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 LinkedList<Patch> patch_make(LinkedList<Diff> diffs) {
if (diffs == null) {
throw new IllegalArgumentException("Null inputs. (patch_make)");
}
// No origin string provided, compute our own.
String text1 = diff_text1(diffs);
return patch_make(text1, diffs);
} | LinkedList<Patch> function(LinkedList<Diff> diffs) { if (diffs == null) { throw new IllegalArgumentException(STR); } String text1 = diff_text1(diffs); return patch_make(text1, diffs); } | /**
* Compute a list of patches to turn text1 into text2.
* text1 will be derived from the provided diffs.
* @param diffs Array of Diff objects for text1 to text2.
* @return LinkedList of Patch objects.
*/ | Compute a list of patches to turn text1 into text2. text1 will be derived from the provided diffs | patch_make | {
"repo_name": "mgreau/when-websocket-met-asciidoctor",
"path": "src/main/java/com/mgreau/wwsmad/diff/diff_match_patch.java",
"license": "mit",
"size": 89017
} | [
"java.util.LinkedList"
] | import java.util.LinkedList; | import java.util.*; | [
"java.util"
] | java.util; | 1,411,483 |
@Bean
@Scope("prototype")
public RegistrationHttpEndpoint registrationHttpEndpoint() {
return new RegistrationHttpEndpoint(vertx());
} | @Scope(STR) RegistrationHttpEndpoint function() { return new RegistrationHttpEndpoint(vertx()); } | /**
* Creates a new instance of an HTTP protocol handler for Hono's <em>Device Registration</em> API.
*
* @return The handler.
*/ | Creates a new instance of an HTTP protocol handler for Hono's Device Registration API | registrationHttpEndpoint | {
"repo_name": "iotbricks/iotbricks",
"path": "integrations/hono/device-registry/src/main/java/org/eclipse/hono/deviceregistry/ApplicationConfig.java",
"license": "epl-1.0",
"size": 7302
} | [
"org.eclipse.hono.service.registration.RegistrationHttpEndpoint",
"org.springframework.context.annotation.Scope"
] | import org.eclipse.hono.service.registration.RegistrationHttpEndpoint; import org.springframework.context.annotation.Scope; | import org.eclipse.hono.service.registration.*; import org.springframework.context.annotation.*; | [
"org.eclipse.hono",
"org.springframework.context"
] | org.eclipse.hono; org.springframework.context; | 2,913,927 |
default double swipeRatio(@NotNull InputHelperType helper) {
return 1d;
} | default double swipeRatio(@NotNull InputHelperType helper) { return 1d; } | /**
* Get the swipe ratio to use with
* {@link AndroidChoiceMultiSwipeType#rxe_elementSwipeRatio()}.
* @param helper {@link InputHelperType} instance.
* @return {@link Double} value.
*/ | Get the swipe ratio to use with <code>AndroidChoiceMultiSwipeType#rxe_elementSwipeRatio()</code> | swipeRatio | {
"repo_name": "protoman92/XTestKit",
"path": "src/main/java/org/swiften/xtestkit/base/model/ChoiceInputType.java",
"license": "apache-2.0",
"size": 3382
} | [
"org.jetbrains.annotations.NotNull"
] | import org.jetbrains.annotations.NotNull; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 1,786,032 |
@Override
public String getDestination(String function, ClipboardSessionController clipboardSC,
HttpRequest request) {
SilverTrace.info("clipboardPeas",
"ClipboardRequestRooter.getDestination()", "root.MSG_GEN_ENTER_METHOD",
" componentName = " + clipboardSC.getClass().getName() + "; funct... | String function(String function, ClipboardSessionController clipboardSC, HttpRequest request) { SilverTrace.info(STR, STR, STR, STR + clipboardSC.getClass().getName() + STR + function); String destination; if (function.startsWith(STR)) { destination = STR; } else if (function.startsWith("paste")) { clipboardSC.setCompo... | /**
* This method has to be implemented by the component request rooter it has to compute a
* destination page
*
* @param function The entering request function (ex : "Main.jsp")
* @param clipboardSC The component Session Control, build and initialised.
* @param request
* @return The complete desti... | This method has to be implemented by the component request rooter it has to compute a destination page | getDestination | {
"repo_name": "CecileBONIN/Silverpeas-Core",
"path": "war-core/src/main/java/com/stratelia/silverpeas/clipboardPeas/servlets/ClipboardRequestRouter.java",
"license": "agpl-3.0",
"size": 9137
} | [
"com.silverpeas.util.StringUtil",
"com.silverpeas.util.clipboard.ClipboardException",
"com.stratelia.silverpeas.clipboardPeas.control.ClipboardSessionController",
"com.stratelia.silverpeas.peasCore.URLManager",
"com.stratelia.silverpeas.silvertrace.SilverTrace",
"org.silverpeas.servlet.HttpRequest"
] | import com.silverpeas.util.StringUtil; import com.silverpeas.util.clipboard.ClipboardException; import com.stratelia.silverpeas.clipboardPeas.control.ClipboardSessionController; import com.stratelia.silverpeas.peasCore.URLManager; import com.stratelia.silverpeas.silvertrace.SilverTrace; import org.silverpeas.servlet.Ht... | import com.silverpeas.util.*; import com.silverpeas.util.clipboard.*; import com.stratelia.silverpeas.*; import com.stratelia.silverpeas.silvertrace.*; import org.silverpeas.servlet.*; | [
"com.silverpeas.util",
"com.stratelia.silverpeas",
"org.silverpeas.servlet"
] | com.silverpeas.util; com.stratelia.silverpeas; org.silverpeas.servlet; | 2,368,994 |
@Deprecated
public static void waitForTableToBecomeActive(AmazonDynamoDB dynamo, String tableName, int timeout, int interval) {
try {
awaitTableToBecomeActive(dynamo, tableName, timeout, interval);
} catch (InterruptedException e) {
throw new AmazonClientException("Interr... | static void function(AmazonDynamoDB dynamo, String tableName, int timeout, int interval) { try { awaitTableToBecomeActive(dynamo, tableName, timeout, interval); } catch (InterruptedException e) { throw new AmazonClientException(STR, e); } } | /**
* Waits up to a specified amount of time for a specified AWS DynamoDB
* table to move into the <code>ACTIVE</code> state. If the table doesn't
* transition to the <code>ACTIVE</code> state, then an
* AmazonClientException is thrown.
*
* @param dynamo
* The AWS DynamoDB ... | Waits up to a specified amount of time for a specified AWS DynamoDB table to move into the <code>ACTIVE</code> state. If the table doesn't transition to the <code>ACTIVE</code> state, then an AmazonClientException is thrown | waitForTableToBecomeActive | {
"repo_name": "mhurne/aws-sdk-java",
"path": "aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/util/Tables.java",
"license": "apache-2.0",
"size": 8176
} | [
"com.amazonaws.AmazonClientException",
"com.amazonaws.services.dynamodbv2.AmazonDynamoDB"
] | import com.amazonaws.AmazonClientException; import com.amazonaws.services.dynamodbv2.AmazonDynamoDB; | import com.amazonaws.*; import com.amazonaws.services.dynamodbv2.*; | [
"com.amazonaws",
"com.amazonaws.services"
] | com.amazonaws; com.amazonaws.services; | 1,453,107 |
ColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle); | ColumnMetadata getColumnMetadata(Session session, TableHandle tableHandle, ColumnHandle columnHandle); | /**
* Gets the metadata for the specified table column.
*
* @throws RuntimeException if table or column handles are no longer valid
*/ | Gets the metadata for the specified table column | getColumnMetadata | {
"repo_name": "stewartpark/presto",
"path": "presto-main/src/main/java/com/facebook/presto/metadata/Metadata.java",
"license": "apache-2.0",
"size": 14812
} | [
"com.facebook.presto.Session",
"com.facebook.presto.spi.ColumnHandle",
"com.facebook.presto.spi.ColumnMetadata"
] | import com.facebook.presto.Session; import com.facebook.presto.spi.ColumnHandle; import com.facebook.presto.spi.ColumnMetadata; | import com.facebook.presto.*; import com.facebook.presto.spi.*; | [
"com.facebook.presto"
] | com.facebook.presto; | 38,086 |
azure
.storageAccounts()
.manager()
.serviceClient()
.getManagementPolicies()
.getWithResponse("res6977", "sto2527", ManagementPolicyName.DEFAULT, Context.NONE);
} | azure .storageAccounts() .manager() .serviceClient() .getManagementPolicies() .getWithResponse(STR, STR, ManagementPolicyName.DEFAULT, Context.NONE); } | /**
* Sample code: StorageAccountGetManagementPolicies.
*
* @param azure The entry point for accessing resource management APIs in Azure.
*/ | Sample code: StorageAccountGetManagementPolicies | storageAccountGetManagementPolicies | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager/src/samples/java/com/azure/resourcemanager/storage/generated/ManagementPoliciesGetSamples.java",
"license": "mit",
"size": 1094
} | [
"com.azure.core.util.Context",
"com.azure.resourcemanager.storage.models.ManagementPolicyName"
] | import com.azure.core.util.Context; import com.azure.resourcemanager.storage.models.ManagementPolicyName; | import com.azure.core.util.*; import com.azure.resourcemanager.storage.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,476,876 |
public T caseMCommonPackageFile(MCommonPackageFile object) {
return null;
} | T function(MCommonPackageFile object) { return null; } | /**
* Returns the result of interpreting the object as an instance of '<em>MCommonPackageFile</em>'.
* @param object the target of the switch.
* @return the result of interpreting the object as an instance of '<em>MCommonPackageFile</em>'.
* @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
* @g... | Returns the result of interpreting the object as an instance of 'MCommonPackageFile' | caseMCommonPackageFile | {
"repo_name": "parraman/micobs",
"path": "mclev/domains/edroom/es.uah.aut.srg.micobs.mclev.domain.edroom/src/es/uah/aut/srg/micobs/mclev/domain/edroom/edroomdclass/util/edroomdclassSwitch.java",
"license": "epl-1.0",
"size": 28861
} | [
"es.uah.aut.srg.micobs.common.MCommonPackageFile"
] | import es.uah.aut.srg.micobs.common.MCommonPackageFile; | import es.uah.aut.srg.micobs.common.*; | [
"es.uah.aut"
] | es.uah.aut; | 1,478,997 |
@Test
public void testSuspectMembersNotCalledThroughPingThreadBeforeTimeout() {
long startTime = System.currentTimeMillis();
installAView();
InternalDistributedMember neighbor = gmsHealthMonitor.getNextNeighbor();
await().until(() -> gmsHealthMonitor.isSuspectMember(neighbor));
long endTime = S... | void function() { long startTime = System.currentTimeMillis(); installAView(); InternalDistributedMember neighbor = gmsHealthMonitor.getNextNeighbor(); await().until(() -> gmsHealthMonitor.isSuspectMember(neighbor)); long endTime = System.currentTimeMillis(); assertThat(memberTimeout + 100).isLessThanOrEqualTo(endTime ... | /***
* checks ping thread didn't sends suspectMembers message before timeout
*/ | checks ping thread didn't sends suspectMembers message before timeout | testSuspectMembersNotCalledThroughPingThreadBeforeTimeout | {
"repo_name": "pdxrunner/geode",
"path": "geode-core/src/integrationTest/java/org/apache/geode/distributed/internal/membership/gms/fd/GMSHealthMonitorJUnitTest.java",
"license": "apache-2.0",
"size": 36244
} | [
"org.apache.geode.distributed.internal.membership.InternalDistributedMember",
"org.apache.geode.test.awaitility.GeodeAwaitility",
"org.assertj.core.api.Assertions"
] | import org.apache.geode.distributed.internal.membership.InternalDistributedMember; import org.apache.geode.test.awaitility.GeodeAwaitility; import org.assertj.core.api.Assertions; | import org.apache.geode.distributed.internal.membership.*; import org.apache.geode.test.awaitility.*; import org.assertj.core.api.*; | [
"org.apache.geode",
"org.assertj.core"
] | org.apache.geode; org.assertj.core; | 779,487 |
// <editor-fold defaultstate="collapsed" desc="HttpServlet methods. Click on the + sign on the left to edit the code.">
@Override
protected void doGet(HttpServletRequest request, HttpServletResponse response)
throws ServletException, IOException {
try {
processRequest(reques... | void function(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { try { processRequest(request, response); } catch (CerberusException ex) { LOG.warn(ex); } catch (JSONException ex) { LOG.warn(ex); } } | /**
* Handles the HTTP <code>GET</code> method.
*
* @param request servlet request
* @param response servlet response
* @throws ServletException if a servlet-specific error occurs
* @throws IOException if an I/O error occurs
*/ | Handles the HTTP <code>GET</code> method | doGet | {
"repo_name": "vertigo17/Cerberus",
"path": "source/src/main/java/org/cerberus/servlet/crud/transversaltables/UpdateParameter.java",
"license": "gpl-3.0",
"size": 9108
} | [
"java.io.IOException",
"javax.servlet.ServletException",
"javax.servlet.http.HttpServletRequest",
"javax.servlet.http.HttpServletResponse",
"org.cerberus.exception.CerberusException",
"org.json.JSONException"
] | import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import org.cerberus.exception.CerberusException; import org.json.JSONException; | import java.io.*; import javax.servlet.*; import javax.servlet.http.*; import org.cerberus.exception.*; import org.json.*; | [
"java.io",
"javax.servlet",
"org.cerberus.exception",
"org.json"
] | java.io; javax.servlet; org.cerberus.exception; org.json; | 2,638,124 |
public static boolean validateEncounterEntryId(EncounterEntry encounterEntry, DiagnosticChain diagnostics, Map<Object, Object> context) {
if (VALIDATE_ENCOUNTER_ENTRY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) {
OCL.Helper helper = EOCL_ENV.createOCLHelper();
helper.setContext(IHEPackage.Literals.ENCOUN... | static boolean function(EncounterEntry encounterEntry, DiagnosticChain diagnostics, Map<Object, Object> context) { if (VALIDATE_ENCOUNTER_ENTRY_ID__DIAGNOSTIC_CHAIN_MAP__EOCL_INV == null) { OCL.Helper helper = EOCL_ENV.createOCLHelper(); helper.setContext(IHEPackage.Literals.ENCOUNTER_ENTRY); try { VALIDATE_ENCOUNTER_E... | /**
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* <!-- begin-model-doc -->
* not self.id->isEmpty()
* @param encounterEntry The receiving '<em><b>Encounter Entry</b></em>' model object.
* @param diagnostics The chain of diagnostics to which problems are to be appended.
* @param context The ca... | not self.id->isEmpty() | validateEncounterEntryId | {
"repo_name": "drbgfc/mdht",
"path": "cda/deprecated/org.openhealthtools.mdht.uml.cda.ihe/src/org/openhealthtools/mdht/uml/cda/ihe/operations/EncounterEntryOperations.java",
"license": "epl-1.0",
"size": 15740
} | [
"java.util.Map",
"org.eclipse.emf.common.util.BasicDiagnostic",
"org.eclipse.emf.common.util.Diagnostic",
"org.eclipse.emf.common.util.DiagnosticChain",
"org.eclipse.ocl.ParserException",
"org.eclipse.ocl.ecore.Constraint",
"org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry",
"org.openhealthtools.md... | import java.util.Map; import org.eclipse.emf.common.util.BasicDiagnostic; import org.eclipse.emf.common.util.Diagnostic; import org.eclipse.emf.common.util.DiagnosticChain; import org.eclipse.ocl.ParserException; import org.eclipse.ocl.ecore.Constraint; import org.openhealthtools.mdht.uml.cda.ihe.EncounterEntry; import... | import java.util.*; import org.eclipse.emf.common.util.*; import org.eclipse.ocl.*; import org.eclipse.ocl.ecore.*; import org.openhealthtools.mdht.uml.cda.ihe.*; import org.openhealthtools.mdht.uml.cda.ihe.util.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.ocl",
"org.openhealthtools.mdht"
] | java.util; org.eclipse.emf; org.eclipse.ocl; org.openhealthtools.mdht; | 1,700,377 |
@ServiceMethod(returns = ReturnType.SINGLE)
void redeploy(
String resourceGroupName,
String vmScaleSetName,
VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs,
Context context); | @ServiceMethod(returns = ReturnType.SINGLE) void redeploy( String resourceGroupName, String vmScaleSetName, VirtualMachineScaleSetVMInstanceIDs vmInstanceIDs, Context context); | /**
* Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them
* back on.
*
* @param resourceGroupName The name of the resource group.
* @param vmScaleSetName The name of the VM scale set.
* @param vmInstanceIDs A list of virtual machi... | Shuts down all the virtual machines in the virtual machine scale set, moves them to a new node, and powers them back on | redeploy | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanagerhybrid/azure-resourcemanager-compute/src/main/java/com/azure/resourcemanager/compute/fluent/VirtualMachineScaleSetsClient.java",
"license": "mit",
"size": 129320
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.util.Context",
"com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceIDs"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.util.Context; import com.azure.resourcemanager.compute.models.VirtualMachineScaleSetVMInstanceIDs; | import com.azure.core.annotation.*; import com.azure.core.util.*; import com.azure.resourcemanager.compute.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 445,826 |
public Builder maxAge(int maxAge, TimeUnit timeUnit) {
if (maxAge < 0) throw new IllegalArgumentException("maxAge < 0: " + maxAge);
long maxAgeSecondsLong = timeUnit.toSeconds(maxAge);
this.maxAgeSeconds = maxAgeSecondsLong > Integer.MAX_VALUE
? Integer.MAX_VALUE
: (int) maxAge... | Builder function(int maxAge, TimeUnit timeUnit) { if (maxAge < 0) throw new IllegalArgumentException(STR + maxAge); long maxAgeSecondsLong = timeUnit.toSeconds(maxAge); this.maxAgeSeconds = maxAgeSecondsLong > Integer.MAX_VALUE ? Integer.MAX_VALUE : (int) maxAgeSecondsLong; return this; } | /**
* Sets the maximum age of a cached response. If the cache response's age exceeds {@code
* maxAge}, it will not be used and a network request will be made.
*
* @param maxAge a non-negative integer. This is stored and transmitted with {@link
* TimeUnit#SECONDS} precision; finer precision will... | Sets the maximum age of a cached response. If the cache response's age exceeds maxAge, it will not be used and a network request will be made | maxAge | {
"repo_name": "wfxiang08/okhttp",
"path": "okhttp/src/main/java/okhttp3/CacheControl.java",
"license": "apache-2.0",
"size": 12695
} | [
"java.util.concurrent.TimeUnit"
] | import java.util.concurrent.TimeUnit; | import java.util.concurrent.*; | [
"java.util"
] | java.util; | 1,855,689 |
protected String mapToStr(Map map)
{
StringBuilder sb = new StringBuilder();
if (map != null)
{
sb.append("[");
for (Iterator i = map.entrySet().iterator(); i.hasNext(); )
{
Entry entry = (Entry) i.next();
Object key = entry.getValue();
sb.append("[").append(key).append(":");
Object v... | String function(Map map) { StringBuilder sb = new StringBuilder(); if (map != null) { sb.append("["); for (Iterator i = map.entrySet().iterator(); i.hasNext(); ) { Entry entry = (Entry) i.next(); Object key = entry.getValue(); sb.append("[").append(key).append(":"); Object value = entry.getValue(); if (value instanceof... | /**
* Flatten a {@link java.util.Map} to a String
*
* @param map
* @return A string representation of the {@link java.util.Map}. Examples of results include:
* Standard key/value pairs: [[key1:value1], [key2:value2]]
* List values: [[key1:value1, value2], [key2:value3, value4]]
* ... | Flatten a <code>java.util.Map</code> to a String | mapToStr | {
"repo_name": "kingmook/sakai",
"path": "kernel/kernel-impl/src/main/java/org/sakaiproject/email/impl/BasicEmailService.java",
"license": "apache-2.0",
"size": 51869
} | [
"java.util.Collection",
"java.util.Iterator",
"java.util.Map"
] | import java.util.Collection; import java.util.Iterator; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,326,634 |
public static int readFully(InputStream fd, byte[] dst, int off)
throws IOException {
int r;
int len = 0;
while ((r = fd.read(dst, off, dst.length - off)) >= 0
&& len < dst.length) {
off += r;
len += r;
}
return len;
} | static int function(InputStream fd, byte[] dst, int off) throws IOException { int r; int len = 0; while ((r = fd.read(dst, off, dst.length - off)) >= 0 && len < dst.length) { off += r; len += r; } return len; } | /**
* Read the entire byte array into memory, unless input is shorter
*
* @param fd
* input stream to read the data from.
* @param dst
* buffer that must be fully populated, [off, off+len).
* @param off
* position within the buffer to start writing to.
* @return number... | Read the entire byte array into memory, unless input is shorter | readFully | {
"repo_name": "DanielliUrbieta/ProjetoHidraWS",
"path": "src/org/eclipse/jgit/util/IO.java",
"license": "gpl-2.0",
"size": 11521
} | [
"java.io.IOException",
"java.io.InputStream"
] | import java.io.IOException; import java.io.InputStream; | import java.io.*; | [
"java.io"
] | java.io; | 238,671 |
public static String toString(JSONObject object, String key) {
return toString(object, key, StringService.EMPTY_STRING) ;
}
| static String function(JSONObject object, String key) { return toString(object, key, StringService.EMPTY_STRING) ; } | /**
* Get key value from the given JSONObject and key.
*
* @param object JSONObject - the given JSONObject to read data.
* @param key String - the given object key.
* @return the object value or empty.
*/ | Get key value from the given JSONObject and key | toString | {
"repo_name": "inetcloud/iMail",
"path": "source/mail-admin-service/src/com/inet/web/service/mail/utils/WebCommonService.java",
"license": "gpl-2.0",
"size": 10432
} | [
"com.inet.base.service.StringService",
"net.sf.json.JSONObject"
] | import com.inet.base.service.StringService; import net.sf.json.JSONObject; | import com.inet.base.service.*; import net.sf.json.*; | [
"com.inet.base",
"net.sf.json"
] | com.inet.base; net.sf.json; | 261,643 |
InternalConfigurationData getInternalConfigurationData() throws PulsarAdminException; | InternalConfigurationData getInternalConfigurationData() throws PulsarAdminException; | /**
* Get the internal configuration data.
*
* @return internal configuration data.
*/ | Get the internal configuration data | getInternalConfigurationData | {
"repo_name": "merlimat/pulsar",
"path": "pulsar-client-admin/src/main/java/org/apache/pulsar/client/admin/Brokers.java",
"license": "apache-2.0",
"size": 4500
} | [
"org.apache.pulsar.common.conf.InternalConfigurationData"
] | import org.apache.pulsar.common.conf.InternalConfigurationData; | import org.apache.pulsar.common.conf.*; | [
"org.apache.pulsar"
] | org.apache.pulsar; | 2,791,447 |
public Observable<ServiceResponse<Void>> beginDeleteWithServiceResponseAsync(String resourceGroupName, String vpnSiteName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
... | Observable<ServiceResponse<Void>> function(String resourceGroupName, String vpnSiteName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (vpnSiteName == null) { throw new IllegalArgumentException(STR)... | /**
* Deletes a VpnSite.
*
* @param resourceGroupName The resource group name of the VpnSite.
* @param vpnSiteName The name of the VpnSite being deleted.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the {@link ServiceResponse} object if successful.
... | Deletes a VpnSite | beginDeleteWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2019_11_01/src/main/java/com/microsoft/azure/management/network/v2019_11_01/implementation/VpnSitesInner.java",
"license": "mit",
"size": 62670
} | [
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.rest.ServiceResponse; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 640,320 |
public static Date clearTime(final Date self) {
Calendar calendar = Calendar.getInstance();
calendar.setTime(self);
clearTimeCommon(calendar);
self.setTime(calendar.getTime().getTime());
return self;
} | static Date function(final Date self) { Calendar calendar = Calendar.getInstance(); calendar.setTime(self); clearTimeCommon(calendar); self.setTime(calendar.getTime().getTime()); return self; } | /**
* Clears the time portion of this Date instance; useful utility where
* it makes sense to compare month/day/year only portions of a Date.
*
* @param self a Date
* @return the Date but with the time portion cleared
* @since 1.6.7
*/ | Clears the time portion of this Date instance; useful utility where it makes sense to compare month/day/year only portions of a Date | clearTime | {
"repo_name": "Selventa/model-builder",
"path": "tools/groovy/src/src/main/org/codehaus/groovy/runtime/DateGroovyMethods.java",
"license": "apache-2.0",
"size": 22020
} | [
"java.util.Calendar",
"java.util.Date"
] | import java.util.Calendar; import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 396,164 |
public TypePriorities getImportedTypePriorities() {
return importedTypePriorities;
}
// private void setImportedExternalResourcesAndBindings() throws ResourceInitializationException {
// ResourceManagerConfiguration_impl rmc = ((ResourceManagerConfiguration_impl)
// aeDescription.getResourceManagerConfig... | TypePriorities function() { return importedTypePriorities; } | /**
* Gets the imported type priorities.
*
* @return the imported type priorities
*/ | Gets the imported type priorities | getImportedTypePriorities | {
"repo_name": "apache/uima-uimaj",
"path": "uimaj-ep-configurator/src/main/java/org/apache/uima/taeconfigurator/editors/MultiPageEditor.java",
"license": "apache-2.0",
"size": 143007
} | [
"org.apache.uima.resource.metadata.TypePriorities"
] | import org.apache.uima.resource.metadata.TypePriorities; | import org.apache.uima.resource.metadata.*; | [
"org.apache.uima"
] | org.apache.uima; | 459,922 |
@Override public void exitStr(@NotNull MicroParser.StrContext ctx) { } | @Override public void exitStr(@NotNull MicroParser.StrContext ctx) { } | /**
* {@inheritDoc}
* <p/>
* The default implementation does nothing.
*/ | The default implementation does nothing | enterStr | {
"repo_name": "ssabpisa/compiler-468",
"path": "ssabpisa/build/MicroBaseListener.java",
"license": "agpl-3.0",
"size": 15720
} | [
"org.antlr.v4.runtime.misc.NotNull"
] | import org.antlr.v4.runtime.misc.NotNull; | import org.antlr.v4.runtime.misc.*; | [
"org.antlr.v4"
] | org.antlr.v4; | 1,051,024 |
private void createLayouts(int widthItems, int widthLabel) {
if (itemsLayout == null || itemsLayout.getWidth() > widthItems) {
itemsLayout = new StaticLayout(buildText(isScrollingPerformed), itemsPaint, widthItems,
widthLabel > 0 ? Layout.Alignment.ALIGN_OPPOSITE : Layout.... | void function(int widthItems, int widthLabel) { if (itemsLayout == null itemsLayout.getWidth() > widthItems) { itemsLayout = new StaticLayout(buildText(isScrollingPerformed), itemsPaint, widthItems, widthLabel > 0 ? Layout.Alignment.ALIGN_OPPOSITE : Layout.Alignment.ALIGN_CENTER, 1, ADDITIONAL_ITEM_HEIGHT, false); } el... | /**
* Creates layouts.
*
* @param widthItems width of items layout
* @param widthLabel width of label layout
*/ | Creates layouts | createLayouts | {
"repo_name": "gizwits/Gizwits-SmartLights_Android",
"path": "src/com/gizwits/framework/widget/WheelView.java",
"license": "mit",
"size": 31428
} | [
"android.text.Layout",
"android.text.StaticLayout"
] | import android.text.Layout; import android.text.StaticLayout; | import android.text.*; | [
"android.text"
] | android.text; | 2,331,703 |
public void testAssociationElements2() throws Exception
{
Class targetClass = Chain.class;
Class associatedClass = Pendant.class;
validateClassAssociationElements(targetClass, associatedClass, "pendant","0","1");
}
| void function() throws Exception { Class targetClass = Chain.class; Class associatedClass = Pendant.class; validateClassAssociationElements(targetClass, associatedClass, STR,"0","1"); } | /**
* Verifies that association elements
* corresponding to the Class are present in the XSD
* Verifies that the Class attributes are present in the XSD
*
* @throws Exception
*/ | Verifies that association elements corresponding to the Class are present in the XSD Verifies that the Class attributes are present in the XSD | testAssociationElements2 | {
"repo_name": "NCIP/cacore-sdk",
"path": "sdk-toolkit/iso-example-project/junit/src/test/xsd/O2OBidirectionalWJoinXSDTest.java",
"license": "bsd-3-clause",
"size": 2928
} | [
"gov.nih.nci.cacoresdk.domain.onetoone.bidirectional.withjoin.Chain",
"gov.nih.nci.cacoresdk.domain.onetoone.bidirectional.withjoin.Pendant"
] | import gov.nih.nci.cacoresdk.domain.onetoone.bidirectional.withjoin.Chain; import gov.nih.nci.cacoresdk.domain.onetoone.bidirectional.withjoin.Pendant; | import gov.nih.nci.cacoresdk.domain.onetoone.bidirectional.withjoin.*; | [
"gov.nih.nci"
] | gov.nih.nci; | 310,125 |
@Override
public synchronized void append(LoggingEvent event) throws FlumeException {
//If rpcClient is null, it means either this appender object was never
//setup by setting hostname and port and then calling activateOptions
//or this appender object was closed by calling close(), so we throw an
/... | synchronized void function(LoggingEvent event) throws FlumeException { if (rpcClient == null) { String errorMsg = STR + STR; LogLog.error(errorMsg); if (unsafeMode) { return; } throw new FlumeException(errorMsg); } if (!rpcClient.isActive()) { reconnect(); } Map<String, String> hdrs = new HashMap<String, String>(); hdr... | /**
* Append the LoggingEvent, to send to the first Flume hop.
* @param event The LoggingEvent to be appended to the flume.
* @throws FlumeException if the appender was closed,
* or the hostname and port were not setup, there was a timeout, or there
* was a connection error.
*/ | Append the LoggingEvent, to send to the first Flume hop | append | {
"repo_name": "wangcy6/storm_app",
"path": "frame/apache-flume-1.7.0-src/flume-ng-clients/flume-ng-log4jappender/src/main/java/org/apache/flume/clients/log4jappender/Log4jAppender.java",
"license": "apache-2.0",
"size": 11166
} | [
"java.io.ByteArrayOutputStream",
"java.nio.charset.Charset",
"java.util.HashMap",
"java.util.Map",
"org.apache.avro.Schema",
"org.apache.avro.generic.GenericRecord",
"org.apache.avro.io.BinaryEncoder",
"org.apache.avro.io.DatumWriter",
"org.apache.avro.reflect.ReflectData",
"org.apache.avro.specif... | import java.io.ByteArrayOutputStream; import java.nio.charset.Charset; import java.util.HashMap; import java.util.Map; import org.apache.avro.Schema; import org.apache.avro.generic.GenericRecord; import org.apache.avro.io.BinaryEncoder; import org.apache.avro.io.DatumWriter; import org.apache.avro.reflect.ReflectData; ... | import java.io.*; import java.nio.charset.*; import java.util.*; import org.apache.avro.*; import org.apache.avro.generic.*; import org.apache.avro.io.*; import org.apache.avro.reflect.*; import org.apache.avro.specific.*; import org.apache.flume.*; import org.apache.flume.event.*; import org.apache.log4j.helpers.*; im... | [
"java.io",
"java.nio",
"java.util",
"org.apache.avro",
"org.apache.flume",
"org.apache.log4j"
] | java.io; java.nio; java.util; org.apache.avro; org.apache.flume; org.apache.log4j; | 1,263,543 |
//TODO the (short) cast is nasty - should consider using either short or int end to end
public synchronized short getSymbol(final Element element) {
return (short) localNameSymbols.getId(element.getLocalName());
} | synchronized short function(final Element element) { return (short) localNameSymbols.getId(element.getLocalName()); } | /**
* Return a unique id for the local node name of the specified element.
*
* @param element
*/ | Return a unique id for the local node name of the specified element | getSymbol | {
"repo_name": "zwobit/exist",
"path": "src/org/exist/dom/persistent/SymbolTable.java",
"license": "lgpl-2.1",
"size": 19400
} | [
"org.w3c.dom.Element"
] | import org.w3c.dom.Element; | import org.w3c.dom.*; | [
"org.w3c.dom"
] | org.w3c.dom; | 941,530 |
void returnProcessedBytes(Http2Stream http2Stream, int bytes) {
try {
decoder().flowController().consumeBytes(http2Stream, bytes);
} catch (Http2Exception e) {
throw new RuntimeException(e);
}
} | void returnProcessedBytes(Http2Stream http2Stream, int bytes) { try { decoder().flowController().consumeBytes(http2Stream, bytes); } catch (Http2Exception e) { throw new RuntimeException(e); } } | /**
* Returns the given processed bytes back to inbound flow control.
*/ | Returns the given processed bytes back to inbound flow control | returnProcessedBytes | {
"repo_name": "LuminateWireless/grpc-java",
"path": "netty/src/main/java/io/grpc/netty/NettyServerHandler.java",
"license": "bsd-3-clause",
"size": 18272
} | [
"io.netty.handler.codec.http2.Http2Exception",
"io.netty.handler.codec.http2.Http2Stream"
] | import io.netty.handler.codec.http2.Http2Exception; import io.netty.handler.codec.http2.Http2Stream; | import io.netty.handler.codec.http2.*; | [
"io.netty.handler"
] | io.netty.handler; | 1,179,898 |
@Accessor(name = "intrinsics", type = Accessor.Type.Getter)
public static Object intrinsics(ExecutionContext cx, Object thisValue) {
Realm realm = thisRealmValue(cx, thisValue, "Reflect.Realm.prototype.intrinsics");
OrdinaryObject table = ObjectCreate(cx... | @Accessor(name = STR, type = Accessor.Type.Getter) static Object function(ExecutionContext cx, Object thisValue) { Realm realm = thisRealmValue(cx, thisValue, STR); OrdinaryObject table = ObjectCreate(cx, Intrinsics.ObjectPrototype); for (Intrinsics intrinsic : Intrinsics.values()) { if (intrinsic.isInternal()) { conti... | /**
* 26.?.3.4 get Reflect.Realm.prototype.intrinsics
*
* @param cx
* the execution context
* @param thisValue
* the function this-value
* @return the intrinsics object instance
*/ | 26.?.3.4 get Reflect.Realm.prototype.intrinsics | intrinsics | {
"repo_name": "anba/es6draft",
"path": "src/main/java/com/github/anba/es6draft/runtime/objects/reflect/RealmPrototype.java",
"license": "mit",
"size": 15410
} | [
"com.github.anba.es6draft.runtime.AbstractOperations",
"com.github.anba.es6draft.runtime.ExecutionContext",
"com.github.anba.es6draft.runtime.Realm",
"com.github.anba.es6draft.runtime.internal.Properties",
"com.github.anba.es6draft.runtime.types.Intrinsics",
"com.github.anba.es6draft.runtime.types.Type",
... | import com.github.anba.es6draft.runtime.AbstractOperations; import com.github.anba.es6draft.runtime.ExecutionContext; import com.github.anba.es6draft.runtime.Realm; import com.github.anba.es6draft.runtime.internal.Properties; import com.github.anba.es6draft.runtime.types.Intrinsics; import com.github.anba.es6draft.runt... | import com.github.anba.es6draft.runtime.*; import com.github.anba.es6draft.runtime.internal.*; import com.github.anba.es6draft.runtime.types.*; import com.github.anba.es6draft.runtime.types.builtins.*; | [
"com.github.anba"
] | com.github.anba; | 1,511,157 |
public void broadcastTradesDownloaded() {
Intent localIntent = new Intent(MainActivity.DownloadStateReceiver.ACTION);
localIntent.putExtra(MainActivity.DownloadStateReceiver.TYPE, MainActivity.DownloadStateReceiver.KEY_TRADES_DOWNLOADED);
LocalBroadcastManager.getInstance(this).sendBroadcas... | void function() { Intent localIntent = new Intent(MainActivity.DownloadStateReceiver.ACTION); localIntent.putExtra(MainActivity.DownloadStateReceiver.TYPE, MainActivity.DownloadStateReceiver.KEY_TRADES_DOWNLOADED); LocalBroadcastManager.getInstance(this).sendBroadcast(localIntent); } | /**
* Broadcasts information about finished downloading back to MainActivity
*/ | Broadcasts information about finished downloading back to MainActivity | broadcastTradesDownloaded | {
"repo_name": "shmoula/Nawa",
"path": "app/src/main/java/cz/shmoula/nawa/service/DownloadService.java",
"license": "mit",
"size": 5854
} | [
"android.content.Intent",
"android.support.v4.content.LocalBroadcastManager",
"cz.shmoula.nawa.MainActivity"
] | import android.content.Intent; import android.support.v4.content.LocalBroadcastManager; import cz.shmoula.nawa.MainActivity; | import android.content.*; import android.support.v4.content.*; import cz.shmoula.nawa.*; | [
"android.content",
"android.support",
"cz.shmoula.nawa"
] | android.content; android.support; cz.shmoula.nawa; | 1,762,136 |
public static Connection connectToDatabaseServer(Properties config, String prefix) throws SQLException {
return doConnectToDatabaseServer(config, prefix, "");
} | static Connection function(Properties config, String prefix) throws SQLException { return doConnectToDatabaseServer(config, prefix, ""); } | /**
* Connect to the database server without connecting to a specific
* database on that server.
*
* @param configProperties CloudCoder configuration properties
* @param prefix the prefix for database-related configuration properties (e.g., "cloudcoder.db")
* @return the Connection to the databas... | Connect to the database server without connecting to a specific database on that server | connectToDatabaseServer | {
"repo_name": "daveho/CloudCoder",
"path": "CloudCoderModelClassesPersistence/src/org/cloudcoder/app/server/persist/util/DBUtil.java",
"license": "agpl-3.0",
"size": 34681
} | [
"java.sql.Connection",
"java.sql.SQLException",
"java.util.Properties"
] | import java.sql.Connection; import java.sql.SQLException; import java.util.Properties; | import java.sql.*; import java.util.*; | [
"java.sql",
"java.util"
] | java.sql; java.util; | 250,228 |
public static Date getSubElementValueAsDate(Element element, String subElementName){
Element e = getElement(element, subElementName);
if(e == null){
return null;
}
return getDate(e.getText());
} | static Date function(Element element, String subElementName){ Element e = getElement(element, subElementName); if(e == null){ return null; } return getDate(e.getText()); } | /**
* Retrieves the text value of the subelement as a date.
*
* @param element The element.
* @param subElementName The name of the sub element.
* @return The text value as a date.
*/ | Retrieves the text value of the subelement as a date | getSubElementValueAsDate | {
"repo_name": "SynthesisProject/server",
"path": "synthesis-api/src/main/java/coza/opencollab/synthesis/service/api/util/impl/DomHelper.java",
"license": "agpl-3.0",
"size": 6863
} | [
"java.util.Date",
"org.dom4j.Element"
] | import java.util.Date; import org.dom4j.Element; | import java.util.*; import org.dom4j.*; | [
"java.util",
"org.dom4j"
] | java.util; org.dom4j; | 2,820,056 |
protected ModuleDef[] provideExtraModuleDefs(ServletContext context)
{
return new ModuleDef[0];
} | ModuleDef[] function(ServletContext context) { return new ModuleDef[0]; } | /**
* Overridden in subclasses to provide additional module definitions beyond those normally
* located. This
* implementation returns an empty array.
*/ | Overridden in subclasses to provide additional module definitions beyond those normally located. This implementation returns an empty array | provideExtraModuleDefs | {
"repo_name": "ganshane/lichen",
"path": "lichen-struts/src/main/java/lichen/struts/services/TapestryIocListener.java",
"license": "apache-2.0",
"size": 1844
} | [
"javax.servlet.ServletContext",
"org.apache.tapestry5.ioc.def.ModuleDef"
] | import javax.servlet.ServletContext; import org.apache.tapestry5.ioc.def.ModuleDef; | import javax.servlet.*; import org.apache.tapestry5.ioc.def.*; | [
"javax.servlet",
"org.apache.tapestry5"
] | javax.servlet; org.apache.tapestry5; | 1,872,407 |
@Override
public boolean closeIt()
{
log.info(toString());
// Before Close
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_CLOSE);
if (m_processMsg != null)
return false;
// After Close
m_processMsg = ModelValidationEngine.get().fireDocValidate(this, Mod... | boolean function() { log.info(toString()); m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_BEFORE_CLOSE); if (m_processMsg != null) return false; m_processMsg = ModelValidationEngine.get().fireDocValidate(this, ModelValidator.TIMING_AFTER_CLOSE); if (m_processMsg != null) return f... | /**
* Close Document.
*
* @return true if success
*/ | Close Document | closeIt | {
"repo_name": "klst-com/metasfresh",
"path": "de.metas.contracts/src/main/java/de/metas/flatrate/model/MCFlatrateTransition.java",
"license": "gpl-2.0",
"size": 6618
} | [
"org.compiere.model.ModelValidationEngine",
"org.compiere.model.ModelValidator"
] | import org.compiere.model.ModelValidationEngine; import org.compiere.model.ModelValidator; | import org.compiere.model.*; | [
"org.compiere.model"
] | org.compiere.model; | 69,264 |
private String getBasicAuthHeaders(MessageContext msgCtx) {
Map map = (Map) msgCtx.getProperty(MessageContext.TRANSPORT_HEADERS);
if(map == null) {
return null;
}
String tmp = (String) map.get("Authorization");
if (tmp == null) {
tmp = (String) map.... | String function(MessageContext msgCtx) { Map map = (Map) msgCtx.getProperty(MessageContext.TRANSPORT_HEADERS); if(map == null) { return null; } String tmp = (String) map.get(STR); if (tmp == null) { tmp = (String) map.get(STR); } if (tmp != null && tmp.trim().startsWith(STR)) { return tmp; } else { return null; } } | /**
* Utility method to return basic auth transport headers if present
* @return
*/ | Utility method to return basic auth transport headers if present | getBasicAuthHeaders | {
"repo_name": "thariyarox/ORG-carbon-identity",
"path": "components/security/org.wso2.carbon.security.mgt/src/main/java/org/wso2/carbon/security/pox/POXSecurityHandler.java",
"license": "apache-2.0",
"size": 13952
} | [
"java.util.Map",
"org.apache.axis2.context.MessageContext"
] | import java.util.Map; import org.apache.axis2.context.MessageContext; | import java.util.*; import org.apache.axis2.context.*; | [
"java.util",
"org.apache.axis2"
] | java.util; org.apache.axis2; | 210,221 |
private void update(Object oid, Exchange exchange) {
Object obj = ExchangeUtils.getSource(this.source, exchange, Object.class);
info(this,"Update("+oid+").obj:"+obj);
getCache().lock(oid);
getCache().replace(oid, obj);
getCache().unlock(oid);
} | void function(Object oid, Exchange exchange) { Object obj = ExchangeUtils.getSource(this.source, exchange, Object.class); info(this,STR+oid+STR+obj); getCache().lock(oid); getCache().replace(oid, obj); getCache().unlock(oid); } | /**
* update an object in your cache (the whole object will be replaced)
*/ | update an object in your cache (the whole object will be replaced) | update | {
"repo_name": "ms123s/simpl4-src",
"path": "bundles/camel/src/main/java/org/ms123/common/camel/components/hazelcast/HazelcastMapProducer.java",
"license": "apache-2.0",
"size": 5112
} | [
"com.jcabi.log.Logger",
"org.apache.camel.Exchange",
"org.ms123.common.camel.api.ExchangeUtils"
] | import com.jcabi.log.Logger; import org.apache.camel.Exchange; import org.ms123.common.camel.api.ExchangeUtils; | import com.jcabi.log.*; import org.apache.camel.*; import org.ms123.common.camel.api.*; | [
"com.jcabi.log",
"org.apache.camel",
"org.ms123.common"
] | com.jcabi.log; org.apache.camel; org.ms123.common; | 807,953 |
public CmsResourceState getResourceState() {
return m_resourceState;
} | CmsResourceState function() { return m_resourceState; } | /**
* Returns the resource state.<p>
*
* @return the resource state
*/ | Returns the resource state | getResourceState | {
"repo_name": "ggiudetti/opencms-core",
"path": "src/org/opencms/ade/sitemap/shared/CmsAdditionalEntryInfo.java",
"license": "lgpl-2.1",
"size": 2427
} | [
"org.opencms.db.CmsResourceState"
] | import org.opencms.db.CmsResourceState; | import org.opencms.db.*; | [
"org.opencms.db"
] | org.opencms.db; | 2,571,883 |
public void addTrusted(final UUID uuid) {
if (this.getTrusted().add(uuid)) DBFunc.setTrusted(this, uuid);
} | void function(final UUID uuid) { if (this.getTrusted().add(uuid)) DBFunc.setTrusted(this, uuid); } | /**
* Add someone as a helper (updates database as well)
*
* @param uuid
*/ | Add someone as a helper (updates database as well) | addTrusted | {
"repo_name": "PiLogic/PlotSquared",
"path": "src/main/java/com/intellectualcrafters/plot/object/Plot.java",
"license": "gpl-3.0",
"size": 28745
} | [
"com.intellectualcrafters.plot.database.DBFunc"
] | import com.intellectualcrafters.plot.database.DBFunc; | import com.intellectualcrafters.plot.database.*; | [
"com.intellectualcrafters.plot"
] | com.intellectualcrafters.plot; | 2,797,841 |
public static void assertWarning(List<Issue> issues, EObject model, EClass objectType, String code,
String... messageParts) {
assertIssue(issues, Severity.WARNING, model, objectType, code, messageParts);
} | static void function(List<Issue> issues, EObject model, EClass objectType, String code, String... messageParts) { assertIssue(issues, Severity.WARNING, model, objectType, code, messageParts); } | /** Assert that the given warning is inside the list of issues.
*
* @param issues the list of issues.
* @param severity the expected severity.
* @param model the issued model.
* @param objectType the type of the object.
* @param code the issue code.
* @param messageParts the parts of the issue message tha... | Assert that the given warning is inside the list of issues | assertWarning | {
"repo_name": "sarl/sarl",
"path": "tests/io.sarl.tests.api/src/main/java/io/sarl/tests/api/tools/TestAssertions.java",
"license": "apache-2.0",
"size": 39628
} | [
"java.util.List",
"org.eclipse.emf.ecore.EClass",
"org.eclipse.emf.ecore.EObject",
"org.eclipse.xtext.diagnostics.Severity",
"org.eclipse.xtext.validation.Issue"
] | import java.util.List; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EObject; import org.eclipse.xtext.diagnostics.Severity; import org.eclipse.xtext.validation.Issue; | import java.util.*; import org.eclipse.emf.ecore.*; import org.eclipse.xtext.diagnostics.*; import org.eclipse.xtext.validation.*; | [
"java.util",
"org.eclipse.emf",
"org.eclipse.xtext"
] | java.util; org.eclipse.emf; org.eclipse.xtext; | 2,093,463 |
public boolean executeKeyEvent(KeyEvent event) {
boolean handled = false;
if (event.getAction() == KeyEvent.ACTION_DOWN) {
switch (event.getKeyCode()) {
case KeyEvent.KEYCODE_DPAD_LEFT:
handled = arrowScroll(FOCUS_LEFT);
break;
case KeyEvent.KEYCODE_DPAD_RIGHT:
handled = arrowScroll(FOCUS_RI... | boolean function(KeyEvent event) { boolean handled = false; if (event.getAction() == KeyEvent.ACTION_DOWN) { switch (event.getKeyCode()) { case KeyEvent.KEYCODE_DPAD_LEFT: handled = arrowScroll(FOCUS_LEFT); break; case KeyEvent.KEYCODE_DPAD_RIGHT: handled = arrowScroll(FOCUS_RIGHT); break; case KeyEvent.KEYCODE_TAB: if... | /**
* You can call this function yourself to have the scroll view perform
* scrolling from a key event, just as if the event had been dispatched to
* it by the view hierarchy.
*
* @param event The key event to execute.
* @return Return true if the event was handled, else false.
*/ | You can call this function yourself to have the scroll view perform scrolling from a key event, just as if the event had been dispatched to it by the view hierarchy | executeKeyEvent | {
"repo_name": "Malabarba/DroidMage",
"path": "src/libs/com/jeremyfeinstein/slidingmenu/lib/CustomViewAbove.java",
"license": "mit",
"size": 29784
} | [
"android.os.Build",
"android.support.v4.view.KeyEventCompat",
"android.view.KeyEvent"
] | import android.os.Build; import android.support.v4.view.KeyEventCompat; import android.view.KeyEvent; | import android.os.*; import android.support.v4.view.*; import android.view.*; | [
"android.os",
"android.support",
"android.view"
] | android.os; android.support; android.view; | 1,108,216 |
@Test
public void testSimpleRdnNoValueStaticSerialization() throws LdapException, IOException, ClassNotFoundException
{
Rdn rdn = new Rdn( " ABC =" );
rdn.normalize();
ByteArrayOutputStream baos = new ByteArrayOutputStream();
ObjectOutputStream out = new ObjectOutputStream(... | void function() throws LdapException, IOException, ClassNotFoundException { Rdn rdn = new Rdn( STR ); rdn.normalize(); ByteArrayOutputStream baos = new ByteArrayOutputStream(); ObjectOutputStream out = new ObjectOutputStream( baos ); rdn.writeExternal( out ); ObjectInputStream in = null; byte[] data = baos.toByteArray(... | /**
* Test serialization of a simple Rdn with no value
*/ | Test serialization of a simple Rdn with no value | testSimpleRdnNoValueStaticSerialization | {
"repo_name": "darranl/directory-shared",
"path": "ldap/model/src/test/java/org/apache/directory/api/ldap/model/name/RdnSerializationTest.java",
"license": "apache-2.0",
"size": 8959
} | [
"java.io.ByteArrayInputStream",
"java.io.ByteArrayOutputStream",
"java.io.IOException",
"java.io.ObjectInputStream",
"java.io.ObjectOutputStream",
"org.apache.directory.api.ldap.model.exception.LdapException",
"org.apache.directory.api.ldap.model.name.Rdn",
"org.junit.Assert"
] | import java.io.ByteArrayInputStream; import java.io.ByteArrayOutputStream; import java.io.IOException; import java.io.ObjectInputStream; import java.io.ObjectOutputStream; import org.apache.directory.api.ldap.model.exception.LdapException; import org.apache.directory.api.ldap.model.name.Rdn; import org.junit.Assert; | import java.io.*; import org.apache.directory.api.ldap.model.exception.*; import org.apache.directory.api.ldap.model.name.*; import org.junit.*; | [
"java.io",
"org.apache.directory",
"org.junit"
] | java.io; org.apache.directory; org.junit; | 293,527 |
protected void verifyCommandReturnValueAndOutput(int expectedReturnValue, String expectedOutput,
String... command) {
int ret = mFsShell.run(command);
assertEquals(expectedReturnValue, ret);
assertTrue(mOutput.toString().contains(expectedOutput));
} | void function(int expectedReturnValue, String expectedOutput, String... command) { int ret = mFsShell.run(command); assertEquals(expectedReturnValue, ret); assertTrue(mOutput.toString().contains(expectedOutput)); } | /**
* Verifies the return value and output of executing command meet expectations.
*
* @param expectedReturnValue the expected return value
* @param expectedOutput the expected output string
* @param command command to execute
*/ | Verifies the return value and output of executing command meet expectations | verifyCommandReturnValueAndOutput | {
"repo_name": "maboelhassan/alluxio",
"path": "tests/src/test/java/alluxio/cli/fs/AbstractFileSystemShellTest.java",
"license": "apache-2.0",
"size": 8833
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 24,491 |
public void testJSONGenericArrayParse() {
Exception ex = null;
try {
String json = "[ \"foo\", true, 1, null ]";
JSONArtifact jsonA = JSON.parse(json);
assertTrue(jsonA instanceof JSONArray);
StringWriter strWriter = new StringWriter();
j... | void function() { Exception ex = null; try { String json = STRfoo\STR; JSONArtifact jsonA = JSON.parse(json); assertTrue(jsonA instanceof JSONArray); StringWriter strWriter = new StringWriter(); jsonA.write(strWriter); System.out.println(STR); System.out.println(strWriter.toString()); } catch (Exception ex1) { ex = ex1... | /**
* Test a basic parse of a JSONArray in text form
* then with compact emit for checking.
*/ | Test a basic parse of a JSONArray in text form then with compact emit for checking | testJSONGenericArrayParse | {
"repo_name": "os890/wink_patches",
"path": "wink-json4j/src/test/java/org/apache/wink/json4j/tests/JSONParserTests.java",
"license": "apache-2.0",
"size": 4463
} | [
"java.io.StringWriter",
"org.apache.wink.json4j.JSON",
"org.apache.wink.json4j.JSONArray",
"org.apache.wink.json4j.JSONArtifact"
] | import java.io.StringWriter; import org.apache.wink.json4j.JSON; import org.apache.wink.json4j.JSONArray; import org.apache.wink.json4j.JSONArtifact; | import java.io.*; import org.apache.wink.json4j.*; | [
"java.io",
"org.apache.wink"
] | java.io; org.apache.wink; | 693,067 |
public void exited(final NotificationType exited, final MAP map, final ArjunaContext arjunaContext) ; | void function(final NotificationType exited, final MAP map, final ArjunaContext arjunaContext) ; | /**
* Handle the exited event.
* @param exited The exited notification.
* @param map The addressing context.
* @param arjunaContext The arjuna context.
*/ | Handle the exited event | exited | {
"repo_name": "nmcl/scratch",
"path": "graalvm/transactions/fork/narayana/XTS/WS-T/dev/src/com/arjuna/webservices11/wsba/CoordinatorCompletionParticipantInboundEvents.java",
"license": "apache-2.0",
"size": 4351
} | [
"com.arjuna.webservices11.wsarj.ArjunaContext",
"org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType"
] | import com.arjuna.webservices11.wsarj.ArjunaContext; import org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType; | import com.arjuna.webservices11.wsarj.*; import org.oasis_open.docs.ws_tx.wsba.*; | [
"com.arjuna.webservices11",
"org.oasis_open.docs"
] | com.arjuna.webservices11; org.oasis_open.docs; | 1,480,874 |
public static CastSettingsManager createCastSettingsManager(
Context context, OnSettingChangedListener listener) {
ContentResolver contentResolver = context.getContentResolver();
return new CastSettingsManager(contentResolver, listener);
}
@SuppressLint("NewApi")
private Cas... | static CastSettingsManager function( Context context, OnSettingChangedListener listener) { ContentResolver contentResolver = context.getContentResolver(); return new CastSettingsManager(contentResolver, listener); } @SuppressLint(STR) private CastSettingsManager( ContentResolver contentResolver, OnSettingChangedListene... | /**
* Creates a fully-featured CastSettingsManager instance. Will fail if called from a
* sandboxed process.
*/ | Creates a fully-featured CastSettingsManager instance. Will fail if called from a sandboxed process | createCastSettingsManager | {
"repo_name": "endlessm/chromium-browser",
"path": "chromecast/base/java/src/org/chromium/chromecast/base/CastSettingsManager.java",
"license": "bsd-3-clause",
"size": 6051
} | [
"android.annotation.SuppressLint",
"android.content.ContentResolver",
"android.content.Context"
] | import android.annotation.SuppressLint; import android.content.ContentResolver; import android.content.Context; | import android.annotation.*; import android.content.*; | [
"android.annotation",
"android.content"
] | android.annotation; android.content; | 2,772,167 |
protected boolean fill(final Context2D context, final Attributes attr, double alpha)
{
final boolean filled = attr.hasFill();
if ((filled) || (attr.isFillShapeForSelection()))
{
alpha = alpha * attr.getFillAlpha();
if (alpha <= 0)
{
r... | boolean function(final Context2D context, final Attributes attr, double alpha) { final boolean filled = attr.hasFill(); if ((filled) (attr.isFillShapeForSelection())) { alpha = alpha * attr.getFillAlpha(); if (alpha <= 0) { return false; } if (context.isSelection()) { final String color = getColorKey(); if (null == col... | /**
* Fills the Shape using the passed attributes.
* This method will silently also fill the Shape to its unique rgb color if the context is a buffer.
*
* @param context
* @param attr
*/ | Fills the Shape using the passed attributes. This method will silently also fill the Shape to its unique rgb color if the context is a buffer | fill | {
"repo_name": "Josephblt/lienzo-core",
"path": "src/main/java/com/ait/lienzo/client/core/shape/Shape.java",
"license": "apache-2.0",
"size": 43293
} | [
"com.ait.lienzo.client.core.Context2D",
"com.ait.lienzo.client.core.types.FillGradient",
"com.ait.lienzo.client.core.types.LinearGradient",
"com.ait.lienzo.client.core.types.PatternGradient",
"com.ait.lienzo.client.core.types.RadialGradient"
] | import com.ait.lienzo.client.core.Context2D; import com.ait.lienzo.client.core.types.FillGradient; import com.ait.lienzo.client.core.types.LinearGradient; import com.ait.lienzo.client.core.types.PatternGradient; import com.ait.lienzo.client.core.types.RadialGradient; | import com.ait.lienzo.client.core.*; import com.ait.lienzo.client.core.types.*; | [
"com.ait.lienzo"
] | com.ait.lienzo; | 540,040 |
@Bean
@ConditionalOnMissingBean(CacheStrategy.class)
@Order(-90)
<K, V> CacheStrategy<K, V> defaultCacheStrategy() {
LOGGER.debug("Creating cache strategy 'LruMemoryCacheStrategy'");
return new LruMemoryCacheStrategy<>();
} | @ConditionalOnMissingBean(CacheStrategy.class) @Order(-90) <K, V> CacheStrategy<K, V> defaultCacheStrategy() { LOGGER.debug(STR); return new LruMemoryCacheStrategy<>(); } | /**
* This is the default "Least recently used memory cache" strategy of Wro4j
* which will be configured per default.
*
* @param <K> Type of the cache keys
* @param <V> Type of the cache values
* @return A default Wro4j cache strategy
*/ | This is the default "Least recently used memory cache" strategy of Wro4j which will be configured per default | defaultCacheStrategy | {
"repo_name": "michael-simons/wro4j-spring-boot-starter",
"path": "src/main/java/ac/simons/spring/boot/wro4j/Wro4jAutoConfiguration.java",
"license": "apache-2.0",
"size": 13568
} | [
"org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean",
"org.springframework.core.annotation.Order",
"ro.isdc.wro.cache.CacheStrategy",
"ro.isdc.wro.cache.impl.LruMemoryCacheStrategy"
] | import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.core.annotation.Order; import ro.isdc.wro.cache.CacheStrategy; import ro.isdc.wro.cache.impl.LruMemoryCacheStrategy; | import org.springframework.boot.autoconfigure.condition.*; import org.springframework.core.annotation.*; import ro.isdc.wro.cache.*; import ro.isdc.wro.cache.impl.*; | [
"org.springframework.boot",
"org.springframework.core",
"ro.isdc.wro"
] | org.springframework.boot; org.springframework.core; ro.isdc.wro; | 1,074,790 |
@Test
public void testCrossCacheModeQuery() throws Exception {
Ignite ignite = startGrid();
ignite.cache(LOCAL_CACHE_NAME).put(1, LOCAL_CACHE_NAME);
ignite.cache(REPLICATED_CACHE_NAME).put(1, REPLICATED_CACHE_NAME);
ignite.cache(PARTITIONED_CACHE_NAME).put(1, PARTITIONED_CACHE_N... | void function() throws Exception { Ignite ignite = startGrid(); ignite.cache(LOCAL_CACHE_NAME).put(1, LOCAL_CACHE_NAME); ignite.cache(REPLICATED_CACHE_NAME).put(1, REPLICATED_CACHE_NAME); ignite.cache(PARTITIONED_CACHE_NAME).put(1, PARTITIONED_CACHE_NAME); final List<String> cacheNamesList = F.asList(LOCAL_CACHE_NAME, ... | /**
* It should not matter what cache mode does entry cache use, if there is no join
*/ | It should not matter what cache mode does entry cache use, if there is no join | testCrossCacheModeQuery | {
"repo_name": "shroman/ignite",
"path": "modules/indexing/src/test/java/org/apache/ignite/internal/processors/query/IgniteSqlEntryCacheModeAgnosticTest.java",
"license": "apache-2.0",
"size": 4790
} | [
"java.util.List",
"org.apache.ignite.Ignite",
"org.apache.ignite.cache.query.QueryCursor",
"org.apache.ignite.cache.query.SqlFieldsQuery",
"org.apache.ignite.internal.util.typedef.F"
] | import java.util.List; import org.apache.ignite.Ignite; import org.apache.ignite.cache.query.QueryCursor; import org.apache.ignite.cache.query.SqlFieldsQuery; import org.apache.ignite.internal.util.typedef.F; | import java.util.*; import org.apache.ignite.*; import org.apache.ignite.cache.query.*; import org.apache.ignite.internal.util.typedef.*; | [
"java.util",
"org.apache.ignite"
] | java.util; org.apache.ignite; | 593,836 |
@Test
public void testSetCommand() throws SQLException {
// execute set command
String sql = "set -v";
Statement stmt = con.createStatement();
ResultSet res = stmt.executeQuery(sql);
// Validate resultset columns
ResultSetMetaData md = res.getMetaData();
assertEquals(1, md.getColumnCoun... | void function() throws SQLException { String sql = STR; Statement stmt = con.createStatement(); ResultSet res = stmt.executeQuery(sql); ResultSetMetaData md = res.getMetaData(); assertEquals(1, md.getColumnCount()); assertEquals(SET_COLUMN_NAME, md.getColumnLabel(1)); int numLines = 0; while (res.next()) { numLines++; ... | /**
* validate schema generated by "set" command
* @throws SQLException
*/ | validate schema generated by "set" command | testSetCommand | {
"repo_name": "b-slim/hive",
"path": "itests/hive-unit/src/test/java/org/apache/hive/jdbc/TestJdbcDriver2.java",
"license": "apache-2.0",
"size": 119749
} | [
"java.lang.String",
"java.sql.ResultSet",
"java.sql.ResultSetMetaData",
"java.sql.SQLException",
"java.sql.Statement",
"org.apache.hadoop.hive.conf.HiveConf",
"org.junit.Assert"
] | import java.lang.String; import java.sql.ResultSet; import java.sql.ResultSetMetaData; import java.sql.SQLException; import java.sql.Statement; import org.apache.hadoop.hive.conf.HiveConf; import org.junit.Assert; | import java.lang.*; import java.sql.*; import org.apache.hadoop.hive.conf.*; import org.junit.*; | [
"java.lang",
"java.sql",
"org.apache.hadoop",
"org.junit"
] | java.lang; java.sql; org.apache.hadoop; org.junit; | 1,856,017 |
String removeSystemUnderTest(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams); | String removeSystemUnderTest(Vector<Object> systemUnderTestParams, Vector<Object> repositoryParams); | /**
* Removes the systemUnderTest
* <p/>
*
* @param systemUnderTestParams
* @param repositoryParams
* @return error id if an error occurred
*/ | Removes the systemUnderTest | removeSystemUnderTest | {
"repo_name": "benhamidene/livingdoc-confluence",
"path": "livingdoc-confluence-plugin/src/main/java/info/novatec/testit/livingdoc/server/rpc/RpcServerService.java",
"license": "gpl-3.0",
"size": 13630
} | [
"java.util.Vector"
] | import java.util.Vector; | import java.util.*; | [
"java.util"
] | java.util; | 1,708,492 |
@Test
public void testBaseUrl( ) throws SiteMessageException
{
IPageService pageService = (IPageService) SpringContextService.getBean( "pageService" );
HttpServletResponse response = new MockHttpServletResponse( );
MockHttpServletRequest request = new MockHttpServletRequest( );
... | void function( ) throws SiteMessageException { IPageService pageService = (IPageService) SpringContextService.getBean( STR ); HttpServletResponse response = new MockHttpServletResponse( ); MockHttpServletRequest request = new MockHttpServletRequest( ); LocalVariables.setLocal( null, request, response ); request.addPara... | /**
* Tests that the base URL is correct when the page is cached and the URL used to access the site changes
*
* @throws SiteMessageException
*/ | Tests that the base URL is correct when the page is cached and the URL used to access the site changes | testBaseUrl | {
"repo_name": "lutece-platform/lutece-core",
"path": "src/test/java/fr/paris/lutece/portal/service/page/PageServiceTest.java",
"license": "bsd-3-clause",
"size": 4431
} | [
"fr.paris.lutece.portal.service.message.SiteMessageException",
"fr.paris.lutece.portal.service.spring.SpringContextService",
"fr.paris.lutece.portal.web.LocalVariables",
"fr.paris.lutece.portal.web.constants.Parameters",
"javax.servlet.http.HttpServletResponse",
"org.springframework.mock.web.MockHttpServl... | import fr.paris.lutece.portal.service.message.SiteMessageException; import fr.paris.lutece.portal.service.spring.SpringContextService; import fr.paris.lutece.portal.web.LocalVariables; import fr.paris.lutece.portal.web.constants.Parameters; import javax.servlet.http.HttpServletResponse; import org.springframework.mock.... | import fr.paris.lutece.portal.service.message.*; import fr.paris.lutece.portal.service.spring.*; import fr.paris.lutece.portal.web.*; import fr.paris.lutece.portal.web.constants.*; import javax.servlet.http.*; import org.springframework.mock.web.*; | [
"fr.paris.lutece",
"javax.servlet",
"org.springframework.mock"
] | fr.paris.lutece; javax.servlet; org.springframework.mock; | 2,048,968 |
@Test
public void verifyFT24() throws IOException,
InterruptedException {
HttpPost httpPost = createInboxCallDetailsRequestHttpPost(new InboxCallDetailsRequest(
123456789L, // callingNumber less than 10 digit
"A", // operator
"AP", // circle
... | void function() throws IOException, InterruptedException { HttpPost httpPost = createInboxCallDetailsRequestHttpPost(new InboxCallDetailsRequest( 123456789L, "A", "AP", 123456789012345L, 123L, 456L, 123, 1, 1, null)); String expectedJsonResponse = createFailureResponseJson(STR); assertTrue(SimpleHttpClient.execHttpRequ... | /**
* NMS_FT_24 To check response of SaveInboxCallDetails API if
* callingNumber provided in the request is in invalid format
*/ | NMS_FT_24 To check response of SaveInboxCallDetails API if callingNumber provided in the request is in invalid format | verifyFT24 | {
"repo_name": "ngraczewski/mim",
"path": "testing/src/test/java/org/motechproject/nms/testing/it/api/KilkariControllerBundleIT.java",
"license": "bsd-3-clause",
"size": 193191
} | [
"java.io.IOException",
"org.apache.commons.httpclient.HttpStatus",
"org.apache.http.client.methods.HttpPost",
"org.junit.Assert",
"org.motechproject.nms.api.web.contract.kilkari.InboxCallDetailsRequest",
"org.motechproject.testing.osgi.http.SimpleHttpClient"
] | import java.io.IOException; import org.apache.commons.httpclient.HttpStatus; import org.apache.http.client.methods.HttpPost; import org.junit.Assert; import org.motechproject.nms.api.web.contract.kilkari.InboxCallDetailsRequest; import org.motechproject.testing.osgi.http.SimpleHttpClient; | import java.io.*; import org.apache.commons.httpclient.*; import org.apache.http.client.methods.*; import org.junit.*; import org.motechproject.nms.api.web.contract.kilkari.*; import org.motechproject.testing.osgi.http.*; | [
"java.io",
"org.apache.commons",
"org.apache.http",
"org.junit",
"org.motechproject.nms",
"org.motechproject.testing"
] | java.io; org.apache.commons; org.apache.http; org.junit; org.motechproject.nms; org.motechproject.testing; | 2,469,334 |
public CppCompileActionBuilder setFeatureConfiguration(
FeatureConfiguration featureConfiguration) {
this.featureConfiguration = featureConfiguration;
return this;
} | CppCompileActionBuilder function( FeatureConfiguration featureConfiguration) { this.featureConfiguration = featureConfiguration; return this; } | /**
* Sets the feature configuration to be used for the action.
*/ | Sets the feature configuration to be used for the action | setFeatureConfiguration | {
"repo_name": "Digas29/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CppCompileActionBuilder.java",
"license": "apache-2.0",
"size": 18161
} | [
"com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures"
] | import com.google.devtools.build.lib.rules.cpp.CcToolchainFeatures; | import com.google.devtools.build.lib.rules.cpp.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,046,256 |
protected final void flushXML(XMLWriter writer) throws IOException
{
if (shouldFlushXMLWriter())
{
writer.flush();
}
m_response.getWriter().write(m_xmlWriter.toCharArray());
m_xmlWriter.reset();
}
| final void function(XMLWriter writer) throws IOException { if (shouldFlushXMLWriter()) { writer.flush(); } m_response.getWriter().write(m_xmlWriter.toCharArray()); m_xmlWriter.reset(); } | /**
* Flushes all XML written so far to the response
*
* @param xml XMLWriter that should be flushed
*/ | Flushes all XML written so far to the response | flushXML | {
"repo_name": "to2y/AlfrescoOnlineEditWebDAV",
"path": "OnlineEditWebDAV/src/jp/aegif/alfresco/online_webdav/WebDAVMethod.java",
"license": "gpl-2.0",
"size": 46386
} | [
"java.io.IOException",
"org.dom4j.io.XMLWriter"
] | import java.io.IOException; import org.dom4j.io.XMLWriter; | import java.io.*; import org.dom4j.io.*; | [
"java.io",
"org.dom4j.io"
] | java.io; org.dom4j.io; | 1,424,798 |
@Override
public FontMetrics getFontMetrics(Font f) {
return this.fmImage.createGraphics().getFontMetrics(f);
} | FontMetrics function(Font f) { return this.fmImage.createGraphics().getFontMetrics(f); } | /**
* Returns the font metrics for the specified font.
*
* @param f the font.
*
* @return The font metrics.
*/ | Returns the font metrics for the specified font | getFontMetrics | {
"repo_name": "levigo/jadice-server-converter-client",
"path": "src/main/java/org/jfree/chart/fx/FXGraphics2D.java",
"license": "bsd-3-clause",
"size": 60303
} | [
"java.awt.Font",
"java.awt.FontMetrics"
] | import java.awt.Font; import java.awt.FontMetrics; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,433,393 |
@Test
public void needSyncNeedsResyncTest() {
String sync_id = "needSyncNeedsResyncTest";
dao.insert(new Sync(sync_id, new DateTime(0)));
assertThat(syncManager.needSync(sync_id, 1234)).isTrue();
} | void function() { String sync_id = STR; dao.insert(new Sync(sync_id, new DateTime(0))); assertThat(syncManager.needSync(sync_id, 1234)).isTrue(); } | /**
* Default needSync usage - specific sync target hasn't been synced for a while
* Expected output: returns true
*/ | Default needSync usage - specific sync target hasn't been synced for a while Expected output: returns true | needSyncNeedsResyncTest | {
"repo_name": "TCA-Team/TumCampusApp",
"path": "app/src/test/java/de/tum/in/tumcampusapp/managers/SyncManagerTest.java",
"license": "gpl-3.0",
"size": 2824
} | [
"de.tum.in.tumcampusapp.utils.sync.model.Sync",
"org.assertj.core.api.Assertions",
"org.joda.time.DateTime"
] | import de.tum.in.tumcampusapp.utils.sync.model.Sync; import org.assertj.core.api.Assertions; import org.joda.time.DateTime; | import de.tum.in.tumcampusapp.utils.sync.model.*; import org.assertj.core.api.*; import org.joda.time.*; | [
"de.tum.in",
"org.assertj.core",
"org.joda.time"
] | de.tum.in; org.assertj.core; org.joda.time; | 2,175,897 |
private static void validateTable(Configuration conf, TableName tableName, String family,
int valueMultiplier) throws IOException {
LOG.debug("Validating table.");
Table table = util.getConnection().getTable(tableName);
boolean verified = false;
long pause = conf.getLong("hbase.client.pause", 5... | static void function(Configuration conf, TableName tableName, String family, int valueMultiplier) throws IOException { LOG.debug(STR); Table table = util.getConnection().getTable(tableName); boolean verified = false; long pause = conf.getLong(STR, 5 * 1000); int numRetries = conf.getInt(HConstants.HBASE_CLIENT_RETRIES_... | /**
* Confirm ImportTsv via data in online table.
*/ | Confirm ImportTsv via data in online table | validateTable | {
"repo_name": "vincentpoon/hbase",
"path": "hbase-mapreduce/src/test/java/org/apache/hadoop/hbase/mapreduce/TestImportTSVWithVisibilityLabels.java",
"license": "apache-2.0",
"size": 20852
} | [
"java.io.IOException",
"java.util.List",
"org.apache.hadoop.conf.Configuration",
"org.apache.hadoop.hbase.Cell",
"org.apache.hadoop.hbase.CellUtil",
"org.apache.hadoop.hbase.HConstants",
"org.apache.hadoop.hbase.TableName",
"org.apache.hadoop.hbase.client.Result",
"org.apache.hadoop.hbase.client.Res... | import java.io.IOException; import java.util.List; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hbase.Cell; import org.apache.hadoop.hbase.CellUtil; import org.apache.hadoop.hbase.HConstants; import org.apache.hadoop.hbase.TableName; import org.apache.hadoop.hbase.client.Result; import org.apac... | import java.io.*; import java.util.*; import org.apache.hadoop.conf.*; import org.apache.hadoop.hbase.*; import org.apache.hadoop.hbase.client.*; import org.apache.hadoop.hbase.security.visibility.*; import org.apache.hadoop.hbase.util.*; import org.junit.*; | [
"java.io",
"java.util",
"org.apache.hadoop",
"org.junit"
] | java.io; java.util; org.apache.hadoop; org.junit; | 1,395,513 |
protected void connectionConfig(String prefix) throws BiremeException {
Configuration subConfig = new SubsetConfiguration(config, "target", ".");
targetDatabase = new ConnectionConfig();
targetDatabase.jdbcUrl = subConfig.getString("url");
targetDatabase.user = subConfig.getString("user");
target... | void function(String prefix) throws BiremeException { Configuration subConfig = new SubsetConfiguration(config, STR, "."); targetDatabase = new ConnectionConfig(); targetDatabase.jdbcUrl = subConfig.getString("url"); targetDatabase.user = subConfig.getString("user"); targetDatabase.passwd = subConfig.getString(STR); if... | /**
* Get the connection configuration to database.
*
* @param prefix "target" database
* @throws BiremeException when url of database is null
*/ | Get the connection configuration to database | connectionConfig | {
"repo_name": "HashDataInc/bireme",
"path": "src/main/java/cn/hashdata/bireme/Config.java",
"license": "apache-2.0",
"size": 9886
} | [
"org.apache.commons.configuration2.Configuration",
"org.apache.commons.configuration2.SubsetConfiguration"
] | import org.apache.commons.configuration2.Configuration; import org.apache.commons.configuration2.SubsetConfiguration; | import org.apache.commons.configuration2.*; | [
"org.apache.commons"
] | org.apache.commons; | 1,954,543 |
public DrillbitEndpoint getIdentity() {
return context.getEndpoint();
} | DrillbitEndpoint function() { return context.getEndpoint(); } | /**
* Get this node's identity.
* @return A DrillbitEndpoint object.
*/ | Get this node's identity | getIdentity | {
"repo_name": "tshiran/drill",
"path": "exec/java-exec/src/main/java/org/apache/drill/exec/ops/FragmentContext.java",
"license": "apache-2.0",
"size": 10900
} | [
"org.apache.drill.exec.proto.CoordinationProtos"
] | import org.apache.drill.exec.proto.CoordinationProtos; | import org.apache.drill.exec.proto.*; | [
"org.apache.drill"
] | org.apache.drill; | 1,760,791 |
public void unlockAll() throws IOException {
for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) {
it.next().unlock();
}
} | void function() throws IOException { for (Iterator<StorageDirectory> it = storageDirs.iterator(); it.hasNext();) { it.next().unlock(); } } | /**
* Unlock all storage directories.
* @throws IOException
*/ | Unlock all storage directories | unlockAll | {
"repo_name": "simplegeo/hadoop",
"path": "src/hdfs/org/apache/hadoop/hdfs/server/common/Storage.java",
"license": "apache-2.0",
"size": 29519
} | [
"java.io.IOException",
"java.util.Iterator"
] | import java.io.IOException; import java.util.Iterator; | import java.io.*; import java.util.*; | [
"java.io",
"java.util"
] | java.io; java.util; | 1,140,293 |
private Map<String, Object> buildWatermarkTemplateModel(NodeRef ref)
{
Map<String, Object> model = new HashMap<String, Object>();
NodeRef person = ps.getPerson(as.getCurrentUserName());
model.put("person", new TemplateNode(person, serviceRegistry, null));
NodeRef homespace = (No... | Map<String, Object> function(NodeRef ref) { Map<String, Object> model = new HashMap<String, Object>(); NodeRef person = ps.getPerson(as.getCurrentUserName()); model.put(STR, new TemplateNode(person, serviceRegistry, null)); NodeRef homespace = (NodeRef)ns.getProperty(person, ContentModel.PROP_HOMEFOLDER); model.put(STR... | /**
* Builds a freemarker model which supports a subset of the default model.
*
* @param ref
* @return
*/ | Builds a freemarker model which supports a subset of the default model | buildWatermarkTemplateModel | {
"repo_name": "ntmcminn/alfresco-pdf-toolkit",
"path": "pdf-toolkit-repo/src/main/java/org/alfresco/extension/pdftoolkit/service/PDFToolkitServiceImpl.java",
"license": "gpl-2.0",
"size": 68606
} | [
"java.util.Date",
"java.util.HashMap",
"java.util.Map",
"org.alfresco.model.ContentModel",
"org.alfresco.repo.template.TemplateNode",
"org.alfresco.service.cmr.repository.NodeRef"
] | import java.util.Date; import java.util.HashMap; import java.util.Map; import org.alfresco.model.ContentModel; import org.alfresco.repo.template.TemplateNode; import org.alfresco.service.cmr.repository.NodeRef; | import java.util.*; import org.alfresco.model.*; import org.alfresco.repo.template.*; import org.alfresco.service.cmr.repository.*; | [
"java.util",
"org.alfresco.model",
"org.alfresco.repo",
"org.alfresco.service"
] | java.util; org.alfresco.model; org.alfresco.repo; org.alfresco.service; | 587,822 |
@CacheResult(cacheName = "configuration")
public String get(@CacheKey final String name) {
return Optional.ofNullable(getRaw(name)).map(cryptoHelper::decryptAsNeeded).orElse(null);
} | @CacheResult(cacheName = STR) String function(@CacheKey final String name) { return Optional.ofNullable(getRaw(name)).map(cryptoHelper::decryptAsNeeded).orElse(null); } | /**
* Return a specific configuration. System properties overrides the value from the database. Value is decrypted as
* needed.
*
* @param name The requested configuration name.
* @return A specific configuration. May be <code>null</code> when undefined.
*/ | Return a specific configuration. System properties overrides the value from the database. Value is decrypted as needed | get | {
"repo_name": "ligoj/bootstrap",
"path": "bootstrap-business/src/main/java/org/ligoj/bootstrap/resource/system/configuration/ConfigurationResource.java",
"license": "mit",
"size": 8949
} | [
"java.util.Optional",
"javax.cache.annotation.CacheKey",
"javax.cache.annotation.CacheResult"
] | import java.util.Optional; import javax.cache.annotation.CacheKey; import javax.cache.annotation.CacheResult; | import java.util.*; import javax.cache.annotation.*; | [
"java.util",
"javax.cache"
] | java.util; javax.cache; | 2,177,438 |
public void run() {
try {
Thread[] threads = new Thread[commands.size()];
for (int x = 0; x < commands.size(); x++) {
threads[x] = new Thread((Command) commands.get(x));
}
for (int x = 0; x < threads.length; x++) {
threads[x].st... | void function() { try { Thread[] threads = new Thread[commands.size()]; for (int x = 0; x < commands.size(); x++) { threads[x] = new Thread((Command) commands.get(x)); } for (int x = 0; x < threads.length; x++) { threads[x].start(); } for (int x = 0; x < threads.length; x++) { threads[x].join(); } } catch (InterruptedE... | /**
* Runs all of the commands, and waits for them all to finish.
*/ | Runs all of the commands, and waits for them all to finish | run | {
"repo_name": "Team4334/robot-code",
"path": "src/edu/first/commands/ConcurrentCommandGroup.java",
"license": "gpl-3.0",
"size": 2344
} | [
"edu.first.command.Command",
"edu.first.util.log.Logger"
] | import edu.first.command.Command; import edu.first.util.log.Logger; | import edu.first.command.*; import edu.first.util.log.*; | [
"edu.first.command",
"edu.first.util"
] | edu.first.command; edu.first.util; | 2,054,807 |
public static void asyncCreate(ZooKeeperWatcher zkw,
String znode, byte [] data, final AsyncCallback.StringCallback cb,
final Object ctx) {
zkw.getRecoverableZooKeeper().getZooKeeper().create(znode, data,
createACL(zkw, znode), CreateMode.PERSISTENT, cb, ctx);
} | static void function(ZooKeeperWatcher zkw, String znode, byte [] data, final AsyncCallback.StringCallback cb, final Object ctx) { zkw.getRecoverableZooKeeper().getZooKeeper().create(znode, data, createACL(zkw, znode), CreateMode.PERSISTENT, cb, ctx); } | /**
* Async creates the specified node with the specified data.
*
* <p>Throws an exception if the node already exists.
*
* <p>The node created is persistent and open access.
*
* @param zkw zk reference
* @param znode path of node to create
* @param data data of node to create
* @param cb
... | Async creates the specified node with the specified data. Throws an exception if the node already exists. The node created is persistent and open access | asyncCreate | {
"repo_name": "lilonglai/hbase-0.96.2",
"path": "hbase-client/src/main/java/org/apache/hadoop/hbase/zookeeper/ZKUtil.java",
"license": "apache-2.0",
"size": 72004
} | [
"org.apache.zookeeper.AsyncCallback",
"org.apache.zookeeper.CreateMode"
] | import org.apache.zookeeper.AsyncCallback; import org.apache.zookeeper.CreateMode; | import org.apache.zookeeper.*; | [
"org.apache.zookeeper"
] | org.apache.zookeeper; | 875,107 |
public static <T> List<T> getServices(final Class<T> intf)
{
Objects.requireNonNull(intf);
List<T> ret = new LinkedList<>();
for (final T t : ServiceLoader.load(intf)) {
ret.add(t);
}
return ret;
} | static <T> List<T> function(final Class<T> intf) { Objects.requireNonNull(intf); List<T> ret = new LinkedList<>(); for (final T t : ServiceLoader.load(intf)) { ret.add(t); } return ret; } | /**
* Get all advertised service implementations of the specified interface.
*
* @param intf the interface to find advertised service implementations of
* @param <T> the interface
* @return a collection of implementations of the specified interface
*/ | Get all advertised service implementations of the specified interface | getServices | {
"repo_name": "CAFapi/caf-common",
"path": "util-moduleloader/src/main/java/com/hpe/caf/util/ModuleLoader.java",
"license": "apache-2.0",
"size": 4756
} | [
"java.util.LinkedList",
"java.util.List",
"java.util.Objects",
"java.util.ServiceLoader"
] | import java.util.LinkedList; import java.util.List; import java.util.Objects; import java.util.ServiceLoader; | import java.util.*; | [
"java.util"
] | java.util; | 1,002,836 |
IndexSettings getIndexSettings();
/**
* Updates the meta data of this index. Changes become visible through {@link #getIndexSettings()} | IndexSettings getIndexSettings(); /** * Updates the meta data of this index. Changes become visible through {@link #getIndexSettings()} | /**
* Returns the index settings of this index.
*/ | Returns the index settings of this index | getIndexSettings | {
"repo_name": "wuranbo/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java",
"license": "apache-2.0",
"size": 46029
} | [
"org.elasticsearch.index.IndexSettings"
] | import org.elasticsearch.index.IndexSettings; | import org.elasticsearch.index.*; | [
"org.elasticsearch.index"
] | org.elasticsearch.index; | 2,611,212 |
Future<JobListResponse> listWithFilterAsync(JobListWithFilterParameters parameters); | Future<JobListResponse> listWithFilterAsync(JobListWithFilterParameters parameters); | /**
* Get the list of jobs in a job collection matching a filter on job state.
*
* @param parameters Required. Parameters supplied to the List Jobs with
* filter operation.
* @return The List Jobs operation response.
*/ | Get the list of jobs in a job collection matching a filter on job state | listWithFilterAsync | {
"repo_name": "flydream2046/azure-sdk-for-java",
"path": "service-management/azure-svc-mgmt-scheduler/src/main/java/com/microsoft/windowsazure/scheduler/JobOperations.java",
"license": "apache-2.0",
"size": 13088
} | [
"com.microsoft.windowsazure.scheduler.models.JobListResponse",
"com.microsoft.windowsazure.scheduler.models.JobListWithFilterParameters",
"java.util.concurrent.Future"
] | import com.microsoft.windowsazure.scheduler.models.JobListResponse; import com.microsoft.windowsazure.scheduler.models.JobListWithFilterParameters; import java.util.concurrent.Future; | import com.microsoft.windowsazure.scheduler.models.*; import java.util.concurrent.*; | [
"com.microsoft.windowsazure",
"java.util"
] | com.microsoft.windowsazure; java.util; | 415,685 |
@Override
int guessFluffedDataSize() {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "guessFluffedDataSize");
// If the data has been set in 'unserialized' then it will be ignored in these
// calculations. This seems reasonable, as ef... | int guessFluffedDataSize() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, STR); int total = 0; JsMsgPart part = getPayloadIfFluffed(); if (part != null) { total += part.estimateFieldValueSize(JmsObjectBodyAccess.BODY_DATA_VALUE) * DESERIALIZATION_MULTIPLIER; } else { int payloa... | /**
* guessFluffedDataSize
* Return the estimated fluffed size of the payload data.
*
* For this class, we should return an approximation of the fluffed up payload
* data.
*
* @return int A guesstimate of the fluffed size of the payload data
*/ | guessFluffedDataSize Return the estimated fluffed size of the payload data. For this class, we should return an approximation of the fluffed up payload data | guessFluffedDataSize | {
"repo_name": "OpenLiberty/open-liberty",
"path": "dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/impl/JsJmsObjectMessageImpl.java",
"license": "epl-1.0",
"size": 24213
} | [
"com.ibm.websphere.ras.TraceComponent",
"com.ibm.ws.sib.mfp.schema.JmsObjectBodyAccess",
"com.ibm.ws.sib.utils.ras.SibTr"
] | import com.ibm.websphere.ras.TraceComponent; import com.ibm.ws.sib.mfp.schema.JmsObjectBodyAccess; import com.ibm.ws.sib.utils.ras.SibTr; | import com.ibm.websphere.ras.*; import com.ibm.ws.sib.mfp.schema.*; import com.ibm.ws.sib.utils.ras.*; | [
"com.ibm.websphere",
"com.ibm.ws"
] | com.ibm.websphere; com.ibm.ws; | 17,740 |
private QName getArrayItemTypeFromSequence(Element sequenceElement, WsdlTypes wsdlTypes) {
Element element = DomUtils.getChildElementByName(sequenceElement, "element");
if (element == null) {
return null;
}
if (!isArray(element)) {
return null;
}
... | QName function(Element sequenceElement, WsdlTypes wsdlTypes) { Element element = DomUtils.getChildElementByName(sequenceElement, STR); if (element == null) { return null; } if (!isArray(element)) { return null; } return wsdlTypes.getTypeQName(element.getAttribute("type")); } | /**
* Get an array items xml type from a sequence element.
*
* @param sequenceElement Sequence element.
* @param wsdlTypes Wsdl types abstraction.
* @return QName QName of the array item xml type.
*/ | Get an array items xml type from a sequence element | getArrayItemTypeFromSequence | {
"repo_name": "panbasten/imeta",
"path": "imeta2.x/imeta-src/imeta/src/main/java/com/panet/imeta/trans/steps/webservices/wsdl/WsdlOpParameter.java",
"license": "gpl-2.0",
"size": 12622
} | [
"javax.xml.namespace.QName",
"org.w3c.dom.Element"
] | import javax.xml.namespace.QName; import org.w3c.dom.Element; | import javax.xml.namespace.*; import org.w3c.dom.*; | [
"javax.xml",
"org.w3c.dom"
] | javax.xml; org.w3c.dom; | 1,834,408 |
public void injectBlocks(Block[][] blocksToInject) throws IOException {
if (blocksToInject.length > dataNodes.size()) {
throw new IndexOutOfBoundsException();
}
for (int i = 0; i < blocksToInject.length; ++i) {
injectBlocks(i, blocksToInject[i]);
}
} | void function(Block[][] blocksToInject) throws IOException { if (blocksToInject.length > dataNodes.size()) { throw new IndexOutOfBoundsException(); } for (int i = 0; i < blocksToInject.length; ++i) { injectBlocks(i, blocksToInject[i]); } } | /**
* This method is valid only if the data nodes have simulated data
* @param blocksToInject - blocksToInject[] is indexed in the same order as the list
* of datanodes returned by getDataNodes()
* @throws IOException
* if not simulatedFSDataset
* if any of blocks ... | This method is valid only if the data nodes have simulated data | injectBlocks | {
"repo_name": "gndpig/hadoop",
"path": "src/test/org/apache/hadoop/hdfs/MiniDFSCluster.java",
"license": "apache-2.0",
"size": 38318
} | [
"java.io.IOException",
"org.apache.hadoop.hdfs.protocol.Block"
] | import java.io.IOException; import org.apache.hadoop.hdfs.protocol.Block; | import java.io.*; import org.apache.hadoop.hdfs.protocol.*; | [
"java.io",
"org.apache.hadoop"
] | java.io; org.apache.hadoop; | 199,082 |
private boolean hasDelfoiAccess(DelfoiAction action, UserRole userRole) {
Delfoi delfoi = getDelfoi();
return delfoiUserRoleActionDAO.hasDelfoiActionAccess(delfoi, userRole, action);
} | boolean function(DelfoiAction action, UserRole userRole) { Delfoi delfoi = getDelfoi(); return delfoiUserRoleActionDAO.hasDelfoiActionAccess(delfoi, userRole, action); } | /**
* Returns whether user role required action access
*
* @param action action
* @param userRole role
* @return whether user role required action access
*/ | Returns whether user role required action access | hasDelfoiAccess | {
"repo_name": "Metatavu/edelphi",
"path": "rest/src/main/java/fi/metatavu/edelphi/permissions/PermissionController.java",
"license": "gpl-3.0",
"size": 5541
} | [
"fi.metatavu.edelphi.domainmodel.actions.DelfoiAction",
"fi.metatavu.edelphi.domainmodel.base.Delfoi",
"fi.metatavu.edelphi.domainmodel.users.UserRole"
] | import fi.metatavu.edelphi.domainmodel.actions.DelfoiAction; import fi.metatavu.edelphi.domainmodel.base.Delfoi; import fi.metatavu.edelphi.domainmodel.users.UserRole; | import fi.metatavu.edelphi.domainmodel.actions.*; import fi.metatavu.edelphi.domainmodel.base.*; import fi.metatavu.edelphi.domainmodel.users.*; | [
"fi.metatavu.edelphi"
] | fi.metatavu.edelphi; | 1,912,402 |
Set<Cookie> getCookies();
| Set<Cookie> getCookies(); | /**
* Get all the cookies for the current domain. This is the equivalent of
* calling "document.cookie" and parsing the result
*
* @return A Set of cookies for the current domain.
*/ | Get all the cookies for the current domain. This is the equivalent of calling "document.cookie" and parsing the result | getCookies | {
"repo_name": "jijeshmohan/webdriver-rb",
"path": "common/src/java/org/openqa/selenium/WebDriver.java",
"license": "apache-2.0",
"size": 11502
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 83,720 |
boolean valid = true;
if (StringUtils.isEmpty(bean.getRejectReason())) {
valid = false;
String errorParams = "";
reportError("proposalDevelopmentRejectionBean.rejectReason", RiceKeyConstants.ERROR_REQUIRED, errorParams);
}
return valid;
} | boolean valid = true; if (StringUtils.isEmpty(bean.getRejectReason())) { valid = false; String errorParams = STRproposalDevelopmentRejectionBean.rejectReason", RiceKeyConstants.ERROR_REQUIRED, errorParams); } return valid; } | /**
*
* This method validate the reject action.
* @param bean
* @return
*/ | This method validate the reject action | proccessProposalDevelopmentRejection | {
"repo_name": "blackcathacker/kc.preclean",
"path": "coeus-code/src/main/java/org/kuali/coeus/propdev/impl/action/ProposalDevelopmentRejectionRule.java",
"license": "apache-2.0",
"size": 1613
} | [
"org.apache.commons.lang3.StringUtils",
"org.kuali.rice.core.api.util.RiceKeyConstants"
] | import org.apache.commons.lang3.StringUtils; import org.kuali.rice.core.api.util.RiceKeyConstants; | import org.apache.commons.lang3.*; import org.kuali.rice.core.api.util.*; | [
"org.apache.commons",
"org.kuali.rice"
] | org.apache.commons; org.kuali.rice; | 2,168,101 |
public String getPortForService(String name) {
if (name == null) {
return null;
}
DirContext ctx = null;
try {
Hashtable<String, String> env = new Hashtable<String, String>();
env.put(Context.INITIAL_CONTEXT_FACTORY, "com.sun.jndi.dns.DnsContextFac... | String function(String name) { if (name == null) { return null; } DirContext ctx = null; try { Hashtable<String, String> env = new Hashtable<String, String>(); env.put(Context.INITIAL_CONTEXT_FACTORY, STR); env.put(Context.PROVIDER_URL, "dns:"); env.put(STR, "false"); env.put(STR, "2000"); env.put(STR, "4"); ctx = new ... | /**
* Return the port for the specified service.
*
* @param name the service name
* @return the port
*/ | Return the port for the specified service | getPortForService | {
"repo_name": "errantepiphany/openshift-ping",
"path": "activemq/src/main/java/org/openshift/activemq/discoveryagent/dns/DNSUtil.java",
"license": "apache-2.0",
"size": 3755
} | [
"java.util.Hashtable",
"javax.naming.Context",
"javax.naming.NamingEnumeration",
"javax.naming.NamingException",
"javax.naming.directory.Attributes",
"javax.naming.directory.DirContext",
"javax.naming.directory.InitialDirContext"
] | import java.util.Hashtable; import javax.naming.Context; import javax.naming.NamingEnumeration; import javax.naming.NamingException; import javax.naming.directory.Attributes; import javax.naming.directory.DirContext; import javax.naming.directory.InitialDirContext; | import java.util.*; import javax.naming.*; import javax.naming.directory.*; | [
"java.util",
"javax.naming"
] | java.util; javax.naming; | 1,972,143 |
public static boolean allAwaited(Collection<?> futures) {
FuturePool fp = PAActiveObject.getBodyOnThis().getFuturePool();
synchronized (fp) {
Iterator<?> it = futures.iterator();
while (it.hasNext()) {
Object current = it.next();
if (!PAFutu... | static boolean function(Collection<?> futures) { FuturePool fp = PAActiveObject.getBodyOnThis().getFuturePool(); synchronized (fp) { Iterator<?> it = futures.iterator(); while (it.hasNext()) { Object current = it.next(); if (!PAFuture.isAwaited(current)) { return false; } } return true; } } | /**
* Return <code>false</code> if one object of <code>futures</code> is available.
*
* @param futures
* a table with futures.
* @return <code>true</code> if all futures are awaited, else <code>false
* </code>.
*/ | Return <code>false</code> if one object of <code>futures</code> is available | allAwaited | {
"repo_name": "paraita/programming",
"path": "programming-core/src/main/java/org/objectweb/proactive/api/PAFuture.java",
"license": "agpl-3.0",
"size": 16969
} | [
"java.util.Collection",
"java.util.Iterator",
"org.objectweb.proactive.core.body.future.FuturePool"
] | import java.util.Collection; import java.util.Iterator; import org.objectweb.proactive.core.body.future.FuturePool; | import java.util.*; import org.objectweb.proactive.core.body.future.*; | [
"java.util",
"org.objectweb.proactive"
] | java.util; org.objectweb.proactive; | 1,798,953 |
public void addSampleToMotherMap(String gene, Entity sample)
{
if (!(samplesMother.containsKey(gene)))
{
List<Entity> motherSampleList = Lists.newArrayList();
motherSampleList.add(sample);
samplesMother.put(gene, motherSampleList);
}
else
{
samplesMother.get(gene).add(sample);
}
} | void function(String gene, Entity sample) { if (!(samplesMother.containsKey(gene))) { List<Entity> motherSampleList = Lists.newArrayList(); motherSampleList.add(sample); samplesMother.put(gene, motherSampleList); } else { samplesMother.get(gene).add(sample); } } | /**
* A helper method to add a list of samples for one gene for one mother ID to a map.
*
* @param gene
* the gene we are currently looking at
* @param sample
* {@link Entity} containing one sample
*/ | A helper method to add a list of samples for one gene for one mother ID to a map | addSampleToMotherMap | {
"repo_name": "marieke-bijlsma/graduation-project",
"path": "src/main/java/org/molgenis/data/annotation/graduation/model/Trio.java",
"license": "gpl-2.0",
"size": 5323
} | [
"java.util.List",
"org.elasticsearch.common.collect.Lists",
"org.molgenis.data.Entity"
] | import java.util.List; import org.elasticsearch.common.collect.Lists; import org.molgenis.data.Entity; | import java.util.*; import org.elasticsearch.common.collect.*; import org.molgenis.data.*; | [
"java.util",
"org.elasticsearch.common",
"org.molgenis.data"
] | java.util; org.elasticsearch.common; org.molgenis.data; | 1,780,641 |
// Fields that are directly accessible at the top level BibJson object
String[] singleFieldStrings = {"year", "title", "abstract", "month"};
// Fields that are accessible in the journal part of the BibJson object
String[] journalSingleFieldStrings = {"publisher", "number", "volume"};
... | String[] singleFieldStrings = {"year", "title", STR, "month"}; String[] journalSingleFieldStrings = {STR, STR, STR}; BibEntry entry = new BibEntry(); entry.setType(STR); if (bibJsonEntry.has(STR)) { JSONArray authors = bibJsonEntry.getJSONArray(STR); List<String> authorList = new ArrayList<>(); for (int i = 0; i < auth... | /**
* Convert a JSONObject containing a bibJSON entry to a BibEntry
*
* @param bibJsonEntry The JSONObject to convert
* @return the converted BibEntry
*/ | Convert a JSONObject containing a bibJSON entry to a BibEntry | parseBibJSONtoBibtex | {
"repo_name": "RodrigoRubino/DC-UFSCar-ES2-201601-Grupo-Brainstorm",
"path": "src/main/java/net/sf/jabref/importer/fileformat/JSONEntryParser.java",
"license": "gpl-2.0",
"size": 9409
} | [
"java.util.ArrayList",
"java.util.List",
"net.sf.jabref.model.entry.BibEntry",
"org.json.JSONArray",
"org.json.JSONObject"
] | import java.util.ArrayList; import java.util.List; import net.sf.jabref.model.entry.BibEntry; import org.json.JSONArray; import org.json.JSONObject; | import java.util.*; import net.sf.jabref.model.entry.*; import org.json.*; | [
"java.util",
"net.sf.jabref",
"org.json"
] | java.util; net.sf.jabref; org.json; | 1,396,844 |
protected void scanIdentifier() throws SQLSyntaxErrorException {
if (ch == '$') {
if (scanChar() == '{') {
scanPlaceHolder();
} else {
scanIdentifierFromNumber(curIndex - 1, 1);
}
} else {
scanIdentifierFromNumbe... | void function() throws SQLSyntaxErrorException { if (ch == '$') { if (scanChar() == '{') { scanPlaceHolder(); } else { scanIdentifierFromNumber(curIndex - 1, 1); } } else { scanIdentifierFromNumber(curIndex, 0); } } | /**
* id is NOT included in <code>`</code>.
*/ | id is NOT included in <code>`</code> | scanIdentifier | {
"repo_name": "lostdragon/cobar",
"path": "cobar-parser/src/main/java/com/alibaba/cobar/parser/recognizer/lexer/SQLLexer.java",
"license": "apache-2.0",
"size": 36124
} | [
"java.sql.SQLSyntaxErrorException"
] | import java.sql.SQLSyntaxErrorException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 1,940,635 |
public Map<String, Object> getLifetimeStats() {
return this.lifetimeStats;
} | Map<String, Object> function() { return this.lifetimeStats; } | /**
* Returns general stats for the players
*
* @return The stats for the player
*/ | Returns general stats for the players | getLifetimeStats | {
"repo_name": "tomtomssi/Steam-API",
"path": "src/main/java/com/github/koraktor/steamcondenser/community/alien_swarm/AlienSwarmStats.java",
"license": "bsd-3-clause",
"size": 11105
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 67,822 |
protected static <UJO extends Ujo,VALUE> Property<UJO,VALUE> newKey(String name) {
return new OrmProperty(UNDEFINED_INDEX, name, null, null);
} | static <UJO extends Ujo,VALUE> Property<UJO,VALUE> function(String name) { return new OrmProperty(UNDEFINED_INDEX, name, null, null); } | /** A Property Factory creates new key and assigns a next key index.
* @hidden
*/ | A Property Factory creates new key and assigns a next key index | newKey | {
"repo_name": "pponec/ujorm",
"path": "project-m2/ujo-orm/src/main/java/org/ujorm/implementation/orm/OrmTableSynchronized.java",
"license": "apache-2.0",
"size": 14664
} | [
"org.ujorm.Ujo",
"org.ujorm.extensions.Property"
] | import org.ujorm.Ujo; import org.ujorm.extensions.Property; | import org.ujorm.*; import org.ujorm.extensions.*; | [
"org.ujorm",
"org.ujorm.extensions"
] | org.ujorm; org.ujorm.extensions; | 2,336,588 |
protected String getIconURL(Version version, String versionId, Profile profile, String profileId, String restApi) {
// lets find the URL of the icon in the parent profiles
String relativeIcon = profile.getIconRelativePath();
String iconProfileId = profileId;
if (isNullOrEmpty(relativ... | String function(Version version, String versionId, Profile profile, String profileId, String restApi) { String relativeIcon = profile.getIconRelativePath(); String iconProfileId = profileId; if (isNullOrEmpty(relativeIcon)) { List<String> parentIds = profile.getParentIds(); if (parentIds != null && !parentIds.isEmpty()... | /**
* Returns the URL relative to the rest api for the icon
*/ | Returns the URL relative to the rest api for the icon | getIconURL | {
"repo_name": "janstey/fabric8",
"path": "fabric/fabric-core/src/main/java/io/fabric8/core/jmx/FabricManager.java",
"license": "apache-2.0",
"size": 58175
} | [
"io.fabric8.api.Profile",
"io.fabric8.api.Version",
"java.util.List"
] | import io.fabric8.api.Profile; import io.fabric8.api.Version; import java.util.List; | import io.fabric8.api.*; import java.util.*; | [
"io.fabric8.api",
"java.util"
] | io.fabric8.api; java.util; | 1,092,681 |
public Map<String, Object> getRawMetadata() {
return Collections.unmodifiableMap(new TreeMap<String,Object>(metadata));
} | Map<String, Object> function() { return Collections.unmodifiableMap(new TreeMap<String,Object>(metadata)); } | /**
* For internal use only. Gets a map of the raw metadata/headers
* for the associated object.
*
* @return A map of the raw metadata/headers for the associated object.
*/ | For internal use only. Gets a map of the raw metadata/headers for the associated object | getRawMetadata | {
"repo_name": "trasa/aws-sdk-java",
"path": "aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/model/ObjectMetadata.java",
"license": "apache-2.0",
"size": 31009
} | [
"java.util.Collections",
"java.util.Map",
"java.util.TreeMap"
] | import java.util.Collections; import java.util.Map; import java.util.TreeMap; | import java.util.*; | [
"java.util"
] | java.util; | 2,255,153 |
Configuration exclude(Map<String, String> excludeProperties);
/**
* Execute the given action if the configuration has no defined dependencies when it first participates in
* dependency resolution. A {@code Configuration} will participate in dependency resolution
* when:
* <ul>
* <l... | Configuration exclude(Map<String, String> excludeProperties); /** * Execute the given action if the configuration has no defined dependencies when it first participates in * dependency resolution. A {@code Configuration} will participate in dependency resolution * when: * <ul> * <li>The {@link Configuration} itself is ... | /**
* Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration.
* You can also add exclude rules per-dependency. See {@link ModuleDependency#exclude(java.util.Map)}.
*
* @param excludeProperties the properties to define the exclude rule.
* @return this
... | Adds an exclude rule to exclude transitive dependencies for all dependencies of this configuration. You can also add exclude rules per-dependency. See <code>ModuleDependency#exclude(java.util.Map)</code> | exclude | {
"repo_name": "HenryHarper/Acquire-Reboot",
"path": "gradle/src/core/org/gradle/api/artifacts/Configuration.java",
"license": "mit",
"size": 17225
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 742,016 |
public void cleanup() throws SearchException
{
SQLException se = null;
try
{
if (_rs != null)
{
_rs.close();
}
}
catch (SQLException ex)
{
se = ex;
}
finally
{
_rs ... | void function() throws SearchException { SQLException se = null; try { if (_rs != null) { _rs.close(); } } catch (SQLException ex) { se = ex; } finally { _rs = null; } try { if (_pstmt != null) { _pstmt.close(); } } catch (SQLException ex) { if (se == null) se = ex; } finally { _pstmt = null; } if (se != null) throw ne... | /**
* Clean up the open handles.
*
* @throws SearchException
*/ | Clean up the open handles | cleanup | {
"repo_name": "NCIP/cadsr-freestyle-search",
"path": "software/freestylesearch/src/java/gov/nih/nci/cadsr/freestylesearch/tool/DBAccess.java",
"license": "bsd-3-clause",
"size": 39430
} | [
"gov.nih.nci.cadsr.freestylesearch.util.SearchException",
"java.sql.SQLException"
] | import gov.nih.nci.cadsr.freestylesearch.util.SearchException; import java.sql.SQLException; | import gov.nih.nci.cadsr.freestylesearch.util.*; import java.sql.*; | [
"gov.nih.nci",
"java.sql"
] | gov.nih.nci; java.sql; | 1,399,219 |
File getBrokerInstance(); | File getBrokerInstance(); | /**
* Set the Artemis instance relative folder for data and stuff.
*/ | Set the Artemis instance relative folder for data and stuff | getBrokerInstance | {
"repo_name": "gtully/activemq-artemis",
"path": "artemis-server/src/main/java/org/apache/activemq/artemis/core/config/Configuration.java",
"license": "apache-2.0",
"size": 38585
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 2,559,761 |
private static <T> String toStringImpl(
Class<T> cls,
SBLimitedLength buf,
T obj,
Object[] addNames,
Object[] addVals,
@Nullable boolean[] addSens,
int addLen) {
assert cls != null;
assert buf != null;
assert obj != null;
assert... | static <T> String function( Class<T> cls, SBLimitedLength buf, T obj, Object[] addNames, Object[] addVals, @Nullable boolean[] addSens, int addLen) { assert cls != null; assert buf != null; assert obj != null; assert addNames != null; assert addVals != null; assert addNames.length == addVals.length; assert addLen <= ad... | /**
* Creates an uniformed string presentation for the given object.
*
* @param <T> Type of object.
* @param cls Class of the object.
* @param buf String builder buffer.
* @param obj Object for which to get string presentation.
* @param addNames Names of additional values to be includ... | Creates an uniformed string presentation for the given object | toStringImpl | {
"repo_name": "ptupitsyn/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/util/tostring/GridToStringBuilder.java",
"license": "apache-2.0",
"size": 61767
} | [
"java.util.IdentityHashMap",
"org.jetbrains.annotations.Nullable"
] | import java.util.IdentityHashMap; import org.jetbrains.annotations.Nullable; | import java.util.*; import org.jetbrains.annotations.*; | [
"java.util",
"org.jetbrains.annotations"
] | java.util; org.jetbrains.annotations; | 1,010,251 |
public void setPhoneType(int phoneId, int type) {
if (SubscriptionManager.isValidPhoneId(phoneId)) {
TelephonyManager.setTelephonyProperty(phoneId,
TelephonyProperties.CURRENT_ACTIVE_PHONE, String.valueOf(type));
}
} | void function(int phoneId, int type) { if (SubscriptionManager.isValidPhoneId(phoneId)) { TelephonyManager.setTelephonyProperty(phoneId, TelephonyProperties.CURRENT_ACTIVE_PHONE, String.valueOf(type)); } } | /**
* Set phone type by phone id.
*
* @param phoneId for which phone type is set
* @param type phone type
*
* @hide
*/ | Set phone type by phone id | setPhoneType | {
"repo_name": "syslover33/ctank",
"path": "java/android-sdk-linux_r24.4.1_src/sources/android-23/android/telephony/TelephonyManager.java",
"license": "gpl-3.0",
"size": 165169
} | [
"com.android.internal.telephony.TelephonyProperties"
] | import com.android.internal.telephony.TelephonyProperties; | import com.android.internal.telephony.*; | [
"com.android.internal"
] | com.android.internal; | 228,167 |
public T caseDataObjectReference(DataObjectReference object) {
return null;
} | T function(DataObjectReference object) { return null; } | /**
* Returns the result of interpreting the object as an instance of '<em>Data Object Reference</em>'.
* <!-- begin-user-doc -->
* This implementation returns null;
* returning a non-null result will terminate the switch.
* <!-- end-user-doc -->
* @param object the target of the switch.
* @return the res... | Returns the result of interpreting the object as an instance of 'Data Object Reference'. This implementation returns null; returning a non-null result will terminate the switch. | caseDataObjectReference | {
"repo_name": "romartin/kie-wb-common",
"path": "kie-wb-common-stunner/kie-wb-common-stunner-sets/kie-wb-common-stunner-bpmn/kie-wb-common-stunner-bpmn-emf/src/main/java/org/eclipse/bpmn2/util/Bpmn2Switch.java",
"license": "apache-2.0",
"size": 144865
} | [
"org.eclipse.bpmn2.DataObjectReference"
] | import org.eclipse.bpmn2.DataObjectReference; | import org.eclipse.bpmn2.*; | [
"org.eclipse.bpmn2"
] | org.eclipse.bpmn2; | 1,340,561 |
private void scanVariant() {
for (int i = 0; i < variant.getParamList().size() && !isStop(); i++) {
// ZAP: Removed unnecessary cast.
originalPair = variant.getParamList().get(i);
if (!isToExclude(originalPair)) {
// We need t... | void function() { for (int i = 0; i < variant.getParamList().size() && !isStop(); i++) { originalPair = variant.getParamList().get(i); if (!isToExclude(originalPair)) { HttpMessage msg = getNewMsg(); try { scan(msg, originalPair); } catch (Exception e) { logger.error(STR, e); } } } } | /**
* Scan the current message using the current Variant
*/ | Scan the current message using the current Variant | scanVariant | {
"repo_name": "GillesMoris/OSS",
"path": "src/org/parosproxy/paros/core/scanner/AbstractAppParamPlugin.java",
"license": "apache-2.0",
"size": 12271
} | [
"org.parosproxy.paros.network.HttpMessage"
] | import org.parosproxy.paros.network.HttpMessage; | import org.parosproxy.paros.network.*; | [
"org.parosproxy.paros"
] | org.parosproxy.paros; | 177,568 |
Color getActiveUnselectedBadgeColor(); | Color getActiveUnselectedBadgeColor(); | /**
* The color to draw a badge's background with when it's corresponding widget item
* is unselected and the widget is in an active window.
*
* @return the color to draw a badge's background with when it's corresponding
* widget item is unselected and the widget is in an active
* ... | The color to draw a badge's background with when it's corresponding widget item is unselected and the widget is in an active window | getActiveUnselectedBadgeColor | {
"repo_name": "derreisende77/MediathekView",
"path": "src/main/java/com/explodingpixels/macwidgets/WidgetColorScheme.java",
"license": "gpl-3.0",
"size": 5210
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 1,274,894 |
private void setArchitecturesToSystem() {
// Add news architectures
for (int i = 0; i < this.getForm().getTable().getItemCount(); i++) {
TableItem item = this.getForm().getTable().getItem(i);
if (!item.getText(2).equals("")) {
boolean isNotAdd = false;
for (Architecture arc : this.getManager().get... | void function() { for (int i = 0; i < this.getForm().getTable().getItemCount(); i++) { TableItem item = this.getForm().getTable().getItem(i); if (!item.getText(2).equals(STR\\STR\\" + this.getForm().getTxtName().getStringValue()); this.getManager().createArchitecture(architecture); updateUnitsToArchitecture(architectur... | /**
* Update architectures to system
*/ | Update architectures to system | setArchitecturesToSystem | {
"repo_name": "MSMontenegro/SAE",
"path": "Project/src/Presentation/controllerSoftwareArchitectureSpecification/EditSoftwareArchitectureSpecificationPPController.java",
"license": "epl-1.0",
"size": 11253
} | [
"org.eclipse.swt.widgets.TableItem"
] | import org.eclipse.swt.widgets.TableItem; | import org.eclipse.swt.widgets.*; | [
"org.eclipse.swt"
] | org.eclipse.swt; | 1,585,230 |
private Locale getWorkplaceLocale(CmsObject cms) {
if (m_workplaceLocale == null) {
m_workplaceLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
}
return m_workplaceLocale;
}
| Locale function(CmsObject cms) { if (m_workplaceLocale == null) { m_workplaceLocale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms); } return m_workplaceLocale; } | /**
* Returns the workplace locale.<p>
*
* @param cms the current OpenCms context
*
* @return the current users workplace locale
*/ | Returns the workplace locale | getWorkplaceLocale | {
"repo_name": "PatidarWeb/opencms-core",
"path": "src/org/opencms/ade/contenteditor/CmsContentService.java",
"license": "lgpl-2.1",
"size": 49742
} | [
"java.util.Locale",
"org.opencms.file.CmsObject",
"org.opencms.main.OpenCms"
] | import java.util.Locale; import org.opencms.file.CmsObject; import org.opencms.main.OpenCms; | import java.util.*; import org.opencms.file.*; import org.opencms.main.*; | [
"java.util",
"org.opencms.file",
"org.opencms.main"
] | java.util; org.opencms.file; org.opencms.main; | 884,536 |
public boolean forEachEntry( TFloatObjectProcedure<? super V> procedure ); | boolean function( TFloatObjectProcedure<? super V> procedure ); | /**
* Executes <tt>procedure</tt> for each key/value entry in the
* map.
*
* @param procedure a <code>TFloatObjectProcedure</code> value
* @return false if the loop over the entries terminated because
* the procedure returned false for some entry.
*/ | Executes procedure for each key/value entry in the map | forEachEntry | {
"repo_name": "JianpingZeng/xcc",
"path": "xcc/external/trove/gnu/trove/map/TFloatObjectMap.java",
"license": "bsd-3-clause",
"size": 17143
} | [
"gnu.trove.procedure.TFloatObjectProcedure"
] | import gnu.trove.procedure.TFloatObjectProcedure; | import gnu.trove.procedure.*; | [
"gnu.trove.procedure"
] | gnu.trove.procedure; | 849,096 |
public boolean isConnectionOk(String url)
{
try
{
getInputStreamForUrl(url, null, false);
// no need to release connection since the stream has not been retrieved
// if the code above does not throw any exception, the connection is fine
return tru... | boolean function(String url) { try { getInputStreamForUrl(url, null, false); return true; } catch (Exception e) { return false; } } /** * Release the http connection after users finished reading the InputStream * provided by the {@link #getInputStreamForUrl(String, IProgressMonitor)} | /**
* Check if a connection with the given URL can be established.
*
* @param url The URL to test the connection.
*
* @return <code>true</code> if the connection can be established; <code>false</code> otherwise
*/ | Check if a connection with the given URL can be established | isConnectionOk | {
"repo_name": "DmitryADP/diff_qc750",
"path": "tools/motodev/src/plugins/common/src/com/motorola/studio/android/common/utilities/HttpUtils.java",
"license": "gpl-2.0",
"size": 11259
} | [
"java.io.InputStream",
"org.eclipse.core.runtime.IProgressMonitor"
] | import java.io.InputStream; import org.eclipse.core.runtime.IProgressMonitor; | import java.io.*; import org.eclipse.core.runtime.*; | [
"java.io",
"org.eclipse.core"
] | java.io; org.eclipse.core; | 1,457,675 |
protected TracProjectProperty getTracProjectProperty(GitChangeSet changeSet) {
ChangeLogSet<?> cs = changeSet.getParent();
AbstractProject<?,?> p = (AbstractProject<?,?>)cs.build.getProject();
return p.getProperty(TracProjectProperty.class);
}
| TracProjectProperty function(GitChangeSet changeSet) { ChangeLogSet<?> cs = changeSet.getParent(); AbstractProject<?,?> p = (AbstractProject<?,?>)cs.build.getProject(); return p.getProperty(TracProjectProperty.class); } | /**
* Access the Trac ProjectProperty via the changeset.
* This function is protected to allow the test to override it
* and implement a Mock getTracWebURL function to make tests easy.
*/ | Access the Trac ProjectProperty via the changeset. This function is protected to allow the test to override it and implement a Mock getTracWebURL function to make tests easy | getTracProjectProperty | {
"repo_name": "jenkinsci/trac-plugin",
"path": "src/main/java/hudson/plugins/trac/TracGitRepositoryBrowser.java",
"license": "mit",
"size": 5763
} | [
"hudson.model.AbstractProject",
"hudson.plugins.git.GitChangeSet",
"hudson.scm.ChangeLogSet"
] | import hudson.model.AbstractProject; import hudson.plugins.git.GitChangeSet; import hudson.scm.ChangeLogSet; | import hudson.model.*; import hudson.plugins.git.*; import hudson.scm.*; | [
"hudson.model",
"hudson.plugins.git",
"hudson.scm"
] | hudson.model; hudson.plugins.git; hudson.scm; | 356,440 |
@Override
public FileObject getBaseTestFolder(final FileSystemManager manager)
throws Exception
{
if (!inited)
{
opts = new FileSystemOptions();
final DarcFileConfigBuilder builder = DarcFileConfigBuilder.getInstance();
builder.setChangeSession... | FileObject function(final FileSystemManager manager) throws Exception { if (!inited) { opts = new FileSystemOptions(); final DarcFileConfigBuilder builder = DarcFileConfigBuilder.getInstance(); builder.setChangeSession(opts, STR); FileObject base = manager.resolveFile(STR, opts); FileObject from = manager.resolveFile(n... | /**
* Returns the base folder for tests.
*/ | Returns the base folder for tests | getBaseTestFolder | {
"repo_name": "seeburger-ag/seeburger-vfs2",
"path": "vfs2provider-digestarc/src/test/java/com/seeburger/vfs2/provider/digestarc/DarcProviderTestCase.java",
"license": "apache-2.0",
"size": 2693
} | [
"java.io.File",
"org.apache.commons.vfs2.AllFileSelector",
"org.apache.commons.vfs2.FileObject",
"org.apache.commons.vfs2.FileSystemManager",
"org.apache.commons.vfs2.FileSystemOptions"
] | import java.io.File; import org.apache.commons.vfs2.AllFileSelector; import org.apache.commons.vfs2.FileObject; import org.apache.commons.vfs2.FileSystemManager; import org.apache.commons.vfs2.FileSystemOptions; | import java.io.*; import org.apache.commons.vfs2.*; | [
"java.io",
"org.apache.commons"
] | java.io; org.apache.commons; | 934,528 |
public int insertFiredTrigger(Connection conn, Trigger trigger,
String state, JobDetail job) throws SQLException {
PreparedStatement ps = null;
try {
ps = conn.prepareStatement(rtp(INSERT_FIRED_TRIGGER));
ps.setString(1, trigger.getFireInstanceId());
p... | int function(Connection conn, Trigger trigger, String state, JobDetail job) throws SQLException { PreparedStatement ps = null; try { ps = conn.prepareStatement(rtp(INSERT_FIRED_TRIGGER)); ps.setString(1, trigger.getFireInstanceId()); ps.setString(2, trigger.getName()); ps.setString(3, trigger.getGroup()); setBoolean(ps... | /**
* <p>
* Insert a fired trigger.
* </p>
*
* @param conn
* the DB Connection
* @param trigger
* the trigger
* @param state
* the state that the trigger should be stored in
* @return the number of rows inserted
*/ | Insert a fired trigger. | insertFiredTrigger | {
"repo_name": "optivo-org/quartz-1.8.3-optivo",
"path": "quartz/src/main/java/org/quartz/impl/jdbcjobstore/StdJDBCDelegate.java",
"license": "apache-2.0",
"size": 117209
} | [
"java.math.BigDecimal",
"java.sql.Connection",
"java.sql.PreparedStatement",
"java.sql.SQLException",
"org.quartz.JobDetail",
"org.quartz.Trigger"
] | import java.math.BigDecimal; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.SQLException; import org.quartz.JobDetail; import org.quartz.Trigger; | import java.math.*; import java.sql.*; import org.quartz.*; | [
"java.math",
"java.sql",
"org.quartz"
] | java.math; java.sql; org.quartz; | 2,136,667 |
V removeFromQueue(K key) {
Pair2<V, Time> vt = queue.remove(key);
if (vt==null) return null;
if (vt.first==null) {
Log.w("WriteBehind", "Removing del op for "+key);
}
return vt.first;
}
| V removeFromQueue(K key) { Pair2<V, Time> vt = queue.remove(key); if (vt==null) return null; if (vt.first==null) { Log.w(STR, STR+key); } return vt.first; } | /**
* Remove the key/value mapping from the in-memory queue.
* <p>
* WARNING: This will also remove null values (ie. delayed delete commands)
* @param key
* @return the old in-queue value
*/ | Remove the key/value mapping from the in-memory queue. | removeFromQueue | {
"repo_name": "sodash/open-code",
"path": "winterwell.depot/src/com/winterwell/depot/WriteBehind.java",
"license": "mit",
"size": 5670
} | [
"com.winterwell.utils.containers.Pair2",
"com.winterwell.utils.log.Log",
"com.winterwell.utils.time.Time"
] | import com.winterwell.utils.containers.Pair2; import com.winterwell.utils.log.Log; import com.winterwell.utils.time.Time; | import com.winterwell.utils.containers.*; import com.winterwell.utils.log.*; import com.winterwell.utils.time.*; | [
"com.winterwell.utils"
] | com.winterwell.utils; | 2,452,577 |
public Observable<ServiceResponse<IssuerBundle>> getCertificateIssuerWithServiceResponseAsync(String vaultBaseUrl, String issuerName) {
if (vaultBaseUrl == null) {
throw new IllegalArgumentException("Parameter vaultBaseUrl is required and cannot be null.");
}
if (issuerName == nu... | Observable<ServiceResponse<IssuerBundle>> function(String vaultBaseUrl, String issuerName) { if (vaultBaseUrl == null) { throw new IllegalArgumentException(STR); } if (issuerName == null) { throw new IllegalArgumentException(STR); } if (this.apiVersion() == null) { throw new IllegalArgumentException(STR); } | /**
* Lists the specified certificate issuer.
*
* @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
* @param issuerName The name of the issuer.
* @return the observable to the IssuerBundle object
*/ | Lists the specified certificate issuer | getCertificateIssuerWithServiceResponseAsync | {
"repo_name": "anudeepsharma/azure-sdk-for-java",
"path": "azure-keyvault/src/main/java/com/microsoft/azure/keyvault/KeyVaultClientImpl.java",
"license": "mit",
"size": 399443
} | [
"com.microsoft.azure.keyvault.models.IssuerBundle",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.keyvault.models.IssuerBundle; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.keyvault.models.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,698,837 |
public void deactivateCoordinator(CoordinatorInboundEvents coordinator) {
activatedObjectProcessor.deactivateObject(coordinator);
} | void function(CoordinatorInboundEvents coordinator) { activatedObjectProcessor.deactivateObject(coordinator); } | /**
* Deactivate a coordinator recovered from the log.
*
* @param coordinator The coordinator.
*/ | Deactivate a coordinator recovered from the log | deactivateCoordinator | {
"repo_name": "nmcl/scratch",
"path": "graalvm/transactions/fork/narayana/XTS/WS-T/dev/src/com/arjuna/wst11/messaging/CoordinatorProcessorImpl.java",
"license": "apache-2.0",
"size": 10485
} | [
"com.arjuna.webservices11.wsat.CoordinatorInboundEvents"
] | import com.arjuna.webservices11.wsat.CoordinatorInboundEvents; | import com.arjuna.webservices11.wsat.*; | [
"com.arjuna.webservices11"
] | com.arjuna.webservices11; | 1,861,716 |
private String getElementValue(int tag, Dataset dataset) {
boolean ctp = false;
//if group is odd (private) and element is > 1000 (VR=UN or content v. header)
if (((tag & 0x00010000) != 0) && ((tag & 0x0000ff00) != 0)) {
//each block of 1000hex in the tag address space maps
... | String function(int tag, Dataset dataset) { boolean ctp = false; if (((tag & 0x00010000) != 0) && ((tag & 0x0000ff00) != 0)) { try { ctp = dataset.getString(blk).equals("CTP"); } catch (Exception notCTP) { log.warn(STR); notCTP.printStackTrace(); } } String value = null; try { if (ctp) { value = new String(dataset.getB... | /**
* Get the contents of a DICOM element in the DicomObject's dataset.
* If the element is part of a private group owned by CTP, it returns the
* value as text. This method returns the defaultString argument if the
* element does not exist.
* @param tag the tag specifying the element (in the f... | Get the contents of a DICOM element in the DicomObject's dataset. If the element is part of a private group owned by CTP, it returns the value as text. This method returns the defaultString argument if the element does not exist | getElementValue | {
"repo_name": "NCIP/national-biomedical-image-archive",
"path": "software/nbia-ctp/src/gov/nih/nci/nbia/dbadapter/NCIADatabaseDelegator.java",
"license": "bsd-3-clause",
"size": 13143
} | [
"org.dcm4che.data.Dataset"
] | import org.dcm4che.data.Dataset; | import org.dcm4che.data.*; | [
"org.dcm4che.data"
] | org.dcm4che.data; | 276,377 |
public DmdlSourceRepository getSource() {
return source;
} | DmdlSourceRepository function() { return source; } | /**
* Returns DMDL source repository.
* @return the source repository
*/ | Returns DMDL source repository | getSource | {
"repo_name": "asakusafw/asakusafw",
"path": "dmdl-project/asakusa-dmdl-java/src/main/java/com/asakusafw/dmdl/java/Configuration.java",
"license": "apache-2.0",
"size": 3959
} | [
"com.asakusafw.dmdl.source.DmdlSourceRepository"
] | import com.asakusafw.dmdl.source.DmdlSourceRepository; | import com.asakusafw.dmdl.source.*; | [
"com.asakusafw.dmdl"
] | com.asakusafw.dmdl; | 1,632,032 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.