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;... | 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 = ... | /**
* 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... | 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());
appenders... | 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... | 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 ... | /**
* 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.childrenInacces... | @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); fir... | /**
* 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... | 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.conv... | 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... | /**
* 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 {
... | 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);... | /**
* 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.GenericServic... | 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.ofbi... | 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());
}
registrati... | 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... | /**
* 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 con... | 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 "n... | 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... | /**
* 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.add... | 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()... | /**
* 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_extraMet... | 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 CountDo... | /**
* 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... | 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... | 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.c... | /**
* 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).... | 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... | /**
* 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 );
... | 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 BigDeci... | /**
* 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;
... | 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)... | /**
* 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 ap... | 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(... | 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,... | /**
* 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 * N... | 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.Model... | 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.newIns... | 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) {
ret... | 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 ... | 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... | 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 HashMa... | /**
* 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.getT... | 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 buffe... | /**
* 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... | 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.getProd... | 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(wire... | /**
* 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.Messa... | 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.co... | 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)) {
retur... | 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.");
}
... | 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(... | /**
* 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(... | 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()) {
... | 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.createStateme... | 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); clo... | /**
* 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.getLatestBi... | 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 ApiExcepti... | 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... | /**
* 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 'true', then the output is pretty printed. (optional)
* @param dryRun When present, indicates ... | 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);
... | 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 mon... | 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 ... | 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(... | 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( LoggingConfig... | /**
* 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... | 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()); IT... | /**
* 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) ==... | 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, "sa... | /**
* 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,
KeyValueEncod... | 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 sche... | 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[] maxCo... | 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... | /**
* 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 ... | 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(pre... | 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.unscale... | /**
* 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.SE... | 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(idpPr... | /**
* 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.car... | 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; im... | 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 = r... | 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 J... | 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; ... | /**
* 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 corr... | 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.se... | 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... | /**
* 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(), ... | NodeRef function(RenderingContext context) { RenditionLocation location = resolveRenditionLocation( context.getSourceNode(), context.getDefinition(), context.getDestinationNode() ); NodeRef parent = location.getParentRef(); String folderName = getImagesDirectoryName(context); NodeRef imgFolder = nodeService.getChildByN... | /**
* 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 = tru... | 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... | /**
* 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://... | 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.ocl... | /**
* 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... | 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); assertNotNul... | /**
* 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;
... | 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 (!Modifie... | /**
* 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]), ar... | 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(... | 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... | /**
* 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));
locatio... | 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()) {
... | 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; } asser... | /**
* 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);
... | 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_... | /**
* 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);
... | 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... | /**
* 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 whethe... | 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 do... | 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 = ... | /**
* 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>C... | 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 s... | 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(... | 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)... | 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... | /**
* 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 Notif... | 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 MessageFormatExcept... | 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(ST... | /**
* 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 i... | 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 = ... | 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.toStri... | 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... | /**
* 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(Pri... | 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 use... | /**
* 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;... | 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.setV... | /**
* 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.mu... | 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.messa... | 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.viewsy... | [
"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
* ... | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.