method stringlengths 13 441k | clean_method stringlengths 7 313k | doc stringlengths 17 17.3k | comment stringlengths 3 1.42k | method_name stringlengths 1 273 | extra dict | imports list | imports_info stringlengths 19 34.8k | cluster_imports_info stringlengths 15 3.66k | libraries list | libraries_info stringlengths 6 661 | id int64 0 2.92M |
|---|---|---|---|---|---|---|---|---|---|---|---|
public DeviceId getDeviceId() {
if (deviceId == null) {
deviceId = createDeviceId(address, port);
}
return deviceId;
} | DeviceId function() { if (deviceId == null) { deviceId = createDeviceId(address, port); } return deviceId; } | /**
* Return the DeviceId about the device containing the URI.
*
* @return DeviceId
*/ | Return the DeviceId about the device containing the URI | getDeviceId | {
"repo_name": "cboling/onos-restconf-providers",
"path": "protocols/restconf/api/src/main/java/org/onosproject/restconf/RestconfDeviceInfo.java",
"license": "apache-2.0",
"size": 6892
} | [
"org.onosproject.net.DeviceId"
] | import org.onosproject.net.DeviceId; | import org.onosproject.net.*; | [
"org.onosproject.net"
] | org.onosproject.net; | 293,860 |
List<User> getAssignedUsers(PerunSession sess, Facility facility); | List<User> getAssignedUsers(PerunSession sess, Facility facility); | /**
* Return all users assigned to Facility.
*
* @param sess
* @param facility
* @return list of user
* @throws InternalErrorException
*/ | Return all users assigned to Facility | getAssignedUsers | {
"repo_name": "zoraseb/perun",
"path": "perun-core/src/main/java/cz/metacentrum/perun/core/implApi/FacilitiesManagerImplApi.java",
"license": "bsd-2-clause",
"size": 24424
} | [
"cz.metacentrum.perun.core.api.Facility",
"cz.metacentrum.perun.core.api.PerunSession",
"cz.metacentrum.perun.core.api.User",
"java.util.List"
] | import cz.metacentrum.perun.core.api.Facility; import cz.metacentrum.perun.core.api.PerunSession; import cz.metacentrum.perun.core.api.User; import java.util.List; | import cz.metacentrum.perun.core.api.*; import java.util.*; | [
"cz.metacentrum.perun",
"java.util"
] | cz.metacentrum.perun; java.util; | 2,155,516 |
public static long toLong(String value) {
return PcepTools.ipToLong(value.replace(SCHEME, ""));
} | static long function(String value) { return PcepTools.ipToLong(value.replace(SCHEME, "")); } | /**
* Produces device long from the given string which comes from the uri
* method.
*
* @param value string value which produced by uri method.
* @return a long value.
*/ | Produces device long from the given string which comes from the uri method | toLong | {
"repo_name": "kuujo/onos",
"path": "apps/pcep-api/src/main/java/org/onosproject/pcep/api/PcepDpid.java",
"license": "apache-2.0",
"size": 3026
} | [
"org.onosproject.pcep.tools.PcepTools"
] | import org.onosproject.pcep.tools.PcepTools; | import org.onosproject.pcep.tools.*; | [
"org.onosproject.pcep"
] | org.onosproject.pcep; | 160,930 |
@Override
public void run() {
EntryLogger.setSource(this.serverId, "RI");
boolean addedListener = false;
try {
this.system.addDisconnectListener(this);
addedListener = true;
if (!waitForCache()) {
logger.warn("{}: no cache (exiting)", this);
return;
}
processMessages();
} catch (CancelException ignore) {
// just bail
} finally {
if (addedListener) {
this.system.removeDisconnectListener(this);
}
this.close();
EntryLogger.clearSource();
}
} | void function() { EntryLogger.setSource(this.serverId, "RI"); boolean addedListener = false; try { this.system.addDisconnectListener(this); addedListener = true; if (!waitForCache()) { logger.warn(STR, this); return; } processMessages(); } catch (CancelException ignore) { } finally { if (addedListener) { this.system.removeDisconnectListener(this); } this.close(); EntryLogger.clearSource(); } } | /**
* Performs the work of the client update thread. Creates a {@code ServerSocket} and waits for the
* server to connect to it.
*/ | Performs the work of the client update thread. Creates a ServerSocket and waits for the server to connect to it | run | {
"repo_name": "pdxrunner/geode",
"path": "geode-core/src/main/java/org/apache/geode/internal/cache/tier/sockets/CacheClientUpdater.java",
"license": "apache-2.0",
"size": 68860
} | [
"org.apache.geode.CancelException",
"org.apache.geode.internal.sequencelog.EntryLogger"
] | import org.apache.geode.CancelException; import org.apache.geode.internal.sequencelog.EntryLogger; | import org.apache.geode.*; import org.apache.geode.internal.sequencelog.*; | [
"org.apache.geode"
] | org.apache.geode; | 53,938 |
public Map<String, Object> getObjectMap() {
return Collections.unmodifiableMap(this.objectMap);
}
| Map<String, Object> function() { return Collections.unmodifiableMap(this.objectMap); } | /**
* retrieves an unmodifiable view of the objectMap.
*/ | retrieves an unmodifiable view of the objectMap | getObjectMap | {
"repo_name": "ricepanda/rice-git3",
"path": "rice-framework/krad-app-framework/src/main/java/org/kuali/rice/krad/UserSession.java",
"license": "apache-2.0",
"size": 14343
} | [
"java.util.Collections",
"java.util.Map"
] | import java.util.Collections; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,116,954 |
@Test
public void validateProcessorCanBeStoppedWhenOnScheduledBlocksIndefinitelyInterruptable() throws Exception {
final FlowManagerAndSystemBundle fcsb = this.buildFlowControllerForTest(NiFiProperties.PROCESSOR_SCHEDULING_TIMEOUT, "5 sec");
flowManager = fcsb.getFlowManager();
ProcessGroup testGroup = flowManager.createProcessGroup(UUID.randomUUID().toString());
ProcessorNode testProcNode = flowManager.createProcessor(TestProcessor.class.getName(), UUID.randomUUID().toString(),
fcsb.getSystemBundle().getBundleDetails().getCoordinate());
testProcNode.setProperties(properties);
TestProcessor testProcessor = (TestProcessor) testProcNode.getProcessor();
// sets the scenario for the processor to run
this.blockingInterruptableOnUnschedule(testProcessor);
testProcNode.performValidation();
processScheduler.startProcessor(testProcNode, true);
assertCondition(() -> ScheduledState.RUNNING == testProcNode.getScheduledState(), SHORT_DELAY_TOLERANCE);
processScheduler.stopProcessor(testProcNode);
assertCondition(() -> ScheduledState.STOPPED == testProcNode.getScheduledState(), MEDIUM_DELAY_TOLERANCE);
} | void function() throws Exception { final FlowManagerAndSystemBundle fcsb = this.buildFlowControllerForTest(NiFiProperties.PROCESSOR_SCHEDULING_TIMEOUT, STR); flowManager = fcsb.getFlowManager(); ProcessGroup testGroup = flowManager.createProcessGroup(UUID.randomUUID().toString()); ProcessorNode testProcNode = flowManager.createProcessor(TestProcessor.class.getName(), UUID.randomUUID().toString(), fcsb.getSystemBundle().getBundleDetails().getCoordinate()); testProcNode.setProperties(properties); TestProcessor testProcessor = (TestProcessor) testProcNode.getProcessor(); this.blockingInterruptableOnUnschedule(testProcessor); testProcNode.performValidation(); processScheduler.startProcessor(testProcNode, true); assertCondition(() -> ScheduledState.RUNNING == testProcNode.getScheduledState(), SHORT_DELAY_TOLERANCE); processScheduler.stopProcessor(testProcNode); assertCondition(() -> ScheduledState.STOPPED == testProcNode.getScheduledState(), MEDIUM_DELAY_TOLERANCE); } | /**
* Validates that the Processor can be stopped when @OnScheduled blocks
* indefinitely but written to react to thread interrupts
*/ | Validates that the Processor can be stopped when @OnScheduled blocks indefinitely but written to react to thread interrupts | validateProcessorCanBeStoppedWhenOnScheduledBlocksIndefinitelyInterruptable | {
"repo_name": "MikeThomsen/nifi",
"path": "nifi-nar-bundles/nifi-framework-bundle/nifi-framework/nifi-framework-core/src/test/java/org/apache/nifi/controller/scheduling/ProcessorLifecycleIT.java",
"license": "apache-2.0",
"size": 34248
} | [
"java.util.UUID",
"org.apache.nifi.controller.ProcessorNode",
"org.apache.nifi.controller.ScheduledState",
"org.apache.nifi.groups.ProcessGroup",
"org.apache.nifi.util.NiFiProperties"
] | import java.util.UUID; import org.apache.nifi.controller.ProcessorNode; import org.apache.nifi.controller.ScheduledState; import org.apache.nifi.groups.ProcessGroup; import org.apache.nifi.util.NiFiProperties; | import java.util.*; import org.apache.nifi.controller.*; import org.apache.nifi.groups.*; import org.apache.nifi.util.*; | [
"java.util",
"org.apache.nifi"
] | java.util; org.apache.nifi; | 743,875 |
public DispositionResource createVideoDisposition(Integer videoId, DispositionResource dispositionResource) throws ApiException {
Object localVarPostBody = dispositionResource;
// verify the required parameter 'videoId' is set
if (videoId == null) {
throw new ApiException(400, "Missing the required parameter 'videoId' when calling createVideoDisposition");
}
// create path and map variables
String localVarPath = "/media/videos/{video_id}/dispositions"
.replaceAll("\\{" + "video_id" + "\\}", apiClient.escapeString(videoId.toString()));
// query params
List<Pair> localVarQueryParams = new ArrayList<Pair>();
Map<String, String> localVarHeaderParams = new HashMap<String, String>();
Map<String, Object> localVarFormParams = new HashMap<String, Object>();
final String[] localVarAccepts = {
"application/json"
};
final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts);
final String[] localVarContentTypes = {
"application/json"
};
final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes);
String[] localVarAuthNames = new String[] { "oauth2_client_credentials_grant", "oauth2_password_grant" };
GenericType<DispositionResource> localVarReturnType = new GenericType<DispositionResource>() {};
return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType);
} | DispositionResource function(Integer videoId, DispositionResource dispositionResource) throws ApiException { Object localVarPostBody = dispositionResource; if (videoId == null) { throw new ApiException(400, STR); } String localVarPath = STR .replaceAll("\\{" + STR + "\\}", apiClient.escapeString(videoId.toString())); List<Pair> localVarQueryParams = new ArrayList<Pair>(); Map<String, String> localVarHeaderParams = new HashMap<String, String>(); Map<String, Object> localVarFormParams = new HashMap<String, Object>(); final String[] localVarAccepts = { STR }; final String localVarAccept = apiClient.selectHeaderAccept(localVarAccepts); final String[] localVarContentTypes = { STR }; final String localVarContentType = apiClient.selectHeaderContentType(localVarContentTypes); String[] localVarAuthNames = new String[] { STR, STR }; GenericType<DispositionResource> localVarReturnType = new GenericType<DispositionResource>() {}; return apiClient.invokeAPI(localVarPath, "POST", localVarQueryParams, localVarPostBody, localVarHeaderParams, localVarFormParams, localVarAccept, localVarContentType, localVarAuthNames, localVarReturnType); } | /**
* Create a video disposition
* <b>Permissions Needed:</b> VIDEOS_USER or VIDEOS_ADMIN
* @param videoId The video id (required)
* @param dispositionResource The disposition object (optional)
* @return DispositionResource
* @throws ApiException if fails to make API call
*/ | Create a video disposition <b>Permissions Needed:</b> VIDEOS_USER or VIDEOS_ADMIN | createVideoDisposition | {
"repo_name": "knetikmedia/knetikcloud-java-client",
"path": "src/main/java/com/knetikcloud/api/MediaVideosApi.java",
"license": "apache-2.0",
"size": 58759
} | [
"com.knetikcloud.client.ApiException",
"com.knetikcloud.client.Pair",
"com.knetikcloud.model.DispositionResource",
"java.util.ArrayList",
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"javax.ws.rs.core.GenericType"
] | import com.knetikcloud.client.ApiException; import com.knetikcloud.client.Pair; import com.knetikcloud.model.DispositionResource; import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; import javax.ws.rs.core.GenericType; | import com.knetikcloud.client.*; import com.knetikcloud.model.*; import java.util.*; import javax.ws.rs.core.*; | [
"com.knetikcloud.client",
"com.knetikcloud.model",
"java.util",
"javax.ws"
] | com.knetikcloud.client; com.knetikcloud.model; java.util; javax.ws; | 958,408 |
protected boolean hasLodgingActualExpense(TravelDocument document) {
for (ActualExpense expense : document.getActualExpenses()) {
if (expense.isLodging() || expense.isLodgingAllowance()) {
return true;
}
}
return false;
}
| boolean function(TravelDocument document) { for (ActualExpense expense : document.getActualExpenses()) { if (expense.isLodging() expense.isLodgingAllowance()) { return true; } } return false; } | /**
* Determines whether the given document has any actual expenses associated which are lodging expenses
* @param document the document to look for lodging expenses on
* @return true if there are lodging expenses on the document, false otherwise
*/ | Determines whether the given document has any actual expenses associated which are lodging expenses | hasLodgingActualExpense | {
"repo_name": "ua-eas/ua-kfs-5.3",
"path": "work/src/org/kuali/kfs/module/tem/document/validation/impl/TravelAuthTripDetailMealsAndIncidentalsValidation.java",
"license": "agpl-3.0",
"size": 9615
} | [
"org.kuali.kfs.module.tem.businessobject.ActualExpense",
"org.kuali.kfs.module.tem.document.TravelDocument"
] | import org.kuali.kfs.module.tem.businessobject.ActualExpense; import org.kuali.kfs.module.tem.document.TravelDocument; | import org.kuali.kfs.module.tem.businessobject.*; import org.kuali.kfs.module.tem.document.*; | [
"org.kuali.kfs"
] | org.kuali.kfs; | 2,207,821 |
@Override
public MasterDefRegistry getDefRegistry() {
ContextService cs = Aura.getContextService();
cs.assertEstablished();
return cs.getCurrentContext().getDefRegistry();
} | MasterDefRegistry function() { ContextService cs = Aura.getContextService(); cs.assertEstablished(); return cs.getCurrentContext().getDefRegistry(); } | /**
* Get the def registry currently in use.
*
* @return the master def registry.
* @throws RuntimeException if the context has not been initialized.
*/ | Get the def registry currently in use | getDefRegistry | {
"repo_name": "TribeMedia/aura",
"path": "aura-impl/src/main/java/org/auraframework/impl/DefinitionServiceImpl.java",
"license": "apache-2.0",
"size": 12030
} | [
"org.auraframework.Aura",
"org.auraframework.service.ContextService",
"org.auraframework.system.MasterDefRegistry"
] | import org.auraframework.Aura; import org.auraframework.service.ContextService; import org.auraframework.system.MasterDefRegistry; | import org.auraframework.*; import org.auraframework.service.*; import org.auraframework.system.*; | [
"org.auraframework",
"org.auraframework.service",
"org.auraframework.system"
] | org.auraframework; org.auraframework.service; org.auraframework.system; | 1,662,424 |
@Schema(required = true, description = "Distinguished Name (DN) of Active Directory administrative account")
public String getServerAdminName() {
return serverAdminName;
} | @Schema(required = true, description = STR) String function() { return serverAdminName; } | /**
* Distinguished Name (DN) of Active Directory administrative account
* @return serverAdminName
**/ | Distinguished Name (DN) of Active Directory administrative account | getServerAdminName | {
"repo_name": "iterate-ch/cyberduck",
"path": "dracoon/src/main/java/ch/cyberduck/core/sds/io/swagger/client/model/TestActiveDirectoryConfigResponse.java",
"license": "gpl-3.0",
"size": 7847
} | [
"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,249,578 |
public static OperatingSystem identify()
{
OperatingSystem os = null;
String env = System.getProperty("os.name").toLowerCase();
if (env.startsWith(SUN_WINDOWS))
{
LoggingUtil.log("OS: [Windows]");
os = OperatingSystem.WINDOWS;
}
else if (env.contains(SUN_MACOSX) || env.contains(OPENJDK_MACOSX))
{
LoggingUtil.log("OS: [Mac]");
os = OperatingSystem.MACOSX;
}
else
{
LoggingUtil.log("OS: [Linux]");
os = OperatingSystem.LINUX;
}
return os;
} | static OperatingSystem function() { OperatingSystem os = null; String env = System.getProperty(STR).toLowerCase(); if (env.startsWith(SUN_WINDOWS)) { LoggingUtil.log(STR); os = OperatingSystem.WINDOWS; } else if (env.contains(SUN_MACOSX) env.contains(OPENJDK_MACOSX)) { LoggingUtil.log(STR); os = OperatingSystem.MACOSX; } else { LoggingUtil.log(STR); os = OperatingSystem.LINUX; } return os; } | /**
* Searches for Windows and Mac specificially and if not found defaults to Linux.
*/ | Searches for Windows and Mac specificially and if not found defaults to Linux | identify | {
"repo_name": "apache/flex-flexunit",
"path": "FlexUnit4AntTasks/src/org/flexunit/ant/launcher/OperatingSystem.java",
"license": "apache-2.0",
"size": 1685
} | [
"org.flexunit.ant.LoggingUtil"
] | import org.flexunit.ant.LoggingUtil; | import org.flexunit.ant.*; | [
"org.flexunit.ant"
] | org.flexunit.ant; | 2,877,607 |
public FormEntryCaption getCaptionPrompt(FormIndex index) {
return new FormEntryCaption(form, index);
} | FormEntryCaption function(FormIndex index) { return new FormEntryCaption(form, index); } | /**
* When you have a non-question event, a CaptionPrompt will have all the
* information needed to display to the user.
*
* @return Returns the FormEntryCaption for the given FormIndex if is not a
* question.
*/ | When you have a non-question event, a CaptionPrompt will have all the information needed to display to the user | getCaptionPrompt | {
"repo_name": "dimagi/commcare",
"path": "src/main/java/org/javarosa/form/api/FormEntryModel.java",
"license": "apache-2.0",
"size": 24906
} | [
"org.javarosa.core.model.FormIndex"
] | import org.javarosa.core.model.FormIndex; | import org.javarosa.core.model.*; | [
"org.javarosa.core"
] | org.javarosa.core; | 260,651 |
protected String getIdeLocation() {
final String resourcePath = Main.class.getResource(Main.class.getSimpleName() + CLASS_EXTENSION).getPath();
final Pattern pattern = Pattern.compile("file:(.*?)lib/bootstrap.jar!/" + Main.class.getName() + CLASS_EXTENSION);
final Matcher matcher = pattern.matcher(resourcePath);
if (matcher.find()) {
return matcher.group(1);
}
// if the IDE could not be found an empty string is returned
return StringUtils.EMPTY;
} | String function() { final String resourcePath = Main.class.getResource(Main.class.getSimpleName() + CLASS_EXTENSION).getPath(); final Pattern pattern = Pattern.compile(STR + Main.class.getName() + CLASS_EXTENSION); final Matcher matcher = pattern.matcher(resourcePath); if (matcher.find()) { return matcher.group(1); } return StringUtils.EMPTY; } | /**
* Find the current location of the IDE running
*
* @return the IDE path or an empty string if not found
*/ | Find the current location of the IDE running | getIdeLocation | {
"repo_name": "Microsoft/vso-intellij",
"path": "plugin/src/com/microsoft/alm/plugin/idea/common/setup/ApplicationStartup.java",
"license": "mit",
"size": 9344
} | [
"com.intellij.idea.Main",
"java.util.regex.Matcher",
"java.util.regex.Pattern",
"org.apache.commons.lang.StringUtils"
] | import com.intellij.idea.Main; import java.util.regex.Matcher; import java.util.regex.Pattern; import org.apache.commons.lang.StringUtils; | import com.intellij.idea.*; import java.util.regex.*; import org.apache.commons.lang.*; | [
"com.intellij.idea",
"java.util",
"org.apache.commons"
] | com.intellij.idea; java.util; org.apache.commons; | 1,960,164 |
@Update(sql = "DELETE FROM request_data WHERE ID={id}")
void delete(int id, VoidCallback callback);
| @Update(sql = STR) void delete(int id, VoidCallback callback); | /**
* Truncate table.
* @param callback
*/ | Truncate table | delete | {
"repo_name": "2947721120/ChromeRestClient",
"path": "RestClient/src/org/rest/client/storage/websql/RequestDataService.java",
"license": "apache-2.0",
"size": 6024
} | [
"com.google.code.gwt.database.client.service.Update",
"com.google.code.gwt.database.client.service.VoidCallback"
] | import com.google.code.gwt.database.client.service.Update; import com.google.code.gwt.database.client.service.VoidCallback; | import com.google.code.gwt.database.client.service.*; | [
"com.google.code"
] | com.google.code; | 595,082 |
public void count(Example example, double weight) {
for (Aggregator aggregator : aggregators) {
aggregator.count(example, weight);
}
}
| void function(Example example, double weight) { for (Aggregator aggregator : aggregators) { aggregator.count(example, weight); } } | /**
* This will count the given examples for all registered {@link Aggregator}s with the given
* weight. If there's no weight attribute available, it is preferable to use the
* {@link #count(Example)} method, as it might be more efficiently implemented.
*/ | This will count the given examples for all registered <code>Aggregator</code>s with the given weight. If there's no weight attribute available, it is preferable to use the <code>#count(Example)</code> method, as it might be more efficiently implemented | count | {
"repo_name": "rapidminer/rapidminer-studio",
"path": "src/main/java/com/rapidminer/operator/preprocessing/transformation/aggregation/AggregationOperator.java",
"license": "agpl-3.0",
"size": 34055
} | [
"com.rapidminer.example.Example"
] | import com.rapidminer.example.Example; | import com.rapidminer.example.*; | [
"com.rapidminer.example"
] | com.rapidminer.example; | 1,924,544 |
String getMessage(String code, Map<String, Object> args, Locale locale) throws NoSuchMessageException; | String getMessage(String code, Map<String, Object> args, Locale locale) throws NoSuchMessageException; | /**
* Try to resolve the message. Treat as an error if the message can't be found.
* @param code the code to lookup up, such as 'calculator.noRateSet'
* @param args Map of arguments that will be filled in for params within
* the message (params look like "{name}", "{birthday,date}", "{meeting,time}" within a message),
* or {@code null} if none.
* @param locale the Locale in which to do the lookup
* @return the resolved message
* @throws org.springframework.context.NoSuchMessageException if the message wasn't found
* @see java.text.MessageFormat
*/ | Try to resolve the message. Treat as an error if the message can't be found | getMessage | {
"repo_name": "LZaruba/icu4j-spring-vaadin",
"path": "icu4j-spring-vaadin/src/main/java/com/devtrigger/grails/icu/ICUMessageSource.java",
"license": "apache-2.0",
"size": 2739
} | [
"java.util.Locale",
"java.util.Map",
"org.springframework.context.NoSuchMessageException"
] | import java.util.Locale; import java.util.Map; import org.springframework.context.NoSuchMessageException; | import java.util.*; import org.springframework.context.*; | [
"java.util",
"org.springframework.context"
] | java.util; org.springframework.context; | 2,703,961 |
public List<TreeNode<E>> postOrderTraversal();
| List<TreeNode<E>> function(); | /**
* Performs a post-order traversal of this node and its descendants.
* @return a List containing this node and its descendants,
* in post-order traversal order.
*/ | Performs a post-order traversal of this node and its descendants | postOrderTraversal | {
"repo_name": "Herta2006/java-programming",
"path": "Tree/src/TreeNode.java",
"license": "mit",
"size": 3477
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 861,392 |
public static Generator<Vector3D> createNormal()
{
return new Vector3DGenerator(PrimitiveGenerators.doubles(
GeneratorConstants.BOUND_NORMAL_DOUBLE_LOWER,
GeneratorConstants.BOUND_NORMAL_DOUBLE_UPPER
));
} | static Generator<Vector3D> function() { return new Vector3DGenerator(PrimitiveGenerators.doubles( GeneratorConstants.BOUND_NORMAL_DOUBLE_LOWER, GeneratorConstants.BOUND_NORMAL_DOUBLE_UPPER )); } | /**
* Create a generator initialized with a default component generator that
* produces values in the range {@code [-1.0, 1.0]}.
*
* @return A generator
*/ | Create a generator initialized with a default component generator that produces values in the range [-1.0, 1.0] | createNormal | {
"repo_name": "io7m/jtensors",
"path": "com.io7m.jtensors.generators/src/main/java/com/io7m/jtensors/generators/Vector3DGenerator.java",
"license": "isc",
"size": 2723
} | [
"com.io7m.jtensors.core.unparameterized.vectors.Vector3D",
"net.java.quickcheck.Generator",
"net.java.quickcheck.generator.PrimitiveGenerators"
] | import com.io7m.jtensors.core.unparameterized.vectors.Vector3D; import net.java.quickcheck.Generator; import net.java.quickcheck.generator.PrimitiveGenerators; | import com.io7m.jtensors.core.unparameterized.vectors.*; import net.java.quickcheck.*; import net.java.quickcheck.generator.*; | [
"com.io7m.jtensors",
"net.java.quickcheck"
] | com.io7m.jtensors; net.java.quickcheck; | 741,873 |
public JTextField getFolderUri() {
return this.folderUri;
} | JTextField function() { return this.folderUri; } | /**
* Getter for <code>folderUri</code>.
*
* @return Returns the folderUri.
*/ | Getter for <code>folderUri</code> | getFolderUri | {
"repo_name": "dvorka/mindraider",
"path": "mr7/src/main/java/com/emental/mindraider/ui/dialogs/NewFolderJDialog.java",
"license": "apache-2.0",
"size": 7278
} | [
"javax.swing.JTextField"
] | import javax.swing.JTextField; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 1,369,818 |
@Override
public boolean comparePassword(String hash, String password,
String playerName) throws NoSuchAlgorithmException {
String[] line = hash.split("\\$");
return hash.equals(getHash(password, line[2], ""));
} | boolean function(String hash, String password, String playerName) throws NoSuchAlgorithmException { String[] line = hash.split("\\$"); return hash.equals(getHash(password, line[2], "")); } | /**
* Method comparePassword.
*
* @param hash String
* @param password String
* @param playerName String
*
* @return boolean * @throws NoSuchAlgorithmException * @see fr.xephi.authme.security.crypts.EncryptionMethod#comparePassword(String, String, String)
*/ | Method comparePassword | comparePassword | {
"repo_name": "sgdc3/AuthMeReloaded",
"path": "src/main/java/fr/xephi/authme/security/crypts/MD5VB.java",
"license": "gpl-3.0",
"size": 1785
} | [
"java.security.NoSuchAlgorithmException"
] | import java.security.NoSuchAlgorithmException; | import java.security.*; | [
"java.security"
] | java.security; | 1,686,509 |
public static DiskAggregatedListOption pageToken(String pageToken) {
return new DiskAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken);
}
}
class SubnetworkOption extends Option {
private static final long serialVersionUID = 1994416967962074717L;
private SubnetworkOption(ComputeRpc.Option option, Object value) {
super(option, value);
}
/**
* Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this
* option is not provided, all subnetwork's fields are returned. {@code SubnetworkOption.fields} | static DiskAggregatedListOption function(String pageToken) { return new DiskAggregatedListOption(ComputeRpc.Option.PAGE_TOKEN, pageToken); } } class SubnetworkOption extends Option { private static final long serialVersionUID = 1994416967962074717L; private SubnetworkOption(ComputeRpc.Option option, Object value) { super(option, value); } /** * Returns an option to specify the subnetwork's fields to be returned by the RPC call. If this * option is not provided, all subnetwork's fields are returned. {@code SubnetworkOption.fields} | /**
* Returns an option to specify the page token from which to start listing disks.
*/ | Returns an option to specify the page token from which to start listing disks | pageToken | {
"repo_name": "jabubake/google-cloud-java",
"path": "google-cloud-compute/src/main/java/com/google/cloud/compute/Compute.java",
"license": "apache-2.0",
"size": 93984
} | [
"com.google.cloud.compute.spi.ComputeRpc"
] | import com.google.cloud.compute.spi.ComputeRpc; | import com.google.cloud.compute.spi.*; | [
"com.google.cloud"
] | com.google.cloud; | 2,569,197 |
public static String checkLong(EventType type, String longFieldName)
{
Class clazz = getClass(type, longFieldName);
if (clazz == null)
{
return "Parent view does not contain a field named '" + longFieldName + '\'';
}
if ((clazz != Long.class) && (clazz != long.class))
{
return "Parent view field named '" + longFieldName + "' is not of type long";
}
return checkFieldNumeric(type, longFieldName);
} | static String function(EventType type, String longFieldName) { Class clazz = getClass(type, longFieldName); if (clazz == null) { return STR + longFieldName + '\''; } if ((clazz != Long.class) && (clazz != long.class)) { return STR + longFieldName + STR; } return checkFieldNumeric(type, longFieldName); } | /**
* Check if the field identified by the field name is of type long according to the schema.
* @param type contains metadata about fields
* @param longFieldName is the field's field name to test
* @return a String error message if the field doesn't exist or is not a long, or null to indicate success
*/ | Check if the field identified by the field name is of type long according to the schema | checkLong | {
"repo_name": "georgenicoll/esper",
"path": "esper/src/main/java/com/espertech/esper/view/PropertyCheckHelper.java",
"license": "gpl-2.0",
"size": 5455
} | [
"com.espertech.esper.client.EventType"
] | import com.espertech.esper.client.EventType; | import com.espertech.esper.client.*; | [
"com.espertech.esper"
] | com.espertech.esper; | 2,554,152 |
@SuppressWarnings("JavadocReference")
public static void startBackgroundIsolate(long callbackHandle, FlutterShellArgs shellArgs) {
if (flutterBackgroundExecutor != null) {
Log.w(TAG, "Attempted to start a duplicate background isolate. Returning...");
return;
}
flutterBackgroundExecutor = new FlutterFirebaseMessagingBackgroundExecutor();
flutterBackgroundExecutor.startBackgroundIsolate(callbackHandle, shellArgs);
} | @SuppressWarnings(STR) static void function(long callbackHandle, FlutterShellArgs shellArgs) { if (flutterBackgroundExecutor != null) { Log.w(TAG, STR); return; } flutterBackgroundExecutor = new FlutterFirebaseMessagingBackgroundExecutor(); flutterBackgroundExecutor.startBackgroundIsolate(callbackHandle, shellArgs); } | /**
* Starts the background isolate for the {@link FlutterFirebaseMessagingBackgroundService}.
*
* <p>Preconditions:
*
* <ul>
* <li>The given {@code callbackHandle} must correspond to a registered Dart callback. If the
* handle does not resolve to a Dart callback then this method does nothing.
* <li>A static {@link #pluginRegistrantCallback} must exist, otherwise a {@link
* PluginRegistrantException} will be thrown.
* </ul>
*/ | Starts the background isolate for the <code>FlutterFirebaseMessagingBackgroundService</code>. Preconditions: The given callbackHandle must correspond to a registered Dart callback. If the handle does not resolve to a Dart callback then this method does nothing. A static <code>#pluginRegistrantCallback</code> must exist, otherwise a <code>PluginRegistrantException</code> will be thrown. | startBackgroundIsolate | {
"repo_name": "FirebaseExtended/flutterfire",
"path": "packages/firebase_messaging/firebase_messaging/android/src/main/java/io/flutter/plugins/firebase/messaging/FlutterFirebaseMessagingBackgroundService.java",
"license": "bsd-3-clause",
"size": 5938
} | [
"android.util.Log",
"io.flutter.embedding.engine.FlutterShellArgs"
] | import android.util.Log; import io.flutter.embedding.engine.FlutterShellArgs; | import android.util.*; import io.flutter.embedding.engine.*; | [
"android.util",
"io.flutter.embedding"
] | android.util; io.flutter.embedding; | 1,154,222 |
void beforeCommand(CommandEnvironment env, CommonCommandOptions options)
throws AbruptExitException {
if (options.memoryProfilePath != null) {
Path memoryProfilePath = env.getWorkingDirectory().getRelative(options.memoryProfilePath);
MemoryProfiler.instance()
.setStableMemoryParameters(options.memoryProfileStableHeapParameters);
try {
MemoryProfiler.instance().start(memoryProfilePath.getOutputStream());
} catch (IOException e) {
env.getReporter().handle(
Event.error("Error while creating memory profile file: " + e.getMessage()));
}
}
// Initialize exit code to dummy value for afterCommand.
storedExitCode.set(ExitCode.RESERVED);
} | void beforeCommand(CommandEnvironment env, CommonCommandOptions options) throws AbruptExitException { if (options.memoryProfilePath != null) { Path memoryProfilePath = env.getWorkingDirectory().getRelative(options.memoryProfilePath); MemoryProfiler.instance() .setStableMemoryParameters(options.memoryProfileStableHeapParameters); try { MemoryProfiler.instance().start(memoryProfilePath.getOutputStream()); } catch (IOException e) { env.getReporter().handle( Event.error(STR + e.getMessage())); } } storedExitCode.set(ExitCode.RESERVED); } | /**
* Hook method called by the BlazeCommandDispatcher prior to the dispatch of
* each command.
*
* @param options The CommonCommandOptions used by every command.
* @throws AbruptExitException if this command is unsuitable to be run as specified
*/ | Hook method called by the BlazeCommandDispatcher prior to the dispatch of each command | beforeCommand | {
"repo_name": "aehlig/bazel",
"path": "src/main/java/com/google/devtools/build/lib/runtime/BlazeRuntime.java",
"license": "apache-2.0",
"size": 66948
} | [
"com.google.devtools.build.lib.events.Event",
"com.google.devtools.build.lib.profiler.MemoryProfiler",
"com.google.devtools.build.lib.util.AbruptExitException",
"com.google.devtools.build.lib.util.ExitCode",
"com.google.devtools.build.lib.vfs.Path",
"java.io.IOException"
] | import com.google.devtools.build.lib.events.Event; import com.google.devtools.build.lib.profiler.MemoryProfiler; import com.google.devtools.build.lib.util.AbruptExitException; import com.google.devtools.build.lib.util.ExitCode; import com.google.devtools.build.lib.vfs.Path; import java.io.IOException; | import com.google.devtools.build.lib.events.*; import com.google.devtools.build.lib.profiler.*; import com.google.devtools.build.lib.util.*; import com.google.devtools.build.lib.vfs.*; import java.io.*; | [
"com.google.devtools",
"java.io"
] | com.google.devtools; java.io; | 2,419,468 |
public IncreaseAsGroupResponse increaseAsGroup(IncreaseAsGroupRequest request) {
checkNotNull(request, REQUEST_NULL_ERROR_MESSAGE);
if (Strings.isNullOrEmpty(request.getClientToken())) {
request.setClientToken(this.generateClientToken());
}
InternalRequest internalRequest =
this.createRequest(request, HttpMethodName.POST, AS_GROUP, request.getGroupId());
internalRequest.addParameter(AsGroupAction.increase.name(), null);
internalRequest.addParameter(CLIENT_TOKEN, request.getClientToken());
fillPayload(internalRequest, request);
return invokeHttpClient(internalRequest, IncreaseAsGroupResponse.class);
} | IncreaseAsGroupResponse function(IncreaseAsGroupRequest request) { checkNotNull(request, REQUEST_NULL_ERROR_MESSAGE); if (Strings.isNullOrEmpty(request.getClientToken())) { request.setClientToken(this.generateClientToken()); } InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST, AS_GROUP, request.getGroupId()); internalRequest.addParameter(AsGroupAction.increase.name(), null); internalRequest.addParameter(CLIENT_TOKEN, request.getClientToken()); fillPayload(internalRequest, request); return invokeHttpClient(internalRequest, IncreaseAsGroupResponse.class); } | /**
* Add nodes in the specified auto scaling group
*
* @param request The request containing all options for increasing the specified asGroup.
* @return The list of newly added instance IDs and auto scaling group ID
*/ | Add nodes in the specified auto scaling group | increaseAsGroup | {
"repo_name": "baidubce/bce-sdk-java",
"path": "src/main/java/com/baidubce/services/as/AsGroupClient.java",
"license": "apache-2.0",
"size": 13174
} | [
"com.baidubce.http.HttpMethodName",
"com.baidubce.internal.InternalRequest",
"com.baidubce.services.as.model.asgroup.AsGroupAction",
"com.baidubce.services.as.model.asgroup.IncreaseAsGroupRequest",
"com.baidubce.services.as.model.asgroup.IncreaseAsGroupResponse",
"com.google.common.base.Preconditions",
"com.google.common.base.Strings"
] | import com.baidubce.http.HttpMethodName; import com.baidubce.internal.InternalRequest; import com.baidubce.services.as.model.asgroup.AsGroupAction; import com.baidubce.services.as.model.asgroup.IncreaseAsGroupRequest; import com.baidubce.services.as.model.asgroup.IncreaseAsGroupResponse; import com.google.common.base.Preconditions; import com.google.common.base.Strings; | import com.baidubce.http.*; import com.baidubce.internal.*; import com.baidubce.services.as.model.asgroup.*; import com.google.common.base.*; | [
"com.baidubce.http",
"com.baidubce.internal",
"com.baidubce.services",
"com.google.common"
] | com.baidubce.http; com.baidubce.internal; com.baidubce.services; com.google.common; | 1,023,234 |
private void countdownTick() {
//Send a chat message.
if (this.countdownTimeLeft < 10 || (this.countdownTimeLeft % 10) == 0) {
this.chatAll(ChatManager.minigame(
this.minigame,
this.countdownFormat.replace("%timeleft%",
Integer.toString(this.countdownTimeLeft))));
for (Player p : this.getPlayers()) {
p.playSound(p.getLocation(), Sound.WOLF_GROWL, 1F, 1F);
}
}
//If we are using boss bar.
if (this.useBossBar)
this.setBossBarAll(
this.countdownFormat.replace("%timeleft%",
Integer.toString(this.countdownTimeLeft)),
this.countdownTimeLeft / this.countdownLenght * 100F);
//If we reached zero.
if (this.countdownTimeLeft <= 0) {
//Remove bossbar
if (this.useBossBar)
for (Player p : this.activePlayers)
BarAPI.removeBar(p);
//Stop the countdown task.
this.onCountdownStop();
//Start game.
this.chatAll(ChatManager.minigame(
this.getMinigame(),
ChatColor.GREEN + "Map: " + ChatColor.WHITE + this.mapData.getName()
+ ChatColor.WHITE + " by " + ChatColor.RED
+ this.mapData.getAuthor()));
this.onGameStart();
this.gameStarted = true;
}
// Set food level.
for (Player p : this.getPlayers()) {
p.setFoodLevel(20);
}
//Decrement the time.
this.countdownTimeLeft -= 1;
} | void function() { if (this.countdownTimeLeft < 10 (this.countdownTimeLeft % 10) == 0) { this.chatAll(ChatManager.minigame( this.minigame, this.countdownFormat.replace(STR, Integer.toString(this.countdownTimeLeft)))); for (Player p : this.getPlayers()) { p.playSound(p.getLocation(), Sound.WOLF_GROWL, 1F, 1F); } } if (this.useBossBar) this.setBossBarAll( this.countdownFormat.replace(STR, Integer.toString(this.countdownTimeLeft)), this.countdownTimeLeft / this.countdownLenght * 100F); if (this.countdownTimeLeft <= 0) { if (this.useBossBar) for (Player p : this.activePlayers) BarAPI.removeBar(p); this.onCountdownStop(); this.chatAll(ChatManager.minigame( this.getMinigame(), ChatColor.GREEN + STR + ChatColor.WHITE + this.mapData.getName() + ChatColor.WHITE + STR + ChatColor.RED + this.mapData.getAuthor())); this.onGameStart(); this.gameStarted = true; } for (Player p : this.getPlayers()) { p.setFoodLevel(20); } this.countdownTimeLeft -= 1; } | /**
* Called once per second while countdown is running.
*/ | Called once per second while countdown is running | countdownTick | {
"repo_name": "dobrakmato/PexelCore",
"path": "src/eu/matejkormuth/pexel/PexelCore/arenas/AdvancedArena.java",
"license": "gpl-3.0",
"size": 17933
} | [
"eu.matejkormuth.pexel.PexelCore",
"me.confuser.barapi.BarAPI",
"org.bukkit.ChatColor",
"org.bukkit.Sound",
"org.bukkit.entity.Player"
] | import eu.matejkormuth.pexel.PexelCore; import me.confuser.barapi.BarAPI; import org.bukkit.ChatColor; import org.bukkit.Sound; import org.bukkit.entity.Player; | import eu.matejkormuth.pexel.*; import me.confuser.barapi.*; import org.bukkit.*; import org.bukkit.entity.*; | [
"eu.matejkormuth.pexel",
"me.confuser.barapi",
"org.bukkit",
"org.bukkit.entity"
] | eu.matejkormuth.pexel; me.confuser.barapi; org.bukkit; org.bukkit.entity; | 972,064 |
void updateBeans(Collection<T> beans, BiPredicate<T, T> isEqual); | void updateBeans(Collection<T> beans, BiPredicate<T, T> isEqual); | /**
* Update existing rows and add missing rows to the table model.
* @param beans beans to update/append
* @param isEqual used to determine if a row is already in the model
*/ | Update existing rows and add missing rows to the table model | updateBeans | {
"repo_name": "jonestimd/swing-extensions",
"path": "src/main/java/io/github/jonestimd/swing/table/model/BeanTableModel.java",
"license": "mit",
"size": 2982
} | [
"java.util.Collection",
"java.util.function.BiPredicate"
] | import java.util.Collection; import java.util.function.BiPredicate; | import java.util.*; import java.util.function.*; | [
"java.util"
] | java.util; | 2,242,549 |
private boolean isSystemPackage(PackageInfo packageInfo) {
return ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0);
} | boolean function(PackageInfo packageInfo) { return ((packageInfo.applicationInfo.flags & ApplicationInfo.FLAG_SYSTEM) != 0); } | /**
* Returns whether the app is a system app.
* @param packageInfo - Package of the app which you need the status.
* @return - App status.
*/ | Returns whether the app is a system app | isSystemPackage | {
"repo_name": "pasindujw/product-emm",
"path": "modules/mobile-agents/android/client/client/src/main/java/org/wso2/emm/agent/api/ApplicationManager.java",
"license": "apache-2.0",
"size": 10453
} | [
"android.content.pm.ApplicationInfo",
"android.content.pm.PackageInfo"
] | import android.content.pm.ApplicationInfo; import android.content.pm.PackageInfo; | import android.content.pm.*; | [
"android.content"
] | android.content; | 1,459,241 |
public final void actionPerformed(final java.awt.event.ActionEvent p1)
{
if (amRunning)
{
MWC.Utilities.Errors.Trace.trace("Hey, we're busy!");
return;
}
// indicate that we are busy
amRunning = true;
try
{
// get the name of the control
boolean fwd = true;
boolean large = true;
final JButton b = (JButton) p1.getSource();
// first sort out which set it is
if ((b == _startBtn) || (b == _endBtn))
{
if (b == _startBtn)
{
super.gotoStart();
}
else
super.gotoEnd();
}
else
{
if (b == _largeBwd)
{
fwd = false;
large = true;
}
if (b == _smallBwd)
{
fwd = false;
large = false;
}
if (b == _smallFwd)
{
fwd = true;
large = false;
}
if (b == _largeFwd)
{
fwd = true;
large = true;
}
_goingForward = fwd;
_largeSteps = large;
super.doStep(fwd, large);
}
}
catch (final Exception e)
{
MWC.Utilities.Errors.Trace.trace(e);
}
amRunning = false;
}
| final void function(final java.awt.event.ActionEvent p1) { if (amRunning) { MWC.Utilities.Errors.Trace.trace(STR); return; } amRunning = true; try { boolean fwd = true; boolean large = true; final JButton b = (JButton) p1.getSource(); if ((b == _startBtn) (b == _endBtn)) { if (b == _startBtn) { super.gotoStart(); } else super.gotoEnd(); } else { if (b == _largeBwd) { fwd = false; large = true; } if (b == _smallBwd) { fwd = false; large = false; } if (b == _smallFwd) { fwd = true; large = false; } if (b == _largeFwd) { fwd = true; large = true; } _goingForward = fwd; _largeSteps = large; super.doStep(fwd, large); } } catch (final Exception e) { MWC.Utilities.Errors.Trace.trace(e); } amRunning = false; } | /**
* one of our edit buttons has been pressed
*/ | one of our edit buttons has been pressed | actionPerformed | {
"repo_name": "pecko/debrief",
"path": "org.mwc.debrief.legacy/src/Debrief/GUI/Tote/Swing/SwingStepControl.java",
"license": "epl-1.0",
"size": 36160
} | [
"java.awt.event.ActionEvent",
"javax.swing.JButton"
] | import java.awt.event.ActionEvent; import javax.swing.JButton; | import java.awt.event.*; import javax.swing.*; | [
"java.awt",
"javax.swing"
] | java.awt; javax.swing; | 549,291 |
@Override
protected void onPreExecute() {
super.onPreExecute();
pDialog = new ProgressDialog(LoginActivity.this);
pDialog.setMessage("Signing You in..");
pDialog.setIndeterminate(false);
pDialog.setCancelable(false);
pDialog.show();
} | void function() { super.onPreExecute(); pDialog = new ProgressDialog(LoginActivity.this); pDialog.setMessage(STR); pDialog.setIndeterminate(false); pDialog.setCancelable(false); pDialog.show(); } | /**
* Before starting background thread Show Progress Dialog
* */ | Before starting background thread Show Progress Dialog | onPreExecute | {
"repo_name": "AbanoubAmgad/Er3-y-Android-Messenger",
"path": "src/com/example/erghy/LoginActivity.java",
"license": "gpl-2.0",
"size": 4105
} | [
"android.app.ProgressDialog"
] | import android.app.ProgressDialog; | import android.app.*; | [
"android.app"
] | android.app; | 626,165 |
public void onSyncMessage(XWalkExtension extension, String message) {
extension.onSyncMessage(message);
} | void function(XWalkExtension extension, String message) { extension.onSyncMessage(message); } | /**
* Pass synchronized messages.
*/ | Pass synchronized messages | onSyncMessage | {
"repo_name": "Shouqun/crosswalk",
"path": "runtime/android/java/src/org/xwalk/runtime/XWalkRuntimeViewProvider.java",
"license": "bsd-3-clause",
"size": 3010
} | [
"org.xwalk.runtime.extension.XWalkExtension"
] | import org.xwalk.runtime.extension.XWalkExtension; | import org.xwalk.runtime.extension.*; | [
"org.xwalk.runtime"
] | org.xwalk.runtime; | 1,750,874 |
public void testGetAllType() {
final ObjectId oid = ObjectId.of("cfg", "1");
final VersionCorrection version = VersionCorrection.ofVersionAsOf(Instant.ofEpochSecond(10000));
final String value1 = "config item 1";
final String value2 = "config item 2";
final String value3 = "config item 3";
final ConfigItem<?> item1 = new ConfigItem<>(value1);
final ConfigItem<?> item2 = new ConfigItem<>(value2);
final ConfigItem<?> item3 = new ConfigItem<>(value3);
item1.setType(String.class);
item2.setType(String.class);
item3.setType(String.class);
final DummyConfigWebResource resource = new DummyConfigWebResource();
resource.addData(oid, version, item1);
resource.addData(oid, version, item2);
resource.addData(oid, version, item3);
final RemoteConfigSource configSource = new DummyRemoteSource<>(_baseUri, resource);
assertEqualsNoOrder(configSource.getAll(String.class, version), Arrays.asList(item1, item2, item3));
}
private static class DummyRemoteSource<TYPE> extends RemoteConfigSource {
private final DummyWebResource<TYPE> _resource;
public DummyRemoteSource(final URI baseUri, final DummyWebResource<TYPE> resource) {
super(baseUri);
_resource = resource;
}
public DummyRemoteSource(final URI baseUri, final ChangeManager changeManager, final DummyWebResource<TYPE> resource) {
super(baseUri, changeManager);
_resource = resource;
} | void function() { final ObjectId oid = ObjectId.of("cfg", "1"); final VersionCorrection version = VersionCorrection.ofVersionAsOf(Instant.ofEpochSecond(10000)); final String value1 = STR; final String value2 = STR; final String value3 = STR; final ConfigItem<?> item1 = new ConfigItem<>(value1); final ConfigItem<?> item2 = new ConfigItem<>(value2); final ConfigItem<?> item3 = new ConfigItem<>(value3); item1.setType(String.class); item2.setType(String.class); item3.setType(String.class); final DummyConfigWebResource resource = new DummyConfigWebResource(); resource.addData(oid, version, item1); resource.addData(oid, version, item2); resource.addData(oid, version, item3); final RemoteConfigSource configSource = new DummyRemoteSource<>(_baseUri, resource); assertEqualsNoOrder(configSource.getAll(String.class, version), Arrays.asList(item1, item2, item3)); } private static class DummyRemoteSource<TYPE> extends RemoteConfigSource { private final DummyWebResource<TYPE> _resource; public DummyRemoteSource(final URI baseUri, final DummyWebResource<TYPE> resource) { super(baseUri); _resource = resource; } public DummyRemoteSource(final URI baseUri, final ChangeManager changeManager, final DummyWebResource<TYPE> resource) { super(baseUri, changeManager); _resource = resource; } | /**
* Tests getting all configs of a type.
*/ | Tests getting all configs of a type | testGetAllType | {
"repo_name": "McLeodMoores/starling",
"path": "projects/core-rest-client/src/test/java/com/opengamma/core/config/impl/RemoteConfigSourceTest.java",
"license": "apache-2.0",
"size": 15760
} | [
"com.opengamma.core.DummyWebResource",
"com.opengamma.core.change.ChangeManager",
"com.opengamma.id.ObjectId",
"com.opengamma.id.VersionCorrection",
"com.opengamma.test.Assert",
"java.util.Arrays",
"org.threeten.bp.Instant"
] | import com.opengamma.core.DummyWebResource; import com.opengamma.core.change.ChangeManager; import com.opengamma.id.ObjectId; import com.opengamma.id.VersionCorrection; import com.opengamma.test.Assert; import java.util.Arrays; import org.threeten.bp.Instant; | import com.opengamma.core.*; import com.opengamma.core.change.*; import com.opengamma.id.*; import com.opengamma.test.*; import java.util.*; import org.threeten.bp.*; | [
"com.opengamma.core",
"com.opengamma.id",
"com.opengamma.test",
"java.util",
"org.threeten.bp"
] | com.opengamma.core; com.opengamma.id; com.opengamma.test; java.util; org.threeten.bp; | 638,441 |
private Node tryFoldStandardConstructors(Node n) {
Preconditions.checkState(n.isNew());
if (canFoldStandardConstructors(n)) {
n.setType(Token.CALL);
n.putBooleanProp(Node.FREE_CALL, true);
reportCodeChange();
}
return n;
} | Node function(Node n) { Preconditions.checkState(n.isNew()); if (canFoldStandardConstructors(n)) { n.setType(Token.CALL); n.putBooleanProp(Node.FREE_CALL, true); reportCodeChange(); } return n; } | /**
* Fold "new Object()" to "Object()".
*/ | Fold "new Object()" to "Object()" | tryFoldStandardConstructors | {
"repo_name": "superkonduktr/closure-compiler",
"path": "src/com/google/javascript/jscomp/PeepholeSubstituteAlternateSyntax.java",
"license": "apache-2.0",
"size": 26062
} | [
"com.google.common.base.Preconditions",
"com.google.javascript.rhino.Node",
"com.google.javascript.rhino.Token"
] | import com.google.common.base.Preconditions; import com.google.javascript.rhino.Node; import com.google.javascript.rhino.Token; | import com.google.common.base.*; import com.google.javascript.rhino.*; | [
"com.google.common",
"com.google.javascript"
] | com.google.common; com.google.javascript; | 281,028 |
public static Properties getProperties(String resource, Locale locale) {
if (UtilValidate.isEmpty(resource)) {
throw new IllegalArgumentException("resource cannot be null or empty");
}
if (locale == null) {
throw new IllegalArgumentException("locale cannot be null");
}
Properties properties = null;
URL url = resolvePropertiesUrl(resource, locale);
if (url != null) {
try {
properties = new ExtendedProperties(url, locale);
} catch (Exception e) {
if (UtilValidate.isNotEmpty(e.getMessage())) {
Debug.logInfo(e.getMessage(), module);
} else {
Debug.logInfo("Exception thrown: " + e.getClass().getName(), module);
}
properties = null;
}
}
if (UtilValidate.isNotEmpty(properties)) {
if (Debug.verboseOn()) Debug.logVerbose("Loaded " + properties.size() + " properties for: " + resource + " (" + locale + ")", module);
}
return properties;
}
// ========= Classes and Methods for expanded Properties file support ========== //
// Private lazy-initializer class
private static class FallbackLocaleHolder {
private static final Locale fallbackLocale = getFallbackLocale(); | static Properties function(String resource, Locale locale) { if (UtilValidate.isEmpty(resource)) { throw new IllegalArgumentException(STR); } if (locale == null) { throw new IllegalArgumentException(STR); } Properties properties = null; URL url = resolvePropertiesUrl(resource, locale); if (url != null) { try { properties = new ExtendedProperties(url, locale); } catch (Exception e) { if (UtilValidate.isNotEmpty(e.getMessage())) { Debug.logInfo(e.getMessage(), module); } else { Debug.logInfo(STR + e.getClass().getName(), module); } properties = null; } } if (UtilValidate.isNotEmpty(properties)) { if (Debug.verboseOn()) Debug.logVerbose(STR + properties.size() + STR + resource + STR + locale + ")", module); } return properties; } private static class FallbackLocaleHolder { private static final Locale fallbackLocale = getFallbackLocale(); | /** Returns the specified resource/properties file.<p>Note that this method
* will return a Properties instance for the specified locale <em>only</em> -
* if you need <a href="http://www.w3.org/International/">I18n</a> properties, then use
* <a href="#getResourceBundle(java.lang.String,%20java.util.Locale)">
* getResourceBundle(String resource, Locale locale)</a>. This method is
* intended to be used primarily by the UtilProperties class.</p>
* @param resource The name of the resource - can be a file, class, or URL
* @param locale The desired locale
* @return The Properties instance, or null if no matching properties are found
*/ | Returns the specified resource/properties file.Note that this method will return a Properties instance for the specified locale only - if you need I18n properties, then use getResourceBundle(String resource, Locale locale). This method is intended to be used primarily by the UtilProperties class | getProperties | {
"repo_name": "ofbizfriends/vogue",
"path": "framework/base/src/org/ofbiz/base/util/UtilProperties.java",
"license": "apache-2.0",
"size": 55227
} | [
"java.util.Locale",
"java.util.Properties"
] | import java.util.Locale; import java.util.Properties; | import java.util.*; | [
"java.util"
] | java.util; | 1,924,740 |
@Test
public void setLnVLTest(){
Data data = new Data();
data.setLnVL(12.0);
assertEquals(12.0, data.getLnVL(), 0.0);
}
| void function(){ Data data = new Data(); data.setLnVL(12.0); assertEquals(12.0, data.getLnVL(), 0.0); } | /**
* Method to test the method setLnVL.
*/ | Method to test the method setLnVL | setLnVLTest | {
"repo_name": "jhmesa/psp2-program-4",
"path": "src/test/java/co/edu/uniandes/ecos/csof5101/psp2/test/DataTest.java",
"license": "gpl-3.0",
"size": 3550
} | [
"co.edu.uniandes.ecos.csof5101.psp2.model.Data",
"org.junit.Assert"
] | import co.edu.uniandes.ecos.csof5101.psp2.model.Data; import org.junit.Assert; | import co.edu.uniandes.ecos.csof5101.psp2.model.*; import org.junit.*; | [
"co.edu.uniandes",
"org.junit"
] | co.edu.uniandes; org.junit; | 2,112,862 |
private boolean upstreamModuleHasPartitionInfo(StreamDefinition stream, ModuleDefinition currentModule,
Map<String, String> streamDeploymentProperties) {
Iterator<ModuleDefinition> iterator = stream.getDeploymentOrderIterator();
while (iterator.hasNext()) {
ModuleDefinition module = iterator.next();
if (module.equals(currentModule) && iterator.hasNext()) {
ModuleDefinition prevModule = iterator.next();
Map<String, String> moduleDeploymentProperties = extractModuleDeploymentProperties(prevModule, streamDeploymentProperties);
return moduleDeploymentProperties.containsKey(BindingPropertyKeys.OUTPUT_PARTITION_KEY_EXPRESSION) ||
moduleDeploymentProperties.containsKey(BindingPropertyKeys.OUTPUT_PARTITION_KEY_EXTRACTOR_CLASS);
}
}
return false;
} | boolean function(StreamDefinition stream, ModuleDefinition currentModule, Map<String, String> streamDeploymentProperties) { Iterator<ModuleDefinition> iterator = stream.getDeploymentOrderIterator(); while (iterator.hasNext()) { ModuleDefinition module = iterator.next(); if (module.equals(currentModule) && iterator.hasNext()) { ModuleDefinition prevModule = iterator.next(); Map<String, String> moduleDeploymentProperties = extractModuleDeploymentProperties(prevModule, streamDeploymentProperties); return moduleDeploymentProperties.containsKey(BindingPropertyKeys.OUTPUT_PARTITION_KEY_EXPRESSION) moduleDeploymentProperties.containsKey(BindingPropertyKeys.OUTPUT_PARTITION_KEY_EXTRACTOR_CLASS); } } return false; } | /**
* Return {@code true} if the upstream module (the module that appears before
* the provided module) contains partition related properties.
*
* @param stream stream for the module
* @param currentModule module for which to determine if the upstream module
* has partition properties
* @param streamDeploymentProperties deployment properties for the stream
* @return true if the upstream module has partition properties
*/ | Return true if the upstream module (the module that appears before the provided module) contains partition related properties | upstreamModuleHasPartitionInfo | {
"repo_name": "pperalta/spring-cloud-dataflow",
"path": "spring-cloud-dataflow-server-core/src/main/java/org/springframework/cloud/dataflow/server/controller/StreamDeploymentController.java",
"license": "apache-2.0",
"size": 16537
} | [
"java.util.Iterator",
"java.util.Map",
"org.springframework.cloud.dataflow.core.BindingPropertyKeys",
"org.springframework.cloud.dataflow.core.ModuleDefinition",
"org.springframework.cloud.dataflow.core.StreamDefinition"
] | import java.util.Iterator; import java.util.Map; import org.springframework.cloud.dataflow.core.BindingPropertyKeys; import org.springframework.cloud.dataflow.core.ModuleDefinition; import org.springframework.cloud.dataflow.core.StreamDefinition; | import java.util.*; import org.springframework.cloud.dataflow.core.*; | [
"java.util",
"org.springframework.cloud"
] | java.util; org.springframework.cloud; | 1,890,612 |
public long getAnnotationTagBits() {
MethodBinding originalMethod = original();
if ((originalMethod.tagBits & TagBits.AnnotationResolved) == 0 && originalMethod.declaringClass instanceof SourceTypeBinding) {
ClassScope scope = ((SourceTypeBinding) originalMethod.declaringClass).scope;
if (scope != null) {
TypeDeclaration typeDecl = scope.referenceContext;
AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(originalMethod);
if (methodDecl != null)
ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod);
CompilerOptions options = scope.compilerOptions();
if (options.isAnnotationBasedNullAnalysisEnabled) {
boolean isJdk18 = options.sourceLevel >= ClassFileConstants.JDK1_8;
long nullDefaultBits = isJdk18 ? this.defaultNullness
: this.tagBits & (TagBits.AnnotationNonNullByDefault|TagBits.AnnotationNullUnspecifiedByDefault);
if (nullDefaultBits != 0 && this.declaringClass instanceof SourceTypeBinding) {
SourceTypeBinding declaringSourceType = (SourceTypeBinding) this.declaringClass;
if (declaringSourceType.checkRedundantNullnessDefaultOne(methodDecl, methodDecl.annotations, nullDefaultBits, isJdk18)) {
declaringSourceType.checkRedundantNullnessDefaultRecurse(methodDecl, methodDecl.annotations, nullDefaultBits, isJdk18);
}
}
}
}
}
return originalMethod.tagBits;
} | long function() { MethodBinding originalMethod = original(); if ((originalMethod.tagBits & TagBits.AnnotationResolved) == 0 && originalMethod.declaringClass instanceof SourceTypeBinding) { ClassScope scope = ((SourceTypeBinding) originalMethod.declaringClass).scope; if (scope != null) { TypeDeclaration typeDecl = scope.referenceContext; AbstractMethodDeclaration methodDecl = typeDecl.declarationOf(originalMethod); if (methodDecl != null) ASTNode.resolveAnnotations(methodDecl.scope, methodDecl.annotations, originalMethod); CompilerOptions options = scope.compilerOptions(); if (options.isAnnotationBasedNullAnalysisEnabled) { boolean isJdk18 = options.sourceLevel >= ClassFileConstants.JDK1_8; long nullDefaultBits = isJdk18 ? this.defaultNullness : this.tagBits & (TagBits.AnnotationNonNullByDefault TagBits.AnnotationNullUnspecifiedByDefault); if (nullDefaultBits != 0 && this.declaringClass instanceof SourceTypeBinding) { SourceTypeBinding declaringSourceType = (SourceTypeBinding) this.declaringClass; if (declaringSourceType.checkRedundantNullnessDefaultOne(methodDecl, methodDecl.annotations, nullDefaultBits, isJdk18)) { declaringSourceType.checkRedundantNullnessDefaultRecurse(methodDecl, methodDecl.annotations, nullDefaultBits, isJdk18); } } } } } return originalMethod.tagBits; } | /**
* Compute the tagbits for standard annotations. For source types, these could require
* lazily resolving corresponding annotation nodes, in case of forward references.
* @see org.eclipse.jdt.internal.compiler.lookup.Binding#getAnnotationTagBits()
*/ | Compute the tagbits for standard annotations. For source types, these could require lazily resolving corresponding annotation nodes, in case of forward references | getAnnotationTagBits | {
"repo_name": "trylimits/Eclipse-Postfix-Code-Completion",
"path": "luna/org.eclipse.jdt.core/compiler/org/eclipse/jdt/internal/compiler/lookup/MethodBinding.java",
"license": "epl-1.0",
"size": 50773
} | [
"org.eclipse.jdt.internal.compiler.ast.ASTNode",
"org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration",
"org.eclipse.jdt.internal.compiler.ast.TypeDeclaration",
"org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants",
"org.eclipse.jdt.internal.compiler.impl.CompilerOptions"
] | import org.eclipse.jdt.internal.compiler.ast.ASTNode; import org.eclipse.jdt.internal.compiler.ast.AbstractMethodDeclaration; import org.eclipse.jdt.internal.compiler.ast.TypeDeclaration; import org.eclipse.jdt.internal.compiler.classfmt.ClassFileConstants; import org.eclipse.jdt.internal.compiler.impl.CompilerOptions; | import org.eclipse.jdt.internal.compiler.ast.*; import org.eclipse.jdt.internal.compiler.classfmt.*; import org.eclipse.jdt.internal.compiler.impl.*; | [
"org.eclipse.jdt"
] | org.eclipse.jdt; | 796,861 |
@Deprecated
public static void notifyOnAllConnections(IScope scope, String method, Object[] params) {
notifyOnAllScopeConnections(scope, method, params);
}
| static void function(IScope scope, String method, Object[] params) { notifyOnAllScopeConnections(scope, method, params); } | /**
* Notify a method on all connections to a given scope.
*
* @param scope
* scope to get connections for
* @param method
* name of the method to notify
* @param params
* parameters to pass to the method
* @deprecated Use {@link ServiceUtils#notifyOnAllScopeConnections(IScope, String, Object[])} instead
*/ | Notify a method on all connections to a given scope | notifyOnAllConnections | {
"repo_name": "tdj-br/red5-server",
"path": "src/main/java/org/red5/server/api/service/ServiceUtils.java",
"license": "apache-2.0",
"size": 14222
} | [
"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; | 867,165 |
public Map<String, DroneBlueprint> getDrones() {
return getDrones( dlcEnabledByDefault );
} | Map<String, DroneBlueprint> function() { return getDrones( dlcEnabledByDefault ); } | /**
* A frontend using the global DLC default.
*/ | A frontend using the global DLC default | getDrones | {
"repo_name": "Vhati/ftl-profile-editor",
"path": "src/main/java/net/blerf/ftl/parser/DataManager.java",
"license": "gpl-2.0",
"size": 9772
} | [
"java.util.Map",
"net.blerf.ftl.xml.DroneBlueprint"
] | import java.util.Map; import net.blerf.ftl.xml.DroneBlueprint; | import java.util.*; import net.blerf.ftl.xml.*; | [
"java.util",
"net.blerf.ftl"
] | java.util; net.blerf.ftl; | 2,378,279 |
public SceneGraphObject getSceneGraphObject() {
return null;
} | SceneGraphObject function() { return null; } | /**
* Get the OpenGL scene graph object representation of this node. This will
* need to be cast to the appropriate parent type when being used. Default
* implementation returns null.
*
* @return The OpenGL representation.
*/ | Get the OpenGL scene graph object representation of this node. This will need to be cast to the appropriate parent type when being used. Default implementation returns null | getSceneGraphObject | {
"repo_name": "Norkart/NK-VirtualGlobe",
"path": "Xj3D/src/java/org/web3d/vrml/renderer/mobile/nodes/core/MobileMetadataString.java",
"license": "gpl-2.0",
"size": 2141
} | [
"org.web3d.vrml.renderer.mobile.sg.SceneGraphObject"
] | import org.web3d.vrml.renderer.mobile.sg.SceneGraphObject; | import org.web3d.vrml.renderer.mobile.sg.*; | [
"org.web3d.vrml"
] | org.web3d.vrml; | 2,842,648 |
protected void broadcastLogout(Authentication authentication) {
if( logger.isDebugEnabled() )
logger.debug( "BROADCAST logout: token=" + authentication );
final Iterator iter = getBeansToUpdate( LoginAware.class ).iterator();
while( iter.hasNext() ) {
((LoginAware) iter.next()).userLogout( authentication );
}
} | void function(Authentication authentication) { if( logger.isDebugEnabled() ) logger.debug( STR + authentication ); final Iterator iter = getBeansToUpdate( LoginAware.class ).iterator(); while( iter.hasNext() ) { ((LoginAware) iter.next()).userLogout( authentication ); } } | /**
* Broadcast a Logout event to all the LoginAware beans.
* @param authentication token
*/ | Broadcast a Logout event to all the LoginAware beans | broadcastLogout | {
"repo_name": "springrichclient/springrcp",
"path": "spring-richclient-core/src/main/java/org/springframework/richclient/security/SecurityAwareConfigurer.java",
"license": "apache-2.0",
"size": 10850
} | [
"java.util.Iterator",
"org.springframework.security.Authentication"
] | import java.util.Iterator; import org.springframework.security.Authentication; | import java.util.*; import org.springframework.security.*; | [
"java.util",
"org.springframework.security"
] | java.util; org.springframework.security; | 703,148 |
public static ExtendedManagedCustomer withOAuth2FromFile() throws OAuthException,
ValidationException, ConfigurationLoadException, NumberFormatException, RemoteException {
return new ExtendedManagedCustomer(AdWordsSessionUtil.fromFileWithOAuth2());
} | static ExtendedManagedCustomer function() throws OAuthException, ValidationException, ConfigurationLoadException, NumberFormatException, RemoteException { return new ExtendedManagedCustomer(AdWordsSessionUtil.fromFileWithOAuth2()); } | /**
* Creates a new ExtendedManagedCustomer using the ads.properties file and using OAuth2.
*
* @return the ExtendedManagedCustomer associated with the file
* @throws OAuthException if problem with OAuth2
* @throws ConfigurationLoadException if problems loading the ad.properties file
* @throws ValidationException if the {@code AdWordsSession} did not validate
* @throws RemoteException for communication-related exceptions
* @throws NumberFormatException for errors in the CustomerId
*/ | Creates a new ExtendedManagedCustomer using the ads.properties file and using OAuth2 | withOAuth2FromFile | {
"repo_name": "raja15792/googleads-java-lib",
"path": "modules/adwords_axis_utility_extension/src/main/java/com/google/api/ads/adwords/axis/utility/extension/ExtendedManagedCustomer.java",
"license": "apache-2.0",
"size": 39864
} | [
"com.google.api.ads.adwords.axis.utility.extension.util.AdWordsSessionUtil",
"com.google.api.ads.common.lib.conf.ConfigurationLoadException",
"com.google.api.ads.common.lib.exception.OAuthException",
"com.google.api.ads.common.lib.exception.ValidationException",
"java.rmi.RemoteException"
] | import com.google.api.ads.adwords.axis.utility.extension.util.AdWordsSessionUtil; import com.google.api.ads.common.lib.conf.ConfigurationLoadException; import com.google.api.ads.common.lib.exception.OAuthException; import com.google.api.ads.common.lib.exception.ValidationException; import java.rmi.RemoteException; | import com.google.api.ads.adwords.axis.utility.extension.util.*; import com.google.api.ads.common.lib.conf.*; import com.google.api.ads.common.lib.exception.*; import java.rmi.*; | [
"com.google.api",
"java.rmi"
] | com.google.api; java.rmi; | 1,423,897 |
public synchronized void setItems(final Map<String, CookieSpecFactory> map) {
if (map == null) {
return;
}
registeredSpecs.clear();
registeredSpecs.putAll(map);
} | synchronized void function(final Map<String, CookieSpecFactory> map) { if (map == null) { return; } registeredSpecs.clear(); registeredSpecs.putAll(map); } | /**
* Populates the internal collection of registered {@link CookieSpec cookie
* specs} with the content of the map passed as a parameter.
*
* @param map cookie specs
*/ | Populates the internal collection of registered <code>CookieSpec cookie specs</code> with the content of the map passed as a parameter | setItems | {
"repo_name": "s20121035/rk3288_android5.1_repo",
"path": "external/apache-http/src/org/apache/http/cookie/CookieSpecRegistry.java",
"license": "gpl-3.0",
"size": 6102
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 708,106 |
public Intent putExtra(String name, String value) {
if (mExtras == null) {
mExtras = new Bundle();
}
mExtras.putString(name, value);
return this;
} | Intent function(String name, String value) { if (mExtras == null) { mExtras = new Bundle(); } mExtras.putString(name, value); return this; } | /**
* Add extended data to the intent. The name must include a package
* prefix, for example the app com.android.contacts would use names
* like "com.android.contacts.ShowAll".
*
* @param name The name of the extra data, with package prefix.
* @param value The String data value.
*
* @return Returns the same Intent object, for chaining multiple calls
* into a single statement.
*
* @see #putExtras
* @see #removeExtra
* @see #getStringExtra(String)
*/ | Add extended data to the intent. The name must include a package prefix, for example the app com.android.contacts would use names like "com.android.contacts.ShowAll" | putExtra | {
"repo_name": "indashnet/InDashNet.Open.UN2000",
"path": "android/frameworks/base/core/java/android/content/Intent.java",
"license": "apache-2.0",
"size": 299722
} | [
"android.os.Bundle"
] | import android.os.Bundle; | import android.os.*; | [
"android.os"
] | android.os; | 981,338 |
protected void fillDatasetEntries2() throws FileNotFoundException {
if (logger.isInfoEnabled()) {
logger.info(
"The 'Entries'-Tag-part of the XML-document at {} will be overridden by the contents of the CSV-file at {}",
this.xmlFileLocation, this.csvFileLocation);
}
// the files should already exist
FileHelper.filesExist(new File(this.csvFileLocation), new File(
this.xmlFileLocation));
// prepare xmlFile and CsvReader
File datasetFile = new File(this.xmlFileLocation);
DatasetDocument dataset = null;
CsvReader csvReader = null;
try {
csvReader = new CsvReader(this.csvFileLocation, this.csvSeperator);
// skip initial lines, that contain metadata
for (int i = 0; i < this.numberOfInitLinesToSkip; i++) {
// note: the method csvReader.skipLine() may not work on any
// csv-file; thus the method readRecord() is used
csvReader.readRecord();
}
// read the headers of each column of the csv file
csvReader.readHeaders();
// create Map from all single entries of the csv-file
Map<String, DatasetEntry> datasetEntries = readEntries(csvReader);
datasetEntries = WorldSharesComputer.computeWorldShares(datasetEntries);
// load existing xmlDocument
dataset = DatasetDocument.Factory.parse(datasetFile);
// create new list of Entries
createNewEntries(dataset, datasetEntries);
// save changes to datasetFile
dataset.save(datasetFile);
if (logger.isInfoEnabled()) {
logger.info(
"Successfully overridden the 'Entries'-Tag-part of the XML-document at {}.",
this.xmlFileLocation);
}
} catch (XmlException e) {
if (logger.isErrorEnabled())
logger.error("An error (XmlException) occured on file {}.",
this.xmlFileLocation, e);
} catch (IOException e) {
if (logger.isErrorEnabled())
logger.error("An error (IOException) occured.", e);
} finally {
if (csvReader != null)
csvReader.close();
}
} | void function() throws FileNotFoundException { if (logger.isInfoEnabled()) { logger.info( STR, this.xmlFileLocation, this.csvFileLocation); } FileHelper.filesExist(new File(this.csvFileLocation), new File( this.xmlFileLocation)); File datasetFile = new File(this.xmlFileLocation); DatasetDocument dataset = null; CsvReader csvReader = null; try { csvReader = new CsvReader(this.csvFileLocation, this.csvSeperator); for (int i = 0; i < this.numberOfInitLinesToSkip; i++) { csvReader.readRecord(); } csvReader.readHeaders(); Map<String, DatasetEntry> datasetEntries = readEntries(csvReader); datasetEntries = WorldSharesComputer.computeWorldShares(datasetEntries); dataset = DatasetDocument.Factory.parse(datasetFile); createNewEntries(dataset, datasetEntries); dataset.save(datasetFile); if (logger.isInfoEnabled()) { logger.info( STR, this.xmlFileLocation); } } catch (XmlException e) { if (logger.isErrorEnabled()) logger.error(STR, this.xmlFileLocation, e); } catch (IOException e) { if (logger.isErrorEnabled()) logger.error(STR, e); } finally { if (csvReader != null) csvReader.close(); } } | /**
* method not intended for real usage! needed for special use case.
* @throws FileNotFoundException
*/ | method not intended for real usage! needed for special use case | fillDatasetEntries2 | {
"repo_name": "cDanowski/worldviz",
"path": "src/main/java/org/n52/v3d/worldviz/dataaccess/importtools/CsvImporter.java",
"license": "gpl-2.0",
"size": 12621
} | [
"com.csvreader.CsvReader",
"java.io.File",
"java.io.FileNotFoundException",
"java.io.IOException",
"java.util.Map",
"org.apache.xmlbeans.XmlException",
"org.n52.v3d.worldviz.helper.FileHelper"
] | import com.csvreader.CsvReader; import java.io.File; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Map; import org.apache.xmlbeans.XmlException; import org.n52.v3d.worldviz.helper.FileHelper; | import com.csvreader.*; import java.io.*; import java.util.*; import org.apache.xmlbeans.*; import org.n52.v3d.worldviz.helper.*; | [
"com.csvreader",
"java.io",
"java.util",
"org.apache.xmlbeans",
"org.n52.v3d"
] | com.csvreader; java.io; java.util; org.apache.xmlbeans; org.n52.v3d; | 1,983,157 |
private Set<Class<?>> getRestResourceClasses() {
Set<Class<?>> resources = new java.util.HashSet<Class<?>>();
resources.add(service.BookFacadeREST.class);
return resources;
} | Set<Class<?>> function() { Set<Class<?>> resources = new java.util.HashSet<Class<?>>(); resources.add(service.BookFacadeREST.class); return resources; } | /**
* Do not modify this method. It is automatically generated by NetBeans REST support.
*/ | Do not modify this method. It is automatically generated by NetBeans REST support | getRestResourceClasses | {
"repo_name": "dhammika-marasinghe/CRUD.js",
"path": "examples/CRUDjs/src/java/org/netbeans/rest/application/config/ApplicationConfig.java",
"license": "mit",
"size": 732
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 1,818,779 |
public void activar(){
if(!this.validateActivar()){
return;
}
this.setEstado(Estado.ACTIVO.getId());
GdeDAOFactory.getGesJudDeuDAO().update(this);
} | void function(){ if(!this.validateActivar()){ return; } this.setEstado(Estado.ACTIVO.getId()); GdeDAOFactory.getGesJudDeuDAO().update(this); } | /**
* Activa el GesJudDeu. Previamente valida la activacion.
*
*/ | Activa el GesJudDeu. Previamente valida la activacion | activar | {
"repo_name": "avdata99/SIAT",
"path": "siat-1.0-SOURCE/src/buss/src/ar/gov/rosario/siat/gde/buss/bean/GesJudDeu.java",
"license": "gpl-3.0",
"size": 7831
} | [
"ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory",
"coop.tecso.demoda.iface.model.Estado"
] | import ar.gov.rosario.siat.gde.buss.dao.GdeDAOFactory; import coop.tecso.demoda.iface.model.Estado; | import ar.gov.rosario.siat.gde.buss.dao.*; import coop.tecso.demoda.iface.model.*; | [
"ar.gov.rosario",
"coop.tecso.demoda"
] | ar.gov.rosario; coop.tecso.demoda; | 99,136 |
@Deprecated
public Image getCachedImage(String name) throws IOException {
// An ugly hack, but nothing should be using this method anyway.
return Op.load(name).getImage();
} | Image function(String name) throws IOException { return Op.load(name).getImage(); } | /**
* Find an image from the archive
* Once an image is found, cache it in our HashMap.
* @deprecated Use {@link ImageOp}s instead.
*/ | Find an image from the archive Once an image is found, cache it in our HashMap | getCachedImage | {
"repo_name": "caiusb/vassal",
"path": "src/VASSAL/tools/DataArchive.java",
"license": "lgpl-2.1",
"size": 23191
} | [
"java.awt.Image",
"java.io.IOException"
] | import java.awt.Image; import java.io.IOException; | import java.awt.*; import java.io.*; | [
"java.awt",
"java.io"
] | java.awt; java.io; | 677,987 |
public void testEquals() {
Day day1 = new Day(29, MonthConstants.MARCH, 2002);
Hour hour1 = new Hour(15, day1);
Minute minute1 = new Minute(15, hour1);
Second second1 = new Second(34, minute1);
Millisecond milli1 = new Millisecond(999, second1);
Day day2 = new Day(29, MonthConstants.MARCH, 2002);
Hour hour2 = new Hour(15, day2);
Minute minute2 = new Minute(15, hour2);
Second second2 = new Second(34, minute2);
Millisecond milli2 = new Millisecond(999, second2);
assertTrue(milli1.equals(milli2));
} | void function() { Day day1 = new Day(29, MonthConstants.MARCH, 2002); Hour hour1 = new Hour(15, day1); Minute minute1 = new Minute(15, hour1); Second second1 = new Second(34, minute1); Millisecond milli1 = new Millisecond(999, second1); Day day2 = new Day(29, MonthConstants.MARCH, 2002); Hour hour2 = new Hour(15, day2); Minute minute2 = new Minute(15, hour2); Second second2 = new Second(34, minute2); Millisecond milli2 = new Millisecond(999, second2); assertTrue(milli1.equals(milli2)); } | /**
* Tests the equals method.
*/ | Tests the equals method | testEquals | {
"repo_name": "apetresc/JFreeChart",
"path": "src/test/java/org/jfree/data/time/junit/MillisecondTests.java",
"license": "lgpl-2.1",
"size": 13237
} | [
"org.jfree.data.time.Day",
"org.jfree.data.time.Hour",
"org.jfree.data.time.Millisecond",
"org.jfree.data.time.Minute",
"org.jfree.data.time.Second",
"org.jfree.date.MonthConstants"
] | import org.jfree.data.time.Day; import org.jfree.data.time.Hour; import org.jfree.data.time.Millisecond; import org.jfree.data.time.Minute; import org.jfree.data.time.Second; import org.jfree.date.MonthConstants; | import org.jfree.data.time.*; import org.jfree.date.*; | [
"org.jfree.data",
"org.jfree.date"
] | org.jfree.data; org.jfree.date; | 2,858,694 |
public boolean addTransactionAddedInferredTriples(KiWiTriple triple) {
return transactionAddedInferredTriples.add(triple);
}
| boolean function(KiWiTriple triple) { return transactionAddedInferredTriples.add(triple); } | /**
* add a triple to the list of triples that
* have been added during the transaction
* @param triple
* @return
*/ | add a triple to the list of triples that have been added during the transaction | addTransactionAddedInferredTriples | {
"repo_name": "fregaham/KiWi",
"path": "src/action/kiwi/api/transaction/CIVersionBean.java",
"license": "bsd-3-clause",
"size": 11988
} | [
"kiwi.model.kbase.KiWiTriple"
] | import kiwi.model.kbase.KiWiTriple; | import kiwi.model.kbase.*; | [
"kiwi.model.kbase"
] | kiwi.model.kbase; | 2,486,025 |
public CertificateProperties getCertificateProperties(String alias) {
CertificateProperties certificateProperties = new CertificateProperties();
Certificate cert = getCertificate(alias);
certificateProperties.parseFromCertificate((X509Certificate) cert);
certificateProperties.setAlias(alias);
return certificateProperties;
} | CertificateProperties function(String alias) { CertificateProperties certificateProperties = new CertificateProperties(); Certificate cert = getCertificate(alias); certificateProperties.parseFromCertificate((X509Certificate) cert); certificateProperties.setAlias(alias); return certificateProperties; } | /**
* Gets the certificate properties.
* @param alias the certificate alias
* @return the certificate properties
*/ | Gets the certificate properties | getCertificateProperties | {
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/de.enflexit.common/src/de/enflexit/common/crypto/TrustStoreController.java",
"license": "lgpl-2.1",
"size": 16025
} | [
"java.security.cert.Certificate",
"java.security.cert.X509Certificate"
] | import java.security.cert.Certificate; import java.security.cert.X509Certificate; | import java.security.cert.*; | [
"java.security"
] | java.security; | 1,467,876 |
public View getView(int resource, ViewGroup parent) {
switch (resource) {
case NO_RESOURCE:
return null;
case TEXT_VIEW_ITEM_RESOURCE:
return new TextView(context);
default:
return inflater.inflate(resource, parent, false);
}
} | View function(int resource, ViewGroup parent) { switch (resource) { case NO_RESOURCE: return null; case TEXT_VIEW_ITEM_RESOURCE: return new TextView(context); default: return inflater.inflate(resource, parent, false); } } | /**
* Loads view from resources
* @param resource the resource Id
* @return the loaded view or null if resource is not set
*/ | Loads view from resources | getView | {
"repo_name": "928902646/Gymnast",
"path": "app/src/main/java/com/gymnast/view/wheeladapter/AbstractWheelTextAdapter.java",
"license": "apache-2.0",
"size": 7335
} | [
"android.view.View",
"android.view.ViewGroup",
"android.widget.TextView"
] | import android.view.View; import android.view.ViewGroup; import android.widget.TextView; | import android.view.*; import android.widget.*; | [
"android.view",
"android.widget"
] | android.view; android.widget; | 1,876,509 |
public TimeValue getThrottledUntil() {
return throttledUntil;
} | TimeValue function() { return throttledUntil; } | /**
* Remaining delay of any current throttle sleep or 0 if not sleeping.
*/ | Remaining delay of any current throttle sleep or 0 if not sleeping | getThrottledUntil | {
"repo_name": "xuzha/elasticsearch",
"path": "modules/reindex/src/main/java/org/elasticsearch/index/reindex/BulkByScrollTask.java",
"license": "apache-2.0",
"size": 18171
} | [
"org.elasticsearch.common.unit.TimeValue"
] | import org.elasticsearch.common.unit.TimeValue; | import org.elasticsearch.common.unit.*; | [
"org.elasticsearch.common"
] | org.elasticsearch.common; | 1,893,209 |
@Deprecated
public final List<Violation> getViolations(Resource resource) {
return getViolations(ViolationQuery.create().forResource(resource));
} | final List<Violation> function(Resource resource) { return getViolations(ViolationQuery.create().forResource(resource)); } | /**
* Returns all the active (= non switched-off) violations found on the given resource. Equivalent to
* {@link #getViolations(ViolationQuery)} called with <code>ViolationQuery.create().forResource(resource).ignoreSwitchedOff(true)</code>
* as a parameter.
*
* @since 2.7
* @return the list of violations
* @deprecated in 3.6
*/ | Returns all the active (= non switched-off) violations found on the given resource. Equivalent to <code>#getViolations(ViolationQuery)</code> called with <code>ViolationQuery.create().forResource(resource).ignoreSwitchedOff(true)</code> as a parameter | getViolations | {
"repo_name": "xinghuangxu/xinghuangxu.sonarqube",
"path": "sonar-plugin-api/src/main/java/org/sonar/api/batch/SonarIndex.java",
"license": "lgpl-3.0",
"size": 6347
} | [
"java.util.List",
"org.sonar.api.resources.Resource",
"org.sonar.api.rules.Violation",
"org.sonar.api.violations.ViolationQuery"
] | import java.util.List; import org.sonar.api.resources.Resource; import org.sonar.api.rules.Violation; import org.sonar.api.violations.ViolationQuery; | import java.util.*; import org.sonar.api.resources.*; import org.sonar.api.rules.*; import org.sonar.api.violations.*; | [
"java.util",
"org.sonar.api"
] | java.util; org.sonar.api; | 131,102 |
@Deployment(resources = { "org/flowable/rest/service/api/runtime/ProcessInstanceResourceTest.process-one.bpmn20.xml" })
public void testStartProcessWithSameHttpClient() throws Exception {
ObjectNode requestNode = objectMapper.createObjectNode();
// Start using process definition key
requestNode.put("processDefinitionKey", "processOne");
HttpPost httpPost = new HttpPost(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE_COLLECTION));
httpPost.setEntity(new StringEntity(requestNode.toString()));
// First call
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
// Second call
closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED));
List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list();
assertEquals(2, processInstances.size());
for (ProcessInstance processInstance : processInstances) {
HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult();
assertNotNull(historicProcessInstance);
assertEquals("kermit", historicProcessInstance.getStartUserId());
}
} | @Deployment(resources = { STR }) void function() throws Exception { ObjectNode requestNode = objectMapper.createObjectNode(); requestNode.put(STR, STR); HttpPost httpPost = new HttpPost(SERVER_URL_PREFIX + RestUrls.createRelativeResourceUrl(RestUrls.URL_PROCESS_INSTANCE_COLLECTION)); httpPost.setEntity(new StringEntity(requestNode.toString())); closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED)); closeResponse(executeRequest(httpPost, HttpStatus.SC_CREATED)); List<ProcessInstance> processInstances = runtimeService.createProcessInstanceQuery().list(); assertEquals(2, processInstances.size()); for (ProcessInstance processInstance : processInstances) { HistoricProcessInstance historicProcessInstance = historyService.createHistoricProcessInstanceQuery().processInstanceId(processInstance.getId()).singleResult(); assertNotNull(historicProcessInstance); assertEquals(STR, historicProcessInstance.getStartUserId()); } } | /**
* Explicitly testing the statelessness of the Rest API.
*/ | Explicitly testing the statelessness of the Rest API | testStartProcessWithSameHttpClient | {
"repo_name": "motorina0/flowable-engine",
"path": "modules/flowable-rest/src/test/java/org/flowable/rest/service/api/runtime/ProcessInstanceCollectionResourceTest.java",
"license": "apache-2.0",
"size": 26838
} | [
"com.fasterxml.jackson.databind.node.ObjectNode",
"java.util.List",
"org.apache.http.HttpStatus",
"org.apache.http.client.methods.HttpPost",
"org.apache.http.entity.StringEntity",
"org.flowable.engine.history.HistoricProcessInstance",
"org.flowable.engine.runtime.ProcessInstance",
"org.flowable.engine.test.Deployment",
"org.flowable.rest.service.api.RestUrls"
] | import com.fasterxml.jackson.databind.node.ObjectNode; import java.util.List; import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.StringEntity; import org.flowable.engine.history.HistoricProcessInstance; import org.flowable.engine.runtime.ProcessInstance; import org.flowable.engine.test.Deployment; import org.flowable.rest.service.api.RestUrls; | import com.fasterxml.jackson.databind.node.*; import java.util.*; import org.apache.http.*; import org.apache.http.client.methods.*; import org.apache.http.entity.*; import org.flowable.engine.history.*; import org.flowable.engine.runtime.*; import org.flowable.engine.test.*; import org.flowable.rest.service.api.*; | [
"com.fasterxml.jackson",
"java.util",
"org.apache.http",
"org.flowable.engine",
"org.flowable.rest"
] | com.fasterxml.jackson; java.util; org.apache.http; org.flowable.engine; org.flowable.rest; | 798,503 |
public static boolean invokeOnConnection(IConnection conn, String method, Object[] params, IPendingServiceCallback callback) {
if (conn instanceof IServiceCapableConnection) {
if (callback == null) {
((IServiceCapableConnection) conn).invoke(method, params);
} else {
((IServiceCapableConnection) conn).invoke(method, params, callback);
}
return true;
} else {
return false;
}
}
| static boolean function(IConnection conn, String method, Object[] params, IPendingServiceCallback callback) { if (conn instanceof IServiceCapableConnection) { if (callback == null) { ((IServiceCapableConnection) conn).invoke(method, params); } else { ((IServiceCapableConnection) conn).invoke(method, params, callback); } return true; } else { return false; } } | /**
* Invoke a method on a given connection and handle result.
*
* @param conn connection to invoke method on
* @param method name of the method to invoke
* @param params parameters to pass to the method
* @param callback object to notify when result is received
* @return <pre>true</pre> if the connection supports method calls,
* otherwise <pre>false</pre>
*/ | Invoke a method on a given connection and handle result | invokeOnConnection | {
"repo_name": "cantren/red5-server",
"path": "src/main/java/org/red5/server/api/service/ServiceUtils.java",
"license": "apache-2.0",
"size": 11610
} | [
"org.red5.server.api.IConnection"
] | import org.red5.server.api.IConnection; | import org.red5.server.api.*; | [
"org.red5.server"
] | org.red5.server; | 68,701 |
public static String[] loadScannerConf() throws IOException {
String[] newArgs = null;
// First check current directory
File scannerConf = new File("scanner.conf");
if(scannerConf.exists() == false) {
// Check user home directory
String home = System.getenv("HOME");
scannerConf = new File(home, "scanner.conf");
}
if(scannerConf.exists()) {
// Load the properties and build a new args array from them
FileReader confReader = new FileReader(scannerConf);
Properties scannerProps = new Properties();
scannerProps.load(confReader);
ArrayList tmp = new ArrayList();
for(String key : scannerProps.stringPropertyNames()) {
tmp.add("-"+key);
tmp.add(scannerProps.getProperty(key));
}
newArgs = new String[tmp.size()];
tmp.toArray(newArgs);
}
return newArgs;
} | static String[] function() throws IOException { String[] newArgs = null; File scannerConf = new File(STR); if(scannerConf.exists() == false) { String home = System.getenv("HOME"); scannerConf = new File(home, STR); } if(scannerConf.exists()) { FileReader confReader = new FileReader(scannerConf); Properties scannerProps = new Properties(); scannerProps.load(confReader); ArrayList tmp = new ArrayList(); for(String key : scannerProps.stringPropertyNames()) { tmp.add("-"+key); tmp.add(scannerProps.getProperty(key)); } newArgs = new String[tmp.size()]; tmp.toArray(newArgs); } return newArgs; } | /**
* Search the current directory and user home for a scanner.conf properties file
* @return the command line args for the scanner.conf properties if found, null otherwise
* @throws IOException
*/ | Search the current directory and user home for a scanner.conf properties file | loadScannerConf | {
"repo_name": "RHioTResearch/BaseBeaconScanner",
"path": "src/main/java/org/jboss/rhiot/beacon/common/ParseCommand.java",
"license": "apache-2.0",
"size": 12650
} | [
"java.io.File",
"java.io.FileReader",
"java.io.IOException",
"java.util.ArrayList",
"java.util.Properties"
] | import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.ArrayList; import java.util.Properties; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,269,593 |
public static List<Element> convertToElementList(org.w3c.dom.NodeList _nodeList) {
List<org.w3c.dom.Element> elemList = new ArrayList<>();
for (int i = 0; i < _nodeList.getLength(); i++) {
Element elem = (org.w3c.dom.Element) _nodeList.item(i);
elemList.add(elem);
}
return elemList;
} | static List<Element> function(org.w3c.dom.NodeList _nodeList) { List<org.w3c.dom.Element> elemList = new ArrayList<>(); for (int i = 0; i < _nodeList.getLength(); i++) { Element elem = (org.w3c.dom.Element) _nodeList.item(i); elemList.add(elem); } return elemList; } | /**
* Convert a {@link NodeList} to a Java {@link List} of {@link Element}s.
* @param _nodeList collection of nodes
* @return list of elements
*/ | Convert a <code>NodeList</code> to a Java <code>List</code> of <code>Element</code>s | convertToElementList | {
"repo_name": "hypfvieh/java-utils",
"path": "src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java",
"license": "mit",
"size": 8348
} | [
"java.util.ArrayList",
"java.util.List",
"org.w3c.dom.Element",
"org.w3c.dom.NodeList"
] | import java.util.ArrayList; import java.util.List; import org.w3c.dom.Element; import org.w3c.dom.NodeList; | import java.util.*; import org.w3c.dom.*; | [
"java.util",
"org.w3c.dom"
] | java.util; org.w3c.dom; | 511,310 |
public void deleteMatchCollection(final String collectionName)
throws IOException {
final URI uri;
if (collectionName == null) {
uri = getUri(urls.getMatchCollectionUrlString());
} else {
uri = getUri(urls.getOwnerUrlString() + "/matchCollection/" + collectionName);
}
final String requestContext = "DELETE " + uri;
final TextResponseHandler responseHandler = new TextResponseHandler(requestContext);
final HttpDelete httpDelete = new HttpDelete(uri);
LOG.info("deleteMatchCollection: submitting {}", requestContext);
httpClient.execute(httpDelete, responseHandler);
} | void function(final String collectionName) throws IOException { final URI uri; if (collectionName == null) { uri = getUri(urls.getMatchCollectionUrlString()); } else { uri = getUri(urls.getOwnerUrlString() + STR + collectionName); } final String requestContext = STR + uri; final TextResponseHandler responseHandler = new TextResponseHandler(requestContext); final HttpDelete httpDelete = new HttpDelete(uri); LOG.info(STR, requestContext); httpClient.execute(httpDelete, responseHandler); } | /**
* Deletes the specified match collection.
*
* @param collectionName collection to delete (or null to use this client's project as the collection name).
*
* @throws IOException
* if the request fails for any reason.
*/ | Deletes the specified match collection | deleteMatchCollection | {
"repo_name": "fcollman/render",
"path": "render-ws-java-client/src/main/java/org/janelia/render/client/RenderDataClient.java",
"license": "gpl-2.0",
"size": 52031
} | [
"java.io.IOException",
"org.apache.http.client.methods.HttpDelete",
"org.janelia.render.client.response.TextResponseHandler"
] | import java.io.IOException; import org.apache.http.client.methods.HttpDelete; import org.janelia.render.client.response.TextResponseHandler; | import java.io.*; import org.apache.http.client.methods.*; import org.janelia.render.client.response.*; | [
"java.io",
"org.apache.http",
"org.janelia.render"
] | java.io; org.apache.http; org.janelia.render; | 1,419,787 |
public static void main(String[] s) {
JFrame frame = new JFrame("MonthChooser");
frame.getContentPane().add(new JMonthChooser());
frame.pack();
frame.setVisible(true);
}
| static void function(String[] s) { JFrame frame = new JFrame(STR); frame.getContentPane().add(new JMonthChooser()); frame.pack(); frame.setVisible(true); } | /**
* Creates a JFrame with a JMonthChooser inside and can be used for testing.
*
* @param s
* The command line arguments
*/ | Creates a JFrame with a JMonthChooser inside and can be used for testing | main | {
"repo_name": "FOC-framework/framework",
"path": "foc/src/com/foc/gui/dateChooser/JMonthChooser.java",
"license": "apache-2.0",
"size": 8120
} | [
"javax.swing.JFrame"
] | import javax.swing.JFrame; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,673,893 |
public final byte[] getEncoded() throws IOException {
if (!initialized) {
throw new IOException("Parameter has not been initialized");
}
return spiImpl.engineGetEncoded();
} | final byte[] function() throws IOException { if (!initialized) { throw new IOException(STR); } return spiImpl.engineGetEncoded(); } | /**
* Returns this {@code AlgorithmParameters} in their default encoding
* format. The default encoding format is ASN.1.
*
* @return the encoded parameters.
* @throws IOException
* if this {@code AlgorithmParameters} has already been
* initialized, or if this parameters could not be encoded.
*/ | Returns this AlgorithmParameters in their default encoding format. The default encoding format is ASN.1 | getEncoded | {
"repo_name": "webos21/xi",
"path": "java/jcl/src/java/java/security/AlgorithmParameters.java",
"license": "apache-2.0",
"size": 9895
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,319,098 |
public void equip(EquippableVG good) {
equip(good, true);
} | void function(EquippableVG good) { equip(good, true); } | /**
* Equip the given EquippableVG.
* @param good the EquippableVG to equip.
*/ | Equip the given EquippableVG | equip | {
"repo_name": "tooflya/beat-my-robo",
"path": "proj.android/src/com/soomla/store/data/VirtualGoodsStorage.java",
"license": "gpl-2.0",
"size": 7305
} | [
"com.soomla.store.domain.virtualGoods.EquippableVG"
] | import com.soomla.store.domain.virtualGoods.EquippableVG; | import com.soomla.store.domain.*; | [
"com.soomla.store"
] | com.soomla.store; | 755,343 |
public void setDirection(Vector3f direction) {
this.direction = direction;
} | void function(Vector3f direction) { this.direction = direction; } | /**
* set direction of directictional light
*/ | set direction of directictional light | setDirection | {
"repo_name": "JuKu/rpg-2dgame-engine",
"path": "rpg-graphic-engine/src/main/java/com/jukusoft/rpg/graphic/lighting/DirectionalLight.java",
"license": "apache-2.0",
"size": 1463
} | [
"com.jukusoft.rpg.core.math.Vector3f"
] | import com.jukusoft.rpg.core.math.Vector3f; | import com.jukusoft.rpg.core.math.*; | [
"com.jukusoft.rpg"
] | com.jukusoft.rpg; | 1,935,587 |
void newChatLine(String line) throws BadLocationException;
| void newChatLine(String line) throws BadLocationException; | /**
* New text message received by client.
*
* @param line
* the new message
* @throws BadLocationException
*/ | New text message received by client | newChatLine | {
"repo_name": "SergiyKolesnikov/fuji",
"path": "examples/Chat_casestudies/chat-fabian-benduhn/features/Chat/client/ChatLineListener.java",
"license": "lgpl-3.0",
"size": 414
} | [
"javax.swing.text.BadLocationException"
] | import javax.swing.text.BadLocationException; | import javax.swing.text.*; | [
"javax.swing"
] | javax.swing; | 2,715,349 |
private Double getMaxValue( DataElementHistory history )
{
double value = Double.NEGATIVE_INFINITY;
List<DataElementHistoryPoint> historyPoints = history.getHistoryPoints();
for ( DataElementHistoryPoint point : historyPoints )
{
if ( point.getValue() != null )
{
if ( point.getValue() > value )
{
value = point.getValue();
}
}
}
return value;
}
| Double function( DataElementHistory history ) { double value = Double.NEGATIVE_INFINITY; List<DataElementHistoryPoint> historyPoints = history.getHistoryPoints(); for ( DataElementHistoryPoint point : historyPoints ) { if ( point.getValue() != null ) { if ( point.getValue() > value ) { value = point.getValue(); } } } return value; } | /**
* Finds the highest value entered in the periode given by
* history.historyLenght.
*
* @param history DataElementHistory
* @return the highest entred value. If no value is entred
* Double.NEGATIVE_INFINITY is returned
*/ | Finds the highest value entered in the periode given by history.historyLenght | getMaxValue | {
"repo_name": "msf-oca-his/dhis-core",
"path": "dhis-2/dhis-services/dhis-service-reporting/src/main/java/org/hisp/dhis/dataelementhistory/DefaultHistoryRetriever.java",
"license": "bsd-3-clause",
"size": 9223
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 115,789 |
public void testToArray() {
PriorityQueue q = populatedQueue(SIZE);
Object[] o = q.toArray();
Arrays.sort(o);
for (int i = 0; i < o.length; i++)
assertSame(o[i], q.poll());
} | void function() { PriorityQueue q = populatedQueue(SIZE); Object[] o = q.toArray(); Arrays.sort(o); for (int i = 0; i < o.length; i++) assertSame(o[i], q.poll()); } | /**
* toArray contains all elements
*/ | toArray contains all elements | testToArray | {
"repo_name": "debian-pkg-android-tools/android-platform-libcore",
"path": "jsr166-tests/src/test/java/jsr166/PriorityQueueTest.java",
"license": "gpl-2.0",
"size": 14297
} | [
"java.util.Arrays",
"java.util.PriorityQueue"
] | import java.util.Arrays; import java.util.PriorityQueue; | import java.util.*; | [
"java.util"
] | java.util; | 504,132 |
Object get(int ix) throws NamingException; | Object get(int ix) throws NamingException; | /**
* Retrieves the attribute value from the ordered list of attribute values.
* This method returns the value at the <tt>ix</tt> index of the list of
* attribute values.
* If the attribute values are unordered,
* this method returns the value that happens to be at that index.
* @param ix The index of the value in the ordered list of attribute values.
* {@code 0 <= ix < size()}.
* @return The possibly null attribute value at index <tt>ix</tt>;
* null if the attribute value is null.
* @exception NamingException If a naming exception was encountered while
* retrieving the value.
* @exception IndexOutOfBoundsException If <tt>ix</tt> is outside the specified range.
*/ | Retrieves the attribute value from the ordered list of attribute values. This method returns the value at the ix index of the list of attribute values. If the attribute values are unordered, this method returns the value that happens to be at that index | get | {
"repo_name": "openjdk/jdk7u",
"path": "jdk/src/share/classes/javax/naming/directory/Attribute.java",
"license": "gpl-2.0",
"size": 15043
} | [
"javax.naming.NamingException"
] | import javax.naming.NamingException; | import javax.naming.*; | [
"javax.naming"
] | javax.naming; | 239,938 |
private String values( Property p ) throws RepositoryException {
if (!p.isMultiple()) {
return p.getString();
}
Value[] values = p.getValues();
if (values == null || values.length == 0) {
return "";
}
if (values.length == 1) {
return values[0].getString();
}
String s = values[0].getString();
for (int i = 1; i < values.length; i++) {
s += "," + values[i].getString();
}
return s;
} | String function( Property p ) throws RepositoryException { if (!p.isMultiple()) { return p.getString(); } Value[] values = p.getValues(); if (values == null values.length == 0) { return STR," + values[i].getString(); } return s; } | /**
* Displays property value as string
*
* @param p the property to display
* @return property value as text string
* @throws RepositoryException
*/ | Displays property value as string | values | {
"repo_name": "hchiorean/modeshape",
"path": "web/modeshape-web-explorer/src/main/java/org/modeshape/web/server/JcrServiceImpl.java",
"license": "apache-2.0",
"size": 30851
} | [
"javax.jcr.Property",
"javax.jcr.RepositoryException",
"javax.jcr.Value"
] | import javax.jcr.Property; import javax.jcr.RepositoryException; import javax.jcr.Value; | import javax.jcr.*; | [
"javax.jcr"
] | javax.jcr; | 1,581,231 |
RegisteredProject create(ProjectConfig projectConfig, Map<String, String> options)
throws ConflictException, ForbiddenException, ServerException, NotFoundException,
BadRequestException; | RegisteredProject create(ProjectConfig projectConfig, Map<String, String> options) throws ConflictException, ForbiddenException, ServerException, NotFoundException, BadRequestException; | /**
* Create project with specified configuration and creation options
*
* @param projectConfig configuration of a project that is going to be created
* @param options options of a project creation process
* @return
* @throws ConflictException is thrown if project is already registered, or project type is not
* defined
* @throws ForbiddenException is thrown if operation is forbidden
* @throws ServerException is thrown if an error happened during operation execution
* @throws NotFoundException is thrown if parent location does not exist
* @throws BadRequestException is thrown if project path is not defined
*/ | Create project with specified configuration and creation options | create | {
"repo_name": "akervern/che",
"path": "wsagent/che-core-api-project/src/main/java/org/eclipse/che/api/project/server/ProjectManager.java",
"license": "epl-1.0",
"size": 13671
} | [
"java.util.Map",
"org.eclipse.che.api.core.BadRequestException",
"org.eclipse.che.api.core.ConflictException",
"org.eclipse.che.api.core.ForbiddenException",
"org.eclipse.che.api.core.NotFoundException",
"org.eclipse.che.api.core.ServerException",
"org.eclipse.che.api.core.model.workspace.config.ProjectConfig",
"org.eclipse.che.api.project.shared.RegisteredProject"
] | import java.util.Map; import org.eclipse.che.api.core.BadRequestException; import org.eclipse.che.api.core.ConflictException; import org.eclipse.che.api.core.ForbiddenException; import org.eclipse.che.api.core.NotFoundException; import org.eclipse.che.api.core.ServerException; import org.eclipse.che.api.core.model.workspace.config.ProjectConfig; import org.eclipse.che.api.project.shared.RegisteredProject; | import java.util.*; import org.eclipse.che.api.core.*; import org.eclipse.che.api.core.model.workspace.config.*; import org.eclipse.che.api.project.shared.*; | [
"java.util",
"org.eclipse.che"
] | java.util; org.eclipse.che; | 2,229,690 |
public Builder setTicker(CharSequence tickerText, RemoteViews views) {
mTickerText = tickerText;
mTickerView = views;
return this;
} | Builder function(CharSequence tickerText, RemoteViews views) { mTickerText = tickerText; mTickerView = views; return this; } | /**
* Set the text that is displayed in the status bar when the notification first
* arrives, and also a RemoteViews object that may be displayed instead on some
* devices.
*/ | Set the text that is displayed in the status bar when the notification first arrives, and also a RemoteViews object that may be displayed instead on some devices | setTicker | {
"repo_name": "mateor/pdroid",
"path": "android-4.0.3_r1/trunk/frameworks/base/core/java/android/app/Notification.java",
"license": "gpl-3.0",
"size": 36241
} | [
"android.widget.RemoteViews"
] | import android.widget.RemoteViews; | import android.widget.*; | [
"android.widget"
] | android.widget; | 377,191 |
public void showPluginInfo() {
try {
// First we collect information concerning all the plugin types...
//
Map<String, RowMetaInterface> metaMap = new HashMap<>();
Map<String, List<Object[]>> dataMap = new HashMap<>();
PluginRegistry registry = PluginRegistry.getInstance();
List<Class<? extends PluginTypeInterface>> pluginTypeClasses = registry.getPluginTypes();
for ( Class<? extends PluginTypeInterface> pluginTypeClass : pluginTypeClasses ) {
PluginTypeInterface pluginTypeInterface = registry.getPluginType( pluginTypeClass );
if ( pluginTypeInterface.isFragment() ) {
continue;
}
String subject = pluginTypeInterface.getName();
RowBuffer pluginInformation = registry.getPluginInformation( pluginTypeClass );
metaMap.put( subject, pluginInformation.getRowMeta() );
dataMap.put( subject, pluginInformation.getBuffer() );
}
// Now push it all to a subject data browser...
//
SubjectDataBrowserDialog dialog =
new SubjectDataBrowserDialog( shell, metaMap, dataMap, "Plugin browser", "Plugin type" );
dialog.open();
} catch ( Exception e ) {
new ErrorDialog( shell, "Error", "Error listing plugins", e );
}
} | void function() { try { Map<String, List<Object[]>> dataMap = new HashMap<>(); PluginRegistry registry = PluginRegistry.getInstance(); List<Class<? extends PluginTypeInterface>> pluginTypeClasses = registry.getPluginTypes(); for ( Class<? extends PluginTypeInterface> pluginTypeClass : pluginTypeClasses ) { PluginTypeInterface pluginTypeInterface = registry.getPluginType( pluginTypeClass ); if ( pluginTypeInterface.isFragment() ) { continue; } String subject = pluginTypeInterface.getName(); RowBuffer pluginInformation = registry.getPluginInformation( pluginTypeClass ); metaMap.put( subject, pluginInformation.getRowMeta() ); dataMap.put( subject, pluginInformation.getBuffer() ); } new SubjectDataBrowserDialog( shell, metaMap, dataMap, STR, STR ); dialog.open(); } catch ( Exception e ) { new ErrorDialog( shell, "Error", STR, e ); } } | /**
* Show a plugin browser
*/ | Show a plugin browser | showPluginInfo | {
"repo_name": "wseyler/pentaho-kettle",
"path": "ui/src/main/java/org/pentaho/di/ui/spoon/Spoon.java",
"license": "apache-2.0",
"size": 352020
} | [
"java.util.HashMap",
"java.util.List",
"java.util.Map",
"org.pentaho.di.core.plugins.PluginRegistry",
"org.pentaho.di.core.plugins.PluginTypeInterface",
"org.pentaho.di.core.row.RowBuffer",
"org.pentaho.di.ui.core.dialog.ErrorDialog",
"org.pentaho.di.ui.core.dialog.SubjectDataBrowserDialog"
] | import java.util.HashMap; import java.util.List; import java.util.Map; import org.pentaho.di.core.plugins.PluginRegistry; import org.pentaho.di.core.plugins.PluginTypeInterface; import org.pentaho.di.core.row.RowBuffer; import org.pentaho.di.ui.core.dialog.ErrorDialog; import org.pentaho.di.ui.core.dialog.SubjectDataBrowserDialog; | import java.util.*; import org.pentaho.di.core.plugins.*; import org.pentaho.di.core.row.*; import org.pentaho.di.ui.core.dialog.*; | [
"java.util",
"org.pentaho.di"
] | java.util; org.pentaho.di; | 2,606,536 |
public static int getFileLockMethod(String method) {
if (method == null || method.equalsIgnoreCase("FILE")) {
return FileLock.LOCK_FILE;
} else if (method.equalsIgnoreCase("NO")) {
return FileLock.LOCK_NO;
} else if (method.equalsIgnoreCase("SOCKET")) {
return FileLock.LOCK_SOCKET;
} else if (method.equalsIgnoreCase("SERIALIZED")) {
return FileLock.LOCK_SERIALIZED;
} else if (method.equalsIgnoreCase("FS")) {
return FileLock.LOCK_FS;
} else {
throw DbException.get(
ErrorCode.UNSUPPORTED_LOCK_METHOD_1, method);
}
} | static int function(String method) { if (method == null method.equalsIgnoreCase("FILE")) { return FileLock.LOCK_FILE; } else if (method.equalsIgnoreCase("NO")) { return FileLock.LOCK_NO; } else if (method.equalsIgnoreCase(STR)) { return FileLock.LOCK_SOCKET; } else if (method.equalsIgnoreCase(STR)) { return FileLock.LOCK_SERIALIZED; } else if (method.equalsIgnoreCase("FS")) { return FileLock.LOCK_FS; } else { throw DbException.get( ErrorCode.UNSUPPORTED_LOCK_METHOD_1, method); } } | /**
* Get the file locking method type given a method name.
*
* @param method the method name
* @return the method type
* @throws DbException if the method name is unknown
*/ | Get the file locking method type given a method name | getFileLockMethod | {
"repo_name": "vdr007/ThriftyPaxos",
"path": "src/applications/h2/src/main/org/h2/store/FileLock.java",
"license": "apache-2.0",
"size": 17434
} | [
"org.h2.api.ErrorCode",
"org.h2.message.DbException"
] | import org.h2.api.ErrorCode; import org.h2.message.DbException; | import org.h2.api.*; import org.h2.message.*; | [
"org.h2.api",
"org.h2.message"
] | org.h2.api; org.h2.message; | 2,892,718 |
public final boolean sendToServer(final SharedPreferences sp, final Context ctx) {
//Save to server.
//get logindata for server contact
String username = sp.getString("username", "");
String phoneKey = sp.getString("phone_key", "");
Hashtable<String, List<NameValuePair>> postdata = ServerContact.getLogin(username, phoneKey);
//add location to POST data
List<NameValuePair> statusData = new ArrayList<NameValuePair>();
statusData.add(new BasicNameValuePair("status", this.getStatusAsString()));
statusData.add(new BasicNameValuePair("status_custom_message", this.mCustomMessage));
postdata.put("status", statusData);
//send location to server
String url = "/app/app_update_user_info.json";
try {
ServerContact.postJSON(postdata, url, ctx);
} catch (LoginException e) {
Log.e(TAG, "Could not send status to server");
return false;
}
return true;
} | final boolean function(final SharedPreferences sp, final Context ctx) { String username = sp.getString(STR, STRphone_keySTRSTRstatusSTRstatus_custom_messageSTRstatusSTR/app/app_update_user_info.jsonSTRCould not send status to server"); return false; } return true; } | /**
* Send status to server.
* @param sp Shared Preferences where username and phonekey are stored.
* @param ctx calling context
* @return true on success
*/ | Send status to server | sendToServer | {
"repo_name": "at-attentec/at.attentec",
"path": "at.attentec.com/android/at.attentec.client/src/com/attentec/Status.java",
"license": "apache-2.0",
"size": 11279
} | [
"android.content.Context",
"android.content.SharedPreferences"
] | import android.content.Context; import android.content.SharedPreferences; | import android.content.*; | [
"android.content"
] | android.content; | 932,953 |
public void setPatientId(SubjectIdentifier patientId) {
this.patientId = patientId;
} | void function(SubjectIdentifier patientId) { this.patientId = patientId; } | /**
* Method description
*
*
* @param patientId
*/ | Method description | setPatientId | {
"repo_name": "kef/hieos",
"path": "src/xdsbridge/src/main/java/com/vangent/hieos/services/xds/bridge/model/SubmitDocumentRequest.java",
"license": "apache-2.0",
"size": 2109
} | [
"com.vangent.hieos.subjectmodel.SubjectIdentifier"
] | import com.vangent.hieos.subjectmodel.SubjectIdentifier; | import com.vangent.hieos.subjectmodel.*; | [
"com.vangent.hieos"
] | com.vangent.hieos; | 552,239 |
public void userCanAssociateDocumentsWithCampaigns(
final String username, final Collection<String> campaignIds)
throws ServiceException {
for(String campaignId : campaignIds) {
userCanAssociateDocumentsWithCampaign(username, campaignId);
}
}
| void function( final String username, final Collection<String> campaignIds) throws ServiceException { for(String campaignId : campaignIds) { userCanAssociateDocumentsWithCampaign(username, campaignId); } } | /**
* Verifies that a user can associate documents with all of the campaigns
* in a list. The only restriction is that the user must belong to each of
* the campaigns.
*
* @param username The username of the user in question.
*
* @param campaignIds A List of campaign IDs where each campaign ID will be
* checked that the user is a member of it.
*
* @throws ServiceException Thrown if there is an error or if the user is
* not allowed to associate documents with any of
* the campaigns.
*/ | Verifies that a user can associate documents with all of the campaigns in a list. The only restriction is that the user must belong to each of the campaigns | userCanAssociateDocumentsWithCampaigns | {
"repo_name": "HaiJiaoXinHeng/server-1",
"path": "src/org/ohmage/service/UserCampaignDocumentServices.java",
"license": "apache-2.0",
"size": 8606
} | [
"java.util.Collection",
"org.ohmage.exception.ServiceException"
] | import java.util.Collection; import org.ohmage.exception.ServiceException; | import java.util.*; import org.ohmage.exception.*; | [
"java.util",
"org.ohmage.exception"
] | java.util; org.ohmage.exception; | 413,079 |
private String configuraRelacoes(Matcher matcher){
StringBuffer sb = new StringBuffer();
while(matcher.find()){
String ss = matcher.group();
String objAttr = ss.substring(0, ss.indexOf("{"));
String paramAttr = ss.substring(ss.indexOf("{") + 1).replace("}", "");
String[] sAux = paramAttr.split(",");
StringBuilder builder = new StringBuilder();
for(int i=0; i< sAux.length; i++){
if(i > 0){
builder.append(",");
}
builder.append(objAttr).append(".").append(sAux[i]);
}
matcher.appendReplacement(sb, builder.toString());
}
matcher.appendTail(sb);
return sb.toString();
} | String function(Matcher matcher){ StringBuffer sb = new StringBuffer(); while(matcher.find()){ String ss = matcher.group(); String objAttr = ss.substring(0, ss.indexOf("{")); String paramAttr = ss.substring(ss.indexOf("{") + 1).replace("}", STR,STR,STR.").append(sAux[i]); } matcher.appendReplacement(sb, builder.toString()); } matcher.appendTail(sb); return sb.toString(); } | /**
* Metodo auxiliar que realiza a quebra dos caracteres "{" e ","
* @param matcher
* @return
*/ | Metodo auxiliar que realiza a quebra dos caracteres "{" e "," | configuraRelacoes | {
"repo_name": "jurandirjcg/canary",
"path": "src/main/java/br/com/jgon/canary/persistence/QueryMapper.java",
"license": "apache-2.0",
"size": 10216
} | [
"java.util.regex.Matcher"
] | import java.util.regex.Matcher; | import java.util.regex.*; | [
"java.util"
] | java.util; | 1,749,030 |
public void populateFromFile(File f) throws IOException {
BufferedReader reader = new BufferedReader(new FileReader(f));
String line = null;
LOG.info("populating from file: " + f.getAbsolutePath());
while ((line = reader.readLine()) != null) {
String[] cols = line.split("\t");
if (cols.length < 4) {
LOG.error("File formatted incorrectly, expected at least 4 columns:" + line);
continue;
}
String taxonId = cols[0];
String className = cols[1];
String primaryId = cols[2];
String mainIdsStr = cols[3];
if (!StringUtils.isBlank(mainIdsStr)) {
String[] mainIds = mainIdsStr.split(",");
addEntry(taxonId, className, primaryId, Arrays.asList(mainIds), Boolean.TRUE);
}
// read synonyms if they are present
if (cols.length >= 5) {
String synonymsStr = cols[4];
if (!StringUtils.isBlank(synonymsStr)) {
String[] synonyms = synonymsStr.split(",");
addEntry(taxonId, className, primaryId, Arrays.asList(synonyms), Boolean.FALSE);
}
}
}
reader.close();
}
// TODO populate part from file with given taxons and classes, what if there
// are some data nonexists? Maybe not a good idea... | void function(File f) throws IOException { BufferedReader reader = new BufferedReader(new FileReader(f)); String line = null; LOG.info(STR + f.getAbsolutePath()); while ((line = reader.readLine()) != null) { String[] cols = line.split("\t"); if (cols.length < 4) { LOG.error(STR + line); continue; } String taxonId = cols[0]; String className = cols[1]; String primaryId = cols[2]; String mainIdsStr = cols[3]; if (!StringUtils.isBlank(mainIdsStr)) { String[] mainIds = mainIdsStr.split(","); addEntry(taxonId, className, primaryId, Arrays.asList(mainIds), Boolean.TRUE); } if (cols.length >= 5) { String synonymsStr = cols[4]; if (!StringUtils.isBlank(synonymsStr)) { String[] synonyms = synonymsStr.split(","); addEntry(taxonId, className, primaryId, Arrays.asList(synonyms), Boolean.FALSE); } } } reader.close(); } | /**
* Read contents of an IdResolver from file, allows for caching during a build.
* @param f the file to read from
* @throws IOException if problem reading from file
*/ | Read contents of an IdResolver from file, allows for caching during a build | populateFromFile | {
"repo_name": "elsiklab/intermine",
"path": "bio/core/main/src/org/intermine/bio/dataconversion/IdResolver.java",
"license": "lgpl-2.1",
"size": 23378
} | [
"java.io.BufferedReader",
"java.io.File",
"java.io.FileReader",
"java.io.IOException",
"java.util.Arrays",
"org.apache.commons.lang.StringUtils"
] | import java.io.BufferedReader; import java.io.File; import java.io.FileReader; import java.io.IOException; import java.util.Arrays; import org.apache.commons.lang.StringUtils; | import java.io.*; import java.util.*; import org.apache.commons.lang.*; | [
"java.io",
"java.util",
"org.apache.commons"
] | java.io; java.util; org.apache.commons; | 2,826,255 |
public int damageDropped(IBlockState state)
{
return ((EnumDyeColor)state.getValue(COLOR)).getMetadata();
} | int function(IBlockState state) { return ((EnumDyeColor)state.getValue(COLOR)).getMetadata(); } | /**
* Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It
* returns the metadata of the dropped item based on the old metadata of the block.
*/ | Gets the metadata of the item this Block can drop. This method is called when the block gets destroyed. It returns the metadata of the dropped item based on the old metadata of the block | damageDropped | {
"repo_name": "SkidJava/BaseClient",
"path": "new_1.8.8/net/minecraft/block/BlockColored.java",
"license": "gpl-2.0",
"size": 2392
} | [
"net.minecraft.block.state.IBlockState",
"net.minecraft.item.EnumDyeColor"
] | import net.minecraft.block.state.IBlockState; import net.minecraft.item.EnumDyeColor; | import net.minecraft.block.state.*; import net.minecraft.item.*; | [
"net.minecraft.block",
"net.minecraft.item"
] | net.minecraft.block; net.minecraft.item; | 2,621,328 |
public void setReplyToAddresses(List<String> replyToAddresses) {
this.replyToAddresses = replyToAddresses;
} | void function(List<String> replyToAddresses) { this.replyToAddresses = replyToAddresses; } | /**
* List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header.
*/ | List of reply-to email address(es) for the message, override it using 'CamelAwsSesReplyToAddresses' header | setReplyToAddresses | {
"repo_name": "skinzer/camel",
"path": "components/camel-aws/src/main/java/org/apache/camel/component/aws/ses/SesConfiguration.java",
"license": "apache-2.0",
"size": 4902
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,742,322 |
public DataCiteMetadata.GeoLocations.GeoLocation.Builder<_B>
addGeoLocationPlaceOrGeoLocationPointOrGeoLocationBox(
Object... geoLocationPlaceOrGeoLocationPointOrGeoLocationBox) {
addGeoLocationPlaceOrGeoLocationPointOrGeoLocationBox(
Arrays.asList(geoLocationPlaceOrGeoLocationPointOrGeoLocationBox));
return this;
} | DataCiteMetadata.GeoLocations.GeoLocation.Builder<_B> function( Object... geoLocationPlaceOrGeoLocationPointOrGeoLocationBox) { addGeoLocationPlaceOrGeoLocationPointOrGeoLocationBox( Arrays.asList(geoLocationPlaceOrGeoLocationPointOrGeoLocationBox)); return this; } | /**
* Adds the given items to the value of "geoLocationPlaceOrGeoLocationPointOrGeoLocationBox"
*
* @param geoLocationPlaceOrGeoLocationPointOrGeoLocationBox Items to add to the value of
* the "geoLocationPlaceOrGeoLocationPointOrGeoLocationBox" property
*/ | Adds the given items to the value of "geoLocationPlaceOrGeoLocationPointOrGeoLocationBox" | addGeoLocationPlaceOrGeoLocationPointOrGeoLocationBox | {
"repo_name": "gbif/gbif-doi",
"path": "src/main/java/org/gbif/doi/metadata/datacite/DataCiteMetadata.java",
"license": "apache-2.0",
"size": 732108
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 480,752 |
private void injectAllOpenablesForPackageFragment(
IPackageFragment packFrag,
ArrayList openables) {
try {
IPackageFragmentRoot root = (IPackageFragmentRoot) packFrag.getParent();
int kind = root.getKind();
if (kind != 0) {
boolean isSourcePackageFragment = (kind == IPackageFragmentRoot.K_SOURCE);
if (isSourcePackageFragment) {
ICompilationUnit[] cus = packFrag.getCompilationUnits();
for (int i = 0, length = cus.length; i < length; i++) {
openables.add(cus[i]);
}
} else {
IOrdinaryClassFile[] classFiles = packFrag.getOrdinaryClassFiles();
for (int i = 0, length = classFiles.length; i < length; i++) {
openables.add(classFiles[i]);
}
}
}
} catch (JavaModelException e) {
// ignore
}
} | void function( IPackageFragment packFrag, ArrayList openables) { try { IPackageFragmentRoot root = (IPackageFragmentRoot) packFrag.getParent(); int kind = root.getKind(); if (kind != 0) { boolean isSourcePackageFragment = (kind == IPackageFragmentRoot.K_SOURCE); if (isSourcePackageFragment) { ICompilationUnit[] cus = packFrag.getCompilationUnits(); for (int i = 0, length = cus.length; i < length; i++) { openables.add(cus[i]); } } else { IOrdinaryClassFile[] classFiles = packFrag.getOrdinaryClassFiles(); for (int i = 0, length = classFiles.length; i < length; i++) { openables.add(classFiles[i]); } } } } catch (JavaModelException e) { } } | /**
* Adds all of the openables defined within this package fragment to the
* list.
*/ | Adds all of the openables defined within this package fragment to the list | injectAllOpenablesForPackageFragment | {
"repo_name": "Niky4000/UsefulUtils",
"path": "projects/others/eclipse-platform-parent/eclipse.jdt.core-master/org.eclipse.jdt.core/model/org/eclipse/jdt/internal/core/hierarchy/RegionBasedHierarchyBuilder.java",
"license": "gpl-3.0",
"size": 7093
} | [
"java.util.ArrayList",
"org.eclipse.jdt.core.ICompilationUnit",
"org.eclipse.jdt.core.IOrdinaryClassFile",
"org.eclipse.jdt.core.IPackageFragment",
"org.eclipse.jdt.core.IPackageFragmentRoot",
"org.eclipse.jdt.core.JavaModelException"
] | import java.util.ArrayList; import org.eclipse.jdt.core.ICompilationUnit; import org.eclipse.jdt.core.IOrdinaryClassFile; import org.eclipse.jdt.core.IPackageFragment; import org.eclipse.jdt.core.IPackageFragmentRoot; import org.eclipse.jdt.core.JavaModelException; | import java.util.*; import org.eclipse.jdt.core.*; | [
"java.util",
"org.eclipse.jdt"
] | java.util; org.eclipse.jdt; | 1,570,687 |
public ResultPartitionType getConsumedPartitionType() {
return consumedPartitionType;
} | ResultPartitionType function() { return consumedPartitionType; } | /**
* Returns the type of this input channel's consumed result partition.
*
* @return consumed result partition type
*/ | Returns the type of this input channel's consumed result partition | getConsumedPartitionType | {
"repo_name": "ueshin/apache-flink",
"path": "flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/consumer/SingleInputGate.java",
"license": "apache-2.0",
"size": 25469
} | [
"org.apache.flink.runtime.io.network.partition.ResultPartitionType"
] | import org.apache.flink.runtime.io.network.partition.ResultPartitionType; | import org.apache.flink.runtime.io.network.partition.*; | [
"org.apache.flink"
] | org.apache.flink; | 2,217,943 |
@SuppressWarnings("unchecked")
public static List<Byte> getAt(byte[] array, Range range) {
return primitiveArrayGet(array, range);
} | @SuppressWarnings(STR) static List<Byte> function(byte[] array, Range range) { return primitiveArrayGet(array, range); } | /**
* Support the subscript operator with a range for a byte array
*
* @param array a byte array
* @param range a range indicating the indices for the items to retrieve
* @return list of the retrieved bytes
* @since 1.0
*/ | Support the subscript operator with a range for a byte array | getAt | {
"repo_name": "mv2a/yajsw",
"path": "src/groovy-patch/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 704164
} | [
"groovy.lang.Range",
"java.util.List"
] | import groovy.lang.Range; import java.util.List; | import groovy.lang.*; import java.util.*; | [
"groovy.lang",
"java.util"
] | groovy.lang; java.util; | 1,565,602 |
private void registerPlatformTypeLocally(String clsName, CacheObjectBinaryProcessorImpl binProc) {
PlatformProcessor platformProc = ctx.platform();
if (platformProc == null || !platformProc.hasContext())
return;
PlatformContext platformCtx = platformProc.context();
BinaryMetadata meta = platformCtx.getBinaryType(clsName);
if (meta != null)
binProc.binaryContext().registerClassLocally(
meta.wrap(binProc.binaryContext()),
false,
platformCtx.getMarshallerPlatformId());
} | void function(String clsName, CacheObjectBinaryProcessorImpl binProc) { PlatformProcessor platformProc = ctx.platform(); if (platformProc == null !platformProc.hasContext()) return; PlatformContext platformCtx = platformProc.context(); BinaryMetadata meta = platformCtx.getBinaryType(clsName); if (meta != null) binProc.binaryContext().registerClassLocally( meta.wrap(binProc.binaryContext()), false, platformCtx.getMarshallerPlatformId()); } | /**
* Registers platform type locally.
*
* @param clsName Class name.
* @param binProc Binary processor.
*/ | Registers platform type locally | registerPlatformTypeLocally | {
"repo_name": "NSAmelchev/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/query/GridQueryProcessor.java",
"license": "apache-2.0",
"size": 147807
} | [
"org.apache.ignite.internal.binary.BinaryMetadata",
"org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl",
"org.apache.ignite.internal.processors.platform.PlatformContext",
"org.apache.ignite.internal.processors.platform.PlatformProcessor"
] | import org.apache.ignite.internal.binary.BinaryMetadata; import org.apache.ignite.internal.processors.cache.binary.CacheObjectBinaryProcessorImpl; import org.apache.ignite.internal.processors.platform.PlatformContext; import org.apache.ignite.internal.processors.platform.PlatformProcessor; | import org.apache.ignite.internal.binary.*; import org.apache.ignite.internal.processors.cache.binary.*; import org.apache.ignite.internal.processors.platform.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 831,826 |
Constructor getConstructor();
| Constructor getConstructor(); | /**
* Gets the constructor being called.
* <p>
* This method is a frienly implementation of the {@link
* Joinpoint#getStaticPart()} method (same result).
*
* @return the constructor being called.
*/ | Gets the constructor being called. This method is a frienly implementation of the <code>Joinpoint#getStaticPart()</code> method (same result) | getConstructor | {
"repo_name": "OldRepoPreservation/jgentle",
"path": "src/org/aopalliance/intercept/ConstructorInvocation.java",
"license": "apache-2.0",
"size": 1327
} | [
"java.lang.reflect.Constructor"
] | import java.lang.reflect.Constructor; | import java.lang.reflect.*; | [
"java.lang"
] | java.lang; | 977,978 |
//@pda jdbc40
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
validateStatement();
statement_.setSQLXML(parameterIndex, xmlObject);
}
| void function(int parameterIndex, SQLXML xmlObject) throws SQLException { validateStatement(); statement_.setSQLXML(parameterIndex, xmlObject); } | /**
* Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an
* SQL <code>XML</code> value when it sends it to the database.
* @param parameterIndex index of the first parameter is 1, the second is 2, ...
* @param xmlObject a <code>SQLXML</code> object that maps an SQL <code>XML</code> value
* @throws SQLException if a database access error occurs, this method
* is called on a closed result set,
* <code>Writer</code> or <code>OutputStream</code> has not been closed
* for the <code>SQLXML</code> object or
* if there is an error processing the XML value. The <code>getCause</code> method
* of the exception may provide a more detailed exception, for example, if the
* stream does not contain valid XML.
*/ | Sets the designated parameter to the given <code>java.sql.SQLXML</code> object. The driver converts this to an SQL <code>XML</code> value when it sends it to the database | setSQLXML | {
"repo_name": "piguangming/jt400",
"path": "jdbc40/com/ibm/as400/access/AS400JDBCRowSet.java",
"license": "epl-1.0",
"size": 308525
} | [
"java.sql.SQLException"
] | import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 522,751 |
private List<String> preparePartNames(String tabName, int minPart, int maxPart) throws Exception {
if ((minPart < 1) || (maxPart > NUM_PARTS)) {
throw new Exception("tabParts does not have these partition numbers");
}
List<String> partNames = new ArrayList<String>();
for (int i = minPart; i <= maxPart; i++) {
String partName = tabParts.get(i-1);
partNames.add(tabName + partName);
}
return partNames;
} | List<String> function(String tabName, int minPart, int maxPart) throws Exception { if ((minPart < 1) (maxPart > NUM_PARTS)) { throw new Exception(STR); } List<String> partNames = new ArrayList<String>(); for (int i = minPart; i <= maxPart; i++) { String partName = tabParts.get(i-1); partNames.add(tabName + partName); } return partNames; } | /**
* Prepares an array of partition names by getting partitions from minPart ... maxPart and
* prepending with table name
* Example: [tab1part1, tab1part2 ...]
*
* @param tabName
* @param minPart
* @param maxPart
* @return
* @throws Exception
*/ | Prepares an array of partition names by getting partitions from minPart ... maxPart and prepending with table name Example: [tab1part1, tab1part2 ...] | preparePartNames | {
"repo_name": "scalingdata/Impala",
"path": "thirdparty/hive-1.2.1.2.3.0.0-2557/src/metastore/src/test/org/apache/hadoop/hive/metastore/TestAggregateStatsCache.java",
"license": "apache-2.0",
"size": 10407
} | [
"java.util.ArrayList",
"java.util.List"
] | import java.util.ArrayList; import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,362,698 |
@Override
public Iterator<FeatureDescriptor> getFeatureDescriptors(ELContext context,
Object base) {
return null;
} | Iterator<FeatureDescriptor> function(ELContext context, Object base) { return null; } | /**
* Always returns <code>null</code>.
*/ | Always returns <code>null</code> | getFeatureDescriptors | {
"repo_name": "Nickname0806/Test_Q4",
"path": "java/javax/el/StaticFieldELResolver.java",
"license": "apache-2.0",
"size": 7299
} | [
"java.beans.FeatureDescriptor",
"java.util.Iterator"
] | import java.beans.FeatureDescriptor; import java.util.Iterator; | import java.beans.*; import java.util.*; | [
"java.beans",
"java.util"
] | java.beans; java.util; | 2,395,787 |
public void addPackageFromDrl( final Reader source, final Reader dsl ) throws DroolsParserException, IOException {
this.resource = new ReaderResource( source, ResourceType.DSLR );
final DrlParser parser = new DrlParser(configuration.getLanguageLevel());
final PackageDescr pkg = parser.parse( source, dsl );
this.results.addAll( parser.getErrors() );
if (!parser.hasErrors()) {
addPackage( pkg );
}
this.resource = null;
} | void function( final Reader source, final Reader dsl ) throws DroolsParserException, IOException { this.resource = new ReaderResource( source, ResourceType.DSLR ); final DrlParser parser = new DrlParser(configuration.getLanguageLevel()); final PackageDescr pkg = parser.parse( source, dsl ); this.results.addAll( parser.getErrors() ); if (!parser.hasErrors()) { addPackage( pkg ); } this.resource = null; } | /**
* Load a rule package from DRL source using the supplied DSL configuration.
*
* @param source
* The source of the rules.
* @param dsl
* The source of the domain specific language configuration.
* @throws DroolsParserException
* @throws IOException
*/ | Load a rule package from DRL source using the supplied DSL configuration | addPackageFromDrl | {
"repo_name": "yurloc/drools",
"path": "drools-compiler/src/main/java/org/drools/compiler/PackageBuilder.java",
"license": "apache-2.0",
"size": 156973
} | [
"java.io.IOException",
"java.io.Reader",
"org.drools.io.impl.ReaderResource",
"org.drools.lang.descr.PackageDescr",
"org.kie.io.ResourceType"
] | import java.io.IOException; import java.io.Reader; import org.drools.io.impl.ReaderResource; import org.drools.lang.descr.PackageDescr; import org.kie.io.ResourceType; | import java.io.*; import org.drools.io.impl.*; import org.drools.lang.descr.*; import org.kie.io.*; | [
"java.io",
"org.drools.io",
"org.drools.lang",
"org.kie.io"
] | java.io; org.drools.io; org.drools.lang; org.kie.io; | 1,593,035 |
@Override
public void putAll(Map<? extends K, ? extends V> m) {
Iterator<?> i = m.entrySet().iterator();
while ( i.hasNext() ) {
@SuppressWarnings("unchecked")
Map.Entry<K,V> entry = (Map.Entry<K,V>) i.next();
put(entry.getKey(),entry.getValue());
}
} | void function(Map<? extends K, ? extends V> m) { Iterator<?> i = m.entrySet().iterator(); while ( i.hasNext() ) { @SuppressWarnings(STR) Map.Entry<K,V> entry = (Map.Entry<K,V>) i.next(); put(entry.getKey(),entry.getValue()); } } | /**
* Copies all values from one map to this instance
* @param m Map
*/ | Copies all values from one map to this instance | putAll | {
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.61/AbstractReplicatedMap.java",
"license": "mit",
"size": 58695
} | [
"java.util.Iterator",
"java.util.Map"
] | import java.util.Iterator; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 854,120 |
public boolean loadXML(Node valnode)
{
try
{
String valname = XMLHandler.getTagValue(valnode, "name");
int valtype = getType( XMLHandler.getTagValue(valnode, "type") );
String text = XMLHandler.getTagValue(valnode, "text");
boolean isnull = "Y".equalsIgnoreCase(XMLHandler.getTagValue(valnode, "isnull"));
int len = Const.toInt(XMLHandler.getTagValue(valnode, "length"), -1);
int prec = Const.toInt(XMLHandler.getTagValue(valnode, "precision"), -1);
setName(valname);
setValue(text);
setLength(len, prec);
if (valtype!=VALUE_TYPE_STRING)
{
trim();
convertString(valtype);
}
if (isnull) setNull();
}
catch(Exception e)
{
setNull();
return false;
}
return true;
} | boolean function(Node valnode) { try { String valname = XMLHandler.getTagValue(valnode, "name"); int valtype = getType( XMLHandler.getTagValue(valnode, "type") ); String text = XMLHandler.getTagValue(valnode, "text"); boolean isnull = "Y".equalsIgnoreCase(XMLHandler.getTagValue(valnode, STR)); int len = Const.toInt(XMLHandler.getTagValue(valnode, STR), -1); int prec = Const.toInt(XMLHandler.getTagValue(valnode, STR), -1); setName(valname); setValue(text); setLength(len, prec); if (valtype!=VALUE_TYPE_STRING) { trim(); convertString(valtype); } if (isnull) setNull(); } catch(Exception e) { setNull(); return false; } return true; } | /**
* Read the data for this Value from an XML Node
* @param valnode The XML Node to read from
* @return true if all went well, false if something went wrong.
*/ | Read the data for this Value from an XML Node | loadXML | {
"repo_name": "dianhu/Kettle-Research",
"path": "src-core/org/pentaho/di/compatibility/Value.java",
"license": "lgpl-2.1",
"size": 96484
} | [
"org.pentaho.di.core.Const",
"org.pentaho.di.core.xml.XMLHandler",
"org.w3c.dom.Node"
] | import org.pentaho.di.core.Const; import org.pentaho.di.core.xml.XMLHandler; import org.w3c.dom.Node; | import org.pentaho.di.core.*; import org.pentaho.di.core.xml.*; import org.w3c.dom.*; | [
"org.pentaho.di",
"org.w3c.dom"
] | org.pentaho.di; org.w3c.dom; | 2,800,424 |
ServiceLocator.awaitService(bundleContext, ContainerRegistration.class);
Group<GitNode> group = new ZooKeeperGroup<GitNode>(curator, ZkPath.GIT.getPath(), GitNode.class);
final CountDownLatch latch = new CountDownLatch(1); | ServiceLocator.awaitService(bundleContext, ContainerRegistration.class); Group<GitNode> group = new ZooKeeperGroup<GitNode>(curator, ZkPath.GIT.getPath(), GitNode.class); final CountDownLatch latch = new CountDownLatch(1); | /**
* Waits until the master url becomes available & returns it.
*/ | Waits until the master url becomes available & returns it | getMasterUrl | {
"repo_name": "alexeev/jboss-fuse-mirror",
"path": "fabric/fabric-itests/basic/src/test/java/io/fabric8/itests/basic/git/GitUtils.java",
"license": "apache-2.0",
"size": 7292
} | [
"io.fabric8.api.ContainerRegistration",
"io.fabric8.api.ServiceLocator",
"io.fabric8.git.GitNode",
"io.fabric8.groups.Group",
"io.fabric8.groups.internal.ZooKeeperGroup",
"io.fabric8.zookeeper.ZkPath",
"java.util.concurrent.CountDownLatch"
] | import io.fabric8.api.ContainerRegistration; import io.fabric8.api.ServiceLocator; import io.fabric8.git.GitNode; import io.fabric8.groups.Group; import io.fabric8.groups.internal.ZooKeeperGroup; import io.fabric8.zookeeper.ZkPath; import java.util.concurrent.CountDownLatch; | import io.fabric8.api.*; import io.fabric8.git.*; import io.fabric8.groups.*; import io.fabric8.groups.internal.*; import io.fabric8.zookeeper.*; import java.util.concurrent.*; | [
"io.fabric8.api",
"io.fabric8.git",
"io.fabric8.groups",
"io.fabric8.zookeeper",
"java.util"
] | io.fabric8.api; io.fabric8.git; io.fabric8.groups; io.fabric8.zookeeper; java.util; | 2,526,121 |
@Override
protected Capability[] getRequiredCaps()
{
return new Capability[]
{
Capability.GET_TYPE,
Capability.CREATE,
Capability.RANDOM_ACCESS_READ,
Capability.RANDOM_ACCESS_WRITE
};
} | Capability[] function() { return new Capability[] { Capability.GET_TYPE, Capability.CREATE, Capability.RANDOM_ACCESS_READ, Capability.RANDOM_ACCESS_WRITE }; } | /**
* Returns the capabilities required by the tests of this test case.
*/ | Returns the capabilities required by the tests of this test case | getRequiredCaps | {
"repo_name": "easel/commons-vfs",
"path": "core/src/test/java/org/apache/commons/vfs2/test/ProviderRandomReadWriteTests.java",
"license": "apache-2.0",
"size": 3598
} | [
"org.apache.commons.vfs2.Capability"
] | import org.apache.commons.vfs2.Capability; | import org.apache.commons.vfs2.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,847,361 |
@Override
public boolean shouldSkip(TestCase testCase) {
Class<?> testClass = testCase.getClass();
if (testClass.isAnnotationPresent(MinAndroidSdkLevel.class)) {
MinAndroidSdkLevel v = testClass.getAnnotation(MinAndroidSdkLevel.class);
if (Build.VERSION.SDK_INT < v.value()) {
Log.i(TAG, "Test " + testClass.getName() + "#" + testCase.getName()
+ " is not enabled at SDK level " + Build.VERSION.SDK_INT
+ ".");
return true;
}
}
return false;
}
} | boolean function(TestCase testCase) { Class<?> testClass = testCase.getClass(); if (testClass.isAnnotationPresent(MinAndroidSdkLevel.class)) { MinAndroidSdkLevel v = testClass.getAnnotation(MinAndroidSdkLevel.class); if (Build.VERSION.SDK_INT < v.value()) { Log.i(TAG, STR + testClass.getName() + "#" + testCase.getName() + STR + Build.VERSION.SDK_INT + "."); return true; } } return false; } } | /**
* If {@link MinAndroidSdkLevel} is present, checks its value
* against the device's SDK level.
*
* @param testCase The test to check.
* @return true if the device's SDK level is below the specified minimum.
*/ | If <code>MinAndroidSdkLevel</code> is present, checks its value against the device's SDK level | shouldSkip | {
"repo_name": "Workday/OpenFrame",
"path": "base/test/android/javatests/src/org/chromium/base/test/BaseInstrumentationTestRunner.java",
"license": "bsd-3-clause",
"size": 5615
} | [
"android.os.Build",
"junit.framework.TestCase",
"org.chromium.base.Log",
"org.chromium.base.test.util.MinAndroidSdkLevel"
] | import android.os.Build; import junit.framework.TestCase; import org.chromium.base.Log; import org.chromium.base.test.util.MinAndroidSdkLevel; | import android.os.*; import junit.framework.*; import org.chromium.base.*; import org.chromium.base.test.util.*; | [
"android.os",
"junit.framework",
"org.chromium.base"
] | android.os; junit.framework; org.chromium.base; | 2,630,348 |
public Builder xValues(DoubleArray xValues) {
JodaBeanUtils.notNull(xValues, "xValues");
this.xValues = xValues;
return this;
} | Builder function(DoubleArray xValues) { JodaBeanUtils.notNull(xValues, STR); this.xValues = xValues; return this; } | /**
* Sets the array of x-values, one for each point.
* <p>
* This array will contains at least two elements.
* @param xValues the new value, not null
* @return this, for chaining, not null
*/ | Sets the array of x-values, one for each point. This array will contains at least two elements | xValues | {
"repo_name": "OpenGamma/Strata",
"path": "modules/market/src/main/java/com/opengamma/strata/market/surface/InterpolatedNodalSurface.java",
"license": "apache-2.0",
"size": 27333
} | [
"com.opengamma.strata.collect.array.DoubleArray",
"org.joda.beans.JodaBeanUtils"
] | import com.opengamma.strata.collect.array.DoubleArray; import org.joda.beans.JodaBeanUtils; | import com.opengamma.strata.collect.array.*; import org.joda.beans.*; | [
"com.opengamma.strata",
"org.joda.beans"
] | com.opengamma.strata; org.joda.beans; | 1,827,571 |
EList<DataBinding> getBindings(); | EList<DataBinding> getBindings(); | /**
* Returns the value of the '<em><b>Bindings</b></em>' containment reference list.
* The list contents are of type {@link org.tud.inf.st.mbt.data.DataBinding}.
* <!-- begin-user-doc -->
* <p>
* If the meaning of the '<em>Bindings</em>' containment reference list isn't clear,
* there really should be more of a description here...
* </p>
* <!-- end-user-doc -->
* @return the value of the '<em>Bindings</em>' containment reference list.
* @see org.tud.inf.st.mbt.features.FeaturesPackage#getConfiguration_Bindings()
* @model containment="true"
* @generated
*/ | Returns the value of the 'Bindings' containment reference list. The list contents are of type <code>org.tud.inf.st.mbt.data.DataBinding</code>. If the meaning of the 'Bindings' containment reference list isn't clear, there really should be more of a description here... | getBindings | {
"repo_name": "paetti1988/qmate",
"path": "MATE/org.tud.inf.st.mbt.emf/src-gen/org/tud/inf/st/mbt/features/Configuration.java",
"license": "apache-2.0",
"size": 2097
} | [
"org.eclipse.emf.common.util.EList",
"org.tud.inf.st.mbt.data.DataBinding"
] | import org.eclipse.emf.common.util.EList; import org.tud.inf.st.mbt.data.DataBinding; | import org.eclipse.emf.common.util.*; import org.tud.inf.st.mbt.data.*; | [
"org.eclipse.emf",
"org.tud.inf"
] | org.eclipse.emf; org.tud.inf; | 1,089,521 |
private MountMap mountFilesFromFilesetManifests(
Spawn spawn, ActionExecutionContext executionContext) throws IOException, ExecException {
final FilesetActionContext filesetContext =
executionContext.getExecutor().getContext(FilesetActionContext.class);
MountMap mounts = new MountMap();
for (Artifact fileset : spawn.getFilesetManifests()) {
Path manifest =
execRoot.getRelative(AnalysisUtils.getManifestPathFromFilesetPath(fileset.getExecPath()));
Path targetDirectory = execRoot.getRelative(fileset.getExecPathString());
mounts.putAll(
parseManifestFile(
targetDirectory, manifest.getPathFile(), true, filesetContext.getWorkspaceName()));
}
return mounts;
} | MountMap function( Spawn spawn, ActionExecutionContext executionContext) throws IOException, ExecException { final FilesetActionContext filesetContext = executionContext.getExecutor().getContext(FilesetActionContext.class); MountMap mounts = new MountMap(); for (Artifact fileset : spawn.getFilesetManifests()) { Path manifest = execRoot.getRelative(AnalysisUtils.getManifestPathFromFilesetPath(fileset.getExecPath())); Path targetDirectory = execRoot.getRelative(fileset.getExecPathString()); mounts.putAll( parseManifestFile( targetDirectory, manifest.getPathFile(), true, filesetContext.getWorkspaceName())); } return mounts; } | /**
* Mount all files that the spawn needs as specified in its fileset manifests.
*/ | Mount all files that the spawn needs as specified in its fileset manifests | mountFilesFromFilesetManifests | {
"repo_name": "hhclam/bazel",
"path": "src/main/java/com/google/devtools/build/lib/sandbox/LinuxSandboxedStrategy.java",
"license": "apache-2.0",
"size": 19437
} | [
"com.google.devtools.build.lib.actions.ActionExecutionContext",
"com.google.devtools.build.lib.actions.Artifact",
"com.google.devtools.build.lib.actions.ExecException",
"com.google.devtools.build.lib.actions.Spawn",
"com.google.devtools.build.lib.analysis.AnalysisUtils",
"com.google.devtools.build.lib.rules.fileset.FilesetActionContext",
"com.google.devtools.build.lib.vfs.Path",
"java.io.IOException"
] | import com.google.devtools.build.lib.actions.ActionExecutionContext; import com.google.devtools.build.lib.actions.Artifact; import com.google.devtools.build.lib.actions.ExecException; import com.google.devtools.build.lib.actions.Spawn; import com.google.devtools.build.lib.analysis.AnalysisUtils; import com.google.devtools.build.lib.rules.fileset.FilesetActionContext; import com.google.devtools.build.lib.vfs.Path; import java.io.IOException; | import com.google.devtools.build.lib.actions.*; import com.google.devtools.build.lib.analysis.*; import com.google.devtools.build.lib.rules.fileset.*; import com.google.devtools.build.lib.vfs.*; import java.io.*; | [
"com.google.devtools",
"java.io"
] | com.google.devtools; java.io; | 2,369,560 |
protected String decode(final String encodedValue) {
return UriUtils.decode(encodedValue);
} | String function(final String encodedValue) { return UriUtils.decode(encodedValue); } | /**
* Decodes the encoded String value using the default encoding UTF-8. It is assumed the String
* value was encoded with the URLEncoder using the UTF-8 encoding. This method handles
* UnsupportedEncodingException by just returning the encodedValue.
*
* @param encodedValue the encoded String value to decode.
* @return the decoded value of the String or encodedValue if the UTF-8 encoding is unsupported.
* @see org.apache.geode.management.internal.web.util.UriUtils#decode(String)
*/ | Decodes the encoded String value using the default encoding UTF-8. It is assumed the String value was encoded with the URLEncoder using the UTF-8 encoding. This method handles UnsupportedEncodingException by just returning the encodedValue | decode | {
"repo_name": "prasi-in/geode",
"path": "geode-core/src/main/java/org/apache/geode/management/internal/web/shell/AbstractHttpOperationInvoker.java",
"license": "apache-2.0",
"size": 38481
} | [
"org.apache.geode.management.internal.web.util.UriUtils"
] | import org.apache.geode.management.internal.web.util.UriUtils; | import org.apache.geode.management.internal.web.util.*; | [
"org.apache.geode"
] | org.apache.geode; | 680,482 |
public void updateTag ( Tag tag ) throws DotDataException; | void function ( Tag tag ) throws DotDataException; | /**
* Update a tag object by tagId
* @param tag Tag object to update
* @throws DotDataException
*/ | Update a tag object by tagId | updateTag | {
"repo_name": "dotCMS/core",
"path": "dotCMS/src/main/java/com/dotmarketing/tag/business/TagFactory.java",
"license": "gpl-3.0",
"size": 6403
} | [
"com.dotmarketing.exception.DotDataException",
"com.dotmarketing.tag.model.Tag"
] | import com.dotmarketing.exception.DotDataException; import com.dotmarketing.tag.model.Tag; | import com.dotmarketing.exception.*; import com.dotmarketing.tag.model.*; | [
"com.dotmarketing.exception",
"com.dotmarketing.tag"
] | com.dotmarketing.exception; com.dotmarketing.tag; | 2,383,204 |
if ( StringHelper.isEmpty( name ) ) {
return null;
}
final String trimmedName = name.trim();
if ( isQuoted( trimmedName ) ) {
final String bareName = trimmedName.substring( 1, trimmedName.length() - 1 );
return new Identifier( bareName, true );
}
else {
return new Identifier( trimmedName, false );
}
} | if ( StringHelper.isEmpty( name ) ) { return null; } final String trimmedName = name.trim(); if ( isQuoted( trimmedName ) ) { final String bareName = trimmedName.substring( 1, trimmedName.length() - 1 ); return new Identifier( bareName, true ); } else { return new Identifier( trimmedName, false ); } } | /**
* Means to generate an {@link Identifier} instance from its simple name
*
* @param name The name
*
* @return The identifier form of the name.
*/ | Means to generate an <code>Identifier</code> instance from its simple name | toIdentifier | {
"repo_name": "kevin-chen-hw/LDAE",
"path": "com.huawei.soa.ldae/src/main/java/org/hibernate/metamodel/relational/Identifier.java",
"license": "lgpl-2.1",
"size": 3872
} | [
"org.hibernate.internal.util.StringHelper"
] | import org.hibernate.internal.util.StringHelper; | import org.hibernate.internal.util.*; | [
"org.hibernate.internal"
] | org.hibernate.internal; | 836,999 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.