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
sequence | imports_info
stringlengths 19
34.8k
| cluster_imports_info
stringlengths 15
3.66k
| libraries
sequence | libraries_info
stringlengths 6
661
| id
int64 0
2.92M
|
---|---|---|---|---|---|---|---|---|---|---|---|
public final void readChars(char[] buffer, int start, int length)
throws IOException {
final int end = start + length;
for (int i = start; i < end; i++) {
byte b = readByte();
if ((b & 0x80) == 0)
buffer[i] = (char)(b & 0x7F);
else if ((b & 0xE0) != 0xE0) {
buffer[i] = (char)(((b & 0x1F) << 6)
| (readByte() & 0x3F));
} else
buffer[i] = (char)(((b & 0x0F) << 12)
| ((readByte() & 0x3F) << 6)
| (readByte() & 0x3F));
}
} | final void function(char[] buffer, int start, int length) throws IOException { final int end = start + length; for (int i = start; i < end; i++) { byte b = readByte(); if ((b & 0x80) == 0) buffer[i] = (char)(b & 0x7F); else if ((b & 0xE0) != 0xE0) { buffer[i] = (char)(((b & 0x1F) << 6) (readByte() & 0x3F)); } else buffer[i] = (char)(((b & 0x0F) << 12) ((readByte() & 0x3F) << 6) (readByte() & 0x3F)); } } | /** Reads UTF-8 encoded characters into an array.
* @param buffer the array to read characters into
* @param start the offset in the array to start storing characters
* @param length the number of characters to read
* @see OutputStream#writeChars(String,int,int)
*/ | Reads UTF-8 encoded characters into an array | readChars | {
"repo_name": "GateNLP/gate-core",
"path": "src/main/java/gate/creole/annic/apache/lucene/store/InputStream.java",
"license": "lgpl-3.0",
"size": 7547
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,373,115 |
public static StackTraceElement[][] getStackTraceChain(Throwable t, String[] allow, String[] deny) {
ArrayList<StackTraceElement[]> result = new ArrayList<>();
while (t != null) {
StackTraceElement[] stack = getStackTrace(t, allow, deny);
result.add(stack);
t = t.getCause();
}
StackTraceElement[][] allStacks = new StackTraceElement[result.size()][];
for (int i = 0; i < allStacks.length; i++) {
allStacks[i] = result.get(i);
}
return allStacks;
} | static StackTraceElement[][] function(Throwable t, String[] allow, String[] deny) { ArrayList<StackTraceElement[]> result = new ArrayList<>(); while (t != null) { StackTraceElement[] stack = getStackTrace(t, allow, deny); result.add(stack); t = t.getCause(); } StackTraceElement[][] allStacks = new StackTraceElement[result.size()][]; for (int i = 0; i < allStacks.length; i++) { allStacks[i] = result.get(i); } return allStacks; } | /**
* Returns stack trace chain filtered by class names.
*/ | Returns stack trace chain filtered by class names | getStackTraceChain | {
"repo_name": "wjw465150/jodd",
"path": "jodd-core/src/main/java/jodd/exception/ExceptionUtil.java",
"license": "bsd-2-clause",
"size": 8961
} | [
"java.util.ArrayList"
] | import java.util.ArrayList; | import java.util.*; | [
"java.util"
] | java.util; | 2,912,854 |
public void vetoableChange (PropertyChangeEvent e)
{
log.config(e.getPropertyName() + "=" + e.getNewValue());
// BPartner - load Order/Invoice/Shipment
if (e.getPropertyName().equals("C_BPartner_ID"))
{
int C_BPartner_ID = ((Integer)e.getNewValue()).intValue();
initBPOrderDetails (C_BPartner_ID, true);
}
dialog.tableChanged(null);
} // vetoableChange
| void function (PropertyChangeEvent e) { log.config(e.getPropertyName() + "=" + e.getNewValue()); if (e.getPropertyName().equals(STR)) { int C_BPartner_ID = ((Integer)e.getNewValue()).intValue(); initBPOrderDetails (C_BPartner_ID, true); } dialog.tableChanged(null); } | /**
* Change Listener
* @param e event
*/ | Change Listener | vetoableChange | {
"repo_name": "erpcya/adempierePOS",
"path": "client/src/org/compiere/grid/VCreateFromInvoiceUI.java",
"license": "gpl-2.0",
"size": 12623
} | [
"java.beans.PropertyChangeEvent"
] | import java.beans.PropertyChangeEvent; | import java.beans.*; | [
"java.beans"
] | java.beans; | 688,766 |
public static List<String> listAllStreams(AmazonKinesisClient kinesisClient) {
ListStreamsRequest listStreamsRequest = new ListStreamsRequest();
listStreamsRequest.setLimit(10);
ListStreamsResult listStreamsResult = kinesisClient.listStreams(listStreamsRequest);
List<String> streamNames = listStreamsResult.getStreamNames();
while (listStreamsResult.isHasMoreStreams()) {
if (streamNames.size() > 0) {
listStreamsRequest.setExclusiveStartStreamName(streamNames.get(streamNames.size() - 1));
}
listStreamsResult = kinesisClient.listStreams(listStreamsRequest);
streamNames.addAll(listStreamsResult.getStreamNames());
}
return streamNames;
}
/**
* Deletes the input stream specified by config.KINESIS_INPUT_STREAM
*
* @param config
* The configuration containing the stream name and {@link AWSCredentialsProvider} | static List<String> function(AmazonKinesisClient kinesisClient) { ListStreamsRequest listStreamsRequest = new ListStreamsRequest(); listStreamsRequest.setLimit(10); ListStreamsResult listStreamsResult = kinesisClient.listStreams(listStreamsRequest); List<String> streamNames = listStreamsResult.getStreamNames(); while (listStreamsResult.isHasMoreStreams()) { if (streamNames.size() > 0) { listStreamsRequest.setExclusiveStartStreamName(streamNames.get(streamNames.size() - 1)); } listStreamsResult = kinesisClient.listStreams(listStreamsRequest); streamNames.addAll(listStreamsResult.getStreamNames()); } return streamNames; } /** * Deletes the input stream specified by config.KINESIS_INPUT_STREAM * * @param config * The configuration containing the stream name and {@link AWSCredentialsProvider} | /**
* Gets a list of all Kinesis streams
*
* @param kinesisClient
* The {@link AmazonKinesisClient} with Kinesis read privileges
* @return list of Kinesis streams
*/ | Gets a list of all Kinesis streams | listAllStreams | {
"repo_name": "pkallos/snowplow",
"path": "4-storage/kinesis-redshift-sink/src/main/java/com/snowplowanalytics/snowplow/kinesis/utils/KinesisUtils.java",
"license": "apache-2.0",
"size": 10485
} | [
"com.amazonaws.auth.AWSCredentialsProvider",
"com.amazonaws.services.kinesis.AmazonKinesisClient",
"com.amazonaws.services.kinesis.model.ListStreamsRequest",
"com.amazonaws.services.kinesis.model.ListStreamsResult",
"java.util.List"
] | import com.amazonaws.auth.AWSCredentialsProvider; import com.amazonaws.services.kinesis.AmazonKinesisClient; import com.amazonaws.services.kinesis.model.ListStreamsRequest; import com.amazonaws.services.kinesis.model.ListStreamsResult; import java.util.List; | import com.amazonaws.auth.*; import com.amazonaws.services.kinesis.*; import com.amazonaws.services.kinesis.model.*; import java.util.*; | [
"com.amazonaws.auth",
"com.amazonaws.services",
"java.util"
] | com.amazonaws.auth; com.amazonaws.services; java.util; | 2,101,837 |
public void setParameterCopyColor(Color color) {
this.parameterCopyColor = color;
}
| void function(Color color) { this.parameterCopyColor = color; } | /**
* Sets the color of the highlight painted on copies of editable
* parameters in parameterized completions.
*
* @param color The color to use.
* @see #setParameterCopyColor(Color)
*/ | Sets the color of the highlight painted on copies of editable parameters in parameterized completions | setParameterCopyColor | {
"repo_name": "curiosag/ftc",
"path": "AutoComplete/src/main/java/org/fife/ui/autocomplete/AutoCompletionStyleContext.java",
"license": "gpl-3.0",
"size": 3020
} | [
"java.awt.Color"
] | import java.awt.Color; | import java.awt.*; | [
"java.awt"
] | java.awt; | 2,134,034 |
public Observable<ServiceResponse<ManagedClusterInner>> updateTagsWithServiceResponseAsync(String resourceGroupName, String resourceName) {
if (this.client.subscriptionId() == null) {
throw new IllegalArgumentException("Parameter this.client.subscriptionId() is required and cannot be null.");
}
if (resourceGroupName == null) {
throw new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null.");
}
if (resourceName == null) {
throw new IllegalArgumentException("Parameter resourceName is required and cannot be null.");
}
final String apiVersion = "2020-07-01";
final Map<String, String> tags = null;
TagsObject parameters = new TagsObject();
parameters.withTags(null);
Observable<Response<ResponseBody>> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, resourceName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent());
return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<ManagedClusterInner>() { }.getType());
} | Observable<ServiceResponse<ManagedClusterInner>> function(String resourceGroupName, String resourceName) { if (this.client.subscriptionId() == null) { throw new IllegalArgumentException(STR); } if (resourceGroupName == null) { throw new IllegalArgumentException(STR); } if (resourceName == null) { throw new IllegalArgumentException(STR); } final String apiVersion = STR; final Map<String, String> tags = null; TagsObject parameters = new TagsObject(); parameters.withTags(null); Observable<Response<ResponseBody>> observable = service.updateTags(this.client.subscriptionId(), resourceGroupName, resourceName, apiVersion, this.client.acceptLanguage(), parameters, this.client.userAgent()); return client.getAzureClient().getPutOrPatchResultAsync(observable, new TypeToken<ManagedClusterInner>() { }.getType()); } | /**
* Updates tags on a managed cluster.
* Updates a managed cluster with the specified tags.
*
* @param resourceGroupName The name of the resource group.
* @param resourceName The name of the managed cluster resource.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the observable for the request
*/ | Updates tags on a managed cluster. Updates a managed cluster with the specified tags | updateTagsWithServiceResponseAsync | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/containerservice/mgmt-v2020_07_01/src/main/java/com/microsoft/azure/management/containerservice/v2020_07_01/implementation/ManagedClustersInner.java",
"license": "mit",
"size": 155942
} | [
"com.google.common.reflect.TypeToken",
"com.microsoft.azure.management.containerservice.v2020_07_01.TagsObject",
"com.microsoft.rest.ServiceResponse",
"java.util.Map"
] | import com.google.common.reflect.TypeToken; import com.microsoft.azure.management.containerservice.v2020_07_01.TagsObject; import com.microsoft.rest.ServiceResponse; import java.util.Map; | import com.google.common.reflect.*; import com.microsoft.azure.management.containerservice.v2020_07_01.*; import com.microsoft.rest.*; import java.util.*; | [
"com.google.common",
"com.microsoft.azure",
"com.microsoft.rest",
"java.util"
] | com.google.common; com.microsoft.azure; com.microsoft.rest; java.util; | 1,050,506 |
private final Set<Voice> initVoices() {
Set<Voice> voices = new HashSet<Voice>();
InputStreamReader inputStreamReader = null;
BufferedReader bufferedReader = null;
try {
Process process = Runtime.getRuntime().exec("say -v ?");
inputStreamReader = new InputStreamReader(process.getInputStream());
bufferedReader = new BufferedReader(inputStreamReader);
String nextLine;
while ((nextLine = bufferedReader.readLine()) != null) {
voices.add(new MacTTSVoice(nextLine));
}
} catch (IOException e) {
logger.error("Error while executing the 'say -v ?' command: " + e.getMessage());
} finally {
IOUtils.closeQuietly(bufferedReader);
}
return voices;
}
| final Set<Voice> function() { Set<Voice> voices = new HashSet<Voice>(); InputStreamReader inputStreamReader = null; BufferedReader bufferedReader = null; try { Process process = Runtime.getRuntime().exec(STR); inputStreamReader = new InputStreamReader(process.getInputStream()); bufferedReader = new BufferedReader(inputStreamReader); String nextLine; while ((nextLine = bufferedReader.readLine()) != null) { voices.add(new MacTTSVoice(nextLine)); } } catch (IOException e) { logger.error(STR + e.getMessage()); } finally { IOUtils.closeQuietly(bufferedReader); } return voices; } | /**
* Initializes this.voices
*
* @return The voices of this instance
*/ | Initializes this.voices | initVoices | {
"repo_name": "philomatic/smarthome",
"path": "extensions/voice/org.eclipse.smarthome.voice.mactts/src/main/java/org/eclipse/smarthome/voice/mactts/internal/MacTTSService.java",
"license": "epl-1.0",
"size": 4354
} | [
"java.io.BufferedReader",
"java.io.IOException",
"java.io.InputStreamReader",
"java.util.HashSet",
"java.util.Set",
"org.apache.commons.io.IOUtils",
"org.eclipse.smarthome.core.voice.Voice"
] | import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; import java.util.HashSet; import java.util.Set; import org.apache.commons.io.IOUtils; import org.eclipse.smarthome.core.voice.Voice; | import java.io.*; import java.util.*; import org.apache.commons.io.*; import org.eclipse.smarthome.core.voice.*; | [
"java.io",
"java.util",
"org.apache.commons",
"org.eclipse.smarthome"
] | java.io; java.util; org.apache.commons; org.eclipse.smarthome; | 1,474,260 |
public Invoice markUncollectible(Map<String, Object> params) throws StripeException {
return markUncollectible(params, (RequestOptions) null);
} | Invoice function(Map<String, Object> params) throws StripeException { return markUncollectible(params, (RequestOptions) null); } | /**
* Marking an invoice as uncollectible is useful for keeping track of bad debts that can be
* written off for accounting purposes.
*/ | Marking an invoice as uncollectible is useful for keeping track of bad debts that can be written off for accounting purposes | markUncollectible | {
"repo_name": "stripe/stripe-java",
"path": "src/main/java/com/stripe/model/Invoice.java",
"license": "mit",
"size": 73384
} | [
"com.stripe.exception.StripeException",
"com.stripe.net.RequestOptions",
"java.util.Map"
] | import com.stripe.exception.StripeException; import com.stripe.net.RequestOptions; import java.util.Map; | import com.stripe.exception.*; import com.stripe.net.*; import java.util.*; | [
"com.stripe.exception",
"com.stripe.net",
"java.util"
] | com.stripe.exception; com.stripe.net; java.util; | 1,360,625 |
private static List<Field> getEnumerationFields(Class<?> enumClass)
{
List<Field> filteredFields = new LinkedList<Field>();
for(Field f:enumClass.getDeclaredFields())
{
if(f.isEnumConstant())
{
continue; // exclude enum constants
}
if(Modifier.isStatic(f.getModifiers()))
{
continue; // exclude static
}
filteredFields.add(f);
}
return filteredFields;
} | static List<Field> function(Class<?> enumClass) { List<Field> filteredFields = new LinkedList<Field>(); for(Field f:enumClass.getDeclaredFields()) { if(f.isEnumConstant()) { continue; } if(Modifier.isStatic(f.getModifiers())) { continue; } filteredFields.add(f); } return filteredFields; } | /**
* Filters out all extraneous fields and gets only enumeration-entry level fields
* @param enumClass
* @return
*/ | Filters out all extraneous fields and gets only enumeration-entry level fields | getEnumerationFields | {
"repo_name": "ecologylab/ecologylabFundamental",
"path": "src/ecologylab/serialization/EnumerationDescriptor.java",
"license": "lgpl-3.0",
"size": 13225
} | [
"java.lang.reflect.Field",
"java.lang.reflect.Modifier",
"java.util.LinkedList",
"java.util.List"
] | import java.lang.reflect.Field; import java.lang.reflect.Modifier; import java.util.LinkedList; import java.util.List; | import java.lang.reflect.*; import java.util.*; | [
"java.lang",
"java.util"
] | java.lang; java.util; | 1,599,857 |
public void setCustomArgumentResolvers(List<HandlerMethodArgumentResolver> customArgumentResolvers) {
this.customArgumentResolvers.clear();
if (customArgumentResolvers != null) {
this.customArgumentResolvers.addAll(customArgumentResolvers);
}
} | void function(List<HandlerMethodArgumentResolver> customArgumentResolvers) { this.customArgumentResolvers.clear(); if (customArgumentResolvers != null) { this.customArgumentResolvers.addAll(customArgumentResolvers); } } | /**
* Sets the list of custom {@code HandlerMethodArgumentResolver}s that will be used
* after resolvers for supported argument type.
* @param customArgumentResolvers the list of resolvers; never {@code null}.
*/ | Sets the list of custom HandlerMethodArgumentResolvers that will be used after resolvers for supported argument type | setCustomArgumentResolvers | {
"repo_name": "qobel/esoguproject",
"path": "spring-framework/spring-messaging/src/main/java/org/springframework/messaging/handler/invocation/AbstractMethodMessageHandler.java",
"license": "apache-2.0",
"size": 21940
} | [
"java.util.List"
] | import java.util.List; | import java.util.*; | [
"java.util"
] | java.util; | 2,084,140 |
@ServiceMethod(returns = ReturnType.SINGLE)
public EvaluatePoliciesResponseInner evaluatePolicies(
String resourceGroupName, String labName, String name, EvaluatePoliciesRequest evaluatePoliciesRequest) {
return evaluatePoliciesAsync(resourceGroupName, labName, name, evaluatePoliciesRequest).block();
} | @ServiceMethod(returns = ReturnType.SINGLE) EvaluatePoliciesResponseInner function( String resourceGroupName, String labName, String name, EvaluatePoliciesRequest evaluatePoliciesRequest) { return evaluatePoliciesAsync(resourceGroupName, labName, name, evaluatePoliciesRequest).block(); } | /**
* Evaluates lab policy.
*
* @param resourceGroupName The name of the resource group.
* @param labName The name of the lab.
* @param name The name of the policy set.
* @param evaluatePoliciesRequest Request body for evaluating a policy set.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return response body for evaluating a policy set.
*/ | Evaluates lab policy | evaluatePolicies | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/devtestlabs/azure-resourcemanager-devtestlabs/src/main/java/com/azure/resourcemanager/devtestlabs/implementation/PolicySetsClientImpl.java",
"license": "mit",
"size": 12447
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.resourcemanager.devtestlabs.fluent.models.EvaluatePoliciesResponseInner",
"com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.resourcemanager.devtestlabs.fluent.models.EvaluatePoliciesResponseInner; import com.azure.resourcemanager.devtestlabs.models.EvaluatePoliciesRequest; | import com.azure.core.annotation.*; import com.azure.resourcemanager.devtestlabs.fluent.models.*; import com.azure.resourcemanager.devtestlabs.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,909,956 |
public static Bitmap decodeSampledBitmapFromFile(String filename,
int reqWidth, int reqHeight, ImageCache cache) {
// First decode with inJustDecodeBounds=true to check dimensions
final BitmapFactory.Options options = new BitmapFactory.Options();
options.inJustDecodeBounds = true;
BitmapFactory.decodeFile(filename, options);
// Calculate inSampleSize
options.inSampleSize = calculateInSampleSize(options, reqWidth,
reqHeight);
// If we're running on Honeycomb or newer, try to use inBitmap
if (Utils.hasHoneycomb()) {
addInBitmapOptions(options, cache);
}
// Decode bitmap with inSampleSize set
options.inJustDecodeBounds = false;
return BitmapFactory.decodeFile(filename, options);
} | static Bitmap function(String filename, int reqWidth, int reqHeight, ImageCache cache) { final BitmapFactory.Options options = new BitmapFactory.Options(); options.inJustDecodeBounds = true; BitmapFactory.decodeFile(filename, options); options.inSampleSize = calculateInSampleSize(options, reqWidth, reqHeight); if (Utils.hasHoneycomb()) { addInBitmapOptions(options, cache); } options.inJustDecodeBounds = false; return BitmapFactory.decodeFile(filename, options); } | /**
* Decode and sample down a bitmap from a file to the requested width and
* height.
*
* @param filename The full path of the file to decode
* @param reqWidth The requested width of the resulting bitmap
* @param reqHeight The requested height of the resulting bitmap
* @param cache The ImageCache used to find candidate bitmaps for use with
* inBitmap
* @return A bitmap sampled down from the original with the same aspect
* ratio and dimensions that are equal to or greater than the
* requested width and height
*/ | Decode and sample down a bitmap from a file to the requested width and height | decodeSampledBitmapFromFile | {
"repo_name": "nggirl/EaseChatDemo",
"path": "app/src/main/java/com/easemob/chatuidemo/video/util/ImageResizer.java",
"license": "apache-2.0",
"size": 10348
} | [
"android.graphics.Bitmap",
"android.graphics.BitmapFactory"
] | import android.graphics.Bitmap; import android.graphics.BitmapFactory; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 1,110,932 |
public static String getAccountUuidFromIntent(Intent intent) {
final Uri uri = intent.getData();
if (uri == null) {
return null;
}
String uuid = uri.getQueryParameter(ACCOUNT_UUID_PARAM);
return TextUtils.isEmpty(uuid) ? null : uuid;
} | static String function(Intent intent) { final Uri uri = intent.getData(); if (uri == null) { return null; } String uuid = uri.getQueryParameter(ACCOUNT_UUID_PARAM); return TextUtils.isEmpty(uuid) ? null : uuid; } | /**
* Retrieve the account UUID, or null if the UUID param is not found.
*/ | Retrieve the account UUID, or null if the UUID param is not found | getAccountUuidFromIntent | {
"repo_name": "craigacgomez/android_email_policy_patch",
"path": "packages/apps/Email/emailcommon/src/com/android/emailcommon/utility/IntentUtilities.java",
"license": "apache-2.0",
"size": 5263
} | [
"android.content.Intent",
"android.net.Uri",
"android.text.TextUtils"
] | import android.content.Intent; import android.net.Uri; import android.text.TextUtils; | import android.content.*; import android.net.*; import android.text.*; | [
"android.content",
"android.net",
"android.text"
] | android.content; android.net; android.text; | 1,695,128 |
@Test
public void testInterpolationInMultipleConfigs()
{
Configuration c1 = new PropertiesConfiguration();
c1.addProperty("property.one", "one");
c1.addProperty("property.two", "two");
Configuration c2 = new PropertiesConfiguration();
c2.addProperty("property.one.ref", "${property.one}");
cc.addConfiguration(c1);
cc.addConfiguration(c2);
assertEquals("Wrong interpolated value", "one",
cc.getString("property.one.ref"));
} | void function() { Configuration c1 = new PropertiesConfiguration(); c1.addProperty(STR, "one"); c1.addProperty(STR, "two"); Configuration c2 = new PropertiesConfiguration(); c2.addProperty(STR, STR); cc.addConfiguration(c1); cc.addConfiguration(c2); assertEquals(STR, "one", cc.getString(STR)); } | /**
* Tests whether interpolation works if multiple configurations are
* involved. This test is related to CONFIGURATION-441.
*/ | Tests whether interpolation works if multiple configurations are involved. This test is related to CONFIGURATION-441 | testInterpolationInMultipleConfigs | {
"repo_name": "mohanaraosv/commons-configuration",
"path": "src/test/java/org/apache/commons/configuration2/TestCompositeConfiguration.java",
"license": "apache-2.0",
"size": 31733
} | [
"org.junit.Assert"
] | import org.junit.Assert; | import org.junit.*; | [
"org.junit"
] | org.junit; | 2,435,349 |
void updateFlash() {
switch (mFlash) {
case Constants.FLASH_OFF:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_ON);
mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE,
CaptureRequest.FLASH_MODE_OFF);
break;
case Constants.FLASH_ON:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH);
mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE,
CaptureRequest.FLASH_MODE_OFF);
break;
case Constants.FLASH_TORCH:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_ON);
mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE,
CaptureRequest.FLASH_MODE_TORCH);
break;
case Constants.FLASH_AUTO:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH);
mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE,
CaptureRequest.FLASH_MODE_OFF);
break;
case Constants.FLASH_RED_EYE:
mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE,
CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE);
mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE,
CaptureRequest.FLASH_MODE_OFF);
break;
}
} | void updateFlash() { switch (mFlash) { case Constants.FLASH_OFF: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON); mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; case Constants.FLASH_ON: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_ALWAYS_FLASH); mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; case Constants.FLASH_TORCH: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON); mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_TORCH); break; case Constants.FLASH_AUTO: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH); mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; case Constants.FLASH_RED_EYE: mPreviewRequestBuilder.set(CaptureRequest.CONTROL_AE_MODE, CaptureRequest.CONTROL_AE_MODE_ON_AUTO_FLASH_REDEYE); mPreviewRequestBuilder.set(CaptureRequest.FLASH_MODE, CaptureRequest.FLASH_MODE_OFF); break; } } | /**
* Updates the internal state of flash to {@link #mFlash}.
*/ | Updates the internal state of flash to <code>#mFlash</code> | updateFlash | {
"repo_name": "wajahatkarim3/LongImageCamera",
"path": "longimagecamera-lib/src/main/api21/com/google/android/cameraview/Camera2.java",
"license": "apache-2.0",
"size": 27627
} | [
"android.hardware.camera2.CaptureRequest"
] | import android.hardware.camera2.CaptureRequest; | import android.hardware.camera2.*; | [
"android.hardware"
] | android.hardware; | 2,171,916 |
private void addRestResourceClasses(Set<Class<?>> resources) {
resources.add(net.cofares.ljug.resttest.WsResource.class);
} | void function(Set<Class<?>> resources) { resources.add(net.cofares.ljug.resttest.WsResource.class); } | /**
* Do not modify addRestResourceClasses() method.
* It is automatically populated with
* all resources defined in the project.
* If required, comment out calling this method in getClasses().
*/ | Do not modify addRestResourceClasses() method. It is automatically populated with all resources defined in the project. If required, comment out calling this method in getClasses() | addRestResourceClasses | {
"repo_name": "ljug/java-tutorials",
"path": "J2EE-C1/TP/restTest/src/main/java/net/cofares/ljug/resttest/ApplicationConfig.java",
"license": "lgpl-3.0",
"size": 966
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 624,202 |
@VisibleForTesting
static Pair<String, String> toolPathFromSkylark(SkylarkInfo toolPathStruct) throws EvalException {
checkRightProviderType(toolPathStruct, "tool_path");
String name = getMandatoryFieldFromSkylarkProvider(toolPathStruct, "name", String.class);
String path = getMandatoryFieldFromSkylarkProvider(toolPathStruct, "path", String.class);
if (name == null || name.isEmpty()) {
throw new EvalException(
toolPathStruct.getCreationLoc(),
"'name' parameter of tool_path must be a nonempty string.");
}
if (path == null || path.isEmpty()) {
throw new EvalException(
toolPathStruct.getCreationLoc(),
"'path' parameter of tool_path must be a nonempty string.");
}
return Pair.of(name, path);
} | static Pair<String, String> toolPathFromSkylark(SkylarkInfo toolPathStruct) throws EvalException { checkRightProviderType(toolPathStruct, STR); String name = getMandatoryFieldFromSkylarkProvider(toolPathStruct, "name", String.class); String path = getMandatoryFieldFromSkylarkProvider(toolPathStruct, "path", String.class); if (name == null name.isEmpty()) { throw new EvalException( toolPathStruct.getCreationLoc(), STR); } if (path == null path.isEmpty()) { throw new EvalException( toolPathStruct.getCreationLoc(), STR); } return Pair.of(name, path); } | /**
* Creates a Pair(name, path) that represents a {@link
* com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.ToolPath} from a {@link
* SkylarkInfo}.
*/ | Creates a Pair(name, path) that represents a <code>com.google.devtools.build.lib.view.config.crosstool.CrosstoolConfig.ToolPath</code> from a <code>SkylarkInfo</code> | toolPathFromSkylark | {
"repo_name": "akira-baruah/bazel",
"path": "src/main/java/com/google/devtools/build/lib/rules/cpp/CcModule.java",
"license": "apache-2.0",
"size": 82333
} | [
"com.google.devtools.build.lib.packages.SkylarkInfo",
"com.google.devtools.build.lib.syntax.EvalException",
"com.google.devtools.build.lib.util.Pair"
] | import com.google.devtools.build.lib.packages.SkylarkInfo; import com.google.devtools.build.lib.syntax.EvalException; import com.google.devtools.build.lib.util.Pair; | import com.google.devtools.build.lib.packages.*; import com.google.devtools.build.lib.syntax.*; import com.google.devtools.build.lib.util.*; | [
"com.google.devtools"
] | com.google.devtools; | 2,688,720 |
public Date getAcknowledgedAt() {
return (Date) mProperties.get(FIELD_ACKNOWLEDGED_AT);
} | Date function() { return (Date) mProperties.get(FIELD_ACKNOWLEDGED_AT); } | /**
* Gets the time the collaboration's status was changed.
*
* @return the time the collaboration's status was changed.
*/ | Gets the time the collaboration's status was changed | getAcknowledgedAt | {
"repo_name": "irvingruan/box-android-content-sdk",
"path": "box-content-sdk/src/main/java/com/box/androidsdk/content/models/BoxCollaboration.java",
"license": "apache-2.0",
"size": 11569
} | [
"java.util.Date"
] | import java.util.Date; | import java.util.*; | [
"java.util"
] | java.util; | 1,426,748 |
public static void log(final Logger logger, final Level level, final Marker marker, final String format, final Object arg) {
if (level == Level.INFO)
logger.info(marker, format, arg);
else if (level == Level.DEBUG)
logger.debug(marker, format, arg);
else if (level == Level.TRACE)
logger.trace(marker, format, arg);
else if (level == Level.WARN)
logger.warn(marker, format, arg);
else if (level == Level.ERROR)
logger.error(marker, format, arg);
else
throw new UnsupportedOperationException("Unsupported level: " + level);
}
/**
* This method is similar to {@link #log(final Logger logger, final Level level, String, Object, Object)} | static void function(final Logger logger, final Level level, final Marker marker, final String format, final Object arg) { if (level == Level.INFO) logger.info(marker, format, arg); else if (level == Level.DEBUG) logger.debug(marker, format, arg); else if (level == Level.TRACE) logger.trace(marker, format, arg); else if (level == Level.WARN) logger.warn(marker, format, arg); else if (level == Level.ERROR) logger.error(marker, format, arg); else throw new UnsupportedOperationException(STR + level); } /** * This method is similar to {@link #log(final Logger logger, final Level level, String, Object, Object)} | /**
* This method is similar to {@link #log(final Logger logger, final Level level, String, Object)} method except that the
* marker data is also taken into consideration.
*
* @param logger the logger
* @param level the logging level
* @param marker the marker data specific to this log statement
* @param format the format string
* @param arg the argument
*/ | This method is similar to <code>#log(final Logger logger, final Level level, String, Object)</code> method except that the marker data is also taken into consideration | log | {
"repo_name": "SevaSafris/java",
"path": "lib4j/logging/src/main/java/org/lib4j/logging/LoggerUtil.java",
"license": "mit",
"size": 12102
} | [
"org.slf4j.Logger",
"org.slf4j.Marker",
"org.slf4j.event.Level"
] | import org.slf4j.Logger; import org.slf4j.Marker; import org.slf4j.event.Level; | import org.slf4j.*; import org.slf4j.event.*; | [
"org.slf4j",
"org.slf4j.event"
] | org.slf4j; org.slf4j.event; | 1,825,954 |
void dropTable(@Credential String apiKey, String table, Audit audit)
throws UnknownTableException; | void dropTable(@Credential String apiKey, String table, Audit audit) throws UnknownTableException; | /**
* Drops the specified table and all data associated with it.
*/ | Drops the specified table and all data associated with it | dropTable | {
"repo_name": "bazaarvoice/emodb",
"path": "blob-api/src/main/java/com/bazaarvoice/emodb/blob/api/AuthBlobStore.java",
"license": "apache-2.0",
"size": 5456
} | [
"com.bazaarvoice.emodb.auth.proxy.Credential",
"com.bazaarvoice.emodb.sor.api.Audit",
"com.bazaarvoice.emodb.sor.api.UnknownTableException"
] | import com.bazaarvoice.emodb.auth.proxy.Credential; import com.bazaarvoice.emodb.sor.api.Audit; import com.bazaarvoice.emodb.sor.api.UnknownTableException; | import com.bazaarvoice.emodb.auth.proxy.*; import com.bazaarvoice.emodb.sor.api.*; | [
"com.bazaarvoice.emodb"
] | com.bazaarvoice.emodb; | 1,432,365 |
private void setWriter () throws IOException {
writer = new FileWriter ( log.getName (), true );
} | void function () throws IOException { writer = new FileWriter ( log.getName (), true ); } | /**
* Method description
*
*
* @throws IOException
*/ | Method description | setWriter | {
"repo_name": "alperenelhan/multiplayer_checkers_game",
"path": "source/server/LogThemAll.java",
"license": "gpl-3.0",
"size": 1448
} | [
"java.io.FileWriter",
"java.io.IOException"
] | import java.io.FileWriter; import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,618,140 |
public static ComponentUI createUI(JComponent a) {
MultiSeparatorUI mui = new MultiSeparatorUI();
return MultiLookAndFeel.createUIs(mui, mui.uis, a);
} | static ComponentUI function(JComponent a) { MultiSeparatorUI mui = new MultiSeparatorUI(); return MultiLookAndFeel.createUIs(mui, mui.uis, a); } | /**
* Returns a multiplexing UI instance if any of the auxiliary
* <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the
* UI object obtained from the default <code>LookAndFeel</code>.
*
* @param a the component to create the UI for
* @return the UI delegate created
*/ | Returns a multiplexing UI instance if any of the auxiliary <code>LookAndFeel</code>s supports this UI. Otherwise, just returns the UI object obtained from the default <code>LookAndFeel</code> | createUI | {
"repo_name": "mirkosertic/Bytecoder",
"path": "classlib/java.desktop/src/main/resources/META-INF/modules/java.desktop/classes/javax/swing/plaf/multi/MultiSeparatorUI.java",
"license": "apache-2.0",
"size": 7308
} | [
"javax.swing.JComponent",
"javax.swing.plaf.ComponentUI"
] | import javax.swing.JComponent; import javax.swing.plaf.ComponentUI; | import javax.swing.*; import javax.swing.plaf.*; | [
"javax.swing"
] | javax.swing; | 2,298,521 |
@Message(id = 119, value = "Value %s for attribute %s is not a valid multicast address")
OperationFailedException invalidMulticastAddress(String value, String name); | @Message(id = 119, value = STR) OperationFailedException invalidMulticastAddress(String value, String name); | /**
* Creates an exception indicating the {@code value} for the attribute, represented by the {@code name} parameter,
* is not a valid multicast address.
*
* @param value the invalid value.
* @param name the name of the attribute.\
*
* @return a {@link XMLStreamException} for the error.
*/ | Creates an exception indicating the value for the attribute, represented by the name parameter, is not a valid multicast address | invalidMulticastAddress | {
"repo_name": "aloubyansky/wildfly-core",
"path": "controller/src/main/java/org/jboss/as/controller/logging/ControllerLogger.java",
"license": "lgpl-2.1",
"size": 164970
} | [
"org.jboss.as.controller.OperationFailedException",
"org.jboss.logging.annotations.Message"
] | import org.jboss.as.controller.OperationFailedException; import org.jboss.logging.annotations.Message; | import org.jboss.as.controller.*; import org.jboss.logging.annotations.*; | [
"org.jboss.as",
"org.jboss.logging"
] | org.jboss.as; org.jboss.logging; | 79,112 |
public Timestamp getUpdated();
public static final String COLUMNNAME_UpdatedBy = "UpdatedBy"; | Timestamp function(); public static final String COLUMNNAME_UpdatedBy = STR; | /** Get Updated.
* Date this record was updated
*/ | Get Updated. Date this record was updated | getUpdated | {
"repo_name": "geneos/adempiere",
"path": "base/src/org/compiere/model/I_AD_SchedulerRecipient.java",
"license": "gpl-2.0",
"size": 5160
} | [
"java.sql.Timestamp"
] | import java.sql.Timestamp; | import java.sql.*; | [
"java.sql"
] | java.sql; | 127,494 |
public Observable<ServiceResponse<Page<ScheduleInner>>> listNextSinglePageAsync(final String nextPageLink) {
if (nextPageLink == null) {
throw new IllegalArgumentException("Parameter nextPageLink is required and cannot be null.");
} | Observable<ServiceResponse<Page<ScheduleInner>>> function(final String nextPageLink) { if (nextPageLink == null) { throw new IllegalArgumentException(STR); } | /**
* List schedules in a given lab.
*
ServiceResponse<PageImpl<ScheduleInner>> * @param nextPageLink The NextLink from the previous successful call to List operation.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @return the PagedList<ScheduleInner> object wrapped in {@link ServiceResponse} if successful.
*/ | List schedules in a given lab | listNextSinglePageAsync | {
"repo_name": "martinsawicki/azure-sdk-for-java",
"path": "azure-mgmt-devtestlab/src/main/java/com/microsoft/azure/management/devtestlab/implementation/SchedulesInner.java",
"license": "mit",
"size": 75653
} | [
"com.microsoft.azure.Page",
"com.microsoft.rest.ServiceResponse"
] | import com.microsoft.azure.Page; import com.microsoft.rest.ServiceResponse; | import com.microsoft.azure.*; import com.microsoft.rest.*; | [
"com.microsoft.azure",
"com.microsoft.rest"
] | com.microsoft.azure; com.microsoft.rest; | 2,845,817 |
@Override public void readExternal(ObjectInput in) throws IOException {
path = IgfsUtils.readPath(in);
blockSize = in.readInt();
grpBlockSize = in.readLong();
len = in.readLong();
props = IgfsUtils.readStringMap(in);
accessTime = in.readLong();
modificationTime = in.readLong();
flags = in.readByte();
} | @Override void function(ObjectInput in) throws IOException { path = IgfsUtils.readPath(in); blockSize = in.readInt(); grpBlockSize = in.readLong(); len = in.readLong(); props = IgfsUtils.readStringMap(in); accessTime = in.readLong(); modificationTime = in.readLong(); flags = in.readByte(); } | /**
* Reads object from data input.
*
* @param in Data input.
*/ | Reads object from data input | readExternal | {
"repo_name": "ilantukh/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/igfs/IgfsFileImpl.java",
"license": "apache-2.0",
"size": 8323
} | [
"java.io.IOException",
"java.io.ObjectInput"
] | import java.io.IOException; import java.io.ObjectInput; | import java.io.*; | [
"java.io"
] | java.io; | 265,443 |
@Override
public void generatePreTry(JavaWriter out)
throws IOException
{
_next.generatePreTry(out);
}
/**
* Generates code before the call, in the try block.
* <code><pre>
* retType myMethod(...)
* {
* try {
* [pre-call]
* value = bean.myMethod(...);
* ...
* } | void function(JavaWriter out) throws IOException { _next.generatePreTry(out); } /** * Generates code before the call, in the try block. * <code><pre> * retType myMethod(...) * { * try { * [pre-call] * value = bean.myMethod(...); * ... * } | /**
* Generates code before the try block
*/ | Generates code before the try block | generatePreTry | {
"repo_name": "christianchristensen/resin",
"path": "modules/kernel/src/com/caucho/config/gen/AbstractCallChain.java",
"license": "gpl-2.0",
"size": 7992
} | [
"com.caucho.java.JavaWriter",
"java.io.IOException"
] | import com.caucho.java.JavaWriter; import java.io.IOException; | import com.caucho.java.*; import java.io.*; | [
"com.caucho.java",
"java.io"
] | com.caucho.java; java.io; | 663,421 |
public static void clickElementAndWaitForUiQuiescence(
final int elementName, final PointF position) throws InterruptedException {
performActionAndWaitForUiQuiescence(() -> { clickElement(elementName, position); });
} | static void function( final int elementName, final PointF position) throws InterruptedException { performActionAndWaitForUiQuiescence(() -> { clickElement(elementName, position); }); } | /**
* Clicks on a UI element as if done via a controller and waits until all resulting
* animations have finished and propogated to the point of being visible in screenshots.
*
* @param elementName The UserFriendlyElementName that will be clicked on.
* @param position A PointF specifying where on the element to send the click relative to a
* unit square centered at (0, 0).
*/ | Clicks on a UI element as if done via a controller and waits until all resulting animations have finished and propogated to the point of being visible in screenshots | clickElementAndWaitForUiQuiescence | {
"repo_name": "ric2b/Vivaldi-browser",
"path": "chromium/chrome/android/javatests/src/org/chromium/chrome/browser/vr/util/NativeUiUtils.java",
"license": "bsd-3-clause",
"size": 28185
} | [
"android.graphics.PointF"
] | import android.graphics.PointF; | import android.graphics.*; | [
"android.graphics"
] | android.graphics; | 2,802,866 |
@SuppressWarnings("unchecked")
private static <T> T readValue(JsonReader jsonReader, Class<T> valueType)
throws IOException {
if (valueType.equals(String.class)) return ((T) jsonReader.nextString());
if (valueType.equals(Boolean.class)) return ((T) ((Boolean) jsonReader.nextBoolean()));
if (valueType.equals(Integer.class)) return ((T) ((Integer) jsonReader.nextInt()));
if (valueType.equals(Long.class)) return ((T) ((Long) jsonReader.nextLong()));
if (valueType.equals(Double.class)) return ((T) ((Double) jsonReader.nextDouble()));
throw new IllegalArgumentException("Cannot read values of type " + valueType);
} | @SuppressWarnings(STR) static <T> T function(JsonReader jsonReader, Class<T> valueType) throws IOException { if (valueType.equals(String.class)) return ((T) jsonReader.nextString()); if (valueType.equals(Boolean.class)) return ((T) ((Boolean) jsonReader.nextBoolean())); if (valueType.equals(Integer.class)) return ((T) ((Integer) jsonReader.nextInt())); if (valueType.equals(Long.class)) return ((T) ((Long) jsonReader.nextLong())); if (valueType.equals(Double.class)) return ((T) ((Double) jsonReader.nextDouble())); throw new IllegalArgumentException(STR + valueType); } | /**
* Returns the next value of type {@code valueType} as a {@code T}.
* @param jsonReader JsonReader instance to be used.
* @param valueType The type of the value to read.
* @throws IllegalArgumentException If the {@code valueType} isn't known.
* @return the read value.
*/ | Returns the next value of type valueType as a T | readValue | {
"repo_name": "hujiajie/chromium-crosswalk",
"path": "content/public/test/android/javatests/src/org/chromium/content/browser/test/util/DOMUtils.java",
"license": "bsd-3-clause",
"size": 20634
} | [
"android.util.JsonReader",
"java.io.IOException"
] | import android.util.JsonReader; import java.io.IOException; | import android.util.*; import java.io.*; | [
"android.util",
"java.io"
] | android.util; java.io; | 2,137,770 |
public Logging findByregionIDString_Last(String regionIDString,
OrderByComparator orderByComparator)
throws NoSuchLoggingException, SystemException {
Logging logging = fetchByregionIDString_Last(regionIDString,
orderByComparator);
if (logging != null) {
return logging;
}
StringBundler msg = new StringBundler(4);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.append("regionIDString=");
msg.append(regionIDString);
msg.append(StringPool.CLOSE_CURLY_BRACE);
throw new NoSuchLoggingException(msg.toString());
} | Logging function(String regionIDString, OrderByComparator orderByComparator) throws NoSuchLoggingException, SystemException { Logging logging = fetchByregionIDString_Last(regionIDString, orderByComparator); if (logging != null) { return logging; } StringBundler msg = new StringBundler(4); msg.append(_NO_SUCH_ENTITY_WITH_KEY); msg.append(STR); msg.append(regionIDString); msg.append(StringPool.CLOSE_CURLY_BRACE); throw new NoSuchLoggingException(msg.toString()); } | /**
* Returns the last logging in the ordered set where regionIDString = ?.
*
* @param regionIDString the region i d string
* @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
* @return the last matching logging
* @throws de.fraunhofer.fokus.movepla.NoSuchLoggingException if a matching logging could not be found
* @throws SystemException if a system exception occurred
*/ | Returns the last logging in the ordered set where regionIDString = ? | findByregionIDString_Last | {
"repo_name": "fraunhoferfokus/govapps",
"path": "data-portlet/src/main/java/de/fraunhofer/fokus/movepla/service/persistence/LoggingPersistenceImpl.java",
"license": "bsd-3-clause",
"size": 212106
} | [
"com.liferay.portal.kernel.exception.SystemException",
"com.liferay.portal.kernel.util.OrderByComparator",
"com.liferay.portal.kernel.util.StringBundler",
"com.liferay.portal.kernel.util.StringPool",
"de.fraunhofer.fokus.movepla.NoSuchLoggingException",
"de.fraunhofer.fokus.movepla.model.Logging"
] | import com.liferay.portal.kernel.exception.SystemException; import com.liferay.portal.kernel.util.OrderByComparator; import com.liferay.portal.kernel.util.StringBundler; import com.liferay.portal.kernel.util.StringPool; import de.fraunhofer.fokus.movepla.NoSuchLoggingException; import de.fraunhofer.fokus.movepla.model.Logging; | import com.liferay.portal.kernel.exception.*; import com.liferay.portal.kernel.util.*; import de.fraunhofer.fokus.movepla.*; import de.fraunhofer.fokus.movepla.model.*; | [
"com.liferay.portal",
"de.fraunhofer.fokus"
] | com.liferay.portal; de.fraunhofer.fokus; | 1,075,459 |
public GridDeploymentManager deploy(); | GridDeploymentManager function(); | /**
* Gets deployment manager.
*
* @return Deployment manager.
*/ | Gets deployment manager | deploy | {
"repo_name": "dlnufox/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/GridKernalContext.java",
"license": "apache-2.0",
"size": 15723
} | [
"org.apache.ignite.internal.managers.deployment.GridDeploymentManager"
] | import org.apache.ignite.internal.managers.deployment.GridDeploymentManager; | import org.apache.ignite.internal.managers.deployment.*; | [
"org.apache.ignite"
] | org.apache.ignite; | 2,094,417 |
ServiceCall<Void> responseFloatAsync(String scenario, final ServiceCallback<Void> serviceCallback); | ServiceCall<Void> responseFloatAsync(String scenario, final ServiceCallback<Void> serviceCallback); | /**
* Get a response with header value "value": 0.07 or -3.0.
*
* @param scenario Send a post request with header values "scenario": "positive" or "negative"
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/ | Get a response with header value "value": 0.07 or -3.0 | responseFloatAsync | {
"repo_name": "tbombach/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/header/Headers.java",
"license": "mit",
"size": 62060
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; | import com.microsoft.rest.*; | [
"com.microsoft.rest"
] | com.microsoft.rest; | 2,232,777 |
@Metadata(description = "This option is used to set the ErrorHandler that Jetty server uses.", label = "advanced")
public void setErrorHandler(ErrorHandler errorHandler) {
this.errorHandler = errorHandler;
} | @Metadata(description = STR, label = STR) void function(ErrorHandler errorHandler) { this.errorHandler = errorHandler; } | /**
* This option is used to set the ErrorHandler that Jetty server uses.
*/ | This option is used to set the ErrorHandler that Jetty server uses | setErrorHandler | {
"repo_name": "RohanHart/camel",
"path": "components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/JettyHttpComponent.java",
"license": "apache-2.0",
"size": 62997
} | [
"org.apache.camel.spi.Metadata",
"org.eclipse.jetty.server.handler.ErrorHandler"
] | import org.apache.camel.spi.Metadata; import org.eclipse.jetty.server.handler.ErrorHandler; | import org.apache.camel.spi.*; import org.eclipse.jetty.server.handler.*; | [
"org.apache.camel",
"org.eclipse.jetty"
] | org.apache.camel; org.eclipse.jetty; | 1,090,374 |
public GetItemOutcome getItemOutcome(String hashKeyName, Object hashKeyValue,
String rangeKeyName, Object rangeKeyValue); | GetItemOutcome function(String hashKeyName, Object hashKeyValue, String rangeKeyName, Object rangeKeyValue); | /**
* Retrieves an item and the associated information by primary key when the
* primary key consists of both a hash-key and a range-key. Incurs network
* access.
*
* @return the (non-null) result of item retrieval.
*/ | Retrieves an item and the associated information by primary key when the primary key consists of both a hash-key and a range-key. Incurs network access | getItemOutcome | {
"repo_name": "dagnir/aws-sdk-java",
"path": "aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/api/GetItemApi.java",
"license": "apache-2.0",
"size": 6888
} | [
"com.amazonaws.services.dynamodbv2.document.GetItemOutcome"
] | import com.amazonaws.services.dynamodbv2.document.GetItemOutcome; | import com.amazonaws.services.dynamodbv2.document.*; | [
"com.amazonaws.services"
] | com.amazonaws.services; | 935,932 |
public void evaluateFeatureInformation() {
// --- Clear all reminder ---------------------------------------------
this.getFeatureMap().clear();
this.getPluginMap().clear();
this.getFeatureToPluginListMap().clear();
this.getPluginToFeatureListMap().clear();
// --- Evaluate the feature directory ---------------------------------
List<Feature> featureList = this.getFeatureListFromFeatureDirectory();
for (Feature feature : featureList) {
// --- Remind the feature -----------------------------------------
this.getFeatureMap().put(feature.getId(), feature);
// --- Get included features for that feature -
ArrayList<String> includedFeatures = this.getIncludedFeatures(feature);
this.getIncludedFeaturesForFeatureMap().put(feature.getId(), includedFeatures);
// --- Get included features for that feature ---------------------
ArrayList<String> importedFeatures = this.getRequiredImportedFeatures(feature);
this.getImportedFeaturesForFeatureMap().put(feature.getId(), importedFeatures);
// --- Store further cross information ----------------------------
ArrayList<String> pluginNameList = new ArrayList<>();
List<Plugin> pluginList = this.getFeaturePlugins(feature);
for (Plugin plugin : pluginList ) {
pluginNameList.add(plugin.getId());
this.getPluginMap().put(plugin.getId(), plugin);
// --- Did we find the product bundle? ------------------------
if (plugin.getId().equals(this.getProductBundleID())==true) {
this.setProductFeatureID(feature.getId());
}
// --- Do we have already a feature for this bundle? ----------
ArrayList<String> featureIDs = this.getPluginToFeatureListMap().get(plugin.getId());
if (featureIDs==null) {
featureIDs = new ArrayList<>();
featureIDs.add(feature.getId());
this.getPluginToFeatureListMap().put(plugin.getId(), featureIDs);
} else {
if (featureIDs.contains(feature.getId())==false) {
featureIDs.add(feature.getId());
}
}
} // end for
// --- Put plugins of current feature in the reminder -------------
this.getFeatureToPluginListMap().put(feature.getId(), pluginNameList);
}
if (this.isDevelopmentMode==true) {
this.printFeatureInformation();
}
}
| void function() { this.getFeatureMap().clear(); this.getPluginMap().clear(); this.getFeatureToPluginListMap().clear(); this.getPluginToFeatureListMap().clear(); List<Feature> featureList = this.getFeatureListFromFeatureDirectory(); for (Feature feature : featureList) { this.getFeatureMap().put(feature.getId(), feature); ArrayList<String> includedFeatures = this.getIncludedFeatures(feature); this.getIncludedFeaturesForFeatureMap().put(feature.getId(), includedFeatures); ArrayList<String> importedFeatures = this.getRequiredImportedFeatures(feature); this.getImportedFeaturesForFeatureMap().put(feature.getId(), importedFeatures); ArrayList<String> pluginNameList = new ArrayList<>(); List<Plugin> pluginList = this.getFeaturePlugins(feature); for (Plugin plugin : pluginList ) { pluginNameList.add(plugin.getId()); this.getPluginMap().put(plugin.getId(), plugin); if (plugin.getId().equals(this.getProductBundleID())==true) { this.setProductFeatureID(feature.getId()); } ArrayList<String> featureIDs = this.getPluginToFeatureListMap().get(plugin.getId()); if (featureIDs==null) { featureIDs = new ArrayList<>(); featureIDs.add(feature.getId()); this.getPluginToFeatureListMap().put(plugin.getId(), featureIDs); } else { if (featureIDs.contains(feature.getId())==false) { featureIDs.add(feature.getId()); } } } this.getFeatureToPluginListMap().put(feature.getId(), pluginNameList); } if (this.isDevelopmentMode==true) { this.printFeatureInformation(); } } | /**
* Update the feature information.
*/ | Update the feature information | evaluateFeatureInformation | {
"repo_name": "EnFlexIT/AgentWorkbench",
"path": "eclipseProjects/org.agentgui/bundles/de.enflexit.common/src/de/enflexit/common/featureEvaluation/FeatureEvaluator.java",
"license": "lgpl-2.1",
"size": 22592
} | [
"de.enflexit.common.featureEvaluation.featureXML.Feature",
"de.enflexit.common.featureEvaluation.featureXML.Plugin",
"java.util.ArrayList",
"java.util.List"
] | import de.enflexit.common.featureEvaluation.featureXML.Feature; import de.enflexit.common.featureEvaluation.featureXML.Plugin; import java.util.ArrayList; import java.util.List; | import de.enflexit.common.*; import java.util.*; | [
"de.enflexit.common",
"java.util"
] | de.enflexit.common; java.util; | 876,816 |
// --------------------------------------------------------------------------------------------
// Other helper functions
// --------------------------------------------------------------------------------------------
public Network copy() throws Exception {
Network network_new = new Network();
// Copy servers
// We cannot use some addServer( s_old.copy() ) because servers can only be created via a network.
// They need an network determined id. (Hard design decision at the moment)
Map<Server,Server> map__s_old__s_new = new HashMap<Server,Server>();
Server s_new;
for ( Server s_old : servers ) {
s_new = network_new.addServer( s_old.getAlias(),
s_old.getServiceCurve().copy(),
s_old.getMaxServiceCurve().copy(),
s_old.multiplexingDiscipline(),
s_old.useGamma(),
s_old.useExtraGamma() );
map__s_old__s_new.put( s_old, s_new );
}
// Copy links
// We cannot use some addLink( l_old.copy() ) because links can only be created via a network.
// They need an network determined id. (Hard design decision at the moment)
Map<Link,Link> map__l_old__l_new = new HashMap<Link,Link>();
Link l_new;
for ( Link l_old : links ) {
l_new = network_new.addLink( l_old.getAlias(),
map__s_old__s_new.get( l_old.getSource() ),
map__s_old__s_new.get( l_old.getDest() ) );
map__l_old__l_new.put( l_old, l_new );
}
// Copy flows
// We cannot use some addFlow( f_old.copy() ) because flows can only be created via a network.
// They need an network determined id. (Hard design decision at the moment)
Path f_old_path;
Path f_new_path;
List<Server> f_path_old_s;
List<Server> f_path_new_s;
List<Link> f_path_old_l;
List<Link> f_path_new_l;
for ( Flow f_old : flows ) {
f_old_path = f_old.getPath();
f_path_old_s = f_old_path.getServers();
f_path_new_s = new LinkedList<Server>();
for ( Server s : f_path_old_s ){
f_path_new_s.add( map__s_old__s_new.get( s ) );
}
f_path_old_l = f_old_path.getLinks();
f_path_new_l = new LinkedList<Link>();
for ( Link l : f_path_old_l ){
f_path_new_l.add( map__l_old__l_new.get( l ) );
}
f_new_path = new Path( f_path_new_s, f_path_new_l );
network_new.addFlowToNetwork( f_old.getAlias(),
f_old.getArrivalCurve().copy(),
f_new_path );
}
return network_new;
}
| Network function() throws Exception { Network network_new = new Network(); Map<Server,Server> map__s_old__s_new = new HashMap<Server,Server>(); Server s_new; for ( Server s_old : servers ) { s_new = network_new.addServer( s_old.getAlias(), s_old.getServiceCurve().copy(), s_old.getMaxServiceCurve().copy(), s_old.multiplexingDiscipline(), s_old.useGamma(), s_old.useExtraGamma() ); map__s_old__s_new.put( s_old, s_new ); } Map<Link,Link> map__l_old__l_new = new HashMap<Link,Link>(); Link l_new; for ( Link l_old : links ) { l_new = network_new.addLink( l_old.getAlias(), map__s_old__s_new.get( l_old.getSource() ), map__s_old__s_new.get( l_old.getDest() ) ); map__l_old__l_new.put( l_old, l_new ); } Path f_old_path; Path f_new_path; List<Server> f_path_old_s; List<Server> f_path_new_s; List<Link> f_path_old_l; List<Link> f_path_new_l; for ( Flow f_old : flows ) { f_old_path = f_old.getPath(); f_path_old_s = f_old_path.getServers(); f_path_new_s = new LinkedList<Server>(); for ( Server s : f_path_old_s ){ f_path_new_s.add( map__s_old__s_new.get( s ) ); } f_path_old_l = f_old_path.getLinks(); f_path_new_l = new LinkedList<Link>(); for ( Link l : f_path_old_l ){ f_path_new_l.add( map__l_old__l_new.get( l ) ); } f_new_path = new Path( f_path_new_s, f_path_new_l ); network_new.addFlowToNetwork( f_old.getAlias(), f_old.getArrivalCurve().copy(), f_new_path ); } return network_new; } | /**
*
* Creates a deep copy of this network.
*
* @return The copy.
* @throws Exception Signals problems while instantiating the copy.
*/ | Creates a deep copy of this network | copy | {
"repo_name": "mehdi149/OF_COMPILER_0.1",
"path": "src/unikl/disco/network/Network.java",
"license": "apache-2.0",
"size": 50357
} | [
"java.util.HashMap",
"java.util.LinkedList",
"java.util.List",
"java.util.Map"
] | import java.util.HashMap; import java.util.LinkedList; import java.util.List; import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 2,526,556 |
@Adjacency(label = INTERFACES, direction = Direction.OUT)
Iterable<JavaClassModel> getInterfaces(); | @Adjacency(label = INTERFACES, direction = Direction.OUT) Iterable<JavaClassModel> getInterfaces(); | /**
* Lists interfaces implemented by this class, or extended if this is an interface.
*/ | Lists interfaces implemented by this class, or extended if this is an interface | getInterfaces | {
"repo_name": "OndraZizka/windup",
"path": "rules-java/api/src/main/java/org/jboss/windup/rules/apps/java/model/JavaClassModel.java",
"license": "epl-1.0",
"size": 8509
} | [
"com.tinkerpop.blueprints.Direction",
"com.tinkerpop.frames.Adjacency"
] | import com.tinkerpop.blueprints.Direction; import com.tinkerpop.frames.Adjacency; | import com.tinkerpop.blueprints.*; import com.tinkerpop.frames.*; | [
"com.tinkerpop.blueprints",
"com.tinkerpop.frames"
] | com.tinkerpop.blueprints; com.tinkerpop.frames; | 807,064 |
public void analyze(final List<Component> components) {
final boolean fuzzyEnabled = super.isEnabled(ConfigPropertyConstants.SCANNER_INTERNAL_FUZZY_ENABLED);
final boolean excludeComponentsWithPurl = super.isEnabled(ConfigPropertyConstants.SCANNER_INTERNAL_FUZZY_EXCLUDE_PURL);
try (QueryManager qm = new QueryManager()) {
for (Component component : components) {
versionRangeAnalysis(qm, component);
if (fuzzyEnabled) {
if (component.getPurl() == null || !excludeComponentsWithPurl) {
fuzzyCpeAnalysis(qm, component);
}
}
}
}
} | void function(final List<Component> components) { final boolean fuzzyEnabled = super.isEnabled(ConfigPropertyConstants.SCANNER_INTERNAL_FUZZY_ENABLED); final boolean excludeComponentsWithPurl = super.isEnabled(ConfigPropertyConstants.SCANNER_INTERNAL_FUZZY_EXCLUDE_PURL); try (QueryManager qm = new QueryManager()) { for (Component component : components) { versionRangeAnalysis(qm, component); if (fuzzyEnabled) { if (component.getPurl() == null !excludeComponentsWithPurl) { fuzzyCpeAnalysis(qm, component); } } } } } | /**
* Analyzes a list of Components.
* @param components a list of Components
*/ | Analyzes a list of Components | analyze | {
"repo_name": "stevespringett/dependency-track",
"path": "src/main/java/org/dependencytrack/tasks/scanners/InternalAnalysisTask.java",
"license": "apache-2.0",
"size": 4303
} | [
"java.util.List",
"org.dependencytrack.model.Component",
"org.dependencytrack.model.ConfigPropertyConstants",
"org.dependencytrack.persistence.QueryManager"
] | import java.util.List; import org.dependencytrack.model.Component; import org.dependencytrack.model.ConfigPropertyConstants; import org.dependencytrack.persistence.QueryManager; | import java.util.*; import org.dependencytrack.model.*; import org.dependencytrack.persistence.*; | [
"java.util",
"org.dependencytrack.model",
"org.dependencytrack.persistence"
] | java.util; org.dependencytrack.model; org.dependencytrack.persistence; | 1,890,297 |
private ArrayList<Integer> getInactiveContainerIndexes() {
ArrayList<Integer> indexes = getContainerIndexesWithState(State.STOPPED.toString());
indexes.addAll(getContainerIndexesWithState(State.UNKNOWN.toString()));
return indexes;
} | ArrayList<Integer> function() { ArrayList<Integer> indexes = getContainerIndexesWithState(State.STOPPED.toString()); indexes.addAll(getContainerIndexesWithState(State.UNKNOWN.toString())); return indexes; } | /**
* Get the indexes of all inactive containers
*/ | Get the indexes of all inactive containers | getInactiveContainerIndexes | {
"repo_name": "smanvi-pivotal/geode",
"path": "geode-assembly/src/test/java/org/apache/geode/session/tests/ContainerManager.java",
"license": "apache-2.0",
"size": 7554
} | [
"java.util.ArrayList",
"org.codehaus.cargo.container.State"
] | import java.util.ArrayList; import org.codehaus.cargo.container.State; | import java.util.*; import org.codehaus.cargo.container.*; | [
"java.util",
"org.codehaus.cargo"
] | java.util; org.codehaus.cargo; | 1,972,601 |
public PublicIPPrefixInner updateTags(String resourceGroupName, String publicIpPrefixName, Map<String, String> tags) {
return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().single().body();
} | PublicIPPrefixInner function(String resourceGroupName, String publicIpPrefixName, Map<String, String> tags) { return updateTagsWithServiceResponseAsync(resourceGroupName, publicIpPrefixName, tags).toBlocking().single().body(); } | /**
* Updates public IP prefix tags.
*
* @param resourceGroupName The name of the resource group.
* @param publicIpPrefixName The name of the public IP prefix.
* @param tags Resource tags.
* @throws IllegalArgumentException thrown if parameters fail the validation
* @throws CloudException thrown if the request is rejected by server
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @return the PublicIPPrefixInner object if successful.
*/ | Updates public IP prefix tags | updateTags | {
"repo_name": "selvasingh/azure-sdk-for-java",
"path": "sdk/network/mgmt-v2020_03_01/src/main/java/com/microsoft/azure/management/network/v2020_03_01/implementation/PublicIPPrefixesInner.java",
"license": "mit",
"size": 69595
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,769,000 |
public Iterable<SSTableReader> init(Set<SSTableReader> sstables)
{
return tracker.update(Collections.emptySet(), sstables);
} | Iterable<SSTableReader> function(Set<SSTableReader> sstables) { return tracker.update(Collections.emptySet(), sstables); } | /**
* Initialize this column index with specific set of SSTables.
*
* @param sstables The sstables to be used by index initially.
*
* @return A collection of sstables which don't have this specific index attached to them.
*/ | Initialize this column index with specific set of SSTables | init | {
"repo_name": "belliottsmith/cassandra",
"path": "src/java/org/apache/cassandra/index/sasi/conf/ColumnIndex.java",
"license": "apache-2.0",
"size": 8480
} | [
"java.util.Collections",
"java.util.Set",
"org.apache.cassandra.io.sstable.format.SSTableReader"
] | import java.util.Collections; import java.util.Set; import org.apache.cassandra.io.sstable.format.SSTableReader; | import java.util.*; import org.apache.cassandra.io.sstable.format.*; | [
"java.util",
"org.apache.cassandra"
] | java.util; org.apache.cassandra; | 1,319,586 |
public void testSetPathToJSP() {
MockContainer container = new MockContainer("web");
container.start();
container.getRequest().setMethod("GET");
container.testPage(SetPathToJspPage.class);
assertEquals(SetPathToJspPage.PATH, container.getForward());
container.stop();
} | void function() { MockContainer container = new MockContainer("web"); container.start(); container.getRequest().setMethod("GET"); container.testPage(SetPathToJspPage.class); assertEquals(SetPathToJspPage.PATH, container.getForward()); container.stop(); } | /**
* Test that Page.setPath(path), where path is a JSP, works properly. Click
* should set the request to forward to the JSP page.
* CLK-141
*/ | Test that Page.setPath(path), where path is a JSP, works properly. Click should set the request to forward to the JSP page. CLK-141 | testSetPathToJSP | {
"repo_name": "medgar/click",
"path": "framework/test/org/apache/click/PageTest.java",
"license": "apache-2.0",
"size": 9366
} | [
"org.apache.click.pages.SetPathToJspPage"
] | import org.apache.click.pages.SetPathToJspPage; | import org.apache.click.pages.*; | [
"org.apache.click"
] | org.apache.click; | 1,692,715 |
protected List<Long> retrieveAssetNumberForLocking(Asset asset) {
List<Long> capitalAssetNumbers = new ArrayList<Long>();
if (asset.getCapitalAssetNumber() != null) {
capitalAssetNumbers.add(asset.getCapitalAssetNumber());
}
return capitalAssetNumbers;
} | List<Long> function(Asset asset) { List<Long> capitalAssetNumbers = new ArrayList<Long>(); if (asset.getCapitalAssetNumber() != null) { capitalAssetNumbers.add(asset.getCapitalAssetNumber()); } return capitalAssetNumbers; } | /**
* Retrieve asset numbers need to be locked.
*
* @return
*/ | Retrieve asset numbers need to be locked | retrieveAssetNumberForLocking | {
"repo_name": "quikkian-ua-devops/will-financials",
"path": "kfs-cam/src/main/java/org/kuali/kfs/module/cam/document/validation/impl/AssetRule.java",
"license": "agpl-3.0",
"size": 35887
} | [
"java.util.ArrayList",
"java.util.List",
"org.kuali.kfs.module.cam.businessobject.Asset"
] | import java.util.ArrayList; import java.util.List; import org.kuali.kfs.module.cam.businessobject.Asset; | import java.util.*; import org.kuali.kfs.module.cam.businessobject.*; | [
"java.util",
"org.kuali.kfs"
] | java.util; org.kuali.kfs; | 773,954 |
@ServiceMethod(returns = ReturnType.COLLECTION)
private PagedFlux<WcfRelayInner> listByNamespaceAsync(
String resourceGroupName, String namespaceName, Context context) {
return new PagedFlux<>(
() -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context),
nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context));
} | @ServiceMethod(returns = ReturnType.COLLECTION) PagedFlux<WcfRelayInner> function( String resourceGroupName, String namespaceName, Context context) { return new PagedFlux<>( () -> listByNamespaceSinglePageAsync(resourceGroupName, namespaceName, context), nextLink -> listByNamespaceNextSinglePageAsync(nextLink, context)); } | /**
* Lists the WCF relays within the namespace.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param namespaceName The namespace name.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the response of the list WCF relay operation.
*/ | Lists the WCF relays within the namespace | listByNamespaceAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/relay/azure-resourcemanager-relay/src/main/java/com/azure/resourcemanager/relay/implementation/WcfRelaysClientImpl.java",
"license": "mit",
"size": 109024
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedFlux",
"com.azure.core.util.Context",
"com.azure.resourcemanager.relay.fluent.models.WcfRelayInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedFlux; import com.azure.core.util.Context; import com.azure.resourcemanager.relay.fluent.models.WcfRelayInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.relay.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 1,875,649 |
public StoredSortedMap getShipmentMap() {
return shipmentMap;
} | StoredSortedMap function() { return shipmentMap; } | /**
* Return a map view of the shipment storage container.
*/ | Return a map view of the shipment storage container | getShipmentMap | {
"repo_name": "bjorndm/prebake",
"path": "code/third_party/bdb/examples/collections/ship/factory/SampleViews.java",
"license": "apache-2.0",
"size": 4222
} | [
"com.sleepycat.collections.StoredSortedMap"
] | import com.sleepycat.collections.StoredSortedMap; | import com.sleepycat.collections.*; | [
"com.sleepycat.collections"
] | com.sleepycat.collections; | 1,659,769 |
public NoPutResultSet getRaDependentTableScanResultSet(
Activation activation,
long conglomId,
int scociItem,
GeneratedMethod resultRowAllocator,
int resultSetNumber,
GeneratedMethod startKeyGetter,
int startSearchOperator,
GeneratedMethod stopKeyGetter,
int stopSearchOperator,
boolean sameStartStopPosition,
Qualifier[][] qualifiers,
String tableName,
String userSuppliedOptimizerOverrides,
String indexName,
boolean isConstraint,
boolean forUpdate,
int colRefItem,
int indexColItem,
int lockMode,
boolean tableLocked,
int isolationLevel,
boolean oneRowScan,
double optimizerEstimatedRowCount,
double optimizerEstimatedCost,
String parentResultSetId,
long fkIndexConglomId,
int fkColArrayItem,
int rltItem)
throws StandardException
{
StaticCompiledOpenConglomInfo scoci = (StaticCompiledOpenConglomInfo)(activation.getPreparedStatement().
getSavedObject(scociItem));
return new DependentResultSet(
conglomId,
scoci,
activation,
resultRowAllocator,
resultSetNumber,
startKeyGetter,
startSearchOperator,
stopKeyGetter,
stopSearchOperator,
sameStartStopPosition,
qualifiers,
tableName,
userSuppliedOptimizerOverrides,
indexName,
isConstraint,
forUpdate,
colRefItem,
lockMode,
tableLocked,
isolationLevel,
1,
oneRowScan,
optimizerEstimatedRowCount,
optimizerEstimatedCost,
parentResultSetId,
fkIndexConglomId,
fkColArrayItem,
rltItem);
}
| NoPutResultSet function( Activation activation, long conglomId, int scociItem, GeneratedMethod resultRowAllocator, int resultSetNumber, GeneratedMethod startKeyGetter, int startSearchOperator, GeneratedMethod stopKeyGetter, int stopSearchOperator, boolean sameStartStopPosition, Qualifier[][] qualifiers, String tableName, String userSuppliedOptimizerOverrides, String indexName, boolean isConstraint, boolean forUpdate, int colRefItem, int indexColItem, int lockMode, boolean tableLocked, int isolationLevel, boolean oneRowScan, double optimizerEstimatedRowCount, double optimizerEstimatedCost, String parentResultSetId, long fkIndexConglomId, int fkColArrayItem, int rltItem) throws StandardException { StaticCompiledOpenConglomInfo scoci = (StaticCompiledOpenConglomInfo)(activation.getPreparedStatement(). getSavedObject(scociItem)); return new DependentResultSet( conglomId, scoci, activation, resultRowAllocator, resultSetNumber, startKeyGetter, startSearchOperator, stopKeyGetter, stopSearchOperator, sameStartStopPosition, qualifiers, tableName, userSuppliedOptimizerOverrides, indexName, isConstraint, forUpdate, colRefItem, lockMode, tableLocked, isolationLevel, 1, oneRowScan, optimizerEstimatedRowCount, optimizerEstimatedCost, parentResultSetId, fkIndexConglomId, fkColArrayItem, rltItem); } | /**
* a referential action dependent table scan generator.
* @see ResultSetFactory#getTableScanResultSet
* @exception StandardException thrown on error
*/ | a referential action dependent table scan generator | getRaDependentTableScanResultSet | {
"repo_name": "lpxz/grail-derby104",
"path": "java/engine/org/apache/derby/impl/sql/execute/GenericResultSetFactory.java",
"license": "apache-2.0",
"size": 40961
} | [
"org.apache.derby.iapi.error.StandardException",
"org.apache.derby.iapi.services.loader.GeneratedMethod",
"org.apache.derby.iapi.sql.Activation",
"org.apache.derby.iapi.sql.execute.NoPutResultSet",
"org.apache.derby.iapi.store.access.Qualifier",
"org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo"
] | import org.apache.derby.iapi.error.StandardException; import org.apache.derby.iapi.services.loader.GeneratedMethod; import org.apache.derby.iapi.sql.Activation; import org.apache.derby.iapi.sql.execute.NoPutResultSet; import org.apache.derby.iapi.store.access.Qualifier; import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo; | import org.apache.derby.iapi.error.*; import org.apache.derby.iapi.services.loader.*; import org.apache.derby.iapi.sql.*; import org.apache.derby.iapi.sql.execute.*; import org.apache.derby.iapi.store.access.*; | [
"org.apache.derby"
] | org.apache.derby; | 2,008,898 |
public void setUpCrewJob() {
String n[] = new String[SIZE_OF_CREW];
for (int i = 0; i < SIZE_OF_CREW; i++) {
n[i] = personConfig.getConfiguredPersonJob(i, ALPHA_CREW);
JFXComboBox<String> g = setUpCB(JOB_ROW, i); // 3 = Job
// g.setMaximumRowCount(8);
gridPane.add(g, i + 1, JOB_ROW); // job's row = 3
g.setValue(n[i]);
jobList.add(i, g);
}
}
/**
* Sets up the sponsor combobox
*
* @param index
* @return {@link JFXComboBox} | void function() { String n[] = new String[SIZE_OF_CREW]; for (int i = 0; i < SIZE_OF_CREW; i++) { n[i] = personConfig.getConfiguredPersonJob(i, ALPHA_CREW); JFXComboBox<String> g = setUpCB(JOB_ROW, i); gridPane.add(g, i + 1, JOB_ROW); g.setValue(n[i]); jobList.add(i, g); } } /** * Sets up the sponsor combobox * * @param index * @return {@link JFXComboBox} | /**
* Set up the crew job choice
*/ | Set up the crew job choice | setUpCrewJob | {
"repo_name": "mars-sim/mars-sim",
"path": "mars-sim-javafx/src/main/java/org/mars_sim/msp/ui/javafx/config/CrewEditorFX.java",
"license": "gpl-3.0",
"size": 32258
} | [
"com.jfoenix.controls.JFXComboBox"
] | import com.jfoenix.controls.JFXComboBox; | import com.jfoenix.controls.*; | [
"com.jfoenix.controls"
] | com.jfoenix.controls; | 1,851,148 |
protected static String getFirstName(String name) {
String first = new String(name);
StringTokenizer tokenizer = new StringTokenizer(first, "_");
if (tokenizer.hasMoreTokens()) {
first = tokenizer.nextToken();
}
return first;
} | static String function(String name) { String first = new String(name); StringTokenizer tokenizer = new StringTokenizer(first, "_"); if (tokenizer.hasMoreTokens()) { first = tokenizer.nextToken(); } return first; } | /**
* Gets the first name.
*
* @param name the name
* @return the first name
*/ | Gets the first name | getFirstName | {
"repo_name": "Adirockzz95/GenderDetect",
"path": "src/src/fr/lium/experimental/spkDiarization/programs/SpeakerIdenificationDecision9.java",
"license": "gpl-3.0",
"size": 41469
} | [
"java.util.StringTokenizer"
] | import java.util.StringTokenizer; | import java.util.*; | [
"java.util"
] | java.util; | 1,756,266 |
private void registerCheck(int aTokenID, Check aCheck) {
registerCheck(TokenTypes.getTokenName(aTokenID), aCheck);
} | void function(int aTokenID, Check aCheck) { registerCheck(TokenTypes.getTokenName(aTokenID), aCheck); } | /**
* Register a check for a specified token id.
*
* @param aTokenID the id of the token
* @param aCheck the check to register
*/ | Register a check for a specified token id | registerCheck | {
"repo_name": "olivermay/geomajas",
"path": "build-tools/geomajas-checkstyle/src/main/java/org/geomajas/checkstyle/TreeWalker.java",
"license": "agpl-3.0",
"size": 13028
} | [
"com.puppycrawl.tools.checkstyle.api.Check",
"com.puppycrawl.tools.checkstyle.api.TokenTypes"
] | import com.puppycrawl.tools.checkstyle.api.Check; import com.puppycrawl.tools.checkstyle.api.TokenTypes; | import com.puppycrawl.tools.checkstyle.api.*; | [
"com.puppycrawl.tools"
] | com.puppycrawl.tools; | 1,863,643 |
protected Catalogue getAdjustedCatalogue( Catalogue catalogue )
{
// The default implementation is to do nothing
return ( catalogue );
} | Catalogue function( Catalogue catalogue ) { return ( catalogue ); } | /*****************************************************
*
* Should be overridden if an app wants to adjust the
* catalogue in some way, such as to remove shipping
* to certain locations.
*
*****************************************************/ | Should be overridden if an app wants to adjust the catalogue in some way, such as to remove shipping to certain locations | getAdjustedCatalogue | {
"repo_name": "bearprada/Android-Print-SDK",
"path": "KitePrintSDK/src/main/java/ly/kite/journey/selection/ProductSelectionActivity.java",
"license": "mit",
"size": 16298
} | [
"ly.kite.catalogue.Catalogue"
] | import ly.kite.catalogue.Catalogue; | import ly.kite.catalogue.*; | [
"ly.kite.catalogue"
] | ly.kite.catalogue; | 2,454,574 |
public EdmFunctionImport getFunctionImport(); | EdmFunctionImport function(); | /**
* Gets the function import.
* @return {@link EdmFunctionImport} the function import
*/ | Gets the function import | getFunctionImport | {
"repo_name": "SAP/cloud-odata-java",
"path": "odata-api/src/main/java/com/sap/core/odata/api/uri/info/GetEntitySetUriInfo.java",
"license": "apache-2.0",
"size": 5354
} | [
"com.sap.core.odata.api.edm.EdmFunctionImport"
] | import com.sap.core.odata.api.edm.EdmFunctionImport; | import com.sap.core.odata.api.edm.*; | [
"com.sap.core"
] | com.sap.core; | 547,343 |
protected Font getFont(TextHolder figure) {
return figure.getFont();
} | Font function(TextHolder figure) { return figure.getFont(); } | /**
* Gets the font to be used for editing the figure
*
* @param figure the figure
* @return The font
*/ | Gets the font to be used for editing the figure | getFont | {
"repo_name": "samskivert/jhotdraw6",
"path": "src/main/java/org/jhotdraw/contrib/TextAreaTool.java",
"license": "lgpl-2.1",
"size": 11530
} | [
"java.awt.Font",
"org.jhotdraw.standard.TextHolder"
] | import java.awt.Font; import org.jhotdraw.standard.TextHolder; | import java.awt.*; import org.jhotdraw.standard.*; | [
"java.awt",
"org.jhotdraw.standard"
] | java.awt; org.jhotdraw.standard; | 1,883,066 |
public Queue<Object> inboundMessages() {
return inboundMessages;
}
/**
* @deprecated use {@link #inboundMessages()} | Queue<Object> function() { return inboundMessages; } /** * @deprecated use {@link #inboundMessages()} | /**
* Returns the {@link Queue} which holds all the {@link Object}s that were received by this {@link Channel}.
*/ | Returns the <code>Queue</code> which holds all the <code>Object</code>s that were received by this <code>Channel</code> | inboundMessages | {
"repo_name": "firebase/netty",
"path": "transport/src/main/java/io/netty/channel/embedded/EmbeddedChannel.java",
"license": "apache-2.0",
"size": 11056
} | [
"java.util.Queue"
] | import java.util.Queue; | import java.util.*; | [
"java.util"
] | java.util; | 2,320,184 |
public void cleanup() {
lock.lock();
try {
boolean dirty = false;
for (Iterator<Transaction> i = pending.values().iterator(); i.hasNext();) {
Transaction tx = i.next();
if (isTransactionRisky(tx, null) && !acceptRiskyTransactions) {
log.debug("Found risky transaction {} in wallet during cleanup.", tx.getTxId());
if (!tx.isAnyOutputSpent()) {
// Sync myUnspents with the change.
for (TransactionInput input : tx.getInputs()) {
TransactionOutput output = input.getConnectedOutput();
if (output == null) continue;
if (output.isMineOrWatched(this))
checkState(myUnspents.add(output));
input.disconnect();
}
for (TransactionOutput output : tx.getOutputs())
myUnspents.remove(output);
i.remove();
transactions.remove(tx.getTxId());
dirty = true;
log.info("Removed transaction {} from pending pool during cleanup.", tx.getTxId());
} else {
log.info(
"Cannot remove transaction {} from pending pool during cleanup, as it's already spent partially.",
tx.getTxId());
}
}
}
if (dirty) {
isConsistentOrThrow();
saveLater();
if (log.isInfoEnabled())
log.info("Estimated balance is now: {}", getBalance(BalanceType.ESTIMATED).toFriendlyString());
}
} finally {
lock.unlock();
}
} | void function() { lock.lock(); try { boolean dirty = false; for (Iterator<Transaction> i = pending.values().iterator(); i.hasNext();) { Transaction tx = i.next(); if (isTransactionRisky(tx, null) && !acceptRiskyTransactions) { log.debug(STR, tx.getTxId()); if (!tx.isAnyOutputSpent()) { for (TransactionInput input : tx.getInputs()) { TransactionOutput output = input.getConnectedOutput(); if (output == null) continue; if (output.isMineOrWatched(this)) checkState(myUnspents.add(output)); input.disconnect(); } for (TransactionOutput output : tx.getOutputs()) myUnspents.remove(output); i.remove(); transactions.remove(tx.getTxId()); dirty = true; log.info(STR, tx.getTxId()); } else { log.info( STR, tx.getTxId()); } } } if (dirty) { isConsistentOrThrow(); saveLater(); if (log.isInfoEnabled()) log.info(STR, getBalance(BalanceType.ESTIMATED).toFriendlyString()); } } finally { lock.unlock(); } } | /**
* Clean up the wallet. Currently, it only removes risky pending transaction from the wallet and only if their
* outputs have not been spent.
*/ | Clean up the wallet. Currently, it only removes risky pending transaction from the wallet and only if their outputs have not been spent | cleanup | {
"repo_name": "bitcoinj/bitcoinj",
"path": "core/src/main/java/org/bitcoinj/wallet/Wallet.java",
"license": "apache-2.0",
"size": 267304
} | [
"com.google.common.base.Preconditions",
"java.util.Iterator",
"org.bitcoinj.core.Transaction",
"org.bitcoinj.core.TransactionInput",
"org.bitcoinj.core.TransactionOutput"
] | import com.google.common.base.Preconditions; import java.util.Iterator; import org.bitcoinj.core.Transaction; import org.bitcoinj.core.TransactionInput; import org.bitcoinj.core.TransactionOutput; | import com.google.common.base.*; import java.util.*; import org.bitcoinj.core.*; | [
"com.google.common",
"java.util",
"org.bitcoinj.core"
] | com.google.common; java.util; org.bitcoinj.core; | 2,791,185 |
// this is not the official way of using DS but the official way is instable
try {
VarModel.INSTANCE.loaders().registerLoader(ModelUtility.INSTANCE, ProgressObserver.NO_OBSERVER);
} catch (ModelManagementException e) {
EASyLoggerFactory.INSTANCE.getLogger(IvmlParser.class, IvmlBundleId.ID).exception(e);
}
ModelInitializer.register(this);
} | try { VarModel.INSTANCE.loaders().registerLoader(ModelUtility.INSTANCE, ProgressObserver.NO_OBSERVER); } catch (ModelManagementException e) { EASyLoggerFactory.INSTANCE.getLogger(IvmlParser.class, IvmlBundleId.ID).exception(e); } ModelInitializer.register(this); } | /**
* Private method to activate plugin.
* @param context Context.
*/ | Private method to activate plugin | activate | {
"repo_name": "SSEHUB/EASyProducer",
"path": "Plugins/IVML/de.uni_hildesheim.sse.ivml/src/de/uni_hildesheim/sse/IvmlParser.java",
"license": "apache-2.0",
"size": 2017
} | [
"net.ssehub.easy.basics.logger.EASyLoggerFactory",
"net.ssehub.easy.basics.modelManagement.ModelInitializer",
"net.ssehub.easy.basics.modelManagement.ModelManagementException",
"net.ssehub.easy.basics.progress.ProgressObserver",
"net.ssehub.easy.varModel.management.VarModel"
] | import net.ssehub.easy.basics.logger.EASyLoggerFactory; import net.ssehub.easy.basics.modelManagement.ModelInitializer; import net.ssehub.easy.basics.modelManagement.ModelManagementException; import net.ssehub.easy.basics.progress.ProgressObserver; import net.ssehub.easy.varModel.management.VarModel; | import net.ssehub.easy.*; import net.ssehub.easy.basics.*; import net.ssehub.easy.basics.logger.*; import net.ssehub.easy.basics.progress.*; | [
"net.ssehub.easy"
] | net.ssehub.easy; | 998,467 |
public HashSet getBatchClusterFromTextArea(String textNodes) {
String[] nodes = textNodes.split("\\s+");
// HashSet for storing the canonical names
HashSet canonicalNameVector = new HashSet();
HashSet<HashSet<String>> mapNames = new HashSet<HashSet<String>>();
// iterate over every node view to get the canonical names.
// first term is cluster name...
int j = 0;
while (nodes[j].equals("")) {
j++;
}
params.setCluster_name(nodes[j]);
for (int i = j + 1; i < nodes.length; i++) {
if (nodes[i] != null && nodes[i].length() != 0 && !canonicalNameVector.contains(nodes[i].toUpperCase())) {
if (mapNames.contains(params.getAlias().get(nodes[i].toUpperCase()))) {
redundantIDs.put(nodes[i].toUpperCase(),
(HashSet<String>) params.getAlias().get(nodes[i].toUpperCase()));
} else {
if (params.getAlias().get(nodes[i].toUpperCase()) != null) {
mapNames.add((HashSet<String>) params.getAlias().get(nodes[i].toUpperCase()));
}
canonicalNameVector.add(nodes[i].toUpperCase());
}
}
}
return canonicalNameVector;
}
| HashSet function(String textNodes) { String[] nodes = textNodes.split("\\s+"); HashSet canonicalNameVector = new HashSet(); HashSet<HashSet<String>> mapNames = new HashSet<HashSet<String>>(); int j = 0; while (nodes[j].equals("")) { j++; } params.setCluster_name(nodes[j]); for (int i = j + 1; i < nodes.length; i++) { if (nodes[i] != null && nodes[i].length() != 0 && !canonicalNameVector.contains(nodes[i].toUpperCase())) { if (mapNames.contains(params.getAlias().get(nodes[i].toUpperCase()))) { redundantIDs.put(nodes[i].toUpperCase(), (HashSet<String>) params.getAlias().get(nodes[i].toUpperCase())); } else { if (params.getAlias().get(nodes[i].toUpperCase()) != null) { mapNames.add((HashSet<String>) params.getAlias().get(nodes[i].toUpperCase())); } canonicalNameVector.add(nodes[i].toUpperCase()); } } } return canonicalNameVector; } | /**
* method that gets the canonical names from text input in batch mode.
*
* @return vector containing the canonical names of batch instance.
*/ | method that gets the canonical names from text input in batch mode | getBatchClusterFromTextArea | {
"repo_name": "stmae/bingo",
"path": "src/main/java/bingo/internal/SettingsPanelActionListener.java",
"license": "gpl-2.0",
"size": 45892
} | [
"java.util.HashSet"
] | import java.util.HashSet; | import java.util.*; | [
"java.util"
] | java.util; | 2,683,869 |
public void setLikedMessage(MessageDto message) {
this.likedMessage = message;
} | void function(MessageDto message) { this.likedMessage = message; } | /**
* Sets the liked message.
*
* @param message The liked message.
*/ | Sets the liked message | setLikedMessage | {
"repo_name": "chr-krenn/chr-krenn-fhj-ws2016-sd14-pse",
"path": "backend/backend-interface/src/main/java/at/fhj/swd14/pse/like/MessageLikeDto.java",
"license": "mit",
"size": 1621
} | [
"at.fhj.swd14.pse.message.MessageDto"
] | import at.fhj.swd14.pse.message.MessageDto; | import at.fhj.swd14.pse.message.*; | [
"at.fhj.swd14"
] | at.fhj.swd14; | 1,069,851 |
public AttributeWeights getWeights(ExampleSet eSet) throws OperatorException;
| AttributeWeights function(ExampleSet eSet) throws OperatorException; | /**
* Most learners should throw an exception if they are not able to calculate
* attribute weights. However, if a learning scheme is able to calculate
* weights (e.g. the normal vector of a SVM) it should return an
* AttributeWeights object.
*/ | Most learners should throw an exception if they are not able to calculate attribute weights. However, if a learning scheme is able to calculate weights (e.g. the normal vector of a SVM) it should return an AttributeWeights object | getWeights | {
"repo_name": "ntj/ComplexRapidMiner",
"path": "src/com/rapidminer/operator/learner/Learner.java",
"license": "gpl-2.0",
"size": 3473
} | [
"com.rapidminer.example.AttributeWeights",
"com.rapidminer.example.ExampleSet",
"com.rapidminer.operator.OperatorException"
] | import com.rapidminer.example.AttributeWeights; import com.rapidminer.example.ExampleSet; import com.rapidminer.operator.OperatorException; | import com.rapidminer.example.*; import com.rapidminer.operator.*; | [
"com.rapidminer.example",
"com.rapidminer.operator"
] | com.rapidminer.example; com.rapidminer.operator; | 2,905,962 |
@Test
public void testCharset() throws Exception {
// Setup Tomcat instance
Tomcat tomcat = getTomcatInstance();
// Must have a real docBase - just use temp
File docBase = new File(System.getProperty("java.io.tmpdir"));
Context ctx = tomcat.addContext("", docBase.getAbsolutePath());
Tomcat.addServlet(ctx, "servlet", new CharsetServlet());
ctx.addServletMapping("/", "servlet");
tomcat.start();
ByteChunk bc = getUrl("http://localhost:" + getPort() + "/");
assertEquals("OK", bc.toString());
}
private static final class CharsetServlet extends HttpServlet {
private static final long serialVersionUID = 1L; | void function() throws Exception { Tomcat tomcat = getTomcatInstance(); File docBase = new File(System.getProperty(STR)); Context ctx = tomcat.addContext(STRservletSTR/STRservletSTRhttp: assertEquals("OK", bc.toString()); } private static final class CharsetServlet extends HttpServlet { private static final long serialVersionUID = 1L; | /**
* Tests an issue noticed during the investigation of BZ 52811.
*/ | Tests an issue noticed during the investigation of BZ 52811 | testCharset | {
"repo_name": "plumer/codana",
"path": "tomcat_files/7.0.61/TestResponse.java",
"license": "mit",
"size": 12224
} | [
"java.io.File",
"javax.servlet.http.HttpServlet",
"org.apache.catalina.Context",
"org.apache.catalina.startup.Tomcat",
"org.junit.Assert"
] | import java.io.File; import javax.servlet.http.HttpServlet; import org.apache.catalina.Context; import org.apache.catalina.startup.Tomcat; import org.junit.Assert; | import java.io.*; import javax.servlet.http.*; import org.apache.catalina.*; import org.apache.catalina.startup.*; import org.junit.*; | [
"java.io",
"javax.servlet",
"org.apache.catalina",
"org.junit"
] | java.io; javax.servlet; org.apache.catalina; org.junit; | 1,494,344 |
public String getMessage( final Locale locale) {
if( !this.useResourceBundle)
return this.message;
if( this.messageBundleBase == null || this.messageKey == null)
return this.getFailsafeMessage();
try {
return ArgumentException.substitute( ResourceBundle.getBundle( this.messageBundleBase, locale).getString( this.messageKey),
this.getLocalizedParameters( locale));
} catch( final MissingResourceException exception) {
return this.getFailsafeMessage();
}
} | String function( final Locale locale) { if( !this.useResourceBundle) return this.message; if( this.messageBundleBase == null this.messageKey == null) return this.getFailsafeMessage(); try { return ArgumentException.substitute( ResourceBundle.getBundle( this.messageBundleBase, locale).getString( this.messageKey), this.getLocalizedParameters( locale)); } catch( final MissingResourceException exception) { return this.getFailsafeMessage(); } } | /**
* Get the error message in specified locale.
*
* @param locale
* @return
*/ | Get the error message in specified locale | getMessage | {
"repo_name": "markchinama/org.musiel.args",
"path": "src/org/musiel/args/ArgumentException.java",
"license": "apache-2.0",
"size": 6310
} | [
"java.util.Locale",
"java.util.MissingResourceException",
"java.util.ResourceBundle"
] | import java.util.Locale; import java.util.MissingResourceException; import java.util.ResourceBundle; | import java.util.*; | [
"java.util"
] | java.util; | 655,097 |
public Configuracao remove(long configuracaoId)
throws NoSuchConfiguracaoException, SystemException {
return remove(Long.valueOf(configuracaoId));
} | Configuracao function(long configuracaoId) throws NoSuchConfiguracaoException, SystemException { return remove(Long.valueOf(configuracaoId)); } | /**
* Removes the configuracao with the primary key from the database. Also notifies the appropriate model listeners.
*
* @param configuracaoId the primary key of the configuracao
* @return the configuracao that was removed
* @throws br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchConfiguracaoException if a configuracao with the primary key could not be found
* @throws SystemException if a system exception occurred
*/ | Removes the configuracao with the primary key from the database. Also notifies the appropriate model listeners | remove | {
"repo_name": "camaradosdeputadosoficial/edemocracia",
"path": "cd-guiadiscussao-portlet/src/main/java/br/gov/camara/edemocracia/portlets/guiadiscussao/service/persistence/ConfiguracaoPersistenceImpl.java",
"license": "lgpl-2.1",
"size": 34038
} | [
"br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchConfiguracaoException",
"br.gov.camara.edemocracia.portlets.guiadiscussao.model.Configuracao",
"com.liferay.portal.kernel.exception.SystemException"
] | import br.gov.camara.edemocracia.portlets.guiadiscussao.NoSuchConfiguracaoException; import br.gov.camara.edemocracia.portlets.guiadiscussao.model.Configuracao; import com.liferay.portal.kernel.exception.SystemException; | import br.gov.camara.edemocracia.portlets.guiadiscussao.*; import br.gov.camara.edemocracia.portlets.guiadiscussao.model.*; import com.liferay.portal.kernel.exception.*; | [
"br.gov.camara",
"com.liferay.portal"
] | br.gov.camara; com.liferay.portal; | 193,041 |
@Override
public @Nullable String getAuthor() {
return this.internalBlock.getAuthor();
} | @Nullable String function() { return this.internalBlock.getAuthor(); } | /**
* Returns the author of the structure.
*
* @return author.
*/ | Returns the author of the structure | getAuthor | {
"repo_name": "Shynixn/StructureBlockLib",
"path": "structureblocklib-bukkit-core/bukkit-nms-111R1/src/main/java/com/github/shynixn/structureblocklib/bukkit/v1_11_R1/CraftStructureBlock.java",
"license": "mit",
"size": 13085
} | [
"org.jetbrains.annotations.Nullable"
] | import org.jetbrains.annotations.Nullable; | import org.jetbrains.annotations.*; | [
"org.jetbrains.annotations"
] | org.jetbrains.annotations; | 363,953 |
private void removePendingStream(NettyClientStream stream) {
for (Iterator<PendingStream> iter = pendingStreams.iterator(); iter.hasNext();) {
PendingStream pending = iter.next();
if (pending.stream == stream) {
iter.remove();
return;
}
}
} | void function(NettyClientStream stream) { for (Iterator<PendingStream> iter = pendingStreams.iterator(); iter.hasNext();) { PendingStream pending = iter.next(); if (pending.stream == stream) { iter.remove(); return; } } } | /**
* Removes the given stream from the pending queue
*
* @param stream the stream to be removed.
*/ | Removes the given stream from the pending queue | removePendingStream | {
"repo_name": "dongc/grpc-java",
"path": "netty/src/main/java/io/grpc/transport/netty/NettyClientHandler.java",
"license": "bsd-3-clause",
"size": 15950
} | [
"java.util.Iterator"
] | import java.util.Iterator; | import java.util.*; | [
"java.util"
] | java.util; | 2,534,967 |
public static MozuUrl createDocumentTypeUrl(String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/content/documenttypes/?responseFields={responseFields}");
formatter.formatUrl("responseFields", responseFields);
return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ;
} | static MozuUrl function(String responseFields) { UrlFormatter formatter = new UrlFormatter(STR); formatter.formatUrl(STR, responseFields); return new MozuUrl(formatter.getResourceUrl(), MozuUrl.UrlLocation.TENANT_POD) ; } | /**
* Get Resource Url for CreateDocumentType
* @param responseFields Use this field to include those fields which are not included by default.
* @return String Resource Url
*/ | Get Resource Url for CreateDocumentType | createDocumentTypeUrl | {
"repo_name": "eileenzhuang1/mozu-java",
"path": "mozu-java-core/src/main/java/com/mozu/api/urls/content/DocumentTypeUrl.java",
"license": "mit",
"size": 3231
} | [
"com.mozu.api.MozuUrl",
"com.mozu.api.utils.UrlFormatter"
] | import com.mozu.api.MozuUrl; import com.mozu.api.utils.UrlFormatter; | import com.mozu.api.*; import com.mozu.api.utils.*; | [
"com.mozu.api"
] | com.mozu.api; | 520,099 |
@SimpleFunction
public void Stop() {
if (controller == null) {
Log.i(TAG, "Stop() called, but already stopped.");
return;
}
try {
Log.i(TAG, "Stop() called");
Log.i(TAG, "stopping");
controller.stop();
Log.i(TAG, "Firing AfterSoundRecorded with " + controller.file);
AfterSoundRecorded(controller.file);
} catch (Throwable t) {
form.dispatchErrorOccurredEvent(this, "Stop", ErrorMessages.ERROR_SOUND_RECORDER);
} finally {
controller = null;
StoppedRecording();
}
} | void function() { if (controller == null) { Log.i(TAG, STR); return; } try { Log.i(TAG, STR); Log.i(TAG, STR); controller.stop(); Log.i(TAG, STR + controller.file); AfterSoundRecorded(controller.file); } catch (Throwable t) { form.dispatchErrorOccurredEvent(this, "Stop", ErrorMessages.ERROR_SOUND_RECORDER); } finally { controller = null; StoppedRecording(); } } | /**
* Stops recording.
*/ | Stops recording | Stop | {
"repo_name": "tvomf/appinventor-mapps",
"path": "appinventor/components/src/com/google/appinventor/components/runtime/SoundRecorder.java",
"license": "apache-2.0",
"size": 8379
} | [
"android.util.Log",
"com.google.appinventor.components.runtime.util.ErrorMessages"
] | import android.util.Log; import com.google.appinventor.components.runtime.util.ErrorMessages; | import android.util.*; import com.google.appinventor.components.runtime.util.*; | [
"android.util",
"com.google.appinventor"
] | android.util; com.google.appinventor; | 1,287,862 |
public static void setLogFile(String filename) {
mLogFile = filename;
File file = new File(mLogFile);
if (file.exists()) {
file.delete();
}
} | static void function(String filename) { mLogFile = filename; File file = new File(mLogFile); if (file.exists()) { file.delete(); } } | /**
* Set the filename used for logging. If the file already exists, delete it
* as a safe-guard against accidentally appending to an old log file.
*/ | Set the filename used for logging. If the file already exists, delete it as a safe-guard against accidentally appending to an old log file | setLogFile | {
"repo_name": "eventql/eventql",
"path": "deps/3rdparty/spidermonkey/mozjs/build/mobile/robocop/FennecNativeDriver.java",
"license": "agpl-3.0",
"size": 12038
} | [
"java.io.File"
] | import java.io.File; | import java.io.*; | [
"java.io"
] | java.io; | 1,305,096 |
protected void onMeasureChild(View child, int position, int widthMeasureSpec, int heightMeasureSpec) {
child.measure(widthMeasureSpec, heightMeasureSpec);
} | void function(View child, int position, int widthMeasureSpec, int heightMeasureSpec) { child.measure(widthMeasureSpec, heightMeasureSpec); } | /**
* this method is called every time a new child is mesaure.
* @param child
* @param widthMeasureSpec
* @param heightMeasureSpec
*/ | this method is called every time a new child is mesaure | onMeasureChild | {
"repo_name": "pengqinping/androidProject",
"path": "WaterfallStream/PinterestLikeAdapterView-master/src/com/huewu/pla/lib/internal/PLA_ListView.java",
"license": "gpl-3.0",
"size": 69310
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 706,210 |
JavaTypeFactory getTypeFactory(); | JavaTypeFactory getTypeFactory(); | /**
* Returns the type factory.
*/ | Returns the type factory | getTypeFactory | {
"repo_name": "jcamachor/calcite",
"path": "core/src/main/java/org/apache/calcite/DataContext.java",
"license": "apache-2.0",
"size": 5014
} | [
"org.apache.calcite.adapter.java.JavaTypeFactory"
] | import org.apache.calcite.adapter.java.JavaTypeFactory; | import org.apache.calcite.adapter.java.*; | [
"org.apache.calcite"
] | org.apache.calcite; | 1,821,371 |
@ServiceMethod(returns = ReturnType.SINGLE)
private Mono<PagedResponse<UsageInner>> listResourceUsageSinglePageAsync(
String resourceGroupName, String profileName, String endpointName, Context context) {
if (this.client.getEndpoint() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getEndpoint() is required and cannot be null."));
}
if (resourceGroupName == null) {
return Mono
.error(new IllegalArgumentException("Parameter resourceGroupName is required and cannot be null."));
}
if (profileName == null) {
return Mono.error(new IllegalArgumentException("Parameter profileName is required and cannot be null."));
}
if (endpointName == null) {
return Mono.error(new IllegalArgumentException("Parameter endpointName is required and cannot be null."));
}
if (this.client.getSubscriptionId() == null) {
return Mono
.error(
new IllegalArgumentException(
"Parameter this.client.getSubscriptionId() is required and cannot be null."));
}
final String accept = "application/json";
context = this.client.mergeContext(context);
return service
.listResourceUsage(
this.client.getEndpoint(),
resourceGroupName,
profileName,
endpointName,
this.client.getSubscriptionId(),
this.client.getApiVersion(),
accept,
context)
.map(
res ->
new PagedResponseBase<>(
res.getRequest(),
res.getStatusCode(),
res.getHeaders(),
res.getValue().value(),
res.getValue().nextLink(),
null));
} | @ServiceMethod(returns = ReturnType.SINGLE) Mono<PagedResponse<UsageInner>> function( String resourceGroupName, String profileName, String endpointName, Context context) { if (this.client.getEndpoint() == null) { return Mono .error( new IllegalArgumentException( STR)); } if (resourceGroupName == null) { return Mono .error(new IllegalArgumentException(STR)); } if (profileName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (endpointName == null) { return Mono.error(new IllegalArgumentException(STR)); } if (this.client.getSubscriptionId() == null) { return Mono .error( new IllegalArgumentException( STR)); } final String accept = STR; context = this.client.mergeContext(context); return service .listResourceUsage( this.client.getEndpoint(), resourceGroupName, profileName, endpointName, this.client.getSubscriptionId(), this.client.getApiVersion(), accept, context) .map( res -> new PagedResponseBase<>( res.getRequest(), res.getStatusCode(), res.getHeaders(), res.getValue().value(), res.getValue().nextLink(), null)); } | /**
* Checks the quota and actual usage of endpoints under the given CDN profile.
*
* @param resourceGroupName Name of the Resource group within the Azure subscription.
* @param profileName Name of the Azure Front Door Standard or Azure Front Door Premium profile which is unique
* within the resource group.
* @param endpointName Name of the endpoint under the profile which is unique globally.
* @param context The context to associate with this operation.
* @throws IllegalArgumentException thrown if parameters fail the validation.
* @throws ManagementException thrown if the request is rejected by server.
* @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent.
* @return the list usages operation response along with {@link PagedResponse} on successful completion of {@link
* Mono}.
*/ | Checks the quota and actual usage of endpoints under the given CDN profile | listResourceUsageSinglePageAsync | {
"repo_name": "Azure/azure-sdk-for-java",
"path": "sdk/resourcemanager/azure-resourcemanager-cdn/src/main/java/com/azure/resourcemanager/cdn/implementation/AfdEndpointsClientImpl.java",
"license": "mit",
"size": 133372
} | [
"com.azure.core.annotation.ReturnType",
"com.azure.core.annotation.ServiceMethod",
"com.azure.core.http.rest.PagedResponse",
"com.azure.core.http.rest.PagedResponseBase",
"com.azure.core.util.Context",
"com.azure.resourcemanager.cdn.fluent.models.UsageInner"
] | import com.azure.core.annotation.ReturnType; import com.azure.core.annotation.ServiceMethod; import com.azure.core.http.rest.PagedResponse; import com.azure.core.http.rest.PagedResponseBase; import com.azure.core.util.Context; import com.azure.resourcemanager.cdn.fluent.models.UsageInner; | import com.azure.core.annotation.*; import com.azure.core.http.rest.*; import com.azure.core.util.*; import com.azure.resourcemanager.cdn.fluent.models.*; | [
"com.azure.core",
"com.azure.resourcemanager"
] | com.azure.core; com.azure.resourcemanager; | 468,612 |
public void suspend(String cacheName) {
for (Map.Entry<GridCacheInternalKey, GridCacheRemovable> e : dsMap.entrySet()) {
String cacheName0 = ATOMICS_CACHE_NAME + "@" + e.getKey().groupName();
if (cacheName0.equals(cacheName))
e.getValue().suspend();
}
} | void function(String cacheName) { for (Map.Entry<GridCacheInternalKey, GridCacheRemovable> e : dsMap.entrySet()) { String cacheName0 = ATOMICS_CACHE_NAME + "@" + e.getKey().groupName(); if (cacheName0.equals(cacheName)) e.getValue().suspend(); } } | /**
* Would suspend calls for this cache if it is atomics cache.
* @param cacheName To suspend.
*/ | Would suspend calls for this cache if it is atomics cache | suspend | {
"repo_name": "ascherbakoff/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/datastructures/DataStructuresProcessor.java",
"license": "apache-2.0",
"size": 74485
} | [
"java.util.Map"
] | import java.util.Map; | import java.util.*; | [
"java.util"
] | java.util; | 1,491,536 |
public CacheQuery<Map.Entry<K, V>> createScanQuery(@Nullable IgniteBiPredicate<K, V> filter,
@Nullable Integer part, boolean keepPortable) {
return new GridCacheQueryAdapter<>(cctx,
SCAN,
null,
null,
(IgniteBiPredicate<Object, Object>)filter,
part,
false,
keepPortable);
}
/**
* Creates user's full text query, queried class, and query clause. For more information refer to {@link CacheQuery} | CacheQuery<Map.Entry<K, V>> function(@Nullable IgniteBiPredicate<K, V> filter, @Nullable Integer part, boolean keepPortable) { return new GridCacheQueryAdapter<>(cctx, SCAN, null, null, (IgniteBiPredicate<Object, Object>)filter, part, false, keepPortable); } /** * Creates user's full text query, queried class, and query clause. For more information refer to {@link CacheQuery} | /**
* Creates user's predicate based scan query.
*
* @param filter Scan filter.
* @param part Partition.
* @param keepPortable Keep portable flag.
* @return Created query.
*/ | Creates user's predicate based scan query | createScanQuery | {
"repo_name": "dlnufox/ignite",
"path": "modules/core/src/main/java/org/apache/ignite/internal/processors/cache/query/GridCacheQueryManager.java",
"license": "apache-2.0",
"size": 100876
} | [
"java.util.Map",
"org.apache.ignite.lang.IgniteBiPredicate",
"org.jetbrains.annotations.Nullable"
] | import java.util.Map; import org.apache.ignite.lang.IgniteBiPredicate; import org.jetbrains.annotations.Nullable; | import java.util.*; import org.apache.ignite.lang.*; import org.jetbrains.annotations.*; | [
"java.util",
"org.apache.ignite",
"org.jetbrains.annotations"
] | java.util; org.apache.ignite; org.jetbrains.annotations; | 2,452,211 |
private void enable() {
providerService = providerRegistry.register(this);
masterService.addListener(roleListener);
deviceService.addListener(deviceListener);
packetService.addProcessor(packetProcessor, PacketProcessor.advisor(0));
loadDevices();
executor = newSingleThreadScheduledExecutor(groupedThreads("onos/link", "discovery-%d", log));
executor.scheduleAtFixedRate(new SyncDeviceInfoTask(),
DEVICE_SYNC_DELAY, DEVICE_SYNC_DELAY, SECONDS);
executor.scheduleAtFixedRate(new LinkPrunerTask(),
LINK_PRUNER_DELAY, LINK_PRUNER_DELAY, SECONDS);
requestIntercepts();
} | void function() { providerService = providerRegistry.register(this); masterService.addListener(roleListener); deviceService.addListener(deviceListener); packetService.addProcessor(packetProcessor, PacketProcessor.advisor(0)); loadDevices(); executor = newSingleThreadScheduledExecutor(groupedThreads(STR, STR, log)); executor.scheduleAtFixedRate(new SyncDeviceInfoTask(), DEVICE_SYNC_DELAY, DEVICE_SYNC_DELAY, SECONDS); executor.scheduleAtFixedRate(new LinkPrunerTask(), LINK_PRUNER_DELAY, LINK_PRUNER_DELAY, SECONDS); requestIntercepts(); } | /**
* Enables link discovery processing.
*/ | Enables link discovery processing | enable | {
"repo_name": "Shashikanth-Huawei/bmp",
"path": "providers/lldp/src/main/java/org/onosproject/provider/lldp/impl/LldpLinkProvider.java",
"license": "apache-2.0",
"size": 30939
} | [
"java.util.concurrent.Executors",
"org.onosproject.net.packet.PacketProcessor"
] | import java.util.concurrent.Executors; import org.onosproject.net.packet.PacketProcessor; | import java.util.concurrent.*; import org.onosproject.net.packet.*; | [
"java.util",
"org.onosproject.net"
] | java.util; org.onosproject.net; | 1,274,023 |
public Set<Long> getRuneIDs() {
final Set<Long> set = new HashSet<>();
for(final RunePage page : pages) {
if(page.getSlots() != null) {
for(final RuneSlot rune : page.getSlots()) {
set.add(rune.getRuneId().longValue());
}
}
}
return set;
}
| Set<Long> function() { final Set<Long> set = new HashSet<>(); for(final RunePage page : pages) { if(page.getSlots() != null) { for(final RuneSlot rune : page.getSlots()) { set.add(rune.getRuneId().longValue()); } } } return set; } | /**
* Gets all stored rune IDs for batch lookup
*
* @return the rune IDs
*/ | Gets all stored rune IDs for batch lookup | getRuneIDs | {
"repo_name": "prefanatic/Orianna",
"path": "src/com/robrua/orianna/type/dto/summoner/RunePages.java",
"license": "mit",
"size": 3377
} | [
"java.util.HashSet",
"java.util.Set"
] | import java.util.HashSet; import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 404,408 |
void addRequestInterceptor(HttpRequestInterceptor interceptor, int index); | void addRequestInterceptor(HttpRequestInterceptor interceptor, int index); | /**
* Inserts a request interceptor at the specified index.
*
* @param interceptor the request interceptor to add
* @param index the index to insert the interceptor at
*/ | Inserts a request interceptor at the specified index | addRequestInterceptor | {
"repo_name": "garymabin/YGOMobile",
"path": "apache-async-http-HC4/src/org/apache/http/HC4/protocol/HttpRequestInterceptorList.java",
"license": "mit",
"size": 3416
} | [
"org.apache.http.HC4"
] | import org.apache.http.HC4; | import org.apache.http.*; | [
"org.apache.http"
] | org.apache.http; | 1,994,260 |
public Set<Vector3> getForceFields(); | Set<Vector3> function(); | /**
* DO NOT modify this list. Read-only.
*
* @return The actual force field block coordinates in the world.
*/ | DO NOT modify this list. Read-only | getForceFields | {
"repo_name": "FibonacciRedstone/Advanced_Unknowns_1.7.10",
"path": "src/main/java/resonant/api/mffs/machine/IProjector.java",
"license": "lgpl-2.1",
"size": 877
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 69,807 |
boolean rebalance(RoutingAllocation allocation); | boolean rebalance(RoutingAllocation allocation); | /**
* Rebalancing number of shards on all nodes
*
* @param allocation current node allocation
* @return <code>true</code> if the allocation has changed, otherwise <code>false</code>
*/ | Rebalancing number of shards on all nodes | rebalance | {
"repo_name": "ESamir/elasticsearch",
"path": "core/src/main/java/org/elasticsearch/cluster/routing/allocation/allocator/ShardsAllocator.java",
"license": "apache-2.0",
"size": 3039
} | [
"org.elasticsearch.cluster.routing.allocation.RoutingAllocation"
] | import org.elasticsearch.cluster.routing.allocation.RoutingAllocation; | import org.elasticsearch.cluster.routing.allocation.*; | [
"org.elasticsearch.cluster"
] | org.elasticsearch.cluster; | 2,587,961 |
protected void addEnumList(String key, List<? extends Enum> list) {
optionsMap.put(key, list.stream().map(i -> i.toString()).collect(Collectors.toList()));
} | void function(String key, List<? extends Enum> list) { optionsMap.put(key, list.stream().map(i -> i.toString()).collect(Collectors.toList())); } | /**
* Add a list of enums to the options map
* @param key The key for the options map (ex: "include[]")
* @param list A list of enums
*/ | Add a list of enums to the options map | addEnumList | {
"repo_name": "kstateome/canvas-api",
"path": "src/main/java/edu/ksu/canvas/requestOptions/BaseOptions.java",
"license": "lgpl-3.0",
"size": 1179
} | [
"java.util.List",
"java.util.stream.Collectors"
] | import java.util.List; import java.util.stream.Collectors; | import java.util.*; import java.util.stream.*; | [
"java.util"
] | java.util; | 2,437,099 |
protected JComponent makeDisplay () {
// create with size in rows and columns
myTextArea = new JTextArea(FIELD_SIZE, FIELD_SIZE);
myTextArea.addMouseListener(myMouseListener);
myTextArea.addMouseMotionListener(myMouseMotionListener);
return new JScrollPane(myTextArea);
}
| JComponent function () { myTextArea = new JTextArea(FIELD_SIZE, FIELD_SIZE); myTextArea.addMouseListener(myMouseListener); myTextArea.addMouseMotionListener(myMouseMotionListener); return new JScrollPane(myTextArea); } | /**
* Create a display area for showing out to the user, since it may display
* lots of text, make it automatically scroll when needed
*/ | Create a display area for showing out to the user, since it may display lots of text, make it automatically scroll when needed | makeDisplay | {
"repo_name": "duke-compsci308-spring2014/example_swing",
"path": "src/EventDemo.java",
"license": "mit",
"size": 14054
} | [
"javax.swing.JComponent",
"javax.swing.JScrollPane",
"javax.swing.JTextArea"
] | import javax.swing.JComponent; import javax.swing.JScrollPane; import javax.swing.JTextArea; | import javax.swing.*; | [
"javax.swing"
] | javax.swing; | 2,721,009 |
protected final void registerRequestDestructionCallback(String name, Runnable callback) {
Assert.notNull(name, "Name must not be null");
Assert.notNull(callback, "Callback must not be null");
synchronized (this.requestDestructionCallbacks) {
this.requestDestructionCallbacks.put(name, callback);
}
}
| final void function(String name, Runnable callback) { Assert.notNull(name, STR); Assert.notNull(callback, STR); synchronized (this.requestDestructionCallbacks) { this.requestDestructionCallbacks.put(name, callback); } } | /**
* Register the given callback as to be executed after request completion.
* @param name the name of the attribute to register the callback for
* @param callback the callback to be executed for destruction
*/ | Register the given callback as to be executed after request completion | registerRequestDestructionCallback | {
"repo_name": "besom/bbossgroups-mvn",
"path": "bboss_mvc/src/main/java/org/frameworkset/web/servlet/context/AbstractRequestAttributes.java",
"license": "apache-2.0",
"size": 3446
} | [
"org.frameworkset.util.Assert"
] | import org.frameworkset.util.Assert; | import org.frameworkset.util.*; | [
"org.frameworkset.util"
] | org.frameworkset.util; | 1,587,224 |
long getBlockIdBasedOnOffset(long offset) throws IOException {
int index = (int) (offset / mTachyonFS.getFileStatus(mFileId, true).getBlockSizeByte());
return mTachyonFS.getBlockId(mFileId, index);
} | long getBlockIdBasedOnOffset(long offset) throws IOException { int index = (int) (offset / mTachyonFS.getFileStatus(mFileId, true).getBlockSizeByte()); return mTachyonFS.getBlockId(mFileId, index); } | /**
* Get the block id by the file id and offset. it will check whether the file and the block exist.
*
* @param offset The offset of the file.
* @return the block id if exists
* @throws IOException
*/ | Get the block id by the file id and offset. it will check whether the file and the block exist | getBlockIdBasedOnOffset | {
"repo_name": "mesosphere/tachyon",
"path": "core/src/main/java/tachyon/client/TachyonFile.java",
"license": "apache-2.0",
"size": 18091
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 2,549,176 |
public void testRootPath2() throws JavaModelException {
IJavaProject project = getJavaProject("AttachSourceTests");
IFile jar = (IFile) project.getProject().findMember("attach2.jar");
IFile srcZip=(IFile) project.getProject().findMember("attach2src.zip");
JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar);
root.attachSource(srcZip.getFullPath(), new Path(""), null);
IOrdinaryClassFile cf = root.getPackageFragment("x.y").getOrdinaryClassFile("B.class");
assertTrue("source code does not exist for the entire attached compilation unit", cf.getSource() != null);
root.close();
} | void function() throws JavaModelException { IJavaProject project = getJavaProject(STR); IFile jar = (IFile) project.getProject().findMember(STR); IFile srcZip=(IFile) project.getProject().findMember(STR); JarPackageFragmentRoot root = (JarPackageFragmentRoot) project.getPackageFragmentRoot(jar); root.attachSource(srcZip.getFullPath(), new Path(STRx.ySTRB.classSTRsource code does not exist for the entire attached compilation unit", cf.getSource() != null); root.close(); } | /**
* Attaches a source zip to a jar specifying an invalid root path.
* Ensures that the root path is just used as a hint, and that the source is still retrieved.
*/ | Attaches a source zip to a jar specifying an invalid root path. Ensures that the root path is just used as a hint, and that the source is still retrieved | testRootPath2 | {
"repo_name": "Niky4000/UsefulUtils",
"path": "projects/others/eclipse-platform-parent/eclipse.jdt.core-master/org.eclipse.jdt.core.tests.model/src/org/eclipse/jdt/core/tests/model/AttachSourceTests.java",
"license": "gpl-3.0",
"size": 77530
} | [
"org.eclipse.core.resources.IFile",
"org.eclipse.core.runtime.Path",
"org.eclipse.jdt.core.IJavaProject",
"org.eclipse.jdt.core.JavaModelException",
"org.eclipse.jdt.internal.core.JarPackageFragmentRoot"
] | import org.eclipse.core.resources.IFile; import org.eclipse.core.runtime.Path; import org.eclipse.jdt.core.IJavaProject; import org.eclipse.jdt.core.JavaModelException; import org.eclipse.jdt.internal.core.JarPackageFragmentRoot; | import org.eclipse.core.resources.*; import org.eclipse.core.runtime.*; import org.eclipse.jdt.core.*; import org.eclipse.jdt.internal.core.*; | [
"org.eclipse.core",
"org.eclipse.jdt"
] | org.eclipse.core; org.eclipse.jdt; | 1,748,485 |
public Read<K, V> withTopic(String topic) {
return withTopics(ImmutableList.of(topic));
} | Read<K, V> function(String topic) { return withTopics(ImmutableList.of(topic)); } | /**
* Sets the topic to read from.
*
* <p>See {@link UnboundedKafkaSource#split(int, PipelineOptions)} for description
* of how the partitions are distributed among the splits.
*/ | Sets the topic to read from. See <code>UnboundedKafkaSource#split(int, PipelineOptions)</code> for description of how the partitions are distributed among the splits | withTopic | {
"repo_name": "wtanaka/beam",
"path": "sdks/java/io/kafka/src/main/java/org/apache/beam/sdk/io/kafka/KafkaIO.java",
"license": "apache-2.0",
"size": 67158
} | [
"com.google.common.collect.ImmutableList"
] | import com.google.common.collect.ImmutableList; | import com.google.common.collect.*; | [
"com.google.common"
] | com.google.common; | 1,149,699 |
public static ActionInvocationContext onCollection(final Object... domainObjects) {
return onCollection(Arrays.asList(domainObjects));
} | static ActionInvocationContext function(final Object... domainObjects) { return onCollection(Arrays.asList(domainObjects)); } | /**
* Intended only to support unit testing.
*/ | Intended only to support unit testing | onCollection | {
"repo_name": "howepeng/isis",
"path": "core/applib/src/main/java/org/apache/isis/applib/services/actinvoc/ActionInvocationContext.java",
"license": "apache-2.0",
"size": 5288
} | [
"java.util.Arrays"
] | import java.util.Arrays; | import java.util.*; | [
"java.util"
] | java.util; | 330,620 |
@ThreadSafe
List<? extends DirEntry> listDir(File dir) throws NativeException; | List<? extends DirEntry> listDir(File dir) throws NativeException; | /**
* Lists the entries of the given directory.
*
* <p>When a directory entry is a symlink, details about the symlink is returned, not the target of the symlink.</p>
*
* @param dir The path of the directory to list. Follows symlinks to this directory.
* @throws NativeException On failure.
* @throws NoSuchFileException When the specified directory does not exist.
* @throws NotADirectoryException When the specified file is not a directory.
* @throws FilePermissionException When the user has insufficient permissions to list the entries
*/ | Lists the entries of the given directory. When a directory entry is a symlink, details about the symlink is returned, not the target of the symlink | listDir | {
"repo_name": "adammurdoch/native-platform",
"path": "native-platform/src/main/java/net/rubygrapefruit/platform/file/Files.java",
"license": "apache-2.0",
"size": 4245
} | [
"java.io.File",
"java.util.List",
"net.rubygrapefruit.platform.NativeException"
] | import java.io.File; import java.util.List; import net.rubygrapefruit.platform.NativeException; | import java.io.*; import java.util.*; import net.rubygrapefruit.platform.*; | [
"java.io",
"java.util",
"net.rubygrapefruit.platform"
] | java.io; java.util; net.rubygrapefruit.platform; | 1,108,908 |
public SubmissionService getSubmissionService() {
return submissionService;
} | SubmissionService function() { return submissionService; } | /**
* Returns the local submissions service
*
* @return the service
*/ | Returns the local submissions service | getSubmissionService | {
"repo_name": "rapidpro/surveyor",
"path": "app/src/main/java/io/rapidpro/surveyor/SurveyorApplication.java",
"license": "isc",
"size": 6398
} | [
"io.rapidpro.surveyor.data.SubmissionService"
] | import io.rapidpro.surveyor.data.SubmissionService; | import io.rapidpro.surveyor.data.*; | [
"io.rapidpro.surveyor"
] | io.rapidpro.surveyor; | 846,866 |
@Implementation
public View findViewById(int id) {
return getWindow().findViewById(id);
} | View function(int id) { return getWindow().findViewById(id); } | /**
* Checks to ensure that the{@code contentView} has been set
*
* @param id ID of the view to find
* @return the view
* @throws RuntimeException if the {@code contentView} has not been called first
*/ | Checks to ensure that thecontentView has been set | findViewById | {
"repo_name": "macklinu/robolectric",
"path": "robolectric-shadows/shadows-core/src/main/java/org/robolectric/shadows/ShadowActivity.java",
"license": "mit",
"size": 18092
} | [
"android.view.View"
] | import android.view.View; | import android.view.*; | [
"android.view"
] | android.view; | 2,217,834 |
public void waitUntilIdle() {
waitTaskTrackers();
JobClient client;
try {
client = new JobClient(job);
ClusterStatus status = client.getClusterStatus();
while(status.getTaskTrackers() + numTrackerToExclude
< taskTrackerList.size()) {
for(TaskTrackerRunner runner : taskTrackerList) {
if(runner.isDead) {
throw new RuntimeException("TaskTracker is dead");
}
}
Thread.sleep(1000);
status = client.getClusterStatus();
}
}
catch (IOException ex) {
throw new RuntimeException(ex);
}
catch (InterruptedException ex) {
throw new RuntimeException(ex);
}
} | void function() { waitTaskTrackers(); JobClient client; try { client = new JobClient(job); ClusterStatus status = client.getClusterStatus(); while(status.getTaskTrackers() + numTrackerToExclude < taskTrackerList.size()) { for(TaskTrackerRunner runner : taskTrackerList) { if(runner.isDead) { throw new RuntimeException(STR); } } Thread.sleep(1000); status = client.getClusterStatus(); } } catch (IOException ex) { throw new RuntimeException(ex); } catch (InterruptedException ex) { throw new RuntimeException(ex); } } | /**
* Wait until the system is idle.
*/ | Wait until the system is idle | waitUntilIdle | {
"repo_name": "jayantgolhar/Hadoop-0.21.0",
"path": "mapred/src/test/mapred/org/apache/hadoop/mapred/MiniMRCluster.java",
"license": "apache-2.0",
"size": 23511
} | [
"java.io.IOException"
] | import java.io.IOException; | import java.io.*; | [
"java.io"
] | java.io; | 1,610,244 |
@Column(name = "remove_time")
public Date getRemoveTime(); | @Column(name = STR) Date function(); | /**
* Getter for <code>cattle.revision.remove_time</code>.
*/ | Getter for <code>cattle.revision.remove_time</code> | getRemoveTime | {
"repo_name": "vincent99/cattle",
"path": "code/iaas/model/src/main/java/io/cattle/platform/core/model/Revision.java",
"license": "apache-2.0",
"size": 4575
} | [
"java.util.Date",
"javax.persistence.Column"
] | import java.util.Date; import javax.persistence.Column; | import java.util.*; import javax.persistence.*; | [
"java.util",
"javax.persistence"
] | java.util; javax.persistence; | 2,798,572 |
void getAllBookmarkRefs ( Collection listToFill ); | void getAllBookmarkRefs ( Collection listToFill ); | /**
* Retrieves all the bookmarks at this location, adding them to
* the specified collection. Bookmarks held by weak references are
* added to this collection as Weak referenced objects pointing to the
* bookmark.
*
* @param listToFill The collection that will contain bookmarks
* returned by this method.
*/ | Retrieves all the bookmarks at this location, adding them to the specified collection. Bookmarks held by weak references are added to this collection as Weak referenced objects pointing to the bookmark | getAllBookmarkRefs | {
"repo_name": "crow-misia/xmlbeans",
"path": "src/xmlpublic/org/apache/xmlbeans/XmlCursor.java",
"license": "apache-2.0",
"size": 69754
} | [
"java.util.Collection"
] | import java.util.Collection; | import java.util.*; | [
"java.util"
] | java.util; | 1,291,118 |
public void deselectAllTools() {
int toolCount = toolBar.getComponentCount();
for (int i = 0; i < toolCount; ++i) {
Component c = toolBar.getComponent(i);
if (c instanceof ToolButton) {
ToolButton tb = (ToolButton) c;
Action action = tb.getRealAction();
if (action instanceof RadioAction) {
action = ((RadioAction) action).getAction();
}
tb.setSelected(false);
ButtonModel bm = tb.getModel();
bm.setRollover(false);
bm.setSelected(false);
bm.setArmed(false);
bm.setPressed(false);
tb.setBorderPainted(false);
}
}
} | void function() { int toolCount = toolBar.getComponentCount(); for (int i = 0; i < toolCount; ++i) { Component c = toolBar.getComponent(i); if (c instanceof ToolButton) { ToolButton tb = (ToolButton) c; Action action = tb.getRealAction(); if (action instanceof RadioAction) { action = ((RadioAction) action).getAction(); } tb.setSelected(false); ButtonModel bm = tb.getModel(); bm.setRollover(false); bm.setSelected(false); bm.setArmed(false); bm.setPressed(false); tb.setBorderPainted(false); } } } | /**
* Unselect all the toolbar buttons.
*/ | Unselect all the toolbar buttons | deselectAllTools | {
"repo_name": "carvalhomb/tsmells",
"path": "sample/argouml/argouml/org/argouml/uml/diagram/ui/UMLDiagram.java",
"license": "gpl-2.0",
"size": 25134
} | [
"java.awt.Component",
"javax.swing.Action",
"javax.swing.ButtonModel",
"org.tigris.toolbar.toolbutton.ToolButton"
] | import java.awt.Component; import javax.swing.Action; import javax.swing.ButtonModel; import org.tigris.toolbar.toolbutton.ToolButton; | import java.awt.*; import javax.swing.*; import org.tigris.toolbar.toolbutton.*; | [
"java.awt",
"javax.swing",
"org.tigris.toolbar"
] | java.awt; javax.swing; org.tigris.toolbar; | 677,723 |
public ServiceCall<DateTime> getLocalPositiveOffsetLowercaseMaxDateTimeAsync(final ServiceCallback<DateTime> serviceCallback) {
return ServiceCall.create(getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback);
} | ServiceCall<DateTime> function(final ServiceCallback<DateTime> serviceCallback) { return ServiceCall.create(getLocalPositiveOffsetLowercaseMaxDateTimeWithServiceResponseAsync(), serviceCallback); } | /**
* Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00.
*
* @param serviceCallback the async ServiceCallback to handle successful and failed responses.
* @return the {@link ServiceCall} object
*/ | Get max datetime value with positive num offset 9999-12-31t23:59:59.9999999+14:00 | getLocalPositiveOffsetLowercaseMaxDateTimeAsync | {
"repo_name": "tbombach/autorest",
"path": "src/generator/AutoRest.Java.Tests/src/main/java/fixtures/bodydatetime/implementation/DatetimesImpl.java",
"license": "mit",
"size": 60457
} | [
"com.microsoft.rest.ServiceCall",
"com.microsoft.rest.ServiceCallback",
"org.joda.time.DateTime"
] | import com.microsoft.rest.ServiceCall; import com.microsoft.rest.ServiceCallback; import org.joda.time.DateTime; | import com.microsoft.rest.*; import org.joda.time.*; | [
"com.microsoft.rest",
"org.joda.time"
] | com.microsoft.rest; org.joda.time; | 395,357 |
protected String checkForMariaDb(DatabaseMetaData databaseMetaData, String databaseName) {
try {
String databaseProductVersion = databaseMetaData.getDatabaseProductVersion();
if (databaseProductVersion != null && databaseProductVersion.toLowerCase().contains("mariadb")) {
return MARIA_DB_PRODUCT_NAME;
}
} catch (SQLException ignore) {
}
try {
String driverName = databaseMetaData.getDriverName();
if (driverName != null && driverName.toLowerCase().contains("mariadb")) {
return MARIA_DB_PRODUCT_NAME;
}
} catch (SQLException ignore) {
}
String metaDataClassName = databaseMetaData.getClass().getName();
if (metaDataClassName != null && metaDataClassName.toLowerCase().contains("mariadb")) {
return MARIA_DB_PRODUCT_NAME;
}
return databaseName;
}
// myBatis SqlSessionFactory //////////////////////////////////////////////// | String function(DatabaseMetaData databaseMetaData, String databaseName) { try { String databaseProductVersion = databaseMetaData.getDatabaseProductVersion(); if (databaseProductVersion != null && databaseProductVersion.toLowerCase().contains(STR)) { return MARIA_DB_PRODUCT_NAME; } } catch (SQLException ignore) { } try { String driverName = databaseMetaData.getDriverName(); if (driverName != null && driverName.toLowerCase().contains(STR)) { return MARIA_DB_PRODUCT_NAME; } } catch (SQLException ignore) { } String metaDataClassName = databaseMetaData.getClass().getName(); if (metaDataClassName != null && metaDataClassName.toLowerCase().contains(STR)) { return MARIA_DB_PRODUCT_NAME; } return databaseName; } | /**
* The product name of mariadb is still 'MySQL'. This method
* tries if it can find some evidence for mariadb. If it is successful
* it will return "MariaDB", otherwise the provided database name.
*/ | The product name of mariadb is still 'MySQL'. This method tries if it can find some evidence for mariadb. If it is successful it will return "MariaDB", otherwise the provided database name | checkForMariaDb | {
"repo_name": "falko/camunda-bpm-platform",
"path": "engine/src/main/java/org/camunda/bpm/engine/impl/cfg/ProcessEngineConfigurationImpl.java",
"license": "apache-2.0",
"size": 173870
} | [
"java.sql.DatabaseMetaData",
"java.sql.SQLException"
] | import java.sql.DatabaseMetaData; import java.sql.SQLException; | import java.sql.*; | [
"java.sql"
] | java.sql; | 315,960 |
private boolean getUpdatesRequestedState() {
return PreferenceManager.getDefaultSharedPreferences(this)
.getBoolean(Constants.KEY_ACTIVITY_UPDATES_REQUESTED, false);
} | boolean function() { return PreferenceManager.getDefaultSharedPreferences(this) .getBoolean(Constants.KEY_ACTIVITY_UPDATES_REQUESTED, false); } | /**
* Retrieves the boolean from SharedPreferences that tracks whether we are requesting activity
* updates.
*/ | Retrieves the boolean from SharedPreferences that tracks whether we are requesting activity updates | getUpdatesRequestedState | {
"repo_name": "JimSeker/googleplayAPI",
"path": "RecognitionAPI/ActivityRecognition/app/src/main/java/com/google/android/gms/location/sample/activityrecognition/MainActivity.java",
"license": "apache-2.0",
"size": 11308
} | [
"android.preference.PreferenceManager"
] | import android.preference.PreferenceManager; | import android.preference.*; | [
"android.preference"
] | android.preference; | 62,940 |
EAttribute getTeamScoredMessage_Team(); | EAttribute getTeamScoredMessage_Team(); | /**
* Returns the meta object for the attribute '{@link MessagesModel.TeamScoredMessage#getTeam <em>Team</em>}'.
* <!-- begin-user-doc -->
* <!-- end-user-doc -->
* @return the meta object for the attribute '<em>Team</em>'.
* @see MessagesModel.TeamScoredMessage#getTeam()
* @see #getTeamScoredMessage()
* @generated
*/ | Returns the meta object for the attribute '<code>MessagesModel.TeamScoredMessage#getTeam Team</code>'. | getTeamScoredMessage_Team | {
"repo_name": "Hu3bl/statsbot",
"path": "statsbot-parent/statsbot-module.messages.model/src/main/java/MessagesModel/ModelPackage.java",
"license": "mit",
"size": 147130
} | [
"org.eclipse.emf.ecore.EAttribute"
] | import org.eclipse.emf.ecore.EAttribute; | import org.eclipse.emf.ecore.*; | [
"org.eclipse.emf"
] | org.eclipse.emf; | 773,134 |
public static <K, V> Map<K, V> collectEntries(Iterator<?> self) {
return collectEntries(self, Closure.IDENTITY);
}
/**
* A variant of collectEntries for Iterable objects using the identity closure as the transform.
* The source Iterable should contain a list of <code>[key, value]</code> tuples or <code>Map.Entry</code> objects.
* <pre class="groovyTestCase">
* def nums = [1, 10, 100, 1000]
* def tuples = nums.collect{ [it, it.toString().size()] } | static <K, V> Map<K, V> function(Iterator<?> self) { return collectEntries(self, Closure.IDENTITY); } /** * A variant of collectEntries for Iterable objects using the identity closure as the transform. * The source Iterable should contain a list of <code>[key, value]</code> tuples or <code>Map.Entry</code> objects. * <pre class=STR> * def nums = [1, 10, 100, 1000] * def tuples = nums.collect{ [it, it.toString().size()] } | /**
* A variant of collectEntries for Iterators using the identity closure as the transform.
*
* @param self an Iterator
* @return a Map of the transformed entries
* @see #collectEntries(Iterable)
* @since 1.8.7
*/ | A variant of collectEntries for Iterators using the identity closure as the transform | collectEntries | {
"repo_name": "armsargis/groovy",
"path": "src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java",
"license": "apache-2.0",
"size": 698233
} | [
"groovy.lang.Closure",
"java.util.Iterator",
"java.util.Map"
] | import groovy.lang.Closure; import java.util.Iterator; import java.util.Map; | import groovy.lang.*; import java.util.*; | [
"groovy.lang",
"java.util"
] | groovy.lang; java.util; | 2,496,999 |
public ims.nursing.vo.CarePlan saveCarePlan(ims.nursing.vo.CarePlan carePlan, ims.nursing.vo.CarePlanTemplateTitle carePlanTempl, ims.nursing.vo.AssessmentComponent component) throws StaleObjectException
{
// Ensure that the careplan has been validated
if (!carePlan.isValidated())
throw new DomainRuntimeException("CarePlan has not been validated");
DomainFactory factory = getDomainFactory();
// Convert to domain object
CarePlan domainCP = CarePlanAssembler.extractCarePlan(factory, carePlan);
try
{
// Link the Careplan to the Template
CarePlanTemplate domainCPT = null;
if (carePlanTempl != null)
{
domainCPT = (CarePlanTemplate) factory.getDomainObject(CarePlanTemplate.class, carePlanTempl.getID_CarePlanTemplate());
domainCP.setTemplate(domainCPT);
// Update the Assessment component if passed in and a
// template is also associated with the careplan
if (component != null)
{
AssessmentComponent domComp = (AssessmentComponent) factory.getDomainObject(AssessmentComponent.class, component.getID_AssessmentComponent());
domainCP.setAssessmentComponent(domComp);
// We also need to set the careplan template for the
// component
Set temps = domComp.getCarePlanTemplate();
temps.add(domainCPT);
domComp.setCarePlanTemplate(temps);
}
}
factory.save(domainCP);
return (CarePlanAssembler.create(domainCP));
}
catch (DomainException e)
{
throw new DomainRuntimeException("Domain Exception occurred.\r\n" + e.getMessage(), e);
}
}
| ims.nursing.vo.CarePlan function(ims.nursing.vo.CarePlan carePlan, ims.nursing.vo.CarePlanTemplateTitle carePlanTempl, ims.nursing.vo.AssessmentComponent component) throws StaleObjectException { if (!carePlan.isValidated()) throw new DomainRuntimeException(STR); DomainFactory factory = getDomainFactory(); CarePlan domainCP = CarePlanAssembler.extractCarePlan(factory, carePlan); try { CarePlanTemplate domainCPT = null; if (carePlanTempl != null) { domainCPT = (CarePlanTemplate) factory.getDomainObject(CarePlanTemplate.class, carePlanTempl.getID_CarePlanTemplate()); domainCP.setTemplate(domainCPT); if (component != null) { AssessmentComponent domComp = (AssessmentComponent) factory.getDomainObject(AssessmentComponent.class, component.getID_AssessmentComponent()); domainCP.setAssessmentComponent(domComp); Set temps = domComp.getCarePlanTemplate(); temps.add(domainCPT); domComp.setCarePlanTemplate(temps); } } factory.save(domainCP); return (CarePlanAssembler.create(domainCP)); } catch (DomainException e) { throw new DomainRuntimeException(STR + e.getMessage(), e); } } | /**
* Saves the CarePlan
*/ | Saves the CarePlan | saveCarePlan | {
"repo_name": "FreudianNM/openMAXIMS",
"path": "Source Library/openmaxims_workspace/Nursing/src/ims/nursing/domain/impl/CarePlanStep2Impl.java",
"license": "agpl-3.0",
"size": 8688
} | [
"java.util.Set"
] | import java.util.Set; | import java.util.*; | [
"java.util"
] | java.util; | 938,951 |
SafeHtml getDisabledHtml(); | SafeHtml getDisabledHtml(); | /**
* Returns the content to show when this button is disabled.
*/ | Returns the content to show when this button is disabled | getDisabledHtml | {
"repo_name": "OpenUniversity/ovirt-engine",
"path": "frontend/webadmin/modules/gwt-common/src/main/java/org/ovirt/engine/ui/common/widget/action/ActionButtonDefinition.java",
"license": "apache-2.0",
"size": 2255
} | [
"com.google.gwt.safehtml.shared.SafeHtml"
] | import com.google.gwt.safehtml.shared.SafeHtml; | import com.google.gwt.safehtml.shared.*; | [
"com.google.gwt"
] | com.google.gwt; | 313,860 |
private void setState(int loopCount) {
if (loopCount <= LoopController.INFINITE_LOOP_COUNT) {
infinite.setSelected(true);
loops.setEnabled(false);
loops.setText(""); // $NON-NLS-1$
} else {
infinite.setSelected(false);
loops.setEnabled(true);
loops.setText(Integer.toString(loopCount));
}
} | void function(int loopCount) { if (loopCount <= LoopController.INFINITE_LOOP_COUNT) { infinite.setSelected(true); loops.setEnabled(false); loops.setText(""); } else { infinite.setSelected(false); loops.setEnabled(true); loops.setText(Integer.toString(loopCount)); } } | /**
* Set the number of loops which should be reflected in the GUI. If the
* loopCount is less than 0, the number of loops will be assumed to be
* infinity.
*
* @param loopCount
* the number of loops
*/ | Set the number of loops which should be reflected in the GUI. If the loopCount is less than 0, the number of loops will be assumed to be infinity | setState | {
"repo_name": "ufctester/apache-jmeter",
"path": "src/core/org/apache/jmeter/control/gui/LoopControlPanel.java",
"license": "apache-2.0",
"size": 9137
} | [
"org.apache.jmeter.control.LoopController"
] | import org.apache.jmeter.control.LoopController; | import org.apache.jmeter.control.*; | [
"org.apache.jmeter"
] | org.apache.jmeter; | 2,246,355 |
public static OneResponse update(Client client, int id, String new_template,
boolean append)
{
return client.call(UPDATE, id, new_template, append ? 1 : 0);
} | static OneResponse function(Client client, int id, String new_template, boolean append) { return client.call(UPDATE, id, new_template, append ? 1 : 0); } | /**
* Replaces the template contents.
*
* @param client XML-RPC Client.
* @param id The zone id of the target zone we want to modify.
* @param new_template New template contents
* @param append True to append new attributes instead of replace the whole template
* @return If successful the message contains the zone id.
*/ | Replaces the template contents | update | {
"repo_name": "unistra/one",
"path": "src/oca/java/src/org/opennebula/client/zone/Zone.java",
"license": "apache-2.0",
"size": 5557
} | [
"org.opennebula.client.Client",
"org.opennebula.client.OneResponse"
] | import org.opennebula.client.Client; import org.opennebula.client.OneResponse; | import org.opennebula.client.*; | [
"org.opennebula.client"
] | org.opennebula.client; | 1,934,335 |
byte getByte(String columnLabel) throws OntoDriverException; | byte getByte(String columnLabel) throws OntoDriverException; | /**
* Retrieves value from column with the specified label and returns it as {@code byte}.
*
* @param columnLabel Label of the column
* @return {@code byte} value
* @throws IllegalStateException If called on a closed result set
* @throws OntoDriverException If there is no column with the specified label, the value cannot be cast to {@code
* byte} or there occurs some other error
*/ | Retrieves value from column with the specified label and returns it as byte | getByte | {
"repo_name": "kbss-cvut/jopa",
"path": "ontodriver-api/src/main/java/cz/cvut/kbss/ontodriver/iteration/ResultRow.java",
"license": "lgpl-3.0",
"size": 14731
} | [
"cz.cvut.kbss.ontodriver.exception.OntoDriverException"
] | import cz.cvut.kbss.ontodriver.exception.OntoDriverException; | import cz.cvut.kbss.ontodriver.exception.*; | [
"cz.cvut.kbss"
] | cz.cvut.kbss; | 1,862,488 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.