repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/TaskClient.java | TaskClient.getPendingTaskForWorkflow | public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) {
"""
Retrieve pending task identified by reference name for a workflow
@param workflowId Workflow instance id
@param taskReferenceName reference name of the task
@return Returns the pending workflow task identified by t... | java | public Task getPendingTaskForWorkflow(String workflowId, String taskReferenceName) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "Workflow id cannot be blank");
Preconditions.checkArgument(StringUtils.isNotBlank(taskReferenceName), "Task reference name cannot be blank");
ret... | [
"public",
"Task",
"getPendingTaskForWorkflow",
"(",
"String",
"workflowId",
",",
"String",
"taskReferenceName",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"Workflow id cannot be blank\"",
")",
... | Retrieve pending task identified by reference name for a workflow
@param workflowId Workflow instance id
@param taskReferenceName reference name of the task
@return Returns the pending workflow task identified by the reference name | [
"Retrieve",
"pending",
"task",
"identified",
"by",
"reference",
"name",
"for",
"a",
"workflow"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/TaskClient.java#L208-L213 |
JavaMoney/jsr354-ri-bp | src/main/java/org/javamoney/moneta/function/MonetaryFunctions.java | MonetaryFunctions.sortCurrencyUnitDesc | public static Comparator<MonetaryAmount> sortCurrencyUnitDesc() {
"""
Get a comparator for sorting CurrencyUnits descending.
@return the Comparator to sort by CurrencyUnit in descending order, not null.
"""
return new Comparator<MonetaryAmount>() {
@Override
public int compa... | java | public static Comparator<MonetaryAmount> sortCurrencyUnitDesc(){
return new Comparator<MonetaryAmount>() {
@Override
public int compare(MonetaryAmount o1, MonetaryAmount o2) {
return sortCurrencyUnit().compare(o1, o2) * -1;
}
};
} | [
"public",
"static",
"Comparator",
"<",
"MonetaryAmount",
">",
"sortCurrencyUnitDesc",
"(",
")",
"{",
"return",
"new",
"Comparator",
"<",
"MonetaryAmount",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"MonetaryAmount",
"o1",
",",
"Monet... | Get a comparator for sorting CurrencyUnits descending.
@return the Comparator to sort by CurrencyUnit in descending order, not null. | [
"Get",
"a",
"comparator",
"for",
"sorting",
"CurrencyUnits",
"descending",
"."
] | train | https://github.com/JavaMoney/jsr354-ri-bp/blob/9c147ef5623d8032a6dc4c0e5eefdfb41641a9a2/src/main/java/org/javamoney/moneta/function/MonetaryFunctions.java#L131-L138 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java | ArrayUtil.countCommonElements | public static int countCommonElements(int[] arra, int[] arrb) {
"""
Returns the number of elements shared between the two arrays containing
sets.<p>
Return the number of elements shared by two column index arrays.
This method assumes that each of these arrays contains a set (each
element index is listed only... | java | public static int countCommonElements(int[] arra, int[] arrb) {
int k = 0;
for (int i = 0; i < arra.length; i++) {
for (int j = 0; j < arrb.length; j++) {
if (arra[i] == arrb[j]) {
k++;
}
}
}
return k;
} | [
"public",
"static",
"int",
"countCommonElements",
"(",
"int",
"[",
"]",
"arra",
",",
"int",
"[",
"]",
"arrb",
")",
"{",
"int",
"k",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"arra",
".",
"length",
";",
"i",
"++",
")",
"{... | Returns the number of elements shared between the two arrays containing
sets.<p>
Return the number of elements shared by two column index arrays.
This method assumes that each of these arrays contains a set (each
element index is listed only once in each index array). Otherwise the
returned number will NOT represent t... | [
"Returns",
"the",
"number",
"of",
"elements",
"shared",
"between",
"the",
"two",
"arrays",
"containing",
"sets",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/lib/ArrayUtil.java#L499-L512 |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java | MongoDBDialect.insertDocument | private Document insertDocument(EntityKeyMetadata entityKeyMetadata, Tuple tuple, TupleContext tupleContext ) {
"""
/*
InsertOne the tuple and return an object containing the id in the field ID_FIELDNAME
"""
Document dbObject = objectForInsert( tuple, ( (MongoDBTupleSnapshot) tuple.getSnapshot() ).getDbObje... | java | private Document insertDocument(EntityKeyMetadata entityKeyMetadata, Tuple tuple, TupleContext tupleContext ) {
Document dbObject = objectForInsert( tuple, ( (MongoDBTupleSnapshot) tuple.getSnapshot() ).getDbObject() );
getCollection( entityKeyMetadata.getTable(), tupleContext.getTupleTypeContext().getOptionsContex... | [
"private",
"Document",
"insertDocument",
"(",
"EntityKeyMetadata",
"entityKeyMetadata",
",",
"Tuple",
"tuple",
",",
"TupleContext",
"tupleContext",
")",
"{",
"Document",
"dbObject",
"=",
"objectForInsert",
"(",
"tuple",
",",
"(",
"(",
"MongoDBTupleSnapshot",
")",
"t... | /*
InsertOne the tuple and return an object containing the id in the field ID_FIELDNAME | [
"/",
"*",
"InsertOne",
"the",
"tuple",
"and",
"return",
"an",
"object",
"containing",
"the",
"id",
"in",
"the",
"field",
"ID_FIELDNAME"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/MongoDBDialect.java#L545-L549 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.ddoti | @Override
protected double ddoti(long N, INDArray X, DataBuffer indx, INDArray Y) {
"""
Computes the dot product of a compressed sparse double vector by a full-storage real vector.
@param N The number of elements in x and indx
@param X an sparse INDArray. Size at least N
@param indx an Databuffer that Speci... | java | @Override
protected double ddoti(long N, INDArray X, DataBuffer indx, INDArray Y) {
return cblas_ddoti((int) N, (DoublePointer) X.data().addressPointer(),(IntPointer) indx.addressPointer(),
(DoublePointer) Y.data().addressPointer());
} | [
"@",
"Override",
"protected",
"double",
"ddoti",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"DataBuffer",
"indx",
",",
"INDArray",
"Y",
")",
"{",
"return",
"cblas_ddoti",
"(",
"(",
"int",
")",
"N",
",",
"(",
"DoublePointer",
")",
"X",
".",
"data",
... | Computes the dot product of a compressed sparse double vector by a full-storage real vector.
@param N The number of elements in x and indx
@param X an sparse INDArray. Size at least N
@param indx an Databuffer that Specifies the indices for the elements of x. Size at least N
@param Y a dense INDArray. Size at least max... | [
"Computes",
"the",
"dot",
"product",
"of",
"a",
"compressed",
"sparse",
"double",
"vector",
"by",
"a",
"full",
"-",
"storage",
"real",
"vector",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L44-L48 |
languagetool-org/languagetool | languagetool-server/src/main/java/org/languagetool/server/ResultExtender.java | ResultExtender.getFilteredExtensionMatches | @NotNull
List<RuleMatch> getFilteredExtensionMatches(List<RuleMatch> matches, List<RemoteRuleMatch> extensionMatches) {
"""
Filter {@code extensionMatches} so that only those matches are left that don't cover or touch one of the {@code matches}.
"""
List<RuleMatch> filteredExtMatches = new ArrayList<>();... | java | @NotNull
List<RuleMatch> getFilteredExtensionMatches(List<RuleMatch> matches, List<RemoteRuleMatch> extensionMatches) {
List<RuleMatch> filteredExtMatches = new ArrayList<>();
for (RemoteRuleMatch extensionMatch : extensionMatches) {
if (!extensionMatch.isTouchedByOneOf(matches)) {
AnalyzedSente... | [
"@",
"NotNull",
"List",
"<",
"RuleMatch",
">",
"getFilteredExtensionMatches",
"(",
"List",
"<",
"RuleMatch",
">",
"matches",
",",
"List",
"<",
"RemoteRuleMatch",
">",
"extensionMatches",
")",
"{",
"List",
"<",
"RuleMatch",
">",
"filteredExtMatches",
"=",
"new",
... | Filter {@code extensionMatches} so that only those matches are left that don't cover or touch one of the {@code matches}. | [
"Filter",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-server/src/main/java/org/languagetool/server/ResultExtender.java#L71-L84 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java | ReferenceDataUrl.getAddressSchemaUrl | public static MozuUrl getAddressSchemaUrl(String countryCode, String responseFields) {
"""
Get Resource Url for GetAddressSchema
@param countryCode The 2-letter country code used to retrieve a specified address schema.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amo... | java | public static MozuUrl getAddressSchemaUrl(String countryCode, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/reference/addressschema/{countryCode}?responseFields={responseFields}");
formatter.formatUrl("countryCode", countryCode);
formatter.formatUrl("responseFields", respo... | [
"public",
"static",
"MozuUrl",
"getAddressSchemaUrl",
"(",
"String",
"countryCode",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/platform/reference/addressschema/{countryCode}?responseFields={responseFields}\"",
... | Get Resource Url for GetAddressSchema
@param countryCode The 2-letter country code used to retrieve a specified address schema.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. At... | [
"Get",
"Resource",
"Url",
"for",
"GetAddressSchema"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/ReferenceDataUrl.java#L22-L28 |
google/error-prone | check_api/src/main/java/com/google/errorprone/predicates/TypePredicates.java | TypePredicates.isExactTypeAny | public static TypePredicate isExactTypeAny(Iterable<String> types) {
"""
Match types that are exactly equal to any of the given types.
"""
return new ExactAny(Iterables.transform(types, GET_TYPE));
} | java | public static TypePredicate isExactTypeAny(Iterable<String> types) {
return new ExactAny(Iterables.transform(types, GET_TYPE));
} | [
"public",
"static",
"TypePredicate",
"isExactTypeAny",
"(",
"Iterable",
"<",
"String",
">",
"types",
")",
"{",
"return",
"new",
"ExactAny",
"(",
"Iterables",
".",
"transform",
"(",
"types",
",",
"GET_TYPE",
")",
")",
";",
"}"
] | Match types that are exactly equal to any of the given types. | [
"Match",
"types",
"that",
"are",
"exactly",
"equal",
"to",
"any",
"of",
"the",
"given",
"types",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/predicates/TypePredicates.java#L63-L65 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java | OkHttpClientFactory.createClient | public OkHttpClient createClient(boolean loggingEnabled, boolean tls12Enforced, int connectTimeout, int readTimeout, int writeTimeout) {
"""
This method creates an instance of OKHttpClient according to the provided parameters.
It is used internally and is not intended to be used directly.
@param loggingEnabled... | java | public OkHttpClient createClient(boolean loggingEnabled, boolean tls12Enforced, int connectTimeout, int readTimeout, int writeTimeout) {
return modifyClient(new OkHttpClient(), loggingEnabled, tls12Enforced, connectTimeout, readTimeout, writeTimeout);
} | [
"public",
"OkHttpClient",
"createClient",
"(",
"boolean",
"loggingEnabled",
",",
"boolean",
"tls12Enforced",
",",
"int",
"connectTimeout",
",",
"int",
"readTimeout",
",",
"int",
"writeTimeout",
")",
"{",
"return",
"modifyClient",
"(",
"new",
"OkHttpClient",
"(",
"... | This method creates an instance of OKHttpClient according to the provided parameters.
It is used internally and is not intended to be used directly.
@param loggingEnabled Enable logging in the created OkHttpClient.
@param tls12Enforced Enforce TLS 1.2 in the created OkHttpClient on devices with API 16-21
@param conne... | [
"This",
"method",
"creates",
"an",
"instance",
"of",
"OKHttpClient",
"according",
"to",
"the",
"provided",
"parameters",
".",
"It",
"is",
"used",
"internally",
"and",
"is",
"not",
"intended",
"to",
"be",
"used",
"directly",
"."
] | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/request/internal/OkHttpClientFactory.java#L43-L45 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java | GitFlowGraphMonitor.checkFilePath | private boolean checkFilePath(String file, int depth) {
"""
check whether the file has the proper naming and hierarchy
@param file the relative path from the repo root
@return false if the file does not conform
"""
// The file is either a node file or an edge file and needs to be stored at either:
//... | java | private boolean checkFilePath(String file, int depth) {
// The file is either a node file or an edge file and needs to be stored at either:
// flowGraphDir/nodeName/nodeName.properties (if it is a node file), or
// flowGraphDir/nodeName/nodeName/edgeName.properties (if it is an edge file)
Path filePath... | [
"private",
"boolean",
"checkFilePath",
"(",
"String",
"file",
",",
"int",
"depth",
")",
"{",
"// The file is either a node file or an edge file and needs to be stored at either:",
"// flowGraphDir/nodeName/nodeName.properties (if it is a node file), or",
"// flowGraphDir/nodeName/nodeName/... | check whether the file has the proper naming and hierarchy
@param file the relative path from the repo root
@return false if the file does not conform | [
"check",
"whether",
"the",
"file",
"has",
"the",
"proper",
"naming",
"and",
"hierarchy"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitFlowGraphMonitor.java#L271-L285 |
saxsys/SynchronizeFX | transmitter/tomcat-transmitter/src/main/java/de/saxsys/synchronizefx/tomcat/SynchronizeFXTomcatChannel.java | SynchronizeFXTomcatChannel.recivedMessage | void recivedMessage(final ByteBuffer message, final SynchronizeFXTomcatConnection sender) {
"""
Informs this {@link CommandTransferServer} that a client received a command.
@param message The message containing the received command.
@param sender The connection that received the message.
"""
if (LO... | java | void recivedMessage(final ByteBuffer message, final SynchronizeFXTomcatConnection sender) {
if (LOG.isTraceEnabled()) {
LOG.trace("Received a message in thread: id: " + Thread.currentThread().getName() + ", name: "
+ Thread.currentThread().getName());
}
List<Comma... | [
"void",
"recivedMessage",
"(",
"final",
"ByteBuffer",
"message",
",",
"final",
"SynchronizeFXTomcatConnection",
"sender",
")",
"{",
"if",
"(",
"LOG",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Received a message in thread: id: \"",
"+"... | Informs this {@link CommandTransferServer} that a client received a command.
@param message The message containing the received command.
@param sender The connection that received the message. | [
"Informs",
"this",
"{",
"@link",
"CommandTransferServer",
"}",
"that",
"a",
"client",
"received",
"a",
"command",
"."
] | train | https://github.com/saxsys/SynchronizeFX/blob/f3683020e4749110b38514eb5bc73a247998b579/transmitter/tomcat-transmitter/src/main/java/de/saxsys/synchronizefx/tomcat/SynchronizeFXTomcatChannel.java#L183-L203 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java | Item.withLong | public Item withLong(String attrName, long val) {
"""
Sets the value of the specified attribute in the current item to the
given value.
"""
checkInvalidAttrName(attrName);
return withNumber(attrName, Long.valueOf(val));
} | java | public Item withLong(String attrName, long val) {
checkInvalidAttrName(attrName);
return withNumber(attrName, Long.valueOf(val));
} | [
"public",
"Item",
"withLong",
"(",
"String",
"attrName",
",",
"long",
"val",
")",
"{",
"checkInvalidAttrName",
"(",
"attrName",
")",
";",
"return",
"withNumber",
"(",
"attrName",
",",
"Long",
".",
"valueOf",
"(",
"val",
")",
")",
";",
"}"
] | Sets the value of the specified attribute in the current item to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"in",
"the",
"current",
"item",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L332-L335 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/conversion/ConversionClient.java | ConversionClient.submitConversion | public void submitConversion(ConversionRequest.Type type,
String messageId,
boolean delivered,
Date timestamp) throws IOException, NexmoClientException {
"""
Submit a request to the Conversion API indicating whether ... | java | public void submitConversion(ConversionRequest.Type type,
String messageId,
boolean delivered,
Date timestamp) throws IOException, NexmoClientException {
this.conversionEndpoint.submitConversion(new ConversionRequ... | [
"public",
"void",
"submitConversion",
"(",
"ConversionRequest",
".",
"Type",
"type",
",",
"String",
"messageId",
",",
"boolean",
"delivered",
",",
"Date",
"timestamp",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"this",
".",
"conversionEndpoint",... | Submit a request to the Conversion API indicating whether or not a message was delivered.
@param type The {@link ConversionRequest.Type} type of com.nexmo.client.conversion.
@param messageId The id of the message that was sent.
@param delivered A boolean indicating whether or not it was delivered.
@param timestam... | [
"Submit",
"a",
"request",
"to",
"the",
"Conversion",
"API",
"indicating",
"whether",
"or",
"not",
"a",
"message",
"was",
"delivered",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/conversion/ConversionClient.java#L60-L65 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectComboBox.java | DistributionSetSelectComboBox.buildFilter | @Override
protected Filter buildFilter(final String filterString, final FilteringMode filteringMode) {
"""
Overriden not to update the filter when the filterstring (value of
combobox input) was not changed. Otherwise, it would lead to additional
database requests during combobox page change while scrolling i... | java | @Override
protected Filter buildFilter(final String filterString, final FilteringMode filteringMode) {
if (filterStringIsNotChanged(filterString)) {
return null;
}
final Filter filter = super.buildFilter(filterString, filteringMode);
refreshContainerIfFilterStringBecome... | [
"@",
"Override",
"protected",
"Filter",
"buildFilter",
"(",
"final",
"String",
"filterString",
",",
"final",
"FilteringMode",
"filteringMode",
")",
"{",
"if",
"(",
"filterStringIsNotChanged",
"(",
"filterString",
")",
")",
"{",
"return",
"null",
";",
"}",
"final... | Overriden not to update the filter when the filterstring (value of
combobox input) was not changed. Otherwise, it would lead to additional
database requests during combobox page change while scrolling instead of
retreiving items from container cache.
@param filterString
value of combobox input
@param filteringMode
the... | [
"Overriden",
"not",
"to",
"update",
"the",
"filter",
"when",
"the",
"filterstring",
"(",
"value",
"of",
"combobox",
"input",
")",
"was",
"not",
"changed",
".",
"Otherwise",
"it",
"would",
"lead",
"to",
"additional",
"database",
"requests",
"during",
"combobox"... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectComboBox.java#L277-L289 |
outbrain/ob1k | ob1k-cache/src/main/java/com/outbrain/ob1k/cache/memcache/folsom/MemcachedClientBuilder.java | MemcachedClientBuilder.newMessagePackClient | public static <T> MemcachedClientBuilder<T> newMessagePackClient(final Type valueType) {
"""
Create a client builder for MessagePack values.
@return The builder
"""
return newMessagePackClient(DefaultMessagePackHolder.INSTANCE, valueType);
} | java | public static <T> MemcachedClientBuilder<T> newMessagePackClient(final Type valueType) {
return newMessagePackClient(DefaultMessagePackHolder.INSTANCE, valueType);
} | [
"public",
"static",
"<",
"T",
">",
"MemcachedClientBuilder",
"<",
"T",
">",
"newMessagePackClient",
"(",
"final",
"Type",
"valueType",
")",
"{",
"return",
"newMessagePackClient",
"(",
"DefaultMessagePackHolder",
".",
"INSTANCE",
",",
"valueType",
")",
";",
"}"
] | Create a client builder for MessagePack values.
@return The builder | [
"Create",
"a",
"client",
"builder",
"for",
"MessagePack",
"values",
"."
] | train | https://github.com/outbrain/ob1k/blob/9e43ab39230c5787065053da0f766d822d0fe4e7/ob1k-cache/src/main/java/com/outbrain/ob1k/cache/memcache/folsom/MemcachedClientBuilder.java#L72-L74 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java | FlowControllerFactory.getPageFlowForPath | public PageFlowController getPageFlowForPath( RequestContext context, String path )
throws InstantiationException, IllegalAccessException {
"""
Get the page flow instance that should be associated with the given path. If it doesn't exist, create it.
If one is created, the page flow stack (for nesting) wi... | java | public PageFlowController getPageFlowForPath( RequestContext context, String path )
throws InstantiationException, IllegalAccessException
{
HttpServletRequest request = context.getHttpRequest();
HttpServletResponse response = context.getHttpResponse();
PageFlowController cur = PageFl... | [
"public",
"PageFlowController",
"getPageFlowForPath",
"(",
"RequestContext",
"context",
",",
"String",
"path",
")",
"throws",
"InstantiationException",
",",
"IllegalAccessException",
"{",
"HttpServletRequest",
"request",
"=",
"context",
".",
"getHttpRequest",
"(",
")",
... | Get the page flow instance that should be associated with the given path. If it doesn't exist, create it.
If one is created, the page flow stack (for nesting) will be cleared or pushed, and the new instance will be
stored as the current page flow.
@param context a {@link RequestContext} object which contains the curr... | [
"Get",
"the",
"page",
"flow",
"instance",
"that",
"should",
"be",
"associated",
"with",
"the",
"given",
"path",
".",
"If",
"it",
"doesn",
"t",
"exist",
"create",
"it",
".",
"If",
"one",
"is",
"created",
"the",
"page",
"flow",
"stack",
"(",
"for",
"nest... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/FlowControllerFactory.java#L139-L175 |
DV8FromTheWorld/JDA | src/main/java/com/iwebpp/crypto/TweetNaclFast.java | Box.after | public byte [] after(byte [] message, final int moff, final int mlen, byte [] theNonce) {
"""
/*
@description
Same as nacl.box, but uses a shared key precomputed with nacl.box.before,
and passes a nonce explicitly.
"""
// check message
if (!(message!=null && message.length>=(moff+mle... | java | public byte [] after(byte [] message, final int moff, final int mlen, byte [] theNonce) {
// check message
if (!(message!=null && message.length>=(moff+mlen) &&
theNonce!=null && theNonce.length==nonceLength))
return null;
// message buffer
... | [
"public",
"byte",
"[",
"]",
"after",
"(",
"byte",
"[",
"]",
"message",
",",
"final",
"int",
"moff",
",",
"final",
"int",
"mlen",
",",
"byte",
"[",
"]",
"theNonce",
")",
"{",
"// check message",
"if",
"(",
"!",
"(",
"message",
"!=",
"null",
"&&",
"m... | /*
@description
Same as nacl.box, but uses a shared key precomputed with nacl.box.before,
and passes a nonce explicitly. | [
"/",
"*"
] | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/com/iwebpp/crypto/TweetNaclFast.java#L238-L264 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java | XMLParser.getProperty | public String getProperty(String strProperty, String strParams) {
"""
Get this property.
First, see if it's in the param tag, then work your way up the hierarchy.
"""
String strValue = null;
strValue = this.parseArg(strProperty, strParams);
if (strValue == null)
strValue = ... | java | public String getProperty(String strProperty, String strParams)
{
String strValue = null;
strValue = this.parseArg(strProperty, strParams);
if (strValue == null)
strValue = this.getRecordOwner().getProperty(strProperty);
return strValue;
} | [
"public",
"String",
"getProperty",
"(",
"String",
"strProperty",
",",
"String",
"strParams",
")",
"{",
"String",
"strValue",
"=",
"null",
";",
"strValue",
"=",
"this",
".",
"parseArg",
"(",
"strProperty",
",",
"strParams",
")",
";",
"if",
"(",
"strValue",
... | Get this property.
First, see if it's in the param tag, then work your way up the hierarchy. | [
"Get",
"this",
"property",
".",
"First",
"see",
"if",
"it",
"s",
"in",
"the",
"param",
"tag",
"then",
"work",
"your",
"way",
"up",
"the",
"hierarchy",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/report/parser/XMLParser.java#L206-L213 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java | SeaGlassTabbedPaneUI.paintTab | protected void paintTab(SeaGlassContext ss, Graphics g, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) {
"""
Paint a tab.
@param ss the SynthContext.
@param g the Graphics context.
@param rects the array containing the bounds for the tabs.
@param tabIndex the tab ind... | java | protected void paintTab(SeaGlassContext ss, Graphics g, Rectangle[] rects, int tabIndex, Rectangle iconRect, Rectangle textRect) {
Rectangle tabRect = rects[tabIndex];
int selectedIndex = tabPane.getSelectedIndex();
boolean isSelected = selectedIndex == tabIndex;
JCom... | [
"protected",
"void",
"paintTab",
"(",
"SeaGlassContext",
"ss",
",",
"Graphics",
"g",
",",
"Rectangle",
"[",
"]",
"rects",
",",
"int",
"tabIndex",
",",
"Rectangle",
"iconRect",
",",
"Rectangle",
"textRect",
")",
"{",
"Rectangle",
"tabRect",
"=",
"rects",
"[",... | Paint a tab.
@param ss the SynthContext.
@param g the Graphics context.
@param rects the array containing the bounds for the tabs.
@param tabIndex the tab index to paint.
@param iconRect the bounds in which to paint the tab icon, if any.
@param textRect the bounds in which to paint the tab text, if any... | [
"Paint",
"a",
"tab",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/ui/SeaGlassTabbedPaneUI.java#L716-L763 |
Activiti/Activiti | activiti-engine/src/main/java/org/activiti/engine/impl/history/DefaultHistoryManager.java | DefaultHistoryManager.createIdentityLinkComment | @Override
public void createIdentityLinkComment(String taskId, String userId, String groupId, String type, boolean create) {
"""
/*
(non-Javadoc)
@see org.activiti.engine.impl.history.HistoryManagerInterface# createIdentityLinkComment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, bo... | java | @Override
public void createIdentityLinkComment(String taskId, String userId, String groupId, String type, boolean create) {
createIdentityLinkComment(taskId, userId, groupId, type, create, false);
} | [
"@",
"Override",
"public",
"void",
"createIdentityLinkComment",
"(",
"String",
"taskId",
",",
"String",
"userId",
",",
"String",
"groupId",
",",
"String",
"type",
",",
"boolean",
"create",
")",
"{",
"createIdentityLinkComment",
"(",
"taskId",
",",
"userId",
",",... | /*
(non-Javadoc)
@see org.activiti.engine.impl.history.HistoryManagerInterface# createIdentityLinkComment(java.lang.String, java.lang.String, java.lang.String, java.lang.String, boolean) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/Activiti/Activiti/blob/82e2b2cd2083b2f734ca0efc7815389c0f2517d9/activiti-engine/src/main/java/org/activiti/engine/impl/history/DefaultHistoryManager.java#L688-L691 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java | StringUtils.applyRelativePath | public static String applyRelativePath(final String path, final String relativePath) {
"""
Apply the given relative path to the given Java resource path, assuming standard Java folder
separation (i.e. "/" separators).
@param path the path to start from (usually a full file path)
@param relativePath the relati... | java | public static String applyRelativePath(final String path, final String relativePath) {
final int separatorIndex = path.lastIndexOf(StringUtils.FOLDER_SEPARATOR);
if (separatorIndex != -1) {
String newPath = path.substring(0, separatorIndex);
if (!relativePath.startsWith(StringUtils.FOLDER_SEPARATOR)... | [
"public",
"static",
"String",
"applyRelativePath",
"(",
"final",
"String",
"path",
",",
"final",
"String",
"relativePath",
")",
"{",
"final",
"int",
"separatorIndex",
"=",
"path",
".",
"lastIndexOf",
"(",
"StringUtils",
".",
"FOLDER_SEPARATOR",
")",
";",
"if",
... | Apply the given relative path to the given Java resource path, assuming standard Java folder
separation (i.e. "/" separators).
@param path the path to start from (usually a full file path)
@param relativePath the relative path to apply (relative to the full file path above)
@return the full file path that results from... | [
"Apply",
"the",
"given",
"relative",
"path",
"to",
"the",
"given",
"Java",
"resource",
"path",
"assuming",
"standard",
"Java",
"folder",
"separation",
"(",
"i",
".",
"e",
".",
"/",
"separators",
")",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java#L649-L660 |
ZenHarbinger/l2fprod-properties-editor | src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java | PropertySheetTableModel.addPropertiesToModel | private void addPropertiesToModel(List<Property> localProperties, Item parent) {
"""
Add the specified properties to the model using the specified parent.
@param localProperties the properties to add to the end of the model
@param parent the {@link Item} parent of these properties, null if none
"""
... | java | private void addPropertiesToModel(List<Property> localProperties, Item parent) {
for (Property property : localProperties) {
Item propertyItem = new Item(property, parent);
model.add(propertyItem);
// add any sub-properties
Property[] subProperties = property.get... | [
"private",
"void",
"addPropertiesToModel",
"(",
"List",
"<",
"Property",
">",
"localProperties",
",",
"Item",
"parent",
")",
"{",
"for",
"(",
"Property",
"property",
":",
"localProperties",
")",
"{",
"Item",
"propertyItem",
"=",
"new",
"Item",
"(",
"property",... | Add the specified properties to the model using the specified parent.
@param localProperties the properties to add to the end of the model
@param parent the {@link Item} parent of these properties, null if none | [
"Add",
"the",
"specified",
"properties",
"to",
"the",
"model",
"using",
"the",
"specified",
"parent",
"."
] | train | https://github.com/ZenHarbinger/l2fprod-properties-editor/blob/d9b15c3f0b6ac1d9a2a9d315be073d2a4a419c32/src/main/java/com/l2fprod/common/propertysheet/PropertySheetTableModel.java#L516-L527 |
marvinlabs/android-intents | library/src/main/java/com/marvinlabs/intents/PhoneIntents.java | PhoneIntents.newDialNumberIntent | public static Intent newDialNumberIntent(String phoneNumber) {
"""
Creates an intent that will open the phone app and enter the given number. Unlike
{@link #newCallNumberIntent(String)}, this does not actually dispatch the call, so it gives the user a chance to
review and edit the number.
@param phoneNumber t... | java | public static Intent newDialNumberIntent(String phoneNumber) {
final Intent intent;
if (phoneNumber == null || phoneNumber.trim().length() <= 0) {
intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"));
} else {
intent = new Intent(Intent.ACTION_DIAL, Uri.parse("tel:"... | [
"public",
"static",
"Intent",
"newDialNumberIntent",
"(",
"String",
"phoneNumber",
")",
"{",
"final",
"Intent",
"intent",
";",
"if",
"(",
"phoneNumber",
"==",
"null",
"||",
"phoneNumber",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
"<=",
"0",
")",
"{... | Creates an intent that will open the phone app and enter the given number. Unlike
{@link #newCallNumberIntent(String)}, this does not actually dispatch the call, so it gives the user a chance to
review and edit the number.
@param phoneNumber the number to dial
@return the intent | [
"Creates",
"an",
"intent",
"that",
"will",
"open",
"the",
"phone",
"app",
"and",
"enter",
"the",
"given",
"number",
".",
"Unlike",
"{",
"@link",
"#newCallNumberIntent",
"(",
"String",
")",
"}",
"this",
"does",
"not",
"actually",
"dispatch",
"the",
"call",
... | train | https://github.com/marvinlabs/android-intents/blob/33e79c825188b6a97601869522533cc825801f6e/library/src/main/java/com/marvinlabs/intents/PhoneIntents.java#L125-L133 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/TypeCache.java | TypeCache.findOrInsert | public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy, Object monitor) {
"""
Finds an existing type or inserts a new one if the previous type was not found.
@param classLoader The class loader for which this type is stored.
@param key The key for the type in question.
@p... | java | public Class<?> findOrInsert(ClassLoader classLoader, T key, Callable<Class<?>> lazy, Object monitor) {
Class<?> type = find(classLoader, key);
if (type != null) {
return type;
} else {
synchronized (monitor) {
return findOrInsert(classLoader, key, lazy);
... | [
"public",
"Class",
"<",
"?",
">",
"findOrInsert",
"(",
"ClassLoader",
"classLoader",
",",
"T",
"key",
",",
"Callable",
"<",
"Class",
"<",
"?",
">",
">",
"lazy",
",",
"Object",
"monitor",
")",
"{",
"Class",
"<",
"?",
">",
"type",
"=",
"find",
"(",
"... | Finds an existing type or inserts a new one if the previous type was not found.
@param classLoader The class loader for which this type is stored.
@param key The key for the type in question.
@param lazy A lazy creator for the type to insert of no previous type was stored in the cache.
@param monitor ... | [
"Finds",
"an",
"existing",
"type",
"or",
"inserts",
"a",
"new",
"one",
"if",
"the",
"previous",
"type",
"was",
"not",
"found",
"."
] | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/TypeCache.java#L168-L177 |
vvakame/JsonPullParser | jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonHash.java | JsonHash.fromParser | public static JsonHash fromParser(JsonPullParser parser) throws IOException,
JsonFormatException {
"""
Parses the given JSON data as a hash.
@param parser {@link JsonPullParser} with some JSON-formatted data
@return {@link JsonHash}
@throws IOException
@throws JsonFormatException
@author vvakame
"""
... | java | public static JsonHash fromParser(JsonPullParser parser) throws IOException,
JsonFormatException {
State state = parser.getEventType();
if (state == State.VALUE_NULL) {
return null;
} else if (state != State.START_HASH) {
throw new JsonFormatException("unexpected token. token=" + state, parser);
}
... | [
"public",
"static",
"JsonHash",
"fromParser",
"(",
"JsonPullParser",
"parser",
")",
"throws",
"IOException",
",",
"JsonFormatException",
"{",
"State",
"state",
"=",
"parser",
".",
"getEventType",
"(",
")",
";",
"if",
"(",
"state",
"==",
"State",
".",
"VALUE_NU... | Parses the given JSON data as a hash.
@param parser {@link JsonPullParser} with some JSON-formatted data
@return {@link JsonHash}
@throws IOException
@throws JsonFormatException
@author vvakame | [
"Parses",
"the",
"given",
"JSON",
"data",
"as",
"a",
"hash",
"."
] | train | https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/util/JsonHash.java#L63-L86 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java | KeyUtils.addMBeanIdentifier | private static void addMBeanIdentifier(Query query, Result result, StringBuilder sb) {
"""
Adds a key to the StringBuilder
It uses in order of preference:
1. resultAlias if that was specified as part of the query
2. The domain portion of the ObjectName in the query if useObjDomainAsKey is set to true
3. el... | java | private static void addMBeanIdentifier(Query query, Result result, StringBuilder sb) {
if (result.getKeyAlias() != null) {
sb.append(result.getKeyAlias());
} else if (query.isUseObjDomainAsKey()) {
sb.append(StringUtils.cleanupStr(result.getObjDomain(), query.isAllowDottedKeys()));
} else {
sb.append(Str... | [
"private",
"static",
"void",
"addMBeanIdentifier",
"(",
"Query",
"query",
",",
"Result",
"result",
",",
"StringBuilder",
"sb",
")",
"{",
"if",
"(",
"result",
".",
"getKeyAlias",
"(",
")",
"!=",
"null",
")",
"{",
"sb",
".",
"append",
"(",
"result",
".",
... | Adds a key to the StringBuilder
It uses in order of preference:
1. resultAlias if that was specified as part of the query
2. The domain portion of the ObjectName in the query if useObjDomainAsKey is set to true
3. else, the Class Name of the MBean. I.e. ClassName will be used by default if the
user doesn't specify an... | [
"Adds",
"a",
"key",
"to",
"the",
"StringBuilder"
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/naming/KeyUtils.java#L127-L135 |
looly/hutool | hutool-http/src/main/java/cn/hutool/http/HttpRequest.java | HttpRequest.appendPart | private void appendPart(String formFieldName, Resource resource, OutputStream out) {
"""
添加Multipart表单的数据项
@param formFieldName 表单名
@param resource 资源,可以是文件等
@param out Http流
@since 4.1.0
"""
if (resource instanceof MultiResource) {
// 多资源
for (Resource subResource : (MultiResource) resource) ... | java | private void appendPart(String formFieldName, Resource resource, OutputStream out) {
if (resource instanceof MultiResource) {
// 多资源
for (Resource subResource : (MultiResource) resource) {
appendPart(formFieldName, subResource, out);
}
} else {
// 普通资源
final StringBuilder builder = StrUti... | [
"private",
"void",
"appendPart",
"(",
"String",
"formFieldName",
",",
"Resource",
"resource",
",",
"OutputStream",
"out",
")",
"{",
"if",
"(",
"resource",
"instanceof",
"MultiResource",
")",
"{",
"// 多资源\r",
"for",
"(",
"Resource",
"subResource",
":",
"(",
"Mu... | 添加Multipart表单的数据项
@param formFieldName 表单名
@param resource 资源,可以是文件等
@param out Http流
@since 4.1.0 | [
"添加Multipart表单的数据项"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-http/src/main/java/cn/hutool/http/HttpRequest.java#L1075-L1098 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/TabularDataExtractor.java | TabularDataExtractor.convertToMaps | private Object convertToMaps(TabularData pTd, Stack<String> pExtraArgs, ObjectToJsonConverter pConverter) throws AttributeNotFoundException {
"""
Convert tabular data to (nested) maps. Path access is allowed here
"""
JSONObject ret = new JSONObject();
TabularType type = pTd.getTabularType();
... | java | private Object convertToMaps(TabularData pTd, Stack<String> pExtraArgs, ObjectToJsonConverter pConverter) throws AttributeNotFoundException {
JSONObject ret = new JSONObject();
TabularType type = pTd.getTabularType();
List<String> indexNames = type.getIndexNames();
boolean found = false... | [
"private",
"Object",
"convertToMaps",
"(",
"TabularData",
"pTd",
",",
"Stack",
"<",
"String",
">",
"pExtraArgs",
",",
"ObjectToJsonConverter",
"pConverter",
")",
"throws",
"AttributeNotFoundException",
"{",
"JSONObject",
"ret",
"=",
"new",
"JSONObject",
"(",
")",
... | Convert tabular data to (nested) maps. Path access is allowed here | [
"Convert",
"tabular",
"data",
"to",
"(",
"nested",
")",
"maps",
".",
"Path",
"access",
"is",
"allowed",
"here"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/TabularDataExtractor.java#L176-L205 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java | DateFormat.getDateInstance | public final static DateFormat getDateInstance(int style,
Locale aLocale) {
"""
Returns the date formatter with the given formatting style
for the given locale.
@param style the given formatting style. For example,
SHORT for "M/d/yy" in the US locale. As currentl... | java | public final static DateFormat getDateInstance(int style,
Locale aLocale)
{
return get(style, -1, ULocale.forLocale(aLocale), null);
} | [
"public",
"final",
"static",
"DateFormat",
"getDateInstance",
"(",
"int",
"style",
",",
"Locale",
"aLocale",
")",
"{",
"return",
"get",
"(",
"style",
",",
"-",
"1",
",",
"ULocale",
".",
"forLocale",
"(",
"aLocale",
")",
",",
"null",
")",
";",
"}"
] | Returns the date formatter with the given formatting style
for the given locale.
@param style the given formatting style. For example,
SHORT for "M/d/yy" in the US locale. As currently implemented, relative date
formatting only affects a limited range of calendar days before or after the
current date, based on the CLDR... | [
"Returns",
"the",
"date",
"formatter",
"with",
"the",
"given",
"formatting",
"style",
"for",
"the",
"given",
"locale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateFormat.java#L1316-L1320 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java | PythonDistributionAnalyzer.collectWheelMetadata | private static void collectWheelMetadata(Dependency dependency, File file) {
"""
Gathers evidence from the METADATA file.
@param dependency the dependency being analyzed
@param file a reference to the manifest/properties file
"""
final InternetHeaders headers = getManifestProperties(file);
... | java | private static void collectWheelMetadata(Dependency dependency, File file) {
final InternetHeaders headers = getManifestProperties(file);
addPropertyToEvidence(dependency, EvidenceType.VERSION, Confidence.HIGHEST, headers, "Version");
addPropertyToEvidence(dependency, EvidenceType.PRODUCT, Confi... | [
"private",
"static",
"void",
"collectWheelMetadata",
"(",
"Dependency",
"dependency",
",",
"File",
"file",
")",
"{",
"final",
"InternetHeaders",
"headers",
"=",
"getManifestProperties",
"(",
"file",
")",
";",
"addPropertyToEvidence",
"(",
"dependency",
",",
"Evidenc... | Gathers evidence from the METADATA file.
@param dependency the dependency being analyzed
@param file a reference to the manifest/properties file | [
"Gathers",
"evidence",
"from",
"the",
"METADATA",
"file",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/PythonDistributionAnalyzer.java#L292-L326 |
meertensinstituut/mtas | src/main/java/mtas/solr/handler/util/MtasSolrStatus.java | MtasSolrStatus.getInteger | private final Integer getInteger(NamedList<Object> response, String... args) {
"""
Gets the integer.
@param response
the response
@param args
the args
@return the integer
"""
Object objectItem = response.findRecursive(args);
if (objectItem != null && objectItem instanceof Integer) {
return... | java | private final Integer getInteger(NamedList<Object> response, String... args) {
Object objectItem = response.findRecursive(args);
if (objectItem != null && objectItem instanceof Integer) {
return (Integer) objectItem;
} else {
return null;
}
} | [
"private",
"final",
"Integer",
"getInteger",
"(",
"NamedList",
"<",
"Object",
">",
"response",
",",
"String",
"...",
"args",
")",
"{",
"Object",
"objectItem",
"=",
"response",
".",
"findRecursive",
"(",
"args",
")",
";",
"if",
"(",
"objectItem",
"!=",
"nul... | Gets the integer.
@param response
the response
@param args
the args
@return the integer | [
"Gets",
"the",
"integer",
"."
] | train | https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/solr/handler/util/MtasSolrStatus.java#L552-L559 |
IanGClifton/AndroidFloatLabel | FloatLabel/src/com/iangclifton/android/floatlabel/FloatLabel.java | FloatLabel.setTextWithoutAnimation | public void setTextWithoutAnimation(CharSequence text, TextView.BufferType type) {
"""
Sets the EditText's text without animating the label
@param text CharSequence to set
@param type TextView.BufferType
"""
mSkipAnimation = true;
mEditText.setText(text, type);
} | java | public void setTextWithoutAnimation(CharSequence text, TextView.BufferType type) {
mSkipAnimation = true;
mEditText.setText(text, type);
} | [
"public",
"void",
"setTextWithoutAnimation",
"(",
"CharSequence",
"text",
",",
"TextView",
".",
"BufferType",
"type",
")",
"{",
"mSkipAnimation",
"=",
"true",
";",
"mEditText",
".",
"setText",
"(",
"text",
",",
"type",
")",
";",
"}"
] | Sets the EditText's text without animating the label
@param text CharSequence to set
@param type TextView.BufferType | [
"Sets",
"the",
"EditText",
"s",
"text",
"without",
"animating",
"the",
"label"
] | train | https://github.com/IanGClifton/AndroidFloatLabel/blob/b0a39c26f010f17d5f3648331e9784a41e025c0d/FloatLabel/src/com/iangclifton/android/floatlabel/FloatLabel.java#L323-L326 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java | EditUtilities.getVertexToSnap | public static GeometryLocation getVertexToSnap(Geometry g, Point p, double tolerance) {
"""
Gets the coordinate of a Geometry that is the nearest of a given Point,
with a distance tolerance.
@param g
@param p
@param tolerance
@return
"""
DistanceOp distanceOp = new DistanceOp(g, p);
Geom... | java | public static GeometryLocation getVertexToSnap(Geometry g, Point p, double tolerance) {
DistanceOp distanceOp = new DistanceOp(g, p);
GeometryLocation snapedPoint = distanceOp.nearestLocations()[0];
if (tolerance == 0 || snapedPoint.getCoordinate().distance(p.getCoordinate()) <= tolerance) {
... | [
"public",
"static",
"GeometryLocation",
"getVertexToSnap",
"(",
"Geometry",
"g",
",",
"Point",
"p",
",",
"double",
"tolerance",
")",
"{",
"DistanceOp",
"distanceOp",
"=",
"new",
"DistanceOp",
"(",
"g",
",",
"p",
")",
";",
"GeometryLocation",
"snapedPoint",
"="... | Gets the coordinate of a Geometry that is the nearest of a given Point,
with a distance tolerance.
@param g
@param p
@param tolerance
@return | [
"Gets",
"the",
"coordinate",
"of",
"a",
"Geometry",
"that",
"is",
"the",
"nearest",
"of",
"a",
"given",
"Point",
"with",
"a",
"distance",
"tolerance",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/edit/EditUtilities.java#L44-L52 |
shrinkwrap/descriptors | metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/xslt/XsltTransformer.java | XsltTransformer.applyParameters | private static void applyParameters(final Transformer transformer, final Map<String, String> parameters) {
"""
Applies all key/value pairs as defined by the given <code>Map</code> to the given <code>Transformer</code>
instance.
@param transformer
@param parameters
"""
final Set<String> keys = para... | java | private static void applyParameters(final Transformer transformer, final Map<String, String> parameters) {
final Set<String> keys = parameters.keySet();
for (Iterator<String> iterator = keys.iterator(); iterator.hasNext();) {
final String key = iterator.next();
transformer.setPar... | [
"private",
"static",
"void",
"applyParameters",
"(",
"final",
"Transformer",
"transformer",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"keys",
"=",
"parameters",
".",
"keySet",
"(",
"... | Applies all key/value pairs as defined by the given <code>Map</code> to the given <code>Transformer</code>
instance.
@param transformer
@param parameters | [
"Applies",
"all",
"key",
"/",
"value",
"pairs",
"as",
"defined",
"by",
"the",
"given",
"<code",
">",
"Map<",
"/",
"code",
">",
"to",
"the",
"given",
"<code",
">",
"Transformer<",
"/",
"code",
">",
"instance",
"."
] | train | https://github.com/shrinkwrap/descriptors/blob/023ba080e6396b9f4dd8275dc4e5c0ebb6b5e6ba/metadata-parser/src/main/java/org/jboss/shrinkwrap/descriptor/metadata/xslt/XsltTransformer.java#L109-L115 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.newHTML | public static HTML newHTML (String text, String... styles) {
"""
Creates a new HTML element with the specified contents and style.
"""
return setStyleNames(new HTML(text), styles);
} | java | public static HTML newHTML (String text, String... styles)
{
return setStyleNames(new HTML(text), styles);
} | [
"public",
"static",
"HTML",
"newHTML",
"(",
"String",
"text",
",",
"String",
"...",
"styles",
")",
"{",
"return",
"setStyleNames",
"(",
"new",
"HTML",
"(",
"text",
")",
",",
"styles",
")",
";",
"}"
] | Creates a new HTML element with the specified contents and style. | [
"Creates",
"a",
"new",
"HTML",
"element",
"with",
"the",
"specified",
"contents",
"and",
"style",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L255-L258 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java | SASLMechanism.challengeReceived | public final void challengeReceived(String challengeString, boolean finalChallenge) throws SmackSaslException, InterruptedException, NotConnectedException {
"""
The server is challenging the SASL mechanism for the stanza he just sent. Send a
response to the server's challenge.
@param challengeString a base64 e... | java | public final void challengeReceived(String challengeString, boolean finalChallenge) throws SmackSaslException, InterruptedException, NotConnectedException {
byte[] challenge = Base64.decode((challengeString != null && challengeString.equals("=")) ? "" : challengeString);
byte[] response = evaluateChalle... | [
"public",
"final",
"void",
"challengeReceived",
"(",
"String",
"challengeString",
",",
"boolean",
"finalChallenge",
")",
"throws",
"SmackSaslException",
",",
"InterruptedException",
",",
"NotConnectedException",
"{",
"byte",
"[",
"]",
"challenge",
"=",
"Base64",
".",
... | The server is challenging the SASL mechanism for the stanza he just sent. Send a
response to the server's challenge.
@param challengeString a base64 encoded string representing the challenge.
@param finalChallenge true if this is the last challenge send by the server within the success stanza
@throws SmackSaslExceptio... | [
"The",
"server",
"is",
"challenging",
"the",
"SASL",
"mechanism",
"for",
"the",
"stanza",
"he",
"just",
"sent",
".",
"Send",
"a",
"response",
"to",
"the",
"server",
"s",
"challenge",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/sasl/SASLMechanism.java#L227-L244 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java | FailoverGroupsInner.beginForceFailoverAllowDataLoss | public FailoverGroupInner beginForceFailoverAllowDataLoss(String resourceGroupName, String serverName, String failoverGroupName) {
"""
Fails over from the current primary server to this server. This operation might result in data loss.
@param resourceGroupName The name of the resource group that contains the re... | java | public FailoverGroupInner beginForceFailoverAllowDataLoss(String resourceGroupName, String serverName, String failoverGroupName) {
return beginForceFailoverAllowDataLossWithServiceResponseAsync(resourceGroupName, serverName, failoverGroupName).toBlocking().single().body();
} | [
"public",
"FailoverGroupInner",
"beginForceFailoverAllowDataLoss",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"failoverGroupName",
")",
"{",
"return",
"beginForceFailoverAllowDataLossWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
... | Fails over from the current primary server to this server. This operation might result in data loss.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server containing the f... | [
"Fails",
"over",
"from",
"the",
"current",
"primary",
"server",
"to",
"this",
"server",
".",
"This",
"operation",
"might",
"result",
"in",
"data",
"loss",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/FailoverGroupsInner.java#L1136-L1138 |
carewebframework/carewebframework-vista | org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/BrokerSession.java | BrokerSession.onRPCComplete | protected void onRPCComplete(int asyncHandle, String data) {
"""
Invokes the callback for the specified handle upon successful completion of an asynchronous
RPC call.
@param asyncHandle The unique handle for the asynchronous RPC call.
@param data The data returned by the RPC.
"""
IAsyncRPCEvent ca... | java | protected void onRPCComplete(int asyncHandle, String data) {
IAsyncRPCEvent callback = getCallback(asyncHandle);
if (callback != null) {
callback.onRPCComplete(asyncHandle, data);
}
} | [
"protected",
"void",
"onRPCComplete",
"(",
"int",
"asyncHandle",
",",
"String",
"data",
")",
"{",
"IAsyncRPCEvent",
"callback",
"=",
"getCallback",
"(",
"asyncHandle",
")",
";",
"if",
"(",
"callback",
"!=",
"null",
")",
"{",
"callback",
".",
"onRPCComplete",
... | Invokes the callback for the specified handle upon successful completion of an asynchronous
RPC call.
@param asyncHandle The unique handle for the asynchronous RPC call.
@param data The data returned by the RPC. | [
"Invokes",
"the",
"callback",
"for",
"the",
"specified",
"handle",
"upon",
"successful",
"completion",
"of",
"an",
"asynchronous",
"RPC",
"call",
"."
] | train | https://github.com/carewebframework/carewebframework-vista/blob/883b2cbe395d9e8a21cd19db820f0876bda6b1c6/org.carewebframework.vista.mbroker/src/main/java/org/carewebframework/vista/mbroker/BrokerSession.java#L681-L687 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java | JobAgentsInner.beginCreateOrUpdateAsync | public Observable<JobAgentInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String jobAgentName, JobAgentInner parameters) {
"""
Creates or updates a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure... | java | public Observable<JobAgentInner> beginCreateOrUpdateAsync(String resourceGroupName, String serverName, String jobAgentName, JobAgentInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, parameters).map(new Func1<ServiceResponse<JobAgentInner>, JobAge... | [
"public",
"Observable",
"<",
"JobAgentInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"jobAgentName",
",",
"JobAgentInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsyn... | Creates or updates a job agent.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent to be created or updated.
@param param... | [
"Creates",
"or",
"updates",
"a",
"job",
"agent",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobAgentsInner.java#L446-L453 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java | DatabaseImpl.deleteLocalDocument | public void deleteLocalDocument(final String docId) throws DocumentNotFoundException {
"""
<p>Deletes a local document.</p>
@param docId documentId of the document to be deleted
@throws DocumentNotFoundException if the document ID doesn't exist
"""
Misc.checkState(this.isOpen(), "Database is clos... | java | public void deleteLocalDocument(final String docId) throws DocumentNotFoundException {
Misc.checkState(this.isOpen(), "Database is closed");
Misc.checkNotNullOrEmpty(docId, "Input document id");
try {
get(queue.submit(new DeleteLocalDocumentCallable(docId)));
} catch (Execut... | [
"public",
"void",
"deleteLocalDocument",
"(",
"final",
"String",
"docId",
")",
"throws",
"DocumentNotFoundException",
"{",
"Misc",
".",
"checkState",
"(",
"this",
".",
"isOpen",
"(",
")",
",",
"\"Database is closed\"",
")",
";",
"Misc",
".",
"checkNotNullOrEmpty",... | <p>Deletes a local document.</p>
@param docId documentId of the document to be deleted
@throws DocumentNotFoundException if the document ID doesn't exist | [
"<p",
">",
"Deletes",
"a",
"local",
"document",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/documentstore/DatabaseImpl.java#L473-L483 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.readX509Certificate | public static Certificate readX509Certificate(InputStream in, char[] password, String alias) {
"""
读取X.509 Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
... | java | public static Certificate readX509Certificate(InputStream in, char[] password, String alias) {
return KeyUtil.readX509Certificate(in, password, alias);
} | [
"public",
"static",
"Certificate",
"readX509Certificate",
"(",
"InputStream",
"in",
",",
"char",
"[",
"]",
"password",
",",
"String",
"alias",
")",
"{",
"return",
"KeyUtil",
".",
"readX509Certificate",
"(",
"in",
",",
"password",
",",
"alias",
")",
";",
"}"
... | 读取X.509 Certification文件<br>
Certification为证书文件<br>
see: http://snowolf.iteye.com/blog/391931
@param in {@link InputStream} 如果想从文件读取.cer文件,使用 {@link FileUtil#getInputStream(java.io.File)} 读取
@param password 密码
@param alias 别名
@return {@link KeyStore}
@since 4.4.1 | [
"读取X",
".",
"509",
"Certification文件<br",
">",
"Certification为证书文件<br",
">",
"see",
":",
"http",
":",
"//",
"snowolf",
".",
"iteye",
".",
"com",
"/",
"blog",
"/",
"391931"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L335-L337 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWComponent.java | AbstractWComponent.createErrorDiagnostic | protected Diagnostic createErrorDiagnostic(final WComponent source, final String message,
final Serializable... args) {
"""
Create and return an error diagnostic associated to the given error source.
@param source the source of the error.
@param message the error message, using {@link MessageFormat} syntax.... | java | protected Diagnostic createErrorDiagnostic(final WComponent source, final String message,
final Serializable... args) {
return new DiagnosticImpl(Diagnostic.ERROR, source, message, args);
} | [
"protected",
"Diagnostic",
"createErrorDiagnostic",
"(",
"final",
"WComponent",
"source",
",",
"final",
"String",
"message",
",",
"final",
"Serializable",
"...",
"args",
")",
"{",
"return",
"new",
"DiagnosticImpl",
"(",
"Diagnostic",
".",
"ERROR",
",",
"source",
... | Create and return an error diagnostic associated to the given error source.
@param source the source of the error.
@param message the error message, using {@link MessageFormat} syntax.
@param args optional arguments for the message.
@return an error diagnostic for this component. | [
"Create",
"and",
"return",
"an",
"error",
"diagnostic",
"associated",
"to",
"the",
"given",
"error",
"source",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWComponent.java#L772-L775 |
podio/podio-java | src/main/java/com/podio/app/AppAPI.java | AppAPI.addField | public int addField(int appId, ApplicationFieldCreate field) {
"""
Adds a new field to an app
@param appId
The id of the the field should be added to
@param field
The definition of the new field
@return The id of the newly created field
"""
return getResourceFactory().getApiResource("/app/" + appId + ... | java | public int addField(int appId, ApplicationFieldCreate field) {
return getResourceFactory().getApiResource("/app/" + appId + "/field/")
.entity(field, MediaType.APPLICATION_JSON_TYPE)
.post(ApplicationFieldCreateResponse.class).getId();
} | [
"public",
"int",
"addField",
"(",
"int",
"appId",
",",
"ApplicationFieldCreate",
"field",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/app/\"",
"+",
"appId",
"+",
"\"/field/\"",
")",
".",
"entity",
"(",
"field",
",",
"M... | Adds a new field to an app
@param appId
The id of the the field should be added to
@param field
The definition of the new field
@return The id of the newly created field | [
"Adds",
"a",
"new",
"field",
"to",
"an",
"app"
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L111-L115 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java | PageInBrowserStats.getWindowLastLoadTime | public long getWindowLastLoadTime(final String intervalName, final TimeUnit unit) {
"""
Returns web page last load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return web page last load time
"""
return unit.transformMillis(w... | java | public long getWindowLastLoadTime(final String intervalName, final TimeUnit unit) {
return unit.transformMillis(windowLastLoadTime.getValueAsLong(intervalName));
} | [
"public",
"long",
"getWindowLastLoadTime",
"(",
"final",
"String",
"intervalName",
",",
"final",
"TimeUnit",
"unit",
")",
"{",
"return",
"unit",
".",
"transformMillis",
"(",
"windowLastLoadTime",
".",
"getValueAsLong",
"(",
"intervalName",
")",
")",
";",
"}"
] | Returns web page last load time for given interval and {@link TimeUnit}.
@param intervalName name of the interval
@param unit {@link TimeUnit}
@return web page last load time | [
"Returns",
"web",
"page",
"last",
"load",
"time",
"for",
"given",
"interval",
"and",
"{",
"@link",
"TimeUnit",
"}",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/predefined/PageInBrowserStats.java#L199-L201 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.groupBy | public static Map groupBy(Iterable self, List<Closure> closures) {
"""
Sorts all Iterable members into (sub)groups determined by the supplied
mapping closures. Each closure should return the key that this item
should be grouped by. The returned LinkedHashMap will have an entry for each
distinct 'key path' retur... | java | public static Map groupBy(Iterable self, List<Closure> closures) {
return groupBy(self, closures.toArray());
} | [
"public",
"static",
"Map",
"groupBy",
"(",
"Iterable",
"self",
",",
"List",
"<",
"Closure",
">",
"closures",
")",
"{",
"return",
"groupBy",
"(",
"self",
",",
"closures",
".",
"toArray",
"(",
")",
")",
";",
"}"
] | Sorts all Iterable members into (sub)groups determined by the supplied
mapping closures. Each closure should return the key that this item
should be grouped by. The returned LinkedHashMap will have an entry for each
distinct 'key path' returned from the closures, with each value being a list
of items for that 'group pa... | [
"Sorts",
"all",
"Iterable",
"members",
"into",
"(",
"sub",
")",
"groups",
"determined",
"by",
"the",
"supplied",
"mapping",
"closures",
".",
"Each",
"closure",
"should",
"return",
"the",
"key",
"that",
"this",
"item",
"should",
"be",
"grouped",
"by",
".",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L5662-L5664 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.hasBoolean | public static boolean hasBoolean(final JSONObject json, final String key,
final boolean coerce) {
"""
Check if the value at {@code key} is a {@link Boolean} or can,
optionally, be coerced into a {@code Boolean}.
@param json {@link JSONObject} to inspect
@param key Ite... | java | public static boolean hasBoolean(final JSONObject json, final String key,
final boolean coerce) {
if (!coerce) {
return hasBoolean(json, key);
}
// This could be trivially implemented as
// `return JSON.toBoolean(json.opt(key)) != null`
... | [
"public",
"static",
"boolean",
"hasBoolean",
"(",
"final",
"JSONObject",
"json",
",",
"final",
"String",
"key",
",",
"final",
"boolean",
"coerce",
")",
"{",
"if",
"(",
"!",
"coerce",
")",
"{",
"return",
"hasBoolean",
"(",
"json",
",",
"key",
")",
";",
... | Check if the value at {@code key} is a {@link Boolean} or can,
optionally, be coerced into a {@code Boolean}.
@param json {@link JSONObject} to inspect
@param key Item in object to check
@param coerce If {@code true}, check if the value can be coerced to
{@code Boolean}
@return {@code True} if the item exists and... | [
"Check",
"if",
"the",
"value",
"at",
"{",
"@code",
"key",
"}",
"is",
"a",
"{",
"@link",
"Boolean",
"}",
"or",
"can",
"optionally",
"be",
"coerced",
"into",
"a",
"{",
"@code",
"Boolean",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L853-L879 |
dmerkushov/os-helper | src/main/java/ru/dmerkushov/oshelper/OSHelper.java | OSHelper.procWait | public static int procWait (Process process, final long timeout) throws OSHelperException {
"""
Waits for a specified process to terminate for the specified amount of
milliseconds. If it is not terminated in the desired time, it is
terminated explicitly.
NOT TESTED!!!
@param process
@param timeout
@retur... | java | public static int procWait (Process process, final long timeout) throws OSHelperException {
long endTime = Calendar.getInstance ().getTimeInMillis () + timeout;
boolean terminatedByItself = false;
int toReturn = 0;
while (Calendar.getInstance ().getTimeInMillis () < endTime) {
try {
process.exitValue (... | [
"public",
"static",
"int",
"procWait",
"(",
"Process",
"process",
",",
"final",
"long",
"timeout",
")",
"throws",
"OSHelperException",
"{",
"long",
"endTime",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
".",
"getTimeInMillis",
"(",
")",
"+",
"timeout",
";... | Waits for a specified process to terminate for the specified amount of
milliseconds. If it is not terminated in the desired time, it is
terminated explicitly.
NOT TESTED!!!
@param process
@param timeout
@return either <code>osh_PROCESS_EXITED_BY_ITSELF</code> * * *
or <code>osh_PROCESS_KILLED_BY_TIMEOUT</code>
@throw... | [
"Waits",
"for",
"a",
"specified",
"process",
"to",
"terminate",
"for",
"the",
"specified",
"amount",
"of",
"milliseconds",
".",
"If",
"it",
"is",
"not",
"terminated",
"in",
"the",
"desired",
"time",
"it",
"is",
"terminated",
"explicitly",
"."
] | train | https://github.com/dmerkushov/os-helper/blob/a7c2b72d289d9bc23ae106d1c5e11769cf3463d6/src/main/java/ru/dmerkushov/oshelper/OSHelper.java#L181-L212 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.notNull | public static void notNull(Object obj, Supplier<String> message) {
"""
Asserts that the {@link Object} reference is not {@literal null}.
The assertion holds if and only if the {@link Object} reference is not {@literal null}.
@param obj {@link Object} reference to evaluate.
@param message {@link Supplier} co... | java | public static void notNull(Object obj, Supplier<String> message) {
if (isNull(obj)) {
throw new IllegalArgumentException(message.get());
}
} | [
"public",
"static",
"void",
"notNull",
"(",
"Object",
"obj",
",",
"Supplier",
"<",
"String",
">",
"message",
")",
"{",
"if",
"(",
"isNull",
"(",
"obj",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"message",
".",
"get",
"(",
")",
")"... | Asserts that the {@link Object} reference is not {@literal null}.
The assertion holds if and only if the {@link Object} reference is not {@literal null}.
@param obj {@link Object} reference to evaluate.
@param message {@link Supplier} containing the message using in the {@link NullPointerException} thrown
if the asse... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Object",
"}",
"reference",
"is",
"not",
"{",
"@literal",
"null",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L1207-L1211 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java | PacketCapturesInner.beginGetStatusAsync | public Observable<PacketCaptureQueryStatusResultInner> beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) {
"""
Query the status of a running packet capture session.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of th... | java | public Observable<PacketCaptureQueryStatusResultInner> beginGetStatusAsync(String resourceGroupName, String networkWatcherName, String packetCaptureName) {
return beginGetStatusWithServiceResponseAsync(resourceGroupName, networkWatcherName, packetCaptureName).map(new Func1<ServiceResponse<PacketCaptureQueryStat... | [
"public",
"Observable",
"<",
"PacketCaptureQueryStatusResultInner",
">",
"beginGetStatusAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"packetCaptureName",
")",
"{",
"return",
"beginGetStatusWithServiceResponseAsync",
"(",
"res... | Query the status of a running packet capture session.
@param resourceGroupName The name of the resource group.
@param networkWatcherName The name of the Network Watcher resource.
@param packetCaptureName The name given to the packet capture session.
@throws IllegalArgumentException thrown if parameters fail the valida... | [
"Query",
"the",
"status",
"of",
"a",
"running",
"packet",
"capture",
"session",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PacketCapturesInner.java#L818-L825 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Capsule3f.java | Capsule3f.setMedial2 | @Override
public void setMedial2(double x, double y, double z) {
"""
Set the second point of the capsule's segment.
@param x x coordinate of the new second point for the capsule's segment..
@param y y coordinate of the new second point for the capsule's segment..
@param z z coordinate of the new second point... | java | @Override
public void setMedial2(double x, double y, double z) {
this.medial2.set(x, y, z);
ensureAIsLowerPoint();
} | [
"@",
"Override",
"public",
"void",
"setMedial2",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"this",
".",
"medial2",
".",
"set",
"(",
"x",
",",
"y",
",",
"z",
")",
";",
"ensureAIsLowerPoint",
"(",
")",
";",
"}"
] | Set the second point of the capsule's segment.
@param x x coordinate of the new second point for the capsule's segment..
@param y y coordinate of the new second point for the capsule's segment..
@param z z coordinate of the new second point for the capsule's segment.. | [
"Set",
"the",
"second",
"point",
"of",
"the",
"capsule",
"s",
"segment",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Capsule3f.java#L206-L210 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.beginReimageAll | public OperationStatusResponseInner beginReimageAll(String resourceGroupName, String vmScaleSetName) {
"""
Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.
@param resourceGroupName The name of the resource group.
@par... | java | public OperationStatusResponseInner beginReimageAll(String resourceGroupName, String vmScaleSetName) {
return beginReimageAllWithServiceResponseAsync(resourceGroupName, vmScaleSetName).toBlocking().single().body();
} | [
"public",
"OperationStatusResponseInner",
"beginReimageAll",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"beginReimageAllWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"toBlocking",
"(",
")"... | Reimages all the disks ( including data disks ) in the virtual machines in a VM scale set. This operation is only supported for managed disks.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the vali... | [
"Reimages",
"all",
"the",
"disks",
"(",
"including",
"data",
"disks",
")",
"in",
"the",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
".",
"This",
"operation",
"is",
"only",
"supported",
"for",
"managed",
"disks",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L3368-L3370 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ParameterUtility.java | ParameterUtility.buildCustomizableClass | public static <D extends Object> Object buildCustomizableClass(final ParameterItem<Class<?>> parameter, final Class<D> defaultObject, final Class<?> interfaceClass) {
"""
Build a customizable class.
@param parameter The parameter class to load
@param defaultObject the default object class to use as fallback
@... | java | public static <D extends Object> Object buildCustomizableClass(final ParameterItem<Class<?>> parameter, final Class<D> defaultObject, final Class<?> interfaceClass) {
Object object = null;
try {
object = parameter.get().newInstance();
} catch (InstantiationException | IllegalAcce... | [
"public",
"static",
"<",
"D",
"extends",
"Object",
">",
"Object",
"buildCustomizableClass",
"(",
"final",
"ParameterItem",
"<",
"Class",
"<",
"?",
">",
">",
"parameter",
",",
"final",
"Class",
"<",
"D",
">",
"defaultObject",
",",
"final",
"Class",
"<",
"?"... | Build a customizable class.
@param parameter The parameter class to load
@param defaultObject the default object class to use as fallback
@param interfaceClass the interface that the wanted type shall implement (for log purpose)
@param <D> the type wanted
@return a new instance of the generic type | [
"Build",
"a",
"customizable",
"class",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ParameterUtility.java#L55-L68 |
OpenVidu/openvidu | openvidu-server/src/main/java/io/openvidu/server/recording/service/RecordingService.java | RecordingService.updateRecordingManagerCollections | protected void updateRecordingManagerCollections(Session session, Recording recording) {
"""
Changes recording from starting to started, updates global recording
collections and sends RPC response to clients
"""
this.recordingManager.sessionHandler.setRecordingStarted(session.getSessionId(), recording);
t... | java | protected void updateRecordingManagerCollections(Session session, Recording recording) {
this.recordingManager.sessionHandler.setRecordingStarted(session.getSessionId(), recording);
this.recordingManager.sessionsRecordings.put(session.getSessionId(), recording);
this.recordingManager.startingRecordings.remove(rec... | [
"protected",
"void",
"updateRecordingManagerCollections",
"(",
"Session",
"session",
",",
"Recording",
"recording",
")",
"{",
"this",
".",
"recordingManager",
".",
"sessionHandler",
".",
"setRecordingStarted",
"(",
"session",
".",
"getSessionId",
"(",
")",
",",
"rec... | Changes recording from starting to started, updates global recording
collections and sends RPC response to clients | [
"Changes",
"recording",
"from",
"starting",
"to",
"started",
"updates",
"global",
"recording",
"collections",
"and",
"sends",
"RPC",
"response",
"to",
"clients"
] | train | https://github.com/OpenVidu/openvidu/blob/89db47dd37949ceab29e5228371a8fcab04d8d55/openvidu-server/src/main/java/io/openvidu/server/recording/service/RecordingService.java#L101-L106 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteBuffer.java | ByteBuffer.circularByteBufferInitializer | private void circularByteBufferInitializer(int bufferCapacity, int bufferSize, int readPosition, int writePosition) {
"""
Intializes the new CircularByteBuffer with all parameters that characterize a CircularByteBuffer.
@param bufferCapacity the buffer capacity. Must be >= 2.
@param bufferSize the buffer initial... | java | private void circularByteBufferInitializer(int bufferCapacity, int bufferSize, int readPosition, int writePosition) {
if (bufferCapacity < 2) {
throw new IllegalArgumentException("Buffer capacity must be greater than 2 !");
}
if ((bufferSize < 0) || (bufferSize > bufferCapacity)) {
... | [
"private",
"void",
"circularByteBufferInitializer",
"(",
"int",
"bufferCapacity",
",",
"int",
"bufferSize",
",",
"int",
"readPosition",
",",
"int",
"writePosition",
")",
"{",
"if",
"(",
"bufferCapacity",
"<",
"2",
")",
"{",
"throw",
"new",
"IllegalArgumentExceptio... | Intializes the new CircularByteBuffer with all parameters that characterize a CircularByteBuffer.
@param bufferCapacity the buffer capacity. Must be >= 2.
@param bufferSize the buffer initial size. Must be in [0, bufferCapacity].
@param readPosition the buffer initial read position. Must be in [0, bufferSize]
@param wr... | [
"Intializes",
"the",
"new",
"CircularByteBuffer",
"with",
"all",
"parameters",
"that",
"characterize",
"a",
"CircularByteBuffer",
"."
] | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/ByteBuffer.java#L243-L260 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/PayMchAPI.java | PayMchAPI.mmpaymkttransfersSendredpack | public static SendredpackResult mmpaymkttransfersSendredpack(Sendredpack sendredpack,String key) {
"""
现金红包 <br>
1.发送频率限制------默认1800/min <br>
2.发送个数上限------按照默认1800/min算<br>
3.金额上限------根据传入场景id不同默认上限不同,可以在商户平台产品设置进行设置和申请,最大不大于4999元/个<br>
4.其他的“量”上的限制还有哪些?------用户当天的领取上限次数,默认是10<br>
5.如果量上满足不了我们的需求,如何提高各个上... | java | public static SendredpackResult mmpaymkttransfersSendredpack(Sendredpack sendredpack,String key){
Map<String,String> map = MapUtil.objectToMap( sendredpack);
String sign = SignatureUtil.generateSign(map,sendredpack.getSign_type(),key);
sendredpack.setSign(sign);
String secapiPayRefundXML = XMLConverUtil.convert... | [
"public",
"static",
"SendredpackResult",
"mmpaymkttransfersSendredpack",
"(",
"Sendredpack",
"sendredpack",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"MapUtil",
".",
"objectToMap",
"(",
"sendredpack",
")",
";",
"String... | 现金红包 <br>
1.发送频率限制------默认1800/min <br>
2.发送个数上限------按照默认1800/min算<br>
3.金额上限------根据传入场景id不同默认上限不同,可以在商户平台产品设置进行设置和申请,最大不大于4999元/个<br>
4.其他的“量”上的限制还有哪些?------用户当天的领取上限次数,默认是10<br>
5.如果量上满足不了我们的需求,如何提高各个上限?------金额上限和用户当天领取次数上限可以在商户平台进行设置<br>
注 <br>
1:如果你是服务商,希望代你的特约商户发红包,你可以申请获得你特约商户的“现金红包产品授权”。操作路径如下:【登录商户平台-产品中心-
... | [
"现金红包",
"<br",
">"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/PayMchAPI.java#L502-L513 |
osglworks/java-di | src/main/java/org/osgl/inject/util/AnnotationUtil.java | AnnotationUtil.tagAnnotation | public static <T extends Annotation> T tagAnnotation(Annotation annotation, Class<T> tagClass) {
"""
Returns the {@link Annotation} tagged on another annotation instance.
@param annotation
the annotation instance
@param tagClass
the expected annotation class
@param <T>
the generic type of the expected anno... | java | public static <T extends Annotation> T tagAnnotation(Annotation annotation, Class<T> tagClass) {
Class<?> c = annotation.annotationType();
for (Annotation a : c.getAnnotations()) {
if (tagClass.isInstance(a)) {
return (T) a;
}
}
return null;
} | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"tagAnnotation",
"(",
"Annotation",
"annotation",
",",
"Class",
"<",
"T",
">",
"tagClass",
")",
"{",
"Class",
"<",
"?",
">",
"c",
"=",
"annotation",
".",
"annotationType",
"(",
")",
";",
... | Returns the {@link Annotation} tagged on another annotation instance.
@param annotation
the annotation instance
@param tagClass
the expected annotation class
@param <T>
the generic type of the expected annotation
@return
the annotation tagged on annotation of type `tagClass` | [
"Returns",
"the",
"{",
"@link",
"Annotation",
"}",
"tagged",
"on",
"another",
"annotation",
"instance",
"."
] | train | https://github.com/osglworks/java-di/blob/d89871c62ff508733bfa645425596f6c917fd7ee/src/main/java/org/osgl/inject/util/AnnotationUtil.java#L75-L83 |
aspectran/aspectran | shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java | ParsedOptions.getValue | public String getValue(String name, String defaultValue) {
"""
Retrieve the first argument, if any, of an option.
@param name the name of the option
@param defaultValue the default value to be returned if the option
is not specified
@return the value of the argument if option is set, and has an argument,
ot... | java | public String getValue(String name, String defaultValue) {
return getValue(resolveOption(name), defaultValue);
} | [
"public",
"String",
"getValue",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getValue",
"(",
"resolveOption",
"(",
"name",
")",
",",
"defaultValue",
")",
";",
"}"
] | Retrieve the first argument, if any, of an option.
@param name the name of the option
@param defaultValue the default value to be returned if the option
is not specified
@return the value of the argument if option is set, and has an argument,
otherwise {@code defaultValue} | [
"Retrieve",
"the",
"first",
"argument",
"if",
"any",
"of",
"an",
"option",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/shell/src/main/java/com/aspectran/shell/command/option/ParsedOptions.java#L272-L274 |
vdurmont/emoji-java | src/main/java/com/vdurmont/emoji/EmojiParser.java | EmojiParser.parseToAliases | public static String parseToAliases(
String input,
final FitzpatrickAction fitzpatrickAction
) {
"""
Replaces the emoji's unicode occurrences by one of their alias
(between 2 ':').<br>
Example: <code>😄</code> will be replaced by <code>:smile:</code><br>
<br>
When a fitzpatrick modifier is present wi... | java | public static String parseToAliases(
String input,
final FitzpatrickAction fitzpatrickAction
) {
EmojiTransformer emojiTransformer = new EmojiTransformer() {
public String transform(UnicodeCandidate unicodeCandidate) {
switch (fitzpatrickAction) {
default:
case PARSE:
... | [
"public",
"static",
"String",
"parseToAliases",
"(",
"String",
"input",
",",
"final",
"FitzpatrickAction",
"fitzpatrickAction",
")",
"{",
"EmojiTransformer",
"emojiTransformer",
"=",
"new",
"EmojiTransformer",
"(",
")",
"{",
"public",
"String",
"transform",
"(",
"Un... | Replaces the emoji's unicode occurrences by one of their alias
(between 2 ':').<br>
Example: <code>😄</code> will be replaced by <code>:smile:</code><br>
<br>
When a fitzpatrick modifier is present with a PARSE action, a "|" will be
appendend to the alias, with the fitzpatrick type.<br>
Example: <code>👦🏿</code> will ... | [
"Replaces",
"the",
"emoji",
"s",
"unicode",
"occurrences",
"by",
"one",
"of",
"their",
"alias",
"(",
"between",
"2",
":",
")",
".",
"<br",
">",
"Example",
":",
"<code",
">",
"😄<",
"/",
"code",
">",
"will",
"be",
"replaced",
"by",
"<code",
">",
":",
... | train | https://github.com/vdurmont/emoji-java/blob/8cf5fbe0d7c1020b926791f2b342a263ed07bb0f/src/main/java/com/vdurmont/emoji/EmojiParser.java#L55-L85 |
crowmagnumb/s6-util | src/main/java/net/crowmagnumb/util/net/AbstractMultipartUtility.java | AbstractMultipartUtility.addFilePart | public void addFilePart(final String fieldName, final File uploadFile)
throws IOException {
"""
Adds a upload file section to the request
@param fieldName name attribute in <input type="file" name="..." />
@param uploadFile a File to be uploaded
@throws IOException if problems
"""
Stri... | java | public void addFilePart(final String fieldName, final File uploadFile)
throws IOException
{
String fileName = uploadFile.getName();
addFilePart(fieldName, new FileInputStream(uploadFile), fileName, URLConnection.guessContentTypeFromName(fileName));
} | [
"public",
"void",
"addFilePart",
"(",
"final",
"String",
"fieldName",
",",
"final",
"File",
"uploadFile",
")",
"throws",
"IOException",
"{",
"String",
"fileName",
"=",
"uploadFile",
".",
"getName",
"(",
")",
";",
"addFilePart",
"(",
"fieldName",
",",
"new",
... | Adds a upload file section to the request
@param fieldName name attribute in <input type="file" name="..." />
@param uploadFile a File to be uploaded
@throws IOException if problems | [
"Adds",
"a",
"upload",
"file",
"section",
"to",
"the",
"request"
] | train | https://github.com/crowmagnumb/s6-util/blob/0f9969bc0809e8a617501fa57c135e9b3984fae0/src/main/java/net/crowmagnumb/util/net/AbstractMultipartUtility.java#L56-L62 |
ibm-bluemix-mobile-services/bms-clientsdk-android-core | lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java | AuthorizationProcessManager.saveTokenFromResponse | private void saveTokenFromResponse(Response response) {
"""
Extract token from response and save it locally
@param response response that contain the token
"""
try {
JSONObject responseJSON = ((ResponseImpl)response).getResponseJSON();
String accessToken = responseJSON.getStri... | java | private void saveTokenFromResponse(Response response) {
try {
JSONObject responseJSON = ((ResponseImpl)response).getResponseJSON();
String accessToken = responseJSON.getString("access_token");
String idToken = responseJSON.getString("id_token");
//save the token... | [
"private",
"void",
"saveTokenFromResponse",
"(",
"Response",
"response",
")",
"{",
"try",
"{",
"JSONObject",
"responseJSON",
"=",
"(",
"(",
"ResponseImpl",
")",
"response",
")",
".",
"getResponseJSON",
"(",
")",
";",
"String",
"accessToken",
"=",
"responseJSON",... | Extract token from response and save it locally
@param response response that contain the token | [
"Extract",
"token",
"from",
"response",
"and",
"save",
"it",
"locally"
] | train | https://github.com/ibm-bluemix-mobile-services/bms-clientsdk-android-core/blob/8db4f00d0d564792397bfc0e5bd57d52a238b858/lib/src/main/java/com/ibm/mobilefirstplatform/clientsdk/android/security/mca/internal/AuthorizationProcessManager.java#L384-L409 |
lucee/Lucee | core/src/main/java/lucee/runtime/instrumentation/InstrumentationFactory.java | InstrumentationFactory.loadAgent | private static void loadAgent(Config config, Log log, String agentJar, Class<?> vmClass) {
"""
Attach and load an agent class.
@param log Log used if the agent cannot be loaded.
@param agentJar absolute path to the agent jar.
@param vmClass VirtualMachine.class from tools.jar.
"""
try {
// addAttac... | java | private static void loadAgent(Config config, Log log, String agentJar, Class<?> vmClass) {
try {
// addAttach(config,log);
// first obtain the PID of the currently-running process
// ### this relies on the undocumented convention of the
// RuntimeMXBean's
// ### name starting with the PID, b... | [
"private",
"static",
"void",
"loadAgent",
"(",
"Config",
"config",
",",
"Log",
"log",
",",
"String",
"agentJar",
",",
"Class",
"<",
"?",
">",
"vmClass",
")",
"{",
"try",
"{",
"// addAttach(config,log);",
"// first obtain the PID of the currently-running process",
"/... | Attach and load an agent class.
@param log Log used if the agent cannot be loaded.
@param agentJar absolute path to the agent jar.
@param vmClass VirtualMachine.class from tools.jar. | [
"Attach",
"and",
"load",
"an",
"agent",
"class",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/instrumentation/InstrumentationFactory.java#L309-L341 |
sundrio/sundrio | annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java | ToPojo.readArrayProperty | private static String readArrayProperty(String ref, TypeDef source, Property property) {
"""
Returns the string representation of the code that reads an array property.
@param ref The reference.
@param source The type of the reference.
@param property The property to read.
@return ... | java | private static String readArrayProperty(String ref, TypeDef source, Property property) {
TypeRef typeRef = property.getTypeRef();
if (typeRef instanceof ClassRef) {
//TODO: This needs further breakdown, to cover edge cases.
return readObjectArrayProperty(ref, source, property);
... | [
"private",
"static",
"String",
"readArrayProperty",
"(",
"String",
"ref",
",",
"TypeDef",
"source",
",",
"Property",
"property",
")",
"{",
"TypeRef",
"typeRef",
"=",
"property",
".",
"getTypeRef",
"(",
")",
";",
"if",
"(",
"typeRef",
"instanceof",
"ClassRef",
... | Returns the string representation of the code that reads an array property.
@param ref The reference.
@param source The type of the reference.
@param property The property to read.
@return The code. | [
"Returns",
"the",
"string",
"representation",
"of",
"the",
"code",
"that",
"reads",
"an",
"array",
"property",
"."
] | train | https://github.com/sundrio/sundrio/blob/4e38368f4db0d950f7c41a8c75e15b0baff1f69a/annotations/builder/src/main/java/io/sundr/builder/internal/functions/ToPojo.java#L610-L621 |
jeremylong/DependencyCheck | core/src/main/java/org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java | ConnectionFactory.getConnection | public synchronized Connection getConnection() throws DatabaseException {
"""
Constructs a new database connection object per the database
configuration.
@return a database connection object
@throws DatabaseException thrown if there is an exception loading the
database connection
"""
initialize()... | java | public synchronized Connection getConnection() throws DatabaseException {
initialize();
Connection conn = null;
try {
conn = DriverManager.getConnection(connectionString, userName, password);
} catch (SQLException ex) {
LOGGER.debug("", ex);
throw new ... | [
"public",
"synchronized",
"Connection",
"getConnection",
"(",
")",
"throws",
"DatabaseException",
"{",
"initialize",
"(",
")",
";",
"Connection",
"conn",
"=",
"null",
";",
"try",
"{",
"conn",
"=",
"DriverManager",
".",
"getConnection",
"(",
"connectionString",
"... | Constructs a new database connection object per the database
configuration.
@return a database connection object
@throws DatabaseException thrown if there is an exception loading the
database connection | [
"Constructs",
"a",
"new",
"database",
"connection",
"object",
"per",
"the",
"database",
"configuration",
"."
] | train | https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/data/nvdcve/ConnectionFactory.java#L230-L240 |
mboudreau/Alternator | src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java | DynamoDBReflector.parseBoolean | private boolean parseBoolean(String s) {
"""
Attempts to parse the string given as a boolean and return its value.
Throws an exception if the value is anything other than 0 or 1.
"""
if ( "1".equals(s) ) {
return true;
} else if ( "0".equals(s) ) {
return false;
... | java | private boolean parseBoolean(String s) {
if ( "1".equals(s) ) {
return true;
} else if ( "0".equals(s) ) {
return false;
} else {
throw new IllegalArgumentException("Expected 1 or 0 for boolean value, was " + s);
}
} | [
"private",
"boolean",
"parseBoolean",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"\"1\"",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"true",
";",
"}",
"else",
"if",
"(",
"\"0\"",
".",
"equals",
"(",
"s",
")",
")",
"{",
"return",
"false",
";"... | Attempts to parse the string given as a boolean and return its value.
Throws an exception if the value is anything other than 0 or 1. | [
"Attempts",
"to",
"parse",
"the",
"string",
"given",
"as",
"a",
"boolean",
"and",
"return",
"its",
"value",
".",
"Throws",
"an",
"exception",
"if",
"the",
"value",
"is",
"anything",
"other",
"than",
"0",
"or",
"1",
"."
] | train | https://github.com/mboudreau/Alternator/blob/4b230ac843494cb10e46ddc2848f5b5d377d7b72/src/main/java/com/amazonaws/services/dynamodb/datamodeling/DynamoDBReflector.java#L811-L819 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/core/xml/spring327/CastorMarshaller.java | CastorMarshaller.convertCastorException | protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) {
"""
Convert the given {@code XMLException} to an appropriate exception from the
{@code org.springframework.oxm} hierarchy.
<p>A boolean flag is used to indicate whether this exception occurs during marshalling or
unmars... | java | protected XmlMappingException convertCastorException(XMLException ex, boolean marshalling) {
if (ex instanceof ValidationException) {
return new ValidationFailureException("Castor validation exception", ex);
}
else if (ex instanceof MarshalException) {
if (marshalling) {
return new MarshallingFailureExc... | [
"protected",
"XmlMappingException",
"convertCastorException",
"(",
"XMLException",
"ex",
",",
"boolean",
"marshalling",
")",
"{",
"if",
"(",
"ex",
"instanceof",
"ValidationException",
")",
"{",
"return",
"new",
"ValidationFailureException",
"(",
"\"Castor validation excep... | Convert the given {@code XMLException} to an appropriate exception from the
{@code org.springframework.oxm} hierarchy.
<p>A boolean flag is used to indicate whether this exception occurs during marshalling or
unmarshalling, since Castor itself does not make this distinction in its exception hierarchy.
@param ex Castor ... | [
"Convert",
"the",
"given",
"{"
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/xml/spring327/CastorMarshaller.java#L699-L715 |
lestard/advanced-bindings | src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java | MathBindings.copySign | public static FloatBinding copySign(final ObservableFloatValue magnitude, ObservableFloatValue sign) {
"""
Binding for {@link java.lang.Math#copySign(float, float)}
@param magnitude the parameter providing the magnitude of the result
@param sign the parameter providing the sign of the result
@return a valu... | java | public static FloatBinding copySign(final ObservableFloatValue magnitude, ObservableFloatValue sign) {
return createFloatBinding(() -> Math.copySign(magnitude.get(), sign.get()), magnitude, sign);
} | [
"public",
"static",
"FloatBinding",
"copySign",
"(",
"final",
"ObservableFloatValue",
"magnitude",
",",
"ObservableFloatValue",
"sign",
")",
"{",
"return",
"createFloatBinding",
"(",
"(",
")",
"->",
"Math",
".",
"copySign",
"(",
"magnitude",
".",
"get",
"(",
")"... | Binding for {@link java.lang.Math#copySign(float, float)}
@param magnitude the parameter providing the magnitude of the result
@param sign the parameter providing the sign of the result
@return a value with the magnitude of {@code magnitude}
and the sign of {@code sign}. | [
"Binding",
"for",
"{",
"@link",
"java",
".",
"lang",
".",
"Math#copySign",
"(",
"float",
"float",
")",
"}"
] | train | https://github.com/lestard/advanced-bindings/blob/054a5dde261c29f862b971765fa3da3704a13ab4/src/main/java/eu/lestard/advanced_bindings/api/MathBindings.java#L300-L302 |
kiswanij/jk-util | src/main/java/com/jk/util/security/JKSecurityManager.java | JKSecurityManager.createPrivilige | public static JKPrivilige createPrivilige(String name, JKPrivilige parent, int number) {
"""
Creates the privilige.
@param name the name
@param parent the parent
@param number the number
@return the JK privilige
"""
logger.trace("createPriviligeObject(): Id : ", ".name", name, ", Parent:[", parent, ... | java | public static JKPrivilige createPrivilige(String name, JKPrivilige parent, int number) {
logger.trace("createPriviligeObject(): Id : ", ".name", name, ", Parent:[", parent, "] , ", number);
JKPrivilige p = new JKPrivilige(name, parent, number);
p.setDesc(p.getFullName());
return p;
} | [
"public",
"static",
"JKPrivilige",
"createPrivilige",
"(",
"String",
"name",
",",
"JKPrivilige",
"parent",
",",
"int",
"number",
")",
"{",
"logger",
".",
"trace",
"(",
"\"createPriviligeObject(): Id : \"",
",",
"\".name\"",
",",
"name",
",",
"\", Parent:[\"",
",",... | Creates the privilige.
@param name the name
@param parent the parent
@param number the number
@return the JK privilige | [
"Creates",
"the",
"privilige",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/security/JKSecurityManager.java#L163-L168 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java | QueuePlugin.dequeueIfNotDoneYet | public void dequeueIfNotDoneYet(Element elem, String name, Object object) {
"""
Dequeue the object and run the next if it is the first
in the queue.
"""
@SuppressWarnings("rawtypes")
Queue queue = queue(elem, name, null);
if (queue != null && object.equals(queue.peek())) {
dequeueCurrentAndR... | java | public void dequeueIfNotDoneYet(Element elem, String name, Object object) {
@SuppressWarnings("rawtypes")
Queue queue = queue(elem, name, null);
if (queue != null && object.equals(queue.peek())) {
dequeueCurrentAndRunNext(elem, name);
}
} | [
"public",
"void",
"dequeueIfNotDoneYet",
"(",
"Element",
"elem",
",",
"String",
"name",
",",
"Object",
"object",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"Queue",
"queue",
"=",
"queue",
"(",
"elem",
",",
"name",
",",
"null",
")",
";",
... | Dequeue the object and run the next if it is the first
in the queue. | [
"Dequeue",
"the",
"object",
"and",
"run",
"the",
"next",
"if",
"it",
"is",
"the",
"first",
"in",
"the",
"queue",
"."
] | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/QueuePlugin.java#L357-L363 |
Microsoft/malmo | Minecraft/src/main/java/com/microsoft/Malmo/Utils/TCPSocketChannel.java | TCPSocketChannel.sendTCPBytes | public boolean sendTCPBytes(ByteBuffer[] srcbuffers, int length) {
"""
Send byte buffer over TCP, including a length header.
@param srcbuffers the bytes to send
@return true if the message was sent successfully
"""
boolean success = false;
try
{
ByteBuffer header = creat... | java | public boolean sendTCPBytes(ByteBuffer[] srcbuffers, int length)
{
boolean success = false;
try
{
ByteBuffer header = createHeader(length);
ByteBuffer[] buffers = new ByteBuffer[1 + srcbuffers.length];
buffers[0] = header;
for (int i = 0; i < s... | [
"public",
"boolean",
"sendTCPBytes",
"(",
"ByteBuffer",
"[",
"]",
"srcbuffers",
",",
"int",
"length",
")",
"{",
"boolean",
"success",
"=",
"false",
";",
"try",
"{",
"ByteBuffer",
"header",
"=",
"createHeader",
"(",
"length",
")",
";",
"ByteBuffer",
"[",
"]... | Send byte buffer over TCP, including a length header.
@param srcbuffers the bytes to send
@return true if the message was sent successfully | [
"Send",
"byte",
"buffer",
"over",
"TCP",
"including",
"a",
"length",
"header",
"."
] | train | https://github.com/Microsoft/malmo/blob/4139cd6f3e52f6e893a931a1d4b70d35f8e70e5a/Minecraft/src/main/java/com/microsoft/Malmo/Utils/TCPSocketChannel.java#L172-L202 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodesInner.java | DscNodesInner.getAsync | public Observable<DscNodeInner> getAsync(String resourceGroupName, String automationAccountName, String nodeId) {
"""
Retrieve the dsc node identified by node id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeId The node i... | java | public Observable<DscNodeInner> getAsync(String resourceGroupName, String automationAccountName, String nodeId) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, nodeId).map(new Func1<ServiceResponse<DscNodeInner>, DscNodeInner>() {
@Override
public DscNodeIn... | [
"public",
"Observable",
"<",
"DscNodeInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"nodeId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
... | Retrieve the dsc node identified by node id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param nodeId The node id.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DscNodeInner object | [
"Retrieve",
"the",
"dsc",
"node",
"identified",
"by",
"node",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/DscNodesInner.java#L216-L223 |
jboss/jboss-jsp-api_spec | src/main/java/javax/servlet/jsp/tagext/TagSupport.java | TagSupport.setValue | public void setValue(String k, Object o) {
"""
Associate a value with a String key.
@param k The key String.
@param o The value to associate.
"""
if (values == null) {
values = new Hashtable<String, Object>();
}
values.put(k, o);
} | java | public void setValue(String k, Object o) {
if (values == null) {
values = new Hashtable<String, Object>();
}
values.put(k, o);
} | [
"public",
"void",
"setValue",
"(",
"String",
"k",
",",
"Object",
"o",
")",
"{",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"values",
"=",
"new",
"Hashtable",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",
"}",
"values",
".",
"put",
"(",
"k",... | Associate a value with a String key.
@param k The key String.
@param o The value to associate. | [
"Associate",
"a",
"value",
"with",
"a",
"String",
"key",
"."
] | train | https://github.com/jboss/jboss-jsp-api_spec/blob/da53166619f33a5134dc3315a3264990cc1f541f/src/main/java/javax/servlet/jsp/tagext/TagSupport.java#L267-L272 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java | JSField.estimateSizeOfUnassembledValue | public int estimateSizeOfUnassembledValue(Object val, int indirect) {
"""
estimateSizeOfUnassembledValue
Return the estimated size of the value if unassembled.
This size includes a guess at the heap overhead of the object(s) which
would be created.
@param val the object whose unassembled length is desired
@... | java | public int estimateSizeOfUnassembledValue(Object val, int indirect) {
if (indirect == 0)
return estimateUnassembledSize(val);
else
return coder.estimateUnassembledSize(val);
} | [
"public",
"int",
"estimateSizeOfUnassembledValue",
"(",
"Object",
"val",
",",
"int",
"indirect",
")",
"{",
"if",
"(",
"indirect",
"==",
"0",
")",
"return",
"estimateUnassembledSize",
"(",
"val",
")",
";",
"else",
"return",
"coder",
".",
"estimateUnassembledSize"... | estimateSizeOfUnassembledValue
Return the estimated size of the value if unassembled.
This size includes a guess at the heap overhead of the object(s) which
would be created.
@param val the object whose unassembled length is desired
@param indirect the list indirection that applies to the object or -1 if the
JSField's... | [
"estimateSizeOfUnassembledValue",
"Return",
"the",
"estimated",
"size",
"of",
"the",
"value",
"if",
"unassembled",
".",
"This",
"size",
"includes",
"a",
"guess",
"at",
"the",
"heap",
"overhead",
"of",
"the",
"object",
"(",
"s",
")",
"which",
"would",
"be",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/mfp/jmf/impl/JSField.java#L200-L205 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multifile/JournalInputFile.java | JournalInputFile.closeAndRename | public void closeAndRename(File archiveDirectory) throws JournalException {
"""
When we have processed the file, move it to the archive directory.
"""
try {
xmlReader.close();
fileReader.close();
File archiveFile = new File(archiveDirectory, file.getName());
... | java | public void closeAndRename(File archiveDirectory) throws JournalException {
try {
xmlReader.close();
fileReader.close();
File archiveFile = new File(archiveDirectory, file.getName());
/*
* java.io.File.renameTo() has a known bug when working across
... | [
"public",
"void",
"closeAndRename",
"(",
"File",
"archiveDirectory",
")",
"throws",
"JournalException",
"{",
"try",
"{",
"xmlReader",
".",
"close",
"(",
")",
";",
"fileReader",
".",
"close",
"(",
")",
";",
"File",
"archiveFile",
"=",
"new",
"File",
"(",
"a... | When we have processed the file, move it to the archive directory. | [
"When",
"we",
"have",
"processed",
"the",
"file",
"move",
"it",
"to",
"the",
"archive",
"directory",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/journal/readerwriter/multifile/JournalInputFile.java#L63-L88 |
jenkinsci/java-client-api | jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java | JenkinsServer.createJob | public JenkinsServer createJob(FolderJob folder, String jobName, String jobXml, Boolean crumbFlag)
throws IOException {
"""
Create a job on the server using the provided xml and in the provided
folder
@param folder {@link FolderJob}
@param jobName name of the job to be created.
@param jobXml the ... | java | public JenkinsServer createJob(FolderJob folder, String jobName, String jobXml, Boolean crumbFlag)
throws IOException {
client.post_xml(UrlUtils.toBaseUrl(folder) + "createItem?name=" + EncodingUtils.formParameter(jobName), jobXml, crumbFlag);
return this;
} | [
"public",
"JenkinsServer",
"createJob",
"(",
"FolderJob",
"folder",
",",
"String",
"jobName",
",",
"String",
"jobXml",
",",
"Boolean",
"crumbFlag",
")",
"throws",
"IOException",
"{",
"client",
".",
"post_xml",
"(",
"UrlUtils",
".",
"toBaseUrl",
"(",
"folder",
... | Create a job on the server using the provided xml and in the provided
folder
@param folder {@link FolderJob}
@param jobName name of the job to be created.
@param jobXml the <code>config.xml</code> which should be used to create
the job.
@param crumbFlag <code>true</code> to add <b>crumbIssuer</b>
<code>false</code> ot... | [
"Create",
"a",
"job",
"on",
"the",
"server",
"using",
"the",
"provided",
"xml",
"and",
"in",
"the",
"provided",
"folder"
] | train | https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L388-L392 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java | TransformsInner.createOrUpdateAsync | public Observable<TransformInner> createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) {
"""
Create or Update Transform.
Creates or updates a new Transform.
@param resourceGroupName The name of the resource group within the Azure subscription.
@par... | java | public Observable<TransformInner> createOrUpdateAsync(String resourceGroupName, String accountName, String transformName, TransformInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, transformName, parameters).map(new Func1<ServiceResponse<TransformInner>, Transform... | [
"public",
"Observable",
"<",
"TransformInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"transformName",
",",
"TransformInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
... | Create or Update Transform.
Creates or updates a new Transform.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param transformName The Transform name.
@param parameters The request parameters
@throws IllegalArgumentException t... | [
"Create",
"or",
"Update",
"Transform",
".",
"Creates",
"or",
"updates",
"a",
"new",
"Transform",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/TransformsInner.java#L500-L507 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java | GerritJsonEventFactory.getDate | public static Date getDate(JSONObject json, String key) {
"""
Returns the value of a JSON property as a Date if it exists otherwise returns null.
@param json the JSONObject to check.
@param key the key.
@return the value for the key as a Date.
"""
return getDate(json, key, null);
} | java | public static Date getDate(JSONObject json, String key) {
return getDate(json, key, null);
} | [
"public",
"static",
"Date",
"getDate",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"return",
"getDate",
"(",
"json",
",",
"key",
",",
"null",
")",
";",
"}"
] | Returns the value of a JSON property as a Date if it exists otherwise returns null.
@param json the JSONObject to check.
@param key the key.
@return the value for the key as a Date. | [
"Returns",
"the",
"value",
"of",
"a",
"JSON",
"property",
"as",
"a",
"Date",
"if",
"it",
"exists",
"otherwise",
"returns",
"null",
"."
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java#L263-L265 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getCreditPayments | public CreditPayments getCreditPayments(final String accountCode, final QueryParams params) {
"""
Get Credit Payments for a given account
<p>
Returns information about all credit payments.
@param accountCode The account code to filter
@param params {@link QueryParams}
@return CreditPayments on success, null... | java | public CreditPayments getCreditPayments(final String accountCode, final QueryParams params) {
final String path = Accounts.ACCOUNTS_RESOURCE + "/" + accountCode + CreditPayments.CREDIT_PAYMENTS_RESOURCE;
return doGET(path, CreditPayments.class, params);
} | [
"public",
"CreditPayments",
"getCreditPayments",
"(",
"final",
"String",
"accountCode",
",",
"final",
"QueryParams",
"params",
")",
"{",
"final",
"String",
"path",
"=",
"Accounts",
".",
"ACCOUNTS_RESOURCE",
"+",
"\"/\"",
"+",
"accountCode",
"+",
"CreditPayments",
... | Get Credit Payments for a given account
<p>
Returns information about all credit payments.
@param accountCode The account code to filter
@param params {@link QueryParams}
@return CreditPayments on success, null otherwise | [
"Get",
"Credit",
"Payments",
"for",
"a",
"given",
"account",
"<p",
">",
"Returns",
"information",
"about",
"all",
"credit",
"payments",
"."
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L2037-L2040 |
statefulj/statefulj | statefulj-framework/statefulj-framework-core/src/main/java/org/statefulj/framework/core/StatefulFactory.java | StatefulFactory.postProcessBeanDefinitionRegistry | public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg)
throws BeansException {
"""
/*
Override postProcessBeanDefinitionRegistry to dynamically generate all the StatefulJ beans for each StatefulController
(non-Javadoc)
@see org.springframework.beans.factory.support.BeanDefinitionRegistry... | java | public void postProcessBeanDefinitionRegistry(BeanDefinitionRegistry reg)
throws BeansException {
logger.debug("postProcessBeanDefinitionRegistry : enter");
try {
// Reflect over StatefulJ
//
Reflections reflections = new Reflections((Object[])this.packages);
// Load up all Endpoint Binders
//
... | [
"public",
"void",
"postProcessBeanDefinitionRegistry",
"(",
"BeanDefinitionRegistry",
"reg",
")",
"throws",
"BeansException",
"{",
"logger",
".",
"debug",
"(",
"\"postProcessBeanDefinitionRegistry : enter\"",
")",
";",
"try",
"{",
"// Reflect over StatefulJ",
"//",
"Reflect... | /*
Override postProcessBeanDefinitionRegistry to dynamically generate all the StatefulJ beans for each StatefulController
(non-Javadoc)
@see org.springframework.beans.factory.support.BeanDefinitionRegistryPostProcessor#postProcessBeanDefinitionRegistry(org.springframework.beans.factory.support.BeanDefinitionRegistry) | [
"/",
"*",
"Override",
"postProcessBeanDefinitionRegistry",
"to",
"dynamically",
"generate",
"all",
"the",
"StatefulJ",
"beans",
"for",
"each",
"StatefulController"
] | train | https://github.com/statefulj/statefulj/blob/d3459b3cb12bd508643027743401484a231e5fa1/statefulj-framework/statefulj-framework-core/src/main/java/org/statefulj/framework/core/StatefulFactory.java#L278-L324 |
GerdHolz/TOVAL | src/de/invation/code/toval/validate/Validate.java | Validate.notPositive | public static void notPositive(Long value, String message) {
"""
Checks if the given long value is NOT positive.
@param value The long value to validate.
@param message The error message to include in the exception in case the validation fails.
@throws ParameterException if the given long value is <code>null</c... | java | public static void notPositive(Long value, String message) {
if(!validation) return;
notNull(value);
notNull(message);
if(value > 0)
throw new ParameterException(ErrorCode.POSITIVE, message);
} | [
"public",
"static",
"void",
"notPositive",
"(",
"Long",
"value",
",",
"String",
"message",
")",
"{",
"if",
"(",
"!",
"validation",
")",
"return",
";",
"notNull",
"(",
"value",
")",
";",
"notNull",
"(",
"message",
")",
";",
"if",
"(",
"value",
">",
"0... | Checks if the given long value is NOT positive.
@param value The long value to validate.
@param message The error message to include in the exception in case the validation fails.
@throws ParameterException if the given long value is <code>null</code> or bigger than 0. | [
"Checks",
"if",
"the",
"given",
"long",
"value",
"is",
"NOT",
"positive",
"."
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/validate/Validate.java#L547-L553 |
jmxtrans/jmxtrans | jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java | StackdriverWriter.getLocalInstanceId | private String getLocalInstanceId(final String cloudProvider, final String metadataEndpoint, final Map<String,String> headers) {
"""
Use a Cloud provider local metadata endpoint to determine the instance ID that this code is running on.
Useful if you don't want to configure the instance ID manually.
Pass detectI... | java | private String getLocalInstanceId(final String cloudProvider, final String metadataEndpoint, final Map<String,String> headers) {
String detectedInstanceId = null;
try {
final URL metadataUrl = new URL(metadataEndpoint);
URLConnection metadataConnection = metadataUrl.openConnection();
// add any additional ... | [
"private",
"String",
"getLocalInstanceId",
"(",
"final",
"String",
"cloudProvider",
",",
"final",
"String",
"metadataEndpoint",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
")",
"{",
"String",
"detectedInstanceId",
"=",
"null",
";",
"try",
... | Use a Cloud provider local metadata endpoint to determine the instance ID that this code is running on.
Useful if you don't want to configure the instance ID manually.
Pass detectInstance param with a cloud provider ID (AWS|GCE) to have this run in your configuration.
@return String containing an instance id, or null ... | [
"Use",
"a",
"Cloud",
"provider",
"local",
"metadata",
"endpoint",
"to",
"determine",
"the",
"instance",
"ID",
"that",
"this",
"code",
"is",
"running",
"on",
".",
"Useful",
"if",
"you",
"don",
"t",
"want",
"to",
"configure",
"the",
"instance",
"ID",
"manual... | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-output/jmxtrans-output-core/src/main/java/com/googlecode/jmxtrans/model/output/StackdriverWriter.java#L422-L443 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java | BouncyCastleCertProcessingFactory.createCredential | public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
GSIConstants.DelegationType delegType) throws GeneralSecurityException {
"""
Creates a new proxy credential from the specified certificate chain and a private key,
using the given delegation mode... | java | public X509Credential createCredential(X509Certificate[] certs, PrivateKey privateKey, int bits, int lifetime,
GSIConstants.DelegationType delegType) throws GeneralSecurityException {
return createCredential(certs, privateKey, bits, lifetime, delegType, (X509ExtensionSet) null, null);
} | [
"public",
"X509Credential",
"createCredential",
"(",
"X509Certificate",
"[",
"]",
"certs",
",",
"PrivateKey",
"privateKey",
",",
"int",
"bits",
",",
"int",
"lifetime",
",",
"GSIConstants",
".",
"DelegationType",
"delegType",
")",
"throws",
"GeneralSecurityException",
... | Creates a new proxy credential from the specified certificate chain and a private key,
using the given delegation mode.
@see #createCredential(X509Certificate[], PrivateKey, int, int, GSIConstants.CertificateType, X509ExtensionSet, String)
createCredential | [
"Creates",
"a",
"new",
"proxy",
"credential",
"from",
"the",
"specified",
"certificate",
"chain",
"and",
"a",
"private",
"key",
"using",
"the",
"given",
"delegation",
"mode",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/bc/BouncyCastleCertProcessingFactory.java#L672-L675 |
TheHortonMachine/hortonmachine | hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java | OmsPitfiller.setDirection | private void setDirection( double pitValue, int row, int col, int[][] dir, double[] fact ) {
"""
Calculate the drainage direction with the D8 method.
<p>Find the direction that has the maximum
slope and set it as the drainage direction the in the cell (r,c)
in the dir matrix.
@param pitValue the value of p... | java | private void setDirection( double pitValue, int row, int col, int[][] dir, double[] fact ) {
dir[col][row] = 0; /* This necessary to repeat passes after level raised */
double smax = 0.0;
// examine adjacent cells first
for( int k = 1; k <= 8; k++ ) {
int cn = col + DIR_WITH... | [
"private",
"void",
"setDirection",
"(",
"double",
"pitValue",
",",
"int",
"row",
",",
"int",
"col",
",",
"int",
"[",
"]",
"[",
"]",
"dir",
",",
"double",
"[",
"]",
"fact",
")",
"{",
"dir",
"[",
"col",
"]",
"[",
"row",
"]",
"=",
"0",
";",
"/* Th... | Calculate the drainage direction with the D8 method.
<p>Find the direction that has the maximum
slope and set it as the drainage direction the in the cell (r,c)
in the dir matrix.
@param pitValue the value of pit in row/col.
@param row row of the cell in the matrix.
@param col col of the cell in the matrix.
@param di... | [
"Calculate",
"the",
"drainage",
"direction",
"with",
"the",
"D8",
"method",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/hmachine/src/main/java/org/hortonmachine/hmachine/modules/demmanipulation/pitfiller/OmsPitfiller.java#L600-L623 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/dynssl/SslCertificateUtils.java | SslCertificateUtils.createRootCA | public static final KeyStore createRootCA() throws NoSuchAlgorithmException {
"""
Creates a new Root CA certificate and returns private and public key as
{@link KeyStore}. The {@link KeyStore#getDefaultType()} is used.
@return
@throws NoSuchAlgorithmException If no providers are found
for 'RSA' key pair gene... | java | public static final KeyStore createRootCA() throws NoSuchAlgorithmException {
final Date startDate = Calendar.getInstance().getTime();
final Date expireDate = new Date(startDate.getTime()+ DEFAULT_VALIDITY_IN_MS);
final KeyPairGenerator g = KeyPairGenerator.getInstance("RSA");
g.initialize(2048, SecureRandom.g... | [
"public",
"static",
"final",
"KeyStore",
"createRootCA",
"(",
")",
"throws",
"NoSuchAlgorithmException",
"{",
"final",
"Date",
"startDate",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
".",
"getTime",
"(",
")",
";",
"final",
"Date",
"expireDate",
"=",
"new",... | Creates a new Root CA certificate and returns private and public key as
{@link KeyStore}. The {@link KeyStore#getDefaultType()} is used.
@return
@throws NoSuchAlgorithmException If no providers are found
for 'RSA' key pair generator
or 'SHA1PRNG' Secure random number generator
@throws IllegalStateException in case of ... | [
"Creates",
"a",
"new",
"Root",
"CA",
"certificate",
"and",
"returns",
"private",
"and",
"public",
"key",
"as",
"{",
"@link",
"KeyStore",
"}",
".",
"The",
"{",
"@link",
"KeyStore#getDefaultType",
"()",
"}",
"is",
"used",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/dynssl/SslCertificateUtils.java#L113-L167 |
groupon/monsoon | processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java | WavefrontStrings.wavefrontLine | public static Optional<String> wavefrontLine(DateTime ts, GroupName group, MetricName metric, MetricValue metric_value) {
"""
Convert a metric to a wavefront string.
Empty metrics and histograms do not emit a value.
Note: the line is not terminated with a newline.
"""
return wavefrontValue(metric... | java | public static Optional<String> wavefrontLine(DateTime ts, GroupName group, MetricName metric, MetricValue metric_value) {
return wavefrontValue(metric_value)
.map(value -> {
final Map<String, String> tag_map = tags(group.getTags());
final String source = e... | [
"public",
"static",
"Optional",
"<",
"String",
">",
"wavefrontLine",
"(",
"DateTime",
"ts",
",",
"GroupName",
"group",
",",
"MetricName",
"metric",
",",
"MetricValue",
"metric_value",
")",
"{",
"return",
"wavefrontValue",
"(",
"metric_value",
")",
".",
"map",
... | Convert a metric to a wavefront string.
Empty metrics and histograms do not emit a value.
Note: the line is not terminated with a newline. | [
"Convert",
"a",
"metric",
"to",
"a",
"wavefront",
"string",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/processors/wavefront/src/main/java/com/groupon/lex/metrics/processors/wavefront/WavefrontStrings.java#L200-L207 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java | PackageManagerUtils.getPermissionPackageInfo | public static PackageInfo getPermissionPackageInfo(Context context, String targetPackage) throws NameNotFoundException {
"""
Get the {@link android.content.pm.PackageInfo} that contains permission declaration for the context.
@param context the context.
@param targetPackage the target package name.
@return the ... | java | public static PackageInfo getPermissionPackageInfo(Context context, String targetPackage) throws NameNotFoundException {
PackageManager manager = context.getPackageManager();
return manager.getPackageInfo(targetPackage, PackageManager.GET_PERMISSIONS);
} | [
"public",
"static",
"PackageInfo",
"getPermissionPackageInfo",
"(",
"Context",
"context",
",",
"String",
"targetPackage",
")",
"throws",
"NameNotFoundException",
"{",
"PackageManager",
"manager",
"=",
"context",
".",
"getPackageManager",
"(",
")",
";",
"return",
"mana... | Get the {@link android.content.pm.PackageInfo} that contains permission declaration for the context.
@param context the context.
@param targetPackage the target package name.
@return the {@link android.content.pm.PackageInfo}.
@throws NameNotFoundException if no package found. | [
"Get",
"the",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/content/pm/PackageManagerUtils.java#L220-L223 |
Cornutum/tcases | tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJson.java | ProjectJson.asRefBase | private static URI asRefBase( JsonString uri) {
"""
Returns the reference base URI represented by the given JSON string.
"""
try
{
return
uri == null
? null
: new URI( uri.getChars().toString());
}
catch( Exception e)
{
throw new ProjectException( S... | java | private static URI asRefBase( JsonString uri)
{
try
{
return
uri == null
? null
: new URI( uri.getChars().toString());
}
catch( Exception e)
{
throw new ProjectException( String.format( "Error defining reference base=%s", uri), e);
}
} | [
"private",
"static",
"URI",
"asRefBase",
"(",
"JsonString",
"uri",
")",
"{",
"try",
"{",
"return",
"uri",
"==",
"null",
"?",
"null",
":",
"new",
"URI",
"(",
"uri",
".",
"getChars",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"}",
"catch",
"(",
... | Returns the reference base URI represented by the given JSON string. | [
"Returns",
"the",
"reference",
"base",
"URI",
"represented",
"by",
"the",
"given",
"JSON",
"string",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-io/src/main/java/org/cornutum/tcases/io/ProjectJson.java#L57-L70 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/AbstractLoaderFactory.java | AbstractLoaderFactory.createLoadTasksPerBusinessDate | public void createLoadTasksPerBusinessDate(CacheLoaderContext context, Object sourceAttribute, BooleanFilter postLoadFilter) {
"""
combine business date (from this.buildLoadOperation), source attribute (from this.addSourceAttributeOperation)
and processing time (from this.buildRefreshOperations)
"""
... | java | public void createLoadTasksPerBusinessDate(CacheLoaderContext context, Object sourceAttribute, BooleanFilter postLoadFilter)
{
if (context.getRefreshInterval() != null)
{
this.createLoadTasksForRefresh(context, sourceAttribute, postLoadFilter);
}
else
{
... | [
"public",
"void",
"createLoadTasksPerBusinessDate",
"(",
"CacheLoaderContext",
"context",
",",
"Object",
"sourceAttribute",
",",
"BooleanFilter",
"postLoadFilter",
")",
"{",
"if",
"(",
"context",
".",
"getRefreshInterval",
"(",
")",
"!=",
"null",
")",
"{",
"this",
... | combine business date (from this.buildLoadOperation), source attribute (from this.addSourceAttributeOperation)
and processing time (from this.buildRefreshOperations) | [
"combine",
"business",
"date",
"(",
"from",
"this",
".",
"buildLoadOperation",
")",
"source",
"attribute",
"(",
"from",
"this",
".",
"addSourceAttributeOperation",
")",
"and",
"processing",
"time",
"(",
"from",
"this",
".",
"buildRefreshOperations",
")"
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/cacheloader/AbstractLoaderFactory.java#L86-L96 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/VersionControlCommand.java | VersionControlCommand.versionControl | public Response versionControl(Session session, String path) {
"""
Webdav Version-Control method implementation.
@param session current session
@param path resource path
@return the instance of javax.ws.rs.core.Response
"""
try
{
Node node = (Node)session.getItem(path);
... | java | public Response versionControl(Session session, String path)
{
try
{
Node node = (Node)session.getItem(path);
if (!node.isNodeType("mix:versionable"))
{
node.addMixin("mix:versionable");
session.save();
}
return Response.ok(... | [
"public",
"Response",
"versionControl",
"(",
"Session",
"session",
",",
"String",
"path",
")",
"{",
"try",
"{",
"Node",
"node",
"=",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"path",
")",
";",
"if",
"(",
"!",
"node",
".",
"isNodeType",
"(",
"... | Webdav Version-Control method implementation.
@param session current session
@param path resource path
@return the instance of javax.ws.rs.core.Response | [
"Webdav",
"Version",
"-",
"Control",
"method",
"implementation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/deltav/VersionControlCommand.java#L53-L82 |
JoeKerouac/utils | src/main/java/com/joe/utils/secure/KeyTools.java | KeyTools.getPrivateKeyFromPKCS8 | public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, InputStream ins) {
"""
从PKCS8格式的文件中获取私钥
@param algorithm 加密算法名称
@param ins PKCS8文件的输入流
@return 私钥
"""
if (ins == null || StringUtils.isEmpty(algorithm)) {
return null;
}
try {
KeyFactory... | java | public static PrivateKey getPrivateKeyFromPKCS8(String algorithm, InputStream ins) {
if (ins == null || StringUtils.isEmpty(algorithm)) {
return null;
}
try {
KeyFactory keyFactory = KeyFactory.getInstance(algorithm);
byte[] encodedKey = IOUtils.read(ins);
... | [
"public",
"static",
"PrivateKey",
"getPrivateKeyFromPKCS8",
"(",
"String",
"algorithm",
",",
"InputStream",
"ins",
")",
"{",
"if",
"(",
"ins",
"==",
"null",
"||",
"StringUtils",
".",
"isEmpty",
"(",
"algorithm",
")",
")",
"{",
"return",
"null",
";",
"}",
"... | 从PKCS8格式的文件中获取私钥
@param algorithm 加密算法名称
@param ins PKCS8文件的输入流
@return 私钥 | [
"从PKCS8格式的文件中获取私钥"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/secure/KeyTools.java#L60-L72 |
joniles/mpxj | src/main/java/net/sf/mpxj/GenericCriteria.java | GenericCriteria.evaluateLogicalOperator | private boolean evaluateLogicalOperator(FieldContainer container, Map<GenericCriteriaPrompt, Object> promptValues) {
"""
Evalutes AND and OR operators.
@param container data context
@param promptValues responses to prompts
@return operator result
"""
boolean result = false;
if (m_criteriaList... | java | private boolean evaluateLogicalOperator(FieldContainer container, Map<GenericCriteriaPrompt, Object> promptValues)
{
boolean result = false;
if (m_criteriaList.size() == 0)
{
result = true;
}
else
{
for (GenericCriteria criteria : m_criteriaList)
{
... | [
"private",
"boolean",
"evaluateLogicalOperator",
"(",
"FieldContainer",
"container",
",",
"Map",
"<",
"GenericCriteriaPrompt",
",",
"Object",
">",
"promptValues",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"m_criteriaList",
".",
"size",
"(",
")... | Evalutes AND and OR operators.
@param container data context
@param promptValues responses to prompts
@return operator result | [
"Evalutes",
"AND",
"and",
"OR",
"operators",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/GenericCriteria.java#L231-L252 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java | IntuitResponseDeserializer.getAttachableResponse | private AttachableResponse getAttachableResponse(JsonNode jsonNode) throws IOException {
"""
Method to deserialize the QueryResponse object
@param jsonNode
@return QueryResponse
"""
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("AttachableResponseDeserializer",... | java | private AttachableResponse getAttachableResponse(JsonNode jsonNode) throws IOException {
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("AttachableResponseDeserializer", new Version(1, 0, 0, null));
simpleModule.addDeserializer(AttachableResponse.class, new AttachableRespo... | [
"private",
"AttachableResponse",
"getAttachableResponse",
"(",
"JsonNode",
"jsonNode",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"\"Attachabl... | Method to deserialize the QueryResponse object
@param jsonNode
@return QueryResponse | [
"Method",
"to",
"deserialize",
"the",
"QueryResponse",
"object"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java#L372-L382 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java | JSONConverter.writeNotifications | public void writeNotifications(OutputStream out, Notification[] value) throws IOException {
"""
Encode an array of Notification instance as JSON:
@param out The stream to write JSON to
@param value The Notification array to encode. Value can be null,
but its items can't be null.
The "source" of the items mus... | java | public void writeNotifications(OutputStream out, Notification[] value) throws IOException {
final NotificationRecord[] records;
if (value != null) {
records = new NotificationRecord[value.length];
for (int i = 0; i < value.length; ++i) {
Notification n = value[i];... | [
"public",
"void",
"writeNotifications",
"(",
"OutputStream",
"out",
",",
"Notification",
"[",
"]",
"value",
")",
"throws",
"IOException",
"{",
"final",
"NotificationRecord",
"[",
"]",
"records",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"records",
"="... | Encode an array of Notification instance as JSON:
@param out The stream to write JSON to
@param value The Notification array to encode. Value can be null,
but its items can't be null.
The "source" of the items must be an instance of ObjectName.
@throws IOException If an I/O error occurs
@see #readNotifications(InputSt... | [
"Encode",
"an",
"array",
"of",
"Notification",
"instance",
"as",
"JSON",
":"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1628-L1649 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PerQueryCache.java | PerQueryCache.get | Object get(Class<?> type, Object key) {
"""
Returns the value from the cache with the given <code>type</code> and
<code>key</code>.
@param type the query type.
@param key the key object.
@return the value assigned to <code>type</code> and <code>key</code> or
<code>null</code> if it does not exist in the ca... | java | Object get(Class<?> type, Object key) {
return map.get(new Key(type, key));
} | [
"Object",
"get",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"Object",
"key",
")",
"{",
"return",
"map",
".",
"get",
"(",
"new",
"Key",
"(",
"type",
",",
"key",
")",
")",
";",
"}"
] | Returns the value from the cache with the given <code>type</code> and
<code>key</code>.
@param type the query type.
@param key the key object.
@return the value assigned to <code>type</code> and <code>key</code> or
<code>null</code> if it does not exist in the cache. | [
"Returns",
"the",
"value",
"from",
"the",
"cache",
"with",
"the",
"given",
"<code",
">",
"type<",
"/",
"code",
">",
"and",
"<code",
">",
"key<",
"/",
"code",
">",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/PerQueryCache.java#L67-L69 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java | FDBigInteger.mult | private FDBigInteger mult(FDBigInteger other) {
"""
/*@
@ requires this.value() == 0;
@ assignable \nothing;
@ ensures \result == this;
@
@ also
@
@ requires this.value() != 0 && other.value() == 0;
@ assignable \nothing;
@ ensures \result == other;
@
@ also
@
@ requires this.value() != 0 && other.v... | java | private FDBigInteger mult(FDBigInteger other) {
if (this.nWords == 0) {
return this;
}
if (this.size() == 1) {
return other.mult(data[0]);
}
if (other.nWords == 0) {
return other;
}
if (other.size() == 1) {
return th... | [
"private",
"FDBigInteger",
"mult",
"(",
"FDBigInteger",
"other",
")",
"{",
"if",
"(",
"this",
".",
"nWords",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"if",
"(",
"this",
".",
"size",
"(",
")",
"==",
"1",
")",
"{",
"return",
"other",
".",
"... | /*@
@ requires this.value() == 0;
@ assignable \nothing;
@ ensures \result == this;
@
@ also
@
@ requires this.value() != 0 && other.value() == 0;
@ assignable \nothing;
@ ensures \result == other;
@
@ also
@
@ requires this.value() != 0 && other.value() != 0;
@ assignable \nothing;
@ ensures \result.value() == \old(... | [
"/",
"*"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/misc/FDBigInteger.java#L1153-L1169 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/provider/BasicWorkspaceManager.java | BasicWorkspaceManager.getAndActivateWorkspace | @Override
public MemoryWorkspace getAndActivateWorkspace(@NonNull WorkspaceConfiguration configuration, @NonNull String id) {
"""
This method gets & activates default with a given configuration and Id
@param configuration
@param id
@return
"""
return getWorkspaceForCurrentThread(configuration,... | java | @Override
public MemoryWorkspace getAndActivateWorkspace(@NonNull WorkspaceConfiguration configuration, @NonNull String id) {
return getWorkspaceForCurrentThread(configuration, id).notifyScopeEntered();
} | [
"@",
"Override",
"public",
"MemoryWorkspace",
"getAndActivateWorkspace",
"(",
"@",
"NonNull",
"WorkspaceConfiguration",
"configuration",
",",
"@",
"NonNull",
"String",
"id",
")",
"{",
"return",
"getWorkspaceForCurrentThread",
"(",
"configuration",
",",
"id",
")",
".",... | This method gets & activates default with a given configuration and Id
@param configuration
@param id
@return | [
"This",
"method",
"gets",
"&",
"activates",
"default",
"with",
"a",
"given",
"configuration",
"and",
"Id"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/memory/provider/BasicWorkspaceManager.java#L233-L236 |
apache/flink | flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java | ExecutionEnvironment.fromParallelCollection | public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type) {
"""
Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
framework to create a parallel data source that returns the elements in the iterator.
<p>Because... | java | public <X> DataSource<X> fromParallelCollection(SplittableIterator<X> iterator, TypeInformation<X> type) {
return fromParallelCollection(iterator, type, Utils.getCallLocationName());
} | [
"public",
"<",
"X",
">",
"DataSource",
"<",
"X",
">",
"fromParallelCollection",
"(",
"SplittableIterator",
"<",
"X",
">",
"iterator",
",",
"TypeInformation",
"<",
"X",
">",
"type",
")",
"{",
"return",
"fromParallelCollection",
"(",
"iterator",
",",
"type",
"... | Creates a new data set that contains elements in the iterator. The iterator is splittable, allowing the
framework to create a parallel data source that returns the elements in the iterator.
<p>Because the iterator will remain unmodified until the actual execution happens, the type of data
returned by the iterator must... | [
"Creates",
"a",
"new",
"data",
"set",
"that",
"contains",
"elements",
"in",
"the",
"iterator",
".",
"The",
"iterator",
"is",
"splittable",
"allowing",
"the",
"framework",
"to",
"create",
"a",
"parallel",
"data",
"source",
"that",
"returns",
"the",
"elements",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-java/src/main/java/org/apache/flink/api/java/ExecutionEnvironment.java#L779-L781 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_intervention_interventionId_GET | public OvhIntervention serviceName_intervention_interventionId_GET(String serviceName, Long interventionId) throws IOException {
"""
Get this object properties
REST: GET /dedicated/server/{serviceName}/intervention/{interventionId}
@param serviceName [required] The internal name of your dedicated server
@para... | java | public OvhIntervention serviceName_intervention_interventionId_GET(String serviceName, Long interventionId) throws IOException {
String qPath = "/dedicated/server/{serviceName}/intervention/{interventionId}";
StringBuilder sb = path(qPath, serviceName, interventionId);
String resp = exec(qPath, "GET", sb.toString... | [
"public",
"OvhIntervention",
"serviceName_intervention_interventionId_GET",
"(",
"String",
"serviceName",
",",
"Long",
"interventionId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/intervention/{interventionId}\"",
";",
"StringBui... | Get this object properties
REST: GET /dedicated/server/{serviceName}/intervention/{interventionId}
@param serviceName [required] The internal name of your dedicated server
@param interventionId [required] The intervention id | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L650-L655 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getDeleteFileMetadataTemplateRequest | public BoxRequestsMetadata.DeleteFileMetadata getDeleteFileMetadataTemplateRequest(String id, String template) {
"""
Gets a request that deletes the metadata for a specific template on a file
@param id id of the file to retrieve metadata for
@param template metadata template to use
@return request to d... | java | public BoxRequestsMetadata.DeleteFileMetadata getDeleteFileMetadataTemplateRequest(String id, String template) {
BoxRequestsMetadata.DeleteFileMetadata request = new BoxRequestsMetadata.DeleteFileMetadata(getFileMetadataUrl(id, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"DeleteFileMetadata",
"getDeleteFileMetadataTemplateRequest",
"(",
"String",
"id",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"DeleteFileMetadata",
"request",
"=",
"new",
"BoxRequestsMetadata",
".",
"DeleteFileMeta... | Gets a request that deletes the metadata for a specific template on a file
@param id id of the file to retrieve metadata for
@param template metadata template to use
@return request to delete metadata on a file | [
"Gets",
"a",
"request",
"that",
"deletes",
"the",
"metadata",
"for",
"a",
"specific",
"template",
"on",
"a",
"file"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L265-L268 |
biojava/biojava | biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java | Alignments.getPairwiseAlignment | public static <S extends Sequence<C>, C extends Compound> SequencePair<S, C> getPairwiseAlignment(
S query, S target, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
"""
Factory method which computes a sequence alignment for the given {@link Sequence} pair.
@par... | java | public static <S extends Sequence<C>, C extends Compound> SequencePair<S, C> getPairwiseAlignment(
S query, S target, PairwiseSequenceAlignerType type, GapPenalty gapPenalty,
SubstitutionMatrix<C> subMatrix) {
return getPairwiseAligner(query, target, type, gapPenalty, subMatrix).getPair();
} | [
"public",
"static",
"<",
"S",
"extends",
"Sequence",
"<",
"C",
">",
",",
"C",
"extends",
"Compound",
">",
"SequencePair",
"<",
"S",
",",
"C",
">",
"getPairwiseAlignment",
"(",
"S",
"query",
",",
"S",
"target",
",",
"PairwiseSequenceAlignerType",
"type",
",... | Factory method which computes a sequence alignment for the given {@link Sequence} pair.
@param <S> each {@link Sequence} of the pair is of type S
@param <C> each element of an {@link AlignedSequence} is a {@link Compound} of type C
@param query the first {@link Sequence}s to align
@param target the second {@link Seque... | [
"Factory",
"method",
"which",
"computes",
"a",
"sequence",
"alignment",
"for",
"the",
"given",
"{",
"@link",
"Sequence",
"}",
"pair",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-alignment/src/main/java/org/biojava/nbio/alignment/Alignments.java#L214-L218 |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/utils/ConnectivityHelper.java | ConnectivityHelper.register | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static void register(@NonNull Context context, @NonNull ConnectivityListener listener) {
"""
Be sure to remove receiver at appropriate time (i.e. in Activity.onPause()).
"""
if (receiversMap.containsKey(listener)) {
th... | java | @RequiresPermission(Manifest.permission.ACCESS_NETWORK_STATE)
public static void register(@NonNull Context context, @NonNull ConnectivityListener listener) {
if (receiversMap.containsKey(listener)) {
throw new RuntimeException("Connectivity listener " + listener
+ " is alread... | [
"@",
"RequiresPermission",
"(",
"Manifest",
".",
"permission",
".",
"ACCESS_NETWORK_STATE",
")",
"public",
"static",
"void",
"register",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"ConnectivityListener",
"listener",
")",
"{",
"if",
"(",
"rec... | Be sure to remove receiver at appropriate time (i.e. in Activity.onPause()). | [
"Be",
"sure",
"to",
"remove",
"receiver",
"at",
"appropriate",
"time",
"(",
"i",
".",
"e",
".",
"in",
"Activity",
".",
"onPause",
"()",
")",
"."
] | train | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/utils/ConnectivityHelper.java#L31-L43 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.