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 |
|---|---|---|---|---|---|---|---|---|---|---|
roboconf/roboconf-platform | core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java | LiveStatusClient.queryLivestatus | public String queryLivestatus( String nagiosQuery ) throws UnknownHostException, IOException {
"""
Queries a live status server.
@param nagiosQuery the query to pass through a socket (not null)
@return the response
@throws UnknownHostException
@throws IOException
"""
Socket liveStatusSocket = null;
tr... | java | public String queryLivestatus( String nagiosQuery ) throws UnknownHostException, IOException {
Socket liveStatusSocket = null;
try {
this.logger.fine( "About to open a connection through Live Status..." );
liveStatusSocket = new Socket( this.host, this.port );
this.logger.fine( "A connection was establish... | [
"public",
"String",
"queryLivestatus",
"(",
"String",
"nagiosQuery",
")",
"throws",
"UnknownHostException",
",",
"IOException",
"{",
"Socket",
"liveStatusSocket",
"=",
"null",
";",
"try",
"{",
"this",
".",
"logger",
".",
"fine",
"(",
"\"About to open a connection th... | Queries a live status server.
@param nagiosQuery the query to pass through a socket (not null)
@return the response
@throws UnknownHostException
@throws IOException | [
"Queries",
"a",
"live",
"status",
"server",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent-monitoring/src/main/java/net/roboconf/agent/monitoring/internal/nagios/LiveStatusClient.java#L73-L101 |
roboconf/roboconf-platform | core/roboconf-dm-rest-commons/src/main/java/net/roboconf/dm/rest/commons/security/AuthenticationManager.java | AuthenticationManager.isSessionValid | public boolean isSessionValid( final String token, long validityPeriod ) {
"""
Determines whether a session is valid.
@param token a token
@param validityPeriod the validity period for a session (in seconds, < 0 for unbound)
@return true if the session is valid, false otherwise
"""
boolean valid = false;... | java | public boolean isSessionValid( final String token, long validityPeriod ) {
boolean valid = false;
Long loginTime = null;
if( token != null )
loginTime = this.tokenToLoginTime.get( token );
if( validityPeriod < 0 ) {
valid = loginTime != null;
} else if( loginTime != null ) {
long now = new Date().... | [
"public",
"boolean",
"isSessionValid",
"(",
"final",
"String",
"token",
",",
"long",
"validityPeriod",
")",
"{",
"boolean",
"valid",
"=",
"false",
";",
"Long",
"loginTime",
"=",
"null",
";",
"if",
"(",
"token",
"!=",
"null",
")",
"loginTime",
"=",
"this",
... | Determines whether a session is valid.
@param token a token
@param validityPeriod the validity period for a session (in seconds, < 0 for unbound)
@return true if the session is valid, false otherwise | [
"Determines",
"whether",
"a",
"session",
"is",
"valid",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-dm-rest-commons/src/main/java/net/roboconf/dm/rest/commons/security/AuthenticationManager.java#L128-L148 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java | ProductSearchClient.addProductToProductSet | public final void addProductToProductSet(String name, String product) {
"""
Adds a Product to the specified ProductSet. If the Product is already present, no change is
made.
<p>One Product can be added to at most 100 ProductSets.
<p>Possible errors:
<p>* Returns NOT_FOUND if the Product or the Produc... | java | public final void addProductToProductSet(String name, String product) {
AddProductToProductSetRequest request =
AddProductToProductSetRequest.newBuilder().setName(name).setProduct(product).build();
addProductToProductSet(request);
} | [
"public",
"final",
"void",
"addProductToProductSet",
"(",
"String",
"name",
",",
"String",
"product",
")",
"{",
"AddProductToProductSetRequest",
"request",
"=",
"AddProductToProductSetRequest",
".",
"newBuilder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"s... | Adds a Product to the specified ProductSet. If the Product is already present, no change is
made.
<p>One Product can be added to at most 100 ProductSets.
<p>Possible errors:
<p>* Returns NOT_FOUND if the Product or the ProductSet doesn't exist.
<p>Sample code:
<pre><code>
try (ProductSearchClient productSearch... | [
"Adds",
"a",
"Product",
"to",
"the",
"specified",
"ProductSet",
".",
"If",
"the",
"Product",
"is",
"already",
"present",
"no",
"change",
"is",
"made",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-vision/src/main/java/com/google/cloud/vision/v1/ProductSearchClient.java#L2294-L2299 |
aws/aws-sdk-java | aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/CreateTransformJobRequest.java | CreateTransformJobRequest.withEnvironment | public CreateTransformJobRequest withEnvironment(java.util.Map<String, String> environment) {
"""
<p>
The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.
</p>
@param environment
The environment variables to set in the Docker container. We support u... | java | public CreateTransformJobRequest withEnvironment(java.util.Map<String, String> environment) {
setEnvironment(environment);
return this;
} | [
"public",
"CreateTransformJobRequest",
"withEnvironment",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
")",
"{",
"setEnvironment",
"(",
"environment",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The environment variables to set in the Docker container. We support up to 16 key and values entries in the map.
</p>
@param environment
The environment variables to set in the Docker container. We support up to 16 key and values entries in
the map.
@return Returns a reference to this object so that method calls c... | [
"<p",
">",
"The",
"environment",
"variables",
"to",
"set",
"in",
"the",
"Docker",
"container",
".",
"We",
"support",
"up",
"to",
"16",
"key",
"and",
"values",
"entries",
"in",
"the",
"map",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/CreateTransformJobRequest.java#L546-L549 |
michael-rapp/AndroidMaterialValidation | library/src/main/java/de/mrapp/android/validation/Validators.java | Validators.notEmpty | public static Validator<CharSequence> notEmpty(@NonNull final Context context) {
"""
Creates and returns a validator, which allows to validate texts to ensure, that they are not
empty.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}.... | java | public static Validator<CharSequence> notEmpty(@NonNull final Context context) {
return new NotEmptyValidator(context, R.string.default_error_message);
} | [
"public",
"static",
"Validator",
"<",
"CharSequence",
">",
"notEmpty",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
")",
"{",
"return",
"new",
"NotEmptyValidator",
"(",
"context",
",",
"R",
".",
"string",
".",
"default_error_message",
")",
";",
"}"
] | Creates and returns a validator, which allows to validate texts to ensure, that they are not
empty.
@param context
The context, which should be used to retrieve the error message, as an instance of
the class {@link Context}. The context may not be null
@return The validator, which has been created, as an instance of t... | [
"Creates",
"and",
"returns",
"a",
"validator",
"which",
"allows",
"to",
"validate",
"texts",
"to",
"ensure",
"that",
"they",
"are",
"not",
"empty",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialValidation/blob/ac8693baeac7abddf2e38a47da4c1849d4661a8b/library/src/main/java/de/mrapp/android/validation/Validators.java#L386-L388 |
highsource/hyperjaxb3 | ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/xjc/reader/TypeUtil.java | TypeUtil.getAssignableTypes | private static void getAssignableTypes( JClass t, Set<JClass> s ) {
"""
Returns the set of all classes/interfaces that a given type
implements/extends, including itself.
For example, if you pass java.io.FilterInputStream, then the returned
set will contain java.lang.Object, java.lang.InputStream, and
java.la... | java | private static void getAssignableTypes( JClass t, Set<JClass> s ) {
if(!s.add(t))
return;
// TODO
// if (t.fullName().equals(Equals.class.getName()) ||
// t.fullName().equals(HashCode.class.getName()) ||
// t.fullName().equals(ToString.class.getName... | [
"private",
"static",
"void",
"getAssignableTypes",
"(",
"JClass",
"t",
",",
"Set",
"<",
"JClass",
">",
"s",
")",
"{",
"if",
"(",
"!",
"s",
".",
"add",
"(",
"t",
")",
")",
"return",
";",
"// TODO",
"// if (t.fullName().equals(Equals.class.getName()) ||",... | Returns the set of all classes/interfaces that a given type
implements/extends, including itself.
For example, if you pass java.io.FilterInputStream, then the returned
set will contain java.lang.Object, java.lang.InputStream, and
java.lang.FilterInputStream. | [
"Returns",
"the",
"set",
"of",
"all",
"classes",
"/",
"interfaces",
"that",
"a",
"given",
"type",
"implements",
"/",
"extends",
"including",
"itself",
"."
] | train | https://github.com/highsource/hyperjaxb3/blob/c645d1628b8c26a844858d221fc9affe9c18543e/ejb/plugin/src/main/java/org/jvnet/hyperjaxb3/xjc/reader/TypeUtil.java#L213-L240 |
apache/incubator-druid | extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java | ParquetGroupConverter.convertPrimitiveField | @Nullable
private static Object convertPrimitiveField(Group g, int fieldIndex, boolean binaryAsString) {
"""
Convert a primitive group field to a "ingestion friendly" java object
@return "ingestion ready" java object, or null
"""
PrimitiveType pt = (PrimitiveType) g.getType().getFields().get(fieldInde... | java | @Nullable
private static Object convertPrimitiveField(Group g, int fieldIndex, boolean binaryAsString)
{
PrimitiveType pt = (PrimitiveType) g.getType().getFields().get(fieldIndex);
if (pt.isRepetition(Type.Repetition.REPEATED) && g.getFieldRepetitionCount(fieldIndex) > 1) {
List<Object> vals = new Arr... | [
"@",
"Nullable",
"private",
"static",
"Object",
"convertPrimitiveField",
"(",
"Group",
"g",
",",
"int",
"fieldIndex",
",",
"boolean",
"binaryAsString",
")",
"{",
"PrimitiveType",
"pt",
"=",
"(",
"PrimitiveType",
")",
"g",
".",
"getType",
"(",
")",
".",
"getF... | Convert a primitive group field to a "ingestion friendly" java object
@return "ingestion ready" java object, or null | [
"Convert",
"a",
"primitive",
"group",
"field",
"to",
"a",
"ingestion",
"friendly",
"java",
"object"
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/extensions-core/parquet-extensions/src/main/java/org/apache/druid/data/input/parquet/simple/ParquetGroupConverter.java#L246-L258 |
Alluxio/alluxio | core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java | UfsJournalFile.decodeTemporaryCheckpointFile | static UfsJournalFile decodeTemporaryCheckpointFile(UfsJournal journal, String filename) {
"""
Decodes a temporary checkpoint file name into a {@link UfsJournalFile}.
@param journal the UFS journal instance
@param filename the temporary checkpoint file name
@return the instance of {@link UfsJournalFile}
"... | java | static UfsJournalFile decodeTemporaryCheckpointFile(UfsJournal journal, String filename) {
URI location = URIUtils.appendPathOrDie(journal.getTmpDir(), filename);
return UfsJournalFile.createTmpCheckpointFile(location);
} | [
"static",
"UfsJournalFile",
"decodeTemporaryCheckpointFile",
"(",
"UfsJournal",
"journal",
",",
"String",
"filename",
")",
"{",
"URI",
"location",
"=",
"URIUtils",
".",
"appendPathOrDie",
"(",
"journal",
".",
"getTmpDir",
"(",
")",
",",
"filename",
")",
";",
"re... | Decodes a temporary checkpoint file name into a {@link UfsJournalFile}.
@param journal the UFS journal instance
@param filename the temporary checkpoint file name
@return the instance of {@link UfsJournalFile} | [
"Decodes",
"a",
"temporary",
"checkpoint",
"file",
"name",
"into",
"a",
"{",
"@link",
"UfsJournalFile",
"}",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/common/src/main/java/alluxio/master/journal/ufs/UfsJournalFile.java#L210-L213 |
beangle/beangle3 | commons/core/src/main/java/org/beangle/commons/lang/Strings.java | Strings.subtractSeq | public static String subtractSeq(final String first, final String second) {
"""
<p>
subtractSeq.
</p>
@param first
a {@link java.lang.String} object.
@param second
a {@link java.lang.String} object.
@return a {@link java.lang.String} object.
"""
return subtractSeq(first, second, DELIMITER);
} | java | public static String subtractSeq(final String first, final String second) {
return subtractSeq(first, second, DELIMITER);
} | [
"public",
"static",
"String",
"subtractSeq",
"(",
"final",
"String",
"first",
",",
"final",
"String",
"second",
")",
"{",
"return",
"subtractSeq",
"(",
"first",
",",
"second",
",",
"DELIMITER",
")",
";",
"}"
] | <p>
subtractSeq.
</p>
@param first
a {@link java.lang.String} object.
@param second
a {@link java.lang.String} object.
@return a {@link java.lang.String} object. | [
"<p",
">",
"subtractSeq",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/core/src/main/java/org/beangle/commons/lang/Strings.java#L1027-L1029 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java | DefaultNamespaceService.canOpen | private boolean canOpen(String resourceLocation) {
"""
Determines if the {@link Namespace} resource location can be opened for
lookups. To be opened
@param resourceLocation
@return
"""
if (resourceLocation == null) {
throw new InvalidArgument("resourceLocation", resourceLocation);
... | java | private boolean canOpen(String resourceLocation) {
if (resourceLocation == null) {
throw new InvalidArgument("resourceLocation", resourceLocation);
}
synchronized (resourceLocation) {
// find the resource in the cache
CachedResource cachedResource = cacheLook... | [
"private",
"boolean",
"canOpen",
"(",
"String",
"resourceLocation",
")",
"{",
"if",
"(",
"resourceLocation",
"==",
"null",
")",
"{",
"throw",
"new",
"InvalidArgument",
"(",
"\"resourceLocation\"",
",",
"resourceLocation",
")",
";",
"}",
"synchronized",
"(",
"res... | Determines if the {@link Namespace} resource location can be opened for
lookups. To be opened
@param resourceLocation
@return | [
"Determines",
"if",
"the",
"{",
"@link",
"Namespace",
"}",
"resource",
"location",
"can",
"be",
"opened",
"for",
"lookups",
".",
"To",
"be",
"opened"
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/namespace/DefaultNamespaceService.java#L442-L470 |
glyptodon/guacamole-client | extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java | ModeledUserGroup.putRestrictedAttributes | private void putRestrictedAttributes(Map<String, String> attributes) {
"""
Stores all restricted (privileged) attributes within the given Map,
pulling the values of those attributes from the underlying user group
model. If no value is yet defined for an attribute, that attribute will
be set to null.
@param a... | java | private void putRestrictedAttributes(Map<String, String> attributes) {
// Set disabled attribute
attributes.put(DISABLED_ATTRIBUTE_NAME, getModel().isDisabled() ? "true" : null);
} | [
"private",
"void",
"putRestrictedAttributes",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"attributes",
")",
"{",
"// Set disabled attribute",
"attributes",
".",
"put",
"(",
"DISABLED_ATTRIBUTE_NAME",
",",
"getModel",
"(",
")",
".",
"isDisabled",
"(",
")",
"?... | Stores all restricted (privileged) attributes within the given Map,
pulling the values of those attributes from the underlying user group
model. If no value is yet defined for an attribute, that attribute will
be set to null.
@param attributes
The Map to store all restricted attributes within. | [
"Stores",
"all",
"restricted",
"(",
"privileged",
")",
"attributes",
"within",
"the",
"given",
"Map",
"pulling",
"the",
"values",
"of",
"those",
"attributes",
"from",
"the",
"underlying",
"user",
"group",
"model",
".",
"If",
"no",
"value",
"is",
"yet",
"defi... | train | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-jdbc/modules/guacamole-auth-jdbc-base/src/main/java/org/apache/guacamole/auth/jdbc/usergroup/ModeledUserGroup.java#L134-L139 |
sputnikdev/bluetooth-utils | src/main/java/org/sputnikdev/bluetooth/URL.java | URL.copyWith | public URL copyWith(String serviceUUID, String characteristicUUID, String fieldName) {
"""
Makes a copy of a given URL with some additional components.
@param serviceUUID UUID of a GATT service
@param characteristicUUID UUID of a GATT characteristic
@param fieldName name of a field of the characteristic
@retur... | java | public URL copyWith(String serviceUUID, String characteristicUUID, String fieldName) {
return new URL(this.protocol, this.adapterAddress, this.deviceAddress, this.deviceAttributes, serviceUUID,
characteristicUUID, fieldName);
} | [
"public",
"URL",
"copyWith",
"(",
"String",
"serviceUUID",
",",
"String",
"characteristicUUID",
",",
"String",
"fieldName",
")",
"{",
"return",
"new",
"URL",
"(",
"this",
".",
"protocol",
",",
"this",
".",
"adapterAddress",
",",
"this",
".",
"deviceAddress",
... | Makes a copy of a given URL with some additional components.
@param serviceUUID UUID of a GATT service
@param characteristicUUID UUID of a GATT characteristic
@param fieldName name of a field of the characteristic
@return a copy of a given URL with some additional components | [
"Makes",
"a",
"copy",
"of",
"a",
"given",
"URL",
"with",
"some",
"additional",
"components",
"."
] | train | https://github.com/sputnikdev/bluetooth-utils/blob/794e4a8644c1eed54cd043de2bc967f4ef58acca/src/main/java/org/sputnikdev/bluetooth/URL.java#L321-L324 |
jtmelton/appsensor | analysis-engines/appsensor-analysis-reference/src/main/java/org/owasp/appsensor/analysis/ReferenceEventAnalysisEngine.java | ReferenceEventAnalysisEngine.findMostRecentAttackTime | protected DateTime findMostRecentAttackTime(Event event, DetectionPoint configuredDetectionPoint) {
"""
Find most recent {@link Attack} matching the given {@link Event} {@link User}, {@link DetectionPoint}
matching the currently configured detection point (supporting multiple detection points per label),
detecti... | java | protected DateTime findMostRecentAttackTime(Event event, DetectionPoint configuredDetectionPoint) {
DateTime newest = DateUtils.epoch();
SearchCriteria criteria = new SearchCriteria().
setUser(event.getUser()).
setDetectionPoint(configuredDetectionPoint).
setDetectionSystemIds(appSensorServer.getConfig... | [
"protected",
"DateTime",
"findMostRecentAttackTime",
"(",
"Event",
"event",
",",
"DetectionPoint",
"configuredDetectionPoint",
")",
"{",
"DateTime",
"newest",
"=",
"DateUtils",
".",
"epoch",
"(",
")",
";",
"SearchCriteria",
"criteria",
"=",
"new",
"SearchCriteria",
... | Find most recent {@link Attack} matching the given {@link Event} {@link User}, {@link DetectionPoint}
matching the currently configured detection point (supporting multiple detection points per label),
detection system and find it's timestamp.
The {@link Event} should only be counted if they've occurred after the most... | [
"Find",
"most",
"recent",
"{",
"@link",
"Attack",
"}",
"matching",
"the",
"given",
"{",
"@link",
"Event",
"}",
"{",
"@link",
"User",
"}",
"{",
"@link",
"DetectionPoint",
"}",
"matching",
"the",
"currently",
"configured",
"detection",
"point",
"(",
"supportin... | train | https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/analysis-engines/appsensor-analysis-reference/src/main/java/org/owasp/appsensor/analysis/ReferenceEventAnalysisEngine.java#L157-L174 |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsEqual | public boolean hasSlotIsEqual(final String slotName, final String value) {
"""
Checks if a slot is contained in the intent request and also got the value provided.
@param slotName name of the slot to look after
@param value the value
@return True, if slot with slotName has a value equal to the given value
"... | java | public boolean hasSlotIsEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return (slotValue != null && slotValue.equals(value)) ||
slotValue == value;
} | [
"public",
"boolean",
"hasSlotIsEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"slotValue",
"=",
"getSlotValue",
"(",
"slotName",
")",
";",
"return",
"(",
"slotValue",
"!=",
"null",
"&&",
"slotValue",
... | Checks if a slot is contained in the intent request and also got the value provided.
@param slotName name of the slot to look after
@param value the value
@return True, if slot with slotName has a value equal to the given value | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"also",
"got",
"the",
"value",
"provided",
"."
] | train | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L123-L127 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/JdbcWrapper.java | JdbcWrapper.createDataSourceProxy | public DataSource createDataSourceProxy(String name, final DataSource dataSource) {
"""
Crée un proxy d'une {@link DataSource} jdbc.
@param name String
@param dataSource DataSource
@return DataSource
"""
assert dataSource != null;
JdbcWrapperHelper.pullDataSourceProperties(name, dataSource);
final ... | java | public DataSource createDataSourceProxy(String name, final DataSource dataSource) {
assert dataSource != null;
JdbcWrapperHelper.pullDataSourceProperties(name, dataSource);
final InvocationHandler invocationHandler = new AbstractInvocationHandler<DataSource>(
dataSource) {
private static final long se... | [
"public",
"DataSource",
"createDataSourceProxy",
"(",
"String",
"name",
",",
"final",
"DataSource",
"dataSource",
")",
"{",
"assert",
"dataSource",
"!=",
"null",
";",
"JdbcWrapperHelper",
".",
"pullDataSourceProperties",
"(",
"name",
",",
"dataSource",
")",
";",
"... | Crée un proxy d'une {@link DataSource} jdbc.
@param name String
@param dataSource DataSource
@return DataSource | [
"Crée",
"un",
"proxy",
"d",
"une",
"{"
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/JdbcWrapper.java#L771-L789 |
trustathsh/ifmapj | src/main/java/util/DomHelpers.java | DomHelpers.toDocument | public static Document toDocument(String s, Charset c) throws MarshalException {
"""
Marshal a {@link Document} from {@link String} with XML data
@param s string containing XML data
@param c charset used for encoding the string
@return {@link Document} containg the XML data
@throws MarshalException
"""
... | java | public static Document toDocument(String s, Charset c) throws MarshalException {
byte[] bytes = c == null ? s.getBytes() : s.getBytes(c);
ByteArrayInputStream bais = new ByteArrayInputStream(bytes);
return toDocument(bais);
} | [
"public",
"static",
"Document",
"toDocument",
"(",
"String",
"s",
",",
"Charset",
"c",
")",
"throws",
"MarshalException",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"c",
"==",
"null",
"?",
"s",
".",
"getBytes",
"(",
")",
":",
"s",
".",
"getBytes",
"(",
"c"... | Marshal a {@link Document} from {@link String} with XML data
@param s string containing XML data
@param c charset used for encoding the string
@return {@link Document} containg the XML data
@throws MarshalException | [
"Marshal",
"a",
"{",
"@link",
"Document",
"}",
"from",
"{",
"@link",
"String",
"}",
"with",
"XML",
"data"
] | train | https://github.com/trustathsh/ifmapj/blob/44ece9e95a3d2a1b7019573ba6178598a6cbdaa3/src/main/java/util/DomHelpers.java#L470-L476 |
btc-ag/redg | redg-runtime/src/main/java/com/btc/redg/runtime/dummy/DefaultDummyFactory.java | DefaultDummyFactory.createNewDummy | private <T extends RedGEntity> T createNewDummy(AbstractRedG redG, Class<T> dummyClass) {
"""
Creates a new dummy entity of the required type. Required non null foreign keys will be taken from the {@link #getDummy(AbstractRedG, Class)} method
and will be created if necessary as well. If the creation fails for som... | java | private <T extends RedGEntity> T createNewDummy(AbstractRedG redG, Class<T> dummyClass) {
Constructor constructor = Arrays.stream(dummyClass.getDeclaredConstructors())
.filter(this::isDummyRedGEntityConstructor)
.findFirst().orElseThrow(() -> new DummyCreationException("Could ... | [
"private",
"<",
"T",
"extends",
"RedGEntity",
">",
"T",
"createNewDummy",
"(",
"AbstractRedG",
"redG",
",",
"Class",
"<",
"T",
">",
"dummyClass",
")",
"{",
"Constructor",
"constructor",
"=",
"Arrays",
".",
"stream",
"(",
"dummyClass",
".",
"getDeclaredConstruc... | Creates a new dummy entity of the required type. Required non null foreign keys will be taken from the {@link #getDummy(AbstractRedG, Class)} method
and will be created if necessary as well. If the creation fails for some reason, a {@link DummyCreationException} will be thrown.
@param redG The redG instance
@par... | [
"Creates",
"a",
"new",
"dummy",
"entity",
"of",
"the",
"required",
"type",
".",
"Required",
"non",
"null",
"foreign",
"keys",
"will",
"be",
"taken",
"from",
"the",
"{",
"@link",
"#getDummy",
"(",
"AbstractRedG",
"Class",
")",
"}",
"method",
"and",
"will",
... | train | https://github.com/btc-ag/redg/blob/416a68639d002512cabfebff09afd2e1909e27df/redg-runtime/src/main/java/com/btc/redg/runtime/dummy/DefaultDummyFactory.java#L78-L96 |
inkstand-io/scribble | scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/ContentRepository.java | ContentRepository.getAdminSession | public Session getAdminSession() throws RepositoryException {
"""
Logs into the repository as admin user. The session should be logged out after each test if the repository is
used as a {@link org.junit.ClassRule}.
@return a session with admin privileges
@throws RepositoryException
if the login failed for ... | java | public Session getAdminSession() throws RepositoryException {
if(this.isActive(this.adminSession)){
//perform a refresh to update the session to the latest repository version
this.adminSession.refresh(false);
} else {
this.adminSession = this.repository.login(new Sim... | [
"public",
"Session",
"getAdminSession",
"(",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"this",
".",
"isActive",
"(",
"this",
".",
"adminSession",
")",
")",
"{",
"//perform a refresh to update the session to the latest repository version",
"this",
".",
"admin... | Logs into the repository as admin user. The session should be logged out after each test if the repository is
used as a {@link org.junit.ClassRule}.
@return a session with admin privileges
@throws RepositoryException
if the login failed for any reason | [
"Logs",
"into",
"the",
"repository",
"as",
"admin",
"user",
".",
"The",
"session",
"should",
"be",
"logged",
"out",
"after",
"each",
"test",
"if",
"the",
"repository",
"is",
"used",
"as",
"a",
"{",
"@link",
"org",
".",
"junit",
".",
"ClassRule",
"}",
"... | train | https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/rules/ContentRepository.java#L304-L314 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/AbstractInstallPlanJob.java | AbstractInstallPlanJob.installExtension | private ModifableExtensionPlanNode installExtension(ExtensionId extensionId, boolean dependency, String namespace)
throws InstallException {
"""
Install provided extension.
@param extensionId the identifier of the extension to install
@param dependency indicate if the extension is installed as a depend... | java | private ModifableExtensionPlanNode installExtension(ExtensionId extensionId, boolean dependency, String namespace)
throws InstallException
{
// Check if the feature is a root extension
if (namespace != null) {
// Check if the extension already exist on root, throw exception if no... | [
"private",
"ModifableExtensionPlanNode",
"installExtension",
"(",
"ExtensionId",
"extensionId",
",",
"boolean",
"dependency",
",",
"String",
"namespace",
")",
"throws",
"InstallException",
"{",
"// Check if the feature is a root extension",
"if",
"(",
"namespace",
"!=",
"nu... | Install provided extension.
@param extensionId the identifier of the extension to install
@param dependency indicate if the extension is installed as a dependency
@param namespace the namespace where to install the extension
@return the install plan node for the provided extension
@throws InstallException error when t... | [
"Install",
"provided",
"extension",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-extension/xwiki-commons-extension-api/src/main/java/org/xwiki/extension/job/internal/AbstractInstallPlanJob.java#L748-L789 |
RestComm/media-core | network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java | IPAddressCompare.isInRangeV4 | public static boolean isInRangeV4(byte[] network,byte[] subnet,byte[] ipAddress) {
"""
Checks whether ipAddress is in IPV4 network with specified subnet
"""
if(network.length!=4 || subnet.length!=4 || ipAddress.length!=4)
return false;
return compareByteValues(network,subnet,ipAddres... | java | public static boolean isInRangeV4(byte[] network,byte[] subnet,byte[] ipAddress)
{
if(network.length!=4 || subnet.length!=4 || ipAddress.length!=4)
return false;
return compareByteValues(network,subnet,ipAddress);
} | [
"public",
"static",
"boolean",
"isInRangeV4",
"(",
"byte",
"[",
"]",
"network",
",",
"byte",
"[",
"]",
"subnet",
",",
"byte",
"[",
"]",
"ipAddress",
")",
"{",
"if",
"(",
"network",
".",
"length",
"!=",
"4",
"||",
"subnet",
".",
"length",
"!=",
"4",
... | Checks whether ipAddress is in IPV4 network with specified subnet | [
"Checks",
"whether",
"ipAddress",
"is",
"in",
"IPV4",
"network",
"with",
"specified",
"subnet"
] | train | https://github.com/RestComm/media-core/blob/07b8703343708599f60af66bae62aded77ee81b5/network/src/main/java/org/restcomm/media/core/network/deprecated/IPAddressCompare.java#L36-L42 |
square/pollexor | src/main/java/com/squareup/pollexor/ThumborUrlBuilder.java | ThumborUrlBuilder.roundCorner | public static String roundCorner(int radiusInner, int radiusOuter, int color) {
"""
This filter adds rounded corners to the image using the specified color as the background.
@param radiusInner amount of pixels to use as radius.
@param radiusOuter specifies the second value for the ellipse used for the radius.... | java | public static String roundCorner(int radiusInner, int radiusOuter, int color) {
if (radiusInner < 1) {
throw new IllegalArgumentException("Radius must be greater than zero.");
}
if (radiusOuter < 0) {
throw new IllegalArgumentException("Outer radius must be greater than or equal to zero.");
... | [
"public",
"static",
"String",
"roundCorner",
"(",
"int",
"radiusInner",
",",
"int",
"radiusOuter",
",",
"int",
"color",
")",
"{",
"if",
"(",
"radiusInner",
"<",
"1",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Radius must be greater than zero.\""... | This filter adds rounded corners to the image using the specified color as the background.
@param radiusInner amount of pixels to use as radius.
@param radiusOuter specifies the second value for the ellipse used for the radius. Use 0 for
no value.
@param color fill color for clipped region. | [
"This",
"filter",
"adds",
"rounded",
"corners",
"to",
"the",
"image",
"using",
"the",
"specified",
"color",
"as",
"the",
"background",
"."
] | train | https://github.com/square/pollexor/blob/b72430d2799f617f7fcbb2d3ceb27810c9c6d38f/src/main/java/com/squareup/pollexor/ThumborUrlBuilder.java#L601-L620 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Threads.java | Threads.assertUnlocked | public static void assertUnlocked(Object object, String name) {
"""
This is an assertion method that can be used by a thread to confirm that
the thread isn't already holding lock for an object, before acquiring a
lock
@param object
object to test for lock
@param name
tag associated with the lock
"""
... | java | public static void assertUnlocked(Object object, String name) {
if (RUNTIME_ASSERTIONS) {
if (Thread.holdsLock(object)) {
throw new RuntimeAssertion("Recursive lock of %s", name);
}
}
} | [
"public",
"static",
"void",
"assertUnlocked",
"(",
"Object",
"object",
",",
"String",
"name",
")",
"{",
"if",
"(",
"RUNTIME_ASSERTIONS",
")",
"{",
"if",
"(",
"Thread",
".",
"holdsLock",
"(",
"object",
")",
")",
"{",
"throw",
"new",
"RuntimeAssertion",
"(",... | This is an assertion method that can be used by a thread to confirm that
the thread isn't already holding lock for an object, before acquiring a
lock
@param object
object to test for lock
@param name
tag associated with the lock | [
"This",
"is",
"an",
"assertion",
"method",
"that",
"can",
"be",
"used",
"by",
"a",
"thread",
"to",
"confirm",
"that",
"the",
"thread",
"isn",
"t",
"already",
"holding",
"lock",
"for",
"an",
"object",
"before",
"acquiring",
"a",
"lock"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/utility/Threads.java#L703-L709 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/linsol/qr/LinearSolverQr_ZDRM.java | LinearSolverQr_ZDRM.setMaxSize | public void setMaxSize( int maxRows , int maxCols ) {
"""
Changes the size of the matrix it can solve for
@param maxRows Maximum number of rows in the matrix it will decompose.
@param maxCols Maximum number of columns in the matrix it will decompose.
"""
this.maxRows = maxRows; this.maxCols = maxCo... | java | public void setMaxSize( int maxRows , int maxCols )
{
this.maxRows = maxRows; this.maxCols = maxCols;
Q = new ZMatrixRMaj(maxRows,maxRows);
Qt = new ZMatrixRMaj(maxRows,maxRows);
R = new ZMatrixRMaj(maxRows,maxCols);
Y = new ZMatrixRMaj(maxRows,1);
Z = new ZMatrixRM... | [
"public",
"void",
"setMaxSize",
"(",
"int",
"maxRows",
",",
"int",
"maxCols",
")",
"{",
"this",
".",
"maxRows",
"=",
"maxRows",
";",
"this",
".",
"maxCols",
"=",
"maxCols",
";",
"Q",
"=",
"new",
"ZMatrixRMaj",
"(",
"maxRows",
",",
"maxRows",
")",
";",
... | Changes the size of the matrix it can solve for
@param maxRows Maximum number of rows in the matrix it will decompose.
@param maxCols Maximum number of columns in the matrix it will decompose. | [
"Changes",
"the",
"size",
"of",
"the",
"matrix",
"it",
"can",
"solve",
"for"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/linsol/qr/LinearSolverQr_ZDRM.java#L70-L80 |
Azure/azure-sdk-for-java | containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java | TasksInner.getAsync | public Observable<TaskInner> getAsync(String resourceGroupName, String registryName, String taskName) {
"""
Get the properties of a specified task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param ta... | java | public Observable<TaskInner> getAsync(String resourceGroupName, String registryName, String taskName) {
return getWithServiceResponseAsync(resourceGroupName, registryName, taskName).map(new Func1<ServiceResponse<TaskInner>, TaskInner>() {
@Override
public TaskInner call(ServiceResponse<T... | [
"public",
"Observable",
"<",
"TaskInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"registryName",
",",
"String",
"taskName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"registryName",
",",
"taskName",
... | Get the properties of a specified task.
@param resourceGroupName The name of the resource group to which the container registry belongs.
@param registryName The name of the container registry.
@param taskName The name of the container registry task.
@throws IllegalArgumentException thrown if parameters fail the valida... | [
"Get",
"the",
"properties",
"of",
"a",
"specified",
"task",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2018_09_01/src/main/java/com/microsoft/azure/management/containerregistry/v2018_09_01/implementation/TasksInner.java#L268-L275 |
mabe02/lanterna | src/main/java/com/googlecode/lanterna/gui2/GridLayout.java | GridLayout.createLayoutData | public static LayoutData createLayoutData(
Alignment horizontalAlignment,
Alignment verticalAlignment,
boolean grabExtraHorizontalSpace,
boolean grabExtraVerticalSpace) {
"""
Creates a layout data object for {@code GridLayout}:s that specify the horizontal and vertic... | java | public static LayoutData createLayoutData(
Alignment horizontalAlignment,
Alignment verticalAlignment,
boolean grabExtraHorizontalSpace,
boolean grabExtraVerticalSpace) {
return createLayoutData(horizontalAlignment, verticalAlignment, grabExtraHorizontalSpace, gr... | [
"public",
"static",
"LayoutData",
"createLayoutData",
"(",
"Alignment",
"horizontalAlignment",
",",
"Alignment",
"verticalAlignment",
",",
"boolean",
"grabExtraHorizontalSpace",
",",
"boolean",
"grabExtraVerticalSpace",
")",
"{",
"return",
"createLayoutData",
"(",
"horizont... | Creates a layout data object for {@code GridLayout}:s that specify the horizontal and vertical alignment for the
component in case the cell space is larger than the preferred size of the component. This method also has fields
for indicating that the component would like to take more space if available to the container.... | [
"Creates",
"a",
"layout",
"data",
"object",
"for",
"{",
"@code",
"GridLayout",
"}",
":",
"s",
"that",
"specify",
"the",
"horizontal",
"and",
"vertical",
"alignment",
"for",
"the",
"component",
"in",
"case",
"the",
"cell",
"space",
"is",
"larger",
"than",
"... | train | https://github.com/mabe02/lanterna/blob/8dfd62206ff46ab10223b2ef2dbb0a2c51850954/src/main/java/com/googlecode/lanterna/gui2/GridLayout.java#L131-L138 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/FontSelector.java | FontSelector.addFont | public void addFont(Font font) {
"""
Adds a <CODE>Font</CODE> to be searched for valid characters.
@param font the <CODE>Font</CODE>
"""
if (font.getBaseFont() != null) {
fonts.add(font);
return;
}
BaseFont bf = font.getCalculatedBaseFont(true);
Font f2 ... | java | public void addFont(Font font) {
if (font.getBaseFont() != null) {
fonts.add(font);
return;
}
BaseFont bf = font.getCalculatedBaseFont(true);
Font f2 = new Font(bf, font.getSize(), font.getCalculatedStyle(), font.getColor());
fonts.add(f2);
} | [
"public",
"void",
"addFont",
"(",
"Font",
"font",
")",
"{",
"if",
"(",
"font",
".",
"getBaseFont",
"(",
")",
"!=",
"null",
")",
"{",
"fonts",
".",
"add",
"(",
"font",
")",
";",
"return",
";",
"}",
"BaseFont",
"bf",
"=",
"font",
".",
"getCalculatedB... | Adds a <CODE>Font</CODE> to be searched for valid characters.
@param font the <CODE>Font</CODE> | [
"Adds",
"a",
"<CODE",
">",
"Font<",
"/",
"CODE",
">",
"to",
"be",
"searched",
"for",
"valid",
"characters",
"."
] | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/FontSelector.java#L72-L80 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/NetworkInterfacesInner.java | NetworkInterfacesInner.createOrUpdateAsync | public Observable<NetworkInterfaceInner> createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
"""
Creates or updates a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interf... | java | public Observable<NetworkInterfaceInner> createOrUpdateAsync(String resourceGroupName, String networkInterfaceName, NetworkInterfaceInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, parameters).map(new Func1<ServiceResponse<NetworkInterfaceInner>, Network... | [
"public",
"Observable",
"<",
"NetworkInterfaceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
",",
"NetworkInterfaceInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourc... | Creates or updates a network interface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@param parameters Parameters supplied to the create or update network interface operation.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Creates",
"or",
"updates",
"a",
"network",
"interface",
"."
] | 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/NetworkInterfacesInner.java#L520-L527 |
apache/incubator-druid | core/src/main/java/org/apache/druid/java/util/common/Numbers.java | Numbers.parseBoolean | public static boolean parseBoolean(Object val) {
"""
Parse the given object as a {@code boolean}. The input object can be a {@link String} or {@link Boolean}.
@return {@code true} only if the input is a {@link Boolean} representing {@code true} or a {@link String} of
{@code "true"}.
@throws NullPointerExcep... | java | public static boolean parseBoolean(Object val)
{
if (val instanceof String) {
return Boolean.parseBoolean((String) val);
} else if (val instanceof Boolean) {
return (boolean) val;
} else {
if (val == null) {
throw new NullPointerException("Input is null");
} else {
... | [
"public",
"static",
"boolean",
"parseBoolean",
"(",
"Object",
"val",
")",
"{",
"if",
"(",
"val",
"instanceof",
"String",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"(",
"String",
")",
"val",
")",
";",
"}",
"else",
"if",
"(",
"val",
"insta... | Parse the given object as a {@code boolean}. The input object can be a {@link String} or {@link Boolean}.
@return {@code true} only if the input is a {@link Boolean} representing {@code true} or a {@link String} of
{@code "true"}.
@throws NullPointerException if the input is null.
@throws ISE if the input is not a st... | [
"Parse",
"the",
"given",
"object",
"as",
"a",
"{",
"@code",
"boolean",
"}",
".",
"The",
"input",
"object",
"can",
"be",
"a",
"{",
"@link",
"String",
"}",
"or",
"{",
"@link",
"Boolean",
"}",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/core/src/main/java/org/apache/druid/java/util/common/Numbers.java#L80-L93 |
undertow-io/undertow | core/src/main/java/io/undertow/server/HttpServerExchange.java | HttpServerExchange.addResponseCommitListener | public void addResponseCommitListener(final ResponseCommitListener listener) {
"""
Adds a listener that will be invoked on response commit
@param listener The response listener
"""
//technically it is possible to modify the exchange after the response conduit has been created
//as the respo... | java | public void addResponseCommitListener(final ResponseCommitListener listener) {
//technically it is possible to modify the exchange after the response conduit has been created
//as the response channel should not be retrieved until it is about to be written to
//if we get complaints about this w... | [
"public",
"void",
"addResponseCommitListener",
"(",
"final",
"ResponseCommitListener",
"listener",
")",
"{",
"//technically it is possible to modify the exchange after the response conduit has been created",
"//as the response channel should not be retrieved until it is about to be written to",
... | Adds a listener that will be invoked on response commit
@param listener The response listener | [
"Adds",
"a",
"listener",
"that",
"will",
"be",
"invoked",
"on",
"response",
"commit"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/HttpServerExchange.java#L1836-L1848 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java | DefaultAnnotationMetadata.addDefaultAnnotationValues | protected final void addDefaultAnnotationValues(String annotation, Map<CharSequence, Object> values) {
"""
Adds an annotation directly declared on the element and its member values, if the annotation already exists the
data will be merged with existing values replaced.
@param annotation The annotation
@param ... | java | protected final void addDefaultAnnotationValues(String annotation, Map<CharSequence, Object> values) {
if (annotation != null) {
Map<String, Map<CharSequence, Object>> annotationDefaults = this.annotationDefaultValues;
if (annotationDefaults == null) {
this.annotationDefa... | [
"protected",
"final",
"void",
"addDefaultAnnotationValues",
"(",
"String",
"annotation",
",",
"Map",
"<",
"CharSequence",
",",
"Object",
">",
"values",
")",
"{",
"if",
"(",
"annotation",
"!=",
"null",
")",
"{",
"Map",
"<",
"String",
",",
"Map",
"<",
"CharS... | Adds an annotation directly declared on the element and its member values, if the annotation already exists the
data will be merged with existing values replaced.
@param annotation The annotation
@param values The values | [
"Adds",
"an",
"annotation",
"directly",
"declared",
"on",
"the",
"element",
"and",
"its",
"member",
"values",
"if",
"the",
"annotation",
"already",
"exists",
"the",
"data",
"will",
"be",
"merged",
"with",
"existing",
"values",
"replaced",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/annotation/DefaultAnnotationMetadata.java#L479-L489 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java | RouteFiltersInner.beginUpdateAsync | public Observable<RouteFilterInner> beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) {
"""
Updates a route filter in a specified resource group.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter... | java | public Observable<RouteFilterInner> beginUpdateAsync(String resourceGroupName, String routeFilterName, PatchRouteFilter routeFilterParameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, routeFilterName, routeFilterParameters).map(new Func1<ServiceResponse<RouteFilterInner>, RouteFilterInner... | [
"public",
"Observable",
"<",
"RouteFilterInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"routeFilterName",
",",
"PatchRouteFilter",
"routeFilterParameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName... | Updates a route filter in a specified resource group.
@param resourceGroupName The name of the resource group.
@param routeFilterName The name of the route filter.
@param routeFilterParameters Parameters supplied to the update route filter operation.
@throws IllegalArgumentException thrown if parameters fail the valid... | [
"Updates",
"a",
"route",
"filter",
"in",
"a",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/RouteFiltersInner.java#L713-L720 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ScanAPI.java | ScanAPI.productCreate | public static ProductCreateResult productCreate(String accessToken, ProductCreate productCreate) {
"""
创建商品
@param accessToken accessToken
@param productCreate productCreate
@return ProductCreateResult
"""
return productCreate(accessToken, JsonUtil.toJSONString(productCreate));
} | java | public static ProductCreateResult productCreate(String accessToken, ProductCreate productCreate) {
return productCreate(accessToken, JsonUtil.toJSONString(productCreate));
} | [
"public",
"static",
"ProductCreateResult",
"productCreate",
"(",
"String",
"accessToken",
",",
"ProductCreate",
"productCreate",
")",
"{",
"return",
"productCreate",
"(",
"accessToken",
",",
"JsonUtil",
".",
"toJSONString",
"(",
"productCreate",
")",
")",
";",
"}"
] | 创建商品
@param accessToken accessToken
@param productCreate productCreate
@return ProductCreateResult | [
"创建商品"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ScanAPI.java#L46-L48 |
pedrovgs/DraggablePanel | draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java | DraggableViewCallback.onViewPositionChanged | @Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
"""
Override method used to apply different scale and alpha effects while the view is being
dragged.
@param left position.
@param top position.
@param dx change in X position from the last call.
@param dy chan... | java | @Override public void onViewPositionChanged(View changedView, int left, int top, int dx, int dy) {
if (draggableView.isDragViewAtBottom()) {
draggableView.changeDragViewViewAlpha();
} else {
draggableView.restoreAlpha();
draggableView.changeDragViewScale();
draggableView.changeDragViewPo... | [
"@",
"Override",
"public",
"void",
"onViewPositionChanged",
"(",
"View",
"changedView",
",",
"int",
"left",
",",
"int",
"top",
",",
"int",
"dx",
",",
"int",
"dy",
")",
"{",
"if",
"(",
"draggableView",
".",
"isDragViewAtBottom",
"(",
")",
")",
"{",
"dragg... | Override method used to apply different scale and alpha effects while the view is being
dragged.
@param left position.
@param top position.
@param dx change in X position from the last call.
@param dy change in Y position from the last call. | [
"Override",
"method",
"used",
"to",
"apply",
"different",
"scale",
"and",
"alpha",
"effects",
"while",
"the",
"view",
"is",
"being",
"dragged",
"."
] | train | https://github.com/pedrovgs/DraggablePanel/blob/6b6d1806fa4140113f31307a2571bf02435aa53a/draggablepanel/src/main/java/com/github/pedrovgs/DraggableViewCallback.java#L56-L67 |
google/jimfs | jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java | JimfsFileStore.setAttribute | void setAttribute(File file, String attribute, Object value) {
"""
Sets the given attribute to the given value for the given file.
"""
state.checkOpen();
// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter
attributes.setAttribute(file, attribute, value, false);
} | java | void setAttribute(File file, String attribute, Object value) {
state.checkOpen();
// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter
attributes.setAttribute(file, attribute, value, false);
} | [
"void",
"setAttribute",
"(",
"File",
"file",
",",
"String",
"attribute",
",",
"Object",
"value",
")",
"{",
"state",
".",
"checkOpen",
"(",
")",
";",
"// TODO(cgdecker): Change attribute stuff to avoid the sad boolean parameter",
"attributes",
".",
"setAttribute",
"(",
... | Sets the given attribute to the given value for the given file. | [
"Sets",
"the",
"given",
"attribute",
"to",
"the",
"given",
"value",
"for",
"the",
"given",
"file",
"."
] | train | https://github.com/google/jimfs/blob/3eadff747a3afa7b498030f420d2d04ce700534a/jimfs/src/main/java/com/google/common/jimfs/JimfsFileStore.java#L198-L202 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/streaming/messages/StreamInitMessage.java | StreamInitMessage.createMessage | public ByteBuffer createMessage(boolean compress, int version) {
"""
Create serialized message.
@param compress true if message is compressed
@param version Streaming protocol version
@return serialized message in ByteBuffer format
"""
int header = 0;
// set compression bit.
if (co... | java | public ByteBuffer createMessage(boolean compress, int version)
{
int header = 0;
// set compression bit.
if (compress)
header |= 4;
// set streaming bit
header |= 8;
// Setting up the version bit
header |= (version << 8);
byte[] bytes;
... | [
"public",
"ByteBuffer",
"createMessage",
"(",
"boolean",
"compress",
",",
"int",
"version",
")",
"{",
"int",
"header",
"=",
"0",
";",
"// set compression bit.",
"if",
"(",
"compress",
")",
"header",
"|=",
"4",
";",
"// set streaming bit",
"header",
"|=",
"8",
... | Create serialized message.
@param compress true if message is compressed
@param version Streaming protocol version
@return serialized message in ByteBuffer format | [
"Create",
"serialized",
"message",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/streaming/messages/StreamInitMessage.java#L66-L97 |
sockeqwe/sqlbrite-dao | objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java | ObjectMappableProcessor.generateRxMappingMethod | private FieldSpec generateRxMappingMethod(ObjectMappableAnnotatedClass clazz) {
"""
Generates the field that can be used as RxJava method
@param clazz The {@link ObjectMappableAnnotatedClass}
@return MethodSpec
"""
String objectVarName = "item";
String cursorVarName = "cursor";
TypeName eleme... | java | private FieldSpec generateRxMappingMethod(ObjectMappableAnnotatedClass clazz) {
String objectVarName = "item";
String cursorVarName = "cursor";
TypeName elementType = ClassName.get(clazz.getElement().asType());
// new Func1<Cursor, ListsItem>()
CodeBlock.Builder initBlockBuilder = CodeBlock.buil... | [
"private",
"FieldSpec",
"generateRxMappingMethod",
"(",
"ObjectMappableAnnotatedClass",
"clazz",
")",
"{",
"String",
"objectVarName",
"=",
"\"item\"",
";",
"String",
"cursorVarName",
"=",
"\"cursor\"",
";",
"TypeName",
"elementType",
"=",
"ClassName",
".",
"get",
"(",... | Generates the field that can be used as RxJava method
@param clazz The {@link ObjectMappableAnnotatedClass}
@return MethodSpec | [
"Generates",
"the",
"field",
"that",
"can",
"be",
"used",
"as",
"RxJava",
"method"
] | train | https://github.com/sockeqwe/sqlbrite-dao/blob/8d02b76f00bd2f8997a58d33146b98b2eec35452/objectmapper-processor/src/main/java/com/hannesdorfmann/sqlbrite/objectmapper/processor/ObjectMappableProcessor.java#L172-L216 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/instance/NodeShutdownHelper.java | NodeShutdownHelper.shutdownNodeByFiringEvents | public static void shutdownNodeByFiringEvents(Node node, boolean terminate) {
"""
Shutdowns a node by firing lifecycle events. Do not call this method for every node shutdown scenario
since {@link com.hazelcast.core.LifecycleListener}s will end up more than one
{@link com.hazelcast.core.LifecycleEvent.LifecycleS... | java | public static void shutdownNodeByFiringEvents(Node node, boolean terminate) {
final HazelcastInstanceImpl hazelcastInstance = node.hazelcastInstance;
final LifecycleServiceImpl lifecycleService = hazelcastInstance.getLifecycleService();
lifecycleService.fireLifecycleEvent(LifecycleEvent.Lifecycl... | [
"public",
"static",
"void",
"shutdownNodeByFiringEvents",
"(",
"Node",
"node",
",",
"boolean",
"terminate",
")",
"{",
"final",
"HazelcastInstanceImpl",
"hazelcastInstance",
"=",
"node",
".",
"hazelcastInstance",
";",
"final",
"LifecycleServiceImpl",
"lifecycleService",
... | Shutdowns a node by firing lifecycle events. Do not call this method for every node shutdown scenario
since {@link com.hazelcast.core.LifecycleListener}s will end up more than one
{@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTTING_DOWN}
or {@link com.hazelcast.core.LifecycleEvent.LifecycleState#SHUTDOWN} ... | [
"Shutdowns",
"a",
"node",
"by",
"firing",
"lifecycle",
"events",
".",
"Do",
"not",
"call",
"this",
"method",
"for",
"every",
"node",
"shutdown",
"scenario",
"since",
"{",
"@link",
"com",
".",
"hazelcast",
".",
"core",
".",
"LifecycleListener",
"}",
"s",
"w... | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/instance/NodeShutdownHelper.java#L40-L46 |
apache/groovy | src/main/groovy/groovy/lang/GroovyClassLoader.java | GroovyClassLoader.parseClass | public Class parseClass(final String text, final String fileName) throws CompilationFailedException {
"""
Parses the given text into a Java class capable of being run
@param text the text of the script/class to parse
@param fileName the file name to use as the name of the class
@return the main class defi... | java | public Class parseClass(final String text, final String fileName) throws CompilationFailedException {
GroovyCodeSource gcs = AccessController.doPrivileged(new PrivilegedAction<GroovyCodeSource>() {
public GroovyCodeSource run() {
return new GroovyCodeSource(text, fileName, "/groovy/s... | [
"public",
"Class",
"parseClass",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"fileName",
")",
"throws",
"CompilationFailedException",
"{",
"GroovyCodeSource",
"gcs",
"=",
"AccessController",
".",
"doPrivileged",
"(",
"new",
"PrivilegedAction",
"<",
"Groo... | Parses the given text into a Java class capable of being run
@param text the text of the script/class to parse
@param fileName the file name to use as the name of the class
@return the main class defined in the given script | [
"Parses",
"the",
"given",
"text",
"into",
"a",
"Java",
"class",
"capable",
"of",
"being",
"run"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/GroovyClassLoader.java#L244-L252 |
lessthanoptimal/ejml | main/ejml-simple/src/org/ejml/simple/SimpleBase.java | SimpleBase.setRow | public void setRow( int row , int startColumn , double ...values ) {
"""
<p>
Assigns consecutive elements inside a row to the provided array.<br>
<br>
A(row,offset:(offset + values.length)) = values
</p>
@param row The row that the array is to be written to.
@param startColumn The initial column that the a... | java | public void setRow( int row , int startColumn , double ...values ) {
ops.setRow(mat,row,startColumn,values);
} | [
"public",
"void",
"setRow",
"(",
"int",
"row",
",",
"int",
"startColumn",
",",
"double",
"...",
"values",
")",
"{",
"ops",
".",
"setRow",
"(",
"mat",
",",
"row",
",",
"startColumn",
",",
"values",
")",
";",
"}"
] | <p>
Assigns consecutive elements inside a row to the provided array.<br>
<br>
A(row,offset:(offset + values.length)) = values
</p>
@param row The row that the array is to be written to.
@param startColumn The initial column that the array is written to.
@param values Values which are to be written to the row in a matr... | [
"<p",
">",
"Assigns",
"consecutive",
"elements",
"inside",
"a",
"row",
"to",
"the",
"provided",
"array",
".",
"<br",
">",
"<br",
">",
"A",
"(",
"row",
"offset",
":",
"(",
"offset",
"+",
"values",
".",
"length",
"))",
"=",
"values",
"<",
"/",
"p",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-simple/src/org/ejml/simple/SimpleBase.java#L661-L663 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/HashMap.java | HashMap.treeifyBin | final void treeifyBin(Node<K,V>[] tab, int hash) {
"""
Replaces all linked nodes in bin at index for given hash unless
table is too small, in which case resizes instead.
"""
int n, index; Node<K,V> e;
if (tab == null || (n = tab.length) < MIN_TREEIFY_CAPACITY)
resize();
els... | java | final void treeifyBin(Node<K,V>[] tab, int hash) {
int n, index; Node<K,V> e;
if (tab == null || (n = tab.length) < MIN_TREEIFY_CAPACITY)
resize();
else if ((e = tab[index = (n - 1) & hash]) != null) {
TreeNode<K,V> hd = null, tl = null;
do {
T... | [
"final",
"void",
"treeifyBin",
"(",
"Node",
"<",
"K",
",",
"V",
">",
"[",
"]",
"tab",
",",
"int",
"hash",
")",
"{",
"int",
"n",
",",
"index",
";",
"Node",
"<",
"K",
",",
"V",
">",
"e",
";",
"if",
"(",
"tab",
"==",
"null",
"||",
"(",
"n",
... | Replaces all linked nodes in bin at index for given hash unless
table is too small, in which case resizes instead. | [
"Replaces",
"all",
"linked",
"nodes",
"in",
"bin",
"at",
"index",
"for",
"given",
"hash",
"unless",
"table",
"is",
"too",
"small",
"in",
"which",
"case",
"resizes",
"instead",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/HashMap.java#L760-L779 |
mediathekview/MServer | src/main/java/mServer/tool/MserverDatumZeit.java | MserverDatumZeit.formatDate | public static String formatDate(String dateValue, FastDateFormat sdf) {
"""
formats a date/datetime string to the date format used in DatenFilm
@param dateValue the date/datetime value
@param sdf the format of dateValue
@return the formatted date string
"""
try {
return FDF_OUT_DAY.forma... | java | public static String formatDate(String dateValue, FastDateFormat sdf) {
try {
return FDF_OUT_DAY.format(sdf.parse(dateValue));
} catch (ParseException ex) {
LOG.debug(String.format("Fehler beim Parsen des Datums %s: %s", dateValue, ex.getMessage()));
}
re... | [
"public",
"static",
"String",
"formatDate",
"(",
"String",
"dateValue",
",",
"FastDateFormat",
"sdf",
")",
"{",
"try",
"{",
"return",
"FDF_OUT_DAY",
".",
"format",
"(",
"sdf",
".",
"parse",
"(",
"dateValue",
")",
")",
";",
"}",
"catch",
"(",
"ParseExceptio... | formats a date/datetime string to the date format used in DatenFilm
@param dateValue the date/datetime value
@param sdf the format of dateValue
@return the formatted date string | [
"formats",
"a",
"date",
"/",
"datetime",
"string",
"to",
"the",
"date",
"format",
"used",
"in",
"DatenFilm"
] | train | https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/tool/MserverDatumZeit.java#L82-L90 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java | DateIntervalInfo.genPatternInfo | @Deprecated
public static PatternInfo genPatternInfo(String intervalPattern,
boolean laterDateFirst) {
"""
Break interval patterns as 2 part and save them into pattern info.
@param intervalPattern interval pattern
@param laterDateFirst whether the first date in interv... | java | @Deprecated
public static PatternInfo genPatternInfo(String intervalPattern,
boolean laterDateFirst) {
int splitPoint = splitPatternInto2Part(intervalPattern);
String firstPart = intervalPattern.substring(0, splitPoint);
String secondPart = null;
... | [
"@",
"Deprecated",
"public",
"static",
"PatternInfo",
"genPatternInfo",
"(",
"String",
"intervalPattern",
",",
"boolean",
"laterDateFirst",
")",
"{",
"int",
"splitPoint",
"=",
"splitPatternInto2Part",
"(",
"intervalPattern",
")",
";",
"String",
"firstPart",
"=",
"in... | Break interval patterns as 2 part and save them into pattern info.
@param intervalPattern interval pattern
@param laterDateFirst whether the first date in intervalPattern
is earlier date or later date
@return pattern info object
@deprecated This API is ICU internal only.
@hide original deprecated dec... | [
"Break",
"interval",
"patterns",
"as",
"2",
"part",
"and",
"save",
"them",
"into",
"pattern",
"info",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalInfo.java#L818-L830 |
roboconf/roboconf-platform | core/roboconf-agent/src/main/java/net/roboconf/agent/internal/AgentProperties.java | AgentProperties.readIaasProperties | public static AgentProperties readIaasProperties( String rawProperties, Logger logger ) throws IOException {
"""
Creates a new bean from raw properties that will be parsed.
@param rawProperties a non-null string
@param logger a logger (not null)
@return a non-null bean
@throws IOException if there were files t... | java | public static AgentProperties readIaasProperties( String rawProperties, Logger logger ) throws IOException {
Properties props = Utils.readPropertiesQuietly( rawProperties, logger );
return readIaasProperties( props );
} | [
"public",
"static",
"AgentProperties",
"readIaasProperties",
"(",
"String",
"rawProperties",
",",
"Logger",
"logger",
")",
"throws",
"IOException",
"{",
"Properties",
"props",
"=",
"Utils",
".",
"readPropertiesQuietly",
"(",
"rawProperties",
",",
"logger",
")",
";",... | Creates a new bean from raw properties that will be parsed.
@param rawProperties a non-null string
@param logger a logger (not null)
@return a non-null bean
@throws IOException if there were files that failed to be written | [
"Creates",
"a",
"new",
"bean",
"from",
"raw",
"properties",
"that",
"will",
"be",
"parsed",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/AgentProperties.java#L166-L170 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java | PageFlowControlContainerFactory.getControlContainer | public static synchronized PageFlowControlContainer getControlContainer(HttpServletRequest request, ServletContext servletContext) {
"""
This method will return the <code>PageFlowControlContainer</code> that is acting as the
control container for the page flow runtime.
@param request The current request
@param ... | java | public static synchronized PageFlowControlContainer getControlContainer(HttpServletRequest request, ServletContext servletContext)
{
PageFlowControlContainer pfcc = (PageFlowControlContainer) getSessionVar(request, servletContext, PAGEFLOW_CONTROL_CONTAINER);
if (pfcc != null)
return pfc... | [
"public",
"static",
"synchronized",
"PageFlowControlContainer",
"getControlContainer",
"(",
"HttpServletRequest",
"request",
",",
"ServletContext",
"servletContext",
")",
"{",
"PageFlowControlContainer",
"pfcc",
"=",
"(",
"PageFlowControlContainer",
")",
"getSessionVar",
"(",... | This method will return the <code>PageFlowControlContainer</code> that is acting as the
control container for the page flow runtime.
@param request The current request
@param servletContext The servlet context
@return The <code>pageFLowControlContainer</code> acting as the control container. | [
"This",
"method",
"will",
"return",
"the",
"<code",
">",
"PageFlowControlContainer<",
"/",
"code",
">",
"that",
"is",
"acting",
"as",
"the",
"control",
"container",
"for",
"the",
"page",
"flow",
"runtime",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowControlContainerFactory.java#L40-L49 |
Impetus/Kundera | src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClientFactory.java | OracleNoSQLClientFactory.populateIndexer | private void populateIndexer(String indexerClass, Client client) {
"""
Populates {@link Indexer} into {@link IndexManager}
@param indexerClass
@param client
"""
if (indexerClass != null && indexerClass.equals(OracleNoSQLInvertedIndexer.class.getName()))
{
((OracleNoSQLInvertedIn... | java | private void populateIndexer(String indexerClass, Client client)
{
if (indexerClass != null && indexerClass.equals(OracleNoSQLInvertedIndexer.class.getName()))
{
((OracleNoSQLInvertedIndexer) indexManager.getIndexer()).setKvStore(kvStore);
((OracleNoSQLInvertedIndexer) indexM... | [
"private",
"void",
"populateIndexer",
"(",
"String",
"indexerClass",
",",
"Client",
"client",
")",
"{",
"if",
"(",
"indexerClass",
"!=",
"null",
"&&",
"indexerClass",
".",
"equals",
"(",
"OracleNoSQLInvertedIndexer",
".",
"class",
".",
"getName",
"(",
")",
")"... | Populates {@link Indexer} into {@link IndexManager}
@param indexerClass
@param client | [
"Populates",
"{",
"@link",
"Indexer",
"}",
"into",
"{",
"@link",
"IndexManager",
"}"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-oracle-nosql/src/main/java/com/impetus/client/oraclenosql/OracleNoSQLClientFactory.java#L143-L151 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.listFirewallRulesWithServiceResponseAsync | public Observable<ServiceResponse<Page<FirewallRuleInner>>> listFirewallRulesWithServiceResponseAsync(final String resourceGroupName, final String accountName) {
"""
Lists the Data Lake Store firewall rules within the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource gro... | java | public Observable<ServiceResponse<Page<FirewallRuleInner>>> listFirewallRulesWithServiceResponseAsync(final String resourceGroupName, final String accountName) {
return listFirewallRulesSinglePageAsync(resourceGroupName, accountName)
.concatMap(new Func1<ServiceResponse<Page<FirewallRuleInner>>, Obs... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"FirewallRuleInner",
">",
">",
">",
"listFirewallRulesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"accountName",
")",
"{",
"return",
"listFirewallRulesS... | Lists the Data Lake Store firewall rules within the specified Data Lake Store account.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account.
@param accountName The name of the Data Lake Store account from which to get the firewall rules.
@throws IllegalArgumentExcepti... | [
"Lists",
"the",
"Data",
"Lake",
"Store",
"firewall",
"rules",
"within",
"the",
"specified",
"Data",
"Lake",
"Store",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakestore/v2015_10_01_preview/implementation/AccountsInner.java#L392-L404 |
lightblueseas/swing-components | src/main/java/de/alpharogroup/swing/components/factories/JComponentFactory.java | JComponentFactory.newSplashScreen | public static SplashScreen newSplashScreen(final String image, final String text) {
"""
Factory method for create a {@link SplashScreen}.
@param image
the image
@param text
the text
@return the new {@link SplashScreen}.
"""
final SplashScreen splashscreen = new SplashScreen(image, text);
return spla... | java | public static SplashScreen newSplashScreen(final String image, final String text)
{
final SplashScreen splashscreen = new SplashScreen(image, text);
return splashscreen;
} | [
"public",
"static",
"SplashScreen",
"newSplashScreen",
"(",
"final",
"String",
"image",
",",
"final",
"String",
"text",
")",
"{",
"final",
"SplashScreen",
"splashscreen",
"=",
"new",
"SplashScreen",
"(",
"image",
",",
"text",
")",
";",
"return",
"splashscreen",
... | Factory method for create a {@link SplashScreen}.
@param image
the image
@param text
the text
@return the new {@link SplashScreen}. | [
"Factory",
"method",
"for",
"create",
"a",
"{",
"@link",
"SplashScreen",
"}",
"."
] | train | https://github.com/lightblueseas/swing-components/blob/4045e85cabd8f0ce985cbfff134c3c9873930c79/src/main/java/de/alpharogroup/swing/components/factories/JComponentFactory.java#L298-L302 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeLine.java | ST_MakeLine.createLine | public static LineString createLine(Geometry pointA, Geometry... optionalPoints) throws SQLException {
"""
Constructs a LINESTRING from the given POINTs or MULTIPOINTs
@param pointA The first POINT or MULTIPOINT
@param optionalPoints Optional POINTs or MULTIPOINTs
@return The LINESTRING constructed from the g... | java | public static LineString createLine(Geometry pointA, Geometry... optionalPoints) throws SQLException {
if( pointA == null || optionalPoints.length > 0 && optionalPoints[0] == null) {
return null;
}
if (pointA.getNumGeometries() == 1 && !atLeastTwoPoints(optionalPoints, countPoints(po... | [
"public",
"static",
"LineString",
"createLine",
"(",
"Geometry",
"pointA",
",",
"Geometry",
"...",
"optionalPoints",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"pointA",
"==",
"null",
"||",
"optionalPoints",
".",
"length",
">",
"0",
"&&",
"optionalPoints",
... | Constructs a LINESTRING from the given POINTs or MULTIPOINTs
@param pointA The first POINT or MULTIPOINT
@param optionalPoints Optional POINTs or MULTIPOINTs
@return The LINESTRING constructed from the given POINTs or MULTIPOINTs
@throws SQLException | [
"Constructs",
"a",
"LINESTRING",
"from",
"the",
"given",
"POINTs",
"or",
"MULTIPOINTs"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/create/ST_MakeLine.java#L57-L71 |
reactor/reactor-netty | src/main/java/reactor/netty/http/client/HttpClient.java | HttpClient.cookiesWhen | public final HttpClient cookiesWhen(String name, Function<? super Cookie, Mono<? extends Cookie>> cookieBuilder) {
"""
Apply cookies configuration emitted by the returned Mono before requesting.
@param cookieBuilder the cookies {@link Function} to invoke before sending
@return a new {@link HttpClient}
""... | java | public final HttpClient cookiesWhen(String name, Function<? super Cookie, Mono<? extends Cookie>> cookieBuilder) {
return new HttpClientCookieWhen(this, name, cookieBuilder);
} | [
"public",
"final",
"HttpClient",
"cookiesWhen",
"(",
"String",
"name",
",",
"Function",
"<",
"?",
"super",
"Cookie",
",",
"Mono",
"<",
"?",
"extends",
"Cookie",
">",
">",
"cookieBuilder",
")",
"{",
"return",
"new",
"HttpClientCookieWhen",
"(",
"this",
",",
... | Apply cookies configuration emitted by the returned Mono before requesting.
@param cookieBuilder the cookies {@link Function} to invoke before sending
@return a new {@link HttpClient} | [
"Apply",
"cookies",
"configuration",
"emitted",
"by",
"the",
"returned",
"Mono",
"before",
"requesting",
"."
] | train | https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/http/client/HttpClient.java#L446-L448 |
xiancloud/xian | xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/GelfMessage.java | GelfMessage.toJson | public void toJson(ByteBuffer byteBuffer, String additionalFieldPrefix) {
"""
Create a JSON representation for this {@link GelfMessage} and write it to the {@link ByteBuffer}. Additional fields are
prefixed with {@code additionalFieldPrefix}.
@param byteBuffer must not be {@literal null}
@param additionalFiel... | java | public void toJson(ByteBuffer byteBuffer, String additionalFieldPrefix) {
toJson(OutputAccessor.from(byteBuffer), additionalFieldPrefix);
} | [
"public",
"void",
"toJson",
"(",
"ByteBuffer",
"byteBuffer",
",",
"String",
"additionalFieldPrefix",
")",
"{",
"toJson",
"(",
"OutputAccessor",
".",
"from",
"(",
"byteBuffer",
")",
",",
"additionalFieldPrefix",
")",
";",
"}"
] | Create a JSON representation for this {@link GelfMessage} and write it to the {@link ByteBuffer}. Additional fields are
prefixed with {@code additionalFieldPrefix}.
@param byteBuffer must not be {@literal null}
@param additionalFieldPrefix must not be {@literal null} | [
"Create",
"a",
"JSON",
"representation",
"for",
"this",
"{",
"@link",
"GelfMessage",
"}",
"and",
"write",
"it",
"to",
"the",
"{",
"@link",
"ByteBuffer",
"}",
".",
"Additional",
"fields",
"are",
"prefixed",
"with",
"{",
"@code",
"additionalFieldPrefix",
"}",
... | train | https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-log/xian-gelf-common/src/main/java/biz/paluch/logging/gelf/intern/GelfMessage.java#L142-L144 |
gallandarakhneorg/afc | advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/primitive/RoadNetworkConstants.java | RoadNetworkConstants.getSystemDefault | @Pure
public static String getSystemDefault(TrafficDirection direction, int valueIndex) {
"""
Replies the system default string-value for the traffic direction, at the
given index in the list of system default values.
@param direction is the direction for which the string value should be replied
@param value... | java | @Pure
public static String getSystemDefault(TrafficDirection direction, int valueIndex) {
// Values from the IGN-BDCarto standard
switch (direction) {
case DOUBLE_WAY:
switch (valueIndex) {
case 0:
return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION_0;
case 1:
return DEFAULT_DOUBLE_WAY_TRAFFIC_DIRECTION... | [
"@",
"Pure",
"public",
"static",
"String",
"getSystemDefault",
"(",
"TrafficDirection",
"direction",
",",
"int",
"valueIndex",
")",
"{",
"// Values from the IGN-BDCarto standard",
"switch",
"(",
"direction",
")",
"{",
"case",
"DOUBLE_WAY",
":",
"switch",
"(",
"value... | Replies the system default string-value for the traffic direction, at the
given index in the list of system default values.
@param direction is the direction for which the string value should be replied
@param valueIndex is the position of the string-value.
@return the string-value at the given position, never <code>n... | [
"Replies",
"the",
"system",
"default",
"string",
"-",
"value",
"for",
"the",
"traffic",
"direction",
"at",
"the",
"given",
"index",
"in",
"the",
"list",
"of",
"system",
"default",
"values",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/primitive/RoadNetworkConstants.java#L441-L484 |
RestComm/Restcomm-Connect | restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/security/SecurityFilter.java | SecurityFilter.filter | @Override
public ContainerRequest filter(ContainerRequest cr) {
"""
We return Access-* headers only in case allowedOrigin is present and equals to the 'Origin' header.
"""
final DaoManager storage = (DaoManager) servletRequest.getServletContext().getAttribute(DaoManager.class.getName());
Ac... | java | @Override
public ContainerRequest filter(ContainerRequest cr) {
final DaoManager storage = (DaoManager) servletRequest.getServletContext().getAttribute(DaoManager.class.getName());
AccountsDao accountsDao = storage.getAccountsDao();
UserIdentityContext userIdentityContext = new UserIdentityC... | [
"@",
"Override",
"public",
"ContainerRequest",
"filter",
"(",
"ContainerRequest",
"cr",
")",
"{",
"final",
"DaoManager",
"storage",
"=",
"(",
"DaoManager",
")",
"servletRequest",
".",
"getServletContext",
"(",
")",
".",
"getAttribute",
"(",
"DaoManager",
".",
"c... | We return Access-* headers only in case allowedOrigin is present and equals to the 'Origin' header. | [
"We",
"return",
"Access",
"-",
"*",
"headers",
"only",
"in",
"case",
"allowedOrigin",
"is",
"present",
"and",
"equals",
"to",
"the",
"Origin",
"header",
"."
] | train | https://github.com/RestComm/Restcomm-Connect/blob/2194dee4fc524cdfd0af77a218ba5f212f97f7c5/restcomm/restcomm.http/src/main/java/org/restcomm/connect/http/security/SecurityFilter.java#L61-L78 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java | ElementBase.moveChild | protected void moveChild(BaseUIComponent child, BaseUIComponent before) {
"""
Moves a child to before another component.
@param child Child to move
@param before Move child to this component.
"""
child.getParent().addChild(child, before);
} | java | protected void moveChild(BaseUIComponent child, BaseUIComponent before) {
child.getParent().addChild(child, before);
} | [
"protected",
"void",
"moveChild",
"(",
"BaseUIComponent",
"child",
",",
"BaseUIComponent",
"before",
")",
"{",
"child",
".",
"getParent",
"(",
")",
".",
"addChild",
"(",
"child",
",",
"before",
")",
";",
"}"
] | Moves a child to before another component.
@param child Child to move
@param before Move child to this component. | [
"Moves",
"a",
"child",
"to",
"before",
"another",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/elements/ElementBase.java#L763-L765 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/lock/LockSession.java | LockSession.getLockTable | public LockTable getLockTable(String strDatabaseName, String strRecordName) {
"""
Get the lock table for this record.
@param strRecordName The record to look up.
@return The lock table for this record (create if it doesn't exist).
"""
String strKey = strDatabaseName + ':' + strRecordName;
Loc... | java | public LockTable getLockTable(String strDatabaseName, String strRecordName)
{
String strKey = strDatabaseName + ':' + strRecordName;
LockTable lockTable = (LockTable)m_htLockTables.get(strKey);
if (lockTable == null)
{
synchronized (m_htLockTables)
{
... | [
"public",
"LockTable",
"getLockTable",
"(",
"String",
"strDatabaseName",
",",
"String",
"strRecordName",
")",
"{",
"String",
"strKey",
"=",
"strDatabaseName",
"+",
"'",
"'",
"+",
"strRecordName",
";",
"LockTable",
"lockTable",
"=",
"(",
"LockTable",
")",
"m_htLo... | Get the lock table for this record.
@param strRecordName The record to look up.
@return The lock table for this record (create if it doesn't exist). | [
"Get",
"the",
"lock",
"table",
"for",
"this",
"record",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/lock/LockSession.java#L181-L195 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Collator.java | Collator.getDisplayName | static public String getDisplayName(Locale objectLocale, Locale displayLocale) {
"""
<strong>[icu]</strong> Returns the name of the collator for the objectLocale, localized for the
displayLocale.
@param objectLocale the locale of the collator
@param displayLocale the locale for the collator's display name
@ret... | java | static public String getDisplayName(Locale objectLocale, Locale displayLocale) {
return getShim().getDisplayName(ULocale.forLocale(objectLocale),
ULocale.forLocale(displayLocale));
} | [
"static",
"public",
"String",
"getDisplayName",
"(",
"Locale",
"objectLocale",
",",
"Locale",
"displayLocale",
")",
"{",
"return",
"getShim",
"(",
")",
".",
"getDisplayName",
"(",
"ULocale",
".",
"forLocale",
"(",
"objectLocale",
")",
",",
"ULocale",
".",
"for... | <strong>[icu]</strong> Returns the name of the collator for the objectLocale, localized for the
displayLocale.
@param objectLocale the locale of the collator
@param displayLocale the locale for the collator's display name
@return the display name | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Returns",
"the",
"name",
"of",
"the",
"collator",
"for",
"the",
"objectLocale",
"localized",
"for",
"the",
"displayLocale",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/Collator.java#L1060-L1063 |
amsa-code/risky | ais/src/main/java/au/gov/amsa/util/nmea/NmeaMessageParser.java | NmeaMessageParser.parse | public NmeaMessage parse(String line) {
"""
Return an {@link NmeaMessage} from the given NMEA line.
@param line
@return
"""
LinkedHashMap<String, String> tags = Maps.newLinkedHashMap();
String remaining;
if (line.startsWith("\\")) {
int tagFinish = line.lastIndexOf('\\'... | java | public NmeaMessage parse(String line) {
LinkedHashMap<String, String> tags = Maps.newLinkedHashMap();
String remaining;
if (line.startsWith("\\")) {
int tagFinish = line.lastIndexOf('\\', line.length() - 1);
if (tagFinish == -1)
throw new NmeaMessageParse... | [
"public",
"NmeaMessage",
"parse",
"(",
"String",
"line",
")",
"{",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"tags",
"=",
"Maps",
".",
"newLinkedHashMap",
"(",
")",
";",
"String",
"remaining",
";",
"if",
"(",
"line",
".",
"startsWith",
"(",
"\"... | Return an {@link NmeaMessage} from the given NMEA line.
@param line
@return | [
"Return",
"an",
"{",
"@link",
"NmeaMessage",
"}",
"from",
"the",
"given",
"NMEA",
"line",
"."
] | train | https://github.com/amsa-code/risky/blob/13649942aeddfdb9210eec072c605bc5d7a6daf3/ais/src/main/java/au/gov/amsa/util/nmea/NmeaMessageParser.java#L26-L57 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java | ToStream.startDTD | public void startDTD(String name, String publicId, String systemId)
throws org.xml.sax.SAXException {
"""
Report the start of DTD declarations, if any.
Any declarations are assumed to be in the internal subset unless
otherwise indicated.
@param name The document type name.
@param publicId The decla... | java | public void startDTD(String name, String publicId, String systemId)
throws org.xml.sax.SAXException
{
setDoctypeSystem(systemId);
setDoctypePublic(publicId);
m_elemContext.m_elementName = name;
m_inDoctype = true;
} | [
"public",
"void",
"startDTD",
"(",
"String",
"name",
",",
"String",
"publicId",
",",
"String",
"systemId",
")",
"throws",
"org",
".",
"xml",
".",
"sax",
".",
"SAXException",
"{",
"setDoctypeSystem",
"(",
"systemId",
")",
";",
"setDoctypePublic",
"(",
"public... | Report the start of DTD declarations, if any.
Any declarations are assumed to be in the internal subset unless
otherwise indicated.
@param name The document type name.
@param publicId The declared public identifier for the
external DTD subset, or null if none was declared.
@param systemId The declared system identifi... | [
"Report",
"the",
"start",
"of",
"DTD",
"declarations",
"if",
"any",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L2666-L2674 |
marklogic/java-client-api | marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java | StructuredQueryBuilder.propertiesConstraint | public StructuredQueryDefinition propertiesConstraint(String constraintName, StructuredQueryDefinition query) {
"""
Associates a query with the properties of documents (as opposed to
the content of documents) with the specified constraint.
@param constraintName the constraint definition
@param query the q... | java | public StructuredQueryDefinition propertiesConstraint(String constraintName, StructuredQueryDefinition query) {
checkQuery(query);
return new PropertiesConstraintQuery(constraintName, query);
} | [
"public",
"StructuredQueryDefinition",
"propertiesConstraint",
"(",
"String",
"constraintName",
",",
"StructuredQueryDefinition",
"query",
")",
"{",
"checkQuery",
"(",
"query",
")",
";",
"return",
"new",
"PropertiesConstraintQuery",
"(",
"constraintName",
",",
"query",
... | Associates a query with the properties of documents (as opposed to
the content of documents) with the specified constraint.
@param constraintName the constraint definition
@param query the query definition
@return the StructuredQueryDefinition for the properties constraint query | [
"Associates",
"a",
"query",
"with",
"the",
"properties",
"of",
"documents",
"(",
"as",
"opposed",
"to",
"the",
"content",
"of",
"documents",
")",
"with",
"the",
"specified",
"constraint",
"."
] | train | https://github.com/marklogic/java-client-api/blob/acf60229a928abd4a8cc4b21b641d56957467da7/marklogic-client-api/src/main/java/com/marklogic/client/query/StructuredQueryBuilder.java#L1009-L1012 |
fabric8io/kubernetes-client | kubernetes-client/src/main/java/io/fabric8/kubernetes/client/internal/KubeConfigUtils.java | KubeConfigUtils.getUserAuthInfo | public static AuthInfo getUserAuthInfo(Config config, Context context) {
"""
Returns the current {@link AuthInfo} for the current context and user
@param config Config object
@param context Context object
@return {@link AuthInfo} for current context
"""
AuthInfo authInfo = null;
if (config != null... | java | public static AuthInfo getUserAuthInfo(Config config, Context context) {
AuthInfo authInfo = null;
if (config != null && context != null) {
String user = context.getUser();
if (user != null) {
List<NamedAuthInfo> users = config.getUsers();
if (users != null) {
for (NamedAut... | [
"public",
"static",
"AuthInfo",
"getUserAuthInfo",
"(",
"Config",
"config",
",",
"Context",
"context",
")",
"{",
"AuthInfo",
"authInfo",
"=",
"null",
";",
"if",
"(",
"config",
"!=",
"null",
"&&",
"context",
"!=",
"null",
")",
"{",
"String",
"user",
"=",
... | Returns the current {@link AuthInfo} for the current context and user
@param config Config object
@param context Context object
@return {@link AuthInfo} for current context | [
"Returns",
"the",
"current",
"{",
"@link",
"AuthInfo",
"}",
"for",
"the",
"current",
"context",
"and",
"user"
] | train | https://github.com/fabric8io/kubernetes-client/blob/141668a882ed8e902c045a5cd0a80f14bd17d132/kubernetes-client/src/main/java/io/fabric8/kubernetes/client/internal/KubeConfigUtils.java#L93-L109 |
leadware/jpersistence-tools | jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorHelper.java | DAOValidatorHelper.isExpressionContainPattern | public static boolean isExpressionContainPattern(String expression, String pattern) {
"""
Methode permettant de verifier si un chemin contient des Fonctions
@param expression Chaine a controler
@param pattern expression de la fonction
@return Resultat de la verification
"""
try {
// Si la ch... | java | public static boolean isExpressionContainPattern(String expression, String pattern) {
try {
// Si la chaine est vide : false
if(expression == null || expression.trim().length() == 0) {
// On retourne false
return false;
}
// Construction d'un Pattern
Pattern regex = ... | [
"public",
"static",
"boolean",
"isExpressionContainPattern",
"(",
"String",
"expression",
",",
"String",
"pattern",
")",
"{",
"try",
"{",
"// Si la chaine est vide : false\r",
"if",
"(",
"expression",
"==",
"null",
"||",
"expression",
".",
"trim",
"(",
")",
".",
... | Methode permettant de verifier si un chemin contient des Fonctions
@param expression Chaine a controler
@param pattern expression de la fonction
@return Resultat de la verification | [
"Methode",
"permettant",
"de",
"verifier",
"si",
"un",
"chemin",
"contient",
"des",
"Fonctions"
] | train | https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-core/src/main/java/net/leadware/persistence/tools/core/dao/utils/DAOValidatorHelper.java#L573-L595 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java | PathOperations.renameFile | @Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile) {
"""
Rename a file.
@param aSourceFile
The original file name. May not be <code>null</code>.
@param aTargetFile
The destination file name. May not be <code>null</code>.
@return A non-<code>nul... | java | @Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = _getUnifiedPath (aSourceFile);
final Path aRealTarget... | [
"@",
"Nonnull",
"public",
"static",
"FileIOError",
"renameFile",
"(",
"@",
"Nonnull",
"final",
"Path",
"aSourceFile",
",",
"@",
"Nonnull",
"final",
"Path",
"aTargetFile",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSourceFile",
",",
"\"SourceFile\"",
")",
... | Rename a file.
@param aSourceFile
The original file name. May not be <code>null</code>.
@param aTargetFile
The destination file name. May not be <code>null</code>.
@return A non-<code>null</code> error code. | [
"Rename",
"a",
"file",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java#L430-L465 |
schallee/alib4j | core/src/main/java/net/darkmist/alib/res/PkgRes.java | PkgRes.getStringFor | public static String getStringFor(String name, Object obj) {
"""
Get a resource as a String.
@param name The name of the resource
@return The contents of the resource converted to a string
with the default encoding.
@throws NullPointerException if name or obj are null.
ResourceException if the resource cannot... | java | public static String getStringFor(String name, Object obj)
{
if(obj == null)
throw new NullPointerException("obj is null");
return getStringFor(name,obj.getClass());
} | [
"public",
"static",
"String",
"getStringFor",
"(",
"String",
"name",
",",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"throw",
"new",
"NullPointerException",
"(",
"\"obj is null\"",
")",
";",
"return",
"getStringFor",
"(",
"name",
",",
... | Get a resource as a String.
@param name The name of the resource
@return The contents of the resource converted to a string
with the default encoding.
@throws NullPointerException if name or obj are null.
ResourceException if the resource cannot be found. | [
"Get",
"a",
"resource",
"as",
"a",
"String",
"."
] | train | https://github.com/schallee/alib4j/blob/0e0718aee574bbb62268e1cf58e99286529ce529/core/src/main/java/net/darkmist/alib/res/PkgRes.java#L312-L317 |
Microsoft/azure-maven-plugins | azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/Utils.java | Utils.copyResources | public static void copyResources(final MavenProject project, final MavenSession session,
final MavenResourcesFiltering filtering, final List<Resource> resources,
final String targetDirectory) throws IOException {
"""
Copy resources to targ... | java | public static void copyResources(final MavenProject project, final MavenSession session,
final MavenResourcesFiltering filtering, final List<Resource> resources,
final String targetDirectory) throws IOException {
for (final Resource re... | [
"public",
"static",
"void",
"copyResources",
"(",
"final",
"MavenProject",
"project",
",",
"final",
"MavenSession",
"session",
",",
"final",
"MavenResourcesFiltering",
"filtering",
",",
"final",
"List",
"<",
"Resource",
">",
"resources",
",",
"final",
"String",
"t... | Copy resources to target directory using Maven resource filtering so that we don't have to handle
recursive directory listing and pattern matching.
In order to disable filtering, the "filtering" property is force set to False.
@param project
@param session
@param filtering
@param resources
@param targetDirectory
@thro... | [
"Copy",
"resources",
"to",
"target",
"directory",
"using",
"Maven",
"resource",
"filtering",
"so",
"that",
"we",
"don",
"t",
"have",
"to",
"handle",
"recursive",
"directory",
"listing",
"and",
"pattern",
"matching",
".",
"In",
"order",
"to",
"disable",
"filter... | train | https://github.com/Microsoft/azure-maven-plugins/blob/a254902e820185df1823b1d692c7c1d119490b1e/azure-maven-plugin-lib/src/main/java/com/microsoft/azure/maven/Utils.java#L97-L129 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/base/Environment.java | Environment.getNextAvailablePort | public static int getNextAvailablePort(int fromPort, int toPort) {
"""
Returns a currently available port number in the specified range.
@param fromPort the lower port limit
@param toPort the upper port limit
@throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER}
and {@link #MAX... | java | public static int getNextAvailablePort(int fromPort, int toPort) {
if (fromPort < MIN_PORT_NUMBER || toPort > MAX_PORT_NUMBER || fromPort > toPort) {
throw new IllegalArgumentException(format("Invalid port range: %d ~ %d", fromPort, toPort));
}
int nextPort = fromPort;
//noi... | [
"public",
"static",
"int",
"getNextAvailablePort",
"(",
"int",
"fromPort",
",",
"int",
"toPort",
")",
"{",
"if",
"(",
"fromPort",
"<",
"MIN_PORT_NUMBER",
"||",
"toPort",
">",
"MAX_PORT_NUMBER",
"||",
"fromPort",
">",
"toPort",
")",
"{",
"throw",
"new",
"Ille... | Returns a currently available port number in the specified range.
@param fromPort the lower port limit
@param toPort the upper port limit
@throws IllegalArgumentException if port range is not between {@link #MIN_PORT_NUMBER}
and {@link #MAX_PORT_NUMBER} or <code>fromPort</code> if greater than <code>toPort</code>.
@ret... | [
"Returns",
"a",
"currently",
"available",
"port",
"number",
"in",
"the",
"specified",
"range",
"."
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/base/Environment.java#L116-L125 |
google/closure-compiler | src/com/google/javascript/jscomp/CrossChunkCodeMotion.java | CrossChunkCodeMotion.isUndefinedTypeofGuardFor | private boolean isUndefinedTypeofGuardFor(Node expression, Node reference) {
"""
Is the expression of the form {@code 'undefined' != typeof Ref}?
@param expression
@param reference Ref node must be equivalent to this node
"""
if (expression.isNE()) {
Node undefinedString = expression.getFirstChil... | java | private boolean isUndefinedTypeofGuardFor(Node expression, Node reference) {
if (expression.isNE()) {
Node undefinedString = expression.getFirstChild();
Node typeofNode = expression.getLastChild();
return undefinedString.isString()
&& undefinedString.getString().equals("undefined")
... | [
"private",
"boolean",
"isUndefinedTypeofGuardFor",
"(",
"Node",
"expression",
",",
"Node",
"reference",
")",
"{",
"if",
"(",
"expression",
".",
"isNE",
"(",
")",
")",
"{",
"Node",
"undefinedString",
"=",
"expression",
".",
"getFirstChild",
"(",
")",
";",
"No... | Is the expression of the form {@code 'undefined' != typeof Ref}?
@param expression
@param reference Ref node must be equivalent to this node | [
"Is",
"the",
"expression",
"of",
"the",
"form",
"{",
"@code",
"undefined",
"!",
"=",
"typeof",
"Ref",
"}",
"?"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CrossChunkCodeMotion.java#L711-L722 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tsx/db/Query.java | Query.main3 | public static void main3(String args[]) {
"""
This method was created in VisualAge.
@param args java.lang.String[]
"""
String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
String url = "jdbc:db2:sample";
String user = "batra";
String pass = "varunbatra";
String querystri... | java | public static void main3(String args[]) {
String dbDriver = "COM.ibm.db2.jdbc.app.DB2Driver";
String url = "jdbc:db2:sample";
String user = "batra";
String pass = "varunbatra";
String querystring = "Select * from batra.employee";
String fn;
String ln;
Stri... | [
"public",
"static",
"void",
"main3",
"(",
"String",
"args",
"[",
"]",
")",
"{",
"String",
"dbDriver",
"=",
"\"COM.ibm.db2.jdbc.app.DB2Driver\"",
";",
"String",
"url",
"=",
"\"jdbc:db2:sample\"",
";",
"String",
"user",
"=",
"\"batra\"",
";",
"String",
"pass",
"... | This method was created in VisualAge.
@param args java.lang.String[] | [
"This",
"method",
"was",
"created",
"in",
"VisualAge",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/tsx/db/Query.java#L365-L420 |
luuuis/jcalendar | src/main/java/com/toedter/components/JSpinField.java | JSpinField.setValue | protected void setValue(int newValue, boolean updateTextField, boolean firePropertyChange) {
"""
Sets the value attribute of the JSpinField object.
@param newValue
The new value
@param updateTextField
true if text field should be updated
"""
int oldValue = value;
if (newValue < min) {
value = min;... | java | protected void setValue(int newValue, boolean updateTextField, boolean firePropertyChange) {
int oldValue = value;
if (newValue < min) {
value = min;
} else if (newValue > max) {
value = max;
} else {
value = newValue;
}
if (updateTextField) {
textField.setText(Integer.toString(value));
text... | [
"protected",
"void",
"setValue",
"(",
"int",
"newValue",
",",
"boolean",
"updateTextField",
",",
"boolean",
"firePropertyChange",
")",
"{",
"int",
"oldValue",
"=",
"value",
";",
"if",
"(",
"newValue",
"<",
"min",
")",
"{",
"value",
"=",
"min",
";",
"}",
... | Sets the value attribute of the JSpinField object.
@param newValue
The new value
@param updateTextField
true if text field should be updated | [
"Sets",
"the",
"value",
"attribute",
"of",
"the",
"JSpinField",
"object",
"."
] | train | https://github.com/luuuis/jcalendar/blob/442e5bc319d92dee93400e6180ca74a5b6bd7775/src/main/java/com/toedter/components/JSpinField.java#L147-L165 |
alkacon/opencms-core | src/org/opencms/ade/configuration/CmsADEManager.java | CmsADEManager.saveDetailPages | public boolean saveDetailPages(CmsObject cms, String rootPath, List<CmsDetailPageInfo> detailPages, CmsUUID newId)
throws CmsException {
"""
Saves a list of detail pages.<p>
@param cms the cms context
@param rootPath the root path
@param detailPages the detail pages
@param newId the id to use for new detai... | java | public boolean saveDetailPages(CmsObject cms, String rootPath, List<CmsDetailPageInfo> detailPages, CmsUUID newId)
throws CmsException {
CmsADEConfigData configData = lookupConfiguration(cms, rootPath);
CmsDetailPageConfigurationWriter configWriter;
String originalSiteRoot = cms.getRequestC... | [
"public",
"boolean",
"saveDetailPages",
"(",
"CmsObject",
"cms",
",",
"String",
"rootPath",
",",
"List",
"<",
"CmsDetailPageInfo",
">",
"detailPages",
",",
"CmsUUID",
"newId",
")",
"throws",
"CmsException",
"{",
"CmsADEConfigData",
"configData",
"=",
"lookupConfigur... | Saves a list of detail pages.<p>
@param cms the cms context
@param rootPath the root path
@param detailPages the detail pages
@param newId the id to use for new detail pages without an id
@return true if the detail pages could be successfully saved
@throws CmsException if something goes wrong | [
"Saves",
"a",
"list",
"of",
"detail",
"pages",
".",
"<p",
">",
"@param",
"cms",
"the",
"cms",
"context",
"@param",
"rootPath",
"the",
"root",
"path",
"@param",
"detailPages",
"the",
"detail",
"pages",
"@param",
"newId",
"the",
"id",
"to",
"use",
"for",
"... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/configuration/CmsADEManager.java#L1168-L1186 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.transformAffine | public Vector4f transformAffine(float x, float y, float z, float w, Vector4f dest) {
"""
/* (non-Javadoc)
@see org.joml.Matrix4fc#transformAffine(float, float, float, float, org.joml.Vector4f)
"""
dest.x = x;
dest.y = y;
dest.z = z;
dest.w = w;
return dest.mulAffine(thi... | java | public Vector4f transformAffine(float x, float y, float z, float w, Vector4f dest) {
dest.x = x;
dest.y = y;
dest.z = z;
dest.w = w;
return dest.mulAffine(this, dest);
} | [
"public",
"Vector4f",
"transformAffine",
"(",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
",",
"float",
"w",
",",
"Vector4f",
"dest",
")",
"{",
"dest",
".",
"x",
"=",
"x",
";",
"dest",
".",
"y",
"=",
"y",
";",
"dest",
".",
"z",
"=",
"z"... | /* (non-Javadoc)
@see org.joml.Matrix4fc#transformAffine(float, float, float, float, org.joml.Vector4f) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L4650-L4656 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/Assert.java | Assert.notEmpty | public static void notEmpty(Object[] array, String message, Object... arguments) {
"""
Asserts that the {@link Object array} is not empty.
The assertion holds if and only if the {@link Object array} is not {@literal null} and contains at least 1 element.
@param array {@link Object array} to evaluate.
@param... | java | public static void notEmpty(Object[] array, String message, Object... arguments) {
notEmpty(array, new IllegalArgumentException(format(message, arguments)));
} | [
"public",
"static",
"void",
"notEmpty",
"(",
"Object",
"[",
"]",
"array",
",",
"String",
"message",
",",
"Object",
"...",
"arguments",
")",
"{",
"notEmpty",
"(",
"array",
",",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"message",
",",
"arguments"... | Asserts that the {@link Object array} is not empty.
The assertion holds if and only if the {@link Object array} is not {@literal null} and contains at least 1 element.
@param array {@link Object array} to evaluate.
@param message {@link String} containing the message using in the {@link IllegalArgumentException} thro... | [
"Asserts",
"that",
"the",
"{",
"@link",
"Object",
"array",
"}",
"is",
"not",
"empty",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/Assert.java#L958-L960 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/io/DataIO.java | DataIO.createTableModel | public static TableModel createTableModel(final CSTable src) {
"""
Create a r/o data tablemodel
@param src
@return a table model to the CSTable
"""
final List<String[]> rows = new ArrayList<String[]>();
for (String[] row : src.rows()) {
rows.add(row);
}
return n... | java | public static TableModel createTableModel(final CSTable src) {
final List<String[]> rows = new ArrayList<String[]>();
for (String[] row : src.rows()) {
rows.add(row);
}
return new TableModel() {
@Override
public int getColumnCount() {
... | [
"public",
"static",
"TableModel",
"createTableModel",
"(",
"final",
"CSTable",
"src",
")",
"{",
"final",
"List",
"<",
"String",
"[",
"]",
">",
"rows",
"=",
"new",
"ArrayList",
"<",
"String",
"[",
"]",
">",
"(",
")",
";",
"for",
"(",
"String",
"[",
"]... | Create a r/o data tablemodel
@param src
@return a table model to the CSTable | [
"Create",
"a",
"r",
"/",
"o",
"data",
"tablemodel"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/io/DataIO.java#L497-L548 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java | SecureUtil.signParams | public static String signParams(SymmetricCrypto crypto, Map<?, ?> params, String separator, String keyValueSeparator, boolean isIgnoreNull) {
"""
对参数做签名<br>
参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串
@param crypto 对称加密算法
@param params 参数
@param separator entry之间的连接符
@param keyValueSeparator kv之间的连接符
@... | java | public static String signParams(SymmetricCrypto crypto, Map<?, ?> params, String separator, String keyValueSeparator, boolean isIgnoreNull) {
if (MapUtil.isEmpty(params)) {
return null;
}
String paramsStr = MapUtil.join(MapUtil.sort(params), separator, keyValueSeparator, isIgnoreNull);
return crypto.enc... | [
"public",
"static",
"String",
"signParams",
"(",
"SymmetricCrypto",
"crypto",
",",
"Map",
"<",
"?",
",",
"?",
">",
"params",
",",
"String",
"separator",
",",
"String",
"keyValueSeparator",
",",
"boolean",
"isIgnoreNull",
")",
"{",
"if",
"(",
"MapUtil",
".",
... | 对参数做签名<br>
参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串
@param crypto 对称加密算法
@param params 参数
@param separator entry之间的连接符
@param keyValueSeparator kv之间的连接符
@param isIgnoreNull 是否忽略null的键和值
@return 签名
@since 4.0.1 | [
"对参数做签名<br",
">",
"参数签名为对Map参数按照key的顺序排序后拼接为字符串,然后根据提供的签名算法生成签名字符串"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/SecureUtil.java#L847-L853 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheService.java | AbstractCacheService.sendInvalidationEvent | @Override
public void sendInvalidationEvent(String cacheNameWithPrefix, Data key, String sourceUuid) {
"""
Sends an invalidation event for given <code>cacheName</code> with specified <code>key</code>
from mentioned source with <code>sourceUuid</code>.
@param cacheNameWithPrefix the name of the cache that i... | java | @Override
public void sendInvalidationEvent(String cacheNameWithPrefix, Data key, String sourceUuid) {
cacheEventHandler.sendInvalidationEvent(cacheNameWithPrefix, key, sourceUuid);
} | [
"@",
"Override",
"public",
"void",
"sendInvalidationEvent",
"(",
"String",
"cacheNameWithPrefix",
",",
"Data",
"key",
",",
"String",
"sourceUuid",
")",
"{",
"cacheEventHandler",
".",
"sendInvalidationEvent",
"(",
"cacheNameWithPrefix",
",",
"key",
",",
"sourceUuid",
... | Sends an invalidation event for given <code>cacheName</code> with specified <code>key</code>
from mentioned source with <code>sourceUuid</code>.
@param cacheNameWithPrefix the name of the cache that invalidation event is sent for
@param key the {@link com.hazelcast.nio.serialization.Data} represents th... | [
"Sends",
"an",
"invalidation",
"event",
"for",
"given",
"<code",
">",
"cacheName<",
"/",
"code",
">",
"with",
"specified",
"<code",
">",
"key<",
"/",
"code",
">",
"from",
"mentioned",
"source",
"with",
"<code",
">",
"sourceUuid<",
"/",
"code",
">",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/cache/impl/AbstractCacheService.java#L818-L821 |
jhalterman/lyra | src/main/java/net/jodah/lyra/ConnectionOptions.java | ConnectionOptions.withClientProperties | public ConnectionOptions withClientProperties(Map<String, Object> clientProperties) {
"""
Sets the client properties.
@throws NullPointerException if {@code clientProperties} is null
"""
factory.setClientProperties(Assert.notNull(clientProperties, "clientProperties"));
return this;
} | java | public ConnectionOptions withClientProperties(Map<String, Object> clientProperties) {
factory.setClientProperties(Assert.notNull(clientProperties, "clientProperties"));
return this;
} | [
"public",
"ConnectionOptions",
"withClientProperties",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"clientProperties",
")",
"{",
"factory",
".",
"setClientProperties",
"(",
"Assert",
".",
"notNull",
"(",
"clientProperties",
",",
"\"clientProperties\"",
")",
")",
... | Sets the client properties.
@throws NullPointerException if {@code clientProperties} is null | [
"Sets",
"the",
"client",
"properties",
"."
] | train | https://github.com/jhalterman/lyra/blob/ce347a69357fef1b34e92d92a4f9e68792d81255/src/main/java/net/jodah/lyra/ConnectionOptions.java#L181-L184 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/Spider.java | Spider.buildUri | private static String buildUri(String scheme, char[] host, int port, String path) {
"""
Creates a URI (string) with the given scheme, host, port and path. The port is only added if not the default for the
given scheme.
@param scheme the scheme, {@code http} or {@code https}.
@param host the name of the host.
... | java | private static String buildUri(String scheme, char[] host, int port, String path) {
StringBuilder strBuilder = new StringBuilder(150);
strBuilder.append(scheme).append("://").append(host);
if (!isDefaultPort(scheme, port)) {
strBuilder.append(':').append(port);
}
strBuilder.append(path);
return strBuilde... | [
"private",
"static",
"String",
"buildUri",
"(",
"String",
"scheme",
",",
"char",
"[",
"]",
"host",
",",
"int",
"port",
",",
"String",
"path",
")",
"{",
"StringBuilder",
"strBuilder",
"=",
"new",
"StringBuilder",
"(",
"150",
")",
";",
"strBuilder",
".",
"... | Creates a URI (string) with the given scheme, host, port and path. The port is only added if not the default for the
given scheme.
@param scheme the scheme, {@code http} or {@code https}.
@param host the name of the host.
@param port the port.
@param path the path, should start with {@code /}.
@return the URI with the... | [
"Creates",
"a",
"URI",
"(",
"string",
")",
"with",
"the",
"given",
"scheme",
"host",
"port",
"and",
"path",
".",
"The",
"port",
"is",
"only",
"added",
"if",
"not",
"the",
"default",
"for",
"the",
"given",
"scheme",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/Spider.java#L288-L296 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/xslt/EnvironmentCheck.java | EnvironmentCheck.logFoundJars | protected boolean logFoundJars(Vector v, String desc) {
"""
Print out report of .jars found in a classpath.
Takes the information encoded from a checkPathForJars()
call and dumps it out to our PrintWriter.
@param v Vector of Hashtables of .jar file info
@param desc description to print out in header
@re... | java | protected boolean logFoundJars(Vector v, String desc)
{
if ((null == v) || (v.size() < 1))
return false;
boolean errors = false;
logMsg("#---- BEGIN Listing XML-related jars in: " + desc + " ----");
for (int i = 0; i < v.size(); i++)
{
Hashtable subhash = (Hashtable) v.elementAt(i)... | [
"protected",
"boolean",
"logFoundJars",
"(",
"Vector",
"v",
",",
"String",
"desc",
")",
"{",
"if",
"(",
"(",
"null",
"==",
"v",
")",
"||",
"(",
"v",
".",
"size",
"(",
")",
"<",
"1",
")",
")",
"return",
"false",
";",
"boolean",
"errors",
"=",
"fal... | Print out report of .jars found in a classpath.
Takes the information encoded from a checkPathForJars()
call and dumps it out to our PrintWriter.
@param v Vector of Hashtables of .jar file info
@param desc description to print out in header
@return false if OK, true if any .jars were reported
as having errors
@see #... | [
"Print",
"out",
"report",
"of",
".",
"jars",
"found",
"in",
"a",
"classpath",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/xslt/EnvironmentCheck.java#L353-L394 |
KyoriPowered/lunar | src/main/java/net/kyori/lunar/collection/MoreTables.java | MoreTables.computeIfAbsent | public static <R, C, V> /* @Nullable */ V computeIfAbsent(final @NonNull Table<R, C, V> table, final @Nullable R rowKey, final @Nullable C columnKey, final @NonNull BiFunction<? super R, ? super C, ? extends V> valueFunction) {
"""
Gets the value of {@code rowKey} and {@code columnKey} from {@code table}, or compu... | java | public static <R, C, V> /* @Nullable */ V computeIfAbsent(final @NonNull Table<R, C, V> table, final @Nullable R rowKey, final @Nullable C columnKey, final @NonNull BiFunction<? super R, ? super C, ? extends V> valueFunction) {
/* @Nullable */ V value = table.get(rowKey, columnKey);
if(value == null) {
va... | [
"public",
"static",
"<",
"R",
",",
"C",
",",
"V",
">",
"/* @Nullable */",
"V",
"computeIfAbsent",
"(",
"final",
"@",
"NonNull",
"Table",
"<",
"R",
",",
"C",
",",
"V",
">",
"table",
",",
"final",
"@",
"Nullable",
"R",
"rowKey",
",",
"final",
"@",
"N... | Gets the value of {@code rowKey} and {@code columnKey} from {@code table}, or computes
the value using {@code valueFunction} and inserts it into the table.
@param table the table
@param rowKey the row key
@param columnKey the column key
@param valueFunction the value function
@param <R> the row type
@param <C> the col... | [
"Gets",
"the",
"value",
"of",
"{",
"@code",
"rowKey",
"}",
"and",
"{",
"@code",
"columnKey",
"}",
"from",
"{",
"@code",
"table",
"}",
"or",
"computes",
"the",
"value",
"using",
"{",
"@code",
"valueFunction",
"}",
"and",
"inserts",
"it",
"into",
"the",
... | train | https://github.com/KyoriPowered/lunar/blob/6856747d9034a2fe0c8d0a8a0150986797732b5c/src/main/java/net/kyori/lunar/collection/MoreTables.java#L56-L63 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.withTraits | public static Object withTraits(Object self, Class<?>... traits) {
"""
Dynamically wraps an instance into something which implements the
supplied trait classes. It is guaranteed that the returned object
will implement the trait interfaces, but the original type of the
object is lost (replaced with a proxy).
@p... | java | public static Object withTraits(Object self, Class<?>... traits) {
List<Class> interfaces = new ArrayList<Class>();
Collections.addAll(interfaces, traits);
return ProxyGenerator.INSTANCE.instantiateDelegate(interfaces, self);
} | [
"public",
"static",
"Object",
"withTraits",
"(",
"Object",
"self",
",",
"Class",
"<",
"?",
">",
"...",
"traits",
")",
"{",
"List",
"<",
"Class",
">",
"interfaces",
"=",
"new",
"ArrayList",
"<",
"Class",
">",
"(",
")",
";",
"Collections",
".",
"addAll",... | Dynamically wraps an instance into something which implements the
supplied trait classes. It is guaranteed that the returned object
will implement the trait interfaces, but the original type of the
object is lost (replaced with a proxy).
@param self object to be wrapped
@param traits a list of trait classes
@return a p... | [
"Dynamically",
"wraps",
"an",
"instance",
"into",
"something",
"which",
"implements",
"the",
"supplied",
"trait",
"classes",
".",
"It",
"is",
"guaranteed",
"that",
"the",
"returned",
"object",
"will",
"implement",
"the",
"trait",
"interfaces",
"but",
"the",
"ori... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L17614-L17618 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns.java | ns.update | public static ns update(nitro_service client, ns resource) throws Exception {
"""
<pre>
Use this operation to modify NetScaler Instance.
</pre>
"""
resource.validate("modify");
return ((ns[]) resource.update_resource(client))[0];
} | java | public static ns update(nitro_service client, ns resource) throws Exception
{
resource.validate("modify");
return ((ns[]) resource.update_resource(client))[0];
} | [
"public",
"static",
"ns",
"update",
"(",
"nitro_service",
"client",
",",
"ns",
"resource",
")",
"throws",
"Exception",
"{",
"resource",
".",
"validate",
"(",
"\"modify\"",
")",
";",
"return",
"(",
"(",
"ns",
"[",
"]",
")",
"resource",
".",
"update_resource... | <pre>
Use this operation to modify NetScaler Instance.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"modify",
"NetScaler",
"Instance",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/ns/ns.java#L849-L853 |
atomix/catalyst | common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java | PropertiesReader.getFile | public File getFile(String property, File defaultValue) {
"""
Reads a file property.
@param property The property name.
@param defaultValue The default value to return if the property is not present
@return The property value.
"""
return getProperty(property, defaultValue, File::new);
} | java | public File getFile(String property, File defaultValue) {
return getProperty(property, defaultValue, File::new);
} | [
"public",
"File",
"getFile",
"(",
"String",
"property",
",",
"File",
"defaultValue",
")",
"{",
"return",
"getProperty",
"(",
"property",
",",
"defaultValue",
",",
"File",
"::",
"new",
")",
";",
"}"
] | Reads a file property.
@param property The property name.
@param defaultValue The default value to return if the property is not present
@return The property value. | [
"Reads",
"a",
"file",
"property",
"."
] | train | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/common/src/main/java/io/atomix/catalyst/util/PropertiesReader.java#L189-L191 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/lang/Loader.java | Loader.loadClass | @SuppressWarnings("rawtypes")
public static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException {
"""
Load a class. Load a class from the same classloader as the passed
<code>loadClass</code>, or if none then use {@link #loadClass(String)}
@param loaderClass a similar class, belon... | java | @SuppressWarnings("rawtypes")
public static Class loadClass(Class loaderClass, String name) throws ClassNotFoundException {
if (loaderClass != null && loaderClass.getClassLoader() != null)
return loaderClass.getClassLoader().loadClass(name);
return loadClass(name);
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"Class",
"loadClass",
"(",
"Class",
"loaderClass",
",",
"String",
"name",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"loaderClass",
"!=",
"null",
"&&",
"loaderClass",
".",
"getC... | Load a class. Load a class from the same classloader as the passed
<code>loadClass</code>, or if none then use {@link #loadClass(String)}
@param loaderClass a similar class, belong in the same classloader of the desired
class to load
@param name the name of the new class to load
@return Class
@throws ClassNotFo... | [
"Load",
"a",
"class",
".",
"Load",
"a",
"class",
"from",
"the",
"same",
"classloader",
"as",
"the",
"passed",
"<code",
">",
"loadClass<",
"/",
"code",
">",
"or",
"if",
"none",
"then",
"use",
"{",
"@link",
"#loadClass",
"(",
"String",
")",
"}"
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/lang/Loader.java#L76-L81 |
pressgang-ccms/PressGangCCMSContentSpecProcessor | src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java | ContentSpecParser.processLevelRelationships | protected void processLevelRelationships(final ParserData parserData, final Level level,
final HashMap<ParserType, String[]> variableMap, final String line, int lineNumber) throws ParsingException {
"""
Process the relationships parsed for a topic.
@param parserData
@param level The temporary... | java | protected void processLevelRelationships(final ParserData parserData, final Level level,
final HashMap<ParserType, String[]> variableMap, final String line, int lineNumber) throws ParsingException {
// Process the relationships
final String uniqueId = level.getUniqueId();
final Array... | [
"protected",
"void",
"processLevelRelationships",
"(",
"final",
"ParserData",
"parserData",
",",
"final",
"Level",
"level",
",",
"final",
"HashMap",
"<",
"ParserType",
",",
"String",
"[",
"]",
">",
"variableMap",
",",
"final",
"String",
"line",
",",
"int",
"li... | Process the relationships parsed for a topic.
@param parserData
@param level The temporary topic that will be turned into a full topic once fully parsed.
@param variableMap The list of variables containing the parsed relationships.
@param line The line representing the topic and it's relationships.
@param... | [
"Process",
"the",
"relationships",
"parsed",
"for",
"a",
"topic",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecParser.java#L1402-L1426 |
carewebframework/carewebframework-core | org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BaseXmlParser.java | BaseXmlParser.getTagChildren | protected NodeList getTagChildren(String tagName, Element element) {
"""
Returns the children under the specified tag. Compensates for namespace usage.
@param tagName Name of tag whose children are sought.
@param element Element to search for tag.
@return Node list containing children of tag.
"""
... | java | protected NodeList getTagChildren(String tagName, Element element) {
return element.getNamespaceURI() == null ? element.getElementsByTagName(tagName) : element.getElementsByTagNameNS(
element.getNamespaceURI(), tagName);
} | [
"protected",
"NodeList",
"getTagChildren",
"(",
"String",
"tagName",
",",
"Element",
"element",
")",
"{",
"return",
"element",
".",
"getNamespaceURI",
"(",
")",
"==",
"null",
"?",
"element",
".",
"getElementsByTagName",
"(",
"tagName",
")",
":",
"element",
"."... | Returns the children under the specified tag. Compensates for namespace usage.
@param tagName Name of tag whose children are sought.
@param element Element to search for tag.
@return Node list containing children of tag. | [
"Returns",
"the",
"children",
"under",
"the",
"specified",
"tag",
".",
"Compensates",
"for",
"namespace",
"usage",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.api-parent/org.carewebframework.api.core/src/main/java/org/carewebframework/api/spring/BaseXmlParser.java#L82-L85 |
mygreen/super-csv-annotation | src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthExact.java | LengthExact.execute | @SuppressWarnings("unchecked")
public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
{@literal if value is null}
@throws SuperCsvConstraintViolationException
{@literal if length is < min or length > max}
"""
... | java | @SuppressWarnings("unchecked")
public Object execute(final Object value, final CsvContext context) {
if(value == null) {
return next.execute(value, context);
}
final String stringValue = value.toString();
final int length = stringValue.length();
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"next",
".",
"execute",
"(",
"value",... | {@inheritDoc}
@throws SuperCsvCellProcessorException
{@literal if value is null}
@throws SuperCsvConstraintViolationException
{@literal if length is < min or length > max} | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/mygreen/super-csv-annotation/blob/9910320cb6dc143be972c7d10d9ab5ffb09c3b84/src/main/java/com/github/mygreen/supercsv/cellprocessor/constraint/LengthExact.java#L67-L92 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/config/AliasedDiscoveryConfigUtils.java | AliasedDiscoveryConfigUtils.newConfigFor | @SuppressWarnings("unchecked")
public static AliasedDiscoveryConfig newConfigFor(String tag) {
"""
Creates new {@link AliasedDiscoveryConfig} by the given {@code tag}.
"""
if ("aws".equals(tag)) {
return new AwsConfig();
} else if ("gcp".equals(tag)) {
return new Gcp... | java | @SuppressWarnings("unchecked")
public static AliasedDiscoveryConfig newConfigFor(String tag) {
if ("aws".equals(tag)) {
return new AwsConfig();
} else if ("gcp".equals(tag)) {
return new GcpConfig();
} else if ("azure".equals(tag)) {
return new AzureConfig... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"AliasedDiscoveryConfig",
"newConfigFor",
"(",
"String",
"tag",
")",
"{",
"if",
"(",
"\"aws\"",
".",
"equals",
"(",
"tag",
")",
")",
"{",
"return",
"new",
"AwsConfig",
"(",
")",
";",
"... | Creates new {@link AliasedDiscoveryConfig} by the given {@code tag}. | [
"Creates",
"new",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/config/AliasedDiscoveryConfigUtils.java#L187-L202 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/RedisChannelHandler.java | RedisChannelHandler.setTimeout | @Deprecated
public void setTimeout(long timeout, TimeUnit unit) {
"""
Set the command timeout for this connection.
@param timeout Command timeout.
@param unit Unit of time for the timeout.
@deprecated since 5.0, use {@link #setTimeout(Duration)}
"""
setTimeout(Duration.ofNanos(unit.toNanos(tim... | java | @Deprecated
public void setTimeout(long timeout, TimeUnit unit) {
setTimeout(Duration.ofNanos(unit.toNanos(timeout)));
} | [
"@",
"Deprecated",
"public",
"void",
"setTimeout",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"setTimeout",
"(",
"Duration",
".",
"ofNanos",
"(",
"unit",
".",
"toNanos",
"(",
"timeout",
")",
")",
")",
";",
"}"
] | Set the command timeout for this connection.
@param timeout Command timeout.
@param unit Unit of time for the timeout.
@deprecated since 5.0, use {@link #setTimeout(Duration)} | [
"Set",
"the",
"command",
"timeout",
"for",
"this",
"connection",
"."
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/RedisChannelHandler.java#L111-L114 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java | NameService.getMap | public Map getMap(String name, boolean create) {
"""
This method will return the state map associated with the Nameable object if the
object has been stored in the <code>NameService</code> and something has been stored
into the <code>Map</code>. Otherwise this will return null indicating that the map
is empty.... | java | public Map getMap(String name, boolean create) {
if (name == null)
throw new IllegalStateException("name must not be null");
if (_nameMap == null)
return null;
TrackingObject to = (TrackingObject) _nameMap.get(name);
// The object wasn't found
if (to ==... | [
"public",
"Map",
"getMap",
"(",
"String",
"name",
",",
"boolean",
"create",
")",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"throw",
"new",
"IllegalStateException",
"(",
"\"name must not be null\"",
")",
";",
"if",
"(",
"_nameMap",
"==",
"null",
")",
"retu... | This method will return the state map associated with the Nameable object if the
object has been stored in the <code>NameService</code> and something has been stored
into the <code>Map</code>. Otherwise this will return null indicating that the map
is empty. If the <code>create</code> parameter is true, we will alway... | [
"This",
"method",
"will",
"return",
"the",
"state",
"map",
"associated",
"with",
"the",
"Nameable",
"object",
"if",
"the",
"object",
"has",
"been",
"stored",
"in",
"the",
"<code",
">",
"NameService<",
"/",
"code",
">",
"and",
"something",
"has",
"been",
"s... | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/requeststate/NameService.java#L243-L267 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java | ExcelWriter.write | @SuppressWarnings( {
"""
写出数据,本方法只是将数据写入Workbook中的Sheet,并不写出到文件<br>
写出的起始行为当前行号,可使用{@link #getCurrentRow()}方法调用,根据写出的的行数,当前行号自动增加<br>
样式为默认样式,可使用{@link #getCellStyle()}方法调用后自定义默认样式<br>
data中元素支持的类型有:
<p>
1. Map,既元素为一个Map,第一个Map的keys作为首行,剩下的行为Map的values,data表示多行 <br>
2. Bean,既元素为一个Bean,第一个Bean的字段名列表会作为首行,剩下... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
public ExcelWriter write(Iterable<?> data, Comparator<String> comparator) {
Assert.isFalse(this.isClosed, "ExcelWriter has been closed!");
boolean isFirstRow = true;
Map<?, ?> map;
for (Object obj : data) {
if (obj instanceof Map) {
map = new TreeMap... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"ExcelWriter",
"write",
"(",
"Iterable",
"<",
"?",
">",
"data",
",",
"Comparator",
"<",
"String",
">",
"comparator",
")",
"{",
"Assert",
".",
"isFalse",
"(",
"this... | 写出数据,本方法只是将数据写入Workbook中的Sheet,并不写出到文件<br>
写出的起始行为当前行号,可使用{@link #getCurrentRow()}方法调用,根据写出的的行数,当前行号自动增加<br>
样式为默认样式,可使用{@link #getCellStyle()}方法调用后自定义默认样式<br>
data中元素支持的类型有:
<p>
1. Map,既元素为一个Map,第一个Map的keys作为首行,剩下的行为Map的values,data表示多行 <br>
2. Bean,既元素为一个Bean,第一个Bean的字段名列表会作为首行,剩下的行为Bean的字段值列表,data表示多行 <br>
</p>
@pa... | [
"写出数据,本方法只是将数据写入Workbook中的Sheet,并不写出到文件<br",
">",
"写出的起始行为当前行号,可使用",
"{",
"@link",
"#getCurrentRow",
"()",
"}",
"方法调用,根据写出的的行数,当前行号自动增加<br",
">",
"样式为默认样式,可使用",
"{",
"@link",
"#getCellStyle",
"()",
"}",
"方法调用后自定义默认样式<br",
">",
"data中元素支持的类型有:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/ExcelWriter.java#L626-L644 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/optics/lenses/CollectionLens.java | CollectionLens.asSet | public static <X, CX extends Collection<X>> Lens.Simple<CX, Set<X>> asSet(
Function<? super CX, ? extends CX> copyFn) {
"""
Convenience static factory method for creating a lens that focuses on an arbitrary {@link Collection} as a
{@link Set}.
@param copyFn the copying function
@param <X> the c... | java | public static <X, CX extends Collection<X>> Lens.Simple<CX, Set<X>> asSet(
Function<? super CX, ? extends CX> copyFn) {
return simpleLens(HashSet::new, (xsL, xsS) -> {
Set<X> missing = new HashSet<>(xsS);
missing.removeAll(xsL);
CX updated = copyFn.apply(xsL);
... | [
"public",
"static",
"<",
"X",
",",
"CX",
"extends",
"Collection",
"<",
"X",
">",
">",
"Lens",
".",
"Simple",
"<",
"CX",
",",
"Set",
"<",
"X",
">",
">",
"asSet",
"(",
"Function",
"<",
"?",
"super",
"CX",
",",
"?",
"extends",
"CX",
">",
"copyFn",
... | Convenience static factory method for creating a lens that focuses on an arbitrary {@link Collection} as a
{@link Set}.
@param copyFn the copying function
@param <X> the collection element type
@param <CX> the type of the collection
@return a lens that focuses on a Collection as a Set | [
"Convenience",
"static",
"factory",
"method",
"for",
"creating",
"a",
"lens",
"that",
"focuses",
"on",
"an",
"arbitrary",
"{",
"@link",
"Collection",
"}",
"as",
"a",
"{",
"@link",
"Set",
"}",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/optics/lenses/CollectionLens.java#L43-L53 |
OpenLiberty/open-liberty | dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigEvaluator.java | ConfigEvaluator.convertObjectToSingleValue | private Object convertObjectToSingleValue(Object rawValue, ExtendedAttributeDefinition attrDef, EvaluationContext context, int index,
boolean ignoreWarnings) throws ConfigEvaluatorException {
"""
Process and evaluate a raw value.
@return the converted value, or null... | java | private Object convertObjectToSingleValue(Object rawValue, ExtendedAttributeDefinition attrDef, EvaluationContext context, int index,
boolean ignoreWarnings) throws ConfigEvaluatorException {
if (rawValue instanceof String) {
return convertStringToSingle... | [
"private",
"Object",
"convertObjectToSingleValue",
"(",
"Object",
"rawValue",
",",
"ExtendedAttributeDefinition",
"attrDef",
",",
"EvaluationContext",
"context",
",",
"int",
"index",
",",
"boolean",
"ignoreWarnings",
")",
"throws",
"ConfigEvaluatorException",
"{",
"if",
... | Process and evaluate a raw value.
@return the converted value, or null if the value was unresolved | [
"Process",
"and",
"evaluate",
"a",
"raw",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.config/src/com/ibm/ws/config/xml/internal/ConfigEvaluator.java#L895-L911 |
FilteredPush/event_date_qc | src/main/java/org/filteredpush/qc/date/DateUtils.java | DateUtils.eventsAreSameInterval | public static Boolean eventsAreSameInterval(String eventDate, String secondEventDate) {
"""
Compare two strings that should represent event dates (ingoring time, if not a date range)
@param eventDate to compare with second event date
@param secondEventDate to compare with
@return true if the two provided even... | java | public static Boolean eventsAreSameInterval(String eventDate, String secondEventDate) {
boolean result = false;
try {
Interval interval = null;
Interval secondInterval = null;
interval = DateUtils.extractDateInterval(eventDate);
secondInterval = DateUtils.extractDateInterval(secondEven... | [
"public",
"static",
"Boolean",
"eventsAreSameInterval",
"(",
"String",
"eventDate",
",",
"String",
"secondEventDate",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"try",
"{",
"Interval",
"interval",
"=",
"null",
";",
"Interval",
"secondInterval",
"=",
"null... | Compare two strings that should represent event dates (ingoring time, if not a date range)
@param eventDate to compare with second event date
@param secondEventDate to compare with
@return true if the two provided event dates represent the same interval. | [
"Compare",
"two",
"strings",
"that",
"should",
"represent",
"event",
"dates",
"(",
"ingoring",
"time",
"if",
"not",
"a",
"date",
"range",
")"
] | train | https://github.com/FilteredPush/event_date_qc/blob/52957a71b94b00b767e37924f976e2c7e8868ff3/src/main/java/org/filteredpush/qc/date/DateUtils.java#L2608-L2625 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/utils/FastDateFormat.java | FastDateFormat.getTimeZoneDisplay | static synchronized String getTimeZoneDisplay(TimeZone tz, boolean daylight, int style, Locale locale) {
"""
<p>Gets the time zone display name, using a cache for performance.</p>
@param tz the zone to query
@param daylight true if daylight savings
@param style the style to use <code>TimeZone.LONG</code>
... | java | static synchronized String getTimeZoneDisplay(TimeZone tz, boolean daylight, int style, Locale locale) {
Object key = new TimeZoneDisplayKey(tz, daylight, style, locale);
String value = (String) cTimeZoneDisplayCache.get(key);
if (value == null) {
// This is a very slow call, so ... | [
"static",
"synchronized",
"String",
"getTimeZoneDisplay",
"(",
"TimeZone",
"tz",
",",
"boolean",
"daylight",
",",
"int",
"style",
",",
"Locale",
"locale",
")",
"{",
"Object",
"key",
"=",
"new",
"TimeZoneDisplayKey",
"(",
"tz",
",",
"daylight",
",",
"style",
... | <p>Gets the time zone display name, using a cache for performance.</p>
@param tz the zone to query
@param daylight true if daylight savings
@param style the style to use <code>TimeZone.LONG</code>
or <code>TimeZone.SHORT</code>
@param locale the locale to use
@return the textual name of the time zone | [
"<p",
">",
"Gets",
"the",
"time",
"zone",
"display",
"name",
"using",
"a",
"cache",
"for",
"performance",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/utils/FastDateFormat.java#L497-L506 |
s1-platform/s1 | s1-core/src/java/org/s1/ws/SOAPOperation.java | SOAPOperation.getAction | protected String getAction(String service, SOAPMessage msg, HttpServletRequest request) {
"""
Get SOAPAction, try to get it from first body child name
@param service
@param msg
@param request
@return
"""
if(!request.getMethod().equalsIgnoreCase("post")){
return null;
}
... | java | protected String getAction(String service, SOAPMessage msg, HttpServletRequest request){
if(!request.getMethod().equalsIgnoreCase("post")){
return null;
}
String a = null;
Element action = null;
try {
action = XMLFormat.getFirstChildElement(msg.getSOAPBod... | [
"protected",
"String",
"getAction",
"(",
"String",
"service",
",",
"SOAPMessage",
"msg",
",",
"HttpServletRequest",
"request",
")",
"{",
"if",
"(",
"!",
"request",
".",
"getMethod",
"(",
")",
".",
"equalsIgnoreCase",
"(",
"\"post\"",
")",
")",
"{",
"return",... | Get SOAPAction, try to get it from first body child name
@param service
@param msg
@param request
@return | [
"Get",
"SOAPAction",
"try",
"to",
"get",
"it",
"from",
"first",
"body",
"child",
"name"
] | train | https://github.com/s1-platform/s1/blob/370101c13fef01af524bc171bcc1a97e5acc76e8/s1-core/src/java/org/s1/ws/SOAPOperation.java#L178-L193 |
pawelprazak/java-extended | guava/src/main/java/com/bluecatcode/common/contract/Checks.java | Checks.checkUri | public static String checkUri(String uri, @Nullable Object errorMessage) {
"""
Performs URI check against RFC 2396 specification
@param uri the URI to check
@return the checked uri
@throws IllegalArgumentException if the {@code uri} is invalid
@throws NullPointerException if the {@code uri} is null
@see... | java | public static String checkUri(String uri, @Nullable Object errorMessage) {
return checkUri(uri, String.valueOf(errorMessage), EMPTY_ERROR_MESSAGE_ARGS);
} | [
"public",
"static",
"String",
"checkUri",
"(",
"String",
"uri",
",",
"@",
"Nullable",
"Object",
"errorMessage",
")",
"{",
"return",
"checkUri",
"(",
"uri",
",",
"String",
".",
"valueOf",
"(",
"errorMessage",
")",
",",
"EMPTY_ERROR_MESSAGE_ARGS",
")",
";",
"}... | Performs URI check against RFC 2396 specification
@param uri the URI to check
@return the checked uri
@throws IllegalArgumentException if the {@code uri} is invalid
@throws NullPointerException if the {@code uri} is null
@see Checks#checkUri(String, String, Object...) | [
"Performs",
"URI",
"check",
"against",
"RFC",
"2396",
"specification"
] | train | https://github.com/pawelprazak/java-extended/blob/ce1a556a95cbbf7c950a03662938bc02622de69b/guava/src/main/java/com/bluecatcode/common/contract/Checks.java#L448-L450 |
cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/AtomContainerSet.java | AtomContainerSet.setMultiplier | @Override
public boolean setMultiplier(IAtomContainer container, Double multiplier) {
"""
Sets the coefficient of a AtomContainer to a given value.
@param container The AtomContainer for which the multiplier is set
@param multiplier The new multiplier for the AtomContatiner
@return true i... | java | @Override
public boolean setMultiplier(IAtomContainer container, Double multiplier) {
for (int i = 0; i < atomContainers.length; i++) {
if (atomContainers[i] == container) {
multipliers[i] = multiplier;
return true;
}
}
return false;
... | [
"@",
"Override",
"public",
"boolean",
"setMultiplier",
"(",
"IAtomContainer",
"container",
",",
"Double",
"multiplier",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"atomContainers",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"at... | Sets the coefficient of a AtomContainer to a given value.
@param container The AtomContainer for which the multiplier is set
@param multiplier The new multiplier for the AtomContatiner
@return true if multiplier has been set
@see #getMultiplier(IAtomContainer) | [
"Sets",
"the",
"coefficient",
"of",
"a",
"AtomContainer",
"to",
"a",
"given",
"value",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/AtomContainerSet.java#L146-L155 |
shrinkwrap/resolver | maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/bootstrap/MavenRepositorySystem.java | MavenRepositorySystem.resolveArtifact | public ArtifactResult resolveArtifact(final RepositorySystemSession session, final ArtifactRequest request)
throws ArtifactResolutionException {
"""
Resolves an artifact
@param session The current Maven session
@param request The request to be computed
@return The artifact
@throws ArtifactResolut... | java | public ArtifactResult resolveArtifact(final RepositorySystemSession session, final ArtifactRequest request)
throws ArtifactResolutionException {
return system.resolveArtifact(session, request);
} | [
"public",
"ArtifactResult",
"resolveArtifact",
"(",
"final",
"RepositorySystemSession",
"session",
",",
"final",
"ArtifactRequest",
"request",
")",
"throws",
"ArtifactResolutionException",
"{",
"return",
"system",
".",
"resolveArtifact",
"(",
"session",
",",
"request",
... | Resolves an artifact
@param session The current Maven session
@param request The request to be computed
@return The artifact
@throws ArtifactResolutionException If the artifact could not be fetched | [
"Resolves",
"an",
"artifact"
] | train | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/bootstrap/MavenRepositorySystem.java#L133-L136 |
sarl/sarl | contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java | PyExpressionGenerator._generate | protected XExpression _generate(XFeatureCall call, IAppendable it, IExtraLanguageGeneratorContext context) {
"""
Generate the given object.
@param call the feature call.
@param it the target for the generated content.
@param context the context.
@return the feature call.
"""
appendReturnIfExpectedRetur... | java | protected XExpression _generate(XFeatureCall call, IAppendable it, IExtraLanguageGeneratorContext context) {
appendReturnIfExpectedReturnedExpression(it, context);
newFeatureCallGenerator(context, it).generate(call);
return call;
} | [
"protected",
"XExpression",
"_generate",
"(",
"XFeatureCall",
"call",
",",
"IAppendable",
"it",
",",
"IExtraLanguageGeneratorContext",
"context",
")",
"{",
"appendReturnIfExpectedReturnedExpression",
"(",
"it",
",",
"context",
")",
";",
"newFeatureCallGenerator",
"(",
"... | Generate the given object.
@param call the feature call.
@param it the target for the generated content.
@param context the context.
@return the feature call. | [
"Generate",
"the",
"given",
"object",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/contribs/io.sarl.pythongenerator/io.sarl.pythongenerator.generator/src/io/sarl/pythongenerator/generator/generator/PyExpressionGenerator.java#L497-L501 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java | CollectionLiteralsTypeComputer.getCommonSuperType | @Override
protected LightweightTypeReference getCommonSuperType(List<LightweightTypeReference> types, ITypeComputationState state) {
"""
Specializes the super implementation such that is allows an empty list of types.
Returns {@code null} for those.
{@inheritDoc}
"""
if (types.isEmpty()) {
return nul... | java | @Override
protected LightweightTypeReference getCommonSuperType(List<LightweightTypeReference> types, ITypeComputationState state) {
if (types.isEmpty()) {
return null;
}
LightweightTypeReference result = super.getCommonSuperType(types, state);
return result;
} | [
"@",
"Override",
"protected",
"LightweightTypeReference",
"getCommonSuperType",
"(",
"List",
"<",
"LightweightTypeReference",
">",
"types",
",",
"ITypeComputationState",
"state",
")",
"{",
"if",
"(",
"types",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
... | Specializes the super implementation such that is allows an empty list of types.
Returns {@code null} for those.
{@inheritDoc} | [
"Specializes",
"the",
"super",
"implementation",
"such",
"that",
"is",
"allows",
"an",
"empty",
"list",
"of",
"types",
".",
"Returns",
"{",
"@code",
"null",
"}",
"for",
"those",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/CollectionLiteralsTypeComputer.java#L76-L83 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RunnableUtils.java | RunnableUtils.runWithSleepThenReturnValueThrowOnInterrupt | public static <T> T runWithSleepThenReturnValueThrowOnInterrupt(long milliseconds, ReturningRunnable<T> runnable) {
"""
Runs the given {@link ReturningRunnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds before returning a value.
This utility method... | java | public static <T> T runWithSleepThenReturnValueThrowOnInterrupt(long milliseconds, ReturningRunnable<T> runnable) {
Assert.isTrue(milliseconds > 0, "Milliseconds [%d] must be greater than 0", milliseconds);
T returnValue = runnable.run();
if (!ThreadUtils.sleep(milliseconds, 0)) {
throw new SleepDe... | [
"public",
"static",
"<",
"T",
">",
"T",
"runWithSleepThenReturnValueThrowOnInterrupt",
"(",
"long",
"milliseconds",
",",
"ReturningRunnable",
"<",
"T",
">",
"runnable",
")",
"{",
"Assert",
".",
"isTrue",
"(",
"milliseconds",
">",
"0",
",",
"\"Milliseconds [%d] mus... | Runs the given {@link ReturningRunnable} object and then causes the current, calling {@link Thread} to sleep
for the given number of milliseconds before returning a value.
This utility method can be used to simulate a long running, expensive operation.
@param <T> {{@link Class} type of the {@link ReturningRunnable} r... | [
"Runs",
"the",
"given",
"{",
"@link",
"ReturningRunnable",
"}",
"object",
"and",
"then",
"causes",
"the",
"current",
"calling",
"{",
"@link",
"Thread",
"}",
"to",
"sleep",
"for",
"the",
"given",
"number",
"of",
"milliseconds",
"before",
"returning",
"a",
"va... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RunnableUtils.java#L153-L164 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.accessRestriction_sms_id_PUT | public void accessRestriction_sms_id_PUT(Long id, OvhSmsAccount body) throws IOException {
"""
Alter this object properties
REST: PUT /me/accessRestriction/sms/{id}
@param body [required] New object properties
@param id [required] The Id of the restriction
"""
String qPath = "/me/accessRestriction/sms/{... | java | public void accessRestriction_sms_id_PUT(Long id, OvhSmsAccount body) throws IOException {
String qPath = "/me/accessRestriction/sms/{id}";
StringBuilder sb = path(qPath, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"accessRestriction_sms_id_PUT",
"(",
"Long",
"id",
",",
"OvhSmsAccount",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/accessRestriction/sms/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
")... | Alter this object properties
REST: PUT /me/accessRestriction/sms/{id}
@param body [required] New object properties
@param id [required] The Id of the restriction | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3854-L3858 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.