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 |
|---|---|---|---|---|---|---|---|---|---|---|
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java | BaseMetadataHandler.processProcedureName | private String processProcedureName(String dbProductName, String procedureName) {
"""
Processes Procedure/Function name so it would be compatible with database
Also is responsible for cleaning procedure name returned by DatabaseMetadata
@param dbProductName short database name
@param procedureName Stored Proc... | java | private String processProcedureName(String dbProductName, String procedureName) {
String result = null;
if (procedureName != null) {
if ("Microsoft SQL Server".equals(dbProductName) == true || "Sybase".equals(dbProductName) == true) {
if ("Microsoft SQL Server".equals(d... | [
"private",
"String",
"processProcedureName",
"(",
"String",
"dbProductName",
",",
"String",
"procedureName",
")",
"{",
"String",
"result",
"=",
"null",
";",
"if",
"(",
"procedureName",
"!=",
"null",
")",
"{",
"if",
"(",
"\"Microsoft SQL Server\"",
".",
"equals",... | Processes Procedure/Function name so it would be compatible with database
Also is responsible for cleaning procedure name returned by DatabaseMetadata
@param dbProductName short database name
@param procedureName Stored Procedure/Function
@return processed Procedure/Function name | [
"Processes",
"Procedure",
"/",
"Function",
"name",
"so",
"it",
"would",
"be",
"compatible",
"with",
"database",
"Also",
"is",
"responsible",
"for",
"cleaning",
"procedure",
"name",
"returned",
"by",
"DatabaseMetadata"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/metadata/BaseMetadataHandler.java#L279-L299 |
google/closure-templates | java/src/com/google/template/soy/types/SoyTypeRegistry.java | SoyTypeRegistry.getOrCreateMapType | public MapType getOrCreateMapType(SoyType keyType, SoyType valueType) {
"""
Factory function which creates a map type, given a key and value type. This folds map types
with identical key/value types together, so asking for the same key/value type twice will
return a pointer to the same type object.
@param key... | java | public MapType getOrCreateMapType(SoyType keyType, SoyType valueType) {
return mapTypes.intern(MapType.of(keyType, valueType));
} | [
"public",
"MapType",
"getOrCreateMapType",
"(",
"SoyType",
"keyType",
",",
"SoyType",
"valueType",
")",
"{",
"return",
"mapTypes",
".",
"intern",
"(",
"MapType",
".",
"of",
"(",
"keyType",
",",
"valueType",
")",
")",
";",
"}"
] | Factory function which creates a map type, given a key and value type. This folds map types
with identical key/value types together, so asking for the same key/value type twice will
return a pointer to the same type object.
@param keyType The key type of the map.
@param valueType The value type of the map.
@return The... | [
"Factory",
"function",
"which",
"creates",
"a",
"map",
"type",
"given",
"a",
"key",
"and",
"value",
"type",
".",
"This",
"folds",
"map",
"types",
"with",
"identical",
"key",
"/",
"value",
"types",
"together",
"so",
"asking",
"for",
"the",
"same",
"key",
... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/types/SoyTypeRegistry.java#L259-L261 |
threerings/nenya | tools/src/main/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java | MapFileTileSetIDBroker.readMapFile | public static void readMapFile (BufferedReader bin, HashMap<String, Integer> map)
throws IOException {
"""
Reads in a mapping from strings to integers, which should have been
written via {@link #writeMapFile}.
"""
String line;
while ((line = bin.readLine()) != null) {
int e... | java | public static void readMapFile (BufferedReader bin, HashMap<String, Integer> map)
throws IOException
{
String line;
while ((line = bin.readLine()) != null) {
int eidx = line.indexOf(SEP_STR);
if (eidx == -1) {
throw new IOException("Malformed line, no ... | [
"public",
"static",
"void",
"readMapFile",
"(",
"BufferedReader",
"bin",
",",
"HashMap",
"<",
"String",
",",
"Integer",
">",
"map",
")",
"throws",
"IOException",
"{",
"String",
"line",
";",
"while",
"(",
"(",
"line",
"=",
"bin",
".",
"readLine",
"(",
")"... | Reads in a mapping from strings to integers, which should have been
written via {@link #writeMapFile}. | [
"Reads",
"in",
"a",
"mapping",
"from",
"strings",
"to",
"integers",
"which",
"should",
"have",
"been",
"written",
"via",
"{"
] | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/tools/src/main/java/com/threerings/media/tile/tools/MapFileTileSetIDBroker.java#L138-L156 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateWord | public static <T extends CharSequence> T validateWord(T value, String errorMsg) throws ValidateException {
"""
验证是否为字母(包括大写和小写字母)
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 4.1.8
"""
if (false == isWord(value)) {
throw new Valida... | java | public static <T extends CharSequence> T validateWord(T value, String errorMsg) throws ValidateException {
if (false == isWord(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateWord",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isWord",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Va... | 验证是否为字母(包括大写和小写字母)
@param <T> 字符串类型
@param value 表单值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
@since 4.1.8 | [
"验证是否为字母(包括大写和小写字母)"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L572-L577 |
datasift/datasift-java | src/main/java/com/datasift/client/push/connectors/Prepared.java | Prepared.verifyAndGet | public Map<String, String> verifyAndGet() {
"""
/*
Verifies that all required parameters have been set
@return a map of the parameters
"""
for (String paramName : required) {
if (params.get(paramName) == null) {
throw new IllegalStateException(format("Param %s is require... | java | public Map<String, String> verifyAndGet() {
for (String paramName : required) {
if (params.get(paramName) == null) {
throw new IllegalStateException(format("Param %s is required but has not been supplied", paramName));
}
}
return params;
} | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"verifyAndGet",
"(",
")",
"{",
"for",
"(",
"String",
"paramName",
":",
"required",
")",
"{",
"if",
"(",
"params",
".",
"get",
"(",
"paramName",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalS... | /*
Verifies that all required parameters have been set
@return a map of the parameters | [
"/",
"*",
"Verifies",
"that",
"all",
"required",
"parameters",
"have",
"been",
"set"
] | train | https://github.com/datasift/datasift-java/blob/09de124f2a1a507ff6181e59875c6f325290850e/src/main/java/com/datasift/client/push/connectors/Prepared.java#L27-L34 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java | SplitMergeLineFitLoop.selectSplitOffset | protected int selectSplitOffset( int indexStart , int length ) {
"""
Finds the point between indexStart and the end point which is the greater distance from the line
(set up prior to calling). Returns the index of the element with a distances greater than tolerance, otherwise -1
@return Selected offset from s... | java | protected int selectSplitOffset( int indexStart , int length ) {
int bestOffset = -1;
int indexEnd = (indexStart + length) % N;
Point2D_I32 startPt = contour.get(indexStart);
Point2D_I32 endPt = contour.get(indexEnd);
line.p.set(startPt.x,startPt.y);
line.slope.set(endPt.x-startPt.x,endPt.y-startPt.y);
... | [
"protected",
"int",
"selectSplitOffset",
"(",
"int",
"indexStart",
",",
"int",
"length",
")",
"{",
"int",
"bestOffset",
"=",
"-",
"1",
";",
"int",
"indexEnd",
"=",
"(",
"indexStart",
"+",
"length",
")",
"%",
"N",
";",
"Point2D_I32",
"startPt",
"=",
"cont... | Finds the point between indexStart and the end point which is the greater distance from the line
(set up prior to calling). Returns the index of the element with a distances greater than tolerance, otherwise -1
@return Selected offset from start of the split. -1 if no split was selected | [
"Finds",
"the",
"point",
"between",
"indexStart",
"and",
"the",
"end",
"point",
"which",
"is",
"the",
"greater",
"distance",
"from",
"the",
"line",
"(",
"set",
"up",
"prior",
"to",
"calling",
")",
".",
"Returns",
"the",
"index",
"of",
"the",
"element",
"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/shapes/polyline/splitmerge/SplitMergeLineFitLoop.java#L228-L255 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/SecureDfuImpl.java | SecureDfuImpl.readChecksum | private ObjectChecksum readChecksum() throws DeviceDisconnectedException, DfuException,
UploadAbortedException, RemoteDfuException, UnknownResponseException {
"""
Sends the Calculate Checksum request. As a response a notification will be sent with current
offset and CRC32 of the current object.
@re... | java | private ObjectChecksum readChecksum() throws DeviceDisconnectedException, DfuException,
UploadAbortedException, RemoteDfuException, UnknownResponseException {
if (!mConnected)
throw new DeviceDisconnectedException("Unable to read Checksum: device disconnected");
writeOpCode(mControlPointCharacterist... | [
"private",
"ObjectChecksum",
"readChecksum",
"(",
")",
"throws",
"DeviceDisconnectedException",
",",
"DfuException",
",",
"UploadAbortedException",
",",
"RemoteDfuException",
",",
"UnknownResponseException",
"{",
"if",
"(",
"!",
"mConnected",
")",
"throw",
"new",
"Devic... | Sends the Calculate Checksum request. As a response a notification will be sent with current
offset and CRC32 of the current object.
@return requested object info.
@throws DeviceDisconnectedException
@throws DfuException
@throws UploadAbortedException
@throws RemoteDfuException thrown when the returned status code is ... | [
"Sends",
"the",
"Calculate",
"Checksum",
"request",
".",
"As",
"a",
"response",
"a",
"notification",
"will",
"be",
"sent",
"with",
"current",
"offset",
"and",
"CRC32",
"of",
"the",
"current",
"object",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/SecureDfuImpl.java#L870-L888 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java | AtomDODeserializer.getContentSrcAsFile | protected File getContentSrcAsFile(IRI contentSrc, File tempDir) throws ObjectIntegrityException, IOException {
"""
Returns the an Entry's contentSrc as a File relative to the tempDir param.
@param contentSrc
@param tempDir
@return the contentSrc as a File relative to tempDir.
@throws ObjectIntegrityExceptio... | java | protected File getContentSrcAsFile(IRI contentSrc, File tempDir) throws ObjectIntegrityException, IOException {
if (contentSrc.isAbsolute() || contentSrc.isPathAbsolute()) {
throw new ObjectIntegrityException("contentSrc must not be absolute");
}
try {
// Normalize the IR... | [
"protected",
"File",
"getContentSrcAsFile",
"(",
"IRI",
"contentSrc",
",",
"File",
"tempDir",
")",
"throws",
"ObjectIntegrityException",
",",
"IOException",
"{",
"if",
"(",
"contentSrc",
".",
"isAbsolute",
"(",
")",
"||",
"contentSrc",
".",
"isPathAbsolute",
"(",
... | Returns the an Entry's contentSrc as a File relative to the tempDir param.
@param contentSrc
@param tempDir
@return the contentSrc as a File relative to tempDir.
@throws ObjectIntegrityException | [
"Returns",
"the",
"an",
"Entry",
"s",
"contentSrc",
"as",
"a",
"File",
"relative",
"to",
"the",
"tempDir",
"param",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/translation/AtomDODeserializer.java#L607-L631 |
google/closure-compiler | src/com/google/javascript/jscomp/FunctionTypeBuilder.java | FunctionTypeBuilder.registerTemplates | private void registerTemplates(Iterable<TemplateType> templates, @Nullable Node scopeRoot) {
"""
Register the template keys in a template scope and on the function node.
"""
if (!Iterables.isEmpty(templates)) {
// Add any templates from JSDoc into our template scope.
this.templateScope = typeRe... | java | private void registerTemplates(Iterable<TemplateType> templates, @Nullable Node scopeRoot) {
if (!Iterables.isEmpty(templates)) {
// Add any templates from JSDoc into our template scope.
this.templateScope = typeRegistry.createScopeWithTemplates(templateScope, templates);
// Register the template ... | [
"private",
"void",
"registerTemplates",
"(",
"Iterable",
"<",
"TemplateType",
">",
"templates",
",",
"@",
"Nullable",
"Node",
"scopeRoot",
")",
"{",
"if",
"(",
"!",
"Iterables",
".",
"isEmpty",
"(",
"templates",
")",
")",
"{",
"// Add any templates from JSDoc in... | Register the template keys in a template scope and on the function node. | [
"Register",
"the",
"template",
"keys",
"in",
"a",
"template",
"scope",
"and",
"on",
"the",
"function",
"node",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/FunctionTypeBuilder.java#L669-L678 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java | ActiveSyncManager.stopSyncInternal | public void stopSyncInternal(AlluxioURI syncPoint, MountTable.Resolution resolution) {
"""
stop active sync on a URI.
@param syncPoint sync point to be stopped
@param resolution path resolution for the sync point
"""
try (LockResource r = new LockResource(mSyncManagerLock)) {
LOG.debug("stop sync... | java | public void stopSyncInternal(AlluxioURI syncPoint, MountTable.Resolution resolution) {
try (LockResource r = new LockResource(mSyncManagerLock)) {
LOG.debug("stop syncPoint {}", syncPoint.getPath());
RemoveSyncPointEntry removeSyncPoint = File.RemoveSyncPointEntry.newBuilder()
.setSyncpointPat... | [
"public",
"void",
"stopSyncInternal",
"(",
"AlluxioURI",
"syncPoint",
",",
"MountTable",
".",
"Resolution",
"resolution",
")",
"{",
"try",
"(",
"LockResource",
"r",
"=",
"new",
"LockResource",
"(",
"mSyncManagerLock",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
... | stop active sync on a URI.
@param syncPoint sync point to be stopped
@param resolution path resolution for the sync point | [
"stop",
"active",
"sync",
"on",
"a",
"URI",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/activesync/ActiveSyncManager.java#L302-L321 |
scalecube/scalecube-services | services-api/src/main/java/io/scalecube/services/api/Qualifier.java | Qualifier.asString | public static String asString(String namespace, String action) {
"""
Builds qualifier string out of given namespace and action.
@param namespace qualifier namespace.
@param action qualifier action.
@return constructed qualifier.
"""
return DELIMITER + namespace + DELIMITER + action;
} | java | public static String asString(String namespace, String action) {
return DELIMITER + namespace + DELIMITER + action;
} | [
"public",
"static",
"String",
"asString",
"(",
"String",
"namespace",
",",
"String",
"action",
")",
"{",
"return",
"DELIMITER",
"+",
"namespace",
"+",
"DELIMITER",
"+",
"action",
";",
"}"
] | Builds qualifier string out of given namespace and action.
@param namespace qualifier namespace.
@param action qualifier action.
@return constructed qualifier. | [
"Builds",
"qualifier",
"string",
"out",
"of",
"given",
"namespace",
"and",
"action",
"."
] | train | https://github.com/scalecube/scalecube-services/blob/76c8de6019e5480a1436d12b37acf163f70eea47/services-api/src/main/java/io/scalecube/services/api/Qualifier.java#L27-L29 |
sonatype/sisu-guice | extensions/servlet/src/com/google/inject/servlet/ServletScopes.java | ServletScopes.scopeRequest | public static RequestScoper scopeRequest(Map<Key<?>, Object> seedMap) {
"""
Returns an object that will apply request scope to a block of code. This is not the same as the
HTTP request scope, but is used if no HTTP request scope is in progress. In this way, keys can
be scoped as @RequestScoped and exist in non-H... | java | public static RequestScoper scopeRequest(Map<Key<?>, Object> seedMap) {
Preconditions.checkArgument(
null != seedMap, "Seed map cannot be null, try passing in Collections.emptyMap() instead.");
// Copy the seed values into our local scope map.
final Context context = new Context();
Map<Key<?>, ... | [
"public",
"static",
"RequestScoper",
"scopeRequest",
"(",
"Map",
"<",
"Key",
"<",
"?",
">",
",",
"Object",
">",
"seedMap",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"null",
"!=",
"seedMap",
",",
"\"Seed map cannot be null, try passing in Collections.empt... | Returns an object that will apply request scope to a block of code. This is not the same as the
HTTP request scope, but is used if no HTTP request scope is in progress. In this way, keys can
be scoped as @RequestScoped and exist in non-HTTP requests (for example: RPC requests) as well
as in HTTP request threads.
<p>Th... | [
"Returns",
"an",
"object",
"that",
"will",
"apply",
"request",
"scope",
"to",
"a",
"block",
"of",
"code",
".",
"This",
"is",
"not",
"the",
"same",
"as",
"the",
"HTTP",
"request",
"scope",
"but",
"is",
"used",
"if",
"no",
"HTTP",
"request",
"scope",
"is... | train | https://github.com/sonatype/sisu-guice/blob/45f5c89834c189c5338640bf55e6e6181b9b5611/extensions/servlet/src/com/google/inject/servlet/ServletScopes.java#L359-L387 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java | ScenarioPortrayal.updateDataSerieToHistogram | public void updateDataSerieToHistogram(String histogramID, double[] dataSerie, int index) {
"""
Updates the given Histogram (index).
The index will be the order of the histogram.
@param histogramID
@param dataSerie
@param index
"""
this.histograms.get(histogramID).updateSeries(index, dataSerie... | java | public void updateDataSerieToHistogram(String histogramID, double[] dataSerie, int index){
this.histograms.get(histogramID).updateSeries(index, dataSerie);
} | [
"public",
"void",
"updateDataSerieToHistogram",
"(",
"String",
"histogramID",
",",
"double",
"[",
"]",
"dataSerie",
",",
"int",
"index",
")",
"{",
"this",
".",
"histograms",
".",
"get",
"(",
"histogramID",
")",
".",
"updateSeries",
"(",
"index",
",",
"dataSe... | Updates the given Histogram (index).
The index will be the order of the histogram.
@param histogramID
@param dataSerie
@param index | [
"Updates",
"the",
"given",
"Histogram",
"(",
"index",
")",
".",
"The",
"index",
"will",
"be",
"the",
"order",
"of",
"the",
"histogram",
"."
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java#L442-L444 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java | ApiOvhCaasregistry.serviceName_users_userId_DELETE | public void serviceName_users_userId_DELETE(String serviceName, String userId) throws IOException {
"""
Delete user
REST: DELETE /caas/registry/{serviceName}/users/{userId}
@param serviceName [required] Service name
@param userId [required] User id
API beta
"""
String qPath = "/caas/registry/{service... | java | public void serviceName_users_userId_DELETE(String serviceName, String userId) throws IOException {
String qPath = "/caas/registry/{serviceName}/users/{userId}";
StringBuilder sb = path(qPath, serviceName, userId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"serviceName_users_userId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"userId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/registry/{serviceName}/users/{userId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath... | Delete user
REST: DELETE /caas/registry/{serviceName}/users/{userId}
@param serviceName [required] Service name
@param userId [required] User id
API beta | [
"Delete",
"user"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caasregistry/src/main/java/net/minidev/ovh/api/ApiOvhCaasregistry.java#L139-L143 |
aws/aws-sdk-java | aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointUser.java | EndpointUser.setUserAttributes | public void setUserAttributes(java.util.Map<String, java.util.List<String>> userAttributes) {
"""
Custom attributes that describe the user by associating a name with an array of values. For example, an attribute
named "interests" might have the following values: ["science", "politics", "travel"]. You can use thes... | java | public void setUserAttributes(java.util.Map<String, java.util.List<String>> userAttributes) {
this.userAttributes = userAttributes;
} | [
"public",
"void",
"setUserAttributes",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"userAttributes",
")",
"{",
"this",
".",
"userAttributes",
"=",
"userAttributes",
";",
"}"
] | Custom attributes that describe the user by associating a name with an array of values. For example, an attribute
named "interests" might have the following values: ["science", "politics", "travel"]. You can use these
attributes as selection criteria when you create segments.
The Amazon Pinpoint console can't display ... | [
"Custom",
"attributes",
"that",
"describe",
"the",
"user",
"by",
"associating",
"a",
"name",
"with",
"an",
"array",
"of",
"values",
".",
"For",
"example",
"an",
"attribute",
"named",
"interests",
"might",
"have",
"the",
"following",
"values",
":",
"[",
"scie... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-pinpoint/src/main/java/com/amazonaws/services/pinpoint/model/EndpointUser.java#L83-L85 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java | HttpHeaderMap.addDateHeader | public void addDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final ZonedDateTime aDT) {
"""
Add the passed header as a date header.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param aDT
The DateTime to set as a date. May not be <code>null</code>.
"""
_addHeade... | java | public void addDateHeader (@Nonnull @Nonempty final String sName, @Nonnull final ZonedDateTime aDT)
{
_addHeader (sName, getDateTimeAsString (aDT));
} | [
"public",
"void",
"addDateHeader",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sName",
",",
"@",
"Nonnull",
"final",
"ZonedDateTime",
"aDT",
")",
"{",
"_addHeader",
"(",
"sName",
",",
"getDateTimeAsString",
"(",
"aDT",
")",
")",
";",
"}"
] | Add the passed header as a date header.
@param sName
Header name. May neither be <code>null</code> nor empty.
@param aDT
The DateTime to set as a date. May not be <code>null</code>. | [
"Add",
"the",
"passed",
"header",
"as",
"a",
"date",
"header",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/http/HttpHeaderMap.java#L330-L333 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java | FilesImpl.listFromComputeNodeNextAsync | public Observable<Page<NodeFile>> listFromComputeNodeNextAsync(final String nextPageLink, final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions) {
"""
Lists all of the files in task directories on the specified compute node.
@param nextPageLink The NextLink from the previous successful cal... | java | public Observable<Page<NodeFile>> listFromComputeNodeNextAsync(final String nextPageLink, final FileListFromComputeNodeNextOptions fileListFromComputeNodeNextOptions) {
return listFromComputeNodeNextWithServiceResponseAsync(nextPageLink, fileListFromComputeNodeNextOptions)
.map(new Func1<Service... | [
"public",
"Observable",
"<",
"Page",
"<",
"NodeFile",
">",
">",
"listFromComputeNodeNextAsync",
"(",
"final",
"String",
"nextPageLink",
",",
"final",
"FileListFromComputeNodeNextOptions",
"fileListFromComputeNodeNextOptions",
")",
"{",
"return",
"listFromComputeNodeNextWithSe... | Lists all of the files in task directories on the specified compute node.
@param nextPageLink The NextLink from the previous successful call to List operation.
@param fileListFromComputeNodeNextOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@re... | [
"Lists",
"all",
"of",
"the",
"files",
"in",
"task",
"directories",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/FilesImpl.java#L2628-L2636 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/opengl/TextureLoader.java | TextureLoader.getTexture | public static Texture getTexture(String format, InputStream in) throws IOException {
"""
Load a texture with a given format from the supplied input stream
@param format The format of the texture to be loaded (something like "PNG" or "TGA")
@param in The input stream from which the image data will be read
@ret... | java | public static Texture getTexture(String format, InputStream in) throws IOException {
return getTexture(format, in, false, GL11.GL_LINEAR);
} | [
"public",
"static",
"Texture",
"getTexture",
"(",
"String",
"format",
",",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"return",
"getTexture",
"(",
"format",
",",
"in",
",",
"false",
",",
"GL11",
".",
"GL_LINEAR",
")",
";",
"}"
] | Load a texture with a given format from the supplied input stream
@param format The format of the texture to be loaded (something like "PNG" or "TGA")
@param in The input stream from which the image data will be read
@return The newly created texture
@throws IOException Indicates a failure to read the image data | [
"Load",
"a",
"texture",
"with",
"a",
"given",
"format",
"from",
"the",
"supplied",
"input",
"stream"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/opengl/TextureLoader.java#L23-L25 |
Swrve/rate-limited-logger | src/main/java/com/swrve/ratelimitedlogger/RateLimitedLog.java | RateLimitedLog.get | public LogWithPatternAndLevel get(String pattern, Level level) {
"""
@return a LogWithPatternAndLevel object for the supplied @param message and
@param level . This can be cached and reused by callers in performance-sensitive
cases to avoid performing two ConcurrentHashMap lookups.
Note that the string is th... | java | public LogWithPatternAndLevel get(String pattern, Level level) {
return get(pattern).get(level);
} | [
"public",
"LogWithPatternAndLevel",
"get",
"(",
"String",
"pattern",
",",
"Level",
"level",
")",
"{",
"return",
"get",
"(",
"pattern",
")",
".",
"get",
"(",
"level",
")",
";",
"}"
] | @return a LogWithPatternAndLevel object for the supplied @param message and
@param level . This can be cached and reused by callers in performance-sensitive
cases to avoid performing two ConcurrentHashMap lookups.
Note that the string is the sole key used, so the same string cannot be reused with differing period
set... | [
"@return",
"a",
"LogWithPatternAndLevel",
"object",
"for",
"the",
"supplied",
"@param",
"message",
"and",
"@param",
"level",
".",
"This",
"can",
"be",
"cached",
"and",
"reused",
"by",
"callers",
"in",
"performance",
"-",
"sensitive",
"cases",
"to",
"avoid",
"p... | train | https://github.com/Swrve/rate-limited-logger/blob/9094d3961f35dad0d6114aafade4a34b0b264b0b/src/main/java/com/swrve/ratelimitedlogger/RateLimitedLog.java#L433-L435 |
logic-ng/LogicNG | src/main/java/org/logicng/formulas/FormulaFactory.java | FormulaFactory.naryOperator | public Formula naryOperator(final FType type, final Collection<? extends Formula> operands) {
"""
Creates a new n-ary operator with a given type and a list of operands.
@param type the type of the formula
@param operands the list of operands
@return the newly generated formula
@throws IllegalArgumentExcept... | java | public Formula naryOperator(final FType type, final Collection<? extends Formula> operands) {
return this.naryOperator(type, operands.toArray(new Formula[0]));
} | [
"public",
"Formula",
"naryOperator",
"(",
"final",
"FType",
"type",
",",
"final",
"Collection",
"<",
"?",
"extends",
"Formula",
">",
"operands",
")",
"{",
"return",
"this",
".",
"naryOperator",
"(",
"type",
",",
"operands",
".",
"toArray",
"(",
"new",
"For... | Creates a new n-ary operator with a given type and a list of operands.
@param type the type of the formula
@param operands the list of operands
@return the newly generated formula
@throws IllegalArgumentException if a wrong formula type is passed | [
"Creates",
"a",
"new",
"n",
"-",
"ary",
"operator",
"with",
"a",
"given",
"type",
"and",
"a",
"list",
"of",
"operands",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/formulas/FormulaFactory.java#L367-L369 |
UrielCh/ovh-java-sdk | ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java | ApiOvhXdsl.serviceName_modem_reset_POST | public OvhTask serviceName_modem_reset_POST(String serviceName, Boolean resetOvhConfig) throws IOException {
"""
Reset the modem to its default configuration
REST: POST /xdsl/{serviceName}/modem/reset
@param resetOvhConfig [required] Reset configuration stored in OVH databases
@param serviceName [required] Th... | java | public OvhTask serviceName_modem_reset_POST(String serviceName, Boolean resetOvhConfig) throws IOException {
String qPath = "/xdsl/{serviceName}/modem/reset";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "resetOvhConfig", resetOvhConfig);
St... | [
"public",
"OvhTask",
"serviceName_modem_reset_POST",
"(",
"String",
"serviceName",
",",
"Boolean",
"resetOvhConfig",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/xdsl/{serviceName}/modem/reset\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Reset the modem to its default configuration
REST: POST /xdsl/{serviceName}/modem/reset
@param resetOvhConfig [required] Reset configuration stored in OVH databases
@param serviceName [required] The internal name of your XDSL offer | [
"Reset",
"the",
"modem",
"to",
"its",
"default",
"configuration"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-xdsl/src/main/java/net/minidev/ovh/api/ApiOvhXdsl.java#L1257-L1264 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getCompositeEntityRole | public EntityRole getCompositeEntityRole(UUID appId, String versionId, UUID cEntityId, UUID roleId) {
"""
Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param roleId entity role ID.
@throws Illega... | java | public EntityRole getCompositeEntityRole(UUID appId, String versionId, UUID cEntityId, UUID roleId) {
return getCompositeEntityRoleWithServiceResponseAsync(appId, versionId, cEntityId, roleId).toBlocking().single().body();
} | [
"public",
"EntityRole",
"getCompositeEntityRole",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"cEntityId",
",",
"UUID",
"roleId",
")",
"{",
"return",
"getCompositeEntityRoleWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"cEntityId",... | Get one entity role for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param cEntityId The composite entity extractor ID.
@param roleId entity role ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is r... | [
"Get",
"one",
"entity",
"role",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L12354-L12356 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/serializer/StringSerializer.java | StringSerializer.canRead | @Override
public boolean canRead(@Nonnull MediaType mimeType, Type resultType) {
"""
Checks whether mime types is supported by this serializer implementation
"""
MediaType type = mimeType.withoutParameters();
return (type.is(MediaType.ANY_TEXT_TYPE) || MediaType.APPLICATION_XML_UTF_8.withou... | java | @Override
public boolean canRead(@Nonnull MediaType mimeType, Type resultType) {
MediaType type = mimeType.withoutParameters();
return (type.is(MediaType.ANY_TEXT_TYPE) || MediaType.APPLICATION_XML_UTF_8.withoutParameters().is(type)
|| MediaType.JSON_UTF_8.withoutParameters().is(type... | [
"@",
"Override",
"public",
"boolean",
"canRead",
"(",
"@",
"Nonnull",
"MediaType",
"mimeType",
",",
"Type",
"resultType",
")",
"{",
"MediaType",
"type",
"=",
"mimeType",
".",
"withoutParameters",
"(",
")",
";",
"return",
"(",
"type",
".",
"is",
"(",
"Media... | Checks whether mime types is supported by this serializer implementation | [
"Checks",
"whether",
"mime",
"types",
"is",
"supported",
"by",
"this",
"serializer",
"implementation"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/serializer/StringSerializer.java#L87-L92 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/API.java | API.validateMandatoryParams | private void validateMandatoryParams(JSONObject params, ApiElement element) throws ApiException {
"""
Validates that the mandatory parameters of the given {@code ApiElement} are present, throwing an {@code ApiException} if
not.
@param params the parameters of the API request.
@param element the API element to... | java | private void validateMandatoryParams(JSONObject params, ApiElement element) throws ApiException {
if (element == null) {
return;
}
List<String> mandatoryParams = element.getMandatoryParamNames();
if (mandatoryParams != null) {
for (String param : mandatoryParams) {
if (!params.has(param) || params.ge... | [
"private",
"void",
"validateMandatoryParams",
"(",
"JSONObject",
"params",
",",
"ApiElement",
"element",
")",
"throws",
"ApiException",
"{",
"if",
"(",
"element",
"==",
"null",
")",
"{",
"return",
";",
"}",
"List",
"<",
"String",
">",
"mandatoryParams",
"=",
... | Validates that the mandatory parameters of the given {@code ApiElement} are present, throwing an {@code ApiException} if
not.
@param params the parameters of the API request.
@param element the API element to validate.
@throws ApiException if any of the mandatory parameters is missing. | [
"Validates",
"that",
"the",
"mandatory",
"parameters",
"of",
"the",
"given",
"{",
"@code",
"ApiElement",
"}",
"are",
"present",
"throwing",
"an",
"{",
"@code",
"ApiException",
"}",
"if",
"not",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/API.java#L558-L571 |
sebastiangraf/jSCSI | bundles/target/src/main/java/org/jscsi/target/util/BitManip.java | BitManip.getByteWithBitSet | public static final byte getByteWithBitSet (final byte b, final int bitNumber, final boolean value) {
"""
Sets a single bit. If the <i>value</i> parameter is <code>true</code>, the bit will be set to <code>one</code>,
and to <code>zero</code> otherwise. All other bits will be left unchanged.
<p>
The bits are nu... | java | public static final byte getByteWithBitSet (final byte b, final int bitNumber, final boolean value) {
int number = b;
if (value) {
// make sure bit is set to true
int mask = 1;
mask <<= bitNumber;
number |= mask;
} else {
in... | [
"public",
"static",
"final",
"byte",
"getByteWithBitSet",
"(",
"final",
"byte",
"b",
",",
"final",
"int",
"bitNumber",
",",
"final",
"boolean",
"value",
")",
"{",
"int",
"number",
"=",
"b",
";",
"if",
"(",
"value",
")",
"{",
"// make sure bit is set to true\... | Sets a single bit. If the <i>value</i> parameter is <code>true</code>, the bit will be set to <code>one</code>,
and to <code>zero</code> otherwise. All other bits will be left unchanged.
<p>
The bits are numbered in big-endian format, from 0 (LSB) to 7 (MSB).
<p>
<code>
+---+---+---+---+---+---+---+---+<br>
| 7 | 6 | 5... | [
"Sets",
"a",
"single",
"bit",
".",
"If",
"the",
"<i",
">",
"value<",
"/",
"i",
">",
"parameter",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
"the",
"bit",
"will",
"be",
"set",
"to",
"<code",
">",
"one<",
"/",
"code",
">",
"and",
"to",
"<code",... | train | https://github.com/sebastiangraf/jSCSI/blob/6169bfe73f0b15de7d6485453555389e782ae888/bundles/target/src/main/java/org/jscsi/target/util/BitManip.java#L35-L52 |
GII/broccoli | broccoli-api/src/main/java/com/hi3project/broccoli/bsdl/impl/meta/MetaPropertyVersion.java | MetaPropertyVersion.compareTo | private static int compareTo(Deque<String> first, Deque<String> second) {
"""
Compares two string ordered lists containing numbers.
@return -1 when first group is higher, 0 if equals, 1 when second group is higher
"""
if (0 == first.size() && 0 == second.size()) {
return 0;
}
... | java | private static int compareTo(Deque<String> first, Deque<String> second) {
if (0 == first.size() && 0 == second.size()) {
return 0;
}
if (0 == first.size()) {
return 1;
}
if (0 == second.size()) {
return -1;
}
int headsComparatio... | [
"private",
"static",
"int",
"compareTo",
"(",
"Deque",
"<",
"String",
">",
"first",
",",
"Deque",
"<",
"String",
">",
"second",
")",
"{",
"if",
"(",
"0",
"==",
"first",
".",
"size",
"(",
")",
"&&",
"0",
"==",
"second",
".",
"size",
"(",
")",
")",... | Compares two string ordered lists containing numbers.
@return -1 when first group is higher, 0 if equals, 1 when second group is higher | [
"Compares",
"two",
"string",
"ordered",
"lists",
"containing",
"numbers",
"."
] | train | https://github.com/GII/broccoli/blob/a3033a90322cbcee4dc0f1719143b84b822bc4ba/broccoli-api/src/main/java/com/hi3project/broccoli/bsdl/impl/meta/MetaPropertyVersion.java#L82-L98 |
threerings/narya | core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java | PresentsDObjectMgr.setDefaultAccessController | public void setDefaultAccessController (AccessController controller) {
"""
Sets up an access controller that will be provided to any distributed objects created on the
server. The controllers can subsequently be overridden if desired, but a default controller
is useful for implementing basic access control polic... | java | public void setDefaultAccessController (AccessController controller)
{
AccessController oldDefault = _defaultController;
_defaultController = controller;
// switch all objects from the old default (null, usually) to the new default.
for (DObject obj : _objects.values()) {
... | [
"public",
"void",
"setDefaultAccessController",
"(",
"AccessController",
"controller",
")",
"{",
"AccessController",
"oldDefault",
"=",
"_defaultController",
";",
"_defaultController",
"=",
"controller",
";",
"// switch all objects from the old default (null, usually) to the new de... | Sets up an access controller that will be provided to any distributed objects created on the
server. The controllers can subsequently be overridden if desired, but a default controller
is useful for implementing basic access control policies. | [
"Sets",
"up",
"an",
"access",
"controller",
"that",
"will",
"be",
"provided",
"to",
"any",
"distributed",
"objects",
"created",
"on",
"the",
"server",
".",
"The",
"controllers",
"can",
"subsequently",
"be",
"overridden",
"if",
"desired",
"but",
"a",
"default",... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/server/PresentsDObjectMgr.java#L152-L163 |
m-m-m/util | resource/src/main/java/net/sf/mmm/util/resource/base/ClasspathResource.java | ClasspathResource.getAbsolutePath | private static String getAbsolutePath(Class<?> someClass, String nameOrSuffix, boolean append) {
"""
@see #ClasspathResource(Class, String, boolean)
@param someClass is the class identifying the path where the resource is located and the prefix of its
filename.
@param nameOrSuffix is the filename of the resou... | java | private static String getAbsolutePath(Class<?> someClass, String nameOrSuffix, boolean append) {
if (append) {
return someClass.getName().replace('.', '/') + nameOrSuffix;
} else {
return someClass.getPackage().getName().replace('.', '/') + '/' + nameOrSuffix;
}
} | [
"private",
"static",
"String",
"getAbsolutePath",
"(",
"Class",
"<",
"?",
">",
"someClass",
",",
"String",
"nameOrSuffix",
",",
"boolean",
"append",
")",
"{",
"if",
"(",
"append",
")",
"{",
"return",
"someClass",
".",
"getName",
"(",
")",
".",
"replace",
... | @see #ClasspathResource(Class, String, boolean)
@param someClass is the class identifying the path where the resource is located and the prefix of its
filename.
@param nameOrSuffix is the filename of the resource or a suffix (e.g. ".properties" or "-test.xml") for
it depending on {@code append}.
@param append - if {@c... | [
"@see",
"#ClasspathResource",
"(",
"Class",
"String",
"boolean",
")"
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/resource/src/main/java/net/sf/mmm/util/resource/base/ClasspathResource.java#L159-L166 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsEditorDisplayOptions.java | CmsEditorDisplayOptions.showElement | public boolean showElement(String key, String defaultValue, Properties displayOptions) {
"""
Determines if the given element should be shown in the editor.<p>
@param key the element key name which should be displayed
@param defaultValue the default value to use in case the property is not found, should be a bo... | java | public boolean showElement(String key, String defaultValue, Properties displayOptions) {
if (defaultValue == null) {
return ((displayOptions != null) && Boolean.valueOf(displayOptions.getProperty(key)).booleanValue());
}
if (displayOptions == null) {
return Boolean.value... | [
"public",
"boolean",
"showElement",
"(",
"String",
"key",
",",
"String",
"defaultValue",
",",
"Properties",
"displayOptions",
")",
"{",
"if",
"(",
"defaultValue",
"==",
"null",
")",
"{",
"return",
"(",
"(",
"displayOptions",
"!=",
"null",
")",
"&&",
"Boolean... | Determines if the given element should be shown in the editor.<p>
@param key the element key name which should be displayed
@param defaultValue the default value to use in case the property is not found, should be a boolean value as String
@param displayOptions the display options for the current user
@return true if... | [
"Determines",
"if",
"the",
"given",
"element",
"should",
"be",
"shown",
"in",
"the",
"editor",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsEditorDisplayOptions.java#L253-L262 |
hansenji/pocketknife | pocketknife/src/main/java/pocketknife/PocketKnife.java | PocketKnife.bindExtras | public static <T> void bindExtras(T target, Intent intent) {
"""
Bind annotated fields in the specified {@code target} from the {@link android.content.Intent}.
@param target Target object to bind the extras.
@param intent Intent containing the extras.
"""
@SuppressWarnings("unchecked")
Inte... | java | public static <T> void bindExtras(T target, Intent intent) {
@SuppressWarnings("unchecked")
IntentBinding<T> binding = (IntentBinding<T>) getIntentBinding(target.getClass().getClassLoader(), target.getClass());
if (binding != null) {
binding.bindExtras(target, intent);
}
... | [
"public",
"static",
"<",
"T",
">",
"void",
"bindExtras",
"(",
"T",
"target",
",",
"Intent",
"intent",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"IntentBinding",
"<",
"T",
">",
"binding",
"=",
"(",
"IntentBinding",
"<",
"T",
">",
")",
... | Bind annotated fields in the specified {@code target} from the {@link android.content.Intent}.
@param target Target object to bind the extras.
@param intent Intent containing the extras. | [
"Bind",
"annotated",
"fields",
"in",
"the",
"specified",
"{",
"@code",
"target",
"}",
"from",
"the",
"{",
"@link",
"android",
".",
"content",
".",
"Intent",
"}",
"."
] | train | https://github.com/hansenji/pocketknife/blob/f225dd66bcafdd702f472a5c99be1fb48202e6ca/pocketknife/src/main/java/pocketknife/PocketKnife.java#L114-L120 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/SwingUtils.java | SwingUtils.getDescendantNamed | public static Component getDescendantNamed(String name, Component parent) {
"""
Does a pre-order search of a component with a given name.
@param name
the name.
@param parent
the root component in hierarchy.
@return the found component (may be null).
"""
Assert.notNull(name, "name");
Ass... | java | public static Component getDescendantNamed(String name, Component parent) {
Assert.notNull(name, "name");
Assert.notNull(parent, "parent");
if (name.equals(parent.getName())) { // Base case
return parent;
} else if (parent instanceof Container) { // Recursive case
... | [
"public",
"static",
"Component",
"getDescendantNamed",
"(",
"String",
"name",
",",
"Component",
"parent",
")",
"{",
"Assert",
".",
"notNull",
"(",
"name",
",",
"\"name\"",
")",
";",
"Assert",
".",
"notNull",
"(",
"parent",
",",
"\"parent\"",
")",
";",
"if"... | Does a pre-order search of a component with a given name.
@param name
the name.
@param parent
the root component in hierarchy.
@return the found component (may be null). | [
"Does",
"a",
"pre",
"-",
"order",
"search",
"of",
"a",
"component",
"with",
"a",
"given",
"name",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/SwingUtils.java#L90-L109 |
JOML-CI/JOML | src/org/joml/Matrix3d.java | Matrix3d.rotateLocal | public Matrix3d rotateLocal(double ang, double x, double y, double z) {
"""
Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-hande... | java | public Matrix3d rotateLocal(double ang, double x, double y, double z) {
return rotateLocal(ang, x, y, z, this);
} | [
"public",
"Matrix3d",
"rotateLocal",
"(",
"double",
"ang",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"return",
"rotateLocal",
"(",
"ang",
",",
"x",
",",
"y",
",",
"z",
",",
"this",
")",
";",
"}"
] | Pre-multiply a rotation to this matrix by rotating the given amount of radians
about the specified <code>(x, y, z)</code> axis.
<p>
The axis described by the three components needs to be a unit vector.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vector
counter-clockwise arou... | [
"Pre",
"-",
"multiply",
"a",
"rotation",
"to",
"this",
"matrix",
"by",
"rotating",
"the",
"given",
"amount",
"of",
"radians",
"about",
"the",
"specified",
"<code",
">",
"(",
"x",
"y",
"z",
")",
"<",
"/",
"code",
">",
"axis",
".",
"<p",
">",
"The",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3d.java#L2652-L2654 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketFactory.java | SocketFactory.createWebSocketAdapter | protected WebSocketAdapter createWebSocketAdapter(@NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {
"""
Create adapter for websocket library events.
@param stateListenerWeakReference Listener for socket state changes.
@return Adapter for websocket library events.
"""
... | java | protected WebSocketAdapter createWebSocketAdapter(@NonNull final WeakReference<SocketStateListener> stateListenerWeakReference) {
return new WebSocketAdapter() {
@Override
public void onConnected(WebSocket websocket, Map<String, List<String>> headers) throws Exception {
... | [
"protected",
"WebSocketAdapter",
"createWebSocketAdapter",
"(",
"@",
"NonNull",
"final",
"WeakReference",
"<",
"SocketStateListener",
">",
"stateListenerWeakReference",
")",
"{",
"return",
"new",
"WebSocketAdapter",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"o... | Create adapter for websocket library events.
@param stateListenerWeakReference Listener for socket state changes.
@return Adapter for websocket library events. | [
"Create",
"adapter",
"for",
"websocket",
"library",
"events",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/sockets/SocketFactory.java#L136-L180 |
ModeShape/modeshape | modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java | Reflection.findBestMethodWithSignature | public Method findBestMethodWithSignature( String methodName,
Class<?>... argumentsClasses ) throws NoSuchMethodException, SecurityException {
"""
Find the best method on the target class that matches the signature specified with the specified name and the list of
ar... | java | public Method findBestMethodWithSignature( String methodName,
Class<?>... argumentsClasses ) throws NoSuchMethodException, SecurityException {
return findBestMethodWithSignature(methodName, true, argumentsClasses);
} | [
"public",
"Method",
"findBestMethodWithSignature",
"(",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"argumentsClasses",
")",
"throws",
"NoSuchMethodException",
",",
"SecurityException",
"{",
"return",
"findBestMethodWithSignature",
"(",
"methodName",
","... | Find the best method on the target class that matches the signature specified with the specified name and the list of
argument classes. This method first attempts to find the method with the specified argument classes; if no such method is
found, a NoSuchMethodException is thrown.
@param methodName the name of the met... | [
"Find",
"the",
"best",
"method",
"on",
"the",
"target",
"class",
"that",
"matches",
"the",
"signature",
"specified",
"with",
"the",
"specified",
"name",
"and",
"the",
"list",
"of",
"argument",
"classes",
".",
"This",
"method",
"first",
"attempts",
"to",
"fin... | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/Reflection.java#L692-L696 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/host/controller/jvm/JvmType.java | JvmType.createFromJavaHome | public static JvmType createFromJavaHome(final String javaHome, boolean forLaunch) {
"""
Create a {@code JvmType} based on the location of the root dir of the JRE/JDK installation.
@param javaHome the root dir of the JRE/JDK installation. Cannot be {@code null} or empty
@param forLaunch {@code true} if the creat... | java | public static JvmType createFromJavaHome(final String javaHome, boolean forLaunch) {
if (javaHome == null || javaHome.trim().equals("")) {
throw HostControllerLogger.ROOT_LOGGER.invalidJavaHome(javaHome);
}
final File javaHomeDir = new File(javaHome);
if (forLaunch && !javaHo... | [
"public",
"static",
"JvmType",
"createFromJavaHome",
"(",
"final",
"String",
"javaHome",
",",
"boolean",
"forLaunch",
")",
"{",
"if",
"(",
"javaHome",
"==",
"null",
"||",
"javaHome",
".",
"trim",
"(",
")",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"thro... | Create a {@code JvmType} based on the location of the root dir of the JRE/JDK installation.
@param javaHome the root dir of the JRE/JDK installation. Cannot be {@code null} or empty
@param forLaunch {@code true} if the created object will be used for launching servers; {@code false}
if it is simply a data holder. A val... | [
"Create",
"a",
"{",
"@code",
"JvmType",
"}",
"based",
"on",
"the",
"location",
"of",
"the",
"root",
"dir",
"of",
"the",
"JRE",
"/",
"JDK",
"installation",
".",
"@param",
"javaHome",
"the",
"root",
"dir",
"of",
"the",
"JRE",
"/",
"JDK",
"installation",
... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/jvm/JvmType.java#L106-L123 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/resource/TemplateSignatureRequest.java | TemplateSignatureRequest.setCustomFieldValue | public void setCustomFieldValue(String fieldNameOrApiId, String value) {
"""
Adds the value to fill in for a custom field with the given field name.
@param fieldNameOrApiId String name (or "Field Label") of the custom field
to be filled in. The "api_id" can also be used instead of the name.
@param value Strin... | java | public void setCustomFieldValue(String fieldNameOrApiId, String value) {
CustomField f = new CustomField();
f.setName(fieldNameOrApiId);
f.setValue(value);
customFields.add(f);
} | [
"public",
"void",
"setCustomFieldValue",
"(",
"String",
"fieldNameOrApiId",
",",
"String",
"value",
")",
"{",
"CustomField",
"f",
"=",
"new",
"CustomField",
"(",
")",
";",
"f",
".",
"setName",
"(",
"fieldNameOrApiId",
")",
";",
"f",
".",
"setValue",
"(",
"... | Adds the value to fill in for a custom field with the given field name.
@param fieldNameOrApiId String name (or "Field Label") of the custom field
to be filled in. The "api_id" can also be used instead of the name.
@param value String value | [
"Adds",
"the",
"value",
"to",
"fill",
"in",
"for",
"a",
"custom",
"field",
"with",
"the",
"given",
"field",
"name",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/resource/TemplateSignatureRequest.java#L202-L207 |
aws/aws-sdk-java | aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeSimulationApplicationResult.java | DescribeSimulationApplicationResult.withTags | public DescribeSimulationApplicationResult withTags(java.util.Map<String, String> tags) {
"""
<p>
The list of all tags added to the specified simulation application.
</p>
@param tags
The list of all tags added to the specified simulation application.
@return Returns a reference to this object so that method... | java | public DescribeSimulationApplicationResult withTags(java.util.Map<String, String> tags) {
setTags(tags);
return this;
} | [
"public",
"DescribeSimulationApplicationResult",
"withTags",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"setTags",
"(",
"tags",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The list of all tags added to the specified simulation application.
</p>
@param tags
The list of all tags added to the specified simulation application.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"list",
"of",
"all",
"tags",
"added",
"to",
"the",
"specified",
"simulation",
"application",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-robomaker/src/main/java/com/amazonaws/services/robomaker/model/DescribeSimulationApplicationResult.java#L513-L516 |
lessthanoptimal/ddogleg | src/org/ddogleg/sorting/ApproximateSort_F32.java | ApproximateSort_F32.sortObject | public void sortObject( SortableParameter_F32 input[] , int start , int length ) {
"""
Sorts the input list
@param input (Input) Data which is to be sorted. Not modified.
@param start First element in input list
@param length Length of the input list
"""
for( int i = 0; i < histIndexes.size; i++ ) {
... | java | public void sortObject( SortableParameter_F32 input[] , int start , int length ) {
for( int i = 0; i < histIndexes.size; i++ ) {
histObjs[i].reset();
}
for( int i = 0; i < length; i++ ) {
int indexInput = i+start;
SortableParameter_F32 p = input[indexInput];
int discretized = (int)((p.sortValue-minV... | [
"public",
"void",
"sortObject",
"(",
"SortableParameter_F32",
"input",
"[",
"]",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"histIndexes",
".",
"size",
";",
"i",
"++",
")",
"{",
"histObjs",
... | Sorts the input list
@param input (Input) Data which is to be sorted. Not modified.
@param start First element in input list
@param length Length of the input list | [
"Sorts",
"the",
"input",
"list"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/sorting/ApproximateSort_F32.java#L155-L176 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/PathAlterationObserver.java | PathAlterationObserver.checkAndNotify | private void checkAndNotify(final FileStatusEntry parent, final FileStatusEntry[] previous, final Path[] currentPaths)
throws IOException {
"""
Compare two file lists for files which have been created, modified or deleted.
@param parent The parent entry
@param previous The original list of paths
@param ... | java | private void checkAndNotify(final FileStatusEntry parent, final FileStatusEntry[] previous, final Path[] currentPaths)
throws IOException {
int c = 0;
final FileStatusEntry[] current =
currentPaths.length > 0 ? new FileStatusEntry[currentPaths.length] : FileStatusEntry.EMPTY_ENTRIES;
for (fin... | [
"private",
"void",
"checkAndNotify",
"(",
"final",
"FileStatusEntry",
"parent",
",",
"final",
"FileStatusEntry",
"[",
"]",
"previous",
",",
"final",
"Path",
"[",
"]",
"currentPaths",
")",
"throws",
"IOException",
"{",
"int",
"c",
"=",
"0",
";",
"final",
"Fil... | Compare two file lists for files which have been created, modified or deleted.
@param parent The parent entry
@param previous The original list of paths
@param currentPaths The current list of paths | [
"Compare",
"two",
"file",
"lists",
"for",
"files",
"which",
"have",
"been",
"created",
"modified",
"or",
"deleted",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/filesystem/PathAlterationObserver.java#L201-L229 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.perspectiveRect | public Matrix4f perspectiveRect(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
"""
Apply a symmetric perspective projection frustum transformation using for a right-handed coordinate system
the given NDC z range to this matrix.
<p>
If <code>M</code> is <code>this</code> matrix and <co... | java | public Matrix4f perspectiveRect(float width, float height, float zNear, float zFar, boolean zZeroToOne) {
return perspectiveRect(width, height, zNear, zFar, zZeroToOne, thisOrNew());
} | [
"public",
"Matrix4f",
"perspectiveRect",
"(",
"float",
"width",
",",
"float",
"height",
",",
"float",
"zNear",
",",
"float",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"return",
"perspectiveRect",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",
... | Apply a symmetric perspective projection frustum transformation using for a right-handed coordinate system
the given NDC z range to this matrix.
<p>
If <code>M</code> is <code>this</code> matrix and <code>P</code> the perspective projection matrix,
then the new matrix will be <code>M * P</code>. So when transforming a
... | [
"Apply",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"using",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"the",
"given",
"NDC",
"z",
"range",
"to",
"this",
"matrix",
".",
"<p",
">",
"If",
"<code",
">",
"M<",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L9535-L9537 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.getPnsCredentials | public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) {
"""
Lists the PNS Credentials associated with a notification hub .
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notific... | java | public PnsCredentialsResourceInner getPnsCredentials(String resourceGroupName, String namespaceName, String notificationHubName) {
return getPnsCredentialsWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName).toBlocking().single().body();
} | [
"public",
"PnsCredentialsResourceInner",
"getPnsCredentials",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
")",
"{",
"return",
"getPnsCredentialsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"namespaceName... | Lists the PNS Credentials associated with a notification hub .
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown ... | [
"Lists",
"the",
"PNS",
"Credentials",
"associated",
"with",
"a",
"notification",
"hub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L1765-L1767 |
sematext/ActionGenerator | ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java | JSONUtils.getElasticSearchAddDocument | public static String getElasticSearchAddDocument(Map<String, String> values) {
"""
Returns ElasticSearch add command.
@param values
values to include
@return XML as String
"""
StringBuilder builder = new StringBuilder();
builder.append("{");
boolean first = true;
for (Map.Entry<String, Str... | java | public static String getElasticSearchAddDocument(Map<String, String> values) {
StringBuilder builder = new StringBuilder();
builder.append("{");
boolean first = true;
for (Map.Entry<String, String> pair : values.entrySet()) {
if (!first) {
builder.append(",");
}
JSONUtils.addEl... | [
"public",
"static",
"String",
"getElasticSearchAddDocument",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"values",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"{\"",
")",
";",
"boolean... | Returns ElasticSearch add command.
@param values
values to include
@return XML as String | [
"Returns",
"ElasticSearch",
"add",
"command",
"."
] | train | https://github.com/sematext/ActionGenerator/blob/10f4a3e680f20d7d151f5d40e6758aeb072d474f/ag-player-es/src/main/java/com/sematext/ag/es/util/JSONUtils.java#L39-L52 |
phax/ph-oton | ph-oton-core/src/main/java/com/helger/photon/core/form/FormErrorList.java | FormErrorList.addFieldWarning | public void addFieldWarning (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText) {
"""
Add a field specific warning message.
@param sFieldName
The field name for which the message is to be recorded. May neither
be <code>null</code> nor empty.
@param sText
The text to use. May ... | java | public void addFieldWarning (@Nonnull @Nonempty final String sFieldName, @Nonnull @Nonempty final String sText)
{
add (SingleError.builderWarn ().setErrorFieldName (sFieldName).setErrorText (sText).build ());
} | [
"public",
"void",
"addFieldWarning",
"(",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sFieldName",
",",
"@",
"Nonnull",
"@",
"Nonempty",
"final",
"String",
"sText",
")",
"{",
"add",
"(",
"SingleError",
".",
"builderWarn",
"(",
")",
".",
"setErrorFie... | Add a field specific warning message.
@param sFieldName
The field name for which the message is to be recorded. May neither
be <code>null</code> nor empty.
@param sText
The text to use. May neither be <code>null</code> nor empty. | [
"Add",
"a",
"field",
"specific",
"warning",
"message",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/form/FormErrorList.java#L66-L69 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java | SVGPath.moveTo | public SVGPath moveTo(double x, double y) {
"""
Move to the given coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax.
"""
return append(PATH_MOVE).append(x).append(y);
} | java | public SVGPath moveTo(double x, double y) {
return append(PATH_MOVE).append(x).append(y);
} | [
"public",
"SVGPath",
"moveTo",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"return",
"append",
"(",
"PATH_MOVE",
")",
".",
"append",
"(",
"x",
")",
".",
"append",
"(",
"y",
")",
";",
"}"
] | Move to the given coordinates.
@param x new coordinates
@param y new coordinates
@return path object, for compact syntax. | [
"Move",
"to",
"the",
"given",
"coordinates",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/SVGPath.java#L311-L313 |
diffplug/durian | src/com/diffplug/common/base/MoreCollectors.java | MoreCollectors.singleOrEmpty | public static <T> Collector<T, ?, Optional<T>> singleOrEmpty() {
"""
Collector which traverses a stream and returns either a single element
(if there was only one element) or empty (if there were 0 or more than 1
elements). It traverses the entire stream, even if two elements
have been encountered and the empt... | java | public static <T> Collector<T, ?, Optional<T>> singleOrEmpty() {
return Collectors.collectingAndThen(Collectors.toList(),
lst -> lst.size() == 1 ? Optional.of(lst.get(0)) : Optional.empty());
} | [
"public",
"static",
"<",
"T",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Optional",
"<",
"T",
">",
">",
"singleOrEmpty",
"(",
")",
"{",
"return",
"Collectors",
".",
"collectingAndThen",
"(",
"Collectors",
".",
"toList",
"(",
")",
",",
"lst",
"->",
"... | Collector which traverses a stream and returns either a single element
(if there was only one element) or empty (if there were 0 or more than 1
elements). It traverses the entire stream, even if two elements
have been encountered and the empty return value is now certain.
<p>
Implementation credit to Misha <a href="ht... | [
"Collector",
"which",
"traverses",
"a",
"stream",
"and",
"returns",
"either",
"a",
"single",
"element",
"(",
"if",
"there",
"was",
"only",
"one",
"element",
")",
"or",
"empty",
"(",
"if",
"there",
"were",
"0",
"or",
"more",
"than",
"1",
"elements",
")",
... | train | https://github.com/diffplug/durian/blob/10631a3480e5491eb6eb6ee06e752d8596914232/src/com/diffplug/common/base/MoreCollectors.java#L34-L37 |
anotheria/moskito | moskito-core/src/main/java/net/anotheria/moskito/core/plugins/PluginRepository.java | PluginRepository.addPlugin | public void addPlugin(String name, MoskitoPlugin plugin, PluginConfig config) {
"""
Adds a new loaded plugin.
@param name name of the plugin for ui.
@param plugin the plugin instance.
@param config plugin config which was used to load the plugin.
"""
plugins.put(name, plugin);
try{
plugin.initialize(... | java | public void addPlugin(String name, MoskitoPlugin plugin, PluginConfig config){
plugins.put(name, plugin);
try{
plugin.initialize();
configs.put(name, config);
}catch(Exception e){
log.warn("couldn't initialize plugin "+name+" - "+plugin+", removing", e);
plugins.remove(name);
}
} | [
"public",
"void",
"addPlugin",
"(",
"String",
"name",
",",
"MoskitoPlugin",
"plugin",
",",
"PluginConfig",
"config",
")",
"{",
"plugins",
".",
"put",
"(",
"name",
",",
"plugin",
")",
";",
"try",
"{",
"plugin",
".",
"initialize",
"(",
")",
";",
"configs",... | Adds a new loaded plugin.
@param name name of the plugin for ui.
@param plugin the plugin instance.
@param config plugin config which was used to load the plugin. | [
"Adds",
"a",
"new",
"loaded",
"plugin",
"."
] | train | https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/plugins/PluginRepository.java#L82-L91 |
josueeduardo/snappy | plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/jar/JarEntryData.java | JarEntryData.decodeMsDosFormatDateTime | private Calendar decodeMsDosFormatDateTime(long date, long time) {
"""
Decode MS-DOS Date Time details. See
<a href="http://mindprod.com/jgloss/zip.html">mindprod.com/jgloss/zip.html</a> for
more details of the format.
@param date the date part
@param time the time part
@return a {@link Calendar} containing... | java | private Calendar decodeMsDosFormatDateTime(long date, long time) {
int year = (int) ((date >> 9) & 0x7F) + 1980;
int month = (int) ((date >> 5) & 0xF) - 1;
int day = (int) (date & 0x1F);
int hours = (int) ((time >> 11) & 0x1F);
int minutes = (int) ((time >> 5) & 0x3F);
in... | [
"private",
"Calendar",
"decodeMsDosFormatDateTime",
"(",
"long",
"date",
",",
"long",
"time",
")",
"{",
"int",
"year",
"=",
"(",
"int",
")",
"(",
"(",
"date",
">>",
"9",
")",
"&",
"0x7F",
")",
"+",
"1980",
";",
"int",
"month",
"=",
"(",
"int",
")",... | Decode MS-DOS Date Time details. See
<a href="http://mindprod.com/jgloss/zip.html">mindprod.com/jgloss/zip.html</a> for
more details of the format.
@param date the date part
@param time the time part
@return a {@link Calendar} containing the decoded date. | [
"Decode",
"MS",
"-",
"DOS",
"Date",
"Time",
"details",
".",
"See",
"<a",
"href",
"=",
"http",
":",
"//",
"mindprod",
".",
"com",
"/",
"jgloss",
"/",
"zip",
".",
"html",
">",
"mindprod",
".",
"com",
"/",
"jgloss",
"/",
"zip",
".",
"html<",
"/",
"a... | train | https://github.com/josueeduardo/snappy/blob/d95a9e811eda3c24a5e53086369208819884fa49/plugin-parent/snappy-loader/src/main/java/io/joshworks/snappy/loader/jar/JarEntryData.java#L176-L184 |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java | XmlStreamReaderUtils.requiredStringAttribute | public static String requiredStringAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
"""
Returns the value of an attribute as a String. If the attribute is empty, this method throws
an exception.
@param reader
<code>XMLStreamReader</code> that contains att... | java | public static String requiredStringAttribute(final XMLStreamReader reader, final String localName)
throws XMLStreamException {
return requiredStringAttribute(reader, null, localName);
} | [
"public",
"static",
"String",
"requiredStringAttribute",
"(",
"final",
"XMLStreamReader",
"reader",
",",
"final",
"String",
"localName",
")",
"throws",
"XMLStreamException",
"{",
"return",
"requiredStringAttribute",
"(",
"reader",
",",
"null",
",",
"localName",
")",
... | Returns the value of an attribute as a String. If the attribute is empty, this method throws
an exception.
@param reader
<code>XMLStreamReader</code> that contains attribute values.
@param localName
local name of attribute (the namespace is ignored).
@return value of attribute as String
@throws XMLStreamException
if a... | [
"Returns",
"the",
"value",
"of",
"an",
"attribute",
"as",
"a",
"String",
".",
"If",
"the",
"attribute",
"is",
"empty",
"this",
"method",
"throws",
"an",
"exception",
"."
] | train | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L1346-L1349 |
padrig64/ValidationFramework | validationframework-core/src/main/java/com/google/code/validationframework/base/validator/DefaultMappableValidator.java | DefaultMappableValidator.processRule | private void processRule(final Rule<RI, RO> rule, final RI data) {
"""
Processes the specified rule by finding all the mapped results handlers, checking the rule and processing the
rule
result using all found result handlers.
@param rule Rule to be processed.
@param data Data to be checked against the rule.
... | java | private void processRule(final Rule<RI, RO> rule, final RI data) {
// Get result handlers matching the rule
final List<ResultHandler<RO>> mappedResultHandlers = rulesToResultHandlers.get(rule);
if ((mappedResultHandlers == null) || mappedResultHandlers.isEmpty()) {
LOGGER.warn("No ma... | [
"private",
"void",
"processRule",
"(",
"final",
"Rule",
"<",
"RI",
",",
"RO",
">",
"rule",
",",
"final",
"RI",
"data",
")",
"{",
"// Get result handlers matching the rule",
"final",
"List",
"<",
"ResultHandler",
"<",
"RO",
">",
">",
"mappedResultHandlers",
"="... | Processes the specified rule by finding all the mapped results handlers, checking the rule and processing the
rule
result using all found result handlers.
@param rule Rule to be processed.
@param data Data to be checked against the rule. | [
"Processes",
"the",
"specified",
"rule",
"by",
"finding",
"all",
"the",
"mapped",
"results",
"handlers",
"checking",
"the",
"rule",
"and",
"processing",
"the",
"rule",
"result",
"using",
"all",
"found",
"result",
"handlers",
"."
] | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/validator/DefaultMappableValidator.java#L110-L124 |
jtmelton/appsensor | execution-modes/appsensor-ws-rest-server/src/main/java/org/owasp/appsensor/rest/AccessControlUtils.java | AccessControlUtils.checkAuthorization | public void checkAuthorization(Action action, ContainerRequestContext requestContext) throws NotAuthorizedException {
"""
Check authz before performing action.
@param action desired action
@throws NotAuthorizedException thrown if user does not have role.
"""
String clientApplicationName = (String)request... | java | public void checkAuthorization(Action action, ContainerRequestContext requestContext) throws NotAuthorizedException {
String clientApplicationName = (String)requestContext.getProperty(RequestHandler.APPSENSOR_CLIENT_APPLICATION_IDENTIFIER_ATTR);
ClientApplication clientApplication = appSensorServer.getConfiguratio... | [
"public",
"void",
"checkAuthorization",
"(",
"Action",
"action",
",",
"ContainerRequestContext",
"requestContext",
")",
"throws",
"NotAuthorizedException",
"{",
"String",
"clientApplicationName",
"=",
"(",
"String",
")",
"requestContext",
".",
"getProperty",
"(",
"Reque... | Check authz before performing action.
@param action desired action
@throws NotAuthorizedException thrown if user does not have role. | [
"Check",
"authz",
"before",
"performing",
"action",
"."
] | train | https://github.com/jtmelton/appsensor/blob/c3b4e9ada50fdee974e0d618ec4bdfabc2163798/execution-modes/appsensor-ws-rest-server/src/main/java/org/owasp/appsensor/rest/AccessControlUtils.java#L32-L38 |
duracloud/duracloud | durastore/src/main/java/org/duracloud/durastore/rest/SpaceRest.java | SpaceRest.getSpaceACLs | @Path("/acl/ {
"""
see SpaceResource.getSpaceACLs(String, String);
@return 200 response with space ACLs included as header values
"""spaceID}")
@HEAD
public Response getSpaceACLs(@PathParam("spaceID") String spaceID,
@QueryParam("storeID") String storeID) {
S... | java | @Path("/acl/{spaceID}")
@HEAD
public Response getSpaceACLs(@PathParam("spaceID") String spaceID,
@QueryParam("storeID") String storeID) {
String msg = "getting space ACLs(" + spaceID + ", " + storeID + ")";
try {
log.debug(msg);
return ad... | [
"@",
"Path",
"(",
"\"/acl/{spaceID}\"",
")",
"@",
"HEAD",
"public",
"Response",
"getSpaceACLs",
"(",
"@",
"PathParam",
"(",
"\"spaceID\"",
")",
"String",
"spaceID",
",",
"@",
"QueryParam",
"(",
"\"storeID\"",
")",
"String",
"storeID",
")",
"{",
"String",
"ms... | see SpaceResource.getSpaceACLs(String, String);
@return 200 response with space ACLs included as header values | [
"see",
"SpaceResource",
".",
"getSpaceACLs",
"(",
"String",
"String",
")",
";"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/durastore/src/main/java/org/duracloud/durastore/rest/SpaceRest.java#L194-L213 |
Metatavu/edelphi | rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java | AbstractApi.streamResponse | protected Response streamResponse(String type, InputStream inputStream, int contentLength) {
"""
Creates streamed response from input stream
@param inputStream data
@param type content type
@param contentLength content length
@return Response
"""
return Response.ok(new StreamingOutputImpl(inputStream... | java | protected Response streamResponse(String type, InputStream inputStream, int contentLength) {
return Response.ok(new StreamingOutputImpl(inputStream), type)
.header("Content-Length", contentLength)
.build();
} | [
"protected",
"Response",
"streamResponse",
"(",
"String",
"type",
",",
"InputStream",
"inputStream",
",",
"int",
"contentLength",
")",
"{",
"return",
"Response",
".",
"ok",
"(",
"new",
"StreamingOutputImpl",
"(",
"inputStream",
")",
",",
"type",
")",
".",
"hea... | Creates streamed response from input stream
@param inputStream data
@param type content type
@param contentLength content length
@return Response | [
"Creates",
"streamed",
"response",
"from",
"input",
"stream"
] | train | https://github.com/Metatavu/edelphi/blob/d91a0b54f954b33b4ee674a1bdf03612d76c3305/rest/src/main/java/fi/metatavu/edelphi/rest/AbstractApi.java#L177-L181 |
mozilla/rhino | src/org/mozilla/javascript/ScriptRuntime.java | ScriptRuntime.getPropFunctionAndThis | public static Callable getPropFunctionAndThis(Object obj,
String property,
Context cx, Scriptable scope) {
"""
Prepare for calling obj.property(...): return function corresponding to
obj.property and make obj prope... | java | public static Callable getPropFunctionAndThis(Object obj,
String property,
Context cx, Scriptable scope)
{
Scriptable thisObj = toObjectOrNull(cx, obj, scope);
return getPropFunctionAndThisHelper(obj,... | [
"public",
"static",
"Callable",
"getPropFunctionAndThis",
"(",
"Object",
"obj",
",",
"String",
"property",
",",
"Context",
"cx",
",",
"Scriptable",
"scope",
")",
"{",
"Scriptable",
"thisObj",
"=",
"toObjectOrNull",
"(",
"cx",
",",
"obj",
",",
"scope",
")",
"... | Prepare for calling obj.property(...): return function corresponding to
obj.property and make obj properly converted to Scriptable available
as ScriptRuntime.lastStoredScriptable() for consumption as thisObj.
The caller must call ScriptRuntime.lastStoredScriptable() immediately
after calling this method. | [
"Prepare",
"for",
"calling",
"obj",
".",
"property",
"(",
"...",
")",
":",
"return",
"function",
"corresponding",
"to",
"obj",
".",
"property",
"and",
"make",
"obj",
"properly",
"converted",
"to",
"Scriptable",
"available",
"as",
"ScriptRuntime",
".",
"lastSto... | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/src/org/mozilla/javascript/ScriptRuntime.java#L2557-L2563 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuGraphAddDependencies | public static int cuGraphAddDependencies(CUgraph hGraph, CUgraphNode from[], CUgraphNode to[], long numDependencies) {
"""
Adds dependency edges to a graph.<br>
<br>
The number of dependencies to be added is defined by \p numDependencies
Elements in \p from and \p to at corresponding indices define a dependency... | java | public static int cuGraphAddDependencies(CUgraph hGraph, CUgraphNode from[], CUgraphNode to[], long numDependencies)
{
return checkResult(cuGraphAddDependenciesNative(hGraph, from, to, numDependencies));
} | [
"public",
"static",
"int",
"cuGraphAddDependencies",
"(",
"CUgraph",
"hGraph",
",",
"CUgraphNode",
"from",
"[",
"]",
",",
"CUgraphNode",
"to",
"[",
"]",
",",
"long",
"numDependencies",
")",
"{",
"return",
"checkResult",
"(",
"cuGraphAddDependenciesNative",
"(",
... | Adds dependency edges to a graph.<br>
<br>
The number of dependencies to be added is defined by \p numDependencies
Elements in \p from and \p to at corresponding indices define a dependency.
Each node in \p from and \p to must belong to \p hGraph.<br>
<br>
If \p numDependencies is 0, elements in \p from and \p to will ... | [
"Adds",
"dependency",
"edges",
"to",
"a",
"graph",
".",
"<br",
">",
"<br",
">",
"The",
"number",
"of",
"dependencies",
"to",
"be",
"added",
"is",
"defined",
"by",
"\\",
"p",
"numDependencies",
"Elements",
"in",
"\\",
"p",
"from",
"and",
"\\",
"p",
"to"... | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L12848-L12851 |
fracpete/multisearch-weka-package | src/main/java/weka/classifiers/meta/multisearch/Performance.java | Performance.setPerformance | public void setPerformance(int evaluation, double value) {
"""
returns the performance measure.
@param evaluation the type of evaluation to return
@param value the performance measure
"""
if ((m_Metrics != null) && !m_Metrics.check(evaluation))
return;
m_MetricValues.put(evaluation, value);
... | java | public void setPerformance(int evaluation, double value) {
if ((m_Metrics != null) && !m_Metrics.check(evaluation))
return;
m_MetricValues.put(evaluation, value);
} | [
"public",
"void",
"setPerformance",
"(",
"int",
"evaluation",
",",
"double",
"value",
")",
"{",
"if",
"(",
"(",
"m_Metrics",
"!=",
"null",
")",
"&&",
"!",
"m_Metrics",
".",
"check",
"(",
"evaluation",
")",
")",
"return",
";",
"m_MetricValues",
".",
"put"... | returns the performance measure.
@param evaluation the type of evaluation to return
@param value the performance measure | [
"returns",
"the",
"performance",
"measure",
"."
] | train | https://github.com/fracpete/multisearch-weka-package/blob/756fcf343e7cc9fd3844c99a0e1e828368f393d0/src/main/java/weka/classifiers/meta/multisearch/Performance.java#L148-L152 |
ehcache/ehcache3 | core/src/main/java/org/ehcache/core/EhcacheManager.java | EhcacheManager.closeEhcache | protected void closeEhcache(final String alias, final InternalCache<?, ?> ehcache) {
"""
Perform cache closure actions specific to a cache manager implementation.
This method is called <i>after</i> the {@code InternalCache} instance is closed.
@param alias the cache alias
@param ehcache the {@code InternalCac... | java | protected void closeEhcache(final String alias, final InternalCache<?, ?> ehcache) {
for (ResourceType<?> resourceType : ehcache.getRuntimeConfiguration().getResourcePools().getResourceTypeSet()) {
if (resourceType.isPersistable()) {
ResourcePool resourcePool = ehcache.getRuntimeConfiguration()
... | [
"protected",
"void",
"closeEhcache",
"(",
"final",
"String",
"alias",
",",
"final",
"InternalCache",
"<",
"?",
",",
"?",
">",
"ehcache",
")",
"{",
"for",
"(",
"ResourceType",
"<",
"?",
">",
"resourceType",
":",
"ehcache",
".",
"getRuntimeConfiguration",
"(",... | Perform cache closure actions specific to a cache manager implementation.
This method is called <i>after</i> the {@code InternalCache} instance is closed.
@param alias the cache alias
@param ehcache the {@code InternalCache} instance for the cache to close | [
"Perform",
"cache",
"closure",
"actions",
"specific",
"to",
"a",
"cache",
"manager",
"implementation",
".",
"This",
"method",
"is",
"called",
"<i",
">",
"after<",
"/",
"i",
">",
"the",
"{",
"@code",
"InternalCache",
"}",
"instance",
"is",
"closed",
"."
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/core/src/main/java/org/ehcache/core/EhcacheManager.java#L229-L245 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.getFragmentInHours | @GwtIncompatible("incompatible method")
public static long getFragmentInHours(final Date date, final int fragment) {
"""
<p>Returns the number of hours within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the hours of any date will only return the number of hours
of... | java | @GwtIncompatible("incompatible method")
public static long getFragmentInHours(final Date date, final int fragment) {
return getFragment(date, fragment, TimeUnit.HOURS);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"long",
"getFragmentInHours",
"(",
"final",
"Date",
"date",
",",
"final",
"int",
"fragment",
")",
"{",
"return",
"getFragment",
"(",
"date",
",",
"fragment",
",",
"TimeUnit",
".",
... | <p>Returns the number of hours within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the hours of any date will only return the number of hours
of the current day (resulting in a number between 0 and 23). This
method will retrieve the number of hours for any fragment.
For example... | [
"<p",
">",
"Returns",
"the",
"number",
"of",
"hours",
"within",
"the",
"fragment",
".",
"All",
"datefields",
"greater",
"than",
"the",
"fragment",
"will",
"be",
"ignored",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1413-L1416 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/util/SchedulerUtils.java | SchedulerUtils.loadGenericJobConfigs | public static List<Properties> loadGenericJobConfigs(Properties sysProps)
throws ConfigurationException, IOException {
"""
Load job configuration from job configuration files stored in general file system,
located by Path
@param sysProps Gobblin framework configuration properties
@return a list of job con... | java | public static List<Properties> loadGenericJobConfigs(Properties sysProps)
throws ConfigurationException, IOException {
Path rootPath = new Path(sysProps.getProperty(ConfigurationKeys.JOB_CONFIG_FILE_GENERAL_PATH_KEY));
PullFileLoader loader = new PullFileLoader(rootPath, rootPath.getFileSystem(new Configu... | [
"public",
"static",
"List",
"<",
"Properties",
">",
"loadGenericJobConfigs",
"(",
"Properties",
"sysProps",
")",
"throws",
"ConfigurationException",
",",
"IOException",
"{",
"Path",
"rootPath",
"=",
"new",
"Path",
"(",
"sysProps",
".",
"getProperty",
"(",
"Configu... | Load job configuration from job configuration files stored in general file system,
located by Path
@param sysProps Gobblin framework configuration properties
@return a list of job configurations in the form of {@link java.util.Properties} | [
"Load",
"job",
"configuration",
"from",
"job",
"configuration",
"files",
"stored",
"in",
"general",
"file",
"system",
"located",
"by",
"Path"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/util/SchedulerUtils.java#L68-L88 |
GoogleCloudPlatform/appengine-pipelines | java/src/main/java/com/google/appengine/tools/pipeline/impl/tasks/Task.java | Task.fromProperties | public static Task fromProperties(String taskName, Properties properties) {
"""
Construct a task from {@code Properties}. This method is used on the
receiving side. That is, it is used to construct a {@code Task} from an
HttpRequest sent from the App Engine task queue. {@code properties} must
contain a property... | java | public static Task fromProperties(String taskName, Properties properties) {
String taskTypeString = properties.getProperty(TASK_TYPE_PARAMETER);
if (null == taskTypeString) {
throw new IllegalArgumentException(TASK_TYPE_PARAMETER + " property is missing: "
+ properties.toString());
}
Typ... | [
"public",
"static",
"Task",
"fromProperties",
"(",
"String",
"taskName",
",",
"Properties",
"properties",
")",
"{",
"String",
"taskTypeString",
"=",
"properties",
".",
"getProperty",
"(",
"TASK_TYPE_PARAMETER",
")",
";",
"if",
"(",
"null",
"==",
"taskTypeString",
... | Construct a task from {@code Properties}. This method is used on the
receiving side. That is, it is used to construct a {@code Task} from an
HttpRequest sent from the App Engine task queue. {@code properties} must
contain a property named {@link #TASK_TYPE_PARAMETER}. In addition it must
contain the properties specifie... | [
"Construct",
"a",
"task",
"from",
"{"
] | train | https://github.com/GoogleCloudPlatform/appengine-pipelines/blob/277394648dac3e8214677af898935d07399ac8e1/java/src/main/java/com/google/appengine/tools/pipeline/impl/tasks/Task.java#L204-L212 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/STGD.java | STGD.setLearningRate | public void setLearningRate(double learningRate) {
"""
Sets the learning rate to use
@param learningRate the learning rate > 0.
"""
if(Double.isInfinite(learningRate) || Double.isNaN(learningRate) || learningRate <= 0)
throw new IllegalArgumentException("Learning rate must be positive, ... | java | public void setLearningRate(double learningRate)
{
if(Double.isInfinite(learningRate) || Double.isNaN(learningRate) || learningRate <= 0)
throw new IllegalArgumentException("Learning rate must be positive, not " + learningRate);
this.learningRate = learningRate;
} | [
"public",
"void",
"setLearningRate",
"(",
"double",
"learningRate",
")",
"{",
"if",
"(",
"Double",
".",
"isInfinite",
"(",
"learningRate",
")",
"||",
"Double",
".",
"isNaN",
"(",
"learningRate",
")",
"||",
"learningRate",
"<=",
"0",
")",
"throw",
"new",
"I... | Sets the learning rate to use
@param learningRate the learning rate > 0. | [
"Sets",
"the",
"learning",
"rate",
"to",
"use"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/STGD.java#L108-L113 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/html/HAppletHtmlScreen.java | HAppletHtmlScreen.printReport | public void printReport(PrintWriter out, ResourceBundle reg)
throws DBException {
"""
Output this screen using HTML.
Display the html headers, etc. then:
<ol>
- Parse any parameters passed in and set the field values.
- Process any command (such as move=Next).
- Render this screen as Html (by calling ... | java | public void printReport(PrintWriter out, ResourceBundle reg)
throws DBException
{
if (reg == null)
reg = ((BaseApplication)this.getTask().getApplication()).getResources("HtmlApplet", false);
super.printReport(out, reg);
} | [
"public",
"void",
"printReport",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"if",
"(",
"reg",
"==",
"null",
")",
"reg",
"=",
"(",
"(",
"BaseApplication",
")",
"this",
".",
"getTask",
"(",
")",
".",
"getApp... | Output this screen using HTML.
Display the html headers, etc. then:
<ol>
- Parse any parameters passed in and set the field values.
- Process any command (such as move=Next).
- Render this screen as Html (by calling printHtmlScreen()).
</ol>
@param out The html out stream.
@exception DBException File exception. | [
"Output",
"this",
"screen",
"using",
"HTML",
".",
"Display",
"the",
"html",
"headers",
"etc",
".",
"then",
":",
"<ol",
">",
"-",
"Parse",
"any",
"parameters",
"passed",
"in",
"and",
"set",
"the",
"field",
"values",
".",
"-",
"Process",
"any",
"command",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/html/HAppletHtmlScreen.java#L78-L84 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F64_2D.java | GeneralPurposeFFT_F64_2D.realInverse | public void realInverse(double[] a, boolean scale) {
"""
Computes 2D inverse DFT of real data leaving the result in <code>a</code>
. This method only works when the sizes of both dimensions are
power-of-two numbers. The physical layout of the input data has to be as
follows:
<pre>
a[k1*columns+2*k2] = Re[k1... | java | public void realInverse(double[] a, boolean scale) {
// handle special case
if( rows == 1 || columns == 1 ) {
if( rows > 1 )
fftRows.realInverse(a, scale);
else
fftColumns.realInverse(a, scale);
return;
}
if (isPowerOfTwo == false) {
throw new IllegalArgumentException("rows and columns must... | [
"public",
"void",
"realInverse",
"(",
"double",
"[",
"]",
"a",
",",
"boolean",
"scale",
")",
"{",
"// handle special case",
"if",
"(",
"rows",
"==",
"1",
"||",
"columns",
"==",
"1",
")",
"{",
"if",
"(",
"rows",
">",
"1",
")",
"fftRows",
".",
"realInv... | Computes 2D inverse DFT of real data leaving the result in <code>a</code>
. This method only works when the sizes of both dimensions are
power-of-two numbers. The physical layout of the input data has to be as
follows:
<pre>
a[k1*columns+2*k2] = Re[k1][k2] = Re[rows-k1][columns-k2],
a[k1*columns+2*k2+1] = Im[k1][k2] =... | [
"Computes",
"2D",
"inverse",
"DFT",
"of",
"real",
"data",
"leaving",
"the",
"result",
"in",
"<code",
">",
"a<",
"/",
"code",
">",
".",
"This",
"method",
"only",
"works",
"when",
"the",
"sizes",
"of",
"both",
"dimensions",
"are",
"power",
"-",
"of",
"-"... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/transform/fft/GeneralPurposeFFT_F64_2D.java#L342-L361 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java | AbstractCasView.prepareViewModelWithAuthenticationPrincipal | protected Map prepareViewModelWithAuthenticationPrincipal(final Map<String, Object> model) {
"""
Prepare view model with authentication principal.
@param model the model
@return the map
"""
putIntoModel(model, CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL, getPrincipal(model));
putIntoMod... | java | protected Map prepareViewModelWithAuthenticationPrincipal(final Map<String, Object> model) {
putIntoModel(model, CasViewConstants.MODEL_ATTRIBUTE_NAME_PRINCIPAL, getPrincipal(model));
putIntoModel(model, CasViewConstants.MODEL_ATTRIBUTE_NAME_CHAINED_AUTHENTICATIONS, getChainedAuthentications(model));
... | [
"protected",
"Map",
"prepareViewModelWithAuthenticationPrincipal",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"model",
")",
"{",
"putIntoModel",
"(",
"model",
",",
"CasViewConstants",
".",
"MODEL_ATTRIBUTE_NAME_PRINCIPAL",
",",
"getPrincipal",
"(",
"model... | Prepare view model with authentication principal.
@param model the model
@return the map | [
"Prepare",
"view",
"model",
"with",
"authentication",
"principal",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/services/web/view/AbstractCasView.java#L219-L225 |
stripe/stripe-java | src/main/java/com/stripe/model/Account.java | Account.persons | public PersonCollection persons() throws StripeException {
"""
Returns a list of people associated with the account’s legal entity. The people are returned
sorted by creation date, with the most recent people appearing first.
"""
return persons((Map<String, Object>) null, (RequestOptions) null);
} | java | public PersonCollection persons() throws StripeException {
return persons((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"PersonCollection",
"persons",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"persons",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Returns a list of people associated with the account’s legal entity. The people are returned
sorted by creation date, with the most recent people appearing first. | [
"Returns",
"a",
"list",
"of",
"people",
"associated",
"with",
"the",
"account’s",
"legal",
"entity",
".",
"The",
"people",
"are",
"returned",
"sorted",
"by",
"creation",
"date",
"with",
"the",
"most",
"recent",
"people",
"appearing",
"first",
"."
] | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Account.java#L451-L453 |
VoltDB/voltdb | src/frontend/org/voltdb/AbstractTopology.java | AbstractTopology.getTopology | public static AbstractTopology getTopology(Map<Integer, HostInfo> hostInfos, Set<Integer> missingHosts,
int kfactor) {
"""
Create a new topology using {@code hosts}
@param hostInfos hosts to put in topology
@param missingHosts set of missing host IDs
@param kfactor for cluster
@return {@l... | java | public static AbstractTopology getTopology(Map<Integer, HostInfo> hostInfos, Set<Integer> missingHosts,
int kfactor) {
return getTopology(hostInfos, missingHosts, kfactor, false);
} | [
"public",
"static",
"AbstractTopology",
"getTopology",
"(",
"Map",
"<",
"Integer",
",",
"HostInfo",
">",
"hostInfos",
",",
"Set",
"<",
"Integer",
">",
"missingHosts",
",",
"int",
"kfactor",
")",
"{",
"return",
"getTopology",
"(",
"hostInfos",
",",
"missingHost... | Create a new topology using {@code hosts}
@param hostInfos hosts to put in topology
@param missingHosts set of missing host IDs
@param kfactor for cluster
@return {@link AbstractTopology} for cluster
@throws RuntimeException if hosts are not valid for topology | [
"Create",
"a",
"new",
"topology",
"using",
"{",
"@code",
"hosts",
"}"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/AbstractTopology.java#L961-L964 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java | FSEditLogLoader.loadFSEdits | int loadFSEdits(EditLogInputStream edits, long lastAppliedTxId)
throws IOException {
"""
Load an edit log, and apply the changes to the in-memory structure
This is where we apply edits that we've been writing to disk all
along.
"""
long startTime = now();
this.lastAppliedTxId = lastAppliedTxId;
... | java | int loadFSEdits(EditLogInputStream edits, long lastAppliedTxId)
throws IOException {
long startTime = now();
this.lastAppliedTxId = lastAppliedTxId;
int numEdits = loadFSEdits(edits, true);
FSImage.LOG.info("Edits file " + edits.toString()
+ " of size: " + edits.length() + ", # of edits: " +... | [
"int",
"loadFSEdits",
"(",
"EditLogInputStream",
"edits",
",",
"long",
"lastAppliedTxId",
")",
"throws",
"IOException",
"{",
"long",
"startTime",
"=",
"now",
"(",
")",
";",
"this",
".",
"lastAppliedTxId",
"=",
"lastAppliedTxId",
";",
"int",
"numEdits",
"=",
"l... | Load an edit log, and apply the changes to the in-memory structure
This is where we apply edits that we've been writing to disk all
along. | [
"Load",
"an",
"edit",
"log",
"and",
"apply",
"the",
"changes",
"to",
"the",
"in",
"-",
"memory",
"structure",
"This",
"is",
"where",
"we",
"apply",
"edits",
"that",
"we",
"ve",
"been",
"writing",
"to",
"disk",
"all",
"along",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java#L107-L116 |
grpc/grpc-java | netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java | ProtocolNegotiators.httpProxy | public static ProtocolNegotiator httpProxy(final SocketAddress proxyAddress,
final @Nullable String proxyUsername, final @Nullable String proxyPassword,
final ProtocolNegotiator negotiator) {
"""
Returns a {@link ProtocolNegotiator} that does HTTP CONNECT proxy negotiation.
"""
final AsciiStrin... | java | public static ProtocolNegotiator httpProxy(final SocketAddress proxyAddress,
final @Nullable String proxyUsername, final @Nullable String proxyPassword,
final ProtocolNegotiator negotiator) {
final AsciiString scheme = negotiator.scheme();
Preconditions.checkNotNull(proxyAddress, "proxyAddress");
... | [
"public",
"static",
"ProtocolNegotiator",
"httpProxy",
"(",
"final",
"SocketAddress",
"proxyAddress",
",",
"final",
"@",
"Nullable",
"String",
"proxyUsername",
",",
"final",
"@",
"Nullable",
"String",
"proxyPassword",
",",
"final",
"ProtocolNegotiator",
"negotiator",
... | Returns a {@link ProtocolNegotiator} that does HTTP CONNECT proxy negotiation. | [
"Returns",
"a",
"{"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/netty/src/main/java/io/grpc/netty/ProtocolNegotiators.java#L204-L237 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/operations/ValueURLIOHelper.java | ValueURLIOHelper.getContent | public static InputStream getContent(ValueStoragePlugin plugin, ValueData value, String resourceId, boolean spoolContent)
throws IOException {
"""
Extracts the content of the given {@link ValueData} and links the data to
the {@link URL} in the Value Storage if needed
@param plugin the plug-in that will man... | java | public static InputStream getContent(ValueStoragePlugin plugin, ValueData value, String resourceId, boolean spoolContent)
throws IOException
{
if (value.isByteArray())
{
return new ByteArrayInputStream(value.getAsByteArray());
}
else if (value instanceof StreamPersistedValueDat... | [
"public",
"static",
"InputStream",
"getContent",
"(",
"ValueStoragePlugin",
"plugin",
",",
"ValueData",
"value",
",",
"String",
"resourceId",
",",
"boolean",
"spoolContent",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
".",
"isByteArray",
"(",
")",
")"... | Extracts the content of the given {@link ValueData} and links the data to
the {@link URL} in the Value Storage if needed
@param plugin the plug-in that will manage the storage of the provided {@link ValueData}
@param value the value from which we want to extract the content
@param resourceId the internal id of the {@li... | [
"Extracts",
"the",
"content",
"of",
"the",
"given",
"{"
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/storage/value/operations/ValueURLIOHelper.java#L53-L84 |
yidongnan/grpc-spring-boot-starter | grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java | AbstractChannelFactory.configureCompression | protected void configureCompression(final T builder, final String name) {
"""
Configures the compression options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure.
"""
final GrpcChannelProperties properties = getProp... | java | protected void configureCompression(final T builder, final String name) {
final GrpcChannelProperties properties = getPropertiesFor(name);
if (properties.isFullStreamDecompression()) {
builder.enableFullStreamDecompression();
}
} | [
"protected",
"void",
"configureCompression",
"(",
"final",
"T",
"builder",
",",
"final",
"String",
"name",
")",
"{",
"final",
"GrpcChannelProperties",
"properties",
"=",
"getPropertiesFor",
"(",
"name",
")",
";",
"if",
"(",
"properties",
".",
"isFullStreamDecompre... | Configures the compression options that should be used by the channel.
@param builder The channel builder to configure.
@param name The name of the client to configure. | [
"Configures",
"the",
"compression",
"options",
"that",
"should",
"be",
"used",
"by",
"the",
"channel",
"."
] | train | https://github.com/yidongnan/grpc-spring-boot-starter/blob/07f8853cfafc9707584f2371aff012e590217b85/grpc-client-spring-boot-autoconfigure/src/main/java/net/devh/boot/grpc/client/channelfactory/AbstractChannelFactory.java#L244-L249 |
sniffy/sniffy | sniffy-core/src/main/java/io/sniffy/LegacySpy.java | LegacySpy.verifyAtLeast | @Deprecated
public C verifyAtLeast(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
"""
Alias for {@link #verifyBetween(int, int, Threads, Query)} with arguments {@code allowedStatements}, {@link Integer#MAX_VALUE}, {@code threads}, {@link Query#ANY}
@since 2.0
"""
... | java | @Deprecated
public C verifyAtLeast(int allowedStatements, Threads threadMatcher) throws WrongNumberOfQueriesError {
return verify(SqlQueries.minQueries(allowedStatements).threads(threadMatcher));
} | [
"@",
"Deprecated",
"public",
"C",
"verifyAtLeast",
"(",
"int",
"allowedStatements",
",",
"Threads",
"threadMatcher",
")",
"throws",
"WrongNumberOfQueriesError",
"{",
"return",
"verify",
"(",
"SqlQueries",
".",
"minQueries",
"(",
"allowedStatements",
")",
".",
"threa... | Alias for {@link #verifyBetween(int, int, Threads, Query)} with arguments {@code allowedStatements}, {@link Integer#MAX_VALUE}, {@code threads}, {@link Query#ANY}
@since 2.0 | [
"Alias",
"for",
"{"
] | train | https://github.com/sniffy/sniffy/blob/7bdddb9593e6b6e9fe5c7c87519f864acbc3a5c0/sniffy-core/src/main/java/io/sniffy/LegacySpy.java#L548-L551 |
grpc/grpc-java | stub/src/main/java/io/grpc/stub/AbstractStub.java | AbstractStub.withDeadlineAfter | public final S withDeadlineAfter(long duration, TimeUnit unit) {
"""
Returns a new stub with a deadline that is after the given {@code duration} from now.
@since 1.0.0
@see CallOptions#withDeadlineAfter
"""
return build(channel, callOptions.withDeadlineAfter(duration, unit));
} | java | public final S withDeadlineAfter(long duration, TimeUnit unit) {
return build(channel, callOptions.withDeadlineAfter(duration, unit));
} | [
"public",
"final",
"S",
"withDeadlineAfter",
"(",
"long",
"duration",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"build",
"(",
"channel",
",",
"callOptions",
".",
"withDeadlineAfter",
"(",
"duration",
",",
"unit",
")",
")",
";",
"}"
] | Returns a new stub with a deadline that is after the given {@code duration} from now.
@since 1.0.0
@see CallOptions#withDeadlineAfter | [
"Returns",
"a",
"new",
"stub",
"with",
"a",
"deadline",
"that",
"is",
"after",
"the",
"given",
"{",
"@code",
"duration",
"}",
"from",
"now",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/stub/src/main/java/io/grpc/stub/AbstractStub.java#L123-L125 |
astrapi69/mystic-crypt | crypt-data/src/main/java/de/alpharogroup/crypto/key/PublicKeyExtensions.java | PublicKeyExtensions.toHexString | public static String toHexString(final PublicKey publicKey, final boolean lowerCase) {
"""
Transform the given {@link PublicKey} to a hexadecimal {@link String} value.
@param publicKey
the public key
@param lowerCase
the flag if the result shell be transform in lower case. If true the result is
@return the ... | java | public static String toHexString(final PublicKey publicKey, final boolean lowerCase)
{
return HexExtensions.toHexString(publicKey.getEncoded(), lowerCase);
} | [
"public",
"static",
"String",
"toHexString",
"(",
"final",
"PublicKey",
"publicKey",
",",
"final",
"boolean",
"lowerCase",
")",
"{",
"return",
"HexExtensions",
".",
"toHexString",
"(",
"publicKey",
".",
"getEncoded",
"(",
")",
",",
"lowerCase",
")",
";",
"}"
] | Transform the given {@link PublicKey} to a hexadecimal {@link String} value.
@param publicKey
the public key
@param lowerCase
the flag if the result shell be transform in lower case. If true the result is
@return the new hexadecimal {@link String} value. | [
"Transform",
"the",
"given",
"{",
"@link",
"PublicKey",
"}",
"to",
"a",
"hexadecimal",
"{",
"@link",
"String",
"}",
"value",
"."
] | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-data/src/main/java/de/alpharogroup/crypto/key/PublicKeyExtensions.java#L138-L141 |
mjiderhamn/classloader-leak-prevention | classloader-leak-prevention/classloader-leak-prevention-core/src/main/java/se/jiderhamn/classloader/leak/prevention/cleanup/RmiTargetsCleanUp.java | RmiTargetsCleanUp.clearRmiTargetsMap | @SuppressWarnings("WeakerAccess")
protected void clearRmiTargetsMap(ClassLoaderLeakPreventor preventor, Map<?, ?> rmiTargetsMap) {
"""
Iterate RMI Targets Map and remove entries loaded by protected ClassLoader
"""
try {
final Field cclField = preventor.findFieldOfClass("sun.rmi.transport.Target", "... | java | @SuppressWarnings("WeakerAccess")
protected void clearRmiTargetsMap(ClassLoaderLeakPreventor preventor, Map<?, ?> rmiTargetsMap) {
try {
final Field cclField = preventor.findFieldOfClass("sun.rmi.transport.Target", "ccl");
preventor.debug("Looping " + rmiTargetsMap.size() + " RMI Targets to find leaks... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"protected",
"void",
"clearRmiTargetsMap",
"(",
"ClassLoaderLeakPreventor",
"preventor",
",",
"Map",
"<",
"?",
",",
"?",
">",
"rmiTargetsMap",
")",
"{",
"try",
"{",
"final",
"Field",
"cclField",
"=",
"preven... | Iterate RMI Targets Map and remove entries loaded by protected ClassLoader | [
"Iterate",
"RMI",
"Targets",
"Map",
"and",
"remove",
"entries",
"loaded",
"by",
"protected",
"ClassLoader"
] | train | https://github.com/mjiderhamn/classloader-leak-prevention/blob/eea8e3cef64f8096dbbb87552df0a1bd272bcb63/classloader-leak-prevention/classloader-leak-prevention-core/src/main/java/se/jiderhamn/classloader/leak/prevention/cleanup/RmiTargetsCleanUp.java#L30-L47 |
finnyb/javampd | src/main/java/org/bff/javampd/player/MPDPlayer.java | MPDPlayer.firePlayerChangeEvent | protected synchronized void firePlayerChangeEvent(PlayerChangeEvent.Event event) {
"""
Sends the appropriate {@link PlayerChangeEvent} to all registered
{@link PlayerChangeListener}s.
@param event the {@link PlayerChangeEvent.Event} to send
"""
PlayerChangeEvent pce = new PlayerChangeEvent(this, ev... | java | protected synchronized void firePlayerChangeEvent(PlayerChangeEvent.Event event) {
PlayerChangeEvent pce = new PlayerChangeEvent(this, event);
for (PlayerChangeListener pcl : listeners) {
pcl.playerChanged(pce);
}
} | [
"protected",
"synchronized",
"void",
"firePlayerChangeEvent",
"(",
"PlayerChangeEvent",
".",
"Event",
"event",
")",
"{",
"PlayerChangeEvent",
"pce",
"=",
"new",
"PlayerChangeEvent",
"(",
"this",
",",
"event",
")",
";",
"for",
"(",
"PlayerChangeListener",
"pcl",
":... | Sends the appropriate {@link PlayerChangeEvent} to all registered
{@link PlayerChangeListener}s.
@param event the {@link PlayerChangeEvent.Event} to send | [
"Sends",
"the",
"appropriate",
"{",
"@link",
"PlayerChangeEvent",
"}",
"to",
"all",
"registered",
"{",
"@link",
"PlayerChangeListener",
"}",
"s",
"."
] | train | https://github.com/finnyb/javampd/blob/186736e85fc238b4208cc9ee23373f9249376b4c/src/main/java/org/bff/javampd/player/MPDPlayer.java#L76-L82 |
structr/structr | structr-core/src/main/java/org/structr/schema/action/Function.java | Function.logException | protected void logException (final Throwable t, final String msg, final Object[] messageParams) {
"""
Logging of an Exception in a function with custom message and message parameters.
@param t The thrown Exception
@param msg The message to be printed
@param messageParams The parameters for the message
"""... | java | protected void logException (final Throwable t, final String msg, final Object[] messageParams) {
logger.error(msg, messageParams, t);
} | [
"protected",
"void",
"logException",
"(",
"final",
"Throwable",
"t",
",",
"final",
"String",
"msg",
",",
"final",
"Object",
"[",
"]",
"messageParams",
")",
"{",
"logger",
".",
"error",
"(",
"msg",
",",
"messageParams",
",",
"t",
")",
";",
"}"
] | Logging of an Exception in a function with custom message and message parameters.
@param t The thrown Exception
@param msg The message to be printed
@param messageParams The parameters for the message | [
"Logging",
"of",
"an",
"Exception",
"in",
"a",
"function",
"with",
"custom",
"message",
"and",
"message",
"parameters",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/schema/action/Function.java#L109-L111 |
javagl/Common | src/main/java/de/javagl/common/collections/Maps.java | Maps.incrementCount | public static <K> void incrementCount(Map<K, Integer> map, K k) {
"""
Increments the value that is stored for the given key in the given
map by one, or sets it to 1 if there was no value stored for the
given key.
@param <K> The key type
@param map The map
@param k The key
"""
map.put(k, getCoun... | java | public static <K> void incrementCount(Map<K, Integer> map, K k)
{
map.put(k, getCount(map, k)+1);
} | [
"public",
"static",
"<",
"K",
">",
"void",
"incrementCount",
"(",
"Map",
"<",
"K",
",",
"Integer",
">",
"map",
",",
"K",
"k",
")",
"{",
"map",
".",
"put",
"(",
"k",
",",
"getCount",
"(",
"map",
",",
"k",
")",
"+",
"1",
")",
";",
"}"
] | Increments the value that is stored for the given key in the given
map by one, or sets it to 1 if there was no value stored for the
given key.
@param <K> The key type
@param map The map
@param k The key | [
"Increments",
"the",
"value",
"that",
"is",
"stored",
"for",
"the",
"given",
"key",
"in",
"the",
"given",
"map",
"by",
"one",
"or",
"sets",
"it",
"to",
"1",
"if",
"there",
"was",
"no",
"value",
"stored",
"for",
"the",
"given",
"key",
"."
] | train | https://github.com/javagl/Common/blob/5a4876b48c3a2dc61d21324733cf37512d721c33/src/main/java/de/javagl/common/collections/Maps.java#L52-L55 |
cdk/cdk | base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java | AtomTypeAwareSaturationChecker.decideBondOrder | private void decideBondOrder(IAtomContainer atomContainer, int start) throws CDKException {
"""
This method decides the bond order on bonds that has the
<code>SINGLE_OR_DOUBLE</code>-flag raised.
@param atomContainer The molecule to investigate
@param start The bond to start with
@throws CDKException
"""... | java | private void decideBondOrder(IAtomContainer atomContainer, int start) throws CDKException {
for (int i = 0; i < atomContainer.getBondCount(); i++)
if (atomContainer.getBond(i).getFlag(CDKConstants.SINGLE_OR_DOUBLE))
atomContainer.getBond(i).setOrder(IBond.Order.SINGLE);
for ... | [
"private",
"void",
"decideBondOrder",
"(",
"IAtomContainer",
"atomContainer",
",",
"int",
"start",
")",
"throws",
"CDKException",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"atomContainer",
".",
"getBondCount",
"(",
")",
";",
"i",
"++",
")",
"... | This method decides the bond order on bonds that has the
<code>SINGLE_OR_DOUBLE</code>-flag raised.
@param atomContainer The molecule to investigate
@param start The bond to start with
@throws CDKException | [
"This",
"method",
"decides",
"the",
"bond",
"order",
"on",
"bonds",
"that",
"has",
"the",
"<code",
">",
"SINGLE_OR_DOUBLE<",
"/",
"code",
">",
"-",
"flag",
"raised",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/valencycheck/src/main/java/org/openscience/cdk/tools/AtomTypeAwareSaturationChecker.java#L138-L155 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java | ExceptionUtils.printRootCauseStackTrace | @GwtIncompatible("incompatible method")
public static void printRootCauseStackTrace(final Throwable throwable, final PrintWriter writer) {
"""
<p>Prints a compact stack trace for the root cause of a throwable.</p>
<p>The compact stack trace starts with the root cause and prints
stack frames up to the place... | java | @GwtIncompatible("incompatible method")
public static void printRootCauseStackTrace(final Throwable throwable, final PrintWriter writer) {
if (throwable == null) {
return;
}
Validate.isTrue(writer != null, "The PrintWriter must not be null");
final String trace[] = getRoo... | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"void",
"printRootCauseStackTrace",
"(",
"final",
"Throwable",
"throwable",
",",
"final",
"PrintWriter",
"writer",
")",
"{",
"if",
"(",
"throwable",
"==",
"null",
")",
"{",
"return",
... | <p>Prints a compact stack trace for the root cause of a throwable.</p>
<p>The compact stack trace starts with the root cause and prints
stack frames up to the place where it was caught and wrapped.
Then it prints the wrapped exception and continues with stack frames
until the wrapper exception is caught and wrapped ag... | [
"<p",
">",
"Prints",
"a",
"compact",
"stack",
"trace",
"for",
"the",
"root",
"cause",
"of",
"a",
"throwable",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/exception/ExceptionUtils.java#L503-L514 |
auth0/auth0-java | src/main/java/com/auth0/client/mgmt/filter/ClientGrantsFilter.java | ClientGrantsFilter.withPage | public ClientGrantsFilter withPage(int pageNumber, int amountPerPage) {
"""
Filter by page
@param pageNumber the page number to retrieve.
@param amountPerPage the amount of items per page to retrieve.
@return this filter instance
"""
parameters.put("page", pageNumber);
parameters.put("p... | java | public ClientGrantsFilter withPage(int pageNumber, int amountPerPage) {
parameters.put("page", pageNumber);
parameters.put("per_page", amountPerPage);
return this;
} | [
"public",
"ClientGrantsFilter",
"withPage",
"(",
"int",
"pageNumber",
",",
"int",
"amountPerPage",
")",
"{",
"parameters",
".",
"put",
"(",
"\"page\"",
",",
"pageNumber",
")",
";",
"parameters",
".",
"put",
"(",
"\"per_page\"",
",",
"amountPerPage",
")",
";",
... | Filter by page
@param pageNumber the page number to retrieve.
@param amountPerPage the amount of items per page to retrieve.
@return this filter instance | [
"Filter",
"by",
"page"
] | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/mgmt/filter/ClientGrantsFilter.java#L37-L41 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/Criteria.java | Criteria.endsWith | public Criteria endsWith(String s) {
"""
Crates new {@link Predicate} with leading wildcard <br />
<strong>NOTE: </strong>mind your schema and execution times as leading wildcards may not be supported.
<strong>NOTE: </strong>Strings will not be automatically split on whitespace.
@param s
@return
@throws Inv... | java | public Criteria endsWith(String s) {
assertNoBlankInWildcardedQuery(s, true, false);
predicates.add(new Predicate(OperationKey.ENDS_WITH, s));
return this;
} | [
"public",
"Criteria",
"endsWith",
"(",
"String",
"s",
")",
"{",
"assertNoBlankInWildcardedQuery",
"(",
"s",
",",
"true",
",",
"false",
")",
";",
"predicates",
".",
"add",
"(",
"new",
"Predicate",
"(",
"OperationKey",
".",
"ENDS_WITH",
",",
"s",
")",
")",
... | Crates new {@link Predicate} with leading wildcard <br />
<strong>NOTE: </strong>mind your schema and execution times as leading wildcards may not be supported.
<strong>NOTE: </strong>Strings will not be automatically split on whitespace.
@param s
@return
@throws InvalidDataAccessApiUsageException for strings with whi... | [
"Crates",
"new",
"{",
"@link",
"Predicate",
"}",
"with",
"leading",
"wildcard",
"<br",
"/",
">",
"<strong",
">",
"NOTE",
":",
"<",
"/",
"strong",
">",
"mind",
"your",
"schema",
"and",
"execution",
"times",
"as",
"leading",
"wildcards",
"may",
"not",
"be"... | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L263-L267 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java | P2sVpnServerConfigurationsInner.beginCreateOrUpdate | public P2SVpnServerConfigurationInner beginCreateOrUpdate(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) {
"""
Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else upda... | java | public P2SVpnServerConfigurationInner beginCreateOrUpdate(String resourceGroupName, String virtualWanName, String p2SVpnServerConfigurationName, P2SVpnServerConfigurationInner p2SVpnServerConfigurationParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualWanName, p2SVpnServe... | [
"public",
"P2SVpnServerConfigurationInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualWanName",
",",
"String",
"p2SVpnServerConfigurationName",
",",
"P2SVpnServerConfigurationInner",
"p2SVpnServerConfigurationParameters",
")",
"{",
"return",
... | Creates a P2SVpnServerConfiguration to associate with a VirtualWan if it doesn't exist else updates the existing P2SVpnServerConfiguration.
@param resourceGroupName The resource group name of the VirtualWan.
@param virtualWanName The name of the VirtualWan.
@param p2SVpnServerConfigurationName The name of the P2SVpnSe... | [
"Creates",
"a",
"P2SVpnServerConfiguration",
"to",
"associate",
"with",
"a",
"VirtualWan",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"P2SVpnServerConfiguration",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/P2sVpnServerConfigurationsInner.java#L279-L281 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java | JobSchedulesImpl.disableAsync | public Observable<Void> disableAsync(String jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions) {
"""
Disables a job schedule.
No new jobs will be created until the job schedule is enabled again.
@param jobScheduleId The ID of the job schedule to disable.
@param jobScheduleDisableOptions Addit... | java | public Observable<Void> disableAsync(String jobScheduleId, JobScheduleDisableOptions jobScheduleDisableOptions) {
return disableWithServiceResponseAsync(jobScheduleId, jobScheduleDisableOptions).map(new Func1<ServiceResponseWithHeaders<Void, JobScheduleDisableHeaders>, Void>() {
@Override
... | [
"public",
"Observable",
"<",
"Void",
">",
"disableAsync",
"(",
"String",
"jobScheduleId",
",",
"JobScheduleDisableOptions",
"jobScheduleDisableOptions",
")",
"{",
"return",
"disableWithServiceResponseAsync",
"(",
"jobScheduleId",
",",
"jobScheduleDisableOptions",
")",
".",
... | Disables a job schedule.
No new jobs will be created until the job schedule is enabled again.
@param jobScheduleId The ID of the job schedule to disable.
@param jobScheduleDisableOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link... | [
"Disables",
"a",
"job",
"schedule",
".",
"No",
"new",
"jobs",
"will",
"be",
"created",
"until",
"the",
"job",
"schedule",
"is",
"enabled",
"again",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobSchedulesImpl.java#L1450-L1457 |
meltmedia/cadmium | core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java | Jsr250Utils.createJsr250Executor | public static Jsr250Executor createJsr250Executor(Injector injector, final Logger log, Scope... scopes ) {
"""
Creates a Jsr250Executor for the specified scopes.
@param injector
@param log
@param scopes
@return
"""
final Set<Object> instances = findInstancesInScopes(injector, scopes);
final List<... | java | public static Jsr250Executor createJsr250Executor(Injector injector, final Logger log, Scope... scopes ) {
final Set<Object> instances = findInstancesInScopes(injector, scopes);
final List<Object> reverseInstances = new ArrayList<Object>(instances);
Collections.reverse(reverseInstances);
return new Jsr2... | [
"public",
"static",
"Jsr250Executor",
"createJsr250Executor",
"(",
"Injector",
"injector",
",",
"final",
"Logger",
"log",
",",
"Scope",
"...",
"scopes",
")",
"{",
"final",
"Set",
"<",
"Object",
">",
"instances",
"=",
"findInstancesInScopes",
"(",
"injector",
","... | Creates a Jsr250Executor for the specified scopes.
@param injector
@param log
@param scopes
@return | [
"Creates",
"a",
"Jsr250Executor",
"for",
"the",
"specified",
"scopes",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/core/src/main/java/com/meltmedia/cadmium/core/util/Jsr250Utils.java#L237-L263 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.sounds_id_PUT | public void sounds_id_PUT(Long id, OvhSound body) throws IOException {
"""
Alter this object properties
REST: PUT /telephony/sounds/{id}
@param body [required] New object properties
@param id [required] Sound ID
"""
String qPath = "/telephony/sounds/{id}";
StringBuilder sb = path(qPath, id);
exec(qP... | java | public void sounds_id_PUT(Long id, OvhSound body) throws IOException {
String qPath = "/telephony/sounds/{id}";
StringBuilder sb = path(qPath, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"sounds_id_PUT",
"(",
"Long",
"id",
",",
"OvhSound",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/sounds/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"id",
")",
";",
"exec",
"(",
... | Alter this object properties
REST: PUT /telephony/sounds/{id}
@param body [required] New object properties
@param id [required] Sound ID | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8741-L8745 |
Netflix/conductor | grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java | WorkflowClient.deleteWorkflow | public void deleteWorkflow(String workflowId, boolean archiveWorkflow) {
"""
Removes a workflow from the system
@param workflowId the id of the workflow to be deleted
@param archiveWorkflow flag to indicate if the workflow should be archived before deletion
"""
Preconditions.checkArgument(Stri... | java | public void deleteWorkflow(String workflowId, boolean archiveWorkflow) {
Preconditions.checkArgument(StringUtils.isNotBlank(workflowId), "Workflow id cannot be blank");
stub.removeWorkflow(
WorkflowServicePb.RemoveWorkflowRequest.newBuilder()
.setWorkflodId(workfl... | [
"public",
"void",
"deleteWorkflow",
"(",
"String",
"workflowId",
",",
"boolean",
"archiveWorkflow",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"workflowId",
")",
",",
"\"Workflow id cannot be blank\"",
")",
";",
"stu... | Removes a workflow from the system
@param workflowId the id of the workflow to be deleted
@param archiveWorkflow flag to indicate if the workflow should be archived before deletion | [
"Removes",
"a",
"workflow",
"from",
"the",
"system"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/grpc-client/src/main/java/com/netflix/conductor/client/grpc/WorkflowClient.java#L97-L105 |
baratine/baratine | core/src/main/java/com/caucho/v5/util/LruCache.java | LruCache.updateLru | private void updateLru(CacheItem<K,V> item) {
"""
Put item at the head of the used-twice lru list.
This is always called while synchronized.
"""
long lruCounter = _lruCounter;
long itemCounter = item._lruCounter;
long delta = (lruCounter - itemCounter) & 0x3fffffff;
if (_lruTimeout < delta |... | java | private void updateLru(CacheItem<K,V> item)
{
long lruCounter = _lruCounter;
long itemCounter = item._lruCounter;
long delta = (lruCounter - itemCounter) & 0x3fffffff;
if (_lruTimeout < delta || delta < 0) {
// update LRU only if not used recently
updateLruImpl(item);
}
} | [
"private",
"void",
"updateLru",
"(",
"CacheItem",
"<",
"K",
",",
"V",
">",
"item",
")",
"{",
"long",
"lruCounter",
"=",
"_lruCounter",
";",
"long",
"itemCounter",
"=",
"item",
".",
"_lruCounter",
";",
"long",
"delta",
"=",
"(",
"lruCounter",
"-",
"itemCo... | Put item at the head of the used-twice lru list.
This is always called while synchronized. | [
"Put",
"item",
"at",
"the",
"head",
"of",
"the",
"used",
"-",
"twice",
"lru",
"list",
".",
"This",
"is",
"always",
"called",
"while",
"synchronized",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/util/LruCache.java#L413-L424 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java | SourceToHTMLConverter.convertRoot | public static void convertRoot(ConfigurationImpl configuration, DocletEnvironment docEnv,
DocPath outputdir) throws DocFileIOException, SimpleDocletException {
"""
Translate the TypeElements in the given DocletEnvironment to HTML representation.
@param configuration the configuration.
@param docEnv... | java | public static void convertRoot(ConfigurationImpl configuration, DocletEnvironment docEnv,
DocPath outputdir) throws DocFileIOException, SimpleDocletException {
new SourceToHTMLConverter(configuration, docEnv, outputdir).generate();
} | [
"public",
"static",
"void",
"convertRoot",
"(",
"ConfigurationImpl",
"configuration",
",",
"DocletEnvironment",
"docEnv",
",",
"DocPath",
"outputdir",
")",
"throws",
"DocFileIOException",
",",
"SimpleDocletException",
"{",
"new",
"SourceToHTMLConverter",
"(",
"configurati... | Translate the TypeElements in the given DocletEnvironment to HTML representation.
@param configuration the configuration.
@param docEnv the DocletEnvironment to convert.
@param outputdir the name of the directory to output to.
@throws DocFileIOException if there is a problem generating an output file
@throws SimpleDoc... | [
"Translate",
"the",
"TypeElements",
"in",
"the",
"given",
"DocletEnvironment",
"to",
"HTML",
"representation",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SourceToHTMLConverter.java#L109-L112 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/cache/CacheArgumentServices.java | CacheArgumentServices.computeSpecifiedArgPart | String computeSpecifiedArgPart(String[] keys, List<String> jsonArgs, List<String> paramNames) {
"""
Compute the part of cache key that depends of arguments
@param keys : key from annotation
@param jsonArgs : actual args
@param paramNames : parameter name of concern method
@return
"""
StringBuilder sb ... | java | String computeSpecifiedArgPart(String[] keys, List<String> jsonArgs, List<String> paramNames) {
StringBuilder sb = new StringBuilder("[");
boolean first = true;
for (String key : keys) {
if (!first) {
sb.append(",");
}
first = false;
String[] path = key.split("\\.");
logger.debug("Proc... | [
"String",
"computeSpecifiedArgPart",
"(",
"String",
"[",
"]",
"keys",
",",
"List",
"<",
"String",
">",
"jsonArgs",
",",
"List",
"<",
"String",
">",
"paramNames",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
"\"[\"",
")",
";",
"boolean... | Compute the part of cache key that depends of arguments
@param keys : key from annotation
@param jsonArgs : actual args
@param paramNames : parameter name of concern method
@return | [
"Compute",
"the",
"part",
"of",
"cache",
"key",
"that",
"depends",
"of",
"arguments"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/cache/CacheArgumentServices.java#L56-L75 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java | CommerceSubscriptionEntryPersistenceImpl.findByUUID_G | @Override
public CommerceSubscriptionEntry findByUUID_G(String uuid, long groupId)
throws NoSuchSubscriptionEntryException {
"""
Returns the commerce subscription entry where uuid = ? and groupId = ? or throws a {@link NoSuchSubscriptionEntryException} if it could not be found.
@param uuid the uuid
... | java | @Override
public CommerceSubscriptionEntry findByUUID_G(String uuid, long groupId)
throws NoSuchSubscriptionEntryException {
CommerceSubscriptionEntry commerceSubscriptionEntry = fetchByUUID_G(uuid,
groupId);
if (commerceSubscriptionEntry == null) {
StringBundler msg = new StringBundler(6);
msg.appen... | [
"@",
"Override",
"public",
"CommerceSubscriptionEntry",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchSubscriptionEntryException",
"{",
"CommerceSubscriptionEntry",
"commerceSubscriptionEntry",
"=",
"fetchByUUID_G",
"(",
"uuid",
",",
... | Returns the commerce subscription entry where uuid = ? and groupId = ? or throws a {@link NoSuchSubscriptionEntryException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching commerce subscription entry
@throws NoSuchSubscriptionEntryException if a matching commerce... | [
"Returns",
"the",
"commerce",
"subscription",
"entry",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchSubscriptionEntryException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceSubscriptionEntryPersistenceImpl.java#L675-L702 |
microfocus-idol/java-configuration-impl | src/main/java/com/hp/autonomy/frontend/configuration/redis/RedisConfig.java | RedisConfig.basicValidate | @Override
public void basicValidate(final String section) throws ConfigException {
"""
Validates the configuration
@throws ConfigException If either:
<ul>
<li>address is non null and invalid</li>
<li>address is null and sentinels is null or empty </li>
<li>sentinels is non null and non empty and masterN... | java | @Override
public void basicValidate(final String section) throws ConfigException {
super.basicValidate(CONFIG_SECTION);
if (address == null && (sentinels == null || sentinels.isEmpty())) {
throw new ConfigException(CONFIG_SECTION, "Redis configuration requires either an address or at le... | [
"@",
"Override",
"public",
"void",
"basicValidate",
"(",
"final",
"String",
"section",
")",
"throws",
"ConfigException",
"{",
"super",
".",
"basicValidate",
"(",
"CONFIG_SECTION",
")",
";",
"if",
"(",
"address",
"==",
"null",
"&&",
"(",
"sentinels",
"==",
"n... | Validates the configuration
@throws ConfigException If either:
<ul>
<li>address is non null and invalid</li>
<li>address is null and sentinels is null or empty </li>
<li>sentinels is non null and non empty and masterName is null or blank</li>
<li>any sentinels are invalid</li>
</ul> | [
"Validates",
"the",
"configuration"
] | train | https://github.com/microfocus-idol/java-configuration-impl/blob/cd9d744cacfaaae3c76cacc211e65742bbc7b00a/src/main/java/com/hp/autonomy/frontend/configuration/redis/RedisConfig.java#L57-L74 |
jtablesaw/tablesaw | core/src/main/java/tech/tablesaw/table/StandardTableSliceGroup.java | StandardTableSliceGroup.create | public static StandardTableSliceGroup create(Table original, String... columnsNames) {
"""
Returns a viewGroup splitting the original table on the given columns.
The named columns must be CategoricalColumns
"""
List<CategoricalColumn<?>> columns = original.categoricalColumns(columnsNames);
ret... | java | public static StandardTableSliceGroup create(Table original, String... columnsNames) {
List<CategoricalColumn<?>> columns = original.categoricalColumns(columnsNames);
return new StandardTableSliceGroup(original, columns.toArray(new CategoricalColumn<?>[0]));
} | [
"public",
"static",
"StandardTableSliceGroup",
"create",
"(",
"Table",
"original",
",",
"String",
"...",
"columnsNames",
")",
"{",
"List",
"<",
"CategoricalColumn",
"<",
"?",
">",
">",
"columns",
"=",
"original",
".",
"categoricalColumns",
"(",
"columnsNames",
"... | Returns a viewGroup splitting the original table on the given columns.
The named columns must be CategoricalColumns | [
"Returns",
"a",
"viewGroup",
"splitting",
"the",
"original",
"table",
"on",
"the",
"given",
"columns",
".",
"The",
"named",
"columns",
"must",
"be",
"CategoricalColumns"
] | train | https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/StandardTableSliceGroup.java#L50-L53 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/LocaleUtility.java | LocaleUtility.isFallbackOf | public static boolean isFallbackOf(Locale parent, Locale child) {
"""
Compare two locales, and return true if the parent is a
'strict' fallback of the child (parent string is a fallback
of child string).
"""
return isFallbackOf(parent.toString(), child.toString());
} | java | public static boolean isFallbackOf(Locale parent, Locale child) {
return isFallbackOf(parent.toString(), child.toString());
} | [
"public",
"static",
"boolean",
"isFallbackOf",
"(",
"Locale",
"parent",
",",
"Locale",
"child",
")",
"{",
"return",
"isFallbackOf",
"(",
"parent",
".",
"toString",
"(",
")",
",",
"child",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Compare two locales, and return true if the parent is a
'strict' fallback of the child (parent string is a fallback
of child string). | [
"Compare",
"two",
"locales",
"and",
"return",
"true",
"if",
"the",
"parent",
"is",
"a",
"strict",
"fallback",
"of",
"the",
"child",
"(",
"parent",
"string",
"is",
"a",
"fallback",
"of",
"child",
"string",
")",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/LocaleUtility.java#L69-L71 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java | AuditorFactory.getAuditor | public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, AuditorModuleContext context) {
"""
Get an auditor instance for the specified auditor class name,
auditor configuration, and auditor context.
@param className Class name of the auditor class to instantiate
@param config Auditor ... | java | public static IHEAuditor getAuditor(String className, AuditorModuleConfig config, AuditorModuleContext context)
{
Class<? extends IHEAuditor> clazz = AuditorFactory.getAuditorClassForClassName(className);
return getAuditor(clazz, config, context);
} | [
"public",
"static",
"IHEAuditor",
"getAuditor",
"(",
"String",
"className",
",",
"AuditorModuleConfig",
"config",
",",
"AuditorModuleContext",
"context",
")",
"{",
"Class",
"<",
"?",
"extends",
"IHEAuditor",
">",
"clazz",
"=",
"AuditorFactory",
".",
"getAuditorClass... | Get an auditor instance for the specified auditor class name,
auditor configuration, and auditor context.
@param className Class name of the auditor class to instantiate
@param config Auditor configuration to use
@param context Auditor context to use
@return Instance of an IHE Auditor | [
"Get",
"an",
"auditor",
"instance",
"for",
"the",
"specified",
"auditor",
"class",
"name",
"auditor",
"configuration",
"and",
"auditor",
"context",
"."
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/AuditorFactory.java#L106-L110 |
apache/groovy | subprojects/groovy-sql/src/main/java/groovy/sql/GroovyResultSetExtension.java | GroovyResultSetExtension.putAt | public void putAt(int index, Object newValue) throws SQLException {
"""
Supports integer based subscript operators for updating the values of numbered columns
starting at zero. Negative indices are supported, they will count from the last column backwards.
@param index is the number of the column to look at... | java | public void putAt(int index, Object newValue) throws SQLException {
index = normalizeIndex(index);
getResultSet().updateObject(index, newValue);
} | [
"public",
"void",
"putAt",
"(",
"int",
"index",
",",
"Object",
"newValue",
")",
"throws",
"SQLException",
"{",
"index",
"=",
"normalizeIndex",
"(",
"index",
")",
";",
"getResultSet",
"(",
")",
".",
"updateObject",
"(",
"index",
",",
"newValue",
")",
";",
... | Supports integer based subscript operators for updating the values of numbered columns
starting at zero. Negative indices are supported, they will count from the last column backwards.
@param index is the number of the column to look at starting at 1
@param newValue the updated value
@throws java.sql.SQLException i... | [
"Supports",
"integer",
"based",
"subscript",
"operators",
"for",
"updating",
"the",
"values",
"of",
"numbered",
"columns",
"starting",
"at",
"zero",
".",
"Negative",
"indices",
"are",
"supported",
"they",
"will",
"count",
"from",
"the",
"last",
"column",
"backwa... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-sql/src/main/java/groovy/sql/GroovyResultSetExtension.java#L166-L169 |
contentful/contentful-management.java | src/main/java/com/contentful/java/cma/ModuleSpaceMemberships.java | ModuleSpaceMemberships.fetchAll | public CMAArray<CMASpaceMembership> fetchAll(Map<String, String> query) {
"""
Fetch all memberships of the configured space.
@param query define which space memberships to return.
@return the array of memberships.
@throws IllegalArgumentException if spaceId is null.
@throws CMANotWithEnvironmentsExcep... | java | public CMAArray<CMASpaceMembership> fetchAll(Map<String, String> query) {
throwIfEnvironmentIdIsSet();
return fetchAll(spaceId, query);
} | [
"public",
"CMAArray",
"<",
"CMASpaceMembership",
">",
"fetchAll",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"query",
")",
"{",
"throwIfEnvironmentIdIsSet",
"(",
")",
";",
"return",
"fetchAll",
"(",
"spaceId",
",",
"query",
")",
";",
"}"
] | Fetch all memberships of the configured space.
@param query define which space memberships to return.
@return the array of memberships.
@throws IllegalArgumentException if spaceId is null.
@throws CMANotWithEnvironmentsException if environmentId was set using
{@link CMAClient.Builder#setEnvironmentId(String)}.
... | [
"Fetch",
"all",
"memberships",
"of",
"the",
"configured",
"space",
"."
] | train | https://github.com/contentful/contentful-management.java/blob/ca310fb9ea9577fcff0ca57949ab7c2315fa2534/src/main/java/com/contentful/java/cma/ModuleSpaceMemberships.java#L100-L103 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java | CommonOps_DDRM.elementMult | public static void elementMult(DMatrixD1 a , DMatrixD1 b ) {
"""
<p>Performs the an element by element multiplication operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Modified.
@param b The right matrix in the multiplicati... | java | public static void elementMult(DMatrixD1 a , DMatrixD1 b )
{
if( a.numCols != b.numCols || a.numRows != b.numRows ) {
throw new MatrixDimensionException("The 'a' and 'b' matrices do not have compatible dimensions");
}
int length = a.getNumElements();
for( int i = 0; i <... | [
"public",
"static",
"void",
"elementMult",
"(",
"DMatrixD1",
"a",
",",
"DMatrixD1",
"b",
")",
"{",
"if",
"(",
"a",
".",
"numCols",
"!=",
"b",
".",
"numCols",
"||",
"a",
".",
"numRows",
"!=",
"b",
".",
"numRows",
")",
"{",
"throw",
"new",
"MatrixDimen... | <p>Performs the an element by element multiplication operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> * b<sub>ij</sub> <br>
</p>
@param a The left matrix in the multiplication operation. Modified.
@param b The right matrix in the multiplication operation. Not modified. | [
"<p",
">",
"Performs",
"the",
"an",
"element",
"by",
"element",
"multiplication",
"operation",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"*",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/CommonOps_DDRM.java#L1507-L1518 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java | VirtualMachineScaleSetVMsInner.getInstanceView | public VirtualMachineScaleSetVMInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName, String instanceId) {
"""
Gets the status of a virtual machine from a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@par... | java | public VirtualMachineScaleSetVMInstanceViewInner getInstanceView(String resourceGroupName, String vmScaleSetName, String instanceId) {
return getInstanceViewWithServiceResponseAsync(resourceGroupName, vmScaleSetName, instanceId).toBlocking().single().body();
} | [
"public",
"VirtualMachineScaleSetVMInstanceViewInner",
"getInstanceView",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
",",
"String",
"instanceId",
")",
"{",
"return",
"getInstanceViewWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetN... | Gets the status of a virtual machine from a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@param instanceId The instance ID of the virtual machine.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExcepti... | [
"Gets",
"the",
"status",
"of",
"a",
"virtual",
"machine",
"from",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetVMsInner.java#L1134-L1136 |
jhalterman/failsafe | src/main/java/net/jodah/failsafe/FailsafeExecutor.java | FailsafeExecutor.runAsyncExecution | public CompletableFuture<Void> runAsyncExecution(AsyncRunnable runnable) {
"""
Executes the {@code runnable} asynchronously until successful or until the configured policies are exceeded. This
method is intended for integration with asynchronous code. Retries must be manually scheduled via one of the {@code
Asyn... | java | public CompletableFuture<Void> runAsyncExecution(AsyncRunnable runnable) {
return callAsync(execution -> Functions.asyncOfExecution(runnable, execution), true);
} | [
"public",
"CompletableFuture",
"<",
"Void",
">",
"runAsyncExecution",
"(",
"AsyncRunnable",
"runnable",
")",
"{",
"return",
"callAsync",
"(",
"execution",
"->",
"Functions",
".",
"asyncOfExecution",
"(",
"runnable",
",",
"execution",
")",
",",
"true",
")",
";",
... | Executes the {@code runnable} asynchronously until successful or until the configured policies are exceeded. This
method is intended for integration with asynchronous code. Retries must be manually scheduled via one of the {@code
AsyncExecution.retry} methods.
<p>
If a configured circuit breaker is open, the resulting ... | [
"Executes",
"the",
"{",
"@code",
"runnable",
"}",
"asynchronously",
"until",
"successful",
"or",
"until",
"the",
"configured",
"policies",
"are",
"exceeded",
".",
"This",
"method",
"is",
"intended",
"for",
"integration",
"with",
"asynchronous",
"code",
".",
"Ret... | train | https://github.com/jhalterman/failsafe/blob/65fcd3a82f7b232d2ff59bc525a59d693dd8e223/src/main/java/net/jodah/failsafe/FailsafeExecutor.java#L269-L271 |
h2oai/h2o-3 | h2o-core/src/main/java/water/MRTask.java | MRTask.outputFrame | public Frame outputFrame(Key<Frame> key, String [] names, String [][] domains) {
"""
Get the resulting Frame from this invoked MRTask. If the passed in <code>key</code>
is not null, then the resulting Frame will appear in the DKV. AppendableVec instances
are closed into Vec instances, which then appear in the DK... | java | public Frame outputFrame(Key<Frame> key, String [] names, String [][] domains){
Futures fs = new Futures();
Frame res = closeFrame(key, names, domains, fs);
if( key != null ) DKV.put(res,fs);
fs.blockForPending();
return res;
} | [
"public",
"Frame",
"outputFrame",
"(",
"Key",
"<",
"Frame",
">",
"key",
",",
"String",
"[",
"]",
"names",
",",
"String",
"[",
"]",
"[",
"]",
"domains",
")",
"{",
"Futures",
"fs",
"=",
"new",
"Futures",
"(",
")",
";",
"Frame",
"res",
"=",
"closeFram... | Get the resulting Frame from this invoked MRTask. If the passed in <code>key</code>
is not null, then the resulting Frame will appear in the DKV. AppendableVec instances
are closed into Vec instances, which then appear in the DKV.
@param key If null, then the Frame will not appear in the DKV. Otherwise, this result
wi... | [
"Get",
"the",
"resulting",
"Frame",
"from",
"this",
"invoked",
"MRTask",
".",
"If",
"the",
"passed",
"in",
"<code",
">",
"key<",
"/",
"code",
">",
"is",
"not",
"null",
"then",
"the",
"resulting",
"Frame",
"will",
"appear",
"in",
"the",
"DKV",
".",
"App... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/MRTask.java#L218-L224 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/common/Similarity.java | Similarity.check | private static void check(Vector a, Vector b) {
"""
Throws an exception if either {@code Vector} is {@code null} or if the
{@code Vector} lengths do not match.
"""
if (a.length() != b.length())
throw new IllegalArgumentException(
"input vector lengths do not match");
... | java | private static void check(Vector a, Vector b) {
if (a.length() != b.length())
throw new IllegalArgumentException(
"input vector lengths do not match");
} | [
"private",
"static",
"void",
"check",
"(",
"Vector",
"a",
",",
"Vector",
"b",
")",
"{",
"if",
"(",
"a",
".",
"length",
"(",
")",
"!=",
"b",
".",
"length",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"input vector lengths do not match\... | Throws an exception if either {@code Vector} is {@code null} or if the
{@code Vector} lengths do not match. | [
"Throws",
"an",
"exception",
"if",
"either",
"{"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/common/Similarity.java#L313-L317 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.