method
stringlengths
13
441k
clean_method
stringlengths
7
313k
doc
stringlengths
17
17.3k
comment
stringlengths
3
1.42k
method_name
stringlengths
1
273
extra
dict
imports
list
imports_info
stringlengths
19
34.8k
cluster_imports_info
stringlengths
15
3.66k
libraries
list
libraries_info
stringlengths
6
661
id
int64
0
2.92M
public Location getCurrentLocation() { Location tempLocation = getLastKnownLocation(); if (isBetterLocation(tempLocation, location)) { location = tempLocation; } return location; }
Location function() { Location tempLocation = getLastKnownLocation(); if (isBetterLocation(tempLocation, location)) { location = tempLocation; } return location; }
/** * Gets the current location. Checks if the latest location is better than * the location currently assigned * * @return location The user's current best location. */
Gets the current location. Checks if the latest location is better than the location currently assigned
getCurrentLocation
{ "repo_name": "teamshodan/GeoChan", "path": "GeoChan/src/main/java/com/teamshodan/geochan/helpers/LocationListenerService.java", "license": "apache-2.0", "size": 7094 }
[ "android.location.Location" ]
import android.location.Location;
import android.location.*;
[ "android.location" ]
android.location;
731,623
protected BigDecimal getRemainderOfFiscalYearEstimatedIncomeForStocks(Security security, HoldingTaxLot holdingTaxLot) { BigDecimal amount = BigDecimal.ZERO; if (ObjectUtils.isNull(security.getIncomeRate()) || security.getIncomeRate().compareTo(BigDecimal.ZERO) == 0) { return amount; } String incomePayFrequency = security.getIncomePayFrequency(); Date nextIncomeDueDate = security.getIncomeNextPayDate(); if (ObjectUtils.isNull(nextIncomeDueDate)) { return amount; } Date fiscalYearEndDate = getFiscalYearEndDate(); // BONDS - rule 4.a if (nextIncomeDueDate.after(fiscalYearEndDate)) { return BigDecimal.ZERO; } int numberOfMonthsRemaing = getNumberOfMonthsRemaining(fiscalYearEndDate, nextIncomeDueDate); if (nextIncomeDueDate.before(fiscalYearEndDate) && numberOfMonthsRemaing < 4) { return BigDecimal.ZERO; } long quartersLeftToFiscalYear = getQuartersLeftToFiscalYear(fiscalYearEndDate); //calculate holding units times security rate.... amount = KEMCalculationRoundingHelper.multiply(holdingTaxLot.getUnits(), security.getIncomeRate(), EndowConstants.Scale.SECURITY_MARKET_VALUE); // now multiply the above amount by 4 to get amount for 4 quarters or for the year... amount = KEMCalculationRoundingHelper.divide(amount, BigDecimal.valueOf(4), EndowConstants.Scale.SECURITY_MARKET_VALUE); //now compute the amount for the quarters remaining in the fiscal year.... amount = KEMCalculationRoundingHelper.multiply(amount, BigDecimal.valueOf(quartersLeftToFiscalYear), EndowConstants.Scale.SECURITY_MARKET_VALUE); return amount; }
BigDecimal function(Security security, HoldingTaxLot holdingTaxLot) { BigDecimal amount = BigDecimal.ZERO; if (ObjectUtils.isNull(security.getIncomeRate()) security.getIncomeRate().compareTo(BigDecimal.ZERO) == 0) { return amount; } String incomePayFrequency = security.getIncomePayFrequency(); Date nextIncomeDueDate = security.getIncomeNextPayDate(); if (ObjectUtils.isNull(nextIncomeDueDate)) { return amount; } Date fiscalYearEndDate = getFiscalYearEndDate(); if (nextIncomeDueDate.after(fiscalYearEndDate)) { return BigDecimal.ZERO; } int numberOfMonthsRemaing = getNumberOfMonthsRemaining(fiscalYearEndDate, nextIncomeDueDate); if (nextIncomeDueDate.before(fiscalYearEndDate) && numberOfMonthsRemaing < 4) { return BigDecimal.ZERO; } long quartersLeftToFiscalYear = getQuartersLeftToFiscalYear(fiscalYearEndDate); amount = KEMCalculationRoundingHelper.multiply(holdingTaxLot.getUnits(), security.getIncomeRate(), EndowConstants.Scale.SECURITY_MARKET_VALUE); amount = KEMCalculationRoundingHelper.divide(amount, BigDecimal.valueOf(4), EndowConstants.Scale.SECURITY_MARKET_VALUE); amount = KEMCalculationRoundingHelper.multiply(amount, BigDecimal.valueOf(quartersLeftToFiscalYear), EndowConstants.Scale.SECURITY_MARKET_VALUE); return amount; }
/** * calculates the remainder of fiscal year estimated income for stocks * * @param security * @param holdingTaxLot * @return amount */
calculates the remainder of fiscal year estimated income for stocks
getRemainderOfFiscalYearEstimatedIncomeForStocks
{ "repo_name": "ua-eas/ua-kfs-5.3", "path": "work/src/org/kuali/kfs/module/endow/document/service/impl/CurrentTaxLotServiceImpl.java", "license": "agpl-3.0", "size": 51572 }
[ "java.math.BigDecimal", "java.util.Date", "org.kuali.kfs.module.endow.EndowConstants", "org.kuali.kfs.module.endow.businessobject.HoldingTaxLot", "org.kuali.kfs.module.endow.businessobject.Security", "org.kuali.kfs.module.endow.util.KEMCalculationRoundingHelper", "org.kuali.rice.krad.util.ObjectUtils" ]
import java.math.BigDecimal; import java.util.Date; import org.kuali.kfs.module.endow.EndowConstants; import org.kuali.kfs.module.endow.businessobject.HoldingTaxLot; import org.kuali.kfs.module.endow.businessobject.Security; import org.kuali.kfs.module.endow.util.KEMCalculationRoundingHelper; import org.kuali.rice.krad.util.ObjectUtils;
import java.math.*; import java.util.*; import org.kuali.kfs.module.endow.*; import org.kuali.kfs.module.endow.businessobject.*; import org.kuali.kfs.module.endow.util.*; import org.kuali.rice.krad.util.*;
[ "java.math", "java.util", "org.kuali.kfs", "org.kuali.rice" ]
java.math; java.util; org.kuali.kfs; org.kuali.rice;
2,766,835
public static BigInteger decodeBigInteger(String value) throws Base64DecodingException { return new BigInteger(Base64Coder.decodeWebSafe(value)); }
static BigInteger function(String value) throws Base64DecodingException { return new BigInteger(Base64Coder.decodeWebSafe(value)); }
/** * Web safe Base64-decode a BigInteger. */
Web safe Base64-decode a BigInteger
decodeBigInteger
{ "repo_name": "frewsxcv/keyczar", "path": "java/code/src/org/keyczar/util/Util.java", "license": "apache-2.0", "size": 14671 }
[ "java.math.BigInteger", "org.keyczar.exceptions.Base64DecodingException" ]
import java.math.BigInteger; import org.keyczar.exceptions.Base64DecodingException;
import java.math.*; import org.keyczar.exceptions.*;
[ "java.math", "org.keyczar.exceptions" ]
java.math; org.keyczar.exceptions;
1,153,722
@Override public void purge() { long createTime = System.currentTimeMillis() - timeToLive; for (Entry<String, Long> entry : appendersUsage.entrySet()) { if (entry.getValue() < createTime) { LOGGER.debug("Removing appender " + entry.getKey()); appendersUsage.remove(entry.getKey()); routingAppender.deleteAppender(entry.getKey()); } } }
void function() { long createTime = System.currentTimeMillis() - timeToLive; for (Entry<String, Long> entry : appendersUsage.entrySet()) { if (entry.getValue() < createTime) { LOGGER.debug(STR + entry.getKey()); appendersUsage.remove(entry.getKey()); routingAppender.deleteAppender(entry.getKey()); } } }
/** * Purging appenders that were not in use specified time */
Purging appenders that were not in use specified time
purge
{ "repo_name": "lburgazzoli/logging-log4j2", "path": "log4j-core/src/main/java/org/apache/logging/log4j/core/appender/routing/IdlePurgePolicy.java", "license": "apache-2.0", "size": 5397 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
2,307,663
@Override public void run() { amIActive = true; if (args.length < 2) { showFeedback("Plugin parameters have not been set properly."); return; } String inputHeader = args[0]; String outputHeader = args[1]; // check to see that the inputHeader and outputHeader are not null. if ((inputHeader == null) || (outputHeader == null)) { showFeedback("One or more of the input parameters have not been set properly."); return; } try { int row, col; double z; int progress, oldProgress = -1; double[] data; final double log2 = 0.301029995663981; WhiteboxRaster inputFile = new WhiteboxRaster(inputHeader, "r"); int rows = inputFile.getNumberRows(); int cols = inputFile.getNumberColumns(); double noData = inputFile.getNoDataValue(); WhiteboxRaster outputFile = new WhiteboxRaster(outputHeader, "rw", inputHeader, WhiteboxRaster.DataType.FLOAT, noData); outputFile.setPreferredPalette(inputFile.getPreferredPalette()); for (row = 0; row < rows; row++) { data = inputFile.getRowValues(row); for (col = 0; col < cols; col++) { z = data[col]; if (z != noData) { outputFile.setValue(row, col, Math.log(z) / log2); } } progress = (int) (100f * row / (rows - 1)); if (progress != oldProgress) { oldProgress = progress; updateProgress((int) progress); if (cancelOp) { cancelOperation(); return; } } } outputFile.addMetadataEntry("Created by the " + getDescriptiveName() + " tool."); outputFile.addMetadataEntry("Created on " + new Date()); // close all of the open Whitebox rasters. inputFile.close(); outputFile.close(); // returning a header file string displays the image. returnData(outputHeader); } catch (OutOfMemoryError oe) { myHost.showFeedback("An out-of-memory error has occurred during operation."); } catch (Exception e) { myHost.showFeedback("An error has occurred during operation. See log file for details."); myHost.logException("Error in " + getDescriptiveName(), e); } finally { updateProgress("Progress: ", 0); // tells the main application that this process is completed. amIActive = false; myHost.pluginComplete(); } }
void function() { amIActive = true; if (args.length < 2) { showFeedback(STR); return; } String inputHeader = args[0]; String outputHeader = args[1]; if ((inputHeader == null) (outputHeader == null)) { showFeedback(STR); return; } try { int row, col; double z; int progress, oldProgress = -1; double[] data; final double log2 = 0.301029995663981; WhiteboxRaster inputFile = new WhiteboxRaster(inputHeader, "r"); int rows = inputFile.getNumberRows(); int cols = inputFile.getNumberColumns(); double noData = inputFile.getNoDataValue(); WhiteboxRaster outputFile = new WhiteboxRaster(outputHeader, "rw", inputHeader, WhiteboxRaster.DataType.FLOAT, noData); outputFile.setPreferredPalette(inputFile.getPreferredPalette()); for (row = 0; row < rows; row++) { data = inputFile.getRowValues(row); for (col = 0; col < cols; col++) { z = data[col]; if (z != noData) { outputFile.setValue(row, col, Math.log(z) / log2); } } progress = (int) (100f * row / (rows - 1)); if (progress != oldProgress) { oldProgress = progress; updateProgress((int) progress); if (cancelOp) { cancelOperation(); return; } } } outputFile.addMetadataEntry(STR + getDescriptiveName() + STR); outputFile.addMetadataEntry(STR + new Date()); inputFile.close(); outputFile.close(); returnData(outputHeader); } catch (OutOfMemoryError oe) { myHost.showFeedback(STR); } catch (Exception e) { myHost.showFeedback(STR); myHost.logException(STR + getDescriptiveName(), e); } finally { updateProgress(STR, 0); amIActive = false; myHost.pluginComplete(); } }
/** * Used to execute this plugin tool. */
Used to execute this plugin tool
run
{ "repo_name": "jblindsay/jblindsay.github.io", "path": "ghrg/Whitebox/WhiteboxGAT-linux/resources/plugins/source_files/Log2.java", "license": "mit", "size": 8570 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
653,622
@Transient @Mutator public void setChildrenInaccessibleReason(Throwable cause, Class<? extends SQLObject> childType, boolean rethrow) throws SQLObjectException { Map<Class<? extends SQLObject>, Throwable> oldVal = new HashMap<Class<? extends SQLObject>, Throwable>(this.childrenInaccessibleReason); this.childrenInaccessibleReason.put(childType, cause); firePropertyChange("childrenInaccessibleReason", oldVal, childrenInaccessibleReason); setPopulated(true); if (rethrow) { if (cause instanceof SQLObjectException) { throw (SQLObjectException) cause; } else if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw new SQLObjectException(cause); } } }
@Transient void function(Throwable cause, Class<? extends SQLObject> childType, boolean rethrow) throws SQLObjectException { Map<Class<? extends SQLObject>, Throwable> oldVal = new HashMap<Class<? extends SQLObject>, Throwable>(this.childrenInaccessibleReason); this.childrenInaccessibleReason.put(childType, cause); firePropertyChange(STR, oldVal, childrenInaccessibleReason); setPopulated(true); if (rethrow) { if (cause instanceof SQLObjectException) { throw (SQLObjectException) cause; } else if (cause instanceof RuntimeException) { throw (RuntimeException) cause; } else { throw new SQLObjectException(cause); } } }
/** * This setter will take in a Throwable to set the inaccessible reason to, * for things like copy methods. See {@link SQLObject#childrenInaccessibleReason}; * * @param cause * The throwable that made the children of this object * inaccessible * @param childType * The type of child that is inaccessible. Can be * {@link SQLObject} if the exception covers all of the children. * @param rethrow * Decides if the cause should be rethrown wrapped in a * SQLObjectException. Set this to true to have the exception be * rethrown. */
This setter will take in a Throwable to set the inaccessible reason to, for things like copy methods. See <code>SQLObject#childrenInaccessibleReason</code>
setChildrenInaccessibleReason
{ "repo_name": "malikoski/sqlpower-library", "path": "src/main/java/ca/sqlpower/sqlobject/SQLObject.java", "license": "gpl-3.0", "size": 32922 }
[ "ca.sqlpower.object.annotation.Transient", "java.util.HashMap", "java.util.Map" ]
import ca.sqlpower.object.annotation.Transient; import java.util.HashMap; import java.util.Map;
import ca.sqlpower.object.annotation.*; import java.util.*;
[ "ca.sqlpower.object", "java.util" ]
ca.sqlpower.object; java.util;
151,781
@Test public void testBuildEmptyResultSetWithEmptyColumnOrdering() throws Exception { // Given Table table = buildTable(); String query = "select column from table"; ResultSet resultSet = mock(ResultSet.class); given(resultSet.findColumn("Column")).willReturn(1); given(sqlDialect.convertStatementToSQL(any(SelectStatement.class))).willReturn(query); given(statement.executeQuery(query)).willReturn(resultSet); // When @SuppressWarnings("resource") ResultSetIterator resultSetIterator = new ResultSetIterator(table, Lists.newArrayList(), connection, sqlDialect); // Then assertFalse(resultSetIterator.hasNext()); verify(resultSet).close(); verify(statement).close(); }
void function() throws Exception { Table table = buildTable(); String query = STR; ResultSet resultSet = mock(ResultSet.class); given(resultSet.findColumn(STR)).willReturn(1); given(sqlDialect.convertStatementToSQL(any(SelectStatement.class))).willReturn(query); given(statement.executeQuery(query)).willReturn(resultSet); @SuppressWarnings(STR) ResultSetIterator resultSetIterator = new ResultSetIterator(table, Lists.newArrayList(), connection, sqlDialect); assertFalse(resultSetIterator.hasNext()); verify(resultSet).close(); verify(statement).close(); }
/** * Tests building a ResultSetIterator with an empty column ordering that produces an empty result set. * @throws Exception */
Tests building a ResultSetIterator with an empty column ordering that produces an empty result set
testBuildEmptyResultSetWithEmptyColumnOrdering
{ "repo_name": "badgerwithagun/morf", "path": "morf-core/src/test/java/org/alfasoftware/morf/jdbc/TestResultSetIterator.java", "license": "apache-2.0", "size": 7641 }
[ "com.google.common.collect.Lists", "java.sql.ResultSet", "org.alfasoftware.morf.metadata.Table", "org.alfasoftware.morf.sql.SelectStatement", "org.junit.Assert", "org.mockito.BDDMockito", "org.mockito.Mockito" ]
import com.google.common.collect.Lists; import java.sql.ResultSet; import org.alfasoftware.morf.metadata.Table; import org.alfasoftware.morf.sql.SelectStatement; import org.junit.Assert; import org.mockito.BDDMockito; import org.mockito.Mockito;
import com.google.common.collect.*; import java.sql.*; import org.alfasoftware.morf.metadata.*; import org.alfasoftware.morf.sql.*; import org.junit.*; import org.mockito.*;
[ "com.google.common", "java.sql", "org.alfasoftware.morf", "org.junit", "org.mockito" ]
com.google.common; java.sql; org.alfasoftware.morf; org.junit; org.mockito;
575,122
@Override public void enterEveryRule(@NotNull ParserRuleContext ctx) { }
@Override public void enterEveryRule(@NotNull ParserRuleContext ctx) { }
/** * {@inheritDoc} * * <p>The default implementation does nothing.</p> */
The default implementation does nothing
exitVardecl
{ "repo_name": "Corjuh/PoCo-Compiler", "path": "src/com/poco/PoCoParser/PoCoParserBaseListener.java", "license": "lgpl-2.1", "size": 18510 }
[ "org.antlr.v4.runtime.ParserRuleContext", "org.antlr.v4.runtime.misc.NotNull" ]
import org.antlr.v4.runtime.ParserRuleContext; import org.antlr.v4.runtime.misc.NotNull;
import org.antlr.v4.runtime.*; import org.antlr.v4.runtime.misc.*;
[ "org.antlr.v4" ]
org.antlr.v4;
1,869,434
protected void resetGlobalFlags() { DMLScript.STATISTICS = oldStatistics; DMLScript.FORCE_ACCELERATOR = oldForceGPU; DMLScript.USE_ACCELERATOR = oldGPU; DMLScript.STATISTICS_COUNT = DMLOptions.defaultOptions.statsCount; }
void function() { DMLScript.STATISTICS = oldStatistics; DMLScript.FORCE_ACCELERATOR = oldForceGPU; DMLScript.USE_ACCELERATOR = oldGPU; DMLScript.STATISTICS_COUNT = DMLOptions.defaultOptions.statsCount; }
/** * Reset the global flags (for example: statistics, gpu, etc) * post-execution. */
Reset the global flags (for example: statistics, gpu, etc) post-execution
resetGlobalFlags
{ "repo_name": "akchinSTC/systemml", "path": "src/main/java/org/apache/sysml/api/mlcontext/ScriptExecutor.java", "license": "apache-2.0", "size": 23125 }
[ "org.apache.sysml.api.DMLScript" ]
import org.apache.sysml.api.DMLScript;
import org.apache.sysml.api.*;
[ "org.apache.sysml" ]
org.apache.sysml;
535,407
private static void savePgr(DispatchContext dctx, GenericValue pgr) { Map<String, GenericValue> context = UtilMisc.<String, GenericValue>toMap("paymentGatewayResponse", pgr); LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); try { dispatcher.addRollbackService("savePaymentGatewayResponse", context, true); delegator.create(pgr); } catch (GenericEntityException|GenericServiceException ge) { Debug.logError(ge, module); } catch (Exception e) { Debug.logError(e, module); } }
static void function(DispatchContext dctx, GenericValue pgr) { Map<String, GenericValue> context = UtilMisc.<String, GenericValue>toMap(STR, pgr); LocalDispatcher dispatcher = dctx.getDispatcher(); Delegator delegator = dctx.getDelegator(); try { dispatcher.addRollbackService(STR, context, true); delegator.create(pgr); } catch (GenericEntityException GenericServiceException ge) { Debug.logError(ge, module); } catch (Exception e) { Debug.logError(e, module); } }
/** * Saves either a PaymentGatewayResponse or PaymentGatewayRespMsg value and ensures that the value * is persisted even in the event of a rollback. * @param dctx * @param pgr Either a PaymentGatewayResponse or PaymentGatewayRespMsg GenericValue */
Saves either a PaymentGatewayResponse or PaymentGatewayRespMsg value and ensures that the value is persisted even in the event of a rollback
savePgr
{ "repo_name": "rohankarthik/Ofbiz", "path": "applications/accounting/src/main/java/org/apache/ofbiz/accounting/payment/PaymentGatewayServices.java", "license": "apache-2.0", "size": 202137 }
[ "java.util.Map", "org.apache.ofbiz.base.util.Debug", "org.apache.ofbiz.base.util.UtilMisc", "org.apache.ofbiz.entity.Delegator", "org.apache.ofbiz.entity.GenericEntityException", "org.apache.ofbiz.entity.GenericValue", "org.apache.ofbiz.service.DispatchContext", "org.apache.ofbiz.service.GenericServiceException", "org.apache.ofbiz.service.LocalDispatcher" ]
import java.util.Map; import org.apache.ofbiz.base.util.Debug; import org.apache.ofbiz.base.util.UtilMisc; import org.apache.ofbiz.entity.Delegator; import org.apache.ofbiz.entity.GenericEntityException; import org.apache.ofbiz.entity.GenericValue; import org.apache.ofbiz.service.DispatchContext; import org.apache.ofbiz.service.GenericServiceException; import org.apache.ofbiz.service.LocalDispatcher;
import java.util.*; import org.apache.ofbiz.base.util.*; import org.apache.ofbiz.entity.*; import org.apache.ofbiz.service.*;
[ "java.util", "org.apache.ofbiz" ]
java.util; org.apache.ofbiz;
1,985,509
RedisFuture<String> flushallAsync();
RedisFuture<String> flushallAsync();
/** * Remove all keys asynchronously from all databases on all cluster upstream nodes with pipelining. * * @return String simple-string-reply * @see RedisServerAsyncCommands#flushallAsync() * @since 6.0 */
Remove all keys asynchronously from all databases on all cluster upstream nodes with pipelining
flushallAsync
{ "repo_name": "lettuce-io/lettuce-core", "path": "src/main/java/io/lettuce/core/cluster/api/async/RedisAdvancedClusterAsyncCommands.java", "license": "apache-2.0", "size": 16598 }
[ "io.lettuce.core.RedisFuture" ]
import io.lettuce.core.RedisFuture;
import io.lettuce.core.*;
[ "io.lettuce.core" ]
io.lettuce.core;
994,427
public String registerWithGoogle() { if (isPlayServicesInstalled()) { registrationId = Preference.getString(getContext(), Constants.REG_ID); if (registrationId == null) { try { if (cloudMessaging == null) { cloudMessaging = GoogleCloudMessaging.getInstance(getContext()); } registrationId = cloudMessaging.register(getGoogleProjectNumber()); } catch (IOException ex) { Log.e(TAG, "Error while registering with GCM ", ex); clearData(getContext()); displayConnectionError(); } } } else { if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG, "Play services not installed"); } } return registrationId; }
String function() { if (isPlayServicesInstalled()) { registrationId = Preference.getString(getContext(), Constants.REG_ID); if (registrationId == null) { try { if (cloudMessaging == null) { cloudMessaging = GoogleCloudMessaging.getInstance(getContext()); } registrationId = cloudMessaging.register(getGoogleProjectNumber()); } catch (IOException ex) { Log.e(TAG, STR, ex); clearData(getContext()); displayConnectionError(); } } } else { if (Constants.DEBUG_MODE_ENABLED) { Log.d(TAG, STR); } } return registrationId; }
/** * If the devices hasn't been registered before, first register with Google. * Otherwise obtain the registration ID from preferences. * * @return Registration Id return by Google. */
If the devices hasn't been registered before, first register with Google. Otherwise obtain the registration ID from preferences
registerWithGoogle
{ "repo_name": "jelacote/product-mdm", "path": "modules/mobile-agents/android/client/client/src/main/java/org/wso2/emm/agent/GCMRegistrationManager.java", "license": "apache-2.0", "size": 7164 }
[ "android.util.Log", "com.google.android.gms.gcm.GoogleCloudMessaging", "java.io.IOException", "org.wso2.emm.agent.utils.Constants", "org.wso2.emm.agent.utils.Preference" ]
import android.util.Log; import com.google.android.gms.gcm.GoogleCloudMessaging; import java.io.IOException; import org.wso2.emm.agent.utils.Constants; import org.wso2.emm.agent.utils.Preference;
import android.util.*; import com.google.android.gms.gcm.*; import java.io.*; import org.wso2.emm.agent.utils.*;
[ "android.util", "com.google.android", "java.io", "org.wso2.emm" ]
android.util; com.google.android; java.io; org.wso2.emm;
2,125,912
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<Void>, Void> beginDelete( String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName, Context context);
@ServiceMethod(returns = ReturnType.SINGLE) SyncPoller<PollResult<Void>, Void> beginDelete( String locationName, String longTermRetentionServerName, String longTermRetentionDatabaseName, String backupName, Context context);
/** * Deletes a long term retention backup. * * @param locationName The location of the database. * @param longTermRetentionServerName The name of the server. * @param longTermRetentionDatabaseName The name of the database. * @param backupName The backup name. * @param context The context to associate with this operation. * @throws IllegalArgumentException thrown if parameters fail the validation. * @throws com.azure.core.management.exception.ManagementException thrown if the request is rejected by server. * @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent. * @return the completion. */
Deletes a long term retention backup
beginDelete
{ "repo_name": "selvasingh/azure-sdk-for-java", "path": "sdk/resourcemanager/azure-resourcemanager-sql/src/main/java/com/azure/resourcemanager/sql/fluent/LongTermRetentionBackupsClient.java", "license": "mit", "size": 48333 }
[ "com.azure.core.annotation.ReturnType", "com.azure.core.annotation.ServiceMethod", "com.azure.core.management.polling.PollResult", "com.azure.core.util.Context", "com.azure.core.util.polling.SyncPoller" ]
import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.management.polling.PollResult; import com.azure.core.util.Context; import com.azure.core.util.polling.SyncPoller;
import com.azure.core.annotation.*; import com.azure.core.management.polling.*; import com.azure.core.util.*; import com.azure.core.util.polling.*;
[ "com.azure.core" ]
com.azure.core;
1,793,063
@Override public Adapter createSelectionOperationAdapter() { if (selectionOperationItemProvider == null) { selectionOperationItemProvider = new SelectionOperationItemProvider(this); } return selectionOperationItemProvider; } protected SystemOperationItemProvider systemOperationItemProvider;
Adapter function() { if (selectionOperationItemProvider == null) { selectionOperationItemProvider = new SelectionOperationItemProvider(this); } return selectionOperationItemProvider; } protected SystemOperationItemProvider systemOperationItemProvider;
/** * This creates an adapter for a {@link com.odcgroup.t24.enquiry.enquiry.SelectionOperation}. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
This creates an adapter for a <code>com.odcgroup.t24.enquiry.enquiry.SelectionOperation</code>.
createSelectionOperationAdapter
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/t24/core/com.odcgroup.t24.enquiry.model.edit/src/com/odcgroup/t24/enquiry/enquiry/provider/EnquiryItemProviderAdapterFactory.java", "license": "epl-1.0", "size": 78683 }
[ "org.eclipse.emf.common.notify.Adapter" ]
import org.eclipse.emf.common.notify.Adapter;
import org.eclipse.emf.common.notify.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
311,138
@Override public void collided(CollisionObject colObj) { // TODO Auto-generated method stub if (colObj instanceof Projectile) { onHit((Projectile) (colObj)); } }
void function(CollisionObject colObj) { if (colObj instanceof Projectile) { onHit((Projectile) (colObj)); } }
/** * If collided sees a Projectile, then onHit is called. * * @param p */
If collided sees a Projectile, then onHit is called
collided
{ "repo_name": "SuperKaitoKid/MGA", "path": "src/com/mga/logic/Shootable.java", "license": "mit", "size": 1048 }
[ "com.mga.game.engine.CollisionObject" ]
import com.mga.game.engine.CollisionObject;
import com.mga.game.engine.*;
[ "com.mga.game" ]
com.mga.game;
2,493,507
public List listPrimaryKeyFieldNames(Class businessObjectInterfaceClass); /** * This method returns a list of alternate primary keys. This is used when the "real" primary * key is not the only one that can be used. For example, documentType has "documentTypeId" * as its primary key, but the "name" could also be used. * A List of Lists is returned because because there can be component keys: * Ex: * {name, date} * {department, personId}
List function(Class businessObjectInterfaceClass); /** * This method returns a list of alternate primary keys. This is used when the "real" primary * key is not the only one that can be used. For example, documentType has STR * as its primary key, but the "name" could also be used. * A List of Lists is returned because because there can be component keys: * Ex: * {name, date} * {department, personId}
/** * This method returns the list of primary keys for the EBO. * * @param businessObjectInterfaceClass * @return */
This method returns the list of primary keys for the EBO
listPrimaryKeyFieldNames
{ "repo_name": "sbower/kuali-rice-1", "path": "krad/krad-web-framework/src/main/java/org/kuali/rice/krad/service/ModuleService.java", "license": "apache-2.0", "size": 7248 }
[ "java.util.List" ]
import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
609,280
private String replaceMacros(String msg, I_CmsNewsletterRecipient recipient) { CmsMacroResolver resolver = CmsMacroResolver.newInstance(); resolver.addMacro(MACRO_USER_FIRSTNAME, recipient.getFirstname()); resolver.addMacro(MACRO_USER_LASTNAME, recipient.getLastname()); resolver.addMacro(MACRO_USER_FULLNAME, recipient.getFullName()); resolver.addMacro(MACRO_USER_EMAIL, recipient.getEmail()); resolver.addMacro( MACRO_SEND_DATE, DateFormat.getDateTimeInstance().format(new Date(System.currentTimeMillis()))); return resolver.resolveMacros(msg); }
String function(String msg, I_CmsNewsletterRecipient recipient) { CmsMacroResolver resolver = CmsMacroResolver.newInstance(); resolver.addMacro(MACRO_USER_FIRSTNAME, recipient.getFirstname()); resolver.addMacro(MACRO_USER_LASTNAME, recipient.getLastname()); resolver.addMacro(MACRO_USER_FULLNAME, recipient.getFullName()); resolver.addMacro(MACRO_USER_EMAIL, recipient.getEmail()); resolver.addMacro( MACRO_SEND_DATE, DateFormat.getDateTimeInstance().format(new Date(System.currentTimeMillis()))); return resolver.resolveMacros(msg); }
/** * Replaces the macros in the given message.<p> * * @param msg the message in which the macros are replaced * @param recipient the recipient in the message * * @return the message with the macros replaced */
Replaces the macros in the given message
replaceMacros
{ "repo_name": "mediaworx/opencms-core", "path": "src/org/opencms/newsletter/CmsNewsletter.java", "license": "lgpl-2.1", "size": 7358 }
[ "java.text.DateFormat", "java.util.Date", "org.opencms.util.CmsMacroResolver" ]
import java.text.DateFormat; import java.util.Date; import org.opencms.util.CmsMacroResolver;
import java.text.*; import java.util.*; import org.opencms.util.*;
[ "java.text", "java.util", "org.opencms.util" ]
java.text; java.util; org.opencms.util;
2,116,751
public void setContents(List<Block> blocks) { mBlockListView.setContents(blocks); }
void function(List<Block> blocks) { mBlockListView.setContents(blocks); }
/** * Called by the {@link BlocklyController}, setting the list of blocks in the trash. * * @param blocks The trashed blocks. */
Called by the <code>BlocklyController</code>, setting the list of blocks in the trash
setContents
{ "repo_name": "rohlfingt/blockly-android", "path": "blocklylib-core/src/main/java/com/google/blockly/android/TrashFragment.java", "license": "apache-2.0", "size": 7473 }
[ "com.google.blockly.model.Block", "java.util.List" ]
import com.google.blockly.model.Block; import java.util.List;
import com.google.blockly.model.*; import java.util.*;
[ "com.google.blockly", "java.util" ]
com.google.blockly; java.util;
1,233,865
public static void loadTable(Client client, VoltTable t) throws Exception { // ensure table is annotated assert(t.m_extraMetadata != null); // replicated tables if (t.m_extraMetadata.partitionColIndex == -1) { client.callProcedure("@LoadMultipartitionTable", t.m_extraMetadata.name, (byte) 0, t); // using insert here } // partitioned tables else { final AtomicBoolean failed = new AtomicBoolean(false); final CountDownLatch latch = new CountDownLatch(t.getRowCount()); int columns = t.getColumnCount(); String procedureName = t.m_extraMetadata.name.toUpperCase() + ".insert";
static void function(Client client, VoltTable t) throws Exception { assert(t.m_extraMetadata != null); if (t.m_extraMetadata.partitionColIndex == -1) { client.callProcedure(STR, t.m_extraMetadata.name, (byte) 0, t); } else { final AtomicBoolean failed = new AtomicBoolean(false); final CountDownLatch latch = new CountDownLatch(t.getRowCount()); int columns = t.getColumnCount(); String procedureName = t.m_extraMetadata.name.toUpperCase() + STR;
/** * A fairly straighforward loader for tables with metadata and rows. Maybe this could * be faster or have better error messages? Meh. * * @param client Client connected to a VoltDB instance containing a table with same name * and schema as the VoltTable parameter named "t". * @param t A table with extra metadata and presumably some data in it. * @throws Exception */
A fairly straighforward loader for tables with metadata and rows. Maybe this could be faster or have better error messages? Meh
loadTable
{ "repo_name": "simonzhangsm/voltdb", "path": "src/frontend/org/voltdb/TableHelper.java", "license": "agpl-3.0", "size": 62713 }
[ "java.util.concurrent.CountDownLatch", "java.util.concurrent.atomic.AtomicBoolean", "org.voltdb.client.Client" ]
import java.util.concurrent.CountDownLatch; import java.util.concurrent.atomic.AtomicBoolean; import org.voltdb.client.Client;
import java.util.concurrent.*; import java.util.concurrent.atomic.*; import org.voltdb.client.*;
[ "java.util", "org.voltdb.client" ]
java.util; org.voltdb.client;
666,132
public void saveMessageContentToFile(String filename, String foldername) throws KettleException { OutputStream os= null; try { os = KettleVFS.getOutputStream(foldername+(foldername.endsWith("/")?"":"/")+filename, false); getMessage().writeTo(os); updateSavedMessagesCounter(); }catch(Exception e) { throw new KettleException(BaseMessages.getString(PKG, "MailConnection.Error.SavingMessageContent", ""+this.message.getMessageNumber(), filename, foldername),e); }finally { if(os!=null) { try{ os.close();os=null; }catch(Exception e){}; } } }
void function(String filename, String foldername) throws KettleException { OutputStream os= null; try { os = KettleVFS.getOutputStream(foldername+(foldername.endsWith("/")?"":"/STRMailConnection.Error.SavingMessageContentSTR"+this.message.getMessageNumber(), filename, foldername),e); }finally { if(os!=null) { try{ os.close();os=null; }catch(Exception e){}; } } }
/** * Export message content to a filename. * @param filename the target filename * @param foldername the parent folder of filename * @throws KettleException. */
Export message content to a filename
saveMessageContentToFile
{ "repo_name": "jjeb/kettle-trunk", "path": "engine/src/org/pentaho/di/job/entries/getpop/MailConnection.java", "license": "apache-2.0", "size": 39078 }
[ "java.io.OutputStream", "org.pentaho.di.core.exception.KettleException", "org.pentaho.di.core.vfs.KettleVFS" ]
import java.io.OutputStream; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.vfs.KettleVFS;
import java.io.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.vfs.*;
[ "java.io", "org.pentaho.di" ]
java.io; org.pentaho.di;
239,440
public boolean isValidConfigFile() { boolean valueReturn = true; for (StatType typeCurrent : allStatisticsConfig.keySet()) { if (!initGood) { valueReturn = false; } if (!this.isExist(typeCurrent)) { valueReturn = false; } if (!allStatisticsConfig.get(typeCurrent).hasGoodCumulKey()) { valueReturn = false; } if (!allStatisticsConfig.get(typeCurrent).isDateStatKeyExist()) { valueReturn = false; } } return valueReturn; }
boolean function() { boolean valueReturn = true; for (StatType typeCurrent : allStatisticsConfig.keySet()) { if (!initGood) { valueReturn = false; } if (!this.isExist(typeCurrent)) { valueReturn = false; } if (!allStatisticsConfig.get(typeCurrent).hasGoodCumulKey()) { valueReturn = false; } if (!allStatisticsConfig.get(typeCurrent).isDateStatKeyExist()) { valueReturn = false; } } return valueReturn; }
/** * Method declaration * @return * @see */
Method declaration
isValidConfigFile
{ "repo_name": "NicolasEYSSERIC/Silverpeas-Core", "path": "ejb-core/silverstatistics/src/main/java/com/stratelia/silverpeas/silverstatistics/model/StatisticsConfig.java", "license": "agpl-3.0", "size": 10684 }
[ "com.stratelia.silverpeas.silverstatistics.util.StatType" ]
import com.stratelia.silverpeas.silverstatistics.util.StatType;
import com.stratelia.silverpeas.silverstatistics.util.*;
[ "com.stratelia.silverpeas" ]
com.stratelia.silverpeas;
951,196
public void start( PassSupplier passSupplier, Console console ) { if( isAlive() ) { throw new IllegalThreadStateException( "Watcher is already started." ); } this.passSupplier = requireNonNull( passSupplier ); this.console = requireNonNull( console ); passSequence = passSupplier.getPassSequence(); queue = passSupplier.getQueue(); size = new BigDecimal( passSequence.size() ); startTimestamp = System.currentTimeMillis(); start(); }
void function( PassSupplier passSupplier, Console console ) { if( isAlive() ) { throw new IllegalThreadStateException( STR ); } this.passSupplier = requireNonNull( passSupplier ); this.console = requireNonNull( console ); passSequence = passSupplier.getPassSequence(); queue = passSupplier.getQueue(); size = new BigDecimal( passSequence.size() ); startTimestamp = System.currentTimeMillis(); start(); }
/** * Start the Watcher. * * @param passSupplier the PassSupplier * @param console the Console */
Start the Watcher
start
{ "repo_name": "iddqdby/PassCracker", "path": "src/main/java/by/iddqd/passcracker/cli/Watcher.java", "license": "gpl-3.0", "size": 5948 }
[ "by.iddqd.passcracker.sequence.workers.PassSupplier", "java.math.BigDecimal", "java.util.Objects" ]
import by.iddqd.passcracker.sequence.workers.PassSupplier; import java.math.BigDecimal; import java.util.Objects;
import by.iddqd.passcracker.sequence.workers.*; import java.math.*; import java.util.*;
[ "by.iddqd.passcracker", "java.math", "java.util" ]
by.iddqd.passcracker; java.math; java.util;
1,665,603
public void setChannelNameMetalistener(@NonNull ChannelNameMetadataListener listener) { mChannelNameMetadataListener = listener; }
void function(@NonNull ChannelNameMetadataListener listener) { mChannelNameMetadataListener = listener; }
/** * To set a channel name metadata change event. If channel name metadata is changed, it will trigger this listener * * @param listener A listener to listen channel name metadata changed event. */
To set a channel name metadata change event. If channel name metadata is changed, it will trigger this listener
setChannelNameMetalistener
{ "repo_name": "b95505017/StraaS-android-sdk-sample", "path": "MediaCore/src/main/java/io/straas/android/media/demo/widget/StraasPlayerView.java", "license": "apache-2.0", "size": 52213 }
[ "android.support.annotation.NonNull" ]
import android.support.annotation.NonNull;
import android.support.annotation.*;
[ "android.support" ]
android.support;
2,557,444
@Override final MathTransform concatenate(final MathTransform other, final boolean applyOtherFirst, final MathTransformFactory factory) throws FactoryException { if (other instanceof LinearTransform1D) { final LinearTransform1D linear = (LinearTransform1D) other; if (applyOtherFirst) { if (linear.offset == 0 && linear.scale > 0) { return create(base(), transform(linear.scale)); } } else { final double newBase = pow(1 / linear.scale); if (!Double.isNaN(newBase)) { return create(newBase, linear.transform(offset())); } } } else if (other instanceof ExponentialTransform1D) { return ((ExponentialTransform1D) other).concatenateLog(this, !applyOtherFirst); } return super.concatenate(other, applyOtherFirst, factory); }
final MathTransform concatenate(final MathTransform other, final boolean applyOtherFirst, final MathTransformFactory factory) throws FactoryException { if (other instanceof LinearTransform1D) { final LinearTransform1D linear = (LinearTransform1D) other; if (applyOtherFirst) { if (linear.offset == 0 && linear.scale > 0) { return create(base(), transform(linear.scale)); } } else { final double newBase = pow(1 / linear.scale); if (!Double.isNaN(newBase)) { return create(newBase, linear.transform(offset())); } } } else if (other instanceof ExponentialTransform1D) { return ((ExponentialTransform1D) other).concatenateLog(this, !applyOtherFirst); } return super.concatenate(other, applyOtherFirst, factory); }
/** * Concatenates in an optimized way a {@link MathTransform} {@code other} to this * {@code MathTransform}. This implementation can optimize some concatenation with * {@link LinearTransform1D} and {@link ExponentialTransform1D}. * * @param other The math transform to apply. * @param applyOtherFirst {@code true} if the transformation order is {@code other} followed by {@code this}, * or {@code false} if the transformation order is {@code this} followed by {@code other}. * @param factory The factory which is (indirectly) invoking this method, or {@code null} if none. * @return The combined math transform, or {@code null} if no optimized combined transform is available. */
Concatenates in an optimized way a <code>MathTransform</code> other to this MathTransform. This implementation can optimize some concatenation with <code>LinearTransform1D</code> and <code>ExponentialTransform1D</code>
concatenate
{ "repo_name": "desruisseaux/sis", "path": "core/sis-referencing/src/main/java/org/apache/sis/referencing/operation/transform/LogarithmicTransform1D.java", "license": "apache-2.0", "size": 14844 }
[ "org.opengis.referencing.operation.MathTransform", "org.opengis.referencing.operation.MathTransformFactory", "org.opengis.util.FactoryException" ]
import org.opengis.referencing.operation.MathTransform; import org.opengis.referencing.operation.MathTransformFactory; import org.opengis.util.FactoryException;
import org.opengis.referencing.operation.*; import org.opengis.util.*;
[ "org.opengis.referencing", "org.opengis.util" ]
org.opengis.referencing; org.opengis.util;
1,252,552
public void unregisterLoadListener(LoadListener listener) { ThreadUtils.assertOnUiThread(); boolean removed = mLoadListeners.removeObserver(listener); assert removed; }
void function(LoadListener listener) { ThreadUtils.assertOnUiThread(); boolean removed = mLoadListeners.removeObserver(listener); assert removed; }
/** * Unregisters a listener for the callback that indicates that the * TemplateURLService has loaded. */
Unregisters a listener for the callback that indicates that the TemplateURLService has loaded
unregisterLoadListener
{ "repo_name": "CTSRD-SOAAP/chromium-42.0.2311.135", "path": "chrome/android/java/src/org/chromium/chrome/browser/search_engines/TemplateUrlService.java", "license": "bsd-3-clause", "size": 13521 }
[ "org.chromium.base.ThreadUtils" ]
import org.chromium.base.ThreadUtils;
import org.chromium.base.*;
[ "org.chromium.base" ]
org.chromium.base;
490,582
private String autoCorrect(String wrong_word, List<String> correct_list, int percentage) { if(percentage< 0) return null; char[] elements= wrong_word.toCharArray(); double result; LinkedList<String> suggestions= new LinkedList<String>(); String m; for(int i=0; i<correct_list.size(); i++) { m= correct_list.get(i); result= Match(m, elements); if(result>=percentage) suggestions.add(m); } if(suggestions.isEmpty()) return autoCorrect(wrong_word, correct_list, percentage-10); for(String suggestion: suggestions) { if(suggestion.contains(wrong_word) || suggestion.startsWith(wrong_word) || suggestion.endsWith(wrong_word)) return suggestion; } return suggestions.get(0); }
String function(String wrong_word, List<String> correct_list, int percentage) { if(percentage< 0) return null; char[] elements= wrong_word.toCharArray(); double result; LinkedList<String> suggestions= new LinkedList<String>(); String m; for(int i=0; i<correct_list.size(); i++) { m= correct_list.get(i); result= Match(m, elements); if(result>=percentage) suggestions.add(m); } if(suggestions.isEmpty()) return autoCorrect(wrong_word, correct_list, percentage-10); for(String suggestion: suggestions) { if(suggestion.contains(wrong_word) suggestion.startsWith(wrong_word) suggestion.endsWith(wrong_word)) return suggestion; } return suggestions.get(0); }
/** * Attempt to auto-correct given wrong word. * @param wrong_word Incorrect word to replace. * @param correct_list List containing possible replacements. * @param percentage percentage match with replacement. * @return corrected word or null if failed. */
Attempt to auto-correct given wrong word
autoCorrect
{ "repo_name": "kbakhit/RuleSet_Library", "path": "src/com/khaledbakhit/api/rslib/ruleset/DefaultRulSetVerifier.java", "license": "gpl-3.0", "size": 6245 }
[ "java.util.LinkedList", "java.util.List" ]
import java.util.LinkedList; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
2,860,648
@Test public void shouldMeasureLongPath() { String url = "/blog/2017-How-to-mix-a-good-Mojito-without-using-a-cocktail-shaker"; request(url, "text/html", 15 * NS_IN_MS); assertThat(registry.get("http.Path.Invocations", url)).isEqualTo(1); assertThat(registry.get("http.Path.Durations", url)).isEqualTo(15 * NS_IN_MS); }
void function() { String url = STR; request(url, STR, 15 * NS_IN_MS); assertThat(registry.get(STR, url)).isEqualTo(1); assertThat(registry.get(STR, url)).isEqualTo(15 * NS_IN_MS); }
/** * Should measure long path. */
Should measure long path
shouldMeasureLongPath
{ "repo_name": "mevdschee/tqdev-metrics", "path": "metrics-http/src/test/java/com/tqdev/metrics/http/MeasureRequestPathFilterTest.java", "license": "mit", "size": 7908 }
[ "org.assertj.core.api.Assertions" ]
import org.assertj.core.api.Assertions;
import org.assertj.core.api.*;
[ "org.assertj.core" ]
org.assertj.core;
939,818
EReference getModelTurbsimtbs_WrFMTFF();
EReference getModelTurbsimtbs_WrFMTFF();
/** * Returns the meta object for the containment reference '{@link sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getWrFMTFF <em>Wr FMTFF</em>}'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @return the meta object for the containment reference '<em>Wr FMTFF</em>'. * @see sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getWrFMTFF() * @see #getModelTurbsimtbs() * @generated */
Returns the meta object for the containment reference '<code>sc.ndt.editor.turbsimtbs.ModelTurbsimtbs#getWrFMTFF Wr FMTFF</code>'.
getModelTurbsimtbs_WrFMTFF
{ "repo_name": "cooked/NDT", "path": "sc.ndt.editor.turbsim.tbs/src-gen/sc/ndt/editor/turbsimtbs/TurbsimtbsPackage.java", "license": "gpl-3.0", "size": 204585 }
[ "org.eclipse.emf.ecore.EReference" ]
import org.eclipse.emf.ecore.EReference;
import org.eclipse.emf.ecore.*;
[ "org.eclipse.emf" ]
org.eclipse.emf;
786,064
@Nullable public static String getNewBranchNameFromUser(@Nonnull Project project, @Nonnull Collection<GitRepository> repositories, @Nonnull String dialogTitle) { return Messages.showInputDialog(project, "Enter the name of new branch:", dialogTitle, Messages.getQuestionIcon(), "", GitNewBranchNameValidator.newInstance(repositories)); }
static String function(@Nonnull Project project, @Nonnull Collection<GitRepository> repositories, @Nonnull String dialogTitle) { return Messages.showInputDialog(project, STR, dialogTitle, Messages.getQuestionIcon(), "", GitNewBranchNameValidator.newInstance(repositories)); }
/** * Shows a message dialog to enter the name of new branch. * * @return name of new branch or {@code null} if user has cancelled the dialog. */
Shows a message dialog to enter the name of new branch
getNewBranchNameFromUser
{ "repo_name": "consulo/consulo-git", "path": "plugin/src/main/java/git4idea/branch/GitBranchUtil.java", "license": "apache-2.0", "size": 15849 }
[ "com.intellij.openapi.project.Project", "com.intellij.openapi.ui.Messages", "java.util.Collection", "javax.annotation.Nonnull" ]
import com.intellij.openapi.project.Project; import com.intellij.openapi.ui.Messages; import java.util.Collection; import javax.annotation.Nonnull;
import com.intellij.openapi.project.*; import com.intellij.openapi.ui.*; import java.util.*; import javax.annotation.*;
[ "com.intellij.openapi", "java.util", "javax.annotation" ]
com.intellij.openapi; java.util; javax.annotation;
981,917
public boolean checkAccess(String docname, String right) { try { XWikiDocument doc = getXWikiContext().getWiki().getDocument(docname, this.context); return getXWikiContext().getWiki().checkAccess(right, doc, getXWikiContext()); } catch (XWikiException e) { return false; } }
boolean function(String docname, String right) { try { XWikiDocument doc = getXWikiContext().getWiki().getDocument(docname, this.context); return getXWikiContext().getWiki().checkAccess(right, doc, getXWikiContext()); } catch (XWikiException e) { return false; } }
/** * Verify the rights the current user has on a document. If the document requires rights and the user is not * authenticated he will be redirected to the login page. * * @param docname fullname of the document * @param right right to check ("view", "edit", "admin", "delete") * @return true if it exists */
Verify the rights the current user has on a document. If the document requires rights and the user is not authenticated he will be redirected to the login page
checkAccess
{ "repo_name": "xwiki-labs/sankoreorg", "path": "xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/api/XWiki.java", "license": "lgpl-2.1", "size": 124899 }
[ "com.xpn.xwiki.XWikiException", "com.xpn.xwiki.doc.XWikiDocument" ]
import com.xpn.xwiki.XWikiException; import com.xpn.xwiki.doc.XWikiDocument;
import com.xpn.xwiki.*; import com.xpn.xwiki.doc.*;
[ "com.xpn.xwiki" ]
com.xpn.xwiki;
1,650,807
Block updateReplicaUnderRecovery(Block oldBlock, long recoveryId, long newLength) throws IOException;
Block updateReplicaUnderRecovery(Block oldBlock, long recoveryId, long newLength) throws IOException;
/** * Update replica with the new generation stamp and length. */
Update replica with the new generation stamp and length
updateReplicaUnderRecovery
{ "repo_name": "jayantgolhar/Hadoop-0.21.0", "path": "hdfs/src/java/org/apache/hadoop/hdfs/server/protocol/InterDatanodeProtocol.java", "license": "apache-2.0", "size": 2217 }
[ "java.io.IOException", "org.apache.hadoop.hdfs.protocol.Block" ]
import java.io.IOException; import org.apache.hadoop.hdfs.protocol.Block;
import java.io.*; import org.apache.hadoop.hdfs.protocol.*;
[ "java.io", "org.apache.hadoop" ]
java.io; org.apache.hadoop;
1,881,787
protected int read(byte[] buffer) throws IOException { return mTiffStream.read(buffer); }
int function(byte[] buffer) throws IOException { return mTiffStream.read(buffer); }
/** * Equivalent to read(buffer, 0, buffer.length). */
Equivalent to read(buffer, 0, buffer.length)
read
{ "repo_name": "AdeebNqo/Thula", "path": "Thula/src/main/java/com/adeebnqo/Thula/exif/ExifParser.java", "license": "gpl-3.0", "size": 34327 }
[ "java.io.IOException" ]
import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
478,212
filterConversionMap = new HashMap<String, Map<String, String>>(); InputStreamReader inFile = new InputStreamReader(IDMapperBiomart.class.getResource(RESOURCE).openStream()); BufferedReader inBuffer = new BufferedReader(inFile); String line; String trimed; String oldName = null; Map<String, String> oneEntry = new HashMap<String, String>(); String[] dbparts; while ((line = inBuffer.readLine()) != null) { trimed = line.trim(); dbparts = trimed.split("\\t"); if (dbparts[0].equals(oldName) == false) { oneEntry = new HashMap<String, String>(); oldName = dbparts[0]; filterConversionMap.put(oldName, oneEntry); } oneEntry.put(dbparts[1], dbparts[2]); } inFile.close(); inBuffer.close(); }
filterConversionMap = new HashMap<String, Map<String, String>>(); InputStreamReader inFile = new InputStreamReader(IDMapperBiomart.class.getResource(RESOURCE).openStream()); BufferedReader inBuffer = new BufferedReader(inFile); String line; String trimed; String oldName = null; Map<String, String> oneEntry = new HashMap<String, String>(); String[] dbparts; while ((line = inBuffer.readLine()) != null) { trimed = line.trim(); dbparts = trimed.split("\\t"); if (dbparts[0].equals(oldName) == false) { oneEntry = new HashMap<String, String>(); oldName = dbparts[0]; filterConversionMap.put(oldName, oneEntry); } oneEntry.put(dbparts[1], dbparts[2]); } inFile.close(); inBuffer.close(); }
/** * Conversion map from filter to attribute. * @throws IOException if failed to read local resource */
Conversion map from filter to attribute
loadConversionFile
{ "repo_name": "bridgedb/BridgeDb", "path": "org.bridgedb.webservice.biomart/src/org/bridgedb/webservice/biomart/util/BiomartClient.java", "license": "apache-2.0", "size": 7685 }
[ "java.io.BufferedReader", "java.io.InputStreamReader", "java.util.HashMap", "java.util.Map", "org.bridgedb.webservice.biomart.IDMapperBiomart" ]
import java.io.BufferedReader; import java.io.InputStreamReader; import java.util.HashMap; import java.util.Map; import org.bridgedb.webservice.biomart.IDMapperBiomart;
import java.io.*; import java.util.*; import org.bridgedb.webservice.biomart.*;
[ "java.io", "java.util", "org.bridgedb.webservice" ]
java.io; java.util; org.bridgedb.webservice;
536,335
public ProfilePartWriter createFlagCodingPartWriter() { return new NullProfilePartWriter(); }
ProfilePartWriter function() { return new NullProfilePartWriter(); }
/** * Creates an instance of {@link org.esa.snap.dataio.netcdf.metadata.ProfilePartWriter} responsible for writing * {@link org.esa.snap.framework.datamodel.FlagCoding flag coding}. * * @return the {@link org.esa.snap.dataio.netcdf.metadata.ProfilePartWriter} for flag coding */
Creates an instance of <code>org.esa.snap.dataio.netcdf.metadata.ProfilePartWriter</code> responsible for writing <code>org.esa.snap.framework.datamodel.FlagCoding flag coding</code>
createFlagCodingPartWriter
{ "repo_name": "arraydev/snap-engine", "path": "snap-netcdf/src/main/java/org/esa/snap/dataio/netcdf/AbstractNetCdfWriterPlugIn.java", "license": "gpl-3.0", "size": 6808 }
[ "org.esa.snap.dataio.netcdf.metadata.ProfilePartWriter" ]
import org.esa.snap.dataio.netcdf.metadata.ProfilePartWriter;
import org.esa.snap.dataio.netcdf.metadata.*;
[ "org.esa.snap" ]
org.esa.snap;
282,784
void cloneRepository(CloneRepositoryCommand command) throws UnableToCloneRepositoryException;
void cloneRepository(CloneRepositoryCommand command) throws UnableToCloneRepositoryException;
/** * Clones a remote git repository to the local working directory * * @param command A CloneRepositoryCommand containing the needed arguments. * @throws UnableToCloneRepositoryException Thrown if there is an error while cloning the * repository. */
Clones a remote git repository to the local working directory
cloneRepository
{ "repo_name": "reflectoring/coderadar", "path": "coderadar-core/src/main/java/io/reflectoring/coderadar/vcs/port/driver/clone/CloneRepositoryUseCase.java", "license": "mit", "size": 546 }
[ "io.reflectoring.coderadar.vcs.UnableToCloneRepositoryException" ]
import io.reflectoring.coderadar.vcs.UnableToCloneRepositoryException;
import io.reflectoring.coderadar.vcs.*;
[ "io.reflectoring.coderadar" ]
io.reflectoring.coderadar;
69,085
protected HttpRequest createConnectRequest(HttpRoute route, HttpContext context) { // see RFC 2817, section 5.2 and // INTERNET-DRAFT: Tunneling TCP based protocols through // Web proxy servers HttpHost target = route.getTargetHost(); String host = target.getHostName(); int port = target.getPort(); if (port < 0) { Scheme scheme = connManager.getSchemeRegistry(). getScheme(target.getSchemeName()); port = scheme.getDefaultPort(); } StringBuilder buffer = new StringBuilder(host.length() + 6); buffer.append(host); buffer.append(':'); buffer.append(Integer.toString(port)); String authority = buffer.toString(); ProtocolVersion ver = HttpProtocolParams.getVersion(params); HttpRequest req = new BasicHttpRequest ("CONNECT", authority, ver); return req; }
HttpRequest function(HttpRoute route, HttpContext context) { HttpHost target = route.getTargetHost(); String host = target.getHostName(); int port = target.getPort(); if (port < 0) { Scheme scheme = connManager.getSchemeRegistry(). getScheme(target.getSchemeName()); port = scheme.getDefaultPort(); } StringBuilder buffer = new StringBuilder(host.length() + 6); buffer.append(host); buffer.append(':'); buffer.append(Integer.toString(port)); String authority = buffer.toString(); ProtocolVersion ver = HttpProtocolParams.getVersion(params); HttpRequest req = new BasicHttpRequest (STR, authority, ver); return req; }
/** * Creates the CONNECT request for tunnelling. * Called by {@link #createTunnelToTarget createTunnelToTarget}. * * @param route the route to establish * @param context the context for request execution * * @return the CONNECT request for tunnelling */
Creates the CONNECT request for tunnelling. Called by <code>#createTunnelToTarget createTunnelToTarget</code>
createConnectRequest
{ "repo_name": "indashnet/InDashNet.Open.UN2000", "path": "android/external/apache-http/src/org/apache/http/impl/client/DefaultRequestDirector.java", "license": "apache-2.0", "size": 45088 }
[ "org.apache.http.HttpHost", "org.apache.http.HttpRequest", "org.apache.http.ProtocolVersion", "org.apache.http.conn.routing.HttpRoute", "org.apache.http.conn.scheme.Scheme", "org.apache.http.message.BasicHttpRequest", "org.apache.http.params.HttpProtocolParams", "org.apache.http.protocol.HttpContext" ]
import org.apache.http.HttpHost; import org.apache.http.HttpRequest; import org.apache.http.ProtocolVersion; import org.apache.http.conn.routing.HttpRoute; import org.apache.http.conn.scheme.Scheme; import org.apache.http.message.BasicHttpRequest; import org.apache.http.params.HttpProtocolParams; import org.apache.http.protocol.HttpContext;
import org.apache.http.*; import org.apache.http.conn.routing.*; import org.apache.http.conn.scheme.*; import org.apache.http.message.*; import org.apache.http.params.*; import org.apache.http.protocol.*;
[ "org.apache.http" ]
org.apache.http;
2,053,687
public int tightMarshal1(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { Message info = (Message)o; info.beforeMarshall(wireFormat); int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getOriginalDestination(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getOriginalTransactionId(), bs); rc += tightMarshalString1(info.getGroupID(), bs); rc += tightMarshalString1(info.getCorrelationId(), bs); bs.writeBoolean(info.isPersistent()); rc += tightMarshalLong1(wireFormat, info.getExpiration(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getReplyTo(), bs); rc += tightMarshalLong1(wireFormat, info.getTimestamp(), bs); rc += tightMarshalString1(info.getType(), bs); rc += tightMarshalBuffer1(info.getContent(), bs); rc += tightMarshalBuffer1(info.getMarshalledProperties(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDataStructure(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTargetConsumerId(), bs); bs.writeBoolean(info.isCompressed()); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalLong1(wireFormat, info.getArrival(), bs); rc += tightMarshalString1(info.getUserID(), bs); bs.writeBoolean(info.isRecievedByDFBridge()); return rc + 9; }
int function(OpenWireFormat wireFormat, Object o, BooleanStream bs) throws IOException { Message info = (Message)o; info.beforeMarshall(wireFormat); int rc = super.tightMarshal1(wireFormat, o, bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getProducerId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getDestination(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTransactionId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getOriginalDestination(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getMessageId(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getOriginalTransactionId(), bs); rc += tightMarshalString1(info.getGroupID(), bs); rc += tightMarshalString1(info.getCorrelationId(), bs); bs.writeBoolean(info.isPersistent()); rc += tightMarshalLong1(wireFormat, info.getExpiration(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getReplyTo(), bs); rc += tightMarshalLong1(wireFormat, info.getTimestamp(), bs); rc += tightMarshalString1(info.getType(), bs); rc += tightMarshalBuffer1(info.getContent(), bs); rc += tightMarshalBuffer1(info.getMarshalledProperties(), bs); rc += tightMarshalNestedObject1(wireFormat, (DataStructure)info.getDataStructure(), bs); rc += tightMarshalCachedObject1(wireFormat, (DataStructure)info.getTargetConsumerId(), bs); bs.writeBoolean(info.isCompressed()); rc += tightMarshalObjectArray1(wireFormat, info.getBrokerPath(), bs); rc += tightMarshalLong1(wireFormat, info.getArrival(), bs); rc += tightMarshalString1(info.getUserID(), bs); bs.writeBoolean(info.isRecievedByDFBridge()); return rc + 9; }
/** * Write the booleans that this object uses to a BooleanStream */
Write the booleans that this object uses to a BooleanStream
tightMarshal1
{ "repo_name": "jludvice/fabric8", "path": "gateway/gateway-core/src/main/java/io/fabric8/gateway/handlers/detecting/protocol/openwire/codec/v1/MessageMarshaller.java", "license": "apache-2.0", "size": 13805 }
[ "io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.BooleanStream", "io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.OpenWireFormat", "io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure", "io.fabric8.gateway.handlers.detecting.protocol.openwire.command.Message", "java.io.IOException" ]
import io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.BooleanStream; import io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.OpenWireFormat; import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.DataStructure; import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.Message; import java.io.IOException;
import io.fabric8.gateway.handlers.detecting.protocol.openwire.codec.*; import io.fabric8.gateway.handlers.detecting.protocol.openwire.command.*; import java.io.*;
[ "io.fabric8.gateway", "java.io" ]
io.fabric8.gateway; java.io;
66,124
public Date getModifiedDate();
Date function();
/** * Date the folder was last modified. * * @return last modified date */
Date the folder was last modified
getModifiedDate
{ "repo_name": "nate-rcl/irplus", "path": "file_db/src/edu/ur/file/db/FolderInfo.java", "license": "apache-2.0", "size": 2079 }
[ "java.util.Date" ]
import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
2,874,766
public static boolean isPointOnScreen(Point p) { GraphicsDevice[] screens = GraphicsEnvironment .getLocalGraphicsEnvironment().getScreenDevices(); for (GraphicsDevice screen : screens) { if (screen.getDefaultConfiguration().getBounds().contains(p)) { return true; } } return false; }
static boolean function(Point p) { GraphicsDevice[] screens = GraphicsEnvironment .getLocalGraphicsEnvironment().getScreenDevices(); for (GraphicsDevice screen : screens) { if (screen.getDefaultConfiguration().getBounds().contains(p)) { return true; } } return false; }
/** * Checks if the given {@code Point} is on a screen. * * @param p The {@code Point} to check * @return {@code true} if the point is on screen, {@code false} otherwise */
Checks if the given Point is on a screen
isPointOnScreen
{ "repo_name": "partouf/Chatty-Twitch-Client", "path": "src/chatty/gui/GuiUtil.java", "license": "apache-2.0", "size": 8738 }
[ "java.awt.GraphicsDevice", "java.awt.GraphicsEnvironment", "java.awt.Point" ]
import java.awt.GraphicsDevice; import java.awt.GraphicsEnvironment; import java.awt.Point;
import java.awt.*;
[ "java.awt" ]
java.awt;
2,610,406
JavascriptHelperDef.Builder builder = new JavascriptHelperDef.Builder(); builder.setAccess(new DefinitionAccessImpl(AuraContext.Access.PUBLIC)); HelperDef helperDef = builder.build(); assertFalse(helperDef.isLocal()); }
JavascriptHelperDef.Builder builder = new JavascriptHelperDef.Builder(); builder.setAccess(new DefinitionAccessImpl(AuraContext.Access.PUBLIC)); HelperDef helperDef = builder.build(); assertFalse(helperDef.isLocal()); }
/** * Verify JavascriptHelperDef is non-local. */
Verify JavascriptHelperDef is non-local
testIsLocalReturnsFalse
{ "repo_name": "madmax983/aura", "path": "aura-integration-test/src/test/java/org/auraframework/integration/test/helper/JavascriptHelperDefTest.java", "license": "apache-2.0", "size": 2898 }
[ "org.auraframework.def.HelperDef", "org.auraframework.impl.DefinitionAccessImpl", "org.auraframework.impl.javascript.helper.JavascriptHelperDef", "org.auraframework.system.AuraContext" ]
import org.auraframework.def.HelperDef; import org.auraframework.impl.DefinitionAccessImpl; import org.auraframework.impl.javascript.helper.JavascriptHelperDef; import org.auraframework.system.AuraContext;
import org.auraframework.def.*; import org.auraframework.impl.*; import org.auraframework.impl.javascript.helper.*; import org.auraframework.system.*;
[ "org.auraframework.def", "org.auraframework.impl", "org.auraframework.system" ]
org.auraframework.def; org.auraframework.impl; org.auraframework.system;
929,144
private void update(BpmnDiagram diagram, BpmnDiagramDTO data) { diagram.setModeler(data.getModeler()); ConnectorNodeDTO node = data.getConnectorNode(); diagram.setLabel(node.getLabel()); diagram.setConnectorId(node.getConnectorId()); diagram.setDiagramPath(node.getId()); }
void function(BpmnDiagram diagram, BpmnDiagramDTO data) { diagram.setModeler(data.getModeler()); ConnectorNodeDTO node = data.getConnectorNode(); diagram.setLabel(node.getLabel()); diagram.setConnectorId(node.getConnectorId()); diagram.setDiagramPath(node.getId()); }
/** * Update a diagram with the given data * * @param diagram * @param data */
Update a diagram with the given data
update
{ "repo_name": "clintmanning/new-empty", "path": "webapps/cycle/cycle/src/main/java/org/camunda/bpm/cycle/web/service/resource/BpmnDiagramService.java", "license": "apache-2.0", "size": 6061 }
[ "org.camunda.bpm.cycle.entity.BpmnDiagram", "org.camunda.bpm.cycle.web.dto.BpmnDiagramDTO", "org.camunda.bpm.cycle.web.dto.ConnectorNodeDTO" ]
import org.camunda.bpm.cycle.entity.BpmnDiagram; import org.camunda.bpm.cycle.web.dto.BpmnDiagramDTO; import org.camunda.bpm.cycle.web.dto.ConnectorNodeDTO;
import org.camunda.bpm.cycle.entity.*; import org.camunda.bpm.cycle.web.dto.*;
[ "org.camunda.bpm" ]
org.camunda.bpm;
877,265
private void saveAction(NodeRef ruleNodeRef, Rule rule) { // Get the action definition from the rule Action action = rule.getAction(); if (action == null) { throw new RuleServiceException("An action must be specified when defining a rule."); } // Get the current action node reference NodeRef actionNodeRef = null; List<ChildAssociationRef> actions = this.nodeService.getChildAssocs(ruleNodeRef, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION); if (actions.size() == 1) { // We need to check that the action is the same actionNodeRef = actions.get(0).getChildRef(); if (actionNodeRef.getId().equals(action.getId()) == false) { // Delete the old action this.nodeService.deleteNode(actionNodeRef); actionNodeRef = null; } } else if (actions.size() > 1) { throw new RuleServiceException("The rule has become corrupt. More than one action is associated with the rule."); } // Create the new action node reference if (actionNodeRef == null) { actionNodeRef = this.runtimeActionService.createActionNodeRef(action, ruleNodeRef, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION); } // Update the action node this.runtimeActionService.saveActionImpl(actionNodeRef, action); }
void function(NodeRef ruleNodeRef, Rule rule) { Action action = rule.getAction(); if (action == null) { throw new RuleServiceException(STR); } NodeRef actionNodeRef = null; List<ChildAssociationRef> actions = this.nodeService.getChildAssocs(ruleNodeRef, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION); if (actions.size() == 1) { actionNodeRef = actions.get(0).getChildRef(); if (actionNodeRef.getId().equals(action.getId()) == false) { this.nodeService.deleteNode(actionNodeRef); actionNodeRef = null; } } else if (actions.size() > 1) { throw new RuleServiceException(STR); } if (actionNodeRef == null) { actionNodeRef = this.runtimeActionService.createActionNodeRef(action, ruleNodeRef, RuleModel.ASSOC_ACTION, RuleModel.ASSOC_ACTION); } this.runtimeActionService.saveActionImpl(actionNodeRef, action); }
/** * Save the action related to the rule. * * @param ruleNodeRef the node reference representing the rule * @param rule the rule */
Save the action related to the rule
saveAction
{ "repo_name": "loftuxab/community-edition-old", "path": "projects/repository/source/java/org/alfresco/repo/rule/RuleServiceImpl.java", "license": "lgpl-3.0", "size": 59302 }
[ "java.util.List", "org.alfresco.service.cmr.action.Action", "org.alfresco.service.cmr.repository.ChildAssociationRef", "org.alfresco.service.cmr.repository.NodeRef", "org.alfresco.service.cmr.rule.Rule", "org.alfresco.service.cmr.rule.RuleServiceException" ]
import java.util.List; import org.alfresco.service.cmr.action.Action; import org.alfresco.service.cmr.repository.ChildAssociationRef; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.rule.Rule; import org.alfresco.service.cmr.rule.RuleServiceException;
import java.util.*; import org.alfresco.service.cmr.action.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.cmr.rule.*;
[ "java.util", "org.alfresco.service" ]
java.util; org.alfresco.service;
173,341
public Object getDestination(Object link) { Collection con = nsmodel.getFacade().getConnections(link); if (con.size() <= 1) { return null; } MLinkEnd le0 = (MLinkEnd) (con.toArray())[1]; return le0.getInstance(); }
Object function(Object link) { Collection con = nsmodel.getFacade().getConnections(link); if (con.size() <= 1) { return null; } MLinkEnd le0 = (MLinkEnd) (con.toArray())[1]; return le0.getInstance(); }
/** * Returns the destination of a link. The destination of a binary link is * defined as the instance where the second linkend is pointing to via the * association instance. * @param link the given link * @return MInstance the destination of the given link */
Returns the destination of a link. The destination of a binary link is defined as the instance where the second linkend is pointing to via the association instance
getDestination
{ "repo_name": "carvalhomb/tsmells", "path": "sample/argouml/argouml/org/argouml/model/uml/CommonBehaviorHelperImpl.java", "license": "gpl-2.0", "size": 21931 }
[ "java.util.Collection", "ru.novosoft.uml.behavior.common_behavior.MLinkEnd" ]
import java.util.Collection; import ru.novosoft.uml.behavior.common_behavior.MLinkEnd;
import java.util.*; import ru.novosoft.uml.behavior.common_behavior.*;
[ "java.util", "ru.novosoft.uml" ]
java.util; ru.novosoft.uml;
983,220
@Test public void testDelete() throws Exception { myInterceptor.setFailOnSeverity(null); myInterceptor.setAddResponseHeaderOnSeverity(ResultSeverityEnum.INFORMATION); HttpDelete httpDelete = new HttpDelete("http://localhost:" + ourPort + "/Patient/123"); CloseableHttpResponse status = ourClient.getClient().execute(httpDelete); try { ourLog.info("Response was:\n{}", status); assertEquals(204, status.getStatusLine().getStatusCode()); assertThat(status.toString(), not(containsString("X-FHIR-Request-Validation"))); } finally { IOUtils.closeQuietly(status); } }
void function() throws Exception { myInterceptor.setFailOnSeverity(null); myInterceptor.setAddResponseHeaderOnSeverity(ResultSeverityEnum.INFORMATION); HttpDelete httpDelete = new HttpDelete(STRResponse was:\n{}STRX-FHIR-Request-Validation"))); } finally { IOUtils.closeQuietly(status); } }
/** * Test for #345 */
Test for #345
testDelete
{ "repo_name": "aemay2/hapi-fhir", "path": "hapi-fhir-validation/src/test/java/ca/uhn/fhir/rest/server/RequestValidatingInterceptorR4Test.java", "license": "apache-2.0", "size": 25019 }
[ "ca.uhn.fhir.validation.ResultSeverityEnum", "org.apache.commons.io.IOUtils", "org.apache.http.client.methods.HttpDelete" ]
import ca.uhn.fhir.validation.ResultSeverityEnum; import org.apache.commons.io.IOUtils; import org.apache.http.client.methods.HttpDelete;
import ca.uhn.fhir.validation.*; import org.apache.commons.io.*; import org.apache.http.client.methods.*;
[ "ca.uhn.fhir", "org.apache.commons", "org.apache.http" ]
ca.uhn.fhir; org.apache.commons; org.apache.http;
1,801,930
@Nullable private static String getMutatorName(Method method) { Matcher m; if (Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 1 && method.getReturnType() == void.class) { m = MUTATOR.matcher(method.getName()); if (m.matches()) { return getPropertyName(m.group(1)); } } return null; }
static String function(Method method) { Matcher m; if (Modifier.isPublic(method.getModifiers()) && method.getParameterTypes().length == 1 && method.getReturnType() == void.class) { m = MUTATOR.matcher(method.getName()); if (m.matches()) { return getPropertyName(m.group(1)); } } return null; }
/** * Detect whether the given method is an mutator and if so, return the * property name. * * @param method The method * @return The property name, if the method is an mutator */
Detect whether the given method is an mutator and if so, return the property name
getMutatorName
{ "repo_name": "frogocomics/SpongeAPI", "path": "src/main/java/org/spongepowered/api/util/reflect/AccessorFirstStrategy.java", "license": "mit", "size": 6358 }
[ "java.lang.reflect.Method", "java.lang.reflect.Modifier", "java.util.regex.Matcher" ]
import java.lang.reflect.Method; import java.lang.reflect.Modifier; import java.util.regex.Matcher;
import java.lang.reflect.*; import java.util.regex.*;
[ "java.lang", "java.util" ]
java.lang; java.util;
1,817,041
public void testClobberStreamingRS() throws Exception { try { Properties props = new Properties(); props.setProperty("clobberStreamingResults", "true"); Connection clobberConn = getConnectionWithProps(props); Statement clobberStmt = clobberConn.createStatement(); clobberStmt.executeUpdate("DROP TABLE IF EXISTS StreamingClobber"); clobberStmt.executeUpdate("CREATE TABLE StreamingClobber ( DUMMYID INTEGER NOT NULL, DUMMYNAME VARCHAR(32),PRIMARY KEY (DUMMYID) )"); clobberStmt.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (0, NULL)"); clobberStmt.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (1, 'nro 1')"); clobberStmt.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (2, 'nro 2')"); clobberStmt.executeUpdate("INSERT INTO StreamingClobber (DUMMYID, DUMMYNAME) VALUES (3, 'nro 3')"); Statement streamStmt = null; try { streamStmt = clobberConn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); streamStmt.setFetchSize(Integer.MIN_VALUE); this.rs = streamStmt.executeQuery("SELECT DUMMYID, DUMMYNAME FROM StreamingClobber ORDER BY DUMMYID"); this.rs.next(); // This should proceed normally, after the driver clears the input stream ResultSet rs2 = clobberStmt.executeQuery("SHOW VARIABLES"); rs2.next(); this.rs.close(); } finally { if (streamStmt != null) { streamStmt.close(); } } } finally { this.stmt.executeUpdate("DROP TABLE IF EXISTS StreamingClobber"); } }
void function() throws Exception { try { Properties props = new Properties(); props.setProperty(STR, "true"); Connection clobberConn = getConnectionWithProps(props); Statement clobberStmt = clobberConn.createStatement(); clobberStmt.executeUpdate(STR); clobberStmt.executeUpdate(STR); clobberStmt.executeUpdate(STR); clobberStmt.executeUpdate(STR); clobberStmt.executeUpdate(STR); clobberStmt.executeUpdate(STR); Statement streamStmt = null; try { streamStmt = clobberConn.createStatement(java.sql.ResultSet.TYPE_FORWARD_ONLY, java.sql.ResultSet.CONCUR_READ_ONLY); streamStmt.setFetchSize(Integer.MIN_VALUE); this.rs = streamStmt.executeQuery(STR); this.rs.next(); ResultSet rs2 = clobberStmt.executeQuery(STR); rs2.next(); this.rs.close(); } finally { if (streamStmt != null) { streamStmt.close(); } } } finally { this.stmt.executeUpdate(STR); } }
/** * Tests that streaming result sets are registered correctly. * * @throws Exception * if any errors occur */
Tests that streaming result sets are registered correctly
testClobberStreamingRS
{ "repo_name": "ynhic/ProjetoRMI", "path": "mysql-connector-java-5.1.42/src/testsuite/regression/ResultSetRegressionTest.java", "license": "apache-2.0", "size": 216758 }
[ "java.sql.Connection", "java.sql.ResultSet", "java.sql.Statement", "java.util.Properties" ]
import java.sql.Connection; import java.sql.ResultSet; import java.sql.Statement; import java.util.Properties;
import java.sql.*; import java.util.*;
[ "java.sql", "java.util" ]
java.sql; java.util;
2,714,328
protected InputStream getDataStream(Collection<ICompilerProblem> problems) { InputStream inStrm = null; if (swcSource != null) { inStrm = getDataStream(swcSource, problems); } else { IBinaryFileSpecification fileSpec = workspace.getLatestBinaryFileSpecification(source); inStrm = getDataStream(fileSpec, problems); } return inStrm; }
InputStream function(Collection<ICompilerProblem> problems) { InputStream inStrm = null; if (swcSource != null) { inStrm = getDataStream(swcSource, problems); } else { IBinaryFileSpecification fileSpec = workspace.getLatestBinaryFileSpecification(source); inStrm = getDataStream(fileSpec, problems); } return inStrm; }
/** * Get the input stream of the embedded asset * * @param problems The collection of compiler problems to which this method will add problems. * @return resultant stream. null on error */
Get the input stream of the embedded asset
getDataStream
{ "repo_name": "adufilie/flex-falcon", "path": "compiler/src/org/apache/flex/compiler/internal/embedding/transcoders/TranscoderBase.java", "license": "apache-2.0", "size": 11843 }
[ "java.io.InputStream", "java.util.Collection", "org.apache.flex.compiler.filespecs.IBinaryFileSpecification", "org.apache.flex.compiler.problems.ICompilerProblem" ]
import java.io.InputStream; import java.util.Collection; import org.apache.flex.compiler.filespecs.IBinaryFileSpecification; import org.apache.flex.compiler.problems.ICompilerProblem;
import java.io.*; import java.util.*; import org.apache.flex.compiler.filespecs.*; import org.apache.flex.compiler.problems.*;
[ "java.io", "java.util", "org.apache.flex" ]
java.io; java.util; org.apache.flex;
1,229,970
public okhttp3.Call deleteNamespacedIngressCall( String name, String namespace, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { Object localVarPostBody = body; // create path and map variables String localVarPath = "/apis/networking.k8s.io/v1/namespaces/{namespace}/ingresses/{name}" .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())) .replaceAll( "\\{" + "namespace" + "\\}", localVarApiClient.escapeString(namespace.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("pretty", pretty)); } if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair("dryRun", dryRun)); } if (gracePeriodSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("gracePeriodSeconds", gracePeriodSeconds)); } if (orphanDependents != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("orphanDependents", orphanDependents)); } if (propagationPolicy != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair("propagationPolicy", propagationPolicy)); } Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarCookieParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { "application/json", "application/yaml", "application/vnd.kubernetes.protobuf" }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put("Accept", localVarAccept); } final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put("Content-Type", localVarContentType); String[] localVarAuthNames = new String[] {"BearerToken"}; return localVarApiClient.buildCall( localVarPath, "DELETE", localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); }
okhttp3.Call function( String name, String namespace, String pretty, String dryRun, Integer gracePeriodSeconds, Boolean orphanDependents, String propagationPolicy, V1DeleteOptions body, final ApiCallback _callback) throws ApiException { Object localVarPostBody = body; String localVarPath = STR .replaceAll("\\{" + "name" + "\\}", localVarApiClient.escapeString(name.toString())) .replaceAll( "\\{" + STR + "\\}", localVarApiClient.escapeString(namespace.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); List<Pair> localVarCollectionQueryParams = new ArrayList<Pair>(); if (pretty != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, pretty)); } if (dryRun != null) { localVarQueryParams.addAll(localVarApiClient.parameterToPair(STR, dryRun)); } if (gracePeriodSeconds != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, gracePeriodSeconds)); } if (orphanDependents != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, orphanDependents)); } if (propagationPolicy != null) { localVarQueryParams.addAll( localVarApiClient.parameterToPair(STR, propagationPolicy)); } Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, String> localVarCookieParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { STR, STR, STR }; final String localVarAccept = localVarApiClient.selectHeaderAccept(localVarAccepts); if (localVarAccept != null) { localVarHeaderParams.put(STR, localVarAccept); } final String[] localVarContentTypes = {}; final String localVarContentType = localVarApiClient.selectHeaderContentType(localVarContentTypes); localVarHeaderParams.put(STR, localVarContentType); String[] localVarAuthNames = new String[] {STR}; return localVarApiClient.buildCall( localVarPath, STR, localVarQueryParams, localVarCollectionQueryParams, localVarPostBody, localVarHeaderParams, localVarCookieParams, localVarFormParams, localVarAuthNames, _callback); }
/** * Build call for deleteNamespacedIngress * * @param name name of the Ingress (required) * @param namespace object name and auth scope, such as for teams and projects (required) * @param pretty If &#39;true&#39;, then the output is pretty printed. (optional) * @param dryRun When present, indicates that modifications should not be persisted. An invalid or * unrecognized dryRun directive will result in an error response and no further processing of * the request. Valid values are: - All: all dry run stages will be processed (optional) * @param gracePeriodSeconds The duration in seconds before the object should be deleted. Value * must be non-negative integer. The value zero indicates delete immediately. If this value is * nil, the default grace period for the specified type will be used. Defaults to a per object * value if not specified. zero means delete immediately. (optional) * @param orphanDependents Deprecated: please use the PropagationPolicy, this field will be * deprecated in 1.7. Should the dependent objects be orphaned. If true/false, the * \&quot;orphan\&quot; finalizer will be added to/removed from the object&#39;s finalizers * list. Either this field or PropagationPolicy may be set, but not both. (optional) * @param propagationPolicy Whether and how garbage collection will be performed. Either this * field or OrphanDependents may be set, but not both. The default policy is decided by the * existing finalizer set in the metadata.finalizers and the resource-specific default policy. * Acceptable values are: &#39;Orphan&#39; - orphan the dependents; &#39;Background&#39; - * allow the garbage collector to delete the dependents in the background; * &#39;Foreground&#39; - a cascading policy that deletes all dependents in the foreground. * (optional) * @param body (optional) * @param _callback Callback for upload/download progress * @return Call to execute * @throws ApiException If fail to serialize the request body object * @http.response.details * <table summary="Response Details" border="1"> * <tr><td> Status Code </td><td> Description </td><td> Response Headers </td></tr> * <tr><td> 200 </td><td> OK </td><td> - </td></tr> * <tr><td> 202 </td><td> Accepted </td><td> - </td></tr> * <tr><td> 401 </td><td> Unauthorized </td><td> - </td></tr> * </table> */
Build call for deleteNamespacedIngress
deleteNamespacedIngressCall
{ "repo_name": "kubernetes-client/java", "path": "kubernetes/src/main/java/io/kubernetes/client/openapi/apis/NetworkingV1Api.java", "license": "apache-2.0", "size": 477939 }
[ "io.kubernetes.client.openapi.ApiCallback", "io.kubernetes.client.openapi.ApiException", "io.kubernetes.client.openapi.Pair", "io.kubernetes.client.openapi.models.V1DeleteOptions", "java.util.ArrayList", "java.util.HashMap", "java.util.List", "java.util.Map" ]
import io.kubernetes.client.openapi.ApiCallback; import io.kubernetes.client.openapi.ApiException; import io.kubernetes.client.openapi.Pair; import io.kubernetes.client.openapi.models.V1DeleteOptions; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map;
import io.kubernetes.client.openapi.*; import io.kubernetes.client.openapi.models.*; import java.util.*;
[ "io.kubernetes.client", "java.util" ]
io.kubernetes.client; java.util;
852,423
default void relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer) { }
default void relocate(int oldPosition, int newPosition, ByteBuffer oldBuffer, ByteBuffer newBuffer) { }
/** * Same as {@link BufferAggregator#relocate}. */
Same as <code>BufferAggregator#relocate</code>
relocate
{ "repo_name": "deltaprojects/druid", "path": "processing/src/main/java/org/apache/druid/query/aggregation/VectorAggregator.java", "license": "apache-2.0", "size": 3507 }
[ "java.nio.ByteBuffer" ]
import java.nio.ByteBuffer;
import java.nio.*;
[ "java.nio" ]
java.nio;
2,288,224
Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(baseTime); cal.add(Calendar.MONTH, -1); cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTimeInMillis(); }
Calendar cal = Calendar.getInstance(); cal.setTimeInMillis(baseTime); cal.add(Calendar.MONTH, -1); cal.set(Calendar.DAY_OF_MONTH, 1); cal.set(Calendar.HOUR_OF_DAY, 0); cal.set(Calendar.MINUTE, 0); cal.set(Calendar.SECOND, 0); cal.set(Calendar.MILLISECOND, 0); return cal.getTimeInMillis(); }
/** * Returns the date representing the first day of the previous month, 0:00. * * @param baseTime * The base time. Based on it the previous month will be * determined. * @return The long representation of the date for the first day of the * previous month. */
Returns the date representing the first day of the previous month, 0:00
getStartDateOfLastMonth
{ "repo_name": "opetrovski/development", "path": "oscm-billing/javasrc/org/oscm/billingservice/business/calculation/revenue/CostCalculatorProRata.java", "license": "apache-2.0", "size": 10308 }
[ "java.util.Calendar" ]
import java.util.Calendar;
import java.util.*;
[ "java.util" ]
java.util;
428,694
private void loadTBT (String tbtHDF5) { long lastTimePoint = this.getCurrentTimeNano(); tbt = new TagsByTaxaByteHDF5TagGroups (tbtHDF5); System.out.println("Loading TBT HDF5 took " + String.valueOf(this.getTimeSpanSecond(lastTimePoint)) + " seconds"); System.out.println("TBT has " + tbt.getTagCount() + " tags and " + tbt.getTaxaCount() + " taxa\n"); this.redirect(); }
void function (String tbtHDF5) { long lastTimePoint = this.getCurrentTimeNano(); tbt = new TagsByTaxaByteHDF5TagGroups (tbtHDF5); System.out.println(STR + String.valueOf(this.getTimeSpanSecond(lastTimePoint)) + STR); System.out.println(STR + tbt.getTagCount() + STR + tbt.getTaxaCount() + STR); this.redirect(); }
/** * load HDF5 TBT * @param tbtHDF5 */
load HDF5 TBT
loadTBT
{ "repo_name": "yzhnasa/TASSEL-iRods", "path": "src/net/maizegenetics/analysis/gbs/TagAgainstAnchorHypothesis.java", "license": "mit", "size": 28327 }
[ "net.maizegenetics.dna.tag.TagsByTaxaByteHDF5TagGroups" ]
import net.maizegenetics.dna.tag.TagsByTaxaByteHDF5TagGroups;
import net.maizegenetics.dna.tag.*;
[ "net.maizegenetics.dna" ]
net.maizegenetics.dna;
2,121,998
private String convertWithLevel_TIMESTAMP( Object out, Class<?> originClass, Date date ) { String toreturn; toreturn = LoggingConfigurator.enterPattern; toreturn = toreturn.replaceAll( DATE_VAR, new SimpleDateFormat( LoggingConfigurator.datePattern ).format( date ) ); toreturn = toreturn.replaceAll( TIME_VAR, new SimpleDateFormat( LoggingConfigurator.timePattern ).format( date ) ); toreturn = toreturn.replaceAll( METHOD_VAR, ( LoggingConfigurator.classNameFullExpand ? originClass.getName() : originClass.getSimpleName() ) ) + String.valueOf( out ); toreturn += System.lineSeparator(); return toreturn; }
String function( Object out, Class<?> originClass, Date date ) { String toreturn; toreturn = LoggingConfigurator.enterPattern; toreturn = toreturn.replaceAll( DATE_VAR, new SimpleDateFormat( LoggingConfigurator.datePattern ).format( date ) ); toreturn = toreturn.replaceAll( TIME_VAR, new SimpleDateFormat( LoggingConfigurator.timePattern ).format( date ) ); toreturn = toreturn.replaceAll( METHOD_VAR, ( LoggingConfigurator.classNameFullExpand ? originClass.getName() : originClass.getSimpleName() ) ) + String.valueOf( out ); toreturn += System.lineSeparator(); return toreturn; }
/** * This is formatting the output string with level TIMESTAMP * * @param out * The message with variables * @param originClass * The class the message came from * @param date * The date of the message * @return The formatted String */
This is formatting the output string with level TIMESTAMP
convertWithLevel_TIMESTAMP
{ "repo_name": "Thyaris/UtilsPlus", "path": "UtilsPlus/src/com/utilsplus/logging/model/PAppender.java", "license": "mit", "size": 9788 }
[ "com.utilsplus.logging.LoggingConfigurator", "java.text.SimpleDateFormat", "java.util.Date" ]
import com.utilsplus.logging.LoggingConfigurator; import java.text.SimpleDateFormat; import java.util.Date;
import com.utilsplus.logging.*; import java.text.*; import java.util.*;
[ "com.utilsplus.logging", "java.text", "java.util" ]
com.utilsplus.logging; java.text; java.util;
971,500
public static <E> FastList<E> newWithNValues(int size, Function0<E> factory) { FastList<E> newFastList = FastList.newList(size); for (int i = 0; i < size; i++) { newFastList.add(factory.value()); } return newFastList; }
static <E> FastList<E> function(int size, Function0<E> factory) { FastList<E> newFastList = FastList.newList(size); for (int i = 0; i < size; i++) { newFastList.add(factory.value()); } return newFastList; }
/** * Creates a new FastList pre-sized to the specified size filled with default values generated by the specified function. * * @since 3.0 */
Creates a new FastList pre-sized to the specified size filled with default values generated by the specified function
newWithNValues
{ "repo_name": "goldmansachs/gs-collections", "path": "collections/src/main/java/com/gs/collections/impl/list/mutable/FastList.java", "license": "apache-2.0", "size": 45715 }
[ "com.gs.collections.api.block.function.Function0" ]
import com.gs.collections.api.block.function.Function0;
import com.gs.collections.api.block.function.*;
[ "com.gs.collections" ]
com.gs.collections;
873,430
@Override public void loadInput(String name) { // If nothing is specified, load case 6 from inside the plugin IFile inputFile = null; IFile templateFile = project .getFile("PROTEUS_Model_Builder" + System.getProperty("file.separator") + "proteus_template.inp"); // Get the file specified, or some default one if (name == null) { inputFile = project.getFile("PROTEUS_Model_Builder" + System.getProperty("file.separator") + "proteus_model.inp"); } else { inputFile = project.getFile(name); } // Load the components from the file and setup the form logger.info("ProteusModel Message: Loading " + inputFile.getLocation().toOSString()); // Set up the reader to use the template if it exists ITemplatedReader reader = ioService.getTemplatedReader("INIReader"); reader.setCommentString("!"); reader.setAssignmentPattern("\\s\\s\\s+"); if (new File(templateFile.getLocation().toOSString()).exists()) { reader.addTemplateType("PROTEUS", templateFile); reader.setTemplateType("PROTEUS"); } else { System.err .println("PROTEUS Model Warning: Could not find template file! Building " + "the model form with no template."); reader.setTemplateType(null); } // Try to read in the form, and if something went wrong give the user // some information form = reader.read(inputFile); if (form != null) { form.setName(getName()); form.setDescription(getDescription()); form.setId(getId()); form.setItemID(getId()); form.setActionList(actionItems); } else { DataComponent errorComponent = new DataComponent(); errorComponent .setName("Could not find PROTEUS input for model creation!"); errorComponent .setDescription("To load PROTEUS data into the model builder " + "either use the import button, or set your data in a file named " + "proteus_model.inp in ICEFiles/default/PROTEUS_Model_Builder."); form = new Form(); form.addComponent(errorComponent); } }
void function(String name) { IFile inputFile = null; IFile templateFile = project .getFile(STR + System.getProperty(STR) + STR); if (name == null) { inputFile = project.getFile(STR + System.getProperty(STR) + STR); } else { inputFile = project.getFile(name); } logger.info(STR + inputFile.getLocation().toOSString()); ITemplatedReader reader = ioService.getTemplatedReader(STR); reader.setCommentString("!"); reader.setAssignmentPattern(STR); if (new File(templateFile.getLocation().toOSString()).exists()) { reader.addTemplateType(STR, templateFile); reader.setTemplateType(STR); } else { System.err .println(STR + STR); reader.setTemplateType(null); } form = reader.read(inputFile); if (form != null) { form.setName(getName()); form.setDescription(getDescription()); form.setId(getId()); form.setItemID(getId()); form.setActionList(actionItems); } else { DataComponent errorComponent = new DataComponent(); errorComponent .setName(STR); errorComponent .setDescription(STR + STR + STR); form = new Form(); form.addComponent(errorComponent); } }
/** * This operation loads the given example into the Form. * * @param name * The path name of the example file name to load. */
This operation loads the given example into the Form
loadInput
{ "repo_name": "gorindn/ice", "path": "src/org.eclipse.ice.proteus/src/org/eclipse/ice/proteus/PROTEUSModel.java", "license": "epl-1.0", "size": 9566 }
[ "java.io.File", "org.eclipse.core.resources.IFile", "org.eclipse.ice.datastructures.form.DataComponent", "org.eclipse.ice.datastructures.form.Form", "org.eclipse.ice.io.serializable.ITemplatedReader" ]
import java.io.File; import org.eclipse.core.resources.IFile; import org.eclipse.ice.datastructures.form.DataComponent; import org.eclipse.ice.datastructures.form.Form; import org.eclipse.ice.io.serializable.ITemplatedReader;
import java.io.*; import org.eclipse.core.resources.*; import org.eclipse.ice.datastructures.form.*; import org.eclipse.ice.io.serializable.*;
[ "java.io", "org.eclipse.core", "org.eclipse.ice" ]
java.io; org.eclipse.core; org.eclipse.ice;
1,459,521
public void doSave_grade_submission(RunData data) { if (!"POST".equals(data.getRequest().getMethod())) { return; } SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); readGradeForm(data, state, "save"); if (state.getAttribute(STATE_MESSAGE) == null) { grade_submission_option(data, "save"); } } // doSave_grade_submission
void function(RunData data) { if (!"POST".equals(data.getRequest().getMethod())) { return; } SessionState state = ((JetspeedRunData) data).getPortletSessionState(((JetspeedRunData) data).getJs_peid()); readGradeForm(data, state, "save"); if (state.getAttribute(STATE_MESSAGE) == null) { grade_submission_option(data, "save"); } }
/** * Action is to save the grade to submission */
Action is to save the grade to submission
doSave_grade_submission
{ "repo_name": "eemirtekin/Sakai-10.6-TR", "path": "assignment/assignment-tool/tool/src/java/org/sakaiproject/assignment/tool/AssignmentAction.java", "license": "apache-2.0", "size": 631432 }
[ "org.sakaiproject.cheftool.JetspeedRunData", "org.sakaiproject.cheftool.RunData", "org.sakaiproject.event.api.SessionState" ]
import org.sakaiproject.cheftool.JetspeedRunData; import org.sakaiproject.cheftool.RunData; import org.sakaiproject.event.api.SessionState;
import org.sakaiproject.cheftool.*; import org.sakaiproject.event.api.*;
[ "org.sakaiproject.cheftool", "org.sakaiproject.event" ]
org.sakaiproject.cheftool; org.sakaiproject.event;
683,210
public Iterator<Item> getItems() { ArrayList<Item> items = new ArrayList<Item>(); for (int y = 0; y < this.world.length; y++) { for (int x = 0; x < this.world[y].length; x++) { if (world[y][x].hasItem()) { items.add(world[y][x].item); } } } return items.iterator(); }
Iterator<Item> function() { ArrayList<Item> items = new ArrayList<Item>(); for (int y = 0; y < this.world.length; y++) { for (int x = 0; x < this.world[y].length; x++) { if (world[y][x].hasItem()) { items.add(world[y][x].item); } } } return items.iterator(); }
/** * Gets only the items in the world. Creatures not included. * * @return the items in the world */
Gets only the items in the world. Creatures not included
getItems
{ "repo_name": "kapadiamush/Eve-s-Adventure", "path": "src/models/campaign/World.java", "license": "mit", "size": 35669 }
[ "java.util.ArrayList", "java.util.Iterator" ]
import java.util.ArrayList; import java.util.Iterator;
import java.util.*;
[ "java.util" ]
java.util;
2,470,169
public static <K, V> SchemaInfo encodeKeyValueSchemaInfo(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) { return encodeKeyValueSchemaInfo( schemaName, keySchema.getSchemaInfo(), valueSchema.getSchemaInfo(), keyValueEncodingType ); }
static <K, V> SchemaInfo function(String schemaName, Schema<K> keySchema, Schema<V> valueSchema, KeyValueEncodingType keyValueEncodingType) { return encodeKeyValueSchemaInfo( schemaName, keySchema.getSchemaInfo(), valueSchema.getSchemaInfo(), keyValueEncodingType ); }
/** * Encode key & value into schema into a KeyValue schema. * * @param schemaName the final schema name * @param keySchema the key schema * @param valueSchema the value schema * @param keyValueEncodingType the encoding type to encode and decode key value pair * @return the final schema info */
Encode key & value into schema into a KeyValue schema
encodeKeyValueSchemaInfo
{ "repo_name": "merlimat/pulsar", "path": "pulsar-client/src/main/java/org/apache/pulsar/client/impl/schema/KeyValueSchemaInfo.java", "license": "apache-2.0", "size": 9799 }
[ "org.apache.pulsar.client.api.Schema", "org.apache.pulsar.common.schema.KeyValueEncodingType", "org.apache.pulsar.common.schema.SchemaInfo" ]
import org.apache.pulsar.client.api.Schema; import org.apache.pulsar.common.schema.KeyValueEncodingType; import org.apache.pulsar.common.schema.SchemaInfo;
import org.apache.pulsar.client.api.*; import org.apache.pulsar.common.schema.*;
[ "org.apache.pulsar" ]
org.apache.pulsar;
1,315,822
public Map<String, String> getItems() { return m_items; }
Map<String, String> function() { return m_items; }
/** * Returns the items as a map for option values to label text.<p> * * @return the items as a map for option values to label text */
Returns the items as a map for option values to label text
getItems
{ "repo_name": "mediaworx/opencms-core", "path": "src-gwt/org/opencms/gwt/client/ui/input/CmsSelectBox.java", "license": "lgpl-2.1", "size": 12031 }
[ "java.util.Map" ]
import java.util.Map;
import java.util.*;
[ "java.util" ]
java.util;
212,440
public void setRepeatToggleModes(@RepeatModeUtil.RepeatToggleModes int repeatToggleModes) { Assertions.checkStateNotNull(controller); controller.setRepeatToggleModes(repeatToggleModes); }
void function(@RepeatModeUtil.RepeatToggleModes int repeatToggleModes) { Assertions.checkStateNotNull(controller); controller.setRepeatToggleModes(repeatToggleModes); }
/** * Sets which repeat toggle modes are enabled. * * @param repeatToggleModes A set of {@link RepeatModeUtil.RepeatToggleModes}. */
Sets which repeat toggle modes are enabled
setRepeatToggleModes
{ "repo_name": "amzn/exoplayer-amazon-port", "path": "library/ui/src/main/java/com/google/android/exoplayer2/ui/StyledPlayerView.java", "license": "apache-2.0", "size": 65521 }
[ "com.google.android.exoplayer2.util.Assertions", "com.google.android.exoplayer2.util.RepeatModeUtil" ]
import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.RepeatModeUtil;
import com.google.android.exoplayer2.util.*;
[ "com.google.android" ]
com.google.android;
2,598,804
void setViewBounds(RectF viewBounds);
void setViewBounds(RectF viewBounds);
/** * Sets the bounds of the view. * * @param viewBounds the bounds of the view */
Sets the bounds of the view
setViewBounds
{ "repo_name": "biezhihua/FrescoStudy", "path": "samples/zoomable/src/main/java/com/facebook/samples/zoomable/ZoomableController.java", "license": "bsd-3-clause", "size": 2700 }
[ "android.graphics.RectF" ]
import android.graphics.RectF;
import android.graphics.*;
[ "android.graphics" ]
android.graphics;
1,109,408
Class clazz = Reflections.getUserClass(root); return toXml(root, clazz, null); }
Class clazz = Reflections.getUserClass(root); return toXml(root, clazz, null); }
/** * Java Object->Xml without encoding. */
Java Object->Xml without encoding
toXml
{ "repo_name": "quangou365/sub", "path": "subadmin/src/main/java/com/thinkgem/jeesite/common/mapper/JaxbMapper.java", "license": "apache-2.0", "size": 4729 }
[ "com.thinkgem.jeesite.common.utils.Reflections" ]
import com.thinkgem.jeesite.common.utils.Reflections;
import com.thinkgem.jeesite.common.utils.*;
[ "com.thinkgem.jeesite" ]
com.thinkgem.jeesite;
269,970
public double avgConnectedSpanForColumnND(Connections c, int columnIndex) { int[] dimensions = c.getInputDimensions(); int[] connected = c.getColumn(columnIndex).getProximalDendrite().getConnectedSynapsesSparse(c); if(connected == null || connected.length == 0) return 0; int[] maxCoord = new int[c.getInputDimensions().length]; int[] minCoord = new int[c.getInputDimensions().length]; Arrays.fill(maxCoord, -1); Arrays.fill(minCoord, ArrayUtils.max(dimensions)); SparseMatrix<?> inputMatrix = c.getInputMatrix(); for(int i = 0;i < connected.length;i++) { maxCoord = ArrayUtils.maxBetween(maxCoord, inputMatrix.computeCoordinates(connected[i])); minCoord = ArrayUtils.minBetween(minCoord, inputMatrix.computeCoordinates(connected[i])); } return ArrayUtils.average(ArrayUtils.add(ArrayUtils.subtract(maxCoord, minCoord), 1)); }
double function(Connections c, int columnIndex) { int[] dimensions = c.getInputDimensions(); int[] connected = c.getColumn(columnIndex).getProximalDendrite().getConnectedSynapsesSparse(c); if(connected == null connected.length == 0) return 0; int[] maxCoord = new int[c.getInputDimensions().length]; int[] minCoord = new int[c.getInputDimensions().length]; Arrays.fill(maxCoord, -1); Arrays.fill(minCoord, ArrayUtils.max(dimensions)); SparseMatrix<?> inputMatrix = c.getInputMatrix(); for(int i = 0;i < connected.length;i++) { maxCoord = ArrayUtils.maxBetween(maxCoord, inputMatrix.computeCoordinates(connected[i])); minCoord = ArrayUtils.minBetween(minCoord, inputMatrix.computeCoordinates(connected[i])); } return ArrayUtils.average(ArrayUtils.add(ArrayUtils.subtract(maxCoord, minCoord), 1)); }
/** * The range of connectedSynapses per column, averaged for each dimension. * This value is used to calculate the inhibition radius. This variation of * the function supports arbitrary column dimensions. * * @param c the {@link Connections} (spatial pooler memory) * @param columnIndex the current column for which to avg. * @return */
The range of connectedSynapses per column, averaged for each dimension. This value is used to calculate the inhibition radius. This variation of the function supports arbitrary column dimensions
avgConnectedSpanForColumnND
{ "repo_name": "antidata/htm.java.experiments", "path": "src/main/java/org/numenta/nupic/algorithms/SpatialPooler.java", "license": "agpl-3.0", "size": 47678 }
[ "java.util.Arrays", "org.numenta.nupic.Connections", "org.numenta.nupic.util.ArrayUtils", "org.numenta.nupic.util.SparseMatrix" ]
import java.util.Arrays; import org.numenta.nupic.Connections; import org.numenta.nupic.util.ArrayUtils; import org.numenta.nupic.util.SparseMatrix;
import java.util.*; import org.numenta.nupic.*; import org.numenta.nupic.util.*;
[ "java.util", "org.numenta.nupic" ]
java.util; org.numenta.nupic;
2,763,433
public void startup() { IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD | IResourceChangeEvent.POST_CHANGE); JavaCore.addElementChangedListener(this, ElementChangedEvent.POST_CHANGE); }
void function() { IWorkspace workspace = ResourcesPlugin.getWorkspace(); workspace.addResourceChangeListener(this, IResourceChangeEvent.POST_BUILD IResourceChangeEvent.POST_CHANGE); JavaCore.addElementChangedListener(this, ElementChangedEvent.POST_CHANGE); }
/** * Registers this listener on worksapce build events */
Registers this listener on worksapce build events
startup
{ "repo_name": "msbarry/Xtest", "path": "plugins/org.xtest.runner/src/org/xtest/runner/WorkspaceListener.java", "license": "epl-1.0", "size": 4028 }
[ "org.eclipse.core.resources.IResourceChangeEvent", "org.eclipse.core.resources.IWorkspace", "org.eclipse.core.resources.ResourcesPlugin", "org.eclipse.jdt.core.ElementChangedEvent", "org.eclipse.jdt.core.JavaCore" ]
import org.eclipse.core.resources.IResourceChangeEvent; import org.eclipse.core.resources.IWorkspace; import org.eclipse.core.resources.ResourcesPlugin; import org.eclipse.jdt.core.ElementChangedEvent; import org.eclipse.jdt.core.JavaCore;
import org.eclipse.core.resources.*; import org.eclipse.jdt.core.*;
[ "org.eclipse.core", "org.eclipse.jdt" ]
org.eclipse.core; org.eclipse.jdt;
746,636
public void testConstrBigIntegerScaleMathContext() { String a = "1231212478987482988429808779810457634781384756794987"; BigInteger bA = new BigInteger(a); int aScale = 10; int precision = 46; RoundingMode rm = RoundingMode.CEILING; MathContext mc = new MathContext(precision, rm); String res = "1231212478987482988429808779810457634781384757"; int resScale = 4; BigDecimal result = new BigDecimal(bA, aScale, mc); assertEquals("incorrect value", res, result.unscaledValue().toString()); assertEquals("incorrect scale", resScale, result.scale()); }
void function() { String a = STR; BigInteger bA = new BigInteger(a); int aScale = 10; int precision = 46; RoundingMode rm = RoundingMode.CEILING; MathContext mc = new MathContext(precision, rm); String res = STR; int resScale = 4; BigDecimal result = new BigDecimal(bA, aScale, mc); assertEquals(STR, res, result.unscaledValue().toString()); assertEquals(STR, resScale, result.scale()); }
/** * new BigDecimal(BigInteger value, int scale, MathContext) */
new BigDecimal(BigInteger value, int scale, MathContext)
testConstrBigIntegerScaleMathContext
{ "repo_name": "JSDemos/android-sdk-20", "path": "src/org/apache/harmony/tests/java/math/BigDecimalConstructorsTest.java", "license": "apache-2.0", "size": 25724 }
[ "java.math.BigDecimal", "java.math.BigInteger", "java.math.MathContext", "java.math.RoundingMode" ]
import java.math.BigDecimal; import java.math.BigInteger; import java.math.MathContext; import java.math.RoundingMode;
import java.math.*;
[ "java.math" ]
java.math;
2,882,647
public void updateResidentIdP(IdentityProvider identityProvider, String tenantDomain) throws IdentityProviderManagementException { for (IdentityProviderProperty idpProp : identityProvider.getIdpProperties()) { if (StringUtils.equals(idpProp.getName(), IdentityApplicationConstants.SESSION_IDLE_TIME_OUT)) { if (StringUtils.isBlank(idpProp.getValue()) || !StringUtils.isNumeric(idpProp.getValue()) || Integer.parseInt(idpProp.getValue().trim()) <= 0) { throw new IdentityProviderManagementException(IdentityApplicationConstants.SESSION_IDLE_TIME_OUT + " of ResidentIdP should be a numeric value greater than 0 "); } } else if (StringUtils.equals(idpProp.getName(), IdentityApplicationConstants.REMEMBER_ME_TIME_OUT)) { if (StringUtils.isBlank(idpProp.getValue()) || !StringUtils.isNumeric(idpProp.getValue()) || Integer.parseInt(idpProp.getValue().trim()) <= 0) { throw new IdentityProviderManagementException(IdentityApplicationConstants.REMEMBER_ME_TIME_OUT + " of ResidentIdP should be a numeric value greater than 0 "); } } } // invoking the pre listeners Collection<IdentityProviderMgtListener> listeners = IdPManagementServiceComponent.getIdpMgtListeners(); for (IdentityProviderMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPreUpdateResidentIdP(identityProvider, tenantDomain)) { return; } } if (identityProvider.getFederatedAuthenticatorConfigs() == null) { identityProvider.setFederatedAuthenticatorConfigs(new FederatedAuthenticatorConfig[0]); } IdentityProvider currentIdP = IdentityProviderManager.getInstance().getIdPByName( IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME, tenantDomain, true); int tenantId = IdentityTenantUtil.getTenantId(tenantDomain); validateUpdateOfIdPEntityId(currentIdP.getFederatedAuthenticatorConfigs(), identityProvider.getFederatedAuthenticatorConfigs(), tenantId, tenantDomain); dao.updateIdP(identityProvider, currentIdP, tenantId, tenantDomain); // invoking the post listeners for (IdentityProviderMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPostUpdateResidentIdP(identityProvider, tenantDomain)) { return; } } }
void function(IdentityProvider identityProvider, String tenantDomain) throws IdentityProviderManagementException { for (IdentityProviderProperty idpProp : identityProvider.getIdpProperties()) { if (StringUtils.equals(idpProp.getName(), IdentityApplicationConstants.SESSION_IDLE_TIME_OUT)) { if (StringUtils.isBlank(idpProp.getValue()) !StringUtils.isNumeric(idpProp.getValue()) Integer.parseInt(idpProp.getValue().trim()) <= 0) { throw new IdentityProviderManagementException(IdentityApplicationConstants.SESSION_IDLE_TIME_OUT + STR); } } else if (StringUtils.equals(idpProp.getName(), IdentityApplicationConstants.REMEMBER_ME_TIME_OUT)) { if (StringUtils.isBlank(idpProp.getValue()) !StringUtils.isNumeric(idpProp.getValue()) Integer.parseInt(idpProp.getValue().trim()) <= 0) { throw new IdentityProviderManagementException(IdentityApplicationConstants.REMEMBER_ME_TIME_OUT + STR); } } } Collection<IdentityProviderMgtListener> listeners = IdPManagementServiceComponent.getIdpMgtListeners(); for (IdentityProviderMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPreUpdateResidentIdP(identityProvider, tenantDomain)) { return; } } if (identityProvider.getFederatedAuthenticatorConfigs() == null) { identityProvider.setFederatedAuthenticatorConfigs(new FederatedAuthenticatorConfig[0]); } IdentityProvider currentIdP = IdentityProviderManager.getInstance().getIdPByName( IdentityApplicationConstants.RESIDENT_IDP_RESERVED_NAME, tenantDomain, true); int tenantId = IdentityTenantUtil.getTenantId(tenantDomain); validateUpdateOfIdPEntityId(currentIdP.getFederatedAuthenticatorConfigs(), identityProvider.getFederatedAuthenticatorConfigs(), tenantId, tenantDomain); dao.updateIdP(identityProvider, currentIdP, tenantId, tenantDomain); for (IdentityProviderMgtListener listener : listeners) { if (listener.isEnable() && !listener.doPostUpdateResidentIdP(identityProvider, tenantDomain)) { return; } } }
/** * Update Resident Identity provider for a given tenant * * @param identityProvider <code>IdentityProvider</code> * @param tenantDomain Tenant domain whose resident IdP is requested * @throws IdentityProviderManagementException Error when updating Resident Identity Provider */
Update Resident Identity provider for a given tenant
updateResidentIdP
{ "repo_name": "kesavany/carbon-identity", "path": "components/idp-mgt/org.wso2.carbon.idp.mgt/src/main/java/org/wso2/carbon/idp/mgt/IdentityProviderManager.java", "license": "apache-2.0", "size": 73125 }
[ "java.util.Collection", "org.apache.commons.lang.StringUtils", "org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig", "org.wso2.carbon.identity.application.common.model.IdentityProvider", "org.wso2.carbon.identity.application.common.model.IdentityProviderProperty", "org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants", "org.wso2.carbon.identity.core.util.IdentityTenantUtil", "org.wso2.carbon.idp.mgt.internal.IdPManagementServiceComponent", "org.wso2.carbon.idp.mgt.listener.IdentityProviderMgtListener" ]
import java.util.Collection; import org.apache.commons.lang.StringUtils; import org.wso2.carbon.identity.application.common.model.FederatedAuthenticatorConfig; import org.wso2.carbon.identity.application.common.model.IdentityProvider; import org.wso2.carbon.identity.application.common.model.IdentityProviderProperty; import org.wso2.carbon.identity.application.common.util.IdentityApplicationConstants; import org.wso2.carbon.identity.core.util.IdentityTenantUtil; import org.wso2.carbon.idp.mgt.internal.IdPManagementServiceComponent; import org.wso2.carbon.idp.mgt.listener.IdentityProviderMgtListener;
import java.util.*; import org.apache.commons.lang.*; import org.wso2.carbon.identity.application.common.model.*; import org.wso2.carbon.identity.application.common.util.*; import org.wso2.carbon.identity.core.util.*; import org.wso2.carbon.idp.mgt.internal.*; import org.wso2.carbon.idp.mgt.listener.*;
[ "java.util", "org.apache.commons", "org.wso2.carbon" ]
java.util; org.apache.commons; org.wso2.carbon;
2,819,465
public int getMinHeight() { int result = getFigureConstants().getSimpleWidgetDefaultHeight(); Widget root = getWidget().getParent(); while(root != null) { if(root.getTypeName().equals("TableColumn") && PaintUtils.getWidth(getWidget()) > 0) { result += PaintUtils.IMAGE_HEIGHT; break; } root = root.getParent(); } return result; }
int function() { int result = getFigureConstants().getSimpleWidgetDefaultHeight(); Widget root = getWidget().getParent(); while(root != null) { if(root.getTypeName().equals(STR) && PaintUtils.getWidth(getWidget()) > 0) { result += PaintUtils.IMAGE_HEIGHT; break; } root = root.getParent(); } return result; }
/** * Gets the minimum height of the figure. * * @return int The minimum height of the figure */
Gets the minimum height of the figure
getMinHeight
{ "repo_name": "debabratahazra/DS", "path": "designstudio/components/page/ui/com.odcgroup.page.ui/src/main/java/com/odcgroup/page/ui/figure/PasswordField.java", "license": "epl-1.0", "size": 3549 }
[ "com.odcgroup.page.model.Widget", "com.odcgroup.page.ui.edit.PaintUtils" ]
import com.odcgroup.page.model.Widget; import com.odcgroup.page.ui.edit.PaintUtils;
import com.odcgroup.page.model.*; import com.odcgroup.page.ui.edit.*;
[ "com.odcgroup.page" ]
com.odcgroup.page;
2,220,939
public EstatusCuenta getEstatusCuentaById (final Integer id);
EstatusCuenta function (final Integer id);
/** * Represents getEstatusCuentaById * * @param id * @return estatusCuenta * @since Aug 4, 2015 * */
Represents getEstatusCuentaById
getEstatusCuentaById
{ "repo_name": "roar109/pluto", "path": "src/main/java/org/pluto/delegate/CatalogoDelegate.java", "license": "mit", "size": 833 }
[ "org.pluto.model.EstatusCuenta" ]
import org.pluto.model.EstatusCuenta;
import org.pluto.model.*;
[ "org.pluto.model" ]
org.pluto.model;
1,134,460
public Set<MetaData> getMetaData() { return mMetadata; }
Set<MetaData> function() { return mMetadata; }
/** * Returns the List of MetaData objects associated with this Catalog entry object * * @return Set of MetaData objects * @see MetaData */
Returns the List of MetaData objects associated with this Catalog entry object
getMetaData
{ "repo_name": "pegasus-isi/pegasus", "path": "src/edu/isi/pegasus/planner/dax/CatalogType.java", "license": "apache-2.0", "size": 6992 }
[ "java.util.Set" ]
import java.util.Set;
import java.util.*;
[ "java.util" ]
java.util;
1,952,686
public static BigDecimal getNotReserved(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int excludeC_OrderLine_ID) { BigDecimal retValue = BigDecimal.ZERO; String sql = "SELECT SUM(ol.QtyOrdered-ol.QtyDelivered-ol.QtyReserved) " + "FROM C_OrderLine ol" + " INNER JOIN C_Order o ON (ol.C_Order_ID=o.C_Order_ID) " + "WHERE ol.M_Warehouse_ID=?" // #1 // metas: adding table alias "ol" to M_Product_ID to distinguish it from C_Order's M_Product_ID + " AND ol.M_Product_ID=?" // #2 + " AND o.IsSOTrx='Y' AND o.DocStatus='DR'" + " AND ol.QtyOrdered-ol.QtyDelivered-ol.QtyReserved<>0" + " AND ol.C_OrderLine_ID<>?"; if (M_AttributeSetInstance_ID != 0) sql += " AND ol.M_AttributeSetInstance_ID=?"; PreparedStatement pstmt = null; try { pstmt = DB.prepareStatement(sql, ITrx.TRXNAME_None); pstmt.setInt(1, M_Warehouse_ID); pstmt.setInt(2, M_Product_ID); pstmt.setInt(3, excludeC_OrderLine_ID); if (M_AttributeSetInstance_ID != 0) pstmt.setInt(4, M_AttributeSetInstance_ID); ResultSet rs = pstmt.executeQuery(); if (rs.next()) retValue = rs.getBigDecimal(1); rs.close(); pstmt.close(); pstmt = null; } catch (Exception e) { s_log.error(sql, e); } try { if (pstmt != null) pstmt.close(); pstmt = null; } catch (Exception e) { pstmt = null; } if (retValue == null) s_log.debug("-"); else s_log.debug(retValue.toString()); return retValue; } // getNotReserved private static Logger s_log = LogManager.getLogger(MOrderLine.class); public MOrderLine(Properties ctx, int C_OrderLine_ID, String trxName) { super(ctx, C_OrderLine_ID, trxName); if (C_OrderLine_ID == 0) { // setC_Order_ID (0); // setLine (0); // setM_Warehouse_ID (0); // @M_Warehouse_ID@ // setC_BPartner_ID(0); // setC_BPartner_Location_ID (0); // @C_BPartner_Location_ID@ // setC_Currency_ID (0); // @C_Currency_ID@ // setDateOrdered (new Timestamp(System.currentTimeMillis())); // @DateOrdered@ // // setC_Tax_ID (0); // setC_UOM_ID (0); // setFreightAmt(BigDecimal.ZERO); setLineNetAmt(BigDecimal.ZERO); // setPriceEntered(BigDecimal.ZERO); setPriceActual(BigDecimal.ZERO); setPriceLimit(BigDecimal.ZERO); setPriceList(BigDecimal.ZERO); // setM_AttributeSetInstance_ID(0); // setQtyEntered(BigDecimal.ZERO); setQtyOrdered(BigDecimal.ZERO); // 1 setQtyDelivered(BigDecimal.ZERO); setQtyInvoiced(BigDecimal.ZERO); // task 09358: get rid of this; instead, update qtyReserved at one central place // setQtyReserved(BigDecimal.ZERO); // setIsDescription(false); // N setProcessed(false); setLine(0); } } // MOrderLine public MOrderLine(MOrder order) { this(order.getCtx(), 0, order.get_TrxName()); if (order.get_ID() == 0) throw new IllegalArgumentException("Header not saved"); setC_Order_ID(order.getC_Order_ID()); // parent setOrder(order); } // MOrderLine public MOrderLine(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } // MOrderLine private int m_M_PriceList_ID = 0; // private boolean m_IsSOTrx = true; // Product Pricing private MProductPricing m_productPrice = null; private MTax m_tax = null; private Integer m_precision = null; private MProduct m_product = null; private MCharge m_charge = null;
static BigDecimal function(Properties ctx, int M_Warehouse_ID, int M_Product_ID, int M_AttributeSetInstance_ID, int excludeC_OrderLine_ID) { BigDecimal retValue = BigDecimal.ZERO; String sql = STR + STR + STR + STR + STR + STR + STR + STR; if (M_AttributeSetInstance_ID != 0) sql += STR; PreparedStatement pstmt = null; try { pstmt = DB.prepareStatement(sql, ITrx.TRXNAME_None); pstmt.setInt(1, M_Warehouse_ID); pstmt.setInt(2, M_Product_ID); pstmt.setInt(3, excludeC_OrderLine_ID); if (M_AttributeSetInstance_ID != 0) pstmt.setInt(4, M_AttributeSetInstance_ID); ResultSet rs = pstmt.executeQuery(); if (rs.next()) retValue = rs.getBigDecimal(1); rs.close(); pstmt.close(); pstmt = null; } catch (Exception e) { s_log.error(sql, e); } try { if (pstmt != null) pstmt.close(); pstmt = null; } catch (Exception e) { pstmt = null; } if (retValue == null) s_log.debug("-"); else s_log.debug(retValue.toString()); return retValue; } private static Logger s_log = LogManager.getLogger(MOrderLine.class); public MOrderLine(Properties ctx, int C_OrderLine_ID, String trxName) { super(ctx, C_OrderLine_ID, trxName); if (C_OrderLine_ID == 0) { setLineNetAmt(BigDecimal.ZERO); setPriceActual(BigDecimal.ZERO); setPriceLimit(BigDecimal.ZERO); setPriceList(BigDecimal.ZERO); setQtyOrdered(BigDecimal.ZERO); setQtyDelivered(BigDecimal.ZERO); setQtyInvoiced(BigDecimal.ZERO); setProcessed(false); setLine(0); } } public MOrderLine(MOrder order) { this(order.getCtx(), 0, order.get_TrxName()); if (order.get_ID() == 0) throw new IllegalArgumentException(STR); setC_Order_ID(order.getC_Order_ID()); setOrder(order); } public MOrderLine(Properties ctx, ResultSet rs, String trxName) { super(ctx, rs, trxName); } private int m_M_PriceList_ID = 0; private MProductPricing m_productPrice = null; private MTax m_tax = null; private Integer m_precision = null; private MProduct m_product = null; private MCharge m_charge = null;
/** * Get Order Unreserved Qty * * @param ctx context * @param M_Warehouse_ID wh * @param M_Product_ID product * @param M_AttributeSetInstance_ID asi * @param excludeC_OrderLine_ID exclude C_OrderLine_ID * @return Unreserved Qty */
Get Order Unreserved Qty
getNotReserved
{ "repo_name": "klst-com/metasfresh", "path": "de.metas.business/src/main/java-legacy/org/compiere/model/MOrderLine.java", "license": "gpl-2.0", "size": 35666 }
[ "de.metas.logging.LogManager", "java.math.BigDecimal", "java.sql.PreparedStatement", "java.sql.ResultSet", "java.util.Properties", "org.adempiere.ad.trx.api.ITrx", "org.compiere.util.DB", "org.slf4j.Logger" ]
import de.metas.logging.LogManager; import java.math.BigDecimal; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.util.Properties; import org.adempiere.ad.trx.api.ITrx; import org.compiere.util.DB; import org.slf4j.Logger;
import de.metas.logging.*; import java.math.*; import java.sql.*; import java.util.*; import org.adempiere.ad.trx.api.*; import org.compiere.util.*; import org.slf4j.*;
[ "de.metas.logging", "java.math", "java.sql", "java.util", "org.adempiere.ad", "org.compiere.util", "org.slf4j" ]
de.metas.logging; java.math; java.sql; java.util; org.adempiere.ad; org.compiere.util; org.slf4j;
61,998
public void testSetGetUseClientMode() throws Exception { Server server = null; SSLSocket socket = null; try { server = new Server(); socket = createSSLSocket(server.getPort()); socket.setUseClientMode(false); assertFalse("Result does not correspond to expected", socket.getUseClientMode()); socket.setUseClientMode(true); assertTrue("Result does not correspond to expected", socket.getUseClientMode());
void function() throws Exception { Server server = null; SSLSocket socket = null; try { server = new Server(); socket = createSSLSocket(server.getPort()); socket.setUseClientMode(false); assertFalse(STR, socket.getUseClientMode()); socket.setUseClientMode(true); assertTrue(STR, socket.getUseClientMode());
/** * setUseClientMode(boolean mode) method testing. * getUseClientMode() method testing. */
setUseClientMode(boolean mode) method testing. getUseClientMode() method testing
testSetGetUseClientMode
{ "repo_name": "s20121035/rk3288_android5.1_repo", "path": "external/apache-harmony/x-net/src/test/impl/java.injected/org/apache/harmony/xnet/provider/jsse/SSLSocketImplTest.java", "license": "gpl-3.0", "size": 39896 }
[ "javax.net.ssl.SSLSocket" ]
import javax.net.ssl.SSLSocket;
import javax.net.ssl.*;
[ "javax.net" ]
javax.net;
960,061
public void enterPlayerName(int players){ if(players >=6){ Window player6Window = SwingUtilities.windowForComponent(menuItem); JDialog player6Name = new JDialog(player6Window, "Player 6: Enter Name"); player6Name.setLocation(200,250); player6Name.setModal(true); player6Name.pack(); player6Name.setVisible(true); } if(players >= 5){ Window player5Window = SwingUtilities.windowForComponent(menuItem); JDialog player5Name = new JDialog(player5Window, "Player 5: Enter Name"); player5Name.setLocation(200,250); player5Name.setModal(true); player5Name.pack(); player5Name.setVisible(true); } if(players >= 4){ Window player4Window = SwingUtilities.windowForComponent(menuItem); JDialog player4Name = new JDialog(player4Window, "Player 4: Enter Name"); player4Name.setLocation(200,250); player4Name.setModal(true); player4Name.pack(); player4Name.setVisible(true); } if(players >= 3){ Window player3Window = SwingUtilities.windowForComponent(menuItem); JDialog player3Name = new JDialog(player3Window, "Player 3: Enter Name"); player3Name.setLocation(200,250); player3Name.setModal(true); player3Name.pack(); player3Name.setVisible(true); } if(players >= 2){ Window player2Window = SwingUtilities.windowForComponent(menuItem); JDialog player2Name = new JDialog(player2Window, "Player 2: Enter Name"); player2Name.setLocation(200,250); player2Name.setModal(true); player2Name.pack(); player2Name.setVisible(true); } if(players >= 1){ Window player1Window = SwingUtilities.windowForComponent(menuItem); JDialog player1Name = new JDialog(player1Window, "Player 1: Enter Name"); player1Name.setLocation(200,250); player1Name.setModal(true); player1Name.pack(); player1Name.setVisible(true); } }
void function(int players){ if(players >=6){ Window player6Window = SwingUtilities.windowForComponent(menuItem); JDialog player6Name = new JDialog(player6Window, STR); player6Name.setLocation(200,250); player6Name.setModal(true); player6Name.pack(); player6Name.setVisible(true); } if(players >= 5){ Window player5Window = SwingUtilities.windowForComponent(menuItem); JDialog player5Name = new JDialog(player5Window, STR); player5Name.setLocation(200,250); player5Name.setModal(true); player5Name.pack(); player5Name.setVisible(true); } if(players >= 4){ Window player4Window = SwingUtilities.windowForComponent(menuItem); JDialog player4Name = new JDialog(player4Window, STR); player4Name.setLocation(200,250); player4Name.setModal(true); player4Name.pack(); player4Name.setVisible(true); } if(players >= 3){ Window player3Window = SwingUtilities.windowForComponent(menuItem); JDialog player3Name = new JDialog(player3Window, STR); player3Name.setLocation(200,250); player3Name.setModal(true); player3Name.pack(); player3Name.setVisible(true); } if(players >= 2){ Window player2Window = SwingUtilities.windowForComponent(menuItem); JDialog player2Name = new JDialog(player2Window, STR); player2Name.setLocation(200,250); player2Name.setModal(true); player2Name.pack(); player2Name.setVisible(true); } if(players >= 1){ Window player1Window = SwingUtilities.windowForComponent(menuItem); JDialog player1Name = new JDialog(player1Window, STR); player1Name.setLocation(200,250); player1Name.setModal(true); player1Name.pack(); player1Name.setVisible(true); } }
/** * Method which contains logic for setting up the players in the game * @param players - Int describing how many players are to be in the game */
Method which contains logic for setting up the players in the game
enterPlayerName
{ "repo_name": "Sy4z/Cluedo", "path": "src/ui/BoardFrame.java", "license": "mit", "size": 12938 }
[ "java.awt.Window", "javax.swing.JDialog", "javax.swing.SwingUtilities" ]
import java.awt.Window; import javax.swing.JDialog; import javax.swing.SwingUtilities;
import java.awt.*; import javax.swing.*;
[ "java.awt", "javax.swing" ]
java.awt; javax.swing;
1,700,767
private NodeRef createImagesDirectory(RenderingContext context) { // It should be a sibling of the HTML in it's eventual location // (not it's current temporary one!) RenditionLocation location = resolveRenditionLocation( context.getSourceNode(), context.getDefinition(), context.getDestinationNode() ); NodeRef parent = location.getParentRef(); // Figure out what to call it, based on the HTML node String folderName = getImagesDirectoryName(context); // It is already there? // (eg from when the rendition is being re-run) NodeRef imgFolder = nodeService.getChildByName( parent, ContentModel.ASSOC_CONTAINS, folderName ); if(imgFolder != null) return imgFolder; // Create the directory Map<QName,Serializable> properties = new HashMap<QName,Serializable>(); properties.put(ContentModel.PROP_NAME, folderName); imgFolder = nodeService.createNode( parent, ContentModel.ASSOC_CONTAINS, QName.createQName(folderName), ContentModel.TYPE_FOLDER, properties ).getChildRef(); return imgFolder; }
NodeRef function(RenderingContext context) { RenditionLocation location = resolveRenditionLocation( context.getSourceNode(), context.getDefinition(), context.getDestinationNode() ); NodeRef parent = location.getParentRef(); String folderName = getImagesDirectoryName(context); NodeRef imgFolder = nodeService.getChildByName( parent, ContentModel.ASSOC_CONTAINS, folderName ); if(imgFolder != null) return imgFolder; Map<QName,Serializable> properties = new HashMap<QName,Serializable>(); properties.put(ContentModel.PROP_NAME, folderName); imgFolder = nodeService.createNode( parent, ContentModel.ASSOC_CONTAINS, QName.createQName(folderName), ContentModel.TYPE_FOLDER, properties ).getChildRef(); return imgFolder; }
/** * Creates a directory to store the images in. * The directory will be a sibling of the rendered * HTML, and named similar to it. * Note this is only required if {@link #PARAM_IMAGES_SAME_FOLDER} is false (the default). */
Creates a directory to store the images in. The directory will be a sibling of the rendered HTML, and named similar to it. Note this is only required if <code>#PARAM_IMAGES_SAME_FOLDER</code> is false (the default)
createImagesDirectory
{ "repo_name": "Alfresco/community-edition", "path": "projects/repository/source/java/org/alfresco/repo/rendition/executer/HTMLRenderingEngine.java", "license": "lgpl-3.0", "size": 20497 }
[ "java.io.Serializable", "java.util.HashMap", "java.util.Map", "org.alfresco.model.ContentModel", "org.alfresco.repo.rendition.RenditionLocation", "org.alfresco.service.cmr.repository.NodeRef", "org.alfresco.service.namespace.QName" ]
import java.io.Serializable; import java.util.HashMap; import java.util.Map; import org.alfresco.model.ContentModel; import org.alfresco.repo.rendition.RenditionLocation; import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.namespace.QName;
import java.io.*; import java.util.*; import org.alfresco.model.*; import org.alfresco.repo.rendition.*; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.namespace.*;
[ "java.io", "java.util", "org.alfresco.model", "org.alfresco.repo", "org.alfresco.service" ]
java.io; java.util; org.alfresco.model; org.alfresco.repo; org.alfresco.service;
1,106,993
static void setWorkOutputPath(JobConf conf, Path outputDir) { outputDir = new Path(conf.getWorkingDirectory(), outputDir); conf.set("mapred.work.output.dir", outputDir.toString()); }
static void setWorkOutputPath(JobConf conf, Path outputDir) { outputDir = new Path(conf.getWorkingDirectory(), outputDir); conf.set(STR, outputDir.toString()); }
/** * Set the {@link Path} of the task's temporary output directory * for the map-reduce job. * * <p><i>Note</i>: Task output path is set by the framework. * </p> * @param conf The configuration of the job. * @param outputDir the {@link Path} of the output directory * for the map-reduce job. */
Set the <code>Path</code> of the task's temporary output directory for the map-reduce job. Note: Task output path is set by the framework.
setWorkOutputPath
{ "repo_name": "sbyoun/i-mapreduce", "path": "src/mapred/org/apache/hadoop/mapred/FileOutputFormat.java", "license": "apache-2.0", "size": 12129 }
[ "org.apache.hadoop.fs.Path" ]
import org.apache.hadoop.fs.Path;
import org.apache.hadoop.fs.*;
[ "org.apache.hadoop" ]
org.apache.hadoop;
1,192,173
public static boolean addSmiles(Context context, Spannable spannable) { boolean hasChanges = false; for (Map.Entry<Pattern, Integer> entry : emoticons.entrySet()) { Matcher matcher = entry.getKey().matcher(spannable); while (matcher.find()) { boolean set = true; for (ImageSpan span : spannable.getSpans(matcher.start(), matcher.end(), ImageSpan.class)) if (spannable.getSpanStart(span) >= matcher.start() && spannable.getSpanEnd(span) <= matcher.end()) spannable.removeSpan(span); else { set = false; break; } if (set) { hasChanges = true; spannable.setSpan(new ImageSpan(context, entry.getValue()), matcher.start(), matcher.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } } } return hasChanges; }
static boolean function(Context context, Spannable spannable) { boolean hasChanges = false; for (Map.Entry<Pattern, Integer> entry : emoticons.entrySet()) { Matcher matcher = entry.getKey().matcher(spannable); while (matcher.find()) { boolean set = true; for (ImageSpan span : spannable.getSpans(matcher.start(), matcher.end(), ImageSpan.class)) if (spannable.getSpanStart(span) >= matcher.start() && spannable.getSpanEnd(span) <= matcher.end()) spannable.removeSpan(span); else { set = false; break; } if (set) { hasChanges = true; spannable.setSpan(new ImageSpan(context, entry.getValue()), matcher.start(), matcher.end(), Spannable.SPAN_EXCLUSIVE_EXCLUSIVE); } } } return hasChanges; }
/** * replace existing spannable with smiles * @param context * @param spannable * @return */
replace existing spannable with smiles
addSmiles
{ "repo_name": "penneryu/penneryu-android", "path": "app/src/main/java/com/penner/android/util/SmileUtils.java", "license": "apache-2.0", "size": 3508 }
[ "android.content.Context", "android.text.Spannable", "android.text.style.ImageSpan", "java.util.Map", "java.util.regex.Matcher", "java.util.regex.Pattern" ]
import android.content.Context; import android.text.Spannable; import android.text.style.ImageSpan; import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern;
import android.content.*; import android.text.*; import android.text.style.*; import java.util.*; import java.util.regex.*;
[ "android.content", "android.text", "java.util" ]
android.content; android.text; java.util;
905,972
public boolean validateMessage_noCrossingMessages(Message message, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate (RamPackage.Literals.MESSAGE, message, diagnostics, context, "http://www.eclipse.org/emf/2002/Ecore/OCL/Pivot", "noCrossingMessages", MESSAGE__NO_CROSSING_MESSAGES__EEXPRESSION, Diagnostic.ERROR, DIAGNOSTIC_SOURCE, 0); } protected static final String MESSAGE__DELETE_MESSAGE_IS_LAST__EEXPRESSION = "if self.messageSort = MessageSort::deleteMessage then if not self.receiveEvent.oclIsUndefined() and not self.receiveEvent.oclAsType(InteractionFragment).covered->isEmpty() then let event : InteractionFragment = self.receiveEvent.oclAsType(InteractionFragment) in event.covered->asOrderedSet()->at(1).coveredBy->forAll(fragment : InteractionFragment | if event.container.fragments->includes(fragment) then event.container.fragments->indexOf(fragment) <= event.container.fragments->indexOf(event) else true endif) else true endif else true endif";
boolean function(Message message, DiagnosticChain diagnostics, Map<Object, Object> context) { return validate (RamPackage.Literals.MESSAGE, message, diagnostics, context, STRnoCrossingMessagesSTRif self.messageSort = MessageSort::deleteMessage then if not self.receiveEvent.oclIsUndefined() and not self.receiveEvent.oclAsType(InteractionFragment).covered->isEmpty() then let event : InteractionFragment = self.receiveEvent.oclAsType(InteractionFragment) in event.covered->asOrderedSet()->at(1).coveredBy->forAll(fragment : InteractionFragment if event.container.fragments->includes(fragment) then event.container.fragments->indexOf(fragment) <= event.container.fragments->indexOf(event) else true endif) else true endif else true endif";
/** * Validates the noCrossingMessages constraint of '<em>Message</em>'. * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */
Validates the noCrossingMessages constraint of 'Message'.
validateMessage_noCrossingMessages
{ "repo_name": "mjorod/textram", "path": "tool/ca.mcgill.sel.ram/src/ca/mcgill/cs/sel/ram/util/RamValidator.java", "license": "mit", "size": 148232 }
[ "ca.mcgill.cs.sel.ram.InteractionFragment", "ca.mcgill.cs.sel.ram.Message", "ca.mcgill.cs.sel.ram.MessageSort", "ca.mcgill.cs.sel.ram.RamPackage", "java.util.Map", "org.eclipse.emf.common.util.DiagnosticChain" ]
import ca.mcgill.cs.sel.ram.InteractionFragment; import ca.mcgill.cs.sel.ram.Message; import ca.mcgill.cs.sel.ram.MessageSort; import ca.mcgill.cs.sel.ram.RamPackage; import java.util.Map; import org.eclipse.emf.common.util.DiagnosticChain;
import ca.mcgill.cs.sel.ram.*; import java.util.*; import org.eclipse.emf.common.util.*;
[ "ca.mcgill.cs", "java.util", "org.eclipse.emf" ]
ca.mcgill.cs; java.util; org.eclipse.emf;
737,937
public void testGenerateBase64CRL() throws Exception { CertificateFactory factory = CertificateFactory.getInstance("X.509"); ByteArrayInputStream bais; for (int i=0; i<good.length; i++) { bais = new ByteArrayInputStream( (good[i][0] + x509crl + good[i][1]).getBytes("UTF-8")); X509CRL crl = (X509CRL) factory.generateCRL(bais); assertNotNull("Factory returned null on correct data", crl); if (publicKey != null) { // verify the signatures crl.verify(publicKey); } } for (int i=0; i<bad_content.length; i++) { bais = new ByteArrayInputStream( (good[0][0] + bad_content[i] + good[0][1]).getBytes("UTF-8")); try { factory.generateCRL(bais); fail("Expected exception was not thrown"); } catch (Exception e) { // e.printStackTrace(); } } for (int i=0; i<bad.length; i++) { bais = new ByteArrayInputStream( (bad[i][0] + x509crl + bad[i][1]).getBytes("UTF-8")); try { factory.generateCRL(bais); fail("Expected exception was not thrown"); } catch (Exception e) { } } }
void function() throws Exception { CertificateFactory factory = CertificateFactory.getInstance("X.509"); ByteArrayInputStream bais; for (int i=0; i<good.length; i++) { bais = new ByteArrayInputStream( (good[i][0] + x509crl + good[i][1]).getBytes("UTF-8")); X509CRL crl = (X509CRL) factory.generateCRL(bais); assertNotNull(STR, crl); if (publicKey != null) { crl.verify(publicKey); } } for (int i=0; i<bad_content.length; i++) { bais = new ByteArrayInputStream( (good[0][0] + bad_content[i] + good[0][1]).getBytes("UTF-8")); try { factory.generateCRL(bais); fail(STR); } catch (Exception e) { } } for (int i=0; i<bad.length; i++) { bais = new ByteArrayInputStream( (bad[i][0] + x509crl + bad[i][1]).getBytes("UTF-8")); try { factory.generateCRL(bais); fail(STR); } catch (Exception e) { } } }
/** * Generates CRLs on the base of PEM encoding. */
Generates CRLs on the base of PEM encoding
testGenerateBase64CRL
{ "repo_name": "rex-xxx/mt6572_x201", "path": "external/apache-harmony/security/src/test/impl/java/org/apache/harmony/security/tests/java/security/cert/CertificateFactory_ImplTest.java", "license": "gpl-2.0", "size": 34378 }
[ "java.io.ByteArrayInputStream", "java.security.cert.CertificateFactory" ]
import java.io.ByteArrayInputStream; import java.security.cert.CertificateFactory;
import java.io.*; import java.security.cert.*;
[ "java.io", "java.security" ]
java.io; java.security;
429,827
private static Class<? extends Test> getTestClass(String className) { if (!className.endsWith(TEST_CLASS_SUFFIX)) { return null; } Class<?> clazz; try { clazz = Class.forName(className); } catch (ClassNotFoundException e) { return null; } catch (NoClassDefFoundError e) { return null; } int mods = clazz.getModifiers(); if (!Modifier.isPublic(mods)) { return null; } if (Modifier.isAbstract(mods)) { return null; } Class<? extends Test> testClazz; try { testClazz = clazz.asSubclass(Test.class); } catch (ClassCastException e) { return null; } return testClazz; }
static Class<? extends Test> function(String className) { if (!className.endsWith(TEST_CLASS_SUFFIX)) { return null; } Class<?> clazz; try { clazz = Class.forName(className); } catch (ClassNotFoundException e) { return null; } catch (NoClassDefFoundError e) { return null; } int mods = clazz.getModifiers(); if (!Modifier.isPublic(mods)) { return null; } if (Modifier.isAbstract(mods)) { return null; } Class<? extends Test> testClazz; try { testClazz = clazz.asSubclass(Test.class); } catch (ClassCastException e) { return null; } return testClazz; }
/** * Check if class might be a valid test case. Must be public, non-abstract, named "*Test" and extend from * {@link Test}. */
Check if class might be a valid test case. Must be public, non-abstract, named "*Test" and extend from <code>Test</code>
getTestClass
{ "repo_name": "madmax983/aura", "path": "aura-util/src/test/java/org/auraframework/util/test/util/TestInventory.java", "license": "apache-2.0", "size": 7566 }
[ "java.lang.reflect.Modifier", "junit.framework.Test" ]
import java.lang.reflect.Modifier; import junit.framework.Test;
import java.lang.reflect.*; import junit.framework.*;
[ "java.lang", "junit.framework" ]
java.lang; junit.framework;
896,226
public static void main(String[] args) throws Exception { if (args.length != 3) { info(); return; } System.out.println("analogizing..."); DirectoryAnalogizer da = new DirectoryAnalogizer(); da.analogizeDirectory(new File(args[0]), new File(args[1]), args[2]); System.out.println("analogized..."); }
static void function(String[] args) throws Exception { if (args.length != 3) { info(); return; } System.out.println(STR); DirectoryAnalogizer da = new DirectoryAnalogizer(); da.analogizeDirectory(new File(args[0]), new File(args[1]), args[2]); System.out.println(STR); }
/** * Performs deletions in the target directory of those files that have no * corresponding mates in the reference directory. * * @param args * @throws Exception */
Performs deletions in the target directory of those files that have no corresponding mates in the reference directory
main
{ "repo_name": "datapoet/hubminer", "path": "src/main/java/util/DirectoryAnalogizer.java", "license": "gpl-3.0", "size": 5889 }
[ "java.io.File" ]
import java.io.File;
import java.io.*;
[ "java.io" ]
java.io;
2,361,261
public static int executeProcessWait(String string, PrintWriter p) { int resultado = 0; try { Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec(string); try { process.waitFor(); resultado = process.exitValue(); if (resultado != 0) { p.print(process.getErrorStream()); } } catch (java.lang.InterruptedException e) { p.println("\nexception: " + e.getMessage() + "\n"); e.printStackTrace(); } } catch (java.io.IOException e) { p.println("\nexception: " + e.getMessage() + "\n"); e.printStackTrace(); } return (resultado); }
static int function(String string, PrintWriter p) { int resultado = 0; try { Runtime runtime = Runtime.getRuntime(); Process process = runtime.exec(string); try { process.waitFor(); resultado = process.exitValue(); if (resultado != 0) { p.print(process.getErrorStream()); } } catch (java.lang.InterruptedException e) { p.println(STR + e.getMessage() + "\n"); e.printStackTrace(); } } catch (java.io.IOException e) { p.println(STR + e.getMessage() + "\n"); e.printStackTrace(); } return (resultado); }
/** * Executes a subprocess waiting for its complete execution */
Executes a subprocess waiting for its complete execution
executeProcessWait
{ "repo_name": "sing-group/bicycle", "path": "src/main/java/es/cnio/bioinfo/bicycle/Tools.java", "license": "lgpl-3.0", "size": 29070 }
[ "java.io.IOException", "java.io.PrintWriter" ]
import java.io.IOException; import java.io.PrintWriter;
import java.io.*;
[ "java.io" ]
java.io;
1,899,185
private void formatSwitchButton(int t) { IconManager icons = IconManager.getInstance(); if (t == Importer.PROJECT_TYPE) { locationButton.setIcon(icons.getIcon(IconManager.PROJECT)); locationLabel.setText(LOCATION_PROJECT); } else { locationButton.setIcon(icons.getIcon(IconManager.SCREEN)); locationLabel.setText(LOCATION_SCREEN); } }
void function(int t) { IconManager icons = IconManager.getInstance(); if (t == Importer.PROJECT_TYPE) { locationButton.setIcon(icons.getIcon(IconManager.PROJECT)); locationLabel.setText(LOCATION_PROJECT); } else { locationButton.setIcon(icons.getIcon(IconManager.SCREEN)); locationLabel.setText(LOCATION_SCREEN); } }
/** * Formats the {@link #projectLocationButton}. * * @param t The type to handle. */
Formats the <code>#projectLocationButton</code>
formatSwitchButton
{ "repo_name": "joshmoore/openmicroscopy", "path": "components/insight/SRC/org/openmicroscopy/shoola/agents/fsimporter/chooser/ImportDialog.java", "license": "gpl-2.0", "size": 72220 }
[ "org.openmicroscopy.shoola.agents.fsimporter.IconManager", "org.openmicroscopy.shoola.agents.fsimporter.view.Importer" ]
import org.openmicroscopy.shoola.agents.fsimporter.IconManager; import org.openmicroscopy.shoola.agents.fsimporter.view.Importer;
import org.openmicroscopy.shoola.agents.fsimporter.*; import org.openmicroscopy.shoola.agents.fsimporter.view.*;
[ "org.openmicroscopy.shoola" ]
org.openmicroscopy.shoola;
1,700,989
@SuppressWarnings("unchecked") @Override public void onDismissNoAction(Object actionData) { if (actionData instanceof Integer) { commitTabClosure((Integer) actionData); } else { for (Tab tab : (List<Tab>) actionData) { commitTabClosure(tab.getId()); } } }
@SuppressWarnings(STR) void function(Object actionData) { if (actionData instanceof Integer) { commitTabClosure((Integer) actionData); } else { for (Tab tab : (List<Tab>) actionData) { commitTabClosure(tab.getId()); } } }
/** * Calls {@link TabModel#commitTabClosure(int)} for the tab or for each tab in * the list of closed tabs. */
Calls <code>TabModel#commitTabClosure(int)</code> for the tab or for each tab in the list of closed tabs
onDismissNoAction
{ "repo_name": "mogoweb/365browser", "path": "app/src/main/java/org/chromium/chrome/browser/snackbar/undo/UndoBarController.java", "license": "apache-2.0", "size": 8230 }
[ "java.util.List", "org.chromium.chrome.browser.tab.Tab" ]
import java.util.List; import org.chromium.chrome.browser.tab.Tab;
import java.util.*; import org.chromium.chrome.browser.tab.*;
[ "java.util", "org.chromium.chrome" ]
java.util; org.chromium.chrome;
1,099,561
public MetaProperty<Boolean> active() { return active; }
MetaProperty<Boolean> function() { return active; }
/** * The meta-property for the {@code active} property. * @return the meta-property, not null */
The meta-property for the active property
active
{ "repo_name": "jmptrader/Strata", "path": "modules/basics/src/main/java/com/opengamma/strata/basics/index/ImmutablePriceIndex.java", "license": "apache-2.0", "size": 17306 }
[ "org.joda.beans.MetaProperty" ]
import org.joda.beans.MetaProperty;
import org.joda.beans.*;
[ "org.joda.beans" ]
org.joda.beans;
2,856,956
CompletableFuture<VersionedMetadata<ReaderGroupState>> updateVersionedState(final VersionedMetadata<ReaderGroupState> state, final ReaderGroupState newState, OperationContext context);
CompletableFuture<VersionedMetadata<ReaderGroupState>> updateVersionedState(final VersionedMetadata<ReaderGroupState> state, final ReaderGroupState newState, OperationContext context);
/** * Api to update versioned state as a CAS operation. * * @param state desired state * @return Future which when completed contains the updated state and version if successful or exception otherwise. */
Api to update versioned state as a CAS operation
updateVersionedState
{ "repo_name": "pravega/pravega", "path": "controller/src/main/java/io/pravega/controller/store/stream/ReaderGroup.java", "license": "apache-2.0", "size": 3698 }
[ "io.pravega.controller.store.VersionedMetadata", "java.util.concurrent.CompletableFuture" ]
import io.pravega.controller.store.VersionedMetadata; import java.util.concurrent.CompletableFuture;
import io.pravega.controller.store.*; import java.util.concurrent.*;
[ "io.pravega.controller", "java.util" ]
io.pravega.controller; java.util;
173,942
public void testKeySetDescendingIteratorOrder() { ConcurrentSkipListMap map = map5(); NavigableSet s = map.navigableKeySet(); Iterator i = s.descendingIterator(); Integer last = (Integer)i.next(); assertEquals(last, five); int count = 1; while (i.hasNext()) { Integer k = (Integer)i.next(); assertTrue(last.compareTo(k) > 0); last = k; ++count; } assertEquals(5, count); }
void function() { ConcurrentSkipListMap map = map5(); NavigableSet s = map.navigableKeySet(); Iterator i = s.descendingIterator(); Integer last = (Integer)i.next(); assertEquals(last, five); int count = 1; while (i.hasNext()) { Integer k = (Integer)i.next(); assertTrue(last.compareTo(k) > 0); last = k; ++count; } assertEquals(5, count); }
/** * descending iterator of key set is inverse ordered */
descending iterator of key set is inverse ordered
testKeySetDescendingIteratorOrder
{ "repo_name": "FauxFaux/jdk9-jdk", "path": "test/java/util/concurrent/tck/ConcurrentSkipListMapTest.java", "license": "gpl-2.0", "size": 40653 }
[ "java.util.Iterator", "java.util.NavigableSet", "java.util.concurrent.ConcurrentSkipListMap" ]
import java.util.Iterator; import java.util.NavigableSet; import java.util.concurrent.ConcurrentSkipListMap;
import java.util.*; import java.util.concurrent.*;
[ "java.util" ]
java.util;
962,321
public String getServicePathForNaming(boolean enableGrouping, boolean enableMappings) { if (enableGrouping) { return headers.get(NGSIConstants.FLUME_HEADER_GROUPED_SERVICE_PATH); } else if (enableMappings) { return headers.get(NGSIConstants.FLUME_HEADER_MAPPED_SERVICE_PATH); } else { return headers.get(CommonConstants.HEADER_FIWARE_SERVICE_PATH); } // if else } // getMappedServicePath
String function(boolean enableGrouping, boolean enableMappings) { if (enableGrouping) { return headers.get(NGSIConstants.FLUME_HEADER_GROUPED_SERVICE_PATH); } else if (enableMappings) { return headers.get(NGSIConstants.FLUME_HEADER_MAPPED_SERVICE_PATH); } else { return headers.get(CommonConstants.HEADER_FIWARE_SERVICE_PATH); } }
/** * Gets the service path for naming. * @param enableGrouping * @param enableMappings * @return The service path for naming */
Gets the service path for naming
getServicePathForNaming
{ "repo_name": "Fiware/context.Cygnus", "path": "cygnus-ngsi/src/main/java/com/telefonica/iot/cygnus/interceptors/NGSIEvent.java", "license": "agpl-3.0", "size": 6584 }
[ "com.telefonica.iot.cygnus.utils.CommonConstants", "com.telefonica.iot.cygnus.utils.NGSIConstants" ]
import com.telefonica.iot.cygnus.utils.CommonConstants; import com.telefonica.iot.cygnus.utils.NGSIConstants;
import com.telefonica.iot.cygnus.utils.*;
[ "com.telefonica.iot" ]
com.telefonica.iot;
2,506,237
public Player getViewer() { return viewer; }
Player function() { return viewer; }
/** * Gets the Player viewing the Menu * * @return Player viewing the Menu */
Gets the Player viewing the Menu
getViewer
{ "repo_name": "DSH105/MenuAPI", "path": "src/main/java/com/dsh105/menuapi/api/event/MenuOpenEvent.java", "license": "gpl-3.0", "size": 1955 }
[ "org.bukkit.entity.Player" ]
import org.bukkit.entity.Player;
import org.bukkit.entity.*;
[ "org.bukkit.entity" ]
org.bukkit.entity;
2,504,046
public boolean isSatisfiedBy(Date date) { Calendar testDateCal = Calendar.getInstance(getTimeZone()); testDateCal.setTime(date); testDateCal.set(Calendar.MILLISECOND, 0); Date originalDate = testDateCal.getTime(); testDateCal.add(Calendar.SECOND, -1); Date timeAfter = getTimeAfter(testDateCal.getTime()); return ((timeAfter != null) && (timeAfter.equals(originalDate))); }
boolean function(Date date) { Calendar testDateCal = Calendar.getInstance(getTimeZone()); testDateCal.setTime(date); testDateCal.set(Calendar.MILLISECOND, 0); Date originalDate = testDateCal.getTime(); testDateCal.add(Calendar.SECOND, -1); Date timeAfter = getTimeAfter(testDateCal.getTime()); return ((timeAfter != null) && (timeAfter.equals(originalDate))); }
/** * Indicates whether the given date satisfies the cron expression. Note that * milliseconds are ignored, so two Dates falling on different milliseconds * of the same second will always have the same result here. * * @param date the date to evaluate * @return a boolean indicating whether the given date satisfies the cron * expression */
Indicates whether the given date satisfies the cron expression. Note that milliseconds are ignored, so two Dates falling on different milliseconds of the same second will always have the same result here
isSatisfiedBy
{ "repo_name": "chandrasekhar4u/opensymphony-quartz-backup", "path": "src/java/org/quartz/CronExpression.java", "license": "apache-2.0", "size": 58376 }
[ "java.util.Calendar", "java.util.Date" ]
import java.util.Calendar; import java.util.Date;
import java.util.*;
[ "java.util" ]
java.util;
339,979
public static Complex[][] conjugate(final Complex[][] a) { final int n = a.length; final int m = a[0].length; final Complex[][] b = new Complex[m][n]; for (int i = 0; i < n; i++) for (int j = 0; j < m; b[j][i] = a[i][j].conj(), j++) ; return b; }
static Complex[][] function(final Complex[][] a) { final int n = a.length; final int m = a[0].length; final Complex[][] b = new Complex[m][n]; for (int i = 0; i < n; i++) for (int j = 0; j < m; b[j][i] = a[i][j].conj(), j++) ; return b; }
/** * Calculate the conjugate transpose of matrix A. * * @param a Complex the matrix * @return Complex[][] the conjugate matrix */
Calculate the conjugate transpose of matrix A
conjugate
{ "repo_name": "axkr/symja_android_library", "path": "symja_android_library/matheclipse-external/src/main/java/de/lab4inf/math/lapack/LinearAlgebra.java", "license": "gpl-3.0", "size": 103733 }
[ "de.lab4inf.math.Complex" ]
import de.lab4inf.math.Complex;
import de.lab4inf.math.*;
[ "de.lab4inf.math" ]
de.lab4inf.math;
23,523
public static boolean isNullLiteral( RexNode node, boolean allowCast) { if (node instanceof RexLiteral) { RexLiteral literal = (RexLiteral) node; if (literal.getTypeName() == SqlTypeName.NULL) { assert null == literal.getValue(); return true; } else { // We don't regard UNKNOWN -- SqlLiteral(null,Boolean) -- as // NULL. return false; } } if (allowCast) { if (node.isA(SqlKind.CAST)) { RexCall call = (RexCall) node; if (isNullLiteral(call.operands.get(0), false)) { // node is "CAST(NULL as type)" return true; } } } return false; }
static boolean function( RexNode node, boolean allowCast) { if (node instanceof RexLiteral) { RexLiteral literal = (RexLiteral) node; if (literal.getTypeName() == SqlTypeName.NULL) { assert null == literal.getValue(); return true; } else { return false; } } if (allowCast) { if (node.isA(SqlKind.CAST)) { RexCall call = (RexCall) node; if (isNullLiteral(call.operands.get(0), false)) { return true; } } } return false; }
/** * Returns whether a node represents the NULL value. * * <p>Examples: * * <ul> * <li>For {@link org.apache.calcite.rex.RexLiteral} Unknown, returns false. * <li>For <code>CAST(NULL AS <i>type</i>)</code>, returns true if <code> * allowCast</code> is true, false otherwise. * <li>For <code>CAST(CAST(NULL AS <i>type</i>) AS <i>type</i>))</code>, * returns false. * </ul> */
Returns whether a node represents the NULL value. Examples: For <code>org.apache.calcite.rex.RexLiteral</code> Unknown, returns false. For <code>CAST(NULL AS type)</code>, returns true if <code> allowCast</code> is true, false otherwise. For <code>CAST(CAST(NULL AS type) AS type))</code>, returns false.
isNullLiteral
{ "repo_name": "googleinterns/calcite", "path": "core/src/main/java/org/apache/calcite/rex/RexUtil.java", "license": "apache-2.0", "size": 89782 }
[ "org.apache.calcite.sql.SqlKind", "org.apache.calcite.sql.type.SqlTypeName" ]
import org.apache.calcite.sql.SqlKind; import org.apache.calcite.sql.type.SqlTypeName;
import org.apache.calcite.sql.*; import org.apache.calcite.sql.type.*;
[ "org.apache.calcite" ]
org.apache.calcite;
2,040,566
public void copy(CSVSeries other) { // Go through and set all instance variables to the other series' values isEnabled = other.isEnabled; label = other.label; // Do not copy here is ok! This means that the parent is equal to the // other parent by reference parent = other.parent; // All series should inherit from this class, so this SHOULD be ok ((AbstractSeriesStyle) style).copy((AbstractSeriesStyle) other.style); time = other.time; unit = other.unit; this.clear(); this.addAll(other); }
void function(CSVSeries other) { isEnabled = other.isEnabled; label = other.label; parent = other.parent; ((AbstractSeriesStyle) style).copy((AbstractSeriesStyle) other.style); time = other.time; unit = other.unit; this.clear(); this.addAll(other); }
/** * Makes this series copy exactly the series provided, to have the same * values and styles. * * @param other */
Makes this series copy exactly the series provided, to have the same values and styles
copy
{ "repo_name": "jarrah42/eavp", "path": "org.eclipse.eavp.viz.service/src/org/eclipse/eavp/viz/service/csv/CSVSeries.java", "license": "epl-1.0", "size": 8968 }
[ "org.eclipse.eavp.viz.service.styles.AbstractSeriesStyle" ]
import org.eclipse.eavp.viz.service.styles.AbstractSeriesStyle;
import org.eclipse.eavp.viz.service.styles.*;
[ "org.eclipse.eavp" ]
org.eclipse.eavp;
2,362,387
public Set<Role> findRoles(final Group userGroup) { final Set<Role> result = new HashSet<Role>(); for(final RoleMapping mapping : this.getRoleMappings()) { final Object source = mapping.getSource(); if((userGroup != null) && userGroup.equals(source)) { result.add(mapping.getTarget()); } } return result; }
Set<Role> function(final Group userGroup) { final Set<Role> result = new HashSet<Role>(); for(final RoleMapping mapping : this.getRoleMappings()) { final Object source = mapping.getSource(); if((userGroup != null) && userGroup.equals(source)) { result.add(mapping.getTarget()); } } return result; }
/** * Finds the roles mapped to given user group. * * @param userGroup * The user group. * @return The roles found. */
Finds the roles mapped to given user group
findRoles
{ "repo_name": "ansell/restlet-utils", "path": "src/main/java/com/github/ansell/restletutils/RestletUtilSesameRealm.java", "license": "apache-2.0", "size": 63162 }
[ "java.util.HashSet", "java.util.Set", "org.restlet.engine.security.RoleMapping", "org.restlet.security.Group", "org.restlet.security.Role" ]
import java.util.HashSet; import java.util.Set; import org.restlet.engine.security.RoleMapping; import org.restlet.security.Group; import org.restlet.security.Role;
import java.util.*; import org.restlet.engine.security.*; import org.restlet.security.*;
[ "java.util", "org.restlet.engine", "org.restlet.security" ]
java.util; org.restlet.engine; org.restlet.security;
2,529,879
private void pingNotifiableEventListenerInternal(Object object, String topic, Registration registration, boolean register) { if (!(object instanceof NotifiableEventListener)) { return; } NotifiableEventListener listener = ((NotifiableEventListener) object); if (register) { listener.onRegister(service, serviceName, topic, registration); } else { listener.onDeregister(service, serviceName, topic, registration); } } /** * Returns the {@link Registration}s for the event {@code topic}. If there are no * registrations and {@code forceCreate}, it will create a concurrent set and put it in the registration map. * * @param topic the event topic * @param forceCreate whether to create the registration set if none exists or to return null * @return the collection of registrations for the topic or null if none exists and {@code forceCreate} is {@code false}
void function(Object object, String topic, Registration registration, boolean register) { if (!(object instanceof NotifiableEventListener)) { return; } NotifiableEventListener listener = ((NotifiableEventListener) object); if (register) { listener.onRegister(service, serviceName, topic, registration); } else { listener.onDeregister(service, serviceName, topic, registration); } } /** * Returns the {@link Registration}s for the event {@code topic}. If there are no * registrations and {@code forceCreate}, it will create a concurrent set and put it in the registration map. * * @param topic the event topic * @param forceCreate whether to create the registration set if none exists or to return null * @return the collection of registrations for the topic or null if none exists and {@code forceCreate} is {@code false}
/** * Notifies the object of an event in the lifecycle of the listener. The listener may have * been registered or deregistered. The object must implement {@link NotifiableEventListener} if * it wants to be notified. * * @param object the object to notified. It must implement {@link NotifiableEventListener} to be notified * @param topic the event topic name * @param registration the listener registration * @param register whether the listener was registered or not */
Notifies the object of an event in the lifecycle of the listener. The listener may have been registered or deregistered. The object must implement <code>NotifiableEventListener</code> if it wants to be notified
pingNotifiableEventListenerInternal
{ "repo_name": "dbrimley/hazelcast", "path": "hazelcast/src/main/java/com/hazelcast/spi/impl/eventservice/impl/EventServiceSegment.java", "license": "apache-2.0", "size": 9945 }
[ "com.hazelcast.spi.NotifiableEventListener" ]
import com.hazelcast.spi.NotifiableEventListener;
import com.hazelcast.spi.*;
[ "com.hazelcast.spi" ]
com.hazelcast.spi;
1,498,444
private byte[] readIP(int ipVersion) throws IOException { byte ip[]; switch (ipVersion) { case 4: ip = new byte[IP_V4_LENGTH]; break; case 6: ip = new byte[IP_V6_LENGTH]; break; default: throw new MessageFormatException("Unknown IP version: " + ipVersion); } try { dis.readFully(ip); } catch(EOFException e) { throw new MessageFormatException("Wrong message length", e); } return ip; }
byte[] function(int ipVersion) throws IOException { byte ip[]; switch (ipVersion) { case 4: ip = new byte[IP_V4_LENGTH]; break; case 6: ip = new byte[IP_V6_LENGTH]; break; default: throw new MessageFormatException(STR + ipVersion); } try { dis.readFully(ip); } catch(EOFException e) { throw new MessageFormatException(STR, e); } return ip; }
/** * Decodes the IP address based on the given IP version. * If IP version is IPv4 it reads the next four bytes. If IP version * is IPv6 it reads the next 16 bytes as IP address. * @param ipVersion * @return a byte array containing the IP address. * @throws IOException if the IP version is unknown or an I/O error * occurs. */
Decodes the IP address based on the given IP version. If IP version is IPv4 it reads the next four bytes. If IP version is IPv6 it reads the next 16 bytes as IP address
readIP
{ "repo_name": "htwg/UCE_deprecated", "path": "socket/de.htwg_konstanz.in.uce.hp.parallel.messages/src/main/java/de/htwg_konstanz/in/uce/hp/parallel/messages/coder/MessageDecoder.java", "license": "gpl-3.0", "size": 11822 }
[ "java.io.EOFException", "java.io.IOException" ]
import java.io.EOFException; import java.io.IOException;
import java.io.*;
[ "java.io" ]
java.io;
1,606,365
public PackedInts.Reader getFirstOrdinals() { return ordinals.firstOrdinals; }
PackedInts.Reader function() { return ordinals.firstOrdinals; }
/** * Return a {@link PackedInts.Reader} instance mapping every doc ID to its first ordinal + 1 if it exists and 0 otherwise. */
Return a <code>PackedInts.Reader</code> instance mapping every doc ID to its first ordinal + 1 if it exists and 0 otherwise
getFirstOrdinals
{ "repo_name": "robin13/elasticsearch", "path": "server/src/main/java/org/elasticsearch/index/fielddata/ordinals/OrdinalsBuilder.java", "license": "apache-2.0", "size": 14330 }
[ "org.apache.lucene.util.packed.PackedInts" ]
import org.apache.lucene.util.packed.PackedInts;
import org.apache.lucene.util.packed.*;
[ "org.apache.lucene" ]
org.apache.lucene;
1,568,882
public void setAnim(@AnimRes int nextIn, @AnimRes int nextOut, @AnimRes int quitIn, @AnimRes int quitOut) { this.nextIn = nextIn; this.nextOut = nextOut; this.quitIn = quitIn; this.quitOut = quitOut; next_in = AnimationUtils.loadAnimation(context, quitIn); next_out = AnimationUtils.loadAnimation(context, quitOut); }
void function(@AnimRes int nextIn, @AnimRes int nextOut, @AnimRes int quitIn, @AnimRes int quitOut) { this.nextIn = nextIn; this.nextOut = nextOut; this.quitIn = quitIn; this.quitOut = quitOut; next_in = AnimationUtils.loadAnimation(context, quitIn); next_out = AnimationUtils.loadAnimation(context, quitOut); }
/** * Set page switch animation * * @param nextIn The next page to enter the animation * @param nextOut The next page out of the animation * @param quitIn The current page into the animation * @param quitOut Exit animation for the current page */
Set page switch animation
setAnim
{ "repo_name": "Mr-wangyong/FragmentStack", "path": "stacklibrary/src/main/java/com/mrwang/stacklibrary/StackManager.java", "license": "apache-2.0", "size": 11101 }
[ "android.support.annotation.AnimRes", "android.view.animation.AnimationUtils" ]
import android.support.annotation.AnimRes; import android.view.animation.AnimationUtils;
import android.support.annotation.*; import android.view.animation.*;
[ "android.support", "android.view" ]
android.support; android.view;
996,552
protected DocumentAttributeString buildSearchableYesNoAttribute(String attributeKey, Object value) { final String boolValueAsString = booleanValueAsString((Boolean)value); return DocumentAttributeFactory.createStringAttribute(attributeKey, boolValueAsString); }
DocumentAttributeString function(String attributeKey, Object value) { final String boolValueAsString = booleanValueAsString((Boolean)value); return DocumentAttributeFactory.createStringAttribute(attributeKey, boolValueAsString); }
/** * This builds a String SearchableAttributeValue for the given key and value, correctly correlating booleans * @param attributeKey the key for the searchable attribute * @param value the value that will be coerced to a String * @return the generated SearchableAttributeStringValue */
This builds a String SearchableAttributeValue for the given key and value, correctly correlating booleans
buildSearchableYesNoAttribute
{ "repo_name": "ua-eas/ksd-kc5.2.1-rice2.3.6-ua", "path": "rice-middleware/impl/src/main/java/org/kuali/rice/kns/workflow/service/impl/WorkflowAttributePropertyResolutionServiceImpl.java", "license": "apache-2.0", "size": 26456 }
[ "org.kuali.rice.kew.api.document.attribute.DocumentAttributeFactory", "org.kuali.rice.kew.api.document.attribute.DocumentAttributeString" ]
import org.kuali.rice.kew.api.document.attribute.DocumentAttributeFactory; import org.kuali.rice.kew.api.document.attribute.DocumentAttributeString;
import org.kuali.rice.kew.api.document.attribute.*;
[ "org.kuali.rice" ]
org.kuali.rice;
1,892,991
public void test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionG_Overflow() { Formatter f = new Formatter(); f.format("%g", 999999.5); assertEquals("1.00000e+06", f.toString()); f = new Formatter(); f.format("%g", 99999.5); assertEquals("99999.5", f.toString()); f = new Formatter(); f.format("%.4g", 99.95); assertEquals("99.95", f.toString()); f = new Formatter(); f.format("%g", 99.95); assertEquals("99.9500", f.toString()); f = new Formatter(); f.format("%g", 0.9); assertEquals("0.900000", f.toString()); f = new Formatter(); f.format("%.0g", 0.000095); assertEquals("0.0001", f.toString()); f = new Formatter(); f.format("%g", 0.0999999); assertEquals("0.0999999", f.toString()); f = new Formatter(); f.format("%g", 0.00009); assertEquals("9.00000e-05", f.toString()); }
public void test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionG_Overflow() { Formatter f = new Formatter(); f.format("%g", 999999.5); assertEquals(STR, f.toString()); f = new Formatter(); f.format("%g", 99999.5); assertEquals(STR, f.toString()); f = new Formatter(); f.format("%.4g", 99.95); assertEquals("99.95", f.toString()); f = new Formatter(); f.format("%g", 99.95); assertEquals(STR, f.toString()); f = new Formatter(); f.format("%g", 0.9); assertEquals(STR, f.toString()); f = new Formatter(); f.format("%.0g", 0.000095); assertEquals(STR, f.toString()); f = new Formatter(); f.format("%g", 0.0999999); assertEquals(STR, f.toString()); f = new Formatter(); f.format("%g", 0.00009); assertEquals(STR, f.toString()); }
/** * java.util.Formatter#format(String, Object...) for Float/Double * conversion type 'g' and 'G' overflow */
java.util.Formatter#format(String, Object...) for Float/Double conversion type 'g' and 'G' overflow
test_formatLjava_lang_String$Ljava_lang_Object_FloatConversionG_Overflow
{ "repo_name": "mirego/j2objc", "path": "jre_emul/android/platform/libcore/harmony-tests/src/test/java/org/apache/harmony/tests/java/util/FormatterTest.java", "license": "apache-2.0", "size": 189619 }
[ "java.util.Formatter" ]
import java.util.Formatter;
import java.util.*;
[ "java.util" ]
java.util;
760,653
public void inputSentence(String text, String userName, String id, Network network) { Vertex input = createInput(text != null ? text.trim() : "", network); //Greeting if(text == null || (text!= null && text.isEmpty())) { input.setRelationship(Primitive.INPUT, Primitive.NULL); input.setRelationship(Primitive.TARGET, Primitive.SELF); } Vertex user = network.createUniqueSpeaker(new Primitive(userName), Primitive.ALEXA); Vertex self = network.createVertex(Primitive.SELF); input.addRelationship(Primitive.SPEAKER, user); input.addRelationship(Primitive.TARGET, self); Vertex conversationId = network.createVertex(id); Vertex today = network.getBot().awareness().getTool(org.botlibre.tool.Date.class).date(self); Vertex conversation = today.getRelationship(conversationId); if (conversation == null) { conversation = network.createVertex(); today.setRelationship(conversationId, conversation); this.conversations++; } else { checkEngaged(conversation); } conversation.addRelationship(Primitive.INSTANTIATION, Primitive.CONVERSATION); conversation.addRelationship(Primitive.TYPE, Primitive.ALEXA); conversation.addRelationship(Primitive.ID, network.createVertex(id)); conversation.addRelationship(Primitive.SPEAKER, user); conversation.addRelationship(Primitive.SPEAKER, self); if(text != null && !text.isEmpty()) { Language.addToConversation(input, conversation); } else { input.addRelationship(Primitive.CONVERSATION, conversation); } network.save(); getBot().memory().addActiveMemory(input); }
void function(String text, String userName, String id, Network network) { Vertex input = createInput(text != null ? text.trim() : "", network); if(text == null (text!= null && text.isEmpty())) { input.setRelationship(Primitive.INPUT, Primitive.NULL); input.setRelationship(Primitive.TARGET, Primitive.SELF); } Vertex user = network.createUniqueSpeaker(new Primitive(userName), Primitive.ALEXA); Vertex self = network.createVertex(Primitive.SELF); input.addRelationship(Primitive.SPEAKER, user); input.addRelationship(Primitive.TARGET, self); Vertex conversationId = network.createVertex(id); Vertex today = network.getBot().awareness().getTool(org.botlibre.tool.Date.class).date(self); Vertex conversation = today.getRelationship(conversationId); if (conversation == null) { conversation = network.createVertex(); today.setRelationship(conversationId, conversation); this.conversations++; } else { checkEngaged(conversation); } conversation.addRelationship(Primitive.INSTANTIATION, Primitive.CONVERSATION); conversation.addRelationship(Primitive.TYPE, Primitive.ALEXA); conversation.addRelationship(Primitive.ID, network.createVertex(id)); conversation.addRelationship(Primitive.SPEAKER, user); conversation.addRelationship(Primitive.SPEAKER, self); if(text != null && !text.isEmpty()) { Language.addToConversation(input, conversation); } else { input.addRelationship(Primitive.CONVERSATION, conversation); } network.save(); getBot().memory().addActiveMemory(input); }
/** * Process the text sentence. */
Process the text sentence
inputSentence
{ "repo_name": "BOTlibre/BOTlibre", "path": "ai-engine/source/org/botlibre/sense/alexa/Alexa.java", "license": "epl-1.0", "size": 15604 }
[ "java.util.Date", "org.botlibre.api.knowledge.Network", "org.botlibre.api.knowledge.Vertex", "org.botlibre.knowledge.Primitive", "org.botlibre.thought.language.Language" ]
import java.util.Date; import org.botlibre.api.knowledge.Network; import org.botlibre.api.knowledge.Vertex; import org.botlibre.knowledge.Primitive; import org.botlibre.thought.language.Language;
import java.util.*; import org.botlibre.api.knowledge.*; import org.botlibre.knowledge.*; import org.botlibre.thought.language.*;
[ "java.util", "org.botlibre.api", "org.botlibre.knowledge", "org.botlibre.thought" ]
java.util; org.botlibre.api; org.botlibre.knowledge; org.botlibre.thought;
2,158,808
mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setEnabled(false); try { List<String> walletFilenamesToMigrate = getWalletFilenamesToMigrate(); if (walletFilenamesToMigrate.size() == 0) { // Nothing to do. return; } MultiBitDialog infoDialog = createDialog(mainFrame, walletFilenamesToMigrate.size()); infoDialog.setVisible(true); Object value = optionPane.getValue(); if ((new Integer(JOptionPane.CANCEL_OPTION)).equals(value)) { controller.displayHelpContext(HelpContentsPanel.HELP_WALLET_FORMATS_URL); return; } else if ((new Integer(JOptionPane.CLOSED_OPTION)).equals(value)) { return; } else { boolean thereWereFailures = false; controller.displayView(View.MESSAGES_VIEW); MessageManager.INSTANCE.addMessage(new Message(" ")); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.start") + " " + controller.getLocaliser().getString("migrateWalletsAction.text") + ".")); FileHandler fileHandler = new FileHandler(this.bitcoinController); for (String walletFilename : walletFilenamesToMigrate) { WalletData loopPerWalletModelData = this.bitcoinController.getModel().getPerWalletModelDataByWalletFilename(walletFilename); if (loopPerWalletModelData != null) { MessageManager.INSTANCE.addMessage(new Message(" ")); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.isSerialisedAndNeedsMigrating", new Object[] {loopPerWalletModelData.getWalletDescription()}))); File tempDirectory = null; File testWalletFile = null; String walletMigrationErrorText = "Unknown"; try { tempDirectory = createTempDirectory(new File(loopPerWalletModelData.getWalletFilename())); testWalletFile = File.createTempFile("migrate", ".wallet", tempDirectory); testWalletFile.deleteOnExit(); // Copy the serialised wallet to the new test wallet location. FileHandler.copyFile(new File(loopPerWalletModelData.getWalletFilename()), testWalletFile); // Load serialised, change to protobuf, save, reload, check. walletMigrationErrorText = convertToProtobufAndCheck(testWalletFile, fileHandler); // Did not save/ load as protobuf. if (walletMigrationErrorText != null) { thereWereFailures = true; MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.testMigrationUnsuccessful"))); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("deleteWalletConfirmDialog.walletDeleteError2", new Object[]{walletMigrationErrorText}))); // Save the MultiBit version so that we do not keep trying to run the migrate utility (until the next version). loopPerWalletModelData.getWalletInfo().put(BitcoinModel.LAST_FAILED_MIGRATE_VERSION, controller.getLocaliser().getVersionNumber()); loopPerWalletModelData.setDirty(true); } } catch (IOException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletLoadException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletSaveException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletVersionException wve) { migrationWasNotSuccessful(loopPerWalletModelData, wve); thereWereFailures = true; } catch (IllegalStateException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (Exception e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } finally { // Delete test wallet data. if (testWalletFile != null) { WalletData testPerWalletModelData = this.bitcoinController.getModel().getPerWalletModelDataByWalletFilename(testWalletFile.getAbsolutePath()); this.bitcoinController.getModel().remove(testPerWalletModelData); fileHandler.deleteWalletAndWalletInfo(testPerWalletModelData); tempDirectory.delete(); } } try { if (walletMigrationErrorText == null) { // Test migrate was successful - now do it for real. // Backup serialised wallet, specifying that it should not be migrated for this version of MultiBit. // (It will likely ony be opened if the real migrate fails). fileHandler.backupPerWalletModelData(loopPerWalletModelData, controller.getLocaliser().getVersionNumber()); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.backingUpFile", new Object[] {loopPerWalletModelData.getWalletBackupFilename()}))); // Load serialised, change to protobuf, save, reload, check. walletMigrationErrorText = convertToProtobufAndCheck(new File(loopPerWalletModelData.getWalletFilename()), fileHandler); if (walletMigrationErrorText == null) { MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.success", new Object[]{ loopPerWalletModelData.getWalletDescription()}))); // Clear any 'lastMigrateFailed' properties. loopPerWalletModelData.getWalletInfo().remove(BitcoinModel.LAST_FAILED_MIGRATE_VERSION); loopPerWalletModelData.setDirty(true); } else { MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.realMigrationUnsuccessful)"))); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("deleteWalletConfirmDialog.walletDeleteError2", new Object[]{walletMigrationErrorText}))); thereWereFailures = true; } } } catch (WalletSaveException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletVersionException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletLoadException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (IllegalStateException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (Exception e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } } } MessageManager.INSTANCE.addMessage(new Message(" ")); if (thereWereFailures) { MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.mailJimErrors"))); } MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString("migrateWalletsAction.end") + " " + controller.getLocaliser().getString("migrateWalletsAction.text") + ".")); MessageManager.INSTANCE.addMessage(new Message(" ")); controller.fireDataChangedUpdateNow(); controller.fireRecreateAllViews(false); controller.displayView(View.MESSAGES_VIEW); } } finally { setEnabled(true); mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }
mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.WAIT_CURSOR)); setEnabled(false); try { List<String> walletFilenamesToMigrate = getWalletFilenamesToMigrate(); if (walletFilenamesToMigrate.size() == 0) { return; } MultiBitDialog infoDialog = createDialog(mainFrame, walletFilenamesToMigrate.size()); infoDialog.setVisible(true); Object value = optionPane.getValue(); if ((new Integer(JOptionPane.CANCEL_OPTION)).equals(value)) { controller.displayHelpContext(HelpContentsPanel.HELP_WALLET_FORMATS_URL); return; } else if ((new Integer(JOptionPane.CLOSED_OPTION)).equals(value)) { return; } else { boolean thereWereFailures = false; controller.displayView(View.MESSAGES_VIEW); MessageManager.INSTANCE.addMessage(new Message(" ")); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR) + " " + controller.getLocaliser().getString(STR) + ".")); FileHandler fileHandler = new FileHandler(this.bitcoinController); for (String walletFilename : walletFilenamesToMigrate) { WalletData loopPerWalletModelData = this.bitcoinController.getModel().getPerWalletModelDataByWalletFilename(walletFilename); if (loopPerWalletModelData != null) { MessageManager.INSTANCE.addMessage(new Message(" ")); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR, new Object[] {loopPerWalletModelData.getWalletDescription()}))); File tempDirectory = null; File testWalletFile = null; String walletMigrationErrorText = STR; try { tempDirectory = createTempDirectory(new File(loopPerWalletModelData.getWalletFilename())); testWalletFile = File.createTempFile(STR, STR, tempDirectory); testWalletFile.deleteOnExit(); FileHandler.copyFile(new File(loopPerWalletModelData.getWalletFilename()), testWalletFile); walletMigrationErrorText = convertToProtobufAndCheck(testWalletFile, fileHandler); if (walletMigrationErrorText != null) { thereWereFailures = true; MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR))); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR, new Object[]{walletMigrationErrorText}))); loopPerWalletModelData.getWalletInfo().put(BitcoinModel.LAST_FAILED_MIGRATE_VERSION, controller.getLocaliser().getVersionNumber()); loopPerWalletModelData.setDirty(true); } } catch (IOException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletLoadException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletSaveException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletVersionException wve) { migrationWasNotSuccessful(loopPerWalletModelData, wve); thereWereFailures = true; } catch (IllegalStateException e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } catch (Exception e1) { migrationWasNotSuccessful(loopPerWalletModelData, e1); thereWereFailures = true; } finally { if (testWalletFile != null) { WalletData testPerWalletModelData = this.bitcoinController.getModel().getPerWalletModelDataByWalletFilename(testWalletFile.getAbsolutePath()); this.bitcoinController.getModel().remove(testPerWalletModelData); fileHandler.deleteWalletAndWalletInfo(testPerWalletModelData); tempDirectory.delete(); } } try { if (walletMigrationErrorText == null) { fileHandler.backupPerWalletModelData(loopPerWalletModelData, controller.getLocaliser().getVersionNumber()); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR, new Object[] {loopPerWalletModelData.getWalletBackupFilename()}))); walletMigrationErrorText = convertToProtobufAndCheck(new File(loopPerWalletModelData.getWalletFilename()), fileHandler); if (walletMigrationErrorText == null) { MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR, new Object[]{ loopPerWalletModelData.getWalletDescription()}))); loopPerWalletModelData.getWalletInfo().remove(BitcoinModel.LAST_FAILED_MIGRATE_VERSION); loopPerWalletModelData.setDirty(true); } else { MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR))); MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR, new Object[]{walletMigrationErrorText}))); thereWereFailures = true; } } } catch (WalletSaveException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletVersionException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (WalletLoadException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (IllegalStateException e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } catch (Exception e1) { migrationWasNotSuccessfulUseBackup(loopPerWalletModelData, e1); thereWereFailures = true; } } } MessageManager.INSTANCE.addMessage(new Message(" ")); if (thereWereFailures) { MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR))); } MessageManager.INSTANCE.addMessage(new Message(controller.getLocaliser().getString(STR) + " " + controller.getLocaliser().getString(STR) + ".")); MessageManager.INSTANCE.addMessage(new Message(" ")); controller.fireDataChangedUpdateNow(); controller.fireRecreateAllViews(false); controller.displayView(View.MESSAGES_VIEW); } } finally { setEnabled(true); mainFrame.setCursor(Cursor.getPredefinedCursor(Cursor.DEFAULT_CURSOR)); } }
/** * Ask the user if they want to migrate wallets now, then perform migration in background thread. */
Ask the user if they want to migrate wallets now, then perform migration in background thread
actionPerformed
{ "repo_name": "da2ce7/multibit", "path": "src/main/java/org/multibit/viewsystem/swing/action/MigrateWalletsAction.java", "license": "mit", "size": 27407 }
[ "java.awt.Cursor", "java.io.File", "java.io.IOException", "java.util.List", "javax.swing.JOptionPane", "org.multibit.file.FileHandler", "org.multibit.file.WalletLoadException", "org.multibit.file.WalletSaveException", "org.multibit.message.Message", "org.multibit.message.MessageManager", "org.multibit.model.bitcoin.BitcoinModel", "org.multibit.model.bitcoin.WalletData", "org.multibit.store.WalletVersionException", "org.multibit.viewsystem.View", "org.multibit.viewsystem.swing.view.components.MultiBitDialog", "org.multibit.viewsystem.swing.view.panels.HelpContentsPanel" ]
import java.awt.Cursor; import java.io.File; import java.io.IOException; import java.util.List; import javax.swing.JOptionPane; import org.multibit.file.FileHandler; import org.multibit.file.WalletLoadException; import org.multibit.file.WalletSaveException; import org.multibit.message.Message; import org.multibit.message.MessageManager; import org.multibit.model.bitcoin.BitcoinModel; import org.multibit.model.bitcoin.WalletData; import org.multibit.store.WalletVersionException; import org.multibit.viewsystem.View; import org.multibit.viewsystem.swing.view.components.MultiBitDialog; import org.multibit.viewsystem.swing.view.panels.HelpContentsPanel;
import java.awt.*; import java.io.*; import java.util.*; import javax.swing.*; import org.multibit.file.*; import org.multibit.message.*; import org.multibit.model.bitcoin.*; import org.multibit.store.*; import org.multibit.viewsystem.*; import org.multibit.viewsystem.swing.view.components.*; import org.multibit.viewsystem.swing.view.panels.*;
[ "java.awt", "java.io", "java.util", "javax.swing", "org.multibit.file", "org.multibit.message", "org.multibit.model", "org.multibit.store", "org.multibit.viewsystem" ]
java.awt; java.io; java.util; javax.swing; org.multibit.file; org.multibit.message; org.multibit.model; org.multibit.store; org.multibit.viewsystem;
1,861,583
@Unstable default List<String> getTrustedDomains() { return Collections.emptyList(); }
default List<String> getTrustedDomains() { return Collections.emptyList(); }
/** * Specify the list of domains that are considered as trusted by the administrators of the wiki: those domains can * be used safely for redirections from the wiki or for performing other requests on them. * @return the list of trusted domains that can be used in the wiki. * @since 13.3RC1 * @since 12.10.7 */
Specify the list of domains that are considered as trusted by the administrators of the wiki: those domains can be used safely for redirections from the wiki or for performing other requests on them
getTrustedDomains
{ "repo_name": "xwiki/xwiki-platform", "path": "xwiki-platform-core/xwiki-platform-url/xwiki-platform-url-api/src/main/java/org/xwiki/url/URLConfiguration.java", "license": "lgpl-2.1", "size": 2836 }
[ "java.util.Collections", "java.util.List" ]
import java.util.Collections; import java.util.List;
import java.util.*;
[ "java.util" ]
java.util;
1,618,258