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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
@SuppressWarnings("unchecked")
public List<PollsQuestion> displayActivePolls(String orderBy, int direction) {
return pollsAPI.getActiveQuestions(orderBy, direction);
}
| @SuppressWarnings(STR) List<PollsQuestion> function(String orderBy, int direction) { return pollsAPI.getActiveQuestions(orderBy, direction); } | /**
* Return a list of active PollsQuestion ordered
* @param orderBy Permitted values createDate, expirationDate and questionId
* @param direction value -1 descending order and 1 to ascending order
*
* @return List<PollsQuestion>
*/ | Return a list of active PollsQuestion ordered | displayActivePolls | {
"repo_name": "ggonzales/ksl",
"path": "src/com/dotmarketing/viewtools/PollsWebAPI.java",
"license": "gpl-3.0",
"size": 10044
} | [
"com.liferay.portlet.polls.model.PollsQuestion",
"java.util.List"
] | import com.liferay.portlet.polls.model.PollsQuestion; import java.util.List; | import com.liferay.portlet.polls.model.*; import java.util.*; | [
"com.liferay.portlet",
"java.util"
] | com.liferay.portlet; java.util; | 179,056 |
public void post(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) {
post(context, url, paramsToEntity(params), null, responseHandler);
} | void function(Context context, String url, RequestParams params, AsyncHttpResponseHandler responseHandler) { post(context, url, paramsToEntity(params), null, responseHandler); } | /**
* Perform a HTTP POST request and track the Android Context which initiated the request.
* @param context the Android Context which initiated the request.
* @param url the URL to send the request to.
* @param params additional POST parameters or files to send with the request.
* @param resp... | Perform a HTTP POST request and track the Android Context which initiated the request | post | {
"repo_name": "zoozooll/MyExercise",
"path": "meep/MeepOTA/src/com/loopj/android/http/AsyncHttpClient.java",
"license": "apache-2.0",
"size": 27035
} | [
"android.content.Context"
] | import android.content.Context; | import android.content.*; | [
"android.content"
] | android.content; | 1,177,236 |
public FocusDevice getFocusDevice(String deviceID) throws DeviceException, RemoteException; | FocusDevice function(String deviceID) throws DeviceException, RemoteException; | /**
* Returns the focus device with the given name.
* @param deviceID Name of focus device.
*
* @return Focus device.
* @throws DeviceException
* @throws RemoteException
*/ | Returns the focus device with the given name | getFocusDevice | {
"repo_name": "langmo/youscope",
"path": "core/api/src/main/java/org/youscope/common/microscope/Microscope.java",
"license": "gpl-2.0",
"size": 16695
} | [
"java.rmi.RemoteException"
] | import java.rmi.RemoteException; | import java.rmi.*; | [
"java.rmi"
] | java.rmi; | 1,055,844 |
private void testParentChild(String target, String parent, String child) {
if (target.length() > 0) {
assertEquals(new AlluxioURI(target), new AlluxioURI(new AlluxioURI(parent),
new AlluxioURI(child)));
} else {
assertEquals(target,
new AlluxioURI(new AlluxioURI(parent), new Al... | void function(String target, String parent, String child) { if (target.length() > 0) { assertEquals(new AlluxioURI(target), new AlluxioURI(new AlluxioURI(parent), new AlluxioURI(child))); } else { assertEquals(target, new AlluxioURI(new AlluxioURI(parent), new AlluxioURI(child)).toString()); } } | /**
* Tests to resolve a child {@link AlluxioURI} against a parent {@link AlluxioURI}.
*
* @param target the target path
* @param parent the parent path
* @param child the child path
*/ | Tests to resolve a child <code>AlluxioURI</code> against a parent <code>AlluxioURI</code> | testParentChild | {
"repo_name": "wwjiang007/alluxio",
"path": "core/common/src/test/java/alluxio/AlluxioURITest.java",
"license": "apache-2.0",
"size": 41273
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 1,895,710 |
@Schema(required = true, description = "Secret Access Key")
public String getSecretKey() {
return secretKey;
} | @Schema(required = true, description = STR) String function() { return secretKey; } | /**
* Secret Access Key
* @return secretKey
**/ | Secret Access Key | getSecretKey | {
"repo_name": "iterate-ch/cyberduck",
"path": "dracoon/src/main/java/ch/cyberduck/core/sds/io/swagger/client/model/S3ConfigCreateRequest.java",
"license": "gpl-3.0",
"size": 6145
} | [
"io.swagger.v3.oas.annotations.media.Schema"
] | import io.swagger.v3.oas.annotations.media.Schema; | import io.swagger.v3.oas.annotations.media.*; | [
"io.swagger.v3"
] | io.swagger.v3; | 1,529,272 |
public void insert(Task ac, Action parent) {
network.addVertex(new TNNode(ac));
network.addEdge(new TNNode(parent), new TNNode(ac));
numOpenTasks++;
clearCache();
} | void function(Task ac, Action parent) { network.addVertex(new TNNode(ac)); network.addEdge(new TNNode(parent), new TNNode(ac)); numOpenTasks++; clearCache(); } | /**
* Adds an action condition to an action.
* @param ac The action condition.
* @param parent The action in which ac appears. This action must be already
* present in the task network.
*/ | Adds an action condition to an action | insert | {
"repo_name": "athy/fape",
"path": "planning/src/main/java/fr/laas/fape/planning/core/planning/tasknetworks/TaskNetworkManager.java",
"license": "bsd-2-clause",
"size": 13911
} | [
"fr.laas.fape.anml.model.concrete.Action",
"fr.laas.fape.anml.model.concrete.Task"
] | import fr.laas.fape.anml.model.concrete.Action; import fr.laas.fape.anml.model.concrete.Task; | import fr.laas.fape.anml.model.concrete.*; | [
"fr.laas.fape"
] | fr.laas.fape; | 2,348,370 |
@Deprecated
void printStat(PrintStream out, String prefix); | void printStat(PrintStream out, String prefix); | /**
* Display statistics to the given output stream Please use writers instead
* of stream.
*
* @param out
* @param prefix
* the prefix to put in front of each line
* @see #printStat(PrintWriter, String)
*/ | Display statistics to the given output stream Please use writers instead of stream | printStat | {
"repo_name": "SCPTeam/Safe-Component-Provider",
"path": "Sat4jCore/src/org/sat4j/specs/ISolver.java",
"license": "mit",
"size": 18738
} | [
"java.io.PrintStream"
] | import java.io.PrintStream; | import java.io.*; | [
"java.io"
] | java.io; | 1,138,653 |
@Override
public Map<K, V> materializeToMap() {
return new MaterializableMap<K, V>(this.materialize());
} | Map<K, V> function() { return new MaterializableMap<K, V>(this.materialize()); } | /**
* Returns a Map<K, V> made up of the keys and values in this PTable.
*/ | Returns a Map made up of the keys and values in this PTable | materializeToMap | {
"repo_name": "rvs/crunch",
"path": "crunch/src/main/java/org/apache/crunch/impl/mr/collect/PTableBase.java",
"license": "apache-2.0",
"size": 3699
} | [
"java.util.Map",
"org.apache.crunch.materialize.MaterializableMap"
] | import java.util.Map; import org.apache.crunch.materialize.MaterializableMap; | import java.util.*; import org.apache.crunch.materialize.*; | [
"java.util",
"org.apache.crunch"
] | java.util; org.apache.crunch; | 1,589,614 |
private void attemptModifyLabelPaint() {
Color c;
c = JColorChooser.showDialog(
this, localizationResources.getString("Label_Color"), Color.BLUE
);
if (c != null) {
this.labelPaintSample.setPaint(c);
}
}
| void function() { Color c; c = JColorChooser.showDialog( this, localizationResources.getString(STR), Color.BLUE ); if (c != null) { this.labelPaintSample.setPaint(c); } } | /**
* Allows the user the opportunity to change the outline paint.
*/ | Allows the user the opportunity to change the outline paint | attemptModifyLabelPaint | {
"repo_name": "greearb/jfreechart-fse-ct",
"path": "src/main/java/org/jfree/chart/editor/DefaultAxisEditor.java",
"license": "lgpl-2.1",
"size": 17693
} | [
"java.awt.Color",
"javax.swing.JColorChooser"
] | import java.awt.Color; import javax.swing.JColorChooser; | import java.awt.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 2,273,293 |
public static void saveToSharedPreferences(String name, String stringValue, Context context) {
if (context == null)
return;
// Access the default SharedPreferences
SharedPreferences preferences =
PreferenceManager.getDefaultSharedPreferences(context);
// T... | static void function(String name, String stringValue, Context context) { if (context == null) return; SharedPreferences preferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = preferences.edit(); editor.putString(name, stringValue); editor.commit(); } | /**
* String in die StaredPreferences schreiben
*
* @param name Name der Einstellung
* @param stringValue String, der gespeichert werden soll
* @param context Ohne Context geht es nicht
*/ | String in die StaredPreferences schreiben | saveToSharedPreferences | {
"repo_name": "LightSnowDev/VPlanPRS",
"path": "mobile/src/main/java/com/lightSnowDev/VPlanPRS2/helper/StorageHelper.java",
"license": "gpl-3.0",
"size": 8277
} | [
"android.content.Context",
"android.content.SharedPreferences",
"android.preference.PreferenceManager"
] | import android.content.Context; import android.content.SharedPreferences; import android.preference.PreferenceManager; | import android.content.*; import android.preference.*; | [
"android.content",
"android.preference"
] | android.content; android.preference; | 768,455 |
public static long[] scaleLargeTimestamps(List<Long> timestamps, long multiplier, long divisor) {
long[] scaledTimestamps = new long[timestamps.size()];
if (divisor >= multiplier && (divisor % multiplier) == 0) {
long divisionFactor = divisor / multiplier;
for (int i = 0; i < scaledTimestamps.leng... | static long[] function(List<Long> timestamps, long multiplier, long divisor) { long[] scaledTimestamps = new long[timestamps.size()]; if (divisor >= multiplier && (divisor % multiplier) == 0) { long divisionFactor = divisor / multiplier; for (int i = 0; i < scaledTimestamps.length; i++) { scaledTimestamps[i] = timestam... | /**
* Applies {@link #scaleLargeTimestamp(long, long, long)} to a list of unscaled timestamps.
*
* @param timestamps The timestamps to scale.
* @param multiplier The multiplier.
* @param divisor The divisor.
* @return The scaled timestamps.
*/ | Applies <code>#scaleLargeTimestamp(long, long, long)</code> to a list of unscaled timestamps | scaleLargeTimestamps | {
"repo_name": "yangwuan55/ExoPlayer",
"path": "library/src/main/java/com/google/android/exoplayer2/util/Util.java",
"license": "apache-2.0",
"size": 43613
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,447,231 |
protected void save() throws Exception {
ArrayList<Attachment> attachments =
new ArrayList<Attachment>();
for (Attachment attachment : this.getRemovedItems()) {
if (!attachment.isNew()) {
attachments.add(attachment);
}
}
// If any, delete them by calling the DeleteAttachment web method.
if (... | void function() throws Exception { ArrayList<Attachment> attachments = new ArrayList<Attachment>(); for (Attachment attachment : this.getRemovedItems()) { if (!attachment.isNew()) { attachments.add(attachment); } } if (attachments.size() > 0) { this.internalDeleteAttachments(attachments); } attachments.clear(); for (At... | /**
* Saves this collection by creating new attachment and deleting removed
* ones.
*
* @throws Exception
* the exception
*/ | Saves this collection by creating new attachment and deleting removed ones | save | {
"repo_name": "vboctor/ews-java-api",
"path": "src/main/java/microsoft/exchange/webservices/data/AttachmentCollection.java",
"license": "mit",
"size": 13549
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 1,554,084 |
public void setSpeed(VehicleDataResult speed) {
if (speed != null) {
parameters.put(Names.speed, speed);
} else {
parameters.remove(Names.speed);
}
}
| void function(VehicleDataResult speed) { if (speed != null) { parameters.put(Names.speed, speed); } else { parameters.remove(Names.speed); } } | /**
* Sets Speed
* @param speed
*/ | Sets Speed | setSpeed | {
"repo_name": "Luxoft/SDLP2",
"path": "SDL_Android/SmartDeviceLinkProxyAndroid/src/com/smartdevicelink/proxy/rpc/UnsubscribeVehicleDataResponse.java",
"license": "lgpl-2.1",
"size": 33556
} | [
"com.smartdevicelink.proxy.constants.Names"
] | import com.smartdevicelink.proxy.constants.Names; | import com.smartdevicelink.proxy.constants.*; | [
"com.smartdevicelink.proxy"
] | com.smartdevicelink.proxy; | 2,640,761 |
public int unarchiveSolves(String type, String subtype, int solves) {
SQLiteDatabase db = this.getWritableDatabase();
ContentValues values = new ContentValues();
values.put(KEY_HISTORY, false);
// Updating row
return db.update(TABLE_TIMES, values,
K... | int function(String type, String subtype, int solves) { SQLiteDatabase db = this.getWritableDatabase(); ContentValues values = new ContentValues(); values.put(KEY_HISTORY, false); return db.update(TABLE_TIMES, values, KEY_ID + STR + KEY_ID + STR + TABLE_TIMES + STR + KEY_PENALTY + STR + PuzzleUtils.PENALTY_HIDETIME + S... | /**
* Unarchives a select number of the most recent solves
*
* @param type
* @param subtype
* @param solves number of solves to be unarchived
*
* @return
*/ | Unarchives a select number of the most recent solves | unarchiveSolves | {
"repo_name": "aricneto/TwistyTimer",
"path": "app/src/main/java/com/aricneto/twistytimer/database/DatabaseHandler.java",
"license": "gpl-3.0",
"size": 38439
} | [
"android.content.ContentValues",
"android.database.sqlite.SQLiteDatabase",
"com.aricneto.twistytimer.utils.PuzzleUtils"
] | import android.content.ContentValues; import android.database.sqlite.SQLiteDatabase; import com.aricneto.twistytimer.utils.PuzzleUtils; | import android.content.*; import android.database.sqlite.*; import com.aricneto.twistytimer.utils.*; | [
"android.content",
"android.database",
"com.aricneto.twistytimer"
] | android.content; android.database; com.aricneto.twistytimer; | 1,497,784 |
public TimeValue total() {
return new TimeValue(total);
} | TimeValue function() { return new TimeValue(total); } | /**
* Get the Process cpu time (sum of User and Sys).
* <p/>
* Supported Platforms: All.
*/ | Get the Process cpu time (sum of User and Sys). Supported Platforms: All | total | {
"repo_name": "Kreolwolf1/Elastic",
"path": "src/main/java/org/elasticsearch/monitor/process/ProcessStats.java",
"license": "apache-2.0",
"size": 10152
} | [
"org.elasticsearch.common.unit.TimeValue"
] | import org.elasticsearch.common.unit.TimeValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 1,951,460 |
private Preference makePreference( ParameterDefinition paramDef ) {
Preference preference = null;
// Handle the various types.
if ( paramDef.getType() instanceof PrimitiveValueType ) {
preference = this.makePrimitivePreference( paramDef );
}
return preference;
} | Preference function( ParameterDefinition paramDef ) { Preference preference = null; if ( paramDef.getType() instanceof PrimitiveValueType ) { preference = this.makePrimitivePreference( paramDef ); } return preference; } | /**
* Makes a preference from a ParameterDefinition.
*
* @param paramDef the definition.
* @return the preference.
*/ | Makes a preference from a ParameterDefinition | makePreference | {
"repo_name": "Centril/sleepfighter",
"path": "application/sleepfighter/src/main/java/se/toxbee/sleepfighter/activity/ChallengeParamsSettingsActivity.java",
"license": "apache-2.0",
"size": 10091
} | [
"android.preference.Preference",
"se.toxbee.sleepfighter.challenge.ChallengePrototypeDefinition"
] | import android.preference.Preference; import se.toxbee.sleepfighter.challenge.ChallengePrototypeDefinition; | import android.preference.*; import se.toxbee.sleepfighter.challenge.*; | [
"android.preference",
"se.toxbee.sleepfighter"
] | android.preference; se.toxbee.sleepfighter; | 324,553 |
EAttribute getCardinalityPredicate_MinCardinality(); | EAttribute getCardinalityPredicate_MinCardinality(); | /**
* Returns the meta object for the attribute '{@link com.b2international.snowowl.snomed.mrcm.CardinalityPredicate#getMinCardinality <em>Min Cardinality</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Min Cardinality</em>'.
* @see com.b2internationa... | Returns the meta object for the attribute '<code>com.b2international.snowowl.snomed.mrcm.CardinalityPredicate#getMinCardinality Min Cardinality</code>'. | getCardinalityPredicate_MinCardinality | {
"repo_name": "IHTSDO/snow-owl",
"path": "snomed/com.b2international.snowowl.snomed.mrcm.model/src/com/b2international/snowowl/snomed/mrcm/MrcmPackage.java",
"license": "apache-2.0",
"size": 82769
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 2,566,684 |
public int getForegroundGravity() {
if (isForegroundEnable())
return super.getForegroundGravity();
return mForegroundInfo != null ? mForegroundInfo.mGravity
: Gravity.START | Gravity.TOP;
}
/**
* Describes how the foreground is positioned. Defaults to START ... | int function() { if (isForegroundEnable()) return super.getForegroundGravity(); return mForegroundInfo != null ? mForegroundInfo.mGravity : Gravity.START Gravity.TOP; } /** * Describes how the foreground is positioned. Defaults to START and TOP. * * @param gravity see {@link android.view.Gravity} | /**
* Describes how the foreground is positioned.
*
* @return foreground gravity.
* @see #setForegroundGravity(int)
*/ | Describes how the foreground is positioned | getForegroundGravity | {
"repo_name": "AlexMofer/AMWidget",
"path": "multifunctionalimageview/src/main/java/am/widget/multifunctionalimageview/ForegroundImageView.java",
"license": "apache-2.0",
"size": 7777
} | [
"android.view.Gravity"
] | import android.view.Gravity; | import android.view.*; | [
"android.view"
] | android.view; | 1,204,924 |
public void removeExe(ByteCodeExecutor exe) {
getQueue().remove(exe);
}
| void function(ByteCodeExecutor exe) { getQueue().remove(exe); } | /**
* Remove an executor from execute queue.
*
* @param exe
*/ | Remove an executor from execute queue | removeExe | {
"repo_name": "IBYoung/asmsupport",
"path": "asmsupport-core/src/main/java/cn/wensiqun/asmsupport/core/block/AbstractKernelBlock.java",
"license": "lgpl-3.0",
"size": 1337
} | [
"cn.wensiqun.asmsupport.core.ByteCodeExecutor"
] | import cn.wensiqun.asmsupport.core.ByteCodeExecutor; | import cn.wensiqun.asmsupport.core.*; | [
"cn.wensiqun.asmsupport"
] | cn.wensiqun.asmsupport; | 2,875,022 |
@Override
public List<String> getJobGroupNames() throws JobPersistenceException {
lock();
try {
return new ArrayList<String>(jobFacade.getAllGroupNames());
} finally {
unlock();
}
} | List<String> function() throws JobPersistenceException { lock(); try { return new ArrayList<String>(jobFacade.getAllGroupNames()); } finally { unlock(); } } | /**
* <p>
* Get the names of all of the <code>{@link org.quartz.Job}</code> groups.
* </p>
*/ | Get the names of all of the <code><code>org.quartz.Job</code></code> groups. | getJobGroupNames | {
"repo_name": "suthat/signal",
"path": "vendor/quartz-2.2.0/src/org/terracotta/quartz/DefaultClusteredJobStore.java",
"license": "apache-2.0",
"size": 64329
} | [
"java.util.ArrayList",
"java.util.List",
"org.quartz.JobPersistenceException"
] | import java.util.ArrayList; import java.util.List; import org.quartz.JobPersistenceException; | import java.util.*; import org.quartz.*; | [
"java.util",
"org.quartz"
] | java.util; org.quartz; | 2,580,577 |
public Pair<Key, String> createKey(final String name) throws InsufficientPermissionsException, DuplicateKeyException {
if (AuthenticationService.getInstance().getAuthenticatedKey().isPresent()) {
if (AuthenticationService.getInstance().getAuthenticatedKey().get().equals(this.getPrimaryKey())) {
return ... | Pair<Key, String> function(final String name) throws InsufficientPermissionsException, DuplicateKeyException { if (AuthenticationService.getInstance().getAuthenticatedKey().isPresent()) { if (AuthenticationService.getInstance().getAuthenticatedKey().get().equals(this.getPrimaryKey())) { return this.addKey(name); } } th... | /**
* Creates a new Key Object and adds it to the Database
*
* @param name Name for the Key
*
* @return Pair of the Key object and the Keys unhashed ID as a String
*
* @throws InsufficientPermissionsException if the current Threads authenticated Key is no PrimaryKey
* @throws DuplicateKeyException ... | Creates a new Key Object and adds it to the Database | createKey | {
"repo_name": "SmartLambda/SmartLambda",
"path": "src/main/java/edu/teco/smartlambda/authentication/entities/User.java",
"license": "gpl-3.0",
"size": 8171
} | [
"edu.teco.smartlambda.authentication.AuthenticationService",
"edu.teco.smartlambda.authentication.DuplicateKeyException",
"edu.teco.smartlambda.authentication.InsufficientPermissionsException",
"org.apache.commons.lang3.tuple.Pair"
] | import edu.teco.smartlambda.authentication.AuthenticationService; import edu.teco.smartlambda.authentication.DuplicateKeyException; import edu.teco.smartlambda.authentication.InsufficientPermissionsException; import org.apache.commons.lang3.tuple.Pair; | import edu.teco.smartlambda.authentication.*; import org.apache.commons.lang3.tuple.*; | [
"edu.teco.smartlambda",
"org.apache.commons"
] | edu.teco.smartlambda; org.apache.commons; | 974,320 |
public void activateEditor(ValueEditor editorToActivate) {
if (editorToActivate != currentEditor) {
makeCurrentEditor(editorToActivate);
}
// If editorToActivate is null and there are top-level editors, then makeCurrentEditor
// will make one of the top-level edi... | void function(ValueEditor editorToActivate) { if (editorToActivate != currentEditor) { makeCurrentEditor(editorToActivate); } if (currentEditor != null && editorToActivate != null) { currentEditor.editorActivated(); Component focusComponent = currentEditor.getDefaultFocusComponent(); if (focusComponent != null) { focus... | /**
* Make a given editor the current editor, and give it focus.
* @param editorToActivate the editor to activate, or null to clear the current editor.
*/ | Make a given editor the current editor, and give it focus | activateEditor | {
"repo_name": "levans/Open-Quark",
"path": "src/Quark_Gems/src/org/openquark/gems/client/valueentry/ValueEditorHierarchyManager.java",
"license": "bsd-3-clause",
"size": 43902
} | [
"java.awt.Component"
] | import java.awt.Component; | import java.awt.*; | [
"java.awt"
] | java.awt; | 435,515 |
protected void moveEntities(ArrayList<Shape> entities) {
for (Shape entity : entities) { // move all entities
if (!(entity instanceof WorldBound)) {
// System.out.println("vel: " + entity.getVelocity());
entity.move(dt);
}
}
} | void function(ArrayList<Shape> entities) { for (Shape entity : entities) { if (!(entity instanceof WorldBound)) { entity.move(dt); } } } | /**
* Move all the entities based on their properties and forces.
*
* @param entities the entities to move.
*/ | Move all the entities based on their properties and forces | moveEntities | {
"repo_name": "afsheenrane/Tugu2D",
"path": "src/phys2d/collisionLogic/collisionManagers/CollisionManager.java",
"license": "mit",
"size": 9006
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,173,483 |
public synchronized void setInstanceStatus(InstanceStatus status) {
InstanceStatus prev = instanceInfo.setStatus(status);
if (prev != null) {
for (StatusChangeListener listener : listeners.values()) {
try {
listener.notify(new StatusChangeEvent(prev, s... | synchronized void function(InstanceStatus status) { InstanceStatus prev = instanceInfo.setStatus(status); if (prev != null) { for (StatusChangeListener listener : listeners.values()) { try { listener.notify(new StatusChangeEvent(prev, status)); } catch (Exception e) { logger.warn(STR, listener.getId(), e); } } } } | /**
* Set the status of this instance. Application can use this to indicate
* whether it is ready to receive traffic. Setting the status here also notifies all registered listeners
* of a status change event.
*
* @param status Status of the instance
*/ | Set the status of this instance. Application can use this to indicate whether it is ready to receive traffic. Setting the status here also notifies all registered listeners of a status change event | setInstanceStatus | {
"repo_name": "ccortezb/eureka",
"path": "eureka-client/src/main/java/com/netflix/appinfo/ApplicationInfoManager.java",
"license": "apache-2.0",
"size": 5916
} | [
"com.netflix.appinfo.InstanceInfo",
"com.netflix.discovery.StatusChangeEvent"
] | import com.netflix.appinfo.InstanceInfo; import com.netflix.discovery.StatusChangeEvent; | import com.netflix.appinfo.*; import com.netflix.discovery.*; | [
"com.netflix.appinfo",
"com.netflix.discovery"
] | com.netflix.appinfo; com.netflix.discovery; | 855,725 |
private int writeStepPerformanceLogRecords( int startSequenceNr, LogStatus status ) throws KettleException {
int lastSeqNr = 0;
Database ldb = null;
PerformanceLogTable performanceLogTable = transMeta.getPerformanceLogTable();
if ( !performanceLogTable.isDefined() || !transMeta.isCapturingStepPerform... | int function( int startSequenceNr, LogStatus status ) throws KettleException { int lastSeqNr = 0; Database ldb = null; PerformanceLogTable performanceLogTable = transMeta.getPerformanceLogTable(); if ( !performanceLogTable.isDefined() !transMeta.isCapturingStepPerformanceSnapShots() stepPerformanceSnapShots == null ste... | /**
* Write step performance log records.
*
* @param startSequenceNr
* the start sequence numberr
* @param status
* the logging status. If this is End, perform cleanup
* @return the new sequence number
* @throws KettleException
* if any errors occur during logging
... | Write step performance log records | writeStepPerformanceLogRecords | {
"repo_name": "denisprotopopov/pentaho-kettle",
"path": "engine/src/org/pentaho/di/trans/Trans.java",
"license": "apache-2.0",
"size": 196543
} | [
"java.util.Iterator",
"java.util.List",
"org.pentaho.di.core.RowMetaAndData",
"org.pentaho.di.core.database.Database",
"org.pentaho.di.core.exception.KettleException",
"org.pentaho.di.core.logging.LogStatus",
"org.pentaho.di.core.logging.PerformanceLogTable",
"org.pentaho.di.i18n.BaseMessages",
"org... | import java.util.Iterator; import java.util.List; import org.pentaho.di.core.RowMetaAndData; import org.pentaho.di.core.database.Database; import org.pentaho.di.core.exception.KettleException; import org.pentaho.di.core.logging.LogStatus; import org.pentaho.di.core.logging.PerformanceLogTable; import org.pentaho.di.i18... | import java.util.*; import org.pentaho.di.core.*; import org.pentaho.di.core.database.*; import org.pentaho.di.core.exception.*; import org.pentaho.di.core.logging.*; import org.pentaho.di.i18n.*; import org.pentaho.di.trans.performance.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 652,611 |
public boolean getBooleanValue() {
if (resultType != BOOLEAN_TYPE) {
throw createXPathException
(XPathException.TYPE_ERR,
"xpath.invalid.result.type",
new Object[] { new Integer(resultType) });
... | boolean function() { if (resultType != BOOLEAN_TYPE) { throw createXPathException (XPathException.TYPE_ERR, STR, new Object[] { new Integer(resultType) }); } return booleanValue; } | /**
* Gets the boolean value.
*/ | Gets the boolean value | getBooleanValue | {
"repo_name": "adufilie/flex-sdk",
"path": "modules/thirdparty/batik/sources/org/apache/flex/forks/batik/dom/AbstractDocument.java",
"license": "apache-2.0",
"size": 95805
} | [
"org.w3c.dom.xpath.XPathException"
] | import org.w3c.dom.xpath.XPathException; | import org.w3c.dom.xpath.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,088,589 |
public boolean childBlockProcessed(@NotNull Block child, @NotNull AbstractBlockWrapper wrappedChild) {
myWrappedChildren.add(wrappedChild);
previousBlock = child;
int subBlocksNumber = parentBlock.getSubBlocks().size();
if (myWrappedChildren.size() > subBlocksNumber) {
return ... | boolean function(@NotNull Block child, @NotNull AbstractBlockWrapper wrappedChild) { myWrappedChildren.add(wrappedChild); previousBlock = child; int subBlocksNumber = parentBlock.getSubBlocks().size(); if (myWrappedChildren.size() > subBlocksNumber) { return true; } else if (myWrappedChildren.size() == subBlocksNumber)... | /**
* Notifies current state that child block is processed.
*
* @return <code>true</code> if all child blocks of the block denoted by the current state are processed;
* <code>false</code> otherwise
*/ | Notifies current state that child block is processed | childBlockProcessed | {
"repo_name": "holmes/intellij-community",
"path": "platform/lang-impl/src/com/intellij/formatting/InitialInfoBuilder.java",
"license": "apache-2.0",
"size": 22742
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 2,422,220 |
@Test (timeout=60000)
public void testOfflineRegion() throws Exception {
TableName table =
TableName.valueOf("testOfflineRegion");
try {
HRegionInfo hri = createTableAndGetOneRegion(table);
RegionStates regionStates = TEST_UTIL.getHBaseCluster().
getMaster().getAssignmentManager... | @Test (timeout=60000) void function() throws Exception { TableName table = TableName.valueOf(STR); try { HRegionInfo hri = createTableAndGetOneRegion(table); RegionStates regionStates = TEST_UTIL.getHBaseCluster(). getMaster().getAssignmentManager().getRegionStates(); ServerName serverName = regionStates.getRegionServe... | /**
* This tests offlining a region
*/ | This tests offlining a region | testOfflineRegion | {
"repo_name": "ibmsoe/hbase",
"path": "hbase-server/src/test/java/org/apache/hadoop/hbase/master/TestAssignmentManagerOnCluster.java",
"license": "apache-2.0",
"size": 55660
} | [
"org.apache.hadoop.hbase.HRegionInfo",
"org.apache.hadoop.hbase.ServerName",
"org.apache.hadoop.hbase.TableName",
"org.apache.hadoop.hbase.master.RegionState",
"org.junit.Assert",
"org.junit.Test"
] | import org.apache.hadoop.hbase.HRegionInfo; import org.apache.hadoop.hbase.ServerName; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.master.RegionState; import org.junit.Assert; import org.junit.Test; | import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.master.*; import org.junit.*; | [
"org.apache.hadoop",
"org.junit"
] | org.apache.hadoop; org.junit; | 1,855,702 |
@Override
public void close() throws IOException
{
// we didn't create the selector,
// it is not our responsibility to close it.
// selector.close();
} | void function() throws IOException { } | /**
* Destroys the poller. Does actually nothing.
*/ | Destroys the poller. Does actually nothing | close | {
"repo_name": "brimzi/jeromq",
"path": "src/main/java/org/zeromq/ZPoller.java",
"license": "gpl-3.0",
"size": 23729
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,492,721 |
IotSensorsModel create(Context context);
} | IotSensorsModel create(Context context); } | /**
* Executes the create request.
*
* @param context The context to associate with this operation.
* @return the created resource.
*/ | Executes the create request | create | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/security/azure-resourcemanager-security/src/main/java/com/azure/resourcemanager/security/models/IotSensorsModel.java",
"license": "mit",
"size": 11258
} | [
"com.azure.core.util.Context"
] | import com.azure.core.util.Context; | import com.azure.core.util.*; | [
"com.azure.core"
] | com.azure.core; | 770,406 |
public static void configureDriver(final WebDriver driver) {
if (driver == null) {
throw new IllegalArgumentException("a driver must be provided.");
}
driver.manage().timeouts().implicitlyWait(IMPLICIT_WAIT_SECONDS, TimeUnit.SECONDS);
driver.manage().window().setSize(new Dimension(SCREEN_WIDTH, SCREEN_HE... | static void function(final WebDriver driver) { if (driver == null) { throw new IllegalArgumentException(STR); } driver.manage().timeouts().implicitlyWait(IMPLICIT_WAIT_SECONDS, TimeUnit.SECONDS); driver.manage().window().setSize(new Dimension(SCREEN_WIDTH, SCREEN_HEIGHT)); } | /**
* Configure the WebDriver with the standard WComponents configuration.
*
* @param driver the WebDriver to configure.
*/ | Configure the WebDriver with the standard WComponents configuration | configureDriver | {
"repo_name": "Joshua-Barclay/wcomponents",
"path": "wcomponents-test-lib/src/main/java/com/github/bordertech/wcomponents/test/selenium/SeleniumWComponentsUtil.java",
"license": "gpl-3.0",
"size": 8118
} | [
"java.util.concurrent.TimeUnit",
"org.openqa.selenium.Dimension",
"org.openqa.selenium.WebDriver"
] | import java.util.concurrent.TimeUnit; import org.openqa.selenium.Dimension; import org.openqa.selenium.WebDriver; | import java.util.concurrent.*; import org.openqa.selenium.*; | [
"java.util",
"org.openqa.selenium"
] | java.util; org.openqa.selenium; | 750,943 |
public static BufferedImage makeImage(byte[] data,
int w, int h, int c, boolean interleaved, boolean signed)
{
if (c == 1) return makeImage(data, w, h, signed);
if (c > 2) return makeRGBImage(data, c, w, h, interleaved);
int dataType;
DataBuffer buffer;
dataType = DataBuffer.TYPE_BYTE;
i... | static BufferedImage function(byte[] data, int w, int h, int c, boolean interleaved, boolean signed) { if (c == 1) return makeImage(data, w, h, signed); if (c > 2) return makeRGBImage(data, c, w, h, interleaved); int dataType; DataBuffer buffer; dataType = DataBuffer.TYPE_BYTE; if (signed) { buffer = new SignedByteBuff... | /**
* Creates an image from the given byte data.
*
* @param data Array containing image data.
* @param w Width of image plane.
* @param h Height of image plane.
* @param c Number of channels.
* @param interleaved If set, the channels are assumed to be interleaved;
* otherwise they are assumed ... | Creates an image from the given byte data | makeImage | {
"repo_name": "hflynn/bioformats",
"path": "components/formats-bsd/src/loci/formats/gui/AWTImageTools.java",
"license": "gpl-2.0",
"size": 71756
} | [
"java.awt.image.BufferedImage",
"java.awt.image.DataBuffer",
"java.awt.image.DataBufferByte"
] | import java.awt.image.BufferedImage; import java.awt.image.DataBuffer; import java.awt.image.DataBufferByte; | import java.awt.image.*; | [
"java.awt"
] | java.awt; | 894,066 |
private void extractFromClassLoader(final String resource) throws IOException {
final byte[] buf = new byte[512];
final InputStream in = DefaultSchemaLdifExtractor.getUniqueResourceAsStream(resource, "LDIF file in schema repository");
try {
final File destination = new File(outp... | void function(final String resource) throws IOException { final byte[] buf = new byte[512]; final InputStream in = DefaultSchemaLdifExtractor.getUniqueResourceAsStream(resource, STR); try { final File destination = new File(outputDirectory, resource); if (destination.exists()) { return; } if (!destination.getParentFile... | /**
* Extracts the LDIF schema resource from class loader.
*
* @param resource
* the LDIF schema resource
* @throws IOException
* if there are IO errors
*/ | Extracts the LDIF schema resource from class loader | extractFromClassLoader | {
"repo_name": "tinglinux/search-guard",
"path": "src/test/java/org/apache/directory/api/ldap/schemaextractor/impl/DefaultSchemaLdifExtractor.java",
"license": "apache-2.0",
"size": 14233
} | [
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"java.io.InputStream",
"org.apache.directory.api.i18n.I18n"
] | import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import java.io.InputStream; import org.apache.directory.api.i18n.I18n; | import java.io.*; import org.apache.directory.api.i18n.*; | [
"java.io",
"org.apache.directory"
] | java.io; org.apache.directory; | 1,268,512 |
public void testLogOnUserWrongUserNameAndPassword()
throws XmlRpcException, MalformedURLException {
Object[] XMLMethodParameters = new Object[] {
"", "" };
executeLogOnUserWithError(XMLMethodParameters, ErrorMessage.USERNAME_OR_PASSWORD_NOT_CORRECT);
}
| void function() throws XmlRpcException, MalformedURLException { Object[] XMLMethodParameters = new Object[] { STR" }; executeLogOnUserWithError(XMLMethodParameters, ErrorMessage.USERNAME_OR_PASSWORD_NOT_CORRECT); } | /**
* Test method with wrong userName and password.
*
* @throws XmlRpcException
* @throws MalformedURLException
*/ | Test method with wrong userName and password | testLogOnUserWrongUserNameAndPassword | {
"repo_name": "adqio/revive-adserver",
"path": "www/api/v1/xmlrpc/tests/unit/src/test/java/org/openx/user/TestAuthUser.java",
"license": "gpl-2.0",
"size": 4794
} | [
"java.net.MalformedURLException",
"org.apache.xmlrpc.XmlRpcException",
"org.openx.utils.ErrorMessage"
] | import java.net.MalformedURLException; import org.apache.xmlrpc.XmlRpcException; import org.openx.utils.ErrorMessage; | import java.net.*; import org.apache.xmlrpc.*; import org.openx.utils.*; | [
"java.net",
"org.apache.xmlrpc",
"org.openx.utils"
] | java.net; org.apache.xmlrpc; org.openx.utils; | 1,159,729 |
private static void checkForMissingFragments(Environment env, TargetAndConfiguration ctgValue,
String attribute, Dependency dep,
Set<Class<? extends BuildConfiguration.Fragment>> expectedDepFragments)
throws DependencyEvaluationException {
Set<String> ctgFragmentNames = new HashSet<>();
for ... | static void function(Environment env, TargetAndConfiguration ctgValue, String attribute, Dependency dep, Set<Class<? extends BuildConfiguration.Fragment>> expectedDepFragments) throws DependencyEvaluationException { Set<String> ctgFragmentNames = new HashSet<>(); for (BuildConfiguration.Fragment fragment : ctgValue.get... | /**
* Diagnostic helper method for dynamic configurations: checks the config fragments required by
* a dep against the fragments in its actual configuration. If any are missing, triggers a
* descriptive "missing fragments" error.
*/ | Diagnostic helper method for dynamic configurations: checks the config fragments required by a dep against the fragments in its actual configuration. If any are missing, triggers a descriptive "missing fragments" error | checkForMissingFragments | {
"repo_name": "mbrukman/bazel",
"path": "src/main/java/com/google/devtools/build/lib/skyframe/ConfiguredTargetFunction.java",
"license": "apache-2.0",
"size": 49953
} | [
"com.google.common.base.Joiner",
"com.google.common.collect.Sets",
"com.google.devtools.build.lib.analysis.Dependency",
"com.google.devtools.build.lib.analysis.TargetAndConfiguration",
"com.google.devtools.build.lib.analysis.config.BuildConfiguration",
"com.google.devtools.build.lib.analysis.config.Invali... | import com.google.common.base.Joiner; import com.google.common.collect.Sets; import com.google.devtools.build.lib.analysis.Dependency; import com.google.devtools.build.lib.analysis.TargetAndConfiguration; import com.google.devtools.build.lib.analysis.config.BuildConfiguration; import com.google.devtools.build.lib.analy... | import com.google.common.base.*; import com.google.common.collect.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.analysis.config.*; import com.google.devtools.build.lib.events.*; import java.util.*; | [
"com.google.common",
"com.google.devtools",
"java.util"
] | com.google.common; com.google.devtools; java.util; | 363,212 |
public static Type getTargetType(MethodParameter methodParam) {
Assert.notNull(methodParam, "MethodParameter must not be null");
if (methodParam.getConstructor() != null) {
return methodParam.getConstructor().getGenericParameterTypes()[methodParam.getParameterIndex()];
}
else {
if (methodParam.getParam... | static Type function(MethodParameter methodParam) { Assert.notNull(methodParam, STR); if (methodParam.getConstructor() != null) { return methodParam.getConstructor().getGenericParameterTypes()[methodParam.getParameterIndex()]; } else { if (methodParam.getParameterIndex() >= 0) { return methodParam.getMethod().getGeneri... | /**
* Determine the target type for the given parameter specification.
* @param methodParam the method parameter specification
* @return the corresponding generic parameter type
*/ | Determine the target type for the given parameter specification | getTargetType | {
"repo_name": "spring-projects/spring-android",
"path": "spring-android-core/src/main/java/org/springframework/core/GenericTypeResolver.java",
"license": "apache-2.0",
"size": 20017
} | [
"java.lang.reflect.Type",
"org.springframework.util.Assert"
] | import java.lang.reflect.Type; import org.springframework.util.Assert; | import java.lang.reflect.*; import org.springframework.util.*; | [
"java.lang",
"org.springframework.util"
] | java.lang; org.springframework.util; | 111,603 |
public static RelationType valueOf(@NonNull String name) {
return DynamicEnum.valueOf(RelationType.class, name);
} | static RelationType function(@NonNull String name) { return DynamicEnum.valueOf(RelationType.class, name); } | /**
* <p>Returns the constant of RelationType with the specified name.The normalized version of the specified name will
* be matched allowing for case and space variations.</p>
*
* @param name the name
* @return The constant of RelationType with the specified name
* @throws IllegalArgumentExcept... | Returns the constant of RelationType with the specified name.The normalized version of the specified name will be matched allowing for case and space variations | valueOf | {
"repo_name": "dbracewell/hermes",
"path": "hermes-core/src/main/java/com/davidbracewell/hermes/RelationType.java",
"license": "apache-2.0",
"size": 3336
} | [
"com.davidbracewell.DynamicEnum"
] | import com.davidbracewell.DynamicEnum; | import com.davidbracewell.*; | [
"com.davidbracewell"
] | com.davidbracewell; | 1,037,941 |
public static Tree UCPtransform(Tree t) {
if (t == null) {
return null;
}
return Tsurgeon.processPattern(ucpRenameTregex, ucpRenameTsurgeon, t);
} | static Tree function(Tree t) { if (t == null) { return null; } return Tsurgeon.processPattern(ucpRenameTregex, ucpRenameTsurgeon, t); } | /**
* Transforms t if it contains an UCP, it will change the UCP tag
* into the phrasal tag of the first word of the UCP
* (UCP (JJ electronic) (, ,) (NN computer) (CC and) (NN building))
* will become
* (ADJP (JJ electronic) (, ,) (NN computer) (CC and) (NN building))
*
* @param t a tree to be tra... | Transforms t if it contains an UCP, it will change the UCP tag into the phrasal tag of the first word of the UCP (UCP (JJ electronic) (, ,) (NN computer) (CC and) (NN building)) will become (ADJP (JJ electronic) (, ,) (NN computer) (CC and) (NN building)) | UCPtransform | {
"repo_name": "intfloat/CoreNLP",
"path": "src/edu/stanford/nlp/trees/CoordinationTransformer.java",
"license": "gpl-2.0",
"size": 30514
} | [
"edu.stanford.nlp.trees.tregex.tsurgeon.Tsurgeon"
] | import edu.stanford.nlp.trees.tregex.tsurgeon.Tsurgeon; | import edu.stanford.nlp.trees.tregex.tsurgeon.*; | [
"edu.stanford.nlp"
] | edu.stanford.nlp; | 1,102,183 |
IpPrefix cidr(); | IpPrefix cidr(); | /**
* Returns the cidr.
*
* @return cidr
*/ | Returns the cidr | cidr | {
"repo_name": "lishuai12/onosfw-L3",
"path": "apps/vtnrsc/src/main/java/org/onosproject/vtnrsc/Subnet.java",
"license": "apache-2.0",
"size": 2962
} | [
"org.onlab.packet.IpPrefix"
] | import org.onlab.packet.IpPrefix; | import org.onlab.packet.*; | [
"org.onlab.packet"
] | org.onlab.packet; | 396,911 |
void insertData(CharacterData node, int index, String insert) {
fInsertNode = node;
node.insertData( index, insert);
fInsertNode = null;
}
| void insertData(CharacterData node, int index, String insert) { fInsertNode = node; node.insertData( index, insert); fInsertNode = null; } | /** This function inserts text into a Node and invokes
* a method to fix-up all other Ranges.
*/ | This function inserts text into a Node and invokes a method to fix-up all other Ranges | insertData | {
"repo_name": "srnsw/xena",
"path": "xena/ext/src/xerces-2_9_1/src/org/apache/xerces/dom/RangeImpl.java",
"license": "gpl-3.0",
"size": 77984
} | [
"org.w3c.dom.CharacterData"
] | import org.w3c.dom.CharacterData; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 1,263,860 |
public NamedNativeQuery<Entity<T>> createNamedNativeQuery()
{
return new NamedNativeQueryImpl<Entity<T>>(this, "named-native-query", childNode);
} | NamedNativeQuery<Entity<T>> function() { return new NamedNativeQueryImpl<Entity<T>>(this, STR, childNode); } | /**
* Creates a new <code>named-native-query</code> element
* @return the new created instance of <code>NamedNativeQuery<Entity<T>></code>
*/ | Creates a new <code>named-native-query</code> element | createNamedNativeQuery | {
"repo_name": "forge/javaee-descriptors",
"path": "impl/src/main/java/org/jboss/shrinkwrap/descriptor/impl/orm20/EntityImpl.java",
"license": "epl-1.0",
"size": 48316
} | [
"org.jboss.shrinkwrap.descriptor.api.orm20.Entity",
"org.jboss.shrinkwrap.descriptor.api.orm20.NamedNativeQuery"
] | import org.jboss.shrinkwrap.descriptor.api.orm20.Entity; import org.jboss.shrinkwrap.descriptor.api.orm20.NamedNativeQuery; | import org.jboss.shrinkwrap.descriptor.api.orm20.*; | [
"org.jboss.shrinkwrap"
] | org.jboss.shrinkwrap; | 2,411,461 |
@VisibleForTesting
boolean isIntact() {
for (int i = 1; i < size; i++) {
if (!heapForIndex(i).verifyIndex(i)) {
return false;
}
}
return true;
}
@WeakOuter
private class Heap {
final Ordering<E> ordering;
@Weak @NullableDecl Heap otherHeap;
Heap(Ordering<E> ord... | boolean isIntact() { for (int i = 1; i < size; i++) { if (!heapForIndex(i).verifyIndex(i)) { return false; } } return true; } private class Heap { final Ordering<E> ordering; @Weak @NullableDecl Heap otherHeap; Heap(Ordering<E> ordering) { this.ordering = ordering; } | /**
* Returns {@code true} if the MinMax heap structure holds. This is only used in testing.
*
* <p>TODO(kevinb): move to the test class?
*/ | Returns true if the MinMax heap structure holds. This is only used in testing. TODO(kevinb): move to the test class | isIntact | {
"repo_name": "typetools/guava",
"path": "android/guava/src/com/google/common/collect/MinMaxPriorityQueue.java",
"license": "apache-2.0",
"size": 33348
} | [
"com.google.j2objc.annotations.Weak",
"org.checkerframework.checker.nullness.compatqual.NullableDecl"
] | import com.google.j2objc.annotations.Weak; import org.checkerframework.checker.nullness.compatqual.NullableDecl; | import com.google.j2objc.annotations.*; import org.checkerframework.checker.nullness.compatqual.*; | [
"com.google.j2objc",
"org.checkerframework.checker"
] | com.google.j2objc; org.checkerframework.checker; | 270,805 |
if (RESOURCE_BUNDLE == null) {
throw new RuntimeException(
"Localized messages from resource bundle '" + BUNDLE_NAME
+ "' not loaded during initialization of driver.");
}
try {
if (key == null) {
throw new IllegalArgumentEx... | if (RESOURCE_BUNDLE == null) { throw new RuntimeException( STR + BUNDLE_NAME + STR); } try { if (key == null) { throw new IllegalArgumentException( STR); } String message = RESOURCE_BUNDLE.getString(key); if (message == null) { message = STR + key + "'"; } return message; } catch (MissingResourceException e) { return '... | /**
* Returns the localized message for the given message key
*
* @param key the message key
* @return The localized message for the key
*/ | Returns the localized message for the given message key | getString | {
"repo_name": "devoof/jPrinterAdmin",
"path": "mysql-connector-java-5.1.23/src/com/mysql/jdbc/Messages.java",
"license": "gpl-2.0",
"size": 3619
} | [
"java.util.MissingResourceException"
] | import java.util.MissingResourceException; | import java.util.*; | [
"java.util"
] | java.util; | 2,886,079 |
private static void shareData(DatabaseEntry from, DatabaseEntry to) {
if (from != null) {
to.setData(from.getData(), from.getOffset(), from.getSize());
}
} | static void function(DatabaseEntry from, DatabaseEntry to) { if (from != null) { to.setData(from.getData(), from.getOffset(), from.getSize()); } } | /**
* Shares the same byte array, offset and size between two entries.
* Used when copying the entry data is not necessary because it is known
* that the underlying operation will not modify the entry, for example,
* with getSearchKey.
*/ | Shares the same byte array, offset and size between two entries. Used when copying the entry data is not necessary because it is known that the underlying operation will not modify the entry, for example, with getSearchKey | shareData | {
"repo_name": "EvilMcJerkface/jessy",
"path": "lib/berkeleydb_core/src/com/sleepycat/util/keyrange/RangeCursor.java",
"license": "mit",
"size": 37406
} | [
"com.sleepycat.db.DatabaseEntry"
] | import com.sleepycat.db.DatabaseEntry; | import com.sleepycat.db.*; | [
"com.sleepycat.db"
] | com.sleepycat.db; | 2,681,341 |
public void sendBye(WsDiscoveryService service) throws WsDiscoveryXMLException, WsDiscoveryNetworkException {
WsDiscoveryS11SOAPMessage<ByeType> bye;
try {
bye = WsDiscoveryS11Utilities.createWsdSOAPMessageBye(service);
} catch (SOAPOverUDPException ex) {
throw new Ws... | void function(WsDiscoveryService service) throws WsDiscoveryXMLException, WsDiscoveryNetworkException { WsDiscoveryS11SOAPMessage<ByeType> bye; try { bye = WsDiscoveryS11Utilities.createWsdSOAPMessageBye(service); } catch (SOAPOverUDPException ex) { throw new WsDiscoveryXMLException(STR, ex); } if (useProxy) { bye.setT... | /**
* Send Bye.
*
* @param service Service that says Bye.
*/ | Send Bye | sendBye | {
"repo_name": "nateridderman/java-ws-discovery",
"path": "wsdiscovery-lib/src/main/java/com/ms/wsdiscovery/standard11/WsDiscoveryS11DispatchThread.java",
"license": "lgpl-3.0",
"size": 36661
} | [
"com.ms.wsdiscovery.exception.WsDiscoveryNetworkException",
"com.ms.wsdiscovery.exception.WsDiscoveryXMLException",
"com.ms.wsdiscovery.jaxb.standard11.wsdiscovery.ByeType",
"com.ms.wsdiscovery.servicedirectory.WsDiscoveryService",
"com.skjegstad.soapoverudp.exceptions.SOAPOverUDPException"
] | import com.ms.wsdiscovery.exception.WsDiscoveryNetworkException; import com.ms.wsdiscovery.exception.WsDiscoveryXMLException; import com.ms.wsdiscovery.jaxb.standard11.wsdiscovery.ByeType; import com.ms.wsdiscovery.servicedirectory.WsDiscoveryService; import com.skjegstad.soapoverudp.exceptions.SOAPOverUDPException; | import com.ms.wsdiscovery.exception.*; import com.ms.wsdiscovery.jaxb.standard11.wsdiscovery.*; import com.ms.wsdiscovery.servicedirectory.*; import com.skjegstad.soapoverudp.exceptions.*; | [
"com.ms.wsdiscovery",
"com.skjegstad.soapoverudp"
] | com.ms.wsdiscovery; com.skjegstad.soapoverudp; | 2,786,856 |
@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (mSearchable == null) {
return false;
}
// if it's an action specified by the searchable activity, launch the
// entered query with the action key
// TODO SearchableInfo.ActionKeyInfo action... | boolean function(int keyCode, KeyEvent event) { if (mSearchable == null) { return false; } return super.onKeyDown(keyCode, event); } | /**
* Handles the key down event for dealing with action keys.
*
* @param keyCode This is the keycode of the typed key, and is the same value as
* found in the KeyEvent parameter.
* @param event The complete event record for the typed key
* @return true if the event was ha... | Handles the key down event for dealing with action keys | onKeyDown | {
"repo_name": "Myanmar-Hub/collabra-devcon",
"path": "Sherlock/src/com/actionbarsherlock/widget/SearchView.java",
"license": "apache-2.0",
"size": 71352
} | [
"android.view.KeyEvent"
] | import android.view.KeyEvent; | import android.view.*; | [
"android.view"
] | android.view; | 2,236,120 |
public void writePIX15(PIX15 value) throws IOException {
writeUB(1, value.reserved);
writeUB(5, value.red);
writeUB(5, value.green);
writeUB(5, value.blue);
} | void function(PIX15 value) throws IOException { writeUB(1, value.reserved); writeUB(5, value.red); writeUB(5, value.green); writeUB(5, value.blue); } | /**
* Writes PIX15 value to the stream
*
* @param value PIX15 value
* @throws IOException
*/ | Writes PIX15 value to the stream | writePIX15 | {
"repo_name": "crimefire/jpexs-decompiler",
"path": "libsrc/ffdec_lib/src/com/jpexs/decompiler/flash/SWFOutputStream.java",
"license": "gpl-3.0",
"size": 64248
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,604,664 |
@SuppressWarnings("unchecked")
public void getPipelinedChildren(Object parent, Set currentElements) {
if (DEBUG) {
System.out.println("getPipelinedChildren for: " + parent);
}
if (parent instanceof IWrappedResource) {
//Note: It seems that this NEVER happens (IWr... | @SuppressWarnings(STR) void function(Object parent, Set currentElements) { if (DEBUG) { System.out.println(STR + parent); } if (parent instanceof IWrappedResource) { Object[] children = getChildren(parent); currentElements.clear(); currentElements.addAll(Arrays.asList(children)); if (DEBUG) { System.out.println(STR + c... | /**
* This method basically replaces all the elements for other resource elements
* or for wrapped elements.
*
* @see org.eclipse.ui.navigator.IPipelinedTreeContentProvider#getPipelinedChildren(java.lang.Object, java.util.Set)
*/ | This method basically replaces all the elements for other resource elements or for wrapped elements | getPipelinedChildren | {
"repo_name": "aptana/Pydev",
"path": "bundles/org.python.pydev/src_navigator/org/python/pydev/navigator/PythonModelProvider.java",
"license": "epl-1.0",
"size": 28888
} | [
"java.util.Arrays",
"java.util.Set",
"org.eclipse.core.resources.IProject",
"org.eclipse.core.resources.IWorkspaceRoot",
"org.eclipse.ui.IWorkingSet",
"org.eclipse.ui.navigator.PipelinedShapeModification",
"org.python.pydev.navigator.elements.IWrappedResource",
"org.python.pydev.navigator.elements.Pyt... | import java.util.Arrays; import java.util.Set; import org.eclipse.core.resources.IProject; import org.eclipse.core.resources.IWorkspaceRoot; import org.eclipse.ui.IWorkingSet; import org.eclipse.ui.navigator.PipelinedShapeModification; import org.python.pydev.navigator.elements.IWrappedResource; import org.python.pydev... | import java.util.*; import org.eclipse.core.resources.*; import org.eclipse.ui.*; import org.eclipse.ui.navigator.*; import org.python.pydev.navigator.elements.*; import org.python.pydev.shared_core.structure.*; | [
"java.util",
"org.eclipse.core",
"org.eclipse.ui",
"org.python.pydev"
] | java.util; org.eclipse.core; org.eclipse.ui; org.python.pydev; | 1,853,064 |
protected Dimension getPreferredSizeForPage()
{
return new Dimension((int) Math.round(pageFormat.getWidth() * pageScale
* horizontalPageCount), (int) Math.round(pageFormat.getHeight()
* pageScale * verticalPageCount));
} | Dimension function() { return new Dimension((int) Math.round(pageFormat.getWidth() * pageScale * horizontalPageCount), (int) Math.round(pageFormat.getHeight() * pageScale * verticalPageCount)); } | /**
* Returns the (unscaled) preferred size for the current page format (scaled
* by pageScale).
*/ | Returns the (unscaled) preferred size for the current page format (scaled by pageScale) | getPreferredSizeForPage | {
"repo_name": "dpisarewski/gka_wise12",
"path": "src/com/mxgraph/swing/mxGraphComponent.java",
"license": "lgpl-2.1",
"size": 102389
} | [
"java.awt.Dimension"
] | import java.awt.Dimension; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,816,601 |
boolean awaitUninterruptibly(long timeout, TimeUnit unit); | boolean awaitUninterruptibly(long timeout, TimeUnit unit); | /**
* Waits for this future to be completed within the
* specified time limit without interruption. This method catches an
* {@link InterruptedException} and discards it silently.
*
* @return {@code true} if and only if the future was completed within
* the specified time limit
... | Waits for this future to be completed within the specified time limit without interruption. This method catches an <code>InterruptedException</code> and discards it silently | awaitUninterruptibly | {
"repo_name": "wangcy6/storm_app",
"path": "frame/java/netty-4.1/common/src/main/java/io/netty/util/concurrent/Future.java",
"license": "apache-2.0",
"size": 5970
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 697,567 |
public Map<String, String> getMetadata() {
return Collections.emptyMap();
} | Map<String, String> function() { return Collections.emptyMap(); } | /**
* Returns any metadata collected through metadata expressions while this
* context was reading the JSON events from the JSON document.
*
* @return A map of any metadata collected through metadata expressions
* while this context was reading the JSON document. Returns an
* ... | Returns any metadata collected through metadata expressions while this context was reading the JSON events from the JSON document | getMetadata | {
"repo_name": "flofreud/aws-sdk-java",
"path": "aws-java-sdk-core/src/main/java/com/amazonaws/transform/JsonUnmarshallerContext.java",
"license": "apache-2.0",
"size": 6806
} | [
"java.util.Collections",
"java.util.Map"
] | import java.util.Collections; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,413,121 |
protected boolean includeAuthorityInRequestLine() {
return connection == null
? policy.usingProxy() // A proxy was requested.
: connection.getRoute().getProxy().type() == Proxy.Type.HTTP; // A proxy was selected.
}
| boolean function() { return connection == null ? policy.usingProxy() : connection.getRoute().getProxy().type() == Proxy.Type.HTTP; } | /**
* Returns true if the request line should contain the full URL with host
* and port (like "GET http://android.com/foo HTTP/1.1") or only the path
* (like "GET /foo HTTP/1.1").
*
* <p>This is non-final because for HTTPS it's never necessary to supply the
* full URL, even if a proxy is in use.... | Returns true if the request line should contain the full URL with host and port (like "GET HREF HTTP/1.1") or only the path (like "GET /foo HTTP/1.1"). This is non-final because for HTTPS it's never necessary to supply the full URL, even if a proxy is in use | includeAuthorityInRequestLine | {
"repo_name": "Ramanujakalyan/Inherit",
"path": "ui/plugins/com.phonegap.plugins.facebookconnect/platforms/android/CordovaLib/src/com/squareup/okhttp/internal/http/HttpEngine.java",
"license": "unlicense",
"size": 23446
} | [
"java.net.Proxy"
] | import java.net.Proxy; | import java.net.*; | [
"java.net"
] | java.net; | 2,413,287 |
public void roomStop(IScope room) {
log.debug("roomStop: {}", room);
for (IApplication listener : listeners) {
listener.roomStop(room);
}
} | void function(IScope room) { log.debug(STR, room); for (IApplication listener : listeners) { listener.roomStop(room); } } | /**
* Handler method. Called when room scope is stopped.
*
* @param room
* Room scope.
*/ | Handler method. Called when room scope is stopped | roomStop | {
"repo_name": "cwpenhale/red5-mobileconsole",
"path": "red5_server/src/main/java/org/red5/server/adapter/MultiThreadedApplicationAdapter.java",
"license": "apache-2.0",
"size": 45074
} | [
"org.red5.server.api.scope.IScope"
] | import org.red5.server.api.scope.IScope; | import org.red5.server.api.scope.*; | [
"org.red5.server"
] | org.red5.server; | 2,304,693 |
public void set_iDate(){
LocalDateTime time = LocalDateTime.now();
iDate[0] = time.getYear();
iDate[1] = time.getMonthValue();
iDate[2] = time.getDayOfMonth();
iDate[3] = System.currentTimeMillis() / 1000;
} | void function(){ LocalDateTime time = LocalDateTime.now(); iDate[0] = time.getYear(); iDate[1] = time.getMonthValue(); iDate[2] = time.getDayOfMonth(); iDate[3] = System.currentTimeMillis() / 1000; } | /**
* uniform vec4 iDate; // image/buffer/sound, Year, month, day, time in seconds in .xyzw
*/ | uniform vec4 iDate; // image/buffer/sound, Year, month, day, time in seconds in .xyzw | set_iDate | {
"repo_name": "diwi/PixelFlow",
"path": "src/com/thomasdiewald/pixelflow/java/imageprocessing/DwShadertoy.java",
"license": "mit",
"size": 14126
} | [
"java.time.LocalDateTime"
] | import java.time.LocalDateTime; | import java.time.*; | [
"java.time"
] | java.time; | 1,681,717 |
public void close() throws ADKException {
_checkOpen();
ByteArrayOutputStream buffer = new ByteArrayOutputStream();
String bodyHeader = "</" + getOperation() + "Response> ";
try {
buffer.write(bodyHeader.getBytes());
// JEN fOut.writeBuffer(buffer);
fOut.close();
}
catch (IOException ioe) {
... | void function() throws ADKException { _checkOpen(); ByteArrayOutputStream buffer = new ByteArrayOutputStream(); String bodyHeader = "</" + getOperation() + STR; try { buffer.write(bodyHeader.getBytes()); fOut.close(); } catch (IOException ioe) { throw new ADKException(STR + ioe, fZone); } fOut.commit(); } | /**
* Close the stream and send one or more SIF_Response packets to the zone.
*/ | Close the stream and send one or more SIF_Response packets to the zone | close | {
"repo_name": "open-adk/OpenADK-java",
"path": "adk-library/src/main/java/openadk/library/services/SIFServiceOutputSender.java",
"license": "apache-2.0",
"size": 10557
} | [
"java.io.ByteArrayOutputStream",
"java.io.IOException"
] | import java.io.ByteArrayOutputStream; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 709,671 |
@SuppressWarnings("deprecation")
@UnstableApi
interface ExtendedHandle extends Handle {
boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier);
}
class DelegatingHandle implements Handle {
private final Handle delegate;
public DelegatingHandle(Han... | @SuppressWarnings(STR) interface ExtendedHandle extends Handle { boolean continueReading(UncheckedBooleanSupplier maybeMoreDataSupplier); } class DelegatingHandle implements Handle { private final Handle delegate; public DelegatingHandle(Handle delegate) { this.delegate = requireNonNull(delegate, STR); } | /**
* Same as {@link Handle#continueReading()} except "more data" is determined by the supplier parameter.
* @param maybeMoreDataSupplier A supplier that determines if there maybe more data to read.
*/ | Same as <code>Handle#continueReading()</code> except "more data" is determined by the supplier parameter | continueReading | {
"repo_name": "gerdriesselmann/netty",
"path": "transport/src/main/java/io/netty/channel/RecvByteBufAllocator.java",
"license": "apache-2.0",
"size": 6345
} | [
"io.netty.util.UncheckedBooleanSupplier",
"java.util.Objects"
] | import io.netty.util.UncheckedBooleanSupplier; import java.util.Objects; | import io.netty.util.*; import java.util.*; | [
"io.netty.util",
"java.util"
] | io.netty.util; java.util; | 1,795,000 |
@Override
@Deprecated
@Dependencies("getLocalesAndCharsets")
@XmlElement(name = "locale", namespace = LegacyNamespaces.GMD)
@XmlJavaTypeAdapter(LocaleAdapter.Wrapped.class)
public Collection<Locale> getLocales() {
if (FilterByVersion.LEGACY_METADATA.accept()) {
final Set<PT_L... | @Dependencies(STR) @XmlElement(name = STR, namespace = LegacyNamespaces.GMD) @XmlJavaTypeAdapter(LocaleAdapter.Wrapped.class) Collection<Locale> function() { if (FilterByVersion.LEGACY_METADATA.accept()) { final Set<PT_Locale> locales = OtherLocales.filter(getLocalesAndCharsets()); return Containers.derivedSet(locales,... | /**
* Provides information about an alternatively used localized character string for a linguistic extension.
*
* @return alternatively used localized character string for a linguistic extension.
*
* @deprecated Replaced by <code>{@linkplain #getLocalesAndCharsets()}.keySet()</code>.
*/ | Provides information about an alternatively used localized character string for a linguistic extension | getLocales | {
"repo_name": "apache/sis",
"path": "core/sis-metadata/src/main/java/org/apache/sis/metadata/iso/DefaultMetadata.java",
"license": "apache-2.0",
"size": 75665
} | [
"java.util.Collection",
"java.util.Locale",
"java.util.Set",
"javax.xml.bind.annotation.XmlElement",
"javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter",
"org.apache.sis.internal.jaxb.FilterByVersion",
"org.apache.sis.internal.jaxb.lan.LocaleAdapter",
"org.apache.sis.internal.jaxb.lan.OtherLocales... | import java.util.Collection; import java.util.Locale; import java.util.Set; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter; import org.apache.sis.internal.jaxb.FilterByVersion; import org.apache.sis.internal.jaxb.lan.LocaleAdapter; import org.apache.sis.interna... | import java.util.*; import javax.xml.bind.annotation.*; import javax.xml.bind.annotation.adapters.*; import org.apache.sis.internal.jaxb.*; import org.apache.sis.internal.jaxb.lan.*; import org.apache.sis.internal.metadata.*; import org.apache.sis.internal.xml.*; import org.apache.sis.util.collection.*; | [
"java.util",
"javax.xml",
"org.apache.sis"
] | java.util; javax.xml; org.apache.sis; | 2,709,033 |
public static Builder builder() {
return new Builder();
}
public static class Builder {
private File path;
private List<String> segments = new ArrayList<>();
private Builder() {
// Prevent external instantiation.
} | static Builder function() { return new Builder(); } public static class Builder { private File path; private List<String> segments = new ArrayList<>(); private Builder() { } | /**
* Create a builder for the {@link DebugSegments} command.
*
* @return an instance of {@link Builder}.
*/ | Create a builder for the <code>DebugSegments</code> command | builder | {
"repo_name": "meggermo/jackrabbit-oak",
"path": "oak-segment-tar/src/main/java/org/apache/jackrabbit/oak/segment/tool/DebugSegments.java",
"license": "apache-2.0",
"size": 7126
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.List"
] | import java.io.File; import java.util.ArrayList; import java.util.List; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,790,369 |
List<User> getPresentUsers(String locationId); | List<User> getPresentUsers(String locationId); | /**
* Access a List of users (User) now present in a location.
*
* @param locationId
* A presence location id.
* @return The a List of users (User) now present in the location (may be empty).
*/ | Access a List of users (User) now present in a location | getPresentUsers | {
"repo_name": "ouit0408/sakai",
"path": "presence/presence-api/api/src/java/org/sakaiproject/presence/api/PresenceService.java",
"license": "apache-2.0",
"size": 4708
} | [
"java.util.List",
"org.sakaiproject.user.api.User"
] | import java.util.List; import org.sakaiproject.user.api.User; | import java.util.*; import org.sakaiproject.user.api.*; | [
"java.util",
"org.sakaiproject.user"
] | java.util; org.sakaiproject.user; | 1,127,767 |
@SuppressWarnings("unchecked")
protected V buildView() throws CoreException {
return (V) ClassUtility.findAndBuildGenericType(this.getClass(), View.class, NullView.class, this);
} | @SuppressWarnings(STR) V function() throws CoreException { return (V) ClassUtility.findAndBuildGenericType(this.getClass(), View.class, NullView.class, this); } | /**
* Create the view it was null.
*
* @throws CoreException when han't been built correctly
*/ | Create the view it was null | buildView | {
"repo_name": "JRebirth/JRebirth",
"path": "org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/AbstractModel.java",
"license": "apache-2.0",
"size": 6293
} | [
"org.jrebirth.af.api.exception.CoreException",
"org.jrebirth.af.api.ui.NullView",
"org.jrebirth.af.api.ui.View",
"org.jrebirth.af.core.util.ClassUtility"
] | import org.jrebirth.af.api.exception.CoreException; import org.jrebirth.af.api.ui.NullView; import org.jrebirth.af.api.ui.View; import org.jrebirth.af.core.util.ClassUtility; | import org.jrebirth.af.api.exception.*; import org.jrebirth.af.api.ui.*; import org.jrebirth.af.core.util.*; | [
"org.jrebirth.af"
] | org.jrebirth.af; | 177,915 |
protected PropertyChangeSupport getPropertyChangeSupport()
{
return getEventSupport();
} | PropertyChangeSupport function() { return getEventSupport(); } | /**
* Get the property change support object for this class. Because the
* property change support object has to be transient, it may need to be
* created.
*
* @return the property change support object.
*/ | Get the property change support object for this class. Because the property change support object has to be transient, it may need to be created | getPropertyChangeSupport | {
"repo_name": "MHTaleb/Encologim",
"path": "lib/JasperReport/src/net/sf/jasperreports/engine/design/JRDesignQuery.java",
"license": "gpl-3.0",
"size": 7867
} | [
"java.beans.PropertyChangeSupport"
] | import java.beans.PropertyChangeSupport; | import java.beans.*; | [
"java.beans"
] | java.beans; | 900,499 |
public int read( byte[] b ) throws IOException {
return read( b, 0, b.length );
} | int function( byte[] b ) throws IOException { return read( b, 0, b.length ); } | /**
* Reads up to b.length bytes of data from this input stream into an array of bytes.
*
* @throws IOException if a network error occurs
*/ | Reads up to b.length bytes of data from this input stream into an array of bytes | read | {
"repo_name": "javonhe/jcifs",
"path": "src/jcifs/smb/SmbFileInputStream.java",
"license": "lgpl-2.1",
"size": 8439
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,529,600 |
public static Data create(final String path, final char delimiter) throws IOException {
return new IterableData(new CSVDataInput(path, delimiter).iterator());
} | static Data function(final String path, final char delimiter) throws IOException { return new IterableData(new CSVDataInput(path, delimiter).iterator()); } | /**
* Creates a new data object from a CSV file.
*
* @param path A path to the file
* @param delimiter The utilized separator character
* @return A Data object
* @throws IOException Signals that an I/O exception has occurred.
*/ | Creates a new data object from a CSV file | create | {
"repo_name": "TheRealRasu/arx",
"path": "src/main/org/deidentifier/arx/Data.java",
"license": "apache-2.0",
"size": 16198
} | [
"java.io.IOException",
"org.deidentifier.arx.io.CSVDataInput"
] | import java.io.IOException; import org.deidentifier.arx.io.CSVDataInput; | import java.io.*; import org.deidentifier.arx.io.*; | [
"java.io",
"org.deidentifier.arx"
] | java.io; org.deidentifier.arx; | 531,469 |
Optional<Collision> collideWith(Collidable target); | Optional<Collision> collideWith(Collidable target); | /**
* Berechnet die Kollision zwischen dem {@link org.amcgala.shape.Shape} und einem anderen Objekt.
*
* @param target das andere Objekt
* @return die Menge aller Kollisionen zwischen den beiden Objekten
*/ | Berechnet die Kollision zwischen dem <code>org.amcgala.shape.Shape</code> und einem anderen Objekt | collideWith | {
"repo_name": "th-koeln/amcgala",
"path": "src/main/java/org/amcgala/shape/util/collision/Collidable.java",
"license": "apache-2.0",
"size": 762
} | [
"com.google.common.base.Optional"
] | import com.google.common.base.Optional; | import com.google.common.base.*; | [
"com.google.common"
] | com.google.common; | 235,019 |
public void setMoreUrl(String rssMoreUrl) {
this.rssMoreUrl = Val.chkStr(rssMoreUrl);
}
| void function(String rssMoreUrl) { this.rssMoreUrl = Val.chkStr(rssMoreUrl); } | /**
* Sets URL to more results.
* @param rssMoreUrl URL to more results
*/ | Sets URL to more results | setMoreUrl | {
"repo_name": "usgin/usgin-geoportal",
"path": "src/com/esri/gpt/catalog/discovery/rest/RestQuery.java",
"license": "apache-2.0",
"size": 5257
} | [
"com.esri.gpt.framework.util.Val"
] | import com.esri.gpt.framework.util.Val; | import com.esri.gpt.framework.util.*; | [
"com.esri.gpt"
] | com.esri.gpt; | 2,561,987 |
public boolean showsScrollHandle() {
return getScrollSize() - getOffsetSize() > WidgetUtil.PIXEL_EPSILON;
} | boolean function() { return getScrollSize() - getOffsetSize() > WidgetUtil.PIXEL_EPSILON; } | /**
* Checks whether the scrollbar's handle is visible.
* <p>
* In other words, this method checks whether the contents is larger than
* can visually fit in the element.
*
* @return <code>true</code> iff the scrollbar's handle is visible
*/ | Checks whether the scrollbar's handle is visible. In other words, this method checks whether the contents is larger than can visually fit in the element | showsScrollHandle | {
"repo_name": "peterl1084/framework",
"path": "compatibility-client/src/main/java/com/vaadin/v7/client/widget/escalator/ScrollbarBundle.java",
"license": "apache-2.0",
"size": 32653
} | [
"com.vaadin.client.WidgetUtil"
] | import com.vaadin.client.WidgetUtil; | import com.vaadin.client.*; | [
"com.vaadin.client"
] | com.vaadin.client; | 2,300,687 |
@Test
public void testRenderingEngineSetters() throws Exception {
File file = File.createTempFile("testRenderingEngineSetters", "."
+ OME_FORMAT);
XMLMockObjects xml = new XMLMockObjects();
XMLWriter writer = new XMLWriter();
writer.writeFile(file, xml.createImage... | void function() throws Exception { File file = File.createTempFile(STR, "." + OME_FORMAT); XMLMockObjects xml = new XMLMockObjects(); XMLWriter writer = new XMLWriter(); writer.writeFile(file, xml.createImage(), true); List<Pixels> pixels = null; try { pixels = importFile(file, OME_FORMAT); } catch (Throwable e) { thro... | /**
* Tests to modify the rendering settings using the rendering engine.
*
* @throws Exception
* Thrown if an error occurred.
*/ | Tests to modify the rendering settings using the rendering engine | testRenderingEngineSetters | {
"repo_name": "jballanc/openmicroscopy",
"path": "components/tools/OmeroJava/test/integration/RenderingEngineTest.java",
"license": "gpl-2.0",
"size": 63338
} | [
"java.io.File",
"java.util.Arrays",
"java.util.Iterator",
"java.util.List",
"org.testng.AssertJUnit"
] | import java.io.File; import java.util.Arrays; import java.util.Iterator; import java.util.List; import org.testng.AssertJUnit; | import java.io.*; import java.util.*; import org.testng.*; | [
"java.io",
"java.util",
"org.testng"
] | java.io; java.util; org.testng; | 2,535,493 |
private void sendResultToServer(int status) {
Score score = new Score();
score.setOutcome(STATUS_STRINGS[status]);
new SendResultToServerTask().execute(score);
} | void function(int status) { Score score = new Score(); score.setOutcome(STATUS_STRINGS[status]); new SendResultToServerTask().execute(score); } | /**
* Stores the game outcome on the server, spawning an AsyncTask to make the
* request.
*
* @param status outcome of the game
*/ | Stores the game outcome on the server, spawning an AsyncTask to make the request | sendResultToServer | {
"repo_name": "GDGSerraGauchaOficial/appengine-endpoints-tictactoe-android",
"path": "src/com/google/devrel/samples/ttt/TictactoeActivity.java",
"license": "apache-2.0",
"size": 13431
} | [
"com.google.api.services.tictactoe.model.Score"
] | import com.google.api.services.tictactoe.model.Score; | import com.google.api.services.tictactoe.model.*; | [
"com.google.api"
] | com.google.api; | 1,533,166 |
@Test
public void testCalculateMedian1() {
List<Number> values = new ArrayList<Number>();
values.add(1.0);
double median = Statistics.calculateMedian(values);
assertEquals(1.0, median, 0.0000001);
}
| void function() { List<Number> values = new ArrayList<Number>(); values.add(1.0); double median = Statistics.calculateMedian(values); assertEquals(1.0, median, 0.0000001); } | /**
* A test for the calculateMedian() method.
*/ | A test for the calculateMedian() method | testCalculateMedian1 | {
"repo_name": "greearb/jfreechart-fse-ct",
"path": "src/test/java/org/jfree/data/statistics/StatisticsTest.java",
"license": "lgpl-2.1",
"size": 15191
} | [
"java.util.ArrayList",
"java.util.List",
"org.junit.Assert"
] | import java.util.ArrayList; import java.util.List; import org.junit.Assert; | import java.util.*; import org.junit.*; | [
"java.util",
"org.junit"
] | java.util; org.junit; | 2,238,429 |
public static Locale getLocale() {
LocaleContext localeContext = (LocaleContext) localeContextHolder.get();
return (localeContext != null ? localeContext.getLocale() : Locale.getDefault());
} | static Locale function() { LocaleContext localeContext = (LocaleContext) localeContextHolder.get(); return (localeContext != null ? localeContext.getLocale() : Locale.getDefault()); } | /**
* Return the Locale associated with the current thread, if any,
* or the system default Locale else.
* @return the current Locale, or the system default Locale if no
* specific Locale has been associated with the current thread
* @see LocaleContext#getLocale()
* @see java.util.Locale#getDefault()
*/ | Return the Locale associated with the current thread, if any, or the system default Locale else | getLocale | {
"repo_name": "raedle/univis",
"path": "lib/springframework-1.2.8/src/org/springframework/context/i18n/LocaleContextHolder.java",
"license": "lgpl-2.1",
"size": 3028
} | [
"java.util.Locale"
] | import java.util.Locale; | import java.util.*; | [
"java.util"
] | java.util; | 530,314 |
void partitionLost(MapPartitionLostEvent event); | void partitionLost(MapPartitionLostEvent event); | /**
* Invoked when owner and all backups of a partition is lost for a specific map.
*
* @param event the event object that contains map name and lost partition ID
*/ | Invoked when owner and all backups of a partition is lost for a specific map | partitionLost | {
"repo_name": "tkountis/hazelcast",
"path": "hazelcast/src/main/java/com/hazelcast/map/listener/MapPartitionLostListener.java",
"license": "apache-2.0",
"size": 1159
} | [
"com.hazelcast.map.MapPartitionLostEvent"
] | import com.hazelcast.map.MapPartitionLostEvent; | import com.hazelcast.map.*; | [
"com.hazelcast.map"
] | com.hazelcast.map; | 2,709,410 |
private void loadDependentInfo()
{
if (m_vo.TableName.equals("C_Order"))
{
int C_DocTyp_ID = 0;
Integer target = (Integer)getValue("C_DocTypeTarget_ID");
if (target != null)
C_DocTyp_ID = target.intValue();
if (C_DocTyp_ID == 0)
return;
String sql = "SELECT DocSubTypeSO FRO... | void function() { if (m_vo.TableName.equals(STR)) { int C_DocTyp_ID = 0; Integer target = (Integer)getValue(STR); if (target != null) C_DocTyp_ID = target.intValue(); if (C_DocTyp_ID == 0) return; String sql = STR; PreparedStatement pstmt = null; ResultSet rs = null; try { pstmt = DB.prepareStatement(sql, null); pstmt.... | /**
* Load Dependent Information
*/ | Load Dependent Information | loadDependentInfo | {
"repo_name": "erpcya/adempierePOS",
"path": "base/src/org/compiere/model/GridTab.java",
"license": "gpl-2.0",
"size": 88652
} | [
"java.sql.PreparedStatement",
"java.sql.ResultSet",
"java.sql.SQLException",
"java.util.logging.Level",
"org.compiere.util.DB",
"org.compiere.util.Env"
] | import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.util.logging.Level; import org.compiere.util.DB; import org.compiere.util.Env; | import java.sql.*; import java.util.logging.*; import org.compiere.util.*; | [
"java.sql",
"java.util",
"org.compiere.util"
] | java.sql; java.util; org.compiere.util; | 837,273 |
@FIXVersion(introduced="4.1", retired="4.3")
@TagNumRef(tagNum=TagNum.CashOrderQty)
public void setCashOrderQty(Double cashOrderQty) {
getSafeOrderQtyData().setCashOrderQty(cashOrderQty);
} | @FIXVersion(introduced="4.1", retired="4.3") @TagNumRef(tagNum=TagNum.CashOrderQty) void function(Double cashOrderQty) { getSafeOrderQtyData().setCashOrderQty(cashOrderQty); } | /**
* Message field setter.
* @param cashOrderQty field value
*/ | Message field setter | setCashOrderQty | {
"repo_name": "marvisan/HadesFIX",
"path": "Model/src/main/java/net/hades/fix/message/OrderModificationRequestMsg.java",
"license": "gpl-3.0",
"size": 149491
} | [
"net.hades.fix.message.anno.FIXVersion",
"net.hades.fix.message.anno.TagNumRef",
"net.hades.fix.message.type.TagNum"
] | import net.hades.fix.message.anno.FIXVersion; import net.hades.fix.message.anno.TagNumRef; import net.hades.fix.message.type.TagNum; | import net.hades.fix.message.anno.*; import net.hades.fix.message.type.*; | [
"net.hades.fix"
] | net.hades.fix; | 1,390,200 |
private void selectPreset(int preset, boolean showToast) {
if (mCurrentPreset == preset) {
return;
}
if (mCurrentPreset >= 0) {
// mPresetButtons[mCurrentPreset].setBackgroundResource(R.color.preset_button_background);
}
mCurrentPreset = preset;
//mPresetButtons[mCurrentPreset].setB... | void function(int preset, boolean showToast) { if (mCurrentPreset == preset) { return; } if (mCurrentPreset >= 0) { } mCurrentPreset = preset; boolean isPlaying = mShimmerViewContainer.isAnimationStarted(); mShimmerViewContainer.useDefaults(); if (mPresetToast != null) { mPresetToast.cancel(); } switch (preset) { defau... | /**
* Select one of the shimmer animation presets.
*
* @param preset index of the shimmer animation preset
* @param showToast whether to show a toast describing the preset, or not
*/ | Select one of the shimmer animation presets | selectPreset | {
"repo_name": "cymcsg/UltimateAndroid",
"path": "deprecated/UltimateAndroidGradle/demoofui/src/main/java/com/marshalchen/common/demoofui/sampleModules/ShimmerFacebookActivity.java",
"license": "apache-2.0",
"size": 4870
} | [
"android.animation.ObjectAnimator",
"android.widget.Toast",
"com.marshalchen.common.ui.ShimmerFrameLayout"
] | import android.animation.ObjectAnimator; import android.widget.Toast; import com.marshalchen.common.ui.ShimmerFrameLayout; | import android.animation.*; import android.widget.*; import com.marshalchen.common.ui.*; | [
"android.animation",
"android.widget",
"com.marshalchen.common"
] | android.animation; android.widget; com.marshalchen.common; | 1,911,993 |
public EscherAggregate getDrawingEscherAggregate() {
_book.findDrawingGroup();
// If there's now no drawing manager, then there's
// no drawing escher records on the workbook
if(_book.getDrawingManager() == null) {
return null;
}
int found = _sheet.aggr... | EscherAggregate function() { _book.findDrawingGroup(); if(_book.getDrawingManager() == null) { return null; } int found = _sheet.aggregateDrawingRecords( _book.getDrawingManager(), false ); if(found == -1) { return null; } EscherAggregate agg = (EscherAggregate) _sheet.findFirstRecordBySid(EscherAggregate.sid); return ... | /**
* Returns the agregate escher records for this sheet,
* it there is one.
* WARNING - calling this will trigger a parsing of the
* associated escher records. Any that aren't supported
* (such as charts and complex drawing types) will almost
* certainly be lost or corrupted when writ... | Returns the agregate escher records for this sheet, it there is one. WARNING - calling this will trigger a parsing of the associated escher records. Any that aren't supported (such as charts and complex drawing types) will almost certainly be lost or corrupted when written out | getDrawingEscherAggregate | {
"repo_name": "tobyclemson/msci-project",
"path": "vendor/poi-3.6/src/java/org/apache/poi/hssf/usermodel/HSSFSheet.java",
"license": "mit",
"size": 66591
} | [
"org.apache.poi.hssf.record.EscherAggregate"
] | import org.apache.poi.hssf.record.EscherAggregate; | import org.apache.poi.hssf.record.*; | [
"org.apache.poi"
] | org.apache.poi; | 614,925 |
@Test
public void parseString()
{
// Setup.
final String bitSetString = "2\n4\n6\n8\n10\n";
final BitSetFormat formatter = new BitSetFormat();
// Run.
final BitSet result = formatter.parse(bitSetString);
// Verify.
verifyBitSet(result);
} | void function() { final String bitSetString = STR; final BitSetFormat formatter = new BitSetFormat(); final BitSet result = formatter.parse(bitSetString); verifyBitSet(result); } | /**
* Test the <code>parse()</code> method.
*/ | Test the <code>parse()</code> method | parseString | {
"repo_name": "jmthompson2015/vizzini",
"path": "game/illyriad/src/test/java/org/vizzini/illyriad/map/BitSetFormatTest.java",
"license": "mit",
"size": 3357
} | [
"java.util.BitSet"
] | import java.util.BitSet; | import java.util.*; | [
"java.util"
] | java.util; | 538,949 |
public static MozuClient<com.mozu.api.contracts.productadmin.ProductProperty> updatePropertyClient(com.mozu.api.DataViewMode dataViewMode, com.mozu.api.contracts.productadmin.ProductProperty productProperty, String productCode, String attributeFQN, String responseFields) throws Exception
{
MozuUrl url = com.mozu.... | static MozuClient<com.mozu.api.contracts.productadmin.ProductProperty> function(com.mozu.api.DataViewMode dataViewMode, com.mozu.api.contracts.productadmin.ProductProperty productProperty, String productCode, String attributeFQN, String responseFields) throws Exception { MozuUrl url = com.mozu.api.urls.commerce.catalog... | /**
* Update one or more details of a property attribute configuration for the product specified in the request.
* <p><pre><code>
* MozuClient<com.mozu.api.contracts.productadmin.ProductProperty> mozuClient=UpdatePropertyClient(dataViewMode, productProperty, productCode, attributeFQN, responseFields);
* cli... | Update one or more details of a property attribute configuration for the product specified in the request. <code><code> MozuClient mozuClient=UpdatePropertyClient(dataViewMode, productProperty, productCode, attributeFQN, responseFields); client.setBaseAddress(url); client.executeRequest(); ProductProperty productProper... | updatePropertyClient | {
"repo_name": "bhewett/mozu-java",
"path": "mozu-javaasync-core/src/main/java/com/mozu/api/clients/commerce/catalog/admin/products/ProductPropertyClient.java",
"license": "mit",
"size": 29988
} | [
"com.mozu.api.DataViewMode",
"com.mozu.api.Headers",
"com.mozu.api.MozuClient",
"com.mozu.api.MozuClientFactory",
"com.mozu.api.MozuUrl"
] | import com.mozu.api.DataViewMode; import com.mozu.api.Headers; import com.mozu.api.MozuClient; import com.mozu.api.MozuClientFactory; import com.mozu.api.MozuUrl; | import com.mozu.api.*; | [
"com.mozu.api"
] | com.mozu.api; | 2,524,967 |
public QueryBuilder getNestedFilter() {
return this.nestedFilter;
} | QueryBuilder function() { return this.nestedFilter; } | /**
* Returns the nested filter that the nested objects should match with in order to be taken into account
* for sorting.
**/ | Returns the nested filter that the nested objects should match with in order to be taken into account for sorting | getNestedFilter | {
"repo_name": "strahanjen/strahanjen.github.io",
"path": "elasticsearch-master/core/src/main/java/org/elasticsearch/search/sort/GeoDistanceSortBuilder.java",
"license": "bsd-3-clause",
"size": 25937
} | [
"org.elasticsearch.index.query.QueryBuilder"
] | import org.elasticsearch.index.query.QueryBuilder; | import org.elasticsearch.index.query.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 2,805,069 |
private MouseListener createClickEnvironmentMouseListener() {
return new MouseAdapter() { | MouseListener function() { return new MouseAdapter() { | /**
* Create the mouse listener for clicks in the environment component
* @return the listener
*/ | Create the mouse listener for clicks in the environment component | createClickEnvironmentMouseListener | {
"repo_name": "XavierCollBagur/ZombieInvasion--Prepare-yourself-",
"path": "ZombieInvasion/src/GUI/Sections/SimulationSection.java",
"license": "gpl-3.0",
"size": 24007
} | [
"java.awt.event.MouseAdapter",
"java.awt.event.MouseListener"
] | import java.awt.event.MouseAdapter; import java.awt.event.MouseListener; | import java.awt.event.*; | [
"java.awt"
] | java.awt; | 1,949,460 |
public void save() {
logger.debug("Saving devices to {}", file.toPath());
try {
// ensure full path exists
file.getParentFile().mkdirs();
final List<NeeoDevice> devices = new ArrayList<>();
// filter for only things that are still valid
f... | void function() { logger.debug(STR, file.toPath()); try { file.getParentFile().mkdirs(); final List<NeeoDevice> devices = new ArrayList<>(); final ThingRegistry thingRegistry = context.getThingRegistry(); for (NeeoDevice device : uidToDevice.values()) { if (StringUtils.equalsIgnoreCase(NeeoConstants.NEEOIO_BINDING_ID, ... | /**
* Saves the current definitions to the {@link #file}. Any {@link IOException} will be logged and ignored.
*/ | Saves the current definitions to the <code>#file</code>. Any <code>IOException</code> will be logged and ignored | save | {
"repo_name": "tavalin/openhab2-addons",
"path": "addons/io/org.openhab.io.neeo/src/main/java/org/openhab/io/neeo/internal/NeeoDeviceDefinitions.java",
"license": "epl-1.0",
"size": 12739
} | [
"java.io.IOException",
"java.nio.charset.StandardCharsets",
"java.nio.file.Files",
"java.util.ArrayList",
"java.util.List",
"org.apache.commons.lang.StringUtils",
"org.eclipse.smarthome.core.thing.ThingRegistry",
"org.openhab.io.neeo.internal.models.NeeoDevice"
] | import java.io.IOException; import java.nio.charset.StandardCharsets; import java.nio.file.Files; import java.util.ArrayList; import java.util.List; import org.apache.commons.lang.StringUtils; import org.eclipse.smarthome.core.thing.ThingRegistry; import org.openhab.io.neeo.internal.models.NeeoDevice; | import java.io.*; import java.nio.charset.*; import java.nio.file.*; import java.util.*; import org.apache.commons.lang.*; import org.eclipse.smarthome.core.thing.*; import org.openhab.io.neeo.internal.models.*; | [
"java.io",
"java.nio",
"java.util",
"org.apache.commons",
"org.eclipse.smarthome",
"org.openhab.io"
] | java.io; java.nio; java.util; org.apache.commons; org.eclipse.smarthome; org.openhab.io; | 2,009,701 |
public Cancellable putSettingsAsync(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options,
ActionListener<ClusterUpdateSettingsResponse> listener) {
return restHighLevelClient.performRequestAsyncAndParseEntity(clusterUpdateSettingsRequest,
... | Cancellable function(ClusterUpdateSettingsRequest clusterUpdateSettingsRequest, RequestOptions options, ActionListener<ClusterUpdateSettingsResponse> listener) { return restHighLevelClient.performRequestAsyncAndParseEntity(clusterUpdateSettingsRequest, ClusterRequestConverters::clusterPutSettings, options, ClusterUpdat... | /**
* Asynchronously updates cluster wide specific settings using the Cluster Update Settings API.
* See <a href="https://www.elastic.co/guide/en/elasticsearch/reference/current/cluster-update-settings.html"> Cluster Update Settings
* API on elastic.co</a>
* @param clusterUpdateSettingsRequest the r... | Asynchronously updates cluster wide specific settings using the Cluster Update Settings API. See Cluster Update Settings API on elastic.co | putSettingsAsync | {
"repo_name": "gingerwizard/elasticsearch",
"path": "client/rest-high-level/src/main/java/org/elasticsearch/client/ClusterClient.java",
"license": "apache-2.0",
"size": 17438
} | [
"java.util.Collections",
"org.elasticsearch.action.ActionListener",
"org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest",
"org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse"
] | import java.util.Collections; import org.elasticsearch.action.ActionListener; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsRequest; import org.elasticsearch.action.admin.cluster.settings.ClusterUpdateSettingsResponse; | import java.util.*; import org.elasticsearch.action.*; import org.elasticsearch.action.admin.cluster.settings.*; | [
"java.util",
"org.elasticsearch.action"
] | java.util; org.elasticsearch.action; | 1,031,885 |
@Override public void exitCompExpr(@NotNull FragmentParser.CompExprContext ctx) { } | @Override public void exitCompExpr(@NotNull FragmentParser.CompExprContext ctx) { } | /**
* {@inheritDoc}
*
* <p>The default implementation does nothing.</p>
*/ | The default implementation does nothing | enterCompExpr | {
"repo_name": "wouwouwou/module_8",
"path": "src/main/java/pp/block4/cc/cfg/FragmentBaseListener.java",
"license": "apache-2.0",
"size": 9582
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 48,946 |
public PaintScale getPaintScale() {
return this.paintScale;
}
| PaintScale function() { return this.paintScale; } | /**
* Returns the paint scale used by the renderer.
*
* @return The paint scale (never <code>null</code>).
*
* @see #setPaintScale(PaintScale)
*/ | Returns the paint scale used by the renderer | getPaintScale | {
"repo_name": "integrated/jfreechart",
"path": "source/org/jfree/chart/renderer/xy/XYShapeRenderer.java",
"license": "lgpl-2.1",
"size": 20711
} | [
"org.jfree.chart.renderer.PaintScale"
] | import org.jfree.chart.renderer.PaintScale; | import org.jfree.chart.renderer.*; | [
"org.jfree.chart"
] | org.jfree.chart; | 2,692,566 |
private int getPhoneType(String string) {
int type = ContactsContract.CommonDataKinds.Phone.TYPE_OTHER;
if ("home".equals(string.toLowerCase())) {
return ContactsContract.CommonDataKinds.Phone.TYPE_HOME;
}
else if ("mobile".equals(string.toLowerCase())) {
return ContactsContract.CommonData... | int function(String string) { int type = ContactsContract.CommonDataKinds.Phone.TYPE_OTHER; if ("home".equals(string.toLowerCase())) { return ContactsContract.CommonDataKinds.Phone.TYPE_HOME; } else if (STR.equals(string.toLowerCase())) { return ContactsContract.CommonDataKinds.Phone.TYPE_MOBILE; } else if ("work".equa... | /**
* Converts a string from the W3C Contact API to it's Android int value.
* @param string
* @return Android int value
*/ | Converts a string from the W3C Contact API to it's Android int value | getPhoneType | {
"repo_name": "brycecurtis/cordova-android",
"path": "framework/src/com/phonegap/ContactAccessorSdk5.java",
"license": "apache-2.0",
"size": 83394
} | [
"android.provider.ContactsContract"
] | import android.provider.ContactsContract; | import android.provider.*; | [
"android.provider"
] | android.provider; | 1,702,623 |
@Nonnull
public OAuth2PermissionGrantCollectionRequest orderBy(@Nonnull final String value) {
addOrderByOption(value);
return this;
} | OAuth2PermissionGrantCollectionRequest function(@Nonnull final String value) { addOrderByOption(value); return this; } | /**
* Sets the order by clause for the request
*
* @param value the order by clause
* @return the updated request
*/ | Sets the order by clause for the request | orderBy | {
"repo_name": "microsoftgraph/msgraph-sdk-java",
"path": "src/main/java/com/microsoft/graph/requests/OAuth2PermissionGrantCollectionRequest.java",
"license": "mit",
"size": 6058
} | [
"com.microsoft.graph.requests.OAuth2PermissionGrantCollectionRequest",
"javax.annotation.Nonnull"
] | import com.microsoft.graph.requests.OAuth2PermissionGrantCollectionRequest; import javax.annotation.Nonnull; | import com.microsoft.graph.requests.*; import javax.annotation.*; | [
"com.microsoft.graph",
"javax.annotation"
] | com.microsoft.graph; javax.annotation; | 1,857,373 |
private void displayFolderChoice(int requestCode, String sourceFolderName,
String accountUuid, String lastSelectedFolderName,
List<MessageReference> messages) {
Intent intent = new Intent(getActivity(), ChooseFolder.class);
intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, accountU... | void function(int requestCode, String sourceFolderName, String accountUuid, String lastSelectedFolderName, List<MessageReference> messages) { Intent intent = new Intent(getActivity(), ChooseFolder.class); intent.putExtra(ChooseFolder.EXTRA_ACCOUNT, accountUuid); intent.putExtra(ChooseFolder.EXTRA_SEL_FOLDER, lastSelect... | /**
* Helper method to manage the invocation of {@link #startActivityForResult(Intent, int)} for a
* folder operation ({@link ChooseFolder} activity), while saving a list of associated messages.
*
* @param requestCode
* If {@code >= 0}, this code will be returned in {@code onActivityRes... | Helper method to manage the invocation of <code>#startActivityForResult(Intent, int)</code> for a folder operation (<code>ChooseFolder</code> activity), while saving a list of associated messages | displayFolderChoice | {
"repo_name": "vt0r/k-9",
"path": "k9mail/src/main/java/com/fsck/k9/fragment/MessageListFragment.java",
"license": "apache-2.0",
"size": 101180
} | [
"android.content.Intent",
"com.fsck.k9.activity.ChooseFolder",
"com.fsck.k9.activity.MessageReference",
"java.util.List"
] | import android.content.Intent; import com.fsck.k9.activity.ChooseFolder; import com.fsck.k9.activity.MessageReference; import java.util.List; | import android.content.*; import com.fsck.k9.activity.*; import java.util.*; | [
"android.content",
"com.fsck.k9",
"java.util"
] | android.content; com.fsck.k9; java.util; | 38,630 |
@Nullable public static <T> Class<T> getInnerClass(Class<?> parentCls, String innerClsName) {
for (Class<?> cls : parentCls.getDeclaredClasses())
if (innerClsName.equals(cls.getSimpleName()))
return (Class<T>)cls;
return null;
} | @Nullable static <T> Class<T> function(Class<?> parentCls, String innerClsName) { for (Class<?> cls : parentCls.getDeclaredClasses()) if (innerClsName.equals(cls.getSimpleName())) return (Class<T>)cls; return null; } | /**
* Get inner class by its name from the enclosing class.
*
* @param parentCls Parent class to resolve inner class for.
* @param innerClsName Name of the inner class.
* @return Inner class.
*/ | Get inner class by its name from the enclosing class | getInnerClass | {
"repo_name": "samaitra/ignite",
"path": "modules/core/src/test/java/org/apache/ignite/testframework/GridTestUtils.java",
"license": "apache-2.0",
"size": 82485
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,069,267 |
public void setParentAdapterFactory(ComposedAdapterFactory parentAdapterFactory) {
this.parentAdapterFactory = parentAdapterFactory;
} | void function(ComposedAdapterFactory parentAdapterFactory) { this.parentAdapterFactory = parentAdapterFactory; } | /**
* This sets the composed adapter factory that contains this factory.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @generated
*/ | This sets the composed adapter factory that contains this factory. | setParentAdapterFactory | {
"repo_name": "ggxx/HelloBrazil",
"path": "src/edu.thu.ggxx.hellobrazil.edit/src/edu/thu/ggxx/hellobrazil/wc2014/provider/Wc2014ItemProviderAdapterFactory.java",
"license": "mit",
"size": 9160
} | [
"org.eclipse.emf.edit.provider.ComposedAdapterFactory"
] | import org.eclipse.emf.edit.provider.ComposedAdapterFactory; | import org.eclipse.emf.edit.provider.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 1,771,358 |
@ServiceMethod(returns = ReturnType.SINGLE)
public Response<AzureADOnlyAuthenticationInner> getWithResponse(
String resourceGroupName,
String workspaceName,
AzureADOnlyAuthenticationName azureADOnlyAuthenticationName,
Context context) {
return getWithResponseAsync(resourc... | @ServiceMethod(returns = ReturnType.SINGLE) Response<AzureADOnlyAuthenticationInner> function( String resourceGroupName, String workspaceName, AzureADOnlyAuthenticationName azureADOnlyAuthenticationName, Context context) { return getWithResponseAsync(resourceGroupName, workspaceName, azureADOnlyAuthenticationName, cont... | /**
* Gets a Azure Active Directory only authentication property.
*
* @param resourceGroupName The name of the resource group. The name is case insensitive.
* @param workspaceName The name of the workspace.
* @param azureADOnlyAuthenticationName name of the property.
* @param context The c... | Gets a Azure Active Directory only authentication property | getWithResponse | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/synapse/azure-resourcemanager-synapse/src/main/java/com/azure/resourcemanager/synapse/implementation/AzureADOnlyAuthenticationsClientImpl.java",
"license": "mit",
"size": 46909
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.Response",
"com.azure.core.util.Context",
"com.azure.resourcemanager.synapse.fluent.models.AzureADOnlyAuthenticationInner",
"com.azure.resourcemanager.synapse.models.AzureADOnlyAuthenticationName"
... | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.Response; import com.azure.core.util.Context; import com.azure.resourcemanager.synapse.fluent.models.AzureADOnlyAuthenticationInner; import com.azure.resourcemanager.synapse.models.AzureADOnlyAut... | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.synapse.fluent.models.*; import com.azure.resourcemanager.synapse.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,762,215 |
public boolean install(String applicationWarName) {
IConnection conn = Red5.getConnectionLocal();
boolean result = false;
//strip everything except the applications name
String application = applicationWarName.substring(0, applicationWarName.indexOf('-'));
log.debug("Applicat... | boolean function(String applicationWarName) { IConnection conn = Red5.getConnectionLocal(); boolean result = false; String application = applicationWarName.substring(0, applicationWarName.indexOf('-')); log.debug(STR, application); String webappsDir = System.getProperty(STR); log.debug(STR, webappsDir); String contextP... | /**
* Installs a given application.
*
* @param applicationWarName
* app war name
* @return true if installed; false otherwise
*/ | Installs a given application | install | {
"repo_name": "maritelle/red5-server",
"path": "src/main/java/org/red5/server/service/Installer.java",
"license": "apache-2.0",
"size": 13124
} | [
"java.io.File",
"java.io.FileOutputStream",
"java.io.IOException",
"javax.servlet.ServletException",
"org.apache.http.HttpEntity",
"org.apache.http.HttpResponse",
"org.apache.http.client.HttpClient",
"org.apache.http.client.methods.HttpGet",
"org.apache.http.conn.HttpHostConnectException",
"org.ap... | import java.io.File; import java.io.FileOutputStream; import java.io.IOException; import javax.servlet.ServletException; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; import org.apache.http.client.HttpClient; import org.apache.http.client.methods.HttpGet; import org.apache.http.conn.HttpHostCo... | import java.io.*; import javax.servlet.*; import org.apache.http.*; import org.apache.http.client.*; import org.apache.http.client.methods.*; import org.apache.http.conn.*; import org.apache.http.util.*; import org.red5.server.api.*; import org.red5.server.api.service.*; import org.red5.server.jmx.mxbeans.*; import org... | [
"java.io",
"javax.servlet",
"org.apache.http",
"org.red5.server"
] | java.io; javax.servlet; org.apache.http; org.red5.server; | 667,427 |
private String getTargetRoleDescription(ProtocolPersonRoleMappingBase protocolPersonRole) {
protocolPersonRole.refreshReferenceObject(targetRoleReferenceObject);
return protocolPersonRole.getTargetRole().getDescription();
} | String function(ProtocolPersonRoleMappingBase protocolPersonRole) { protocolPersonRole.refreshReferenceObject(targetRoleReferenceObject); return protocolPersonRole.getTargetRole().getDescription(); } | /**
* This method is used to refresh target role object and return description
* @param protocolPersonRole
* @return String - target role name
*/ | This method is used to refresh target role object and return description | getTargetRoleDescription | {
"repo_name": "vivantech/kc_fixes",
"path": "src/main/java/org/kuali/kra/irb/personnel/ProtocolPersonRoleValuesFinder.java",
"license": "apache-2.0",
"size": 3585
} | [
"org.kuali.kra.protocol.personnel.ProtocolPersonRoleMappingBase"
] | import org.kuali.kra.protocol.personnel.ProtocolPersonRoleMappingBase; | import org.kuali.kra.protocol.personnel.*; | [
"org.kuali.kra"
] | org.kuali.kra; | 155,842 |
public void testEquals() {
IntervalMarker m1 = new IntervalMarker(45.0, 50.0);
IntervalMarker m2 = new IntervalMarker(45.0, 50.0);
assertTrue(m1.equals(m2));
assertTrue(m2.equals(m1));
m1 = new IntervalMarker(44.0, 50.0);
assertFalse(m1.equals(m2));
... | void function() { IntervalMarker m1 = new IntervalMarker(45.0, 50.0); IntervalMarker m2 = new IntervalMarker(45.0, 50.0); assertTrue(m1.equals(m2)); assertTrue(m2.equals(m1)); m1 = new IntervalMarker(44.0, 50.0); assertFalse(m1.equals(m2)); m2 = new IntervalMarker(44.0, 50.0); assertTrue(m1.equals(m2)); m1 = new Interv... | /**
* Confirm that the equals method can distinguish all the required fields.
*/ | Confirm that the equals method can distinguish all the required fields | testEquals | {
"repo_name": "raedle/univis",
"path": "lib/jfreechart-1.0.1/src/org/jfree/chart/plot/junit/IntervalMarkerTests.java",
"license": "lgpl-2.1",
"size": 4872
} | [
"org.jfree.chart.plot.IntervalMarker",
"org.jfree.ui.GradientPaintTransformType",
"org.jfree.ui.GradientPaintTransformer",
"org.jfree.ui.StandardGradientPaintTransformer"
] | import org.jfree.chart.plot.IntervalMarker; import org.jfree.ui.GradientPaintTransformType; import org.jfree.ui.GradientPaintTransformer; import org.jfree.ui.StandardGradientPaintTransformer; | import org.jfree.chart.plot.*; import org.jfree.ui.*; | [
"org.jfree.chart",
"org.jfree.ui"
] | org.jfree.chart; org.jfree.ui; | 1,583,202 |
public void testMutuallyExclusiveScopes() {
// Those should pass
Setting<String> setting = Setting.simpleString("foo.bar", Property.NodeScope);
assertThat(setting.hasNodeScope(), is(true));
assertThat(setting.hasIndexScope(), is(false));
setting = Setting.simpleString("foo.ba... | void function() { Setting<String> setting = Setting.simpleString(STR, Property.NodeScope); assertThat(setting.hasNodeScope(), is(true)); assertThat(setting.hasIndexScope(), is(false)); setting = Setting.simpleString(STR, Property.IndexScope); assertThat(setting.hasIndexScope(), is(true)); assertThat(setting.hasNodeScop... | /**
* Only one single scope can be added to any setting
*/ | Only one single scope can be added to any setting | testMutuallyExclusiveScopes | {
"repo_name": "camilojd/elasticsearch",
"path": "core/src/test/java/org/elasticsearch/common/settings/SettingTests.java",
"license": "apache-2.0",
"size": 23250
} | [
"org.elasticsearch.common.settings.Setting",
"org.hamcrest.Matchers"
] | import org.elasticsearch.common.settings.Setting; import org.hamcrest.Matchers; | import org.elasticsearch.common.settings.*; import org.hamcrest.*; | [
"org.elasticsearch.common",
"org.hamcrest"
] | org.elasticsearch.common; org.hamcrest; | 287,679 |
static HttpRequest of(RequestHeaders headers, Publisher<? extends HttpObject> publisher) {
requireNonNull(headers, "headers");
requireNonNull(publisher, "publisher");
if (publisher instanceof HttpRequest) {
return ((HttpRequest) publisher).withHeaders(headers);
} else {
... | static HttpRequest of(RequestHeaders headers, Publisher<? extends HttpObject> publisher) { requireNonNull(headers, STR); requireNonNull(publisher, STR); if (publisher instanceof HttpRequest) { return ((HttpRequest) publisher).withHeaders(headers); } else { return new PublisherBasedHttpRequest(headers, publisher); } } | /**
* Creates a new instance from an existing {@link RequestHeaders} and {@link Publisher}.
*/ | Creates a new instance from an existing <code>RequestHeaders</code> and <code>Publisher</code> | of | {
"repo_name": "minwoox/armeria",
"path": "core/src/main/java/com/linecorp/armeria/common/HttpRequest.java",
"license": "apache-2.0",
"size": 20599
} | [
"java.util.Objects",
"org.reactivestreams.Publisher"
] | import java.util.Objects; import org.reactivestreams.Publisher; | import java.util.*; import org.reactivestreams.*; | [
"java.util",
"org.reactivestreams"
] | java.util; org.reactivestreams; | 1,849,510 |
public void processAllPendingDNMessages() throws IOException {
assert !shouldPostponeBlocksFromFuture :
"processAllPendingDNMessages() should be called after disabling " +
"block postponement.";
int count = pendingDNMessages.count();
if (count > 0) {
LOG.info("Processing " + count + " me... | void function() throws IOException { assert !shouldPostponeBlocksFromFuture : STR + STR; int count = pendingDNMessages.count(); if (count > 0) { LOG.info(STR + count + STR + STR); } processQueuedMessages(pendingDNMessages.takeAll()); assert pendingDNMessages.count() == 0; } | /**
* Process any remaining queued datanode messages after entering
* active state. At this point they will not be re-queued since
* we are the definitive master node and thus should be up-to-date
* with the namespace information.
*/ | Process any remaining queued datanode messages after entering active state. At this point they will not be re-queued since we are the definitive master node and thus should be up-to-date with the namespace information | processAllPendingDNMessages | {
"repo_name": "busbey/hadoop",
"path": "hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/blockmanagement/BlockManager.java",
"license": "apache-2.0",
"size": 148493
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,724,863 |
public StructuredDataResults loadStructuredData(Object object,
long userID, boolean viewed)
throws DSOutOfServiceException, DSAccessException
{
if (object == null)
throw new IllegalArgumentException("Object not valid.");
StructuredDataResults results = null;... | StructuredDataResults function(Object object, long userID, boolean viewed) throws DSOutOfServiceException, DSAccessException { if (object == null) throw new IllegalArgumentException(STR); StructuredDataResults results = null; DataObject r = null; if (object instanceof File) { File f = (File) object; DataObject fd = gat... | /**
* Implemented as specified by {@link OmeroDataService}.
* @see OmeroMetadataService#loadStructuredData(DataObject, long, boolean)
*/ | Implemented as specified by <code>OmeroDataService</code> | loadStructuredData | {
"repo_name": "joshmoore/openmicroscopy",
"path": "components/insight/SRC/org/openmicroscopy/shoola/env/data/OmeroMetadataServiceImpl.java",
"license": "gpl-2.0",
"size": 61398
} | [
"java.io.File",
"java.util.ArrayList",
"java.util.Collection",
"java.util.HashMap",
"java.util.Iterator",
"java.util.List",
"java.util.Map",
"org.openmicroscopy.shoola.env.data.util.ModelMapper",
"org.openmicroscopy.shoola.env.data.util.PojoMapper",
"org.openmicroscopy.shoola.env.data.util.Structu... | import java.io.File; import java.util.ArrayList; import java.util.Collection; import java.util.HashMap; import java.util.Iterator; import java.util.List; import java.util.Map; import org.openmicroscopy.shoola.env.data.util.ModelMapper; import org.openmicroscopy.shoola.env.data.util.PojoMapper; import org.openmicroscopy... | import java.io.*; import java.util.*; import org.openmicroscopy.shoola.env.data.util.*; | [
"java.io",
"java.util",
"org.openmicroscopy.shoola"
] | java.io; java.util; org.openmicroscopy.shoola; | 1,490,034 |
public void assertHasSameSizeAs(AssertionInfo info, float[] actual, Object[] other) {
arrays.assertHasSameSizeAs(info, actual, other);
} | void function(AssertionInfo info, float[] actual, Object[] other) { arrays.assertHasSameSizeAs(info, actual, other); } | /**
* Assert that the actual array has the same size as the other array.
* @param info contains information about the assertion.
* @param actual the given array.
* @param other the group to compare
* @throws AssertionError if the actual group is {@code null}.
* @throws AssertionError if the other grou... | Assert that the actual array has the same size as the other array | assertHasSameSizeAs | {
"repo_name": "yurloc/assertj-core",
"path": "src/main/java/org/assertj/core/internal/FloatArrays.java",
"license": "apache-2.0",
"size": 14074
} | [
"org.assertj.core.api.AssertionInfo"
] | import org.assertj.core.api.AssertionInfo; | import org.assertj.core.api.*; | [
"org.assertj.core"
] | org.assertj.core; | 2,309,240 |
public void updatePointCloudModelMatrix(float[] translation,
float[] quaternion) {
float[] tempMultMatrix = new float[16];
Matrix.setIdentityM(tempMultMatrix, 0);
Matrix.multiplyMM(tempMultMatrix, 0, mColorCamera2IMUMatrix, 0,
mOpengl2ColorCameraMatrix, 0);
... | void function(float[] translation, float[] quaternion) { float[] tempMultMatrix = new float[16]; Matrix.setIdentityM(tempMultMatrix, 0); Matrix.multiplyMM(tempMultMatrix, 0, mColorCamera2IMUMatrix, 0, mOpengl2ColorCameraMatrix, 0); float[] tempInvertMatrix = new float[16]; Matrix.setIdentityM(tempInvertMatrix, 0); Matr... | /**
* Updates the model matrix (rotation and translation).
*
* @param translation
* a three-element array of translation data.
* @param quaternion
* a four-element array of rotation data.
*/ | Updates the model matrix (rotation and translation) | updatePointCloudModelMatrix | {
"repo_name": "dariol/MotionTrackingJavaVR",
"path": "tangoUtils/src/main/java/com/projecttango/tangoutils/ModelMatCalculator.java",
"license": "apache-2.0",
"size": 8990
} | [
"android.opengl.Matrix"
] | import android.opengl.Matrix; | import android.opengl.*; | [
"android.opengl"
] | android.opengl; | 2,436,316 |
public int createAndRunWorkbench() {
display = PlatformUI.createDisplay();
return PlatformUI.createAndRunWorkbench(display, this);
}
| int function() { display = PlatformUI.createDisplay(); return PlatformUI.createAndRunWorkbench(display, this); } | /**
* A utility function for starting the workbench.
*
* @return
*/ | A utility function for starting the workbench | createAndRunWorkbench | {
"repo_name": "HebaKhaled/bposs",
"path": "src/com.mentor.nucleus.bp.cli/src/com/mentor/nucleus/bp/cli/BPCLIWorkbenchAdvisor.java",
"license": "apache-2.0",
"size": 10175
} | [
"org.eclipse.ui.PlatformUI"
] | import org.eclipse.ui.PlatformUI; | import org.eclipse.ui.*; | [
"org.eclipse.ui"
] | org.eclipse.ui; | 869,288 |
public List<CubeFactTable> getAllFactTables(CubeInterface cube) throws HiveException {
if (cube instanceof Cube) {
List<CubeFactTable> cubeFacts = new ArrayList<CubeFactTable>();
try {
for (CubeFactTable fact : getAllFacts()) {
if (fact.getCubeName().equalsIgnoreCase(((Cube) cube).ge... | List<CubeFactTable> function(CubeInterface cube) throws HiveException { if (cube instanceof Cube) { List<CubeFactTable> cubeFacts = new ArrayList<CubeFactTable>(); try { for (CubeFactTable fact : getAllFacts()) { if (fact.getCubeName().equalsIgnoreCase(((Cube) cube).getName())) { cubeFacts.add(fact); } } } catch (HiveE... | /**
* Get all fact tables of the cube.
*
* @param cube
* Cube object
*
* @return List of fact tables
* @throws HiveException
*/ | Get all fact tables of the cube | getAllFactTables | {
"repo_name": "rajubairishetti/incubator-lens",
"path": "lens-cube/src/main/java/org/apache/lens/cube/metadata/CubeMetastoreClient.java",
"license": "apache-2.0",
"size": 51955
} | [
"java.util.ArrayList",
"java.util.List",
"org.apache.hadoop.hive.ql.metadata.HiveException"
] | import java.util.ArrayList; import java.util.List; import org.apache.hadoop.hive.ql.metadata.HiveException; | import java.util.*; import org.apache.hadoop.hive.ql.metadata.*; | [
"java.util",
"org.apache.hadoop"
] | java.util; org.apache.hadoop; | 2,488,398 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.