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 void _setIndexVersion(Version indexVersion) {
this.indexVersion = indexVersion;
}
public interface LeafFactory { | void function(Version indexVersion) { this.indexVersion = indexVersion; } public interface LeafFactory { | /**
* Starting a name with underscore, so that the user cannot access this function directly through a script
*/ | Starting a name with underscore, so that the user cannot access this function directly through a script | _setIndexVersion | {
"repo_name": "gingerwizard/elasticsearch",
"path": "server/src/main/java/org/elasticsearch/script/ScoreScript.java",
"license": "apache-2.0",
"size": 9083
} | [
"org.elasticsearch.Version"
] | import org.elasticsearch.Version; | import org.elasticsearch.*; | [
"org.elasticsearch"
] | org.elasticsearch; | 2,396,750 |
public boolean isEmptyFullAccessUsersRepository() throws SQLException {
if (getFullAccessUsers() == null) {
//no Full Access Users exist at repository
return true;
} else { //otherwise at least one user with Full Access exist
return false;
}
} | boolean function() throws SQLException { if (getFullAccessUsers() == null) { return true; } else { return false; } } | /**
* Check out if in the user repository no Full Access Users exist
*
* @return
* @throws SQLException
*/ | Check out if in the user repository no Full Access Users exist | isEmptyFullAccessUsersRepository | {
"repo_name": "jcrcano/DrakkarKeel",
"path": "Modules/DrakkarStern/src/drakkar/stern/tracker/persistent/security/DerbyAuthentication.java",
"license": "gpl-2.0",
"size": 14725
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 744,540 |
public FeatureCursor queryFeaturesForChunk(boolean distinct,
String[] columns, BoundingBox boundingBox, Projection projection,
String where, String orderBy, int limit) {
return queryFeaturesForChunk(distinct, colum... | FeatureCursor function(boolean distinct, String[] columns, BoundingBox boundingBox, Projection projection, String where, String orderBy, int limit) { return queryFeaturesForChunk(distinct, columns, boundingBox, projection, where, null, orderBy, limit); } | /**
* Query for features within the bounding box in the provided projection,
* starting at the offset and returning no more than the limit
*
* @param distinct distinct rows
* @param columns columns
* @param boundingBox bounding box
* @param projection projection
* @param ... | Query for features within the bounding box in the provided projection, starting at the offset and returning no more than the limit | queryFeaturesForChunk | {
"repo_name": "ngageoint/geopackage-android",
"path": "geopackage-sdk/src/main/java/mil/nga/geopackage/extension/nga/index/FeatureTableIndex.java",
"license": "mit",
"size": 276322
} | [
"mil.nga.geopackage.BoundingBox",
"mil.nga.geopackage.features.user.FeatureCursor",
"mil.nga.proj.Projection"
] | import mil.nga.geopackage.BoundingBox; import mil.nga.geopackage.features.user.FeatureCursor; import mil.nga.proj.Projection; | import mil.nga.geopackage.*; import mil.nga.geopackage.features.user.*; import mil.nga.proj.*; | [
"mil.nga.geopackage",
"mil.nga.proj"
] | mil.nga.geopackage; mil.nga.proj; | 347,322 |
boolean startObjectEntry(String key) throws ParseException, IOException;
| boolean startObjectEntry(String key) throws ParseException, IOException; | /**
* Receive notification of the beginning of a JSON object entry.
*
* @param key - Key of a JSON object entry.
*
* @return false if the handler wants to stop parsing after return.
* @throws ParseException
*
* @see #endObjectEntry
*/ | Receive notification of the beginning of a JSON object entry | startObjectEntry | {
"repo_name": "minepass/gameserver-core",
"path": "src/embed/java/net/minepass/api/gameserver/embed/solidtx/embed/json/parser/ContentHandler.java",
"license": "mit",
"size": 3141
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,597,817 |
public void setTransactionEntryProcessedTs(Timestamp transactionEntryProcessedTs) {
this.transactionEntryProcessedTs = transactionEntryProcessedTs;
}
| void function(Timestamp transactionEntryProcessedTs) { this.transactionEntryProcessedTs = transactionEntryProcessedTs; } | /**
* Sets the transactionEntryProcessedTs attribute.
*
* @param transactionEntryProcessedTs The transactionEntryProcessedTs to set.
*/ | Sets the transactionEntryProcessedTs attribute | setTransactionEntryProcessedTs | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/sys/businessobject/GeneralLedgerPendingEntry.java",
"license": "agpl-3.0",
"size": 34159
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 644,742 |
public static void addFuel(ItemStack is, int time){
if(is != null) {
if(is.getItem() != null){
if(is.getItem() instanceof Item) {
TEMold.addFuelItem(is.getItem(), time);
}
if(Block.getBlockFromItem(is.getItem())!= null) {
TEMold.addFuelBlock(Block.getBlockFromItem(is.getItem()), time);
... | static void function(ItemStack is, int time){ if(is != null) { if(is.getItem() != null){ if(is.getItem() instanceof Item) { TEMold.addFuelItem(is.getItem(), time); } if(Block.getBlockFromItem(is.getItem())!= null) { TEMold.addFuelBlock(Block.getBlockFromItem(is.getItem()), time); } } } } | /**ItemStack : item or block to burn
* int time : how long it burns
* */ | ItemStack : item or block to burn int time : how long it burns | addFuel | {
"repo_name": "ArtixAllMighty/rpginventory",
"path": "rpgInventory/utils/RpgUtility.java",
"license": "gpl-3.0",
"size": 4486
} | [
"net.minecraft.block.Block",
"net.minecraft.item.Item",
"net.minecraft.item.ItemStack"
] | import net.minecraft.block.Block; import net.minecraft.item.Item; import net.minecraft.item.ItemStack; | import net.minecraft.block.*; import net.minecraft.item.*; | [
"net.minecraft.block",
"net.minecraft.item"
] | net.minecraft.block; net.minecraft.item; | 2,677,371 |
@Override
public void debug(final String message, final Object... params) {
if (isEnabled(Level.DEBUG, null, message, params)) {
final Message msg = messageFactory.newMessage(message, params);
log(null, FQCN, Level.DEBUG, msg, msg.getThrowable());
}
} | void function(final String message, final Object... params) { if (isEnabled(Level.DEBUG, null, message, params)) { final Message msg = messageFactory.newMessage(message, params); log(null, FQCN, Level.DEBUG, msg, msg.getThrowable()); } } | /**
* Logs a message with parameters at the {@link Level#DEBUG DEBUG} level.
*
* @param message the message to log.
* @param params parameters to the message.
*/ | Logs a message with parameters at the <code>Level#DEBUG DEBUG</code> level | debug | {
"repo_name": "OuZhencong/log4j2",
"path": "log4j-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java",
"license": "apache-2.0",
"size": 66623
} | [
"org.apache.logging.log4j.Level",
"org.apache.logging.log4j.message.Message"
] | import org.apache.logging.log4j.Level; import org.apache.logging.log4j.message.Message; | import org.apache.logging.log4j.*; import org.apache.logging.log4j.message.*; | [
"org.apache.logging"
] | org.apache.logging; | 2,038,958 |
EList<RegisteredResource> getRegisteredResources(); | EList<RegisteredResource> getRegisteredResources(); | /**
* Returns the value of the '<em><b>Registered Resources</b></em>' reference list.
* The list contents are of type {@link CIM.IEC61970.Informative.MarketOperations.RegisteredResource}.
* It is bidirectional and its opposite is '{@link CIM.IEC61970.Informative.MarketOperations.RegisteredResource#getOrganisation... | Returns the value of the 'Registered Resources' reference list. The list contents are of type <code>CIM.IEC61970.Informative.MarketOperations.RegisteredResource</code>. It is bidirectional and its opposite is '<code>CIM.IEC61970.Informative.MarketOperations.RegisteredResource#getOrganisation Organisation</code>'. If th... | getRegisteredResources | {
"repo_name": "georghinkel/ttc2017smartGrids",
"path": "solutions/ModelJoin/src/main/java/CIM/IEC61970/Informative/InfERPSupport/ErpOrganisation.java",
"license": "mit",
"size": 29865
} | [
"org.eclipse.emf.common.util.EList"
] | import org.eclipse.emf.common.util.EList; | import org.eclipse.emf.common.util.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,444,752 |
public static FastDateFormat getInstance(String pattern, TimeZone timeZone) {
return getInstance(pattern, timeZone, null);
}
| static FastDateFormat function(String pattern, TimeZone timeZone) { return getInstance(pattern, timeZone, null); } | /**
* <p>Gets a formatter instance using the specified pattern and
* time zone.</p>
*
* @param pattern {@link java.text.SimpleDateFormat} compatible
* pattern
* @param timeZone optional time zone, overrides time zone of
* formatted date
* @return a pattern based date... | Gets a formatter instance using the specified pattern and time zone | getInstance | {
"repo_name": "SpoonLabs/astor",
"path": "examples/Lang-issue-428/src/main/java/org/apache/commons/lang3/time/FastDateFormat.java",
"license": "gpl-2.0",
"size": 58757
} | [
"java.util.TimeZone"
] | import java.util.TimeZone; | import java.util.*; | [
"java.util"
] | java.util; | 1,239,423 |
@Test
public void clonesInFileItself() {
CloneIndex index = createIndex();
Block[] fileBlocks = newBlocks("a", "1 2 3 1 2 4");
List<CloneGroup> result = detect(index, fileBlocks);
print(result);
assertThat(result.size(), is(1));
assertThat(result, hasCloneGroup(2,
newClonePart("a", 0... | void function() { CloneIndex index = createIndex(); Block[] fileBlocks = newBlocks("a", STR); List<CloneGroup> result = detect(index, fileBlocks); print(result); assertThat(result.size(), is(1)); assertThat(result, hasCloneGroup(2, newClonePart("a", 0, 2), newClonePart("a", 3, 2))); } | /**
* Test for problem, which was described in original paper - same clone would be reported twice.
* Given:
* <pre>
* a: 1 2 3 1 2 4
* </pre>
* Expected only one clone:
* <pre>
* a-a (1 2)
* </pre>
*/ | Test for problem, which was described in original paper - same clone would be reported twice. Given: <code> a: 1 2 3 1 2 4 </code> Expected only one clone: <code> a-a (1 2) </code> | clonesInFileItself | {
"repo_name": "joansmith/sonarqube",
"path": "sonar-duplications/src/test/java/org/sonar/duplications/detector/DetectorTestCase.java",
"license": "lgpl-3.0",
"size": 12270
} | [
"java.util.List",
"org.hamcrest.Matchers",
"org.junit.Assert",
"org.sonar.duplications.block.Block",
"org.sonar.duplications.detector.CloneGroupMatcher",
"org.sonar.duplications.index.CloneGroup",
"org.sonar.duplications.index.CloneIndex"
] | import java.util.List; import org.hamcrest.Matchers; import org.junit.Assert; import org.sonar.duplications.block.Block; import org.sonar.duplications.detector.CloneGroupMatcher; import org.sonar.duplications.index.CloneGroup; import org.sonar.duplications.index.CloneIndex; | import java.util.*; import org.hamcrest.*; import org.junit.*; import org.sonar.duplications.block.*; import org.sonar.duplications.detector.*; import org.sonar.duplications.index.*; | [
"java.util",
"org.hamcrest",
"org.junit",
"org.sonar.duplications"
] | java.util; org.hamcrest; org.junit; org.sonar.duplications; | 80,091 |
protected void emit_XConstructorCall___LeftParenthesisKeyword_4_0_RightParenthesisKeyword_4_2__q(EObject semanticObject, ISynNavigable transition, List<INode> nodes) {
acceptNodes(transition, nodes);
}
| void function(EObject semanticObject, ISynNavigable transition, List<INode> nodes) { acceptNodes(transition, nodes); } | /**
* Syntax:
* ('(' ')')?
*/ | Syntax: ('(' ')') | emit_XConstructorCall___LeftParenthesisKeyword_4_0_RightParenthesisKeyword_4_2__q | {
"repo_name": "Tocea/Architecture-Designer",
"path": "com.tocea.scertify.architecture.xadl/src/main/generated/com/tocea/scertify/architecture/xadl/serializer/ArchitectureDSLSyntacticSequencer.java",
"license": "epl-1.0",
"size": 10679
} | [
"java.util.List",
"org.eclipse.emf.ecore.EObject",
"org.eclipse.xtext.nodemodel.INode",
"org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider"
] | import java.util.List; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.nodemodel.INode; import org.eclipse.xtext.serializer.analysis.ISyntacticSequencerPDAProvider; | import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.nodemodel.*; import org.eclipse.xtext.serializer.analysis.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] | java.util; org.eclipse.emf; org.eclipse.xtext; | 222,880 |
@IgniteSpiConfiguration(optional = true)
public TcpDiscoverySpi setLocalPort(int locPort) {
this.locPort = locPort;
return this;
} | @IgniteSpiConfiguration(optional = true) TcpDiscoverySpi function(int locPort) { this.locPort = locPort; return this; } | /**
* Sets local port to listen to.
* <p>
* If not specified, default is {@link #DFLT_PORT}.
* <p>
* Affected server nodes only.
*
* @param locPort Local port to bind.
* @return {@code this} for chaining.
*/ | Sets local port to listen to. If not specified, default is <code>#DFLT_PORT</code>. Affected server nodes only | setLocalPort | {
"repo_name": "afinka77/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/spi/discovery/tcp/TcpDiscoverySpi.java",
"license": "apache-2.0",
"size": 70334
} | [
"org.apache.ignite.spi.IgniteSpiConfiguration"
] | import org.apache.ignite.spi.IgniteSpiConfiguration; | import org.apache.ignite.spi.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 836,367 |
@Override
public void notifyChanged(Notification notification) {
updateChildren(notification);
switch (notification.getFeatureID(ProcessDefinition.class)) {
case ProcessdefinitionPackage.PROCESS_DEFINITION__NODES:
case ProcessdefinitionPackage.PROCESS_DEFINITION__EDGES:
fireNotifyChanged(new ViewerNo... | void function(Notification notification) { updateChildren(notification); switch (notification.getFeatureID(ProcessDefinition.class)) { case ProcessdefinitionPackage.PROCESS_DEFINITION__NODES: case ProcessdefinitionPackage.PROCESS_DEFINITION__EDGES: fireNotifyChanged(new ViewerNotification(notification, notification.get... | /**
* This handles model notifications by calling {@link #updateChildren} to update any cached
* children and by creating a viewer notification, which it passes to {@link #fireNotifyChanged}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This handles model notifications by calling <code>#updateChildren</code> to update any cached children and by creating a viewer notification, which it passes to <code>#fireNotifyChanged</code>. | notifyChanged | {
"repo_name": "BaSys-PC1/models",
"path": "de.dfki.iui.basys.model.domain.edit/src/de/dfki/iui/basys/model/domain/processdefinition/provider/ProcessDefinitionItemProvider.java",
"license": "epl-1.0",
"size": 6747
} | [
"de.dfki.iui.basys.model.domain.processdefinition.ProcessDefinition",
"de.dfki.iui.basys.model.domain.processdefinition.ProcessdefinitionPackage",
"org.eclipse.emf.common.notify.Notification",
"org.eclipse.emf.edit.provider.ViewerNotification"
] | import de.dfki.iui.basys.model.domain.processdefinition.ProcessDefinition; import de.dfki.iui.basys.model.domain.processdefinition.ProcessdefinitionPackage; import org.eclipse.emf.common.notify.Notification; import org.eclipse.emf.edit.provider.ViewerNotification; | import de.dfki.iui.basys.model.domain.processdefinition.*; import org.eclipse.emf.common.notify.*; import org.eclipse.emf.edit.provider.*; | [
"de.dfki.iui",
"org.eclipse.emf"
] | de.dfki.iui; org.eclipse.emf; | 980,710 |
public boolean isGetAllContactsFast() {
return Display.getInstance().isGetAllContactsFast();
}
| boolean function() { return Display.getInstance().isGetAllContactsFast(); } | /**
* Indicates if the getAllContacts is platform optimized, notice that the method
* might still take seconds or more to run so you should still use a separate thread!
* @return true if getAllContacts will perform faster that just getting each contact
*/ | Indicates if the getAllContacts is platform optimized, notice that the method might still take seconds or more to run so you should still use a separate thread | isGetAllContactsFast | {
"repo_name": "skyHALud/codenameone",
"path": "CodenameOne/src/com/codename1/contacts/ContactsManager.java",
"license": "gpl-2.0",
"size": 5782
} | [
"com.codename1.ui.Display"
] | import com.codename1.ui.Display; | import com.codename1.ui.*; | [
"com.codename1.ui"
] | com.codename1.ui; | 2,055,678 |
public SpringApplicationBuilder contextClass(
Class<? extends ConfigurableApplicationContext> cls) {
this.application.setApplicationContextClass(cls);
return this;
} | SpringApplicationBuilder function( Class<? extends ConfigurableApplicationContext> cls) { this.application.setApplicationContextClass(cls); return this; } | /**
* Explicitly set the context class to be used.
* @param cls the context class to use
* @return the current builder
*/ | Explicitly set the context class to be used | contextClass | {
"repo_name": "christian-posta/spring-boot",
"path": "spring-boot/src/main/java/org/springframework/boot/builder/SpringApplicationBuilder.java",
"license": "apache-2.0",
"size": 16897
} | [
"org.springframework.context.ConfigurableApplicationContext"
] | import org.springframework.context.ConfigurableApplicationContext; | import org.springframework.context.*; | [
"org.springframework.context"
] | org.springframework.context; | 360,078 |
@ScalaOperator("!")
public Matrix2d $bang() {
return operator_not();
} | @ScalaOperator("!") public Matrix2d $bang() { return operator_not(); } | /** Replies the transposition of this matrix: {@code !this}.
*
* <p>This function is an implementation of the operator for
* the <a href="http://scala-lang.org/">Scala Language</a>.
*
* @return the transpose
* @see #add(double)
*/ | Replies the transposition of this matrix: !this. This function is an implementation of the operator for the Scala Language | $bang | {
"repo_name": "gallandarakhneorg/afc",
"path": "core/maths/mathgeom/src/main/java/org/arakhne/afc/math/matrix/Matrix2d.java",
"license": "apache-2.0",
"size": 55348
} | [
"org.arakhne.afc.vmutil.annotations.ScalaOperator"
] | import org.arakhne.afc.vmutil.annotations.ScalaOperator; | import org.arakhne.afc.vmutil.annotations.*; | [
"org.arakhne.afc"
] | org.arakhne.afc; | 19,352 |
public synchronized void removeVolumeScanner(FsVolumeSpi volume) {
if (!isEnabled()) {
LOG.debug("Not removing volume scanner for {}, because the block " +
"scanner is disabled.", volume.getStorageID());
return;
}
VolumeScanner scanner = scanners.get(volume.getStorageID());
if (s... | synchronized void function(FsVolumeSpi volume) { if (!isEnabled()) { LOG.debug(STR + STR, volume.getStorageID()); return; } VolumeScanner scanner = scanners.get(volume.getStorageID()); if (scanner == null) { LOG.warn(STR, volume.getStorageID()); return; } LOG.info(STR, volume.getBasePath(), volume.getStorageID()); scan... | /**
* Stops and removes a volume scanner.<p/>
*
* This function will block until the volume scanner has stopped.
*
* @param volume The volume to remove.
*/ | Stops and removes a volume scanner. This function will block until the volume scanner has stopped | removeVolumeScanner | {
"repo_name": "ZhangXFeng/hadoop",
"path": "src/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/BlockScanner.java",
"license": "apache-2.0",
"size": 12056
} | [
"com.google.common.util.concurrent.Uninterruptibles",
"java.util.concurrent.TimeUnit",
"org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi"
] | import com.google.common.util.concurrent.Uninterruptibles; import java.util.concurrent.TimeUnit; import org.apache.hadoop.hdfs.server.datanode.fsdataset.FsVolumeSpi; | import com.google.common.util.concurrent.*; import java.util.concurrent.*; import org.apache.hadoop.hdfs.server.datanode.fsdataset.*; | [
"com.google.common",
"java.util",
"org.apache.hadoop"
] | com.google.common; java.util; org.apache.hadoop; | 1,435,789 |
EventHandler getListener(); | EventHandler getListener(); | /**
* Returns the {@link EventHandler} that a SkyFunction should use to print any errors,
* warnings, or progress messages during execution of {@link SkyFunction#compute}.
*/ | Returns the <code>EventHandler</code> that a SkyFunction should use to print any errors, warnings, or progress messages during execution of <code>SkyFunction#compute</code> | getListener | {
"repo_name": "Digas29/bazel",
"path": "src/main/java/com/google/devtools/build/skyframe/SkyFunction.java",
"license": "apache-2.0",
"size": 12569
} | [
"com.google.devtools.build.lib.events.EventHandler"
] | import com.google.devtools.build.lib.events.EventHandler; | import com.google.devtools.build.lib.events.*; | [
"com.google.devtools"
] | com.google.devtools; | 82,248 |
@NotNull
public BaseBackoff constantDelay(final long value, @NotNull final TimeUnit unit) {
return new ConstantBackoff(mCount, unit.toMillis(value));
} | BaseBackoff function(final long value, @NotNull final TimeUnit unit) { return new ConstantBackoff(mCount, unit.toMillis(value)); } | /**
* Returns a constant backoff.
* <br>
* The backoff will always return the specified delay.
*
* @param value the delay value.
* @param unit the delay unit.
* @return the backoff instance.
* @throws java.lang.IllegalArgumentException if the delay is negative.
*/ | Returns a constant backoff. The backoff will always return the specified delay | constantDelay | {
"repo_name": "davide-maestroni/jroutine",
"path": "core/src/main/java/com/github/dm/jrt/core/common/BackoffBuilder.java",
"license": "apache-2.0",
"size": 14000
} | [
"java.util.concurrent.TimeUnit",
"org.jetbrains.annotations.NotNull"
] | import java.util.concurrent.TimeUnit; import org.jetbrains.annotations.NotNull; | import java.util.concurrent.*; import org.jetbrains.annotations.*; | [
"java.util",
"org.jetbrains.annotations"
] | java.util; org.jetbrains.annotations; | 2,194,659 |
public void writeField (Object object, String fieldName, String jsonName, Class elementType) {
Class type = object.getClass();
ObjectMap<String, FieldMetadata> fields = getFields(type);
FieldMetadata metadata = fields.get(fieldName);
if (metadata == null) throw new SerializationException("Field not found: " ... | void function (Object object, String fieldName, String jsonName, Class elementType) { Class type = object.getClass(); ObjectMap<String, FieldMetadata> fields = getFields(type); FieldMetadata metadata = fields.get(fieldName); if (metadata == null) throw new SerializationException(STR + fieldName + STR + type.getName() +... | /** Writes the specified field to the current JSON object.
* @param elementType May be null if the type is unknown. */ | Writes the specified field to the current JSON object | writeField | {
"repo_name": "bsmr-java/libgdx",
"path": "gdx/src/com/badlogic/gdx/utils/Json.java",
"license": "apache-2.0",
"size": 41015
} | [
"com.badlogic.gdx.utils.reflect.Field",
"com.badlogic.gdx.utils.reflect.ReflectionException"
] | import com.badlogic.gdx.utils.reflect.Field; import com.badlogic.gdx.utils.reflect.ReflectionException; | import com.badlogic.gdx.utils.reflect.*; | [
"com.badlogic.gdx"
] | com.badlogic.gdx; | 1,766,207 |
//////////////// PLUGIN ENTRY POINT /////////////////////////////
public boolean execute(String action, JSONArray args, CallbackContext callbackContext) {
if (action.equals("onDomDelegateReady")) {
onDomDelegateReady(callbackContext);
} else if (action.equals("disableDebugNotification... | boolean function(String action, JSONArray args, CallbackContext callbackContext) { if (action.equals(STR)) { onDomDelegateReady(callbackContext); } else if (action.equals(STR)) { disableDebugNotifications(callbackContext); } else if (action.equals(STR)) { enableDebugNotifications(callbackContext); } else if (action.equ... | /**
* Executes the request and returns PluginResult.
*
* @param action The action to execute.
* @param args JSONArray of arguments for the plugin.
* @param callbackContext The callback id used when calling back into JavaScript.
* @return True if t... | Executes the request and returns PluginResult | execute | {
"repo_name": "trieudv/bea",
"path": "src/android/LocationManager.java",
"license": "apache-2.0",
"size": 45164
} | [
"org.apache.cordova.CallbackContext",
"org.json.JSONArray"
] | import org.apache.cordova.CallbackContext; import org.json.JSONArray; | import org.apache.cordova.*; import org.json.*; | [
"org.apache.cordova",
"org.json"
] | org.apache.cordova; org.json; | 652,278 |
checkStack(stack);// check the stack
// initialize the result to the first argument
Object first = stack.pop();
if (!(first instanceof Double)) {
throw new ParseException(
"Invalid parameter type, only numbers are allowed for 'min'.");
}
Double currentMin = (Double) first;
int i = 1;
// repea... | checkStack(stack); Object first = stack.pop(); if (!(first instanceof Double)) { throw new ParseException( STR); } Double currentMin = (Double) first; int i = 1; while (i < curNumberOfParameters) { Object param = stack.pop(); if (param instanceof Double) { Double currentValue = (Double) param; currentMin = Math.min(cur... | /**
* Calculates the result of summing up all parameters, which are assumed to
* be of the Double type.
*/ | Calculates the result of summing up all parameters, which are assumed to be of the Double type | run | {
"repo_name": "rapidminer/rapidminer-5",
"path": "src_agpl/com/rapidminer/tools/jep/function/expressions/Minimum.java",
"license": "agpl-3.0",
"size": 2290
} | [
"org.nfunk.jep.ParseException"
] | import org.nfunk.jep.ParseException; | import org.nfunk.jep.*; | [
"org.nfunk.jep"
] | org.nfunk.jep; | 2,581,110 |
// OreDict entry
if (ingredient instanceof IOreDictEntry) {
String ore = ((IOreDictEntry) ingredient).getName();
return new Tuple<>(ore, ingredient.getAmount());
}
// Literal ItemStack
if (ingredient instanceof IItemStack) {
ItemStack stack = CraftTw... | if (ingredient instanceof IOreDictEntry) { String ore = ((IOreDictEntry) ingredient).getName(); return new Tuple<>(ore, ingredient.getAmount()); } if (ingredient instanceof IItemStack) { ItemStack stack = CraftTweakerMC.getItemStack((IItemStack) ingredient); return new Tuple<>(stack, stack.getCount()); } if (ingredient... | /**
* Converts from CraftTweaker ingredients to AlloyRecipe ingredients
*
* @param ingredient The CraftTweaker ingredient to be converted
* @return The converted ingredient, or null for unsupported ingredients
*/ | Converts from CraftTweaker ingredients to AlloyRecipe ingredients | convertIngredient | {
"repo_name": "elytra/Teckle",
"path": "src/main/java/com/elytradev/teckle/compat/ct/TeckleCTUtils.java",
"license": "apache-2.0",
"size": 6303
} | [
"net.minecraft.item.ItemStack",
"net.minecraft.util.Tuple"
] | import net.minecraft.item.ItemStack; import net.minecraft.util.Tuple; | import net.minecraft.item.*; import net.minecraft.util.*; | [
"net.minecraft.item",
"net.minecraft.util"
] | net.minecraft.item; net.minecraft.util; | 642,717 |
public void generateSelect(CharBuffer cb)
{
generateSelect(cb, true);
} | void function(CharBuffer cb) { generateSelect(cb, true); } | /**
* Generates the where expression.
*/ | Generates the where expression | generateSelect | {
"repo_name": "dlitz/resin",
"path": "modules/resin/src/com/caucho/amber/expr/LoadExpr.java",
"license": "gpl-2.0",
"size": 5801
} | [
"com.caucho.util.CharBuffer"
] | import com.caucho.util.CharBuffer; | import com.caucho.util.*; | [
"com.caucho.util"
] | com.caucho.util; | 1,714,959 |
private LocalizedResource getCurrentAppUI(HttpServletRequest request, String[] locale )
{
LocalizedResource localUtil;
String acceptLanguage = request.getHeader("Accept-Language");
localUtil = new LocalizedResource(SERVLET_PROP_MESSAGES);
// if no language specified use one set b... | LocalizedResource function(HttpServletRequest request, String[] locale ) { LocalizedResource localUtil; String acceptLanguage = request.getHeader(STR); localUtil = new LocalizedResource(SERVLET_PROP_MESSAGES); locale[ 0 ] = null; if (acceptLanguage == null) { return localUtil; } StringTokenizer tokenizer = new StringTo... | /**
* Determine the locale file needed for this browsers preferences
* Defaults to the settings for derby.locale and derby.codeset if set
* English otherwise if browsers preferences can't be found
*
* @param request HttpServetRequest for forms
* @param locale ... | Determine the locale file needed for this browsers preferences Defaults to the settings for derby.locale and derby.codeset if set English otherwise if browsers preferences can't be found | getCurrentAppUI | {
"repo_name": "trejkaz/derby",
"path": "java/drda/org/apache/derby/drda/NetServlet.java",
"license": "apache-2.0",
"size": 44974
} | [
"java.util.StringTokenizer",
"javax.servlet.http.HttpServletRequest",
"org.apache.derby.iapi.tools.i18n.LocalizedResource"
] | import java.util.StringTokenizer; import javax.servlet.http.HttpServletRequest; import org.apache.derby.iapi.tools.i18n.LocalizedResource; | import java.util.*; import javax.servlet.http.*; import org.apache.derby.iapi.tools.i18n.*; | [
"java.util",
"javax.servlet",
"org.apache.derby"
] | java.util; javax.servlet; org.apache.derby; | 1,931,596 |
// We runtime type check the return value so we can safely ignore this unchecked
// assignment error.
@SuppressWarnings("unchecked")
public ArrayList<String> getAsListOfStrings(String key, boolean shouldCreateIfNotFound) {
ArrayList<String> retval = null;
if ((!TextUtils.isEmpty(key)) &&... | @SuppressWarnings(STR) ArrayList<String> function(String key, boolean shouldCreateIfNotFound) { ArrayList<String> retval = null; if ((!TextUtils.isEmpty(key)) && (containsKey(key))) { Object value = get(key); if (value instanceof ArrayList) { for (Object v : (ArrayList) value) assert v instanceof String; retval = (Arra... | /**
* Convenience method used to retrieve a named value as an array of strings.
*
* @param key The key of the value to be retrieved
* @param shouldCreateIfNotFound Flag indicating whether or not a new \e ArrayList<String> object should
* be creat... | Convenience method used to retrieve a named value as an array of strings | getAsListOfStrings | {
"repo_name": "janrain/engage.android",
"path": "Jump/src/com/janrain/android/engage/types/JRDictionary.java",
"license": "bsd-3-clause",
"size": 18837
} | [
"android.text.TextUtils",
"java.util.ArrayList"
] | import android.text.TextUtils; import java.util.ArrayList; | import android.text.*; import java.util.*; | [
"android.text",
"java.util"
] | android.text; java.util; | 725,304 |
protected final String deserializeId(final SOAPHeader header) {
logger.debug(DESERIALIZE_LOG_PATTERN, Constants.NS_XRD_ELEM_ID);
String id = null;
NodeList list = header.getElementsByTagNameNS(Constants.NS_XRD_URL, Constants.NS_XRD_ELEM_ID);
if (list.getLength() == 1) {
i... | final String function(final SOAPHeader header) { logger.debug(DESERIALIZE_LOG_PATTERN, Constants.NS_XRD_ELEM_ID); String id = null; NodeList list = header.getElementsByTagNameNS(Constants.NS_XRD_URL, Constants.NS_XRD_ELEM_ID); if (list.getLength() == 1) { id = list.item(0).getTextContent(); logger.trace(ELEMENT_FOUND_L... | /**
* Deserializes the id element of the SOAP header to a String.
*
* @param header SOAP header to be deserialized
* @return id represented as a String
*/ | Deserializes the id element of the SOAP header to a String | deserializeId | {
"repo_name": "petkivim/xrd4j",
"path": "src/common/src/main/java/com/pkrete/xrd4j/common/deserializer/AbstractHeaderDeserializer.java",
"license": "mit",
"size": 17911
} | [
"com.pkrete.xrd4j.common.util.Constants",
"javax.xml.soap.SOAPHeader",
"org.w3c.dom.NodeList"
] | import com.pkrete.xrd4j.common.util.Constants; import javax.xml.soap.SOAPHeader; import org.w3c.dom.NodeList; | import com.pkrete.xrd4j.common.util.*; import javax.xml.soap.*; import org.w3c.dom.*; | [
"com.pkrete.xrd4j",
"javax.xml",
"org.w3c.dom"
] | com.pkrete.xrd4j; javax.xml; org.w3c.dom; | 1,907,858 |
public final void testGetFormat() {
byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4};
PKCS8EncodedKeySpec meks = new PKCS8EncodedKeySpec(encodedKey);
assertEquals("PKCS#8", meks.getFormat());
} | final void function() { byte[] encodedKey = new byte[] {(byte)1,(byte)2,(byte)3,(byte)4}; PKCS8EncodedKeySpec meks = new PKCS8EncodedKeySpec(encodedKey); assertEquals(STR, meks.getFormat()); } | /**
* Test for <code>getFormat()</code> method
* Assertion: returns format name (always "PKCS#8")
*/ | Test for <code>getFormat()</code> method Assertion: returns format name (always "PKCS#8") | testGetFormat | {
"repo_name": "rex-xxx/mt6572_x201",
"path": "external/apache-harmony/security/src/test/api/java/org/apache/harmony/security/tests/java/security/spec/PKCS8EncodedKeySpecTest.java",
"license": "gpl-2.0",
"size": 4302
} | [
"java.security.spec.PKCS8EncodedKeySpec"
] | import java.security.spec.PKCS8EncodedKeySpec; | import java.security.spec.*; | [
"java.security"
] | java.security; | 2,229,855 |
@Message(id = 27, value = "Invalid rollout plan. Server group %s appears more than once in the plan.")
String invalidRolloutPlanGroupAlreadyExists(String group); | @Message(id = 27, value = STR) String invalidRolloutPlanGroupAlreadyExists(String group); | /**
* A message indicating an invalid rollout plan. The server group, represented by the {@code group} parameter,
* appears more than once in the plan.
*
* @param group the server group that appears more than once.
*
* @return the message.
*/ | A message indicating an invalid rollout plan. The server group, represented by the group parameter, appears more than once in the plan | invalidRolloutPlanGroupAlreadyExists | {
"repo_name": "jamezp/wildfly-core",
"path": "host-controller/src/main/java/org/jboss/as/domain/controller/logging/DomainControllerLogger.java",
"license": "lgpl-2.1",
"size": 34982
} | [
"org.jboss.logging.annotations.Message"
] | import org.jboss.logging.annotations.Message; | import org.jboss.logging.annotations.*; | [
"org.jboss.logging"
] | org.jboss.logging; | 468,271 |
public boolean remove(String name, String value) {
try {
openForWriting();
// delete documents matching term
writer.deleteDocuments(new Term(name, value));
return true;
} catch (Exception ex) {
LOGGER.log(Level.WARNING, "Error removing value from the collector.", ex);
return false;
... | boolean function(String name, String value) { try { openForWriting(); writer.deleteDocuments(new Term(name, value)); return true; } catch (Exception ex) { LOGGER.log(Level.WARNING, STR, ex); return false; } } | /**
* Removes string from the collection.
* @param name field name
* @param value field value
* @return <code>true</code> if removing array succeed
*/ | Removes string from the collection | remove | {
"repo_name": "usgin/usgin-geoportal",
"path": "src/com/esri/gpt/control/webharvest/engine/SourceUriArray.java",
"license": "apache-2.0",
"size": 6696
} | [
"java.util.logging.Level",
"org.apache.lucene.index.Term"
] | import java.util.logging.Level; import org.apache.lucene.index.Term; | import java.util.logging.*; import org.apache.lucene.index.*; | [
"java.util",
"org.apache.lucene"
] | java.util; org.apache.lucene; | 1,337,239 |
public ProcessStep addInstrument(final int index, final Instrument instrument) {
if (this.instruments == null) {
this.instruments = new ArrayList<>();
}
this.instruments.add(index, instrument);
return this;
} | ProcessStep function(final int index, final Instrument instrument) { if (this.instruments == null) { this.instruments = new ArrayList<>(); } this.instruments.add(index, instrument); return this; } | /**
* Insert a single instrument for the process step at the input index.
*
* @param index Index at which to insert the input instrument.
* @param instrument {@link Instrument} object to add to the process step.
* @return This object.
*/ | Insert a single instrument for the process step at the input index | addInstrument | {
"repo_name": "kjaym/jpif",
"path": "src/main/java/io/citrine/jpif/obj/common/ProcessStep.java",
"license": "apache-2.0",
"size": 12424
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,267,488 |
Set<String> getProteinAccessions();
| Set<String> getProteinAccessions(); | /**
* Returns the accessions of all protein entries in the database.
*
* @return the accessions
*/ | Returns the accessions of all protein entries in the database | getProteinAccessions | {
"repo_name": "mmueller76/sigpep",
"path": "sigpep-app/src/main/java/org/sigpep/SigPepQueryService.java",
"license": "gpl-2.0",
"size": 8284
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,202,092 |
public static void show(String caption, String description, Type type) {
new Notification(caption, description, type).show(Page.getCurrent());
} | static void function(String caption, String description, Type type) { new Notification(caption, description, type).show(Page.getCurrent()); } | /**
* Shows a notification message the current page. The position and behavior
* of the message depends on the type, which is one of the basic types
* defined in {@link Notification}, for instance
* Notification.TYPE_WARNING_MESSAGE.
*
* The caption is rendered as plain text with HTML auto... | Shows a notification message the current page. The position and behavior of the message depends on the type, which is one of the basic types defined in <code>Notification</code>, for instance Notification.TYPE_WARNING_MESSAGE. The caption is rendered as plain text with HTML automatically escaped | show | {
"repo_name": "peterl1084/framework",
"path": "server/src/main/java/com/vaadin/ui/Notification.java",
"license": "apache-2.0",
"size": 13662
} | [
"com.vaadin.server.Page"
] | import com.vaadin.server.Page; | import com.vaadin.server.*; | [
"com.vaadin.server"
] | com.vaadin.server; | 2,107,298 |
public EntityResolver getEntityResolver ()
{
return entityResolver;
} | EntityResolver function () { return entityResolver; } | /**
* Return the current entity resolver.
*
* @return The current entity resolver, or null if none was supplied.
* @see XMLReader#getEntityResolver
*/ | Return the current entity resolver | getEntityResolver | {
"repo_name": "wangsongpeng/jdk-src",
"path": "src/main/java/org/xml/sax/helpers/ParserAdapter.java",
"license": "apache-2.0",
"size": 31658
} | [
"org.xml.sax.EntityResolver"
] | import org.xml.sax.EntityResolver; | import org.xml.sax.*; | [
"org.xml.sax"
] | org.xml.sax; | 1,028,705 |
@Test
public void testPostCreateModel_ReturnsNoContent() throws Exception {
createEnvConfigurationAndModule();
reinitializeCoreComponent();
mockMvc.perform(
post(REST_MODULE_CREATE_MODEL_URI, randomModule, randomEnvironment2).accept(MediaType.APPLICATION_XML))
.andExpect(content().string(IsEmp... | void function() throws Exception { createEnvConfigurationAndModule(); reinitializeCoreComponent(); mockMvc.perform( post(REST_MODULE_CREATE_MODEL_URI, randomModule, randomEnvironment2).accept(MediaType.APPLICATION_XML)) .andExpect(content().string(IsEmptyString.isEmptyString())); } | /**
* Test that POST "Create Model" service invocation returns no content.
*
* @throws Exception if test fails.
*/ | Test that POST "Create Model" service invocation returns no content | testPostCreateModel_ReturnsNoContent | {
"repo_name": "athrane/pineapple",
"path": "applications/pineapple-web-application/pineapple-web-application-war/src/test/java/com/alpha/pineapple/web/spring/rest/ModulesControllerIntegrationTest.java",
"license": "gpl-3.0",
"size": 24005
} | [
"org.hamcrest.text.IsEmptyString",
"org.springframework.http.MediaType",
"org.springframework.test.web.servlet.request.MockMvcRequestBuilders"
] | import org.hamcrest.text.IsEmptyString; import org.springframework.http.MediaType; import org.springframework.test.web.servlet.request.MockMvcRequestBuilders; | import org.hamcrest.text.*; import org.springframework.http.*; import org.springframework.test.web.servlet.request.*; | [
"org.hamcrest.text",
"org.springframework.http",
"org.springframework.test"
] | org.hamcrest.text; org.springframework.http; org.springframework.test; | 2,754,626 |
private void addLicense(Dependency d, String license) {
if (d.getLicense() == null) {
d.setLicense(license);
} else if (!d.getLicense().contains(license)) {
d.setLicense(d.getLicense() + NEWLINE + license);
}
}
private File tempFileLocation = null; | void function(Dependency d, String license) { if (d.getLicense() == null) { d.setLicense(license); } else if (!d.getLicense().contains(license)) { d.setLicense(d.getLicense() + NEWLINE + license); } } private File tempFileLocation = null; | /**
* Adds a license to the given dependency.
*
* @param d a dependency
* @param license the license
*/ | Adds a license to the given dependency | addLicense | {
"repo_name": "Prakhash/security-tools",
"path": "external/dependency-check-core-3.1.1/src/main/java/org/owasp/dependencycheck/analyzer/JarAnalyzer.java",
"license": "apache-2.0",
"size": 56721
} | [
"java.io.File",
"org.owasp.dependencycheck.dependency.Dependency"
] | import java.io.File; import org.owasp.dependencycheck.dependency.Dependency; | import java.io.*; import org.owasp.dependencycheck.dependency.*; | [
"java.io",
"org.owasp.dependencycheck"
] | java.io; org.owasp.dependencycheck; | 2,471,842 |
public String getScriptName()
{
return StringUtils.isEmpty(scriptName) ? "" : scriptName;
} | String function() { return StringUtils.isEmpty(scriptName) ? "" : scriptName; } | /**
* Get the script name
*
* @return the script name.
*/ | Get the script name | getScriptName | {
"repo_name": "Konque/J2-Admin",
"path": "src/main/java/org/apache/jetspeed/security/mfa/util/ServerData.java",
"license": "apache-2.0",
"size": 6149
} | [
"org.apache.commons.lang.StringUtils"
] | import org.apache.commons.lang.StringUtils; | import org.apache.commons.lang.*; | [
"org.apache.commons"
] | org.apache.commons; | 2,446,884 |
public static boolean isEnabled (@Nonnull final Class <?> aLoggingClass, @Nonnull final IErrorLevel aErrorLevel)
{
return isEnabled (LoggerFactory.getLogger (aLoggingClass), aErrorLevel);
} | static boolean function (@Nonnull final Class <?> aLoggingClass, @Nonnull final IErrorLevel aErrorLevel) { return isEnabled (LoggerFactory.getLogger (aLoggingClass), aErrorLevel); } | /**
* Check if logging is enabled for the passed class based on the error level
* provided
*
* @param aLoggingClass
* The class to determine the logger from. May not be <code>null</code>
* .
* @param aErrorLevel
* The error level. May not be <code>null</code>.
* @return <... | Check if logging is enabled for the passed class based on the error level provided | isEnabled | {
"repo_name": "phax/ph-commons",
"path": "ph-commons/src/main/java/com/helger/commons/log/LogHelper.java",
"license": "apache-2.0",
"size": 17308
} | [
"com.helger.commons.error.level.IErrorLevel",
"javax.annotation.Nonnull",
"org.slf4j.LoggerFactory"
] | import com.helger.commons.error.level.IErrorLevel; import javax.annotation.Nonnull; import org.slf4j.LoggerFactory; | import com.helger.commons.error.level.*; import javax.annotation.*; import org.slf4j.*; | [
"com.helger.commons",
"javax.annotation",
"org.slf4j"
] | com.helger.commons; javax.annotation; org.slf4j; | 122,197 |
Set<String> getColumnNames(); | Set<String> getColumnNames(); | /**
* Get columns names composing the tuple
*
* @return the columns names
*/ | Get columns names composing the tuple | getColumnNames | {
"repo_name": "DavideD/hibernate-ogm",
"path": "core/src/main/java/org/hibernate/ogm/model/spi/TupleSnapshot.java",
"license": "lgpl-2.1",
"size": 1774
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 484,107 |
public ClientMessage sendMessage(String address, byte[] body) {
return sendMessage(SimpleString.toSimpleString(address), body);
} | ClientMessage function(String address, byte[] body) { return sendMessage(SimpleString.toSimpleString(address), body); } | /**
* Create a new message with the specified body, and send the message to an address
*
* @param address the target queueName for the message
* @param body the body for the new message
* @return the message that was sent
*/ | Create a new message with the specified body, and send the message to an address | sendMessage | {
"repo_name": "okalmanRH/jboss-activemq-artemis",
"path": "artemis-junit/src/main/java/org/apache/activemq/artemis/junit/EmbeddedActiveMQResource.java",
"license": "apache-2.0",
"size": 31465
} | [
"org.apache.activemq.artemis.api.core.SimpleString",
"org.apache.activemq.artemis.api.core.client.ClientMessage"
] | import org.apache.activemq.artemis.api.core.SimpleString; import org.apache.activemq.artemis.api.core.client.ClientMessage; | import org.apache.activemq.artemis.api.core.*; import org.apache.activemq.artemis.api.core.client.*; | [
"org.apache.activemq"
] | org.apache.activemq; | 737,269 |
protected DatabaseDriver getDriverAt(TreePath path) {
if (path != null) {
Object object = path.getLastPathComponent();
if (object instanceof DatabaseDriverNode) {
return ((DatabaseDriverNode)object).getDriver();
}
}
return null;
} | DatabaseDriver function(TreePath path) { if (path != null) { Object object = path.getLastPathComponent(); if (object instanceof DatabaseDriverNode) { return ((DatabaseDriverNode)object).getDriver(); } } return null; } | /**
* Returns the database driver associated with the specified path.
*
* @return the driver properties object
*/ | Returns the database driver associated with the specified path | getDriverAt | {
"repo_name": "toxeh/ExecuteQuery",
"path": "java/src/org/executequery/gui/drivers/DriversTreePanel.java",
"license": "gpl-3.0",
"size": 22699
} | [
"javax.swing.tree.TreePath",
"org.executequery.databasemediators.DatabaseDriver"
] | import javax.swing.tree.TreePath; import org.executequery.databasemediators.DatabaseDriver; | import javax.swing.tree.*; import org.executequery.databasemediators.*; | [
"javax.swing",
"org.executequery.databasemediators"
] | javax.swing; org.executequery.databasemediators; | 1,764,618 |
private static int med3( final int a, final int b, final int c, final IntComparator comp ) {
int ab = comp.compare( a, b );
int ac = comp.compare( a, c );
int bc = comp.compare( b, c );
return ( ab < 0 ?
( bc < 0 ? b : ac < 0 ? c : a ) :
( bc > 0 ? b : ac > 0 ? c : a ) );
} | static int function( final int a, final int b, final int c, final IntComparator comp ) { int ab = comp.compare( a, b ); int ac = comp.compare( a, c ); int bc = comp.compare( b, c ); return ( ab < 0 ? ( bc < 0 ? b : ac < 0 ? c : a ) : ( bc > 0 ? b : ac > 0 ? c : a ) ); } | /**
* Returns the index of the median of the three indexed chars.
*/ | Returns the index of the median of the three indexed chars | med3 | {
"repo_name": "benson-basis/fastutil",
"path": "src/it/unimi/dsi/fastutil/Arrays.java",
"license": "apache-2.0",
"size": 12791
} | [
"it.unimi.dsi.fastutil.ints.IntComparator"
] | import it.unimi.dsi.fastutil.ints.IntComparator; | import it.unimi.dsi.fastutil.ints.*; | [
"it.unimi.dsi"
] | it.unimi.dsi; | 1,617,258 |
EAttribute getLocatedElement_CommentsBefore(); | EAttribute getLocatedElement_CommentsBefore(); | /**
* Returns the meta object for the attribute list '{@link anatlyzer.atlext.ATL.LocatedElement#getCommentsBefore <em>Comments Before</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute list '<em>Comments Before</em>'.
* @see anatlyzer.atlext.ATL.LocatedEleme... | Returns the meta object for the attribute list '<code>anatlyzer.atlext.ATL.LocatedElement#getCommentsBefore Comments Before</code>'. | getLocatedElement_CommentsBefore | {
"repo_name": "jesusc/anatlyzer",
"path": "plugins/anatlyzer.atl.typing/src-gen/anatlyzer/atlext/ATL/ATLPackage.java",
"license": "epl-1.0",
"size": 222096
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 569,996 |
void addAdvisor(int pos, Advisor advisor) throws AopConfigException;
/**
* Remove the given advisor.
* @param advisor the advisor to remove
* @return {@code true} if the advisor was removed; {@code false} | void addAdvisor(int pos, Advisor advisor) throws AopConfigException; /** * Remove the given advisor. * @param advisor the advisor to remove * @return {@code true} if the advisor was removed; {@code false} | /**
* Add an Advisor at the specified position in the chain.
* @param advisor the advisor to add at the specified position in the chain
* @param pos position in chain (0 is head). Must be valid.
* @throws AopConfigException in case of invalid advice
*/ | Add an Advisor at the specified position in the chain | addAdvisor | {
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-aop/src/main/java/org/springframework/aop/framework/Advised.java",
"license": "apache-2.0",
"size": 8473
} | [
"org.springframework.aop.Advisor"
] | import org.springframework.aop.Advisor; | import org.springframework.aop.*; | [
"org.springframework.aop"
] | org.springframework.aop; | 1,362,200 |
public void onBlockPlacedBy(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) {
// NO-OP
}
public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { return false; } | void function(World world, int x, int y, int z, EntityLivingBase entity, ItemStack stack) { } public boolean onBlockActivated(World world, int x, int y, int z, EntityPlayer player, int side, float hitX, float hitY, float hitZ) { return false; } | /**
* Called when this sub tile is placed in the world (by an entity).
*/ | Called when this sub tile is placed in the world (by an entity) | onBlockPlacedBy | {
"repo_name": "TeamFRM/TheImpossibleCrossover",
"path": "src/api/java/vazkii/botania/api/subtile/SubTileEntity.java",
"license": "gpl-3.0",
"size": 6001
} | [
"net.minecraft.entity.EntityLivingBase",
"net.minecraft.entity.player.EntityPlayer",
"net.minecraft.item.ItemStack",
"net.minecraft.world.World"
] | import net.minecraft.entity.EntityLivingBase; import net.minecraft.entity.player.EntityPlayer; import net.minecraft.item.ItemStack; import net.minecraft.world.World; | import net.minecraft.entity.*; import net.minecraft.entity.player.*; import net.minecraft.item.*; import net.minecraft.world.*; | [
"net.minecraft.entity",
"net.minecraft.item",
"net.minecraft.world"
] | net.minecraft.entity; net.minecraft.item; net.minecraft.world; | 489,536 |
public static void setUser(UserBase user) {
threadLocal.set(user);
} | static void function(UserBase user) { threadLocal.set(user); } | /**
* Sets the user.
*
* @param user the user
*
* @return the user
*/ | Sets the user | setUser | {
"repo_name": "clstoulouse/motu",
"path": "motu-library-cas/src/main/java/fr/cls/atoll/motu/library/cas/util/MotuUserHolder.java",
"license": "lgpl-3.0",
"size": 4022
} | [
"fr.cls.atoll.motu.library.cas.UserBase"
] | import fr.cls.atoll.motu.library.cas.UserBase; | import fr.cls.atoll.motu.library.cas.*; | [
"fr.cls.atoll"
] | fr.cls.atoll; | 1,853,472 |
@Generated
@CVariable()
@MappedReturn(ObjCStringMapper.class)
public static native String GCHapticsLocalityAll(); | @CVariable() @MappedReturn(ObjCStringMapper.class) static native String function(); | /**
* guaranteed to be supported
*/ | guaranteed to be supported | GCHapticsLocalityAll | {
"repo_name": "multi-os-engine/moe-core",
"path": "moe.apple/moe.platform.ios/src/main/java/apple/gamecontroller/c/GameController.java",
"license": "apache-2.0",
"size": 61506
} | [
"org.moe.natj.c.ann.CVariable",
"org.moe.natj.general.ann.MappedReturn",
"org.moe.natj.objc.map.ObjCStringMapper"
] | import org.moe.natj.c.ann.CVariable; import org.moe.natj.general.ann.MappedReturn; import org.moe.natj.objc.map.ObjCStringMapper; | import org.moe.natj.c.ann.*; import org.moe.natj.general.ann.*; import org.moe.natj.objc.map.*; | [
"org.moe.natj"
] | org.moe.natj; | 1,250,394 |
public void addRenderedRouterOnFabric(String fabricId, NodeId renderedLr) {
this.renderedRouters.put(fabricId, renderedLr);
} | void function(String fabricId, NodeId renderedLr) { this.renderedRouters.put(fabricId, renderedLr); } | /**
* Cache a rendered logical router
* @param fabricId - fabric identifier
* @param renderedLr - the corresponding rendered logical router on a fabric.
*/ | Cache a rendered logical router | addRenderedRouterOnFabric | {
"repo_name": "opendaylight/faas",
"path": "fabric-mgr/uln-cache/src/main/java/org/opendaylight/faas/uln/cache/UserLogicalNetworkCache.java",
"license": "epl-1.0",
"size": 54820
} | [
"org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId"
] | import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; | import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.*; | [
"org.opendaylight.yang"
] | org.opendaylight.yang; | 826,774 |
boolean updateMapping(IndexMetaData indexMetaData) throws IOException; | boolean updateMapping(IndexMetaData indexMetaData) throws IOException; | /**
* Checks if index requires refresh from master.
*/ | Checks if index requires refresh from master | updateMapping | {
"repo_name": "zkidkid/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java",
"license": "apache-2.0",
"size": 43179
} | [
"java.io.IOException",
"org.elasticsearch.cluster.metadata.IndexMetaData"
] | import java.io.IOException; import org.elasticsearch.cluster.metadata.IndexMetaData; | import java.io.*; import org.elasticsearch.cluster.metadata.*; | [
"java.io",
"org.elasticsearch.cluster"
] | java.io; org.elasticsearch.cluster; | 1,842,231 |
private Subscription validateSubsciptionForUnsubscribe(String subId)
throws SubscriptionStateException, SubscriptionStillActiveException,
ObjectNotFoundException {
Subscription subscription = manageBean.loadSubscription(subId, 0);
stateValidator.checkUnsubscribingAllowed(subs... | Subscription function(String subId) throws SubscriptionStateException, SubscriptionStillActiveException, ObjectNotFoundException { Subscription subscription = manageBean.loadSubscription(subId, 0); stateValidator.checkUnsubscribingAllowed(subscription); List<Session> activeSessions = prodSessionMgmt .getProductSessions... | /**
* Obtains the subscription and verifies that the current settings allow a
* unsubscribe operation.
*
* @param subId
* The subscription id to unsubscribe from.
* @return The subscription to unsubscribe from.
* @throws SubscriptionStateException
* Thrown... | Obtains the subscription and verifies that the current settings allow a unsubscribe operation | validateSubsciptionForUnsubscribe | {
"repo_name": "opetrovski/development",
"path": "oscm-subscriptionmgmt/javasrc/org/oscm/subscriptionservice/bean/SubscriptionServiceBean.java",
"license": "apache-2.0",
"size": 259543
} | [
"java.util.List",
"org.oscm.domobjects.Session",
"org.oscm.domobjects.Subscription",
"org.oscm.internal.types.exception.ObjectNotFoundException",
"org.oscm.internal.types.exception.SubscriptionMigrationException",
"org.oscm.internal.types.exception.SubscriptionStateException",
"org.oscm.internal.types.e... | import java.util.List; import org.oscm.domobjects.Session; import org.oscm.domobjects.Subscription; import org.oscm.internal.types.exception.ObjectNotFoundException; import org.oscm.internal.types.exception.SubscriptionMigrationException; import org.oscm.internal.types.exception.SubscriptionStateException; import org.o... | import java.util.*; import org.oscm.domobjects.*; import org.oscm.internal.types.exception.*; import org.oscm.logging.*; import org.oscm.types.enumtypes.*; | [
"java.util",
"org.oscm.domobjects",
"org.oscm.internal",
"org.oscm.logging",
"org.oscm.types"
] | java.util; org.oscm.domobjects; org.oscm.internal; org.oscm.logging; org.oscm.types; | 2,729,776 |
Optional<ParticleType> getParticleType(String name); | Optional<ParticleType> getParticleType(String name); | /**
* Gets a {@link ParticleType} by name.
*
* @param name The particle name
* @return The corresponding particle or Optional.absent() if not found
*/ | Gets a <code>ParticleType</code> by name | getParticleType | {
"repo_name": "SpongeHistory/SpongeAPI-History",
"path": "src/main/java/org/spongepowered/api/GameRegistry.java",
"license": "mit",
"size": 37085
} | [
"com.google.common.base.Optional",
"org.spongepowered.api.effect.particle.ParticleType"
] | import com.google.common.base.Optional; import org.spongepowered.api.effect.particle.ParticleType; | import com.google.common.base.*; import org.spongepowered.api.effect.particle.*; | [
"com.google.common",
"org.spongepowered.api"
] | com.google.common; org.spongepowered.api; | 1,218,056 |
public HRegionLocation getRegionLocation(final byte [] row) throws IOException; | HRegionLocation function(final byte [] row) throws IOException; | /**
* Finds the region on which the given row is being served. Does not reload the cache.
* @param row Row to find.
* @return Location of the row.
* @throws IOException if a remote or network exception occurs
*/ | Finds the region on which the given row is being served. Does not reload the cache | getRegionLocation | {
"repo_name": "gustavoanatoly/hbase",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/client/RegionLocator.java",
"license": "apache-2.0",
"size": 3517
} | [
"java.io.IOException",
"org.apache.hadoop.hbase.HRegionLocation"
] | import java.io.IOException; import org.apache.hadoop.hbase.HRegionLocation; | import java.io.*; import org.apache.hadoop.hbase.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 1,066,386 |
if (!(o instanceof Pair)) {
return false;
}
Pair<?, ?> p = (Pair<?, ?>) o;
return Objects.equals(p.first, first) && Objects.equals(p.second, second);
} | if (!(o instanceof Pair)) { return false; } Pair<?, ?> p = (Pair<?, ?>) o; return Objects.equals(p.first, first) && Objects.equals(p.second, second); } | /**
* Checks the two objects for equality by delegating to their respective
* {@link Object#equals(Object)} methods.
*
* @param o the {@link Pair} to which this one is to be checked for equality
* @return true if the underlying objects of the Pair are both considered
* equal
*... | Checks the two objects for equality by delegating to their respective <code>Object#equals(Object)</code> methods | equals | {
"repo_name": "mirego/j2objc",
"path": "jre_emul/android/frameworks/base/core/java/android/util/Pair.java",
"license": "apache-2.0",
"size": 2415
} | [
"java.util.Objects"
] | import java.util.Objects; | import java.util.*; | [
"java.util"
] | java.util; | 2,896,911 |
@NotNull
@Size(max = 64)
public String getGraduationDesignTeacherId() {
return (String) get(6);
} | @Size(max = 64) String function() { return (String) get(6); } | /**
* Getter for <code>isy.graduation_design_plan.graduation_design_teacher_id</code>.
*/ | Getter for <code>isy.graduation_design_plan.graduation_design_teacher_id</code> | getGraduationDesignTeacherId | {
"repo_name": "zbeboy/ISY",
"path": "src/main/java/top/zbeboy/isy/domain/tables/records/GraduationDesignPlanRecord.java",
"license": "mit",
"size": 10961
} | [
"javax.validation.constraints.Size"
] | import javax.validation.constraints.Size; | import javax.validation.constraints.*; | [
"javax.validation"
] | javax.validation; | 2,794,846 |
@Nullable Event bridge$createSpongeEvent(); | @Nullable Event bridge$createSpongeEvent(); | /**
* Creates a Sponge event from this Forge event
*/ | Creates a Sponge event from this Forge event | bridge$createSpongeEvent | {
"repo_name": "SpongePowered/Sponge",
"path": "forge/src/launch/java/org/spongepowered/forge/launch/bridge/event/ForgeEventBridge_Forge.java",
"license": "mit",
"size": 2484
} | [
"org.checkerframework.checker.nullness.qual.Nullable",
"org.spongepowered.api.event.Event"
] | import org.checkerframework.checker.nullness.qual.Nullable; import org.spongepowered.api.event.Event; | import org.checkerframework.checker.nullness.qual.*; import org.spongepowered.api.event.*; | [
"org.checkerframework.checker",
"org.spongepowered.api"
] | org.checkerframework.checker; org.spongepowered.api; | 2,411,365 |
public void removeAction(final Action a) {
if (a == null) {
throw new NullPointerException();
}
this.actions.remove(a);
}
| void function(final Action a) { if (a == null) { throw new NullPointerException(); } this.actions.remove(a); } | /**
* Removes the action from this concentrator.
*
* @param a the action to be removed.
*/ | Removes the action from this concentrator | removeAction | {
"repo_name": "jfree/jcommon",
"path": "src/main/java/org/jfree/ui/action/ActionConcentrator.java",
"license": "lgpl-2.1",
"size": 3658
} | [
"javax.swing.Action"
] | import javax.swing.Action; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,733,178 |
static void add(PrintWriter pen, SimpleList<String> lst, String[] vals)
throws Exception
{
add(pen, lst.listIterator(), vals);
} // add(PrintWriter, SimpleList<String>, String[]) | static void add(PrintWriter pen, SimpleList<String> lst, String[] vals) throws Exception { add(pen, lst.listIterator(), vals); } | /**
* Add a bunch of elements to the front of a list.
*/ | Add a bunch of elements to the front of a list | add | {
"repo_name": "Grinnell-CSC207/lab-linked-lists",
"path": "src/taojava/lists/SimpleListExpt.java",
"license": "gpl-3.0",
"size": 5278
} | [
"java.io.PrintWriter"
] | import java.io.PrintWriter; | import java.io.*; | [
"java.io"
] | java.io; | 2,308,716 |
public void handle(Callback[] callbacks)
throws UnsupportedCallbackException
{
final List<Object> messages = new ArrayList<>(3);
final List<Action> okActions = new ArrayList<>(2);
ConfirmationInfo confirmation = new ConfirmationInfo();
for (int i = 0;... | void function(Callback[] callbacks) throws UnsupportedCallbackException { final List<Object> messages = new ArrayList<>(3); final List<Action> okActions = new ArrayList<>(2); ConfirmationInfo confirmation = new ConfirmationInfo(); for (int i = 0; i < callbacks.length; i++) { if (callbacks[i] instanceof TextOutputCallba... | /**
* Handles the specified set of callbacks.
*
* @param callbacks the callbacks to handle
* @throws UnsupportedCallbackException if the callback is not an
* instance of NameCallback or PasswordCallback
*/ | Handles the specified set of callbacks | handle | {
"repo_name": "rokn/Count_Words_2015",
"path": "testing/openjdk2/jdk/src/share/classes/com/sun/security/auth/callback/DialogCallbackHandler.java",
"license": "mit",
"size": 11817
} | [
"java.util.ArrayList",
"java.util.List",
"javax.security.auth.callback.Callback",
"javax.security.auth.callback.NameCallback",
"javax.security.auth.callback.TextOutputCallback",
"javax.security.auth.callback.UnsupportedCallbackException",
"javax.swing.Box",
"javax.swing.JLabel",
"javax.swing.JOption... | import java.util.ArrayList; import java.util.List; import javax.security.auth.callback.Callback; import javax.security.auth.callback.NameCallback; import javax.security.auth.callback.TextOutputCallback; import javax.security.auth.callback.UnsupportedCallbackException; import javax.swing.Box; import javax.swing.JLabel; ... | import java.util.*; import javax.security.auth.callback.*; import javax.swing.*; | [
"java.util",
"javax.security",
"javax.swing"
] | java.util; javax.security; javax.swing; | 175,125 |
public void setStartTime(Date startTime) {
this.startTime = startTime;
} | void function(Date startTime) { this.startTime = startTime; } | /**
* <p>Setter for the field <code>startTime</code>.</p>
*
* @param startTime a {@link java.util.Date} object.
*/ | Setter for the field <code>startTime</code> | setStartTime | {
"repo_name": "NotFound403/WePay",
"path": "src/main/java/cn/felord/wepay/ali/sdk/api/domain/RecruitInfo.java",
"license": "apache-2.0",
"size": 2762
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 2,519,606 |
public static Document createDocument(Document document) {
Document result = createDocument();
result.setContentSize(document.getContentSize());
result.setContentType(document.getContentType());
result.setName(document.getName());
result.getContent().setBytes(document.getCont... | static Document function(Document document) { Document result = createDocument(); result.setContentSize(document.getContentSize()); result.setContentType(document.getContentType()); result.setName(document.getName()); result.getContent().setBytes(document.getContent().getBytes()); return result; } | /**
* Creates the copy of the document.
*
* @param document the document.
* @return new created document as a copy of input document.
*/ | Creates the copy of the document | createDocument | {
"repo_name": "lorislab/appky",
"path": "appky-application/src/main/java/org/lorislab/appky/application/factory/ApplicationObjectFactory.java",
"license": "apache-2.0",
"size": 9591
} | [
"org.lorislab.appky.application.model.Document"
] | import org.lorislab.appky.application.model.Document; | import org.lorislab.appky.application.model.*; | [
"org.lorislab.appky"
] | org.lorislab.appky; | 1,722,845 |
public Timer timer(String name) {
return metrics.getTimer(name);
} | Timer function(String name) { return metrics.getTimer(name); } | /**
* Get the timer metric with the supplied name, within the scope of this monitor.
*
* @param name the name of the timer
* @return the timer
*/ | Get the timer metric with the supplied name, within the scope of this monitor | timer | {
"repo_name": "dstl/baleen",
"path": "baleen-uima/src/main/java/uk/gov/dstl/baleen/uima/UimaMonitor.java",
"license": "apache-2.0",
"size": 7234
} | [
"com.codahale.metrics.Timer"
] | import com.codahale.metrics.Timer; | import com.codahale.metrics.*; | [
"com.codahale.metrics"
] | com.codahale.metrics; | 882,023 |
protected synchronized AdRequest getAdRequest() {
return new AdRequest.Builder().build();
} | synchronized AdRequest function() { return new AdRequest.Builder().build(); } | /**
* Setup and get an ads request
*/ | Setup and get an ads request | getAdRequest | {
"repo_name": "clockbyte/admobadapter",
"path": "admobadapter/src/main/java/com/clockbyte/admobadapter/AdmobFetcherBase.java",
"license": "apache-2.0",
"size": 6329
} | [
"com.google.android.gms.ads.AdRequest"
] | import com.google.android.gms.ads.AdRequest; | import com.google.android.gms.ads.*; | [
"com.google.android"
] | com.google.android; | 683,381 |
public T casePrinciple(IPrinciple object) {
return null;
}
| T function(IPrinciple object) { return null; } | /**
* Returns the result of interpreting the object as an instance of '<em>Principle</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
*... | Returns the result of interpreting the object as an instance of 'Principle'. This implementation returns null; returning a non-null result will terminate the switch. | casePrinciple | {
"repo_name": "archimatetool/archi",
"path": "com.archimatetool.model/src/com/archimatetool/model/util/ArchimateSwitch.java",
"license": "mit",
"size": 256079
} | [
"com.archimatetool.model.IPrinciple"
] | import com.archimatetool.model.IPrinciple; | import com.archimatetool.model.*; | [
"com.archimatetool.model"
] | com.archimatetool.model; | 2,036,848 |
@Override
public boolean onFling(MotionEvent event1, MotionEvent event2,
float velocityX, float velocityY) {
String msg = "onFling: " + event1.toString() + event2.toString();
Log.d(TAG, msg);
Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show... | boolean function(MotionEvent event1, MotionEvent event2, float velocityX, float velocityY) { String msg = STR + event1.toString() + event2.toString(); Log.d(TAG, msg); Toast.makeText(getApplicationContext(), msg, Toast.LENGTH_SHORT).show(); return true; } | /**
* overridden from the OnGuestureListener.
*/ | overridden from the OnGuestureListener | onFling | {
"repo_name": "JimSeker/sensors",
"path": "input2/app/src/main/java/edu/cs4730/input2/MainActivity.java",
"license": "apache-2.0",
"size": 6966
} | [
"android.util.Log",
"android.view.MotionEvent",
"android.widget.Toast"
] | import android.util.Log; import android.view.MotionEvent; import android.widget.Toast; | import android.util.*; import android.view.*; import android.widget.*; | [
"android.util",
"android.view",
"android.widget"
] | android.util; android.view; android.widget; | 2,108,951 |
String localModified = getLocalLastModified();
log.debug("Local last modified: {}", localModified);
boolean triggerDownload = false;
if (localModified == null) {
log.debug("No local last modified date found, triggering download");
triggerDownload = true;
}
... | String localModified = getLocalLastModified(); log.debug(STR, localModified); boolean triggerDownload = false; if (localModified == null) { log.debug(STR); triggerDownload = true; } else { URLConnection conn = url.openConnection(); long lastModified = conn.getLastModified(); log.debug(STR, lastModified); if (!Long.valu... | /**
* Downloads the file from the URL assigned to this RemoteDataProvider and extracts it into
* the tmp subdirectory of the current working directory. The actual path to access the data
* can be retrieved using {@link #getLocalDirectory()}.
*
* @throws IOException on errors downloading or extr... | Downloads the file from the URL assigned to this RemoteDataProvider and extracts it into the tmp subdirectory of the current working directory. The actual path to access the data can be retrieved using <code>#getLocalDirectory()</code> | downloadData | {
"repo_name": "eschwert/DL-Learner",
"path": "components-ext/src/main/java/org/dllearner/algorithms/isle/index/RemoteDataProvider.java",
"license": "gpl-3.0",
"size": 7438
} | [
"java.io.BufferedWriter",
"java.io.File",
"java.io.FileOutputStream",
"java.io.FileWriter",
"java.net.URLConnection",
"java.util.zip.ZipEntry",
"java.util.zip.ZipInputStream"
] | import java.io.BufferedWriter; import java.io.File; import java.io.FileOutputStream; import java.io.FileWriter; import java.net.URLConnection; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; | import java.io.*; import java.net.*; import java.util.zip.*; | [
"java.io",
"java.net",
"java.util"
] | java.io; java.net; java.util; | 207,703 |
private static final void writeIntoStream(final ByteBuffer bytebuf, final FileChannel fc, final byte[] contents)
throws IOException {
final int chopSize = 6 * 1024;
if (contents.length >= bytebuf.capacity()) {
List<byte[]> chops = PnmlExport.chopBytes(contents, chopSize);
for (byte[] buf : chops) {
... | static final void function(final ByteBuffer bytebuf, final FileChannel fc, final byte[] contents) throws IOException { final int chopSize = 6 * 1024; if (contents.length >= bytebuf.capacity()) { List<byte[]> chops = PnmlExport.chopBytes(contents, chopSize); for (byte[] buf : chops) { bytebuf.put(buf); bytebuf.flip(); f... | /**
* Writes buffer of a given max size into file channel.
*/ | Writes buffer of a given max size into file channel | writeIntoStream | {
"repo_name": "lhillah/pnmlframework",
"path": "pnmlFw-HLPN/src/fr/lip6/move/pnml/hlpn/hlcorestructure/impl/HLAnnotationImpl.java",
"license": "epl-1.0",
"size": 30794
} | [
"fr.lip6.move.pnml.framework.general.PnmlExport",
"java.io.IOException",
"java.nio.ByteBuffer",
"java.nio.channels.FileChannel",
"java.util.List"
] | import fr.lip6.move.pnml.framework.general.PnmlExport; import java.io.IOException; import java.nio.ByteBuffer; import java.nio.channels.FileChannel; import java.util.List; | import fr.lip6.move.pnml.framework.general.*; import java.io.*; import java.nio.*; import java.nio.channels.*; import java.util.*; | [
"fr.lip6.move",
"java.io",
"java.nio",
"java.util"
] | fr.lip6.move; java.io; java.nio; java.util; | 2,907,168 |
@Override
@NotNull
protected Chain<QueryJCommand, QueryJBuildException, QueryJCommandHandler<QueryJCommand>> buildChain(
@NotNull final Chain<QueryJCommand, QueryJBuildException, QueryJCommandHandler<QueryJCommand>> chain)
{
@NotNull final Chain<QueryJCommand, QueryJBuildException, Query... | Chain<QueryJCommand, QueryJBuildException, QueryJCommandHandler<QueryJCommand>> function( @NotNull final Chain<QueryJCommand, QueryJBuildException, QueryJCommandHandler<QueryJCommand>> chain) { @NotNull final Chain<QueryJCommand, QueryJBuildException, QueryJCommandHandler<QueryJCommand>> result = chain; fillChain(resul... | /**
* Builds the chain.
*
* @param chain the chain to be configured.
* @return the updated chain.
*/ | Builds the chain | buildChain | {
"repo_name": "rydnr/queryj-rt",
"path": "queryj-core/src/main/java/org/acmsl/queryj/api/TemplateFillChain.java",
"license": "gpl-2.0",
"size": 5318
} | [
"org.acmsl.commons.patterns.Chain",
"org.acmsl.queryj.QueryJCommand",
"org.acmsl.queryj.api.exceptions.QueryJBuildException",
"org.acmsl.queryj.tools.handlers.QueryJCommandHandler",
"org.jetbrains.annotations.NotNull"
] | import org.acmsl.commons.patterns.Chain; import org.acmsl.queryj.QueryJCommand; import org.acmsl.queryj.api.exceptions.QueryJBuildException; import org.acmsl.queryj.tools.handlers.QueryJCommandHandler; import org.jetbrains.annotations.NotNull; | import org.acmsl.commons.patterns.*; import org.acmsl.queryj.*; import org.acmsl.queryj.api.exceptions.*; import org.acmsl.queryj.tools.handlers.*; import org.jetbrains.annotations.*; | [
"org.acmsl.commons",
"org.acmsl.queryj",
"org.jetbrains.annotations"
] | org.acmsl.commons; org.acmsl.queryj; org.jetbrains.annotations; | 810,802 |
@Override
public List<WebDataSong> getWebDataSongsForStatus(SongStatus[] statuses, AlbumStatus[] albumStatuses) {
List<WebDataSong> songs = new ArrayList<WebDataSong>();
if (statuses == null || statuses.length == 0) {
return songs;
}
ICursor cur = null;
try {
// TODO: also read meIds, coords, etc.?
... | List<WebDataSong> function(SongStatus[] statuses, AlbumStatus[] albumStatuses) { List<WebDataSong> songs = new ArrayList<WebDataSong>(); if (statuses == null statuses.length == 0) { return songs; } ICursor cur = null; try { StringBuffer buffer = new StringBuffer(); buffer.append(STR + "s." + TblSongs.SONG_ID + STR + Tb... | /**
* returns songs that have one of the status specified in statuses or the according album has one of the statuses
* specified in albumStatuses
*/ | returns songs that have one of the status specified in statuses or the according album has one of the statuses specified in albumStatuses | getWebDataSongsForStatus | {
"repo_name": "kuhnmi/jukefox",
"path": "JukefoxModel/src/ch/ethz/dcg/jukefox/data/db/SqlDbDataPortal.java",
"license": "gpl-3.0",
"size": 145960
} | [
"ch.ethz.dcg.jukefox.commons.utils.Log",
"ch.ethz.dcg.jukefox.model.collection.AlbumStatus",
"ch.ethz.dcg.jukefox.model.collection.CompleteArtist",
"ch.ethz.dcg.jukefox.model.collection.SongStatus",
"ch.ethz.dcg.jukefox.model.libraryimport.WebDataSong",
"java.util.ArrayList",
"java.util.List"
] | import ch.ethz.dcg.jukefox.commons.utils.Log; import ch.ethz.dcg.jukefox.model.collection.AlbumStatus; import ch.ethz.dcg.jukefox.model.collection.CompleteArtist; import ch.ethz.dcg.jukefox.model.collection.SongStatus; import ch.ethz.dcg.jukefox.model.libraryimport.WebDataSong; import java.util.ArrayList; import java.u... | import ch.ethz.dcg.jukefox.commons.utils.*; import ch.ethz.dcg.jukefox.model.collection.*; import ch.ethz.dcg.jukefox.model.libraryimport.*; import java.util.*; | [
"ch.ethz.dcg",
"java.util"
] | ch.ethz.dcg; java.util; | 1,174,185 |
public ProjectInner withTargetPlatform(ProjectTargetPlatform targetPlatform) {
this.targetPlatform = targetPlatform;
return this;
} | ProjectInner function(ProjectTargetPlatform targetPlatform) { this.targetPlatform = targetPlatform; return this; } | /**
* Set the targetPlatform property: Target platform for the project.
*
* @param targetPlatform the targetPlatform value to set.
* @return the ProjectInner object itself.
*/ | Set the targetPlatform property: Target platform for the project | withTargetPlatform | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/datamigration/azure-resourcemanager-datamigration/src/main/java/com/azure/resourcemanager/datamigration/fluent/models/ProjectInner.java",
"license": "mit",
"size": 6686
} | [
"com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform"
] | import com.azure.resourcemanager.datamigration.models.ProjectTargetPlatform; | import com.azure.resourcemanager.datamigration.models.*; | [
"com.azure.resourcemanager"
] | com.azure.resourcemanager; | 2,177,415 |
public final File showFileSaveDialog(String title,
boolean dirsOnly,
FileFilter fileFilter,
String defaultExtension,
final String fileName) {
re... | final File function(String title, boolean dirsOnly, FileFilter fileFilter, String defaultExtension, final String fileName) { return showFileSaveDialog(title, dirsOnly, fileFilter, defaultExtension, fileName, PROPERTY_KEY_APP_LAST_SAVE_DIR); } | /**
* Opens a standard file-safe dialog box.
*
* @param title a dialog-box title
* @param dirsOnly whether or not to select only directories
* @param fileFilter the file filter to be used, can be <code>null</code>
* @param defaultExtension the extension used as def... | Opens a standard file-safe dialog box | showFileSaveDialog | {
"repo_name": "seadas/beam",
"path": "beam-ui/src/main/java/org/esa/beam/framework/ui/BasicApp.java",
"license": "gpl-3.0",
"size": 72797
} | [
"java.io.File",
"javax.swing.filechooser.FileFilter"
] | import java.io.File; import javax.swing.filechooser.FileFilter; | import java.io.*; import javax.swing.filechooser.*; | [
"java.io",
"javax.swing"
] | java.io; javax.swing; | 553,974 |
static <T> T getValue (GeneralParameterValue param, Class<T> required) {
Object value = ((ParameterValue<?>)param).getValue ();
return required.cast (value);
} | static <T> T getValue (GeneralParameterValue param, Class<T> required) { Object value = ((ParameterValue<?>)param).getValue (); return required.cast (value); } | /**
* Used by this class and tests for getting the parameter data from a geotools parameter
*/ | Used by this class and tests for getting the parameter data from a geotools parameter | getValue | {
"repo_name": "debard/georchestra-ird",
"path": "extractorapp/src/main/java/org/georchestra/extractorapp/ws/extractor/wcs/WcsReaderRequest.java",
"license": "gpl-3.0",
"size": 11885
} | [
"org.opengis.parameter.GeneralParameterValue",
"org.opengis.parameter.ParameterValue"
] | import org.opengis.parameter.GeneralParameterValue; import org.opengis.parameter.ParameterValue; | import org.opengis.parameter.*; | [
"org.opengis.parameter"
] | org.opengis.parameter; | 1,431,039 |
public void fireNotifyChanged(Notification notification) {
changeNotifier.fireNotifyChanged(notification);
if (parentAdapterFactory != null) {
parentAdapterFactory.fireNotifyChanged(notification);
}
} | void function(Notification notification) { changeNotifier.fireNotifyChanged(notification); if (parentAdapterFactory != null) { parentAdapterFactory.fireNotifyChanged(notification); } } | /**
* This delegates to {@link #changeNotifier} and to {@link #parentAdapterFactory}.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This delegates to <code>#changeNotifier</code> and to <code>#parentAdapterFactory</code>. | fireNotifyChanged | {
"repo_name": "occiware/Multi-Cloud-Studio",
"path": "plugins/org.eclipse.cmf.occi.multicloud.monitoring.zabbix.edit/src-gen/org/eclipse/cmf/occi/multicloud/monitoring/zabbix/provider/ZabbixItemProviderAdapterFactory.java",
"license": "epl-1.0",
"size": 7203
} | [
"org.eclipse.emf.common.notify.Notification"
] | import org.eclipse.emf.common.notify.Notification; | import org.eclipse.emf.common.notify.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,602,351 |
public boolean isAccessible() {
return override;
}
protected AccessibleObject() {}
// Indicates whether language-level access checks are overridden
// by this object. Initializes to "false". This field is used by
// Field, Method, and Constructor.
//
// NOTE: for security ... | boolean function() { return override; } protected AccessibleObject() {} boolean override; static final ReflectionFactory reflectionFactory = (ReflectionFactory) AccessController.doPrivileged (new sun.reflect.ReflectionFactory.GetReflectionFactoryAction()); /** * @throws NullPointerException {@inheritDoc} | /**
* Get the value of the {@code accessible} flag for this object.
*
* @return the value of the object's {@code accessible} flag
*/ | Get the value of the accessible flag for this object | isAccessible | {
"repo_name": "andreagenso/java2scala",
"path": "test/J2s/java/openjdk-6-src-b27/jdk/src/share/classes/java/lang/reflect/AccessibleObject.java",
"license": "apache-2.0",
"size": 8022
} | [
"java.security.AccessController"
] | import java.security.AccessController; | import java.security.*; | [
"java.security"
] | java.security; | 884,876 |
public Type inOut(Endpoint... endpoints) {
return to(ExchangePattern.InOut, endpoints);
} | Type function(Endpoint... endpoints) { return to(ExchangePattern.InOut, endpoints); } | /**
* Sends the message to the given endpoints using an
* <a href="http://camel.apache.org/request-reply.html">Request Reply</a> or
* <a href="http://camel.apache.org/exchange-pattern.html">InOut exchange pattern</a>
* <p/>
* Notice the existing MEP is restored after the message has been sent t... | Sends the message to the given endpoints using an Request Reply or InOut exchange pattern Notice the existing MEP is restored after the message has been sent to the given endpoint | inOut | {
"repo_name": "chicagozer/rheosoft",
"path": "camel-core/src/main/java/org/apache/camel/model/ProcessorDefinition.java",
"license": "apache-2.0",
"size": 125020
} | [
"org.apache.camel.Endpoint",
"org.apache.camel.ExchangePattern"
] | import org.apache.camel.Endpoint; import org.apache.camel.ExchangePattern; | import org.apache.camel.*; | [
"org.apache.camel"
] | org.apache.camel; | 576,565 |
@Test
public void testCloning() throws CloneNotSupportedException {
HistogramBin b1 = new HistogramBin(1.1, 2.2, false, true);
b1.setItemCount(99);
HistogramBin b2 = (HistogramBin) b1.clone();
assertNotSame(b1, b2);
assertSame(b1.getClass(), b2.getClass());
... | void function() throws CloneNotSupportedException { HistogramBin b1 = new HistogramBin(1.1, 2.2, false, true); b1.setItemCount(99); HistogramBin b2 = (HistogramBin) b1.clone(); assertNotSame(b1, b2); assertSame(b1.getClass(), b2.getClass()); assertEquals(b1, b2); b2.setItemCount(111); assertFalse(b1.equals(b2)); } | /**
* Some checks for the clone() method.
*/ | Some checks for the clone() method | testCloning | {
"repo_name": "oskopek/jfreechart-fse",
"path": "src/test/java/org/jfree/data/statistics/HistogramBinTest.java",
"license": "lgpl-2.1",
"size": 5669
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 169,184 |
public static DaoSession newDevSession(Context context, String name) {
Database db = new DevOpenHelper(context, name).getWritableDb();
DaoMaster daoMaster = new DaoMaster(db);
return daoMaster.newSession();
}
public DaoMaster(SQLiteDatabase db) {
this(new StandardDatabase(db... | static DaoSession function(Context context, String name) { Database db = new DevOpenHelper(context, name).getWritableDb(); DaoMaster daoMaster = new DaoMaster(db); return daoMaster.newSession(); } public DaoMaster(SQLiteDatabase db) { this(new StandardDatabase(db)); } public DaoMaster(Database db) { super(db, SCHEMA_VE... | /**
* WARNING: Drops all table on Upgrade! Use only during development.
* Convenience method using a {@link DevOpenHelper}.
*/ | Convenience method using a <code>DevOpenHelper</code> | newDevSession | {
"repo_name": "InnoFang/Android-Code-Demos",
"path": "GreenDaoDemo/app/src/main/java/io/innofang/greendaodemo/dao/DaoMaster.java",
"license": "apache-2.0",
"size": 3237
} | [
"android.content.Context",
"android.database.sqlite.SQLiteDatabase",
"org.greenrobot.greendao.database.Database",
"org.greenrobot.greendao.database.StandardDatabase"
] | import android.content.Context; import android.database.sqlite.SQLiteDatabase; import org.greenrobot.greendao.database.Database; import org.greenrobot.greendao.database.StandardDatabase; | import android.content.*; import android.database.sqlite.*; import org.greenrobot.greendao.database.*; | [
"android.content",
"android.database",
"org.greenrobot.greendao"
] | android.content; android.database; org.greenrobot.greendao; | 2,086,602 |
public final void setKey(IContext context, String key)
{
getMendixObject().setValue(context, MemberNames.Key.toString(), key);
} | final void function(IContext context, String key) { getMendixObject().setValue(context, MemberNames.Key.toString(), key); } | /**
* Set value of Key
* @param context
* @param key
*/ | Set value of Key | setKey | {
"repo_name": "synobsys/mendix-ObjectBackupRestore",
"path": "src/project/javasource/objectbackuprestore/proxies/TreeViewNodeData.java",
"license": "apache-2.0",
"size": 10121
} | [
"com.mendix.systemwideinterfaces.core.IContext"
] | import com.mendix.systemwideinterfaces.core.IContext; | import com.mendix.systemwideinterfaces.core.*; | [
"com.mendix.systemwideinterfaces"
] | com.mendix.systemwideinterfaces; | 273,795 |
public boolean isAppFileName() {
Matcher m = sApkPattern.matcher(name);
return m.matches();
} | boolean function() { Matcher m = sApkPattern.matcher(name); return m.matches(); } | /**
* Returns if the file name is an application package name.
*/ | Returns if the file name is an application package name | isAppFileName | {
"repo_name": "ironmanMA/continuum",
"path": "backened/app/src/main/java/com/hackathon/continuum/ddmlib/FileListingService.java",
"license": "gpl-3.0",
"size": 27501
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 773,850 |
public void register()
{
PropertyCheck.mandatory(this, "schemaBootstrap", schemaBootstrap);
PropertyCheck.mandatory(this, "preCreateScriptUrls", preCreateScriptUrls);
PropertyCheck.mandatory(this, "postCreateScriptUrls", postCreateScriptUrls);
PropertyCheck.mandatory(this, "... | void function() { PropertyCheck.mandatory(this, STR, schemaBootstrap); PropertyCheck.mandatory(this, STR, preCreateScriptUrls); PropertyCheck.mandatory(this, STR, postCreateScriptUrls); PropertyCheck.mandatory(this, STR, preUpdateScriptPatches); PropertyCheck.mandatory(this, STR, postUpdateScriptPatches); PropertyCheck... | /**
* Registers all the necessary scripts and patches with the {@link SchemaBootstrap}.
*/ | Registers all the necessary scripts and patches with the <code>SchemaBootstrap</code> | register | {
"repo_name": "nguyentienlong/community-edition",
"path": "projects/repository/source/java/org/alfresco/repo/domain/schema/SchemaBootstrapRegistration.java",
"license": "lgpl-3.0",
"size": 5692
} | [
"org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch",
"org.alfresco.util.PropertyCheck"
] | import org.alfresco.repo.admin.patch.impl.SchemaUpgradeScriptPatch; import org.alfresco.util.PropertyCheck; | import org.alfresco.repo.admin.patch.impl.*; import org.alfresco.util.*; | [
"org.alfresco.repo",
"org.alfresco.util"
] | org.alfresco.repo; org.alfresco.util; | 2,745,428 |
Set<IpLink> getEgressIpLinks(TerminationPoint src); | Set<IpLink> getEgressIpLinks(TerminationPoint src); | /**
* Returns all ip links egressing from the specified termination point.
*
* @param src source termination point
* @return set of termination point ip links
*/ | Returns all ip links egressing from the specified termination point | getEgressIpLinks | {
"repo_name": "donNewtonAlpha/onos",
"path": "apps/iptopology-api/src/main/java/org/onosproject/iptopology/api/link/IpLinkStore.java",
"license": "apache-2.0",
"size": 3692
} | [
"java.util.Set",
"org.onosproject.iptopology.api.IpLink",
"org.onosproject.iptopology.api.TerminationPoint"
] | import java.util.Set; import org.onosproject.iptopology.api.IpLink; import org.onosproject.iptopology.api.TerminationPoint; | import java.util.*; import org.onosproject.iptopology.api.*; | [
"java.util",
"org.onosproject.iptopology"
] | java.util; org.onosproject.iptopology; | 1,469,580 |
EReference getIfThenElseExpr_A(); | EReference getIfThenElseExpr_A(); | /**
* Returns the meta object for the containment reference '{@link com.rockwellcollins.atc.agree.agree.IfThenElseExpr#getA <em>A</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the containment reference '<em>A</em>'.
* @see com.rockwellcollins.atc.agree.agree.IfThenEls... | Returns the meta object for the containment reference '<code>com.rockwellcollins.atc.agree.agree.IfThenElseExpr#getA A</code>'. | getIfThenElseExpr_A | {
"repo_name": "smaccm/smaccm",
"path": "fm-workbench/agree/com.rockwellcollins.atc.agree/src-gen/com/rockwellcollins/atc/agree/agree/AgreePackage.java",
"license": "bsd-3-clause",
"size": 292940
} | [
"org.eclipse.emf.ecore.EReference"
] | import org.eclipse.emf.ecore.EReference; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,185,937 |
@Test
public void checkGeneralStats (TestContext context) {
System.out.println(this.getClass().getSimpleName() + " | test 4 | checkGeneralStats on port " + port);
Async async = context.async();
vertx.createHttpClient().getNow(port, "localhost", "/api/stats/general", response -> {
context.assertEquals(respo... | void function (TestContext context) { System.out.println(this.getClass().getSimpleName() + STR + port); Async async = context.async(); vertx.createHttpClient().getNow(port, STR, STR, response -> { context.assertEquals(response.statusCode(), 200); response.bodyHandler(body -> { JsonObject jsonResponse = new JsonObject(b... | /**
* Check that Application returns general stats
*/ | Check that Application returns general stats | checkGeneralStats | {
"repo_name": "sasa-radovanovic/ff-flight-diary",
"path": "src/test/java/frequentFlyer/flight_diary/FlightDiaryApplicationTest.java",
"license": "mit",
"size": 15967
} | [
"io.vertx.core.json.JsonArray",
"io.vertx.core.json.JsonObject",
"io.vertx.ext.unit.Async",
"io.vertx.ext.unit.TestContext"
] | import io.vertx.core.json.JsonArray; import io.vertx.core.json.JsonObject; import io.vertx.ext.unit.Async; import io.vertx.ext.unit.TestContext; | import io.vertx.core.json.*; import io.vertx.ext.unit.*; | [
"io.vertx.core",
"io.vertx.ext"
] | io.vertx.core; io.vertx.ext; | 978,298 |
public static int countByGroupId(long groupId)
throws com.liferay.portal.kernel.exception.SystemException {
return getPersistence().countByGroupId(groupId);
} | static int function(long groupId) throws com.liferay.portal.kernel.exception.SystemException { return getPersistence().countByGroupId(groupId); } | /**
* Returns the number of configuracaos where groupId = ?.
*
* @param groupId the group ID
* @return the number of matching configuracaos
* @throws SystemException if a system exception occurred
*/ | Returns the number of configuracaos where groupId = ? | countByGroupId | {
"repo_name": "camaradosdeputadosoficial/edemocracia",
"path": "cd-guiadiscussao-portlet/src/main/java/br/gov/camara/edemocracia/portlets/guiadiscussao/service/persistence/ConfiguracaoUtil.java",
"license": "lgpl-2.1",
"size": 15265
} | [
"com.liferay.portal.kernel.exception.SystemException"
] | import com.liferay.portal.kernel.exception.SystemException; | import com.liferay.portal.kernel.exception.*; | [
"com.liferay.portal"
] | com.liferay.portal; | 275,661 |
super.init(config);
try {
Registry.start();
} catch (ConfigurationException e) {
log.error("jUDDI registry could not be started." + e.getMessage(), e);
}
} | super.init(config); try { Registry.start(); } catch (ConfigurationException e) { log.error(STR + e.getMessage(), e); } } | /**
* Create the shared instance of jUDDI's Registry class and call it's
* "init()" method to initialize all core components.
*/ | Create the shared instance of jUDDI's Registry class and call it's "init()" method to initialize all core components | init | {
"repo_name": "sameerak/carbon-registry",
"path": "components/registry/org.wso2.carbon.registry.uddi/src/main/java/org/wso2/carbon/registry/uddi/servlet/JUDDIRegistryServlet.java",
"license": "apache-2.0",
"size": 1855
} | [
"org.apache.commons.configuration.ConfigurationException",
"org.apache.juddi.Registry"
] | import org.apache.commons.configuration.ConfigurationException; import org.apache.juddi.Registry; | import org.apache.commons.configuration.*; import org.apache.juddi.*; | [
"org.apache.commons",
"org.apache.juddi"
] | org.apache.commons; org.apache.juddi; | 925,232 |
public void testGetIndex2() {
DefaultKeyedValues v = new DefaultKeyedValues();
assertEquals(-1, v.getIndex("K1"));
v.addValue("K1", 1.0);
assertEquals(0, v.getIndex("K1"));
v.removeValue("K1");
assertEquals(-1, v.getIndex("K1"));
} | void function() { DefaultKeyedValues v = new DefaultKeyedValues(); assertEquals(-1, v.getIndex("K1")); v.addValue("K1", 1.0); assertEquals(0, v.getIndex("K1")); v.removeValue("K1"); assertEquals(-1, v.getIndex("K1")); } | /**
* Another check for the getIndex(Comparable) method.
*/ | Another check for the getIndex(Comparable) method | testGetIndex2 | {
"repo_name": "JSansalone/JFreeChart",
"path": "tests/org/jfree/data/junit/DefaultKeyedValuesTests.java",
"license": "lgpl-2.1",
"size": 16825
} | [
"org.jfree.data.DefaultKeyedValues"
] | import org.jfree.data.DefaultKeyedValues; | import org.jfree.data.*; | [
"org.jfree.data"
] | org.jfree.data; | 1,802,266 |
OperationResult<SchemaChangeResult> createColumnFamily(Properties props) throws ConnectionException; | OperationResult<SchemaChangeResult> createColumnFamily(Properties props) throws ConnectionException; | /**
* Create a column family in this keyspace using the provided properties.
* @param props
* @return
* @throws ConnectionException
*/ | Create a column family in this keyspace using the provided properties | createColumnFamily | {
"repo_name": "bazaarvoice/astyanax",
"path": "astyanax-cassandra/src/main/java/com/netflix/astyanax/Keyspace.java",
"license": "apache-2.0",
"size": 14239
} | [
"com.netflix.astyanax.connectionpool.OperationResult",
"com.netflix.astyanax.connectionpool.exceptions.ConnectionException",
"com.netflix.astyanax.ddl.SchemaChangeResult",
"java.util.Properties"
] | import com.netflix.astyanax.connectionpool.OperationResult; import com.netflix.astyanax.connectionpool.exceptions.ConnectionException; import com.netflix.astyanax.ddl.SchemaChangeResult; import java.util.Properties; | import com.netflix.astyanax.connectionpool.*; import com.netflix.astyanax.connectionpool.exceptions.*; import com.netflix.astyanax.ddl.*; import java.util.*; | [
"com.netflix.astyanax",
"java.util"
] | com.netflix.astyanax; java.util; | 1,503,378 |
@Test
public void TestInterIndic() {
String ID = "Devanagari-Gujarati";
Transliterator dg = Transliterator.getInstance(ID);
if (dg == null) {
errln("FAIL: getInstance(" + ID + ") returned null");
return;
}
String id = dg.getID();
if (!id.eq... | void function() { String ID = STR; Transliterator dg = Transliterator.getInstance(ID); if (dg == null) { errln(STR + ID + STR); return; } String id = dg.getID(); if (!id.equals(ID)) { errln(STR + ID + STR + id); } String dev = STR; String guj = STR; expect(dg, dev, guj); } | /**
* Test inter-Indic transliterators. These are composed.
*/ | Test inter-Indic transliterators. These are composed | TestInterIndic | {
"repo_name": "life-beam/j2objc",
"path": "jre_emul/android/platform/external/icu/android_icu4j/src/main/tests/android/icu/dev/test/translit/TransliteratorTest.java",
"license": "apache-2.0",
"size": 165585
} | [
"android.icu.text.Transliterator"
] | import android.icu.text.Transliterator; | import android.icu.text.*; | [
"android.icu"
] | android.icu; | 291,676 |
protected void restHead(NabuccoServletRequest request, NabuccoServletResponse response) throws ClientException {
throw new ClientException("HTTP HEAD is not supported for this URL.");
} | void function(NabuccoServletRequest request, NabuccoServletResponse response) throws ClientException { throw new ClientException(STR); } | /**
* <b>REST - HTTP HEAD</b>
* <p/>
* Requires meta-information from the server.
*
* @param request
* the HTTP request
* @param response
* the HTTP response
*
* @throws ClientException
* when the resource cannot be removed
... | REST - HTTP HEAD Requires meta-information from the server | restHead | {
"repo_name": "NABUCCO/org.nabucco.framework.base",
"path": "org.nabucco.framework.base.ui.web/src/main/man/org/nabucco/framework/base/ui/web/servlet/NabuccoServlet.java",
"license": "epl-1.0",
"size": 20430
} | [
"org.nabucco.framework.base.facade.exception.client.ClientException"
] | import org.nabucco.framework.base.facade.exception.client.ClientException; | import org.nabucco.framework.base.facade.exception.client.*; | [
"org.nabucco.framework"
] | org.nabucco.framework; | 1,878,029 |
if (fStore == null) {
fStore = new ContributionTemplateStore(TemplateHelper.getContextTypeRegistry(), PydevPlugin.getDefault()
.getPreferenceStore(), CUSTOM_TEMPLATES_PY_KEY);
try {
fStore.load();
} catch (IOException e) {
Log.log(e... | if (fStore == null) { fStore = new ContributionTemplateStore(TemplateHelper.getContextTypeRegistry(), PydevPlugin.getDefault() .getPreferenceStore(), CUSTOM_TEMPLATES_PY_KEY); try { fStore.load(); } catch (IOException e) { Log.log(e); throw new RuntimeException(e); } } return fStore; } | /**
* Returns this plug-in's template store.
*
* @return the template store of this plug-in instance
*/ | Returns this plug-in's template store | getTemplateStore | {
"repo_name": "smkr/pyclipse",
"path": "plugins/org.python.pydev/src/org/python/pydev/editor/templates/TemplateHelper.java",
"license": "epl-1.0",
"size": 2515
} | [
"java.io.IOException",
"org.eclipse.ui.editors.text.templates.ContributionTemplateStore",
"org.python.pydev.core.log.Log",
"org.python.pydev.plugin.PydevPlugin"
] | import java.io.IOException; import org.eclipse.ui.editors.text.templates.ContributionTemplateStore; import org.python.pydev.core.log.Log; import org.python.pydev.plugin.PydevPlugin; | import java.io.*; import org.eclipse.ui.editors.text.templates.*; import org.python.pydev.core.log.*; import org.python.pydev.plugin.*; | [
"java.io",
"org.eclipse.ui",
"org.python.pydev"
] | java.io; org.eclipse.ui; org.python.pydev; | 2,333,847 |
private void processItemIdIndexMapping(final Map<String, List<Integer>> map, final List<Integer> rowIndex,
final TreeItemModel treeModel, final Set<String> expandedRows) {
// Add current item
String id = treeModel.getItemId(rowIndex);
if (id == null) {
return;
}
map.put(id, rowIndex);
/... | void function(final Map<String, List<Integer>> map, final List<Integer> rowIndex, final TreeItemModel treeModel, final Set<String> expandedRows) { String id = treeModel.getItemId(rowIndex); if (id == null) { return; } map.put(id, rowIndex); if (!treeModel.isExpandable(rowIndex)) { return; } if (!treeModel.hasChildren(r... | /**
* Iterate through the table model to add the item ids and their row index.
*
* @param map the map of item ids
* @param rowIndex the current row index
* @param treeModel the tree model
* @param expandedRows the set of expanded rows, null if include all
*/ | Iterate through the table model to add the item ids and their row index | processItemIdIndexMapping | {
"repo_name": "Joshua-Barclay/wcomponents",
"path": "wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTree.java",
"license": "gpl-3.0",
"size": 39637
} | [
"java.util.ArrayList",
"java.util.List",
"java.util.Map",
"java.util.Set"
] | import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 2,073,690 |
@Test
public void testPortCriterionEquals() {
new EqualsTester()
.addEqualityGroup(matchInPort1, sameAsMatchInPort1)
.addEqualityGroup(matchInPort2)
.testEquals();
new EqualsTester()
.addEqualityGroup(matchInPhyPort1, sameAsMatchIn... | void function() { new EqualsTester() .addEqualityGroup(matchInPort1, sameAsMatchInPort1) .addEqualityGroup(matchInPort2) .testEquals(); new EqualsTester() .addEqualityGroup(matchInPhyPort1, sameAsMatchInPhyPort1) .addEqualityGroup(matchInPhyPort2) .testEquals(); } | /**
* Test the equals() method of the PortCriterion class.
*/ | Test the equals() method of the PortCriterion class | testPortCriterionEquals | {
"repo_name": "sonu283304/onos",
"path": "core/api/src/test/java/org/onosproject/net/flow/criteria/CriteriaTest.java",
"license": "apache-2.0",
"size": 44713
} | [
"com.google.common.testing.EqualsTester"
] | import com.google.common.testing.EqualsTester; | import com.google.common.testing.*; | [
"com.google.common"
] | com.google.common; | 2,223,849 |
public void testScrollResponseBatchingBehavior() throws Exception {
int maxBatches = randomIntBetween(0, 100);
for (int batches = 1; batches < maxBatches; batches++) {
Hit hit = new ScrollableHitSource.BasicHit("index", "type", "id", 0);
ScrollableHitSource.Response response ... | void function() throws Exception { int maxBatches = randomIntBetween(0, 100); for (int batches = 1; batches < maxBatches; batches++) { Hit hit = new ScrollableHitSource.BasicHit("index", "type", "id", 0); ScrollableHitSource.Response response = new ScrollableHitSource.Response(false, emptyList(), 1, singletonList(hit),... | /**
* Tests that each scroll response is a batch and that the batch is launched properly.
*/ | Tests that each scroll response is a batch and that the batch is launched properly | testScrollResponseBatchingBehavior | {
"repo_name": "henakamaMSFT/elasticsearch",
"path": "modules/reindex/src/test/java/org/elasticsearch/index/reindex/AsyncBulkByScrollActionTests.java",
"license": "apache-2.0",
"size": 42502
} | [
"java.util.Collections",
"org.elasticsearch.common.unit.TimeValue",
"org.elasticsearch.index.reindex.ScrollableHitSource"
] | import java.util.Collections; import org.elasticsearch.common.unit.TimeValue; import org.elasticsearch.index.reindex.ScrollableHitSource; | import java.util.*; import org.elasticsearch.common.unit.*; import org.elasticsearch.index.reindex.*; | [
"java.util",
"org.elasticsearch.common",
"org.elasticsearch.index"
] | java.util; org.elasticsearch.common; org.elasticsearch.index; | 1,199,418 |
boolean fileExists(Path path) throws IOException; | boolean fileExists(Path path) throws IOException; | /**
* Check if a file exists or not
* @param path the path to check
* @return true if it exists else false
* @throws IOException on any error.
*/ | Check if a file exists or not | fileExists | {
"repo_name": "kevinconaway/storm",
"path": "storm-client/src/jvm/org/apache/storm/daemon/supervisor/IAdvancedFSOps.java",
"license": "apache-2.0",
"size": 7073
} | [
"java.io.IOException",
"java.nio.file.Path"
] | import java.io.IOException; import java.nio.file.Path; | import java.io.*; import java.nio.file.*; | [
"java.io",
"java.nio"
] | java.io; java.nio; | 2,649,973 |
public void setPayload(Map<String, Object> payload) {
mPayload = payload;
}
} | void function(Map<String, Object> payload) { mPayload = payload; } } | /**
* Set the custom payload for this push request.
* @param payload A dictionary.
*/ | Set the custom payload for this push request | setPayload | {
"repo_name": "magnetsystems/message-server",
"path": "server/plugins/mmxmgmt/src/main/java/com/magnet/mmx/server/api/v2/PushMessageResource.java",
"license": "apache-2.0",
"size": 6965
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,257,563 |
@SuppressWarnings("deprecation")
@Deprecated
public void setProject(Project project) {
throw new UnsupportedOperationException();
}
| @SuppressWarnings(STR) void function(Project project) { throw new UnsupportedOperationException(); } | /**
* This optional method is not implemented. It will throw an
* {@link UnsupportedOperationException} if used. Figs are
* added to a GraphModel which is, in turn, owned by a project.<p>
*
* @param project the project
* @deprecated
*/ | This optional method is not implemented. It will throw an <code>UnsupportedOperationException</code> if used. Figs are added to a GraphModel which is, in turn, owned by a project | setProject | {
"repo_name": "ckaestne/LEADT",
"path": "workspace/argouml_diagrams/argouml-app/src/org/argouml/uml/diagram/ui/FigNodeModelElement.java",
"license": "gpl-3.0",
"size": 92897
} | [
"org.argouml.kernel.Project"
] | import org.argouml.kernel.Project; | import org.argouml.kernel.*; | [
"org.argouml.kernel"
] | org.argouml.kernel; | 2,059,437 |
@Test(groups={"ut"})
public void testCreateJiraBean() throws Exception {
jiraOptions.put("priority", "P1");
jiraOptions.put("assignee", "me");
jiraOptions.put("reporter", "you");
jiraOptions.put("jira.issueType", "Bug");
jiraOptions.put("jira.components", "comp1,comp2");
jiraOptions.put("jira.field.f... | @Test(groups={"ut"}) void function() throws Exception { jiraOptions.put(STR, "P1"); jiraOptions.put(STR, "me"); jiraOptions.put(STR, "you"); jiraOptions.put(STR, "Bug"); jiraOptions.put(STR, STR); jiraOptions.put(STR, "bar"); JiraConnector jiraConnector = new JiraConnector(STR[Selenium][selenium][DEV][ngName] test myTe... | /**
* Create a new jira bean with all parameters
* @throws Exception
*/ | Create a new jira bean with all parameters | testCreateJiraBean | {
"repo_name": "bhecquet/seleniumRobot",
"path": "core/src/test/java/com/seleniumtests/ut/connectors/bugtracker/jira/TestJiraConnector.java",
"license": "apache-2.0",
"size": 48007
} | [
"com.seleniumtests.connectors.bugtracker.jira.JiraConnector",
"org.testng.Assert",
"org.testng.annotations.Test"
] | import com.seleniumtests.connectors.bugtracker.jira.JiraConnector; import org.testng.Assert; import org.testng.annotations.Test; | import com.seleniumtests.connectors.bugtracker.jira.*; import org.testng.*; import org.testng.annotations.*; | [
"com.seleniumtests.connectors",
"org.testng",
"org.testng.annotations"
] | com.seleniumtests.connectors; org.testng; org.testng.annotations; | 2,334,551 |
private boolean validTreeLocation()
{
BlockPos down = this.basePos.down();
net.minecraft.block.state.IBlockState state = this.world.getBlockState(down);
boolean isSoil = state.getBlock().canSustainPlant(state, this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.... | boolean function() { BlockPos down = this.basePos.down(); net.minecraft.block.state.IBlockState state = this.world.getBlockState(down); boolean isSoil = state.getBlock().canSustainPlant(state, this.world, down, net.minecraft.util.EnumFacing.UP, ((net.minecraft.block.BlockSapling)Blocks.SAPLING)); if (!isSoil) { return ... | /**
* Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height
* limit, is valid.
*/ | Returns a boolean indicating whether or not the current location for the tree, spanning basePos to to the height limit, is valid | validTreeLocation | {
"repo_name": "kremi151/MinaMod",
"path": "src/main/java/lu/kremi151/minamod/worldgen/WorldGenCustomBigTree.java",
"license": "gpl-3.0",
"size": 12944
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.init.Blocks",
"net.minecraft.util.math.BlockPos"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.init.Blocks; import net.minecraft.util.math.BlockPos; | import net.minecraft.block.state.*; import net.minecraft.init.*; import net.minecraft.util.math.*; | [
"net.minecraft.block",
"net.minecraft.init",
"net.minecraft.util"
] | net.minecraft.block; net.minecraft.init; net.minecraft.util; | 94,672 |
public void moveColumn(int oldIndex, int newIndex) {
if ((oldIndex < 0) || (oldIndex >= getColumnCount()) || (newIndex < 0)
|| (newIndex >= getColumnCount()))
throw new IllegalArgumentException(
"moveColumn() - Index out of range");
TableColumn fromColumn = (TableColumn) tableColumns.get(oldIndex);
... | void function(int oldIndex, int newIndex) { if ((oldIndex < 0) (oldIndex >= getColumnCount()) (newIndex < 0) (newIndex >= getColumnCount())) throw new IllegalArgumentException( STR); TableColumn fromColumn = (TableColumn) tableColumns.get(oldIndex); TableColumn toColumn = (TableColumn) tableColumns.get(newIndex); int a... | /**
* Moves the column from <code>oldIndex</code> to <code>newIndex</code>.
* Posts <code>columnMoved</code> event. Will not move any columns if
* <code>oldIndex</code> equals <code>newIndex</code>.
*
* @param oldIndex
* index of column to be moved
* @param newIndex
* new index of... | Moves the column from <code>oldIndex</code> to <code>newIndex</code>. Posts <code>columnMoved</code> event. Will not move any columns if <code>oldIndex</code> equals <code>newIndex</code> | moveColumn | {
"repo_name": "VladimirRadojcic/Master",
"path": "SwingApp/src/util/column/XTableColumnModel.java",
"license": "mit",
"size": 9535
} | [
"javax.swing.table.TableColumn"
] | import javax.swing.table.TableColumn; | import javax.swing.table.*; | [
"javax.swing"
] | javax.swing; | 2,401,680 |
public int[] getFillExtrusionTranslate() throws MBFormatException {
return parse.array(paint, "fill-extrusion-translate", new int[] {0, 0});
} | int[] function() throws MBFormatException { return parse.array(paint, STR, new int[] {0, 0}); } | /**
* (Optional) Units in pixels. Defaults to 0,0.
*
* <p>The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat
* plane), respectively.
*
* @return The geometry's offset, in pixels.
*/ | (Optional) Units in pixels. Defaults to 0,0. The geometry's offset. Values are [x, y] where negatives indicate left and up (on the flat plane), respectively | getFillExtrusionTranslate | {
"repo_name": "geotools/geotools",
"path": "modules/extension/mbstyle/src/main/java/org/geotools/mbstyle/layer/FillExtrusionMBLayer.java",
"license": "lgpl-2.1",
"size": 16052
} | [
"org.geotools.mbstyle.parse.MBFormatException"
] | import org.geotools.mbstyle.parse.MBFormatException; | import org.geotools.mbstyle.parse.*; | [
"org.geotools.mbstyle"
] | org.geotools.mbstyle; | 1,495,511 |
@Test
public void needsHierarchical_checkWhetherMarked() {
LNode leftOuterNode = addNodeToLayer(makeLayer());
LNode rightOuterNode = addNodeToLayer(makeLayer());
LPort[] leftOuterPorts = addPortsOnSide(2, leftOuterNode, PortSide.EAST);
LPort[] rightOuterPorts = addPortsOnSide(2, ... | void function() { LNode leftOuterNode = addNodeToLayer(makeLayer()); LNode rightOuterNode = addNodeToLayer(makeLayer()); LPort[] leftOuterPorts = addPortsOnSide(2, leftOuterNode, PortSide.EAST); LPort[] rightOuterPorts = addPortsOnSide(2, rightOuterNode, PortSide.WEST); addEdgeBetweenPorts(leftOuterPorts[0], rightOuter... | /**
* <pre>
* _______ _____
* | *-+--+-* |
* | *-+--+-* |
* |_____| |___|
* </pre>
*/ | <code> _______ _____ | *-+--+-* | | *-+--+-* | |_____| |___| </code> | needsHierarchical_checkWhetherMarked | {
"repo_name": "eNBeWe/elk",
"path": "test/org.eclipse.elk.alg.test/src/org/eclipse/elk/alg/test/layered/p3order/LayerSweepCrossingMinimizerTest.java",
"license": "epl-1.0",
"size": 65087
} | [
"java.util.List",
"org.eclipse.elk.alg.layered.graph.LNode",
"org.eclipse.elk.alg.layered.graph.LPort",
"org.eclipse.elk.alg.layered.options.LayeredOptions",
"org.eclipse.elk.alg.layered.p3order.GraphInfoHolder",
"org.eclipse.elk.core.options.PortSide",
"org.junit.Assert"
] | import java.util.List; import org.eclipse.elk.alg.layered.graph.LNode; import org.eclipse.elk.alg.layered.graph.LPort; import org.eclipse.elk.alg.layered.options.LayeredOptions; import org.eclipse.elk.alg.layered.p3order.GraphInfoHolder; import org.eclipse.elk.core.options.PortSide; import org.junit.Assert; | import java.util.*; import org.eclipse.elk.alg.layered.graph.*; import org.eclipse.elk.alg.layered.options.*; import org.eclipse.elk.alg.layered.p3order.*; import org.eclipse.elk.core.options.*; import org.junit.*; | [
"java.util",
"org.eclipse.elk",
"org.junit"
] | java.util; org.eclipse.elk; org.junit; | 2,270,337 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.