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 |
|---|---|---|---|---|---|---|---|---|---|---|
google/closure-compiler | src/com/google/javascript/jscomp/ReplaceMessages.java | ReplaceMessages.replaceCallNode | private Node replaceCallNode(JsMessage message, Node callNode)
throws MalformedException {
"""
Replaces a CALL node with an inlined message value.
<p>
The call tree looks something like:
<pre>
call
|-- getprop
| |-- name 'goog'
| +-- string 'getMsg'
|
|-- string 'Hi {$userName}! Welcome to {$pro... | java | private Node replaceCallNode(JsMessage message, Node callNode)
throws MalformedException {
checkNode(callNode, Token.CALL);
Node getPropNode = callNode.getFirstChild();
checkNode(getPropNode, Token.GETPROP);
Node stringExprNode = getPropNode.getNext();
checkStringExprNode(stringExprNode);
... | [
"private",
"Node",
"replaceCallNode",
"(",
"JsMessage",
"message",
",",
"Node",
"callNode",
")",
"throws",
"MalformedException",
"{",
"checkNode",
"(",
"callNode",
",",
"Token",
".",
"CALL",
")",
";",
"Node",
"getPropNode",
"=",
"callNode",
".",
"getFirstChild",... | Replaces a CALL node with an inlined message value.
<p>
The call tree looks something like:
<pre>
call
|-- getprop
| |-- name 'goog'
| +-- string 'getMsg'
|
|-- string 'Hi {$userName}! Welcome to {$product}.'
+-- objlit
|-- string 'userName'
|-- name 'someUserName'
|-- string 'product'
+-- call
+-- name 'getProduct... | [
"Replaces",
"a",
"CALL",
"node",
"with",
"an",
"inlined",
"message",
"value",
".",
"<p",
">",
"The",
"call",
"tree",
"looks",
"something",
"like",
":",
"<pre",
">",
"call",
"|",
"--",
"getprop",
"|",
"|",
"--",
"name",
"goog",
"|",
"+",
"--",
"string... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/ReplaceMessages.java#L296-L310 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImplIE.java | DocumentStyleImplIE.setStyleProperty | @Override
public void setStyleProperty(Element e, String prop, String val) {
"""
Set the value of a style property of an element.
IE needs a special workaround to handle opacity
"""
if ("opacity".equals(prop)) {
setOpacity(e, val);
} else {
super.setStyleProperty(e, prop, val);
}
} | java | @Override
public void setStyleProperty(Element e, String prop, String val) {
if ("opacity".equals(prop)) {
setOpacity(e, val);
} else {
super.setStyleProperty(e, prop, val);
}
} | [
"@",
"Override",
"public",
"void",
"setStyleProperty",
"(",
"Element",
"e",
",",
"String",
"prop",
",",
"String",
"val",
")",
"{",
"if",
"(",
"\"opacity\"",
".",
"equals",
"(",
"prop",
")",
")",
"{",
"setOpacity",
"(",
"e",
",",
"val",
")",
";",
"}",... | Set the value of a style property of an element.
IE needs a special workaround to handle opacity | [
"Set",
"the",
"value",
"of",
"a",
"style",
"property",
"of",
"an",
"element",
".",
"IE",
"needs",
"a",
"special",
"workaround",
"to",
"handle",
"opacity"
] | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/impl/DocumentStyleImplIE.java#L76-L83 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/config/builders/UserManagedCacheBuilder.java | UserManagedCacheBuilder.withSizeOfMaxObjectGraph | public UserManagedCacheBuilder<K, V, T> withSizeOfMaxObjectGraph(long size) {
"""
Adds or updates the {@link DefaultSizeOfEngineProviderConfiguration} with the specified object graph maximum size to the configured
builder.
<p>
{@link SizeOfEngine} is what enables the heap tier to be sized in {@link MemoryUnit}.... | java | public UserManagedCacheBuilder<K, V, T> withSizeOfMaxObjectGraph(long size) {
UserManagedCacheBuilder<K, V, T> otherBuilder = new UserManagedCacheBuilder<>(this);
removeAnySizeOfEngine(otherBuilder);
otherBuilder.objectGraphSize = size;
otherBuilder.serviceCreationConfigurations.add(new DefaultSizeOfEng... | [
"public",
"UserManagedCacheBuilder",
"<",
"K",
",",
"V",
",",
"T",
">",
"withSizeOfMaxObjectGraph",
"(",
"long",
"size",
")",
"{",
"UserManagedCacheBuilder",
"<",
"K",
",",
"V",
",",
"T",
">",
"otherBuilder",
"=",
"new",
"UserManagedCacheBuilder",
"<>",
"(",
... | Adds or updates the {@link DefaultSizeOfEngineProviderConfiguration} with the specified object graph maximum size to the configured
builder.
<p>
{@link SizeOfEngine} is what enables the heap tier to be sized in {@link MemoryUnit}.
@param size the maximum graph size
@return a new builder with the added / updated config... | [
"Adds",
"or",
"updates",
"the",
"{",
"@link",
"DefaultSizeOfEngineProviderConfiguration",
"}",
"with",
"the",
"specified",
"object",
"graph",
"maximum",
"size",
"to",
"the",
"configured",
"builder",
".",
"<p",
">",
"{",
"@link",
"SizeOfEngine",
"}",
"is",
"what"... | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/config/builders/UserManagedCacheBuilder.java#L741-L747 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java | MapWithProtoValuesSubject.ignoringRepeatedFieldOrderOfFieldsForValues | public MapWithProtoValuesFluentAssertion<M> ignoringRepeatedFieldOrderOfFieldsForValues(
int firstFieldNumber, int... rest) {
"""
Specifies that the ordering of repeated fields for these explicitly specified top-level field
numbers should be ignored when comparing for equality. Sub-fields must be specified ... | java | public MapWithProtoValuesFluentAssertion<M> ignoringRepeatedFieldOrderOfFieldsForValues(
int firstFieldNumber, int... rest) {
return usingConfig(config.ignoringRepeatedFieldOrderOfFields(asList(firstFieldNumber, rest)));
} | [
"public",
"MapWithProtoValuesFluentAssertion",
"<",
"M",
">",
"ignoringRepeatedFieldOrderOfFieldsForValues",
"(",
"int",
"firstFieldNumber",
",",
"int",
"...",
"rest",
")",
"{",
"return",
"usingConfig",
"(",
"config",
".",
"ignoringRepeatedFieldOrderOfFields",
"(",
"asLis... | Specifies that the ordering of repeated fields for these explicitly specified top-level field
numbers should be ignored when comparing for equality. Sub-fields must be specified explicitly
(via {@link FieldDescriptor}) if their orders are to be ignored as well.
<p>Use {@link #ignoringRepeatedFieldOrderForValues()} ins... | [
"Specifies",
"that",
"the",
"ordering",
"of",
"repeated",
"fields",
"for",
"these",
"explicitly",
"specified",
"top",
"-",
"level",
"field",
"numbers",
"should",
"be",
"ignored",
"when",
"comparing",
"for",
"equality",
".",
"Sub",
"-",
"fields",
"must",
"be",
... | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/MapWithProtoValuesSubject.java#L369-L372 |
ops4j/org.ops4j.base | ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java | ZipExploder.processJars | @Deprecated
public void processJars(String[] jarNames, String destDir) throws IOException {
"""
Explode source JAR files into a target directory
@param jarNames
names of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
@deprec... | java | @Deprecated
public void processJars(String[] jarNames, String destDir) throws IOException {
//Delegation to preferred method
processJars(FileUtils.pathNamesToFiles(jarNames), new File(destDir));
} | [
"@",
"Deprecated",
"public",
"void",
"processJars",
"(",
"String",
"[",
"]",
"jarNames",
",",
"String",
"destDir",
")",
"throws",
"IOException",
"{",
"//Delegation to preferred method",
"processJars",
"(",
"FileUtils",
".",
"pathNamesToFiles",
"(",
"jarNames",
")",
... | Explode source JAR files into a target directory
@param jarNames
names of source files
@param destDir
target directory name (should already exist)
@exception IOException
error creating a target file
@deprecated use {@link #processJars(File[], File)} for a type save
variant | [
"Explode",
"source",
"JAR",
"files",
"into",
"a",
"target",
"directory"
] | train | https://github.com/ops4j/org.ops4j.base/blob/b0e742c0d9511f6b19ca64da2ebaf30b7a47256a/ops4j-base-io/src/main/java/org/ops4j/io/ZipExploder.java#L152-L156 |
drewnoakes/metadata-extractor | Source/com/drew/imaging/jpeg/JpegSegmentData.java | JpegSegmentData.removeSegmentOccurrence | @SuppressWarnings( {
"""
Removes a specified instance of a segment's data from the collection. Use this method when more than one
occurrence of segment data exists for a given type exists.
@param segmentType identifies the required segment
@param occurrence the zero-based index of the segment occurrence to ... | java | @SuppressWarnings({"MismatchedQueryAndUpdateOfCollection"})
public void removeSegmentOccurrence(@NotNull JpegSegmentType segmentType, int occurrence)
{
removeSegmentOccurrence(segmentType.byteValue, occurrence);
} | [
"@",
"SuppressWarnings",
"(",
"{",
"\"MismatchedQueryAndUpdateOfCollection\"",
"}",
")",
"public",
"void",
"removeSegmentOccurrence",
"(",
"@",
"NotNull",
"JpegSegmentType",
"segmentType",
",",
"int",
"occurrence",
")",
"{",
"removeSegmentOccurrence",
"(",
"segmentType",
... | Removes a specified instance of a segment's data from the collection. Use this method when more than one
occurrence of segment data exists for a given type exists.
@param segmentType identifies the required segment
@param occurrence the zero-based index of the segment occurrence to remove. | [
"Removes",
"a",
"specified",
"instance",
"of",
"a",
"segment",
"s",
"data",
"from",
"the",
"collection",
".",
"Use",
"this",
"method",
"when",
"more",
"than",
"one",
"occurrence",
"of",
"segment",
"data",
"exists",
"for",
"a",
"given",
"type",
"exists",
".... | train | https://github.com/drewnoakes/metadata-extractor/blob/a958e0b61b50e590731b3be1dca8df8e21ebd43c/Source/com/drew/imaging/jpeg/JpegSegmentData.java#L209-L213 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionLoader.java | MapTileCollisionLoader.loadCollisions | public void loadCollisions(MapTileCollision mapCollision, Media collisionFormulas, Media collisionGroups) {
"""
Load map collision from an external file.
@param mapCollision The map tile collision owner.
@param collisionFormulas The collision formulas descriptor.
@param collisionGroups The tile collision grou... | java | public void loadCollisions(MapTileCollision mapCollision, Media collisionFormulas, Media collisionGroups)
{
if (collisionFormulas.exists())
{
loadCollisionFormulas(collisionFormulas);
}
if (collisionGroups.exists())
{
loadCollisionGroups(mapCol... | [
"public",
"void",
"loadCollisions",
"(",
"MapTileCollision",
"mapCollision",
",",
"Media",
"collisionFormulas",
",",
"Media",
"collisionGroups",
")",
"{",
"if",
"(",
"collisionFormulas",
".",
"exists",
"(",
")",
")",
"{",
"loadCollisionFormulas",
"(",
"collisionForm... | Load map collision from an external file.
@param mapCollision The map tile collision owner.
@param collisionFormulas The collision formulas descriptor.
@param collisionGroups The tile collision groups descriptor.
@throws LionEngineException If error when reading collisions. | [
"Load",
"map",
"collision",
"from",
"an",
"external",
"file",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/MapTileCollisionLoader.java#L83-L95 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/LibertyVersionRange.java | LibertyVersionRange.valueOf | public static LibertyVersionRange valueOf(String versionRangeString) {
"""
Attempts to parse the supplied version range string into a Liberty version range containing just numbers. If it fails to do so it will return null.
@param versionRangeString The String to parse
@return The {@link LibertyVersionRange} or... | java | public static LibertyVersionRange valueOf(String versionRangeString) {
if (versionRangeString == null) {
return null;
}
Matcher versionRangeMatcher = VERSION_RANGE_PATTERN.matcher(versionRangeString);
if (versionRangeMatcher.matches()) {
// Have a min and max so p... | [
"public",
"static",
"LibertyVersionRange",
"valueOf",
"(",
"String",
"versionRangeString",
")",
"{",
"if",
"(",
"versionRangeString",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Matcher",
"versionRangeMatcher",
"=",
"VERSION_RANGE_PATTERN",
".",
"matcher",
... | Attempts to parse the supplied version range string into a Liberty version range containing just numbers. If it fails to do so it will return null.
@param versionRangeString The String to parse
@return The {@link LibertyVersionRange} or <code>null</code> if the string is in the wrong form. | [
"Attempts",
"to",
"parse",
"the",
"supplied",
"version",
"range",
"string",
"into",
"a",
"Liberty",
"version",
"range",
"containing",
"just",
"numbers",
".",
"If",
"it",
"fails",
"to",
"do",
"so",
"it",
"will",
"return",
"null",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository.resolver/src/com/ibm/ws/repository/resolver/internal/LibertyVersionRange.java#L44-L69 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.findClosestPointOnPlane | public static Vector3f findClosestPointOnPlane(float aX, float aY, float aZ, float nX, float nY, float nZ, float pX, float pY, float pZ, Vector3f result) {
"""
Find the point on the given plane which is closest to the specified point <code>(pX, pY, pZ)</code> and store the result in <code>result</code>.
@param ... | java | public static Vector3f findClosestPointOnPlane(float aX, float aY, float aZ, float nX, float nY, float nZ, float pX, float pY, float pZ, Vector3f result) {
float d = -(nX * aX + nY * aY + nZ * aZ);
float t = nX * pX + nY * pY + nZ * pZ - d;
result.x = pX - t * nX;
result.y = pY - t * nY;... | [
"public",
"static",
"Vector3f",
"findClosestPointOnPlane",
"(",
"float",
"aX",
",",
"float",
"aY",
",",
"float",
"aZ",
",",
"float",
"nX",
",",
"float",
"nY",
",",
"float",
"nZ",
",",
"float",
"pX",
",",
"float",
"pY",
",",
"float",
"pZ",
",",
"Vector3... | Find the point on the given plane which is closest to the specified point <code>(pX, pY, pZ)</code> and store the result in <code>result</code>.
@param aX
the x coordinate of one point on the plane
@param aY
the y coordinate of one point on the plane
@param aZ
the z coordinate of one point on the plane
@param nX
the x... | [
"Find",
"the",
"point",
"on",
"the",
"given",
"plane",
"which",
"is",
"closest",
"to",
"the",
"specified",
"point",
"<code",
">",
"(",
"pX",
"pY",
"pZ",
")",
"<",
"/",
"code",
">",
"and",
"store",
"the",
"result",
"in",
"<code",
">",
"result<",
"/",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L1273-L1280 |
eclipse/xtext-core | org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/antlr/RequiredRuleNameComputer.java | RequiredRuleNameComputer.getRequiredRuleNames | public String[][] getRequiredRuleNames(Param param) {
"""
Returns the names of parser rules that should be called in order to obtain the follow elements for the parser
call stack described by the given param.
"""
if (isFiltered(param)) {
return EMPTY_ARRAY;
}
AbstractElement elementToParse = param.el... | java | public String[][] getRequiredRuleNames(Param param) {
if (isFiltered(param)) {
return EMPTY_ARRAY;
}
AbstractElement elementToParse = param.elementToParse;
String ruleName = param.ruleName;
if (ruleName == null) {
return getRequiredRuleNames(param, elementToParse);
}
return getAdjustedRequiredRuleNa... | [
"public",
"String",
"[",
"]",
"[",
"]",
"getRequiredRuleNames",
"(",
"Param",
"param",
")",
"{",
"if",
"(",
"isFiltered",
"(",
"param",
")",
")",
"{",
"return",
"EMPTY_ARRAY",
";",
"}",
"AbstractElement",
"elementToParse",
"=",
"param",
".",
"elementToParse"... | Returns the names of parser rules that should be called in order to obtain the follow elements for the parser
call stack described by the given param. | [
"Returns",
"the",
"names",
"of",
"parser",
"rules",
"that",
"should",
"be",
"called",
"in",
"order",
"to",
"obtain",
"the",
"follow",
"elements",
"for",
"the",
"parser",
"call",
"stack",
"described",
"by",
"the",
"given",
"param",
"."
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.ide/src/org/eclipse/xtext/ide/editor/contentassist/antlr/RequiredRuleNameComputer.java#L76-L86 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/HttpClientRestEndpoint.java | HttpClientRestEndpoint.spliceUrl | final URI spliceUrl(String resource, Map<String, String> parameters) throws RestEndpointIOException {
"""
Splice base URL and URL of resource
@param resource REST Resource Path
@param parameters Map of query parameters
@return Absolute URL to the REST Resource including server and port
@throws RestEndpoint... | java | final URI spliceUrl(String resource, Map<String, String> parameters) throws RestEndpointIOException {
try {
URIBuilder builder;
if (!Strings.isNullOrEmpty(baseUrl)) {
builder = new URIBuilder(baseUrl);
builder.setPath(builder.getPath() + resource);
... | [
"final",
"URI",
"spliceUrl",
"(",
"String",
"resource",
",",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"throws",
"RestEndpointIOException",
"{",
"try",
"{",
"URIBuilder",
"builder",
";",
"if",
"(",
"!",
"Strings",
".",
"isNullOrEmpty",
"("... | Splice base URL and URL of resource
@param resource REST Resource Path
@param parameters Map of query parameters
@return Absolute URL to the REST Resource including server and port
@throws RestEndpointIOException In case of incorrect URL format | [
"Splice",
"base",
"URL",
"and",
"URL",
"of",
"resource"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/HttpClientRestEndpoint.java#L468-L485 |
datacleaner/AnalyzerBeans | core/src/main/java/org/eobjects/analyzer/util/SystemProperties.java | SystemProperties.getInt | public static long getInt(String key, int valueIfNullOrNotParseable) {
"""
Gets a system property int, or a replacement value if the property is
null or blank or not parseable
@param key
@param valueIfNullOrNotParseable
@return
"""
String value = System.getProperty(key);
if (Strings.isNul... | java | public static long getInt(String key, int valueIfNullOrNotParseable) {
String value = System.getProperty(key);
if (Strings.isNullOrEmpty(value)) {
return valueIfNullOrNotParseable;
}
try {
return Integer.parseInt(value);
} catch (NumberFormatException e) {... | [
"public",
"static",
"long",
"getInt",
"(",
"String",
"key",
",",
"int",
"valueIfNullOrNotParseable",
")",
"{",
"String",
"value",
"=",
"System",
".",
"getProperty",
"(",
"key",
")",
";",
"if",
"(",
"Strings",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",
... | Gets a system property int, or a replacement value if the property is
null or blank or not parseable
@param key
@param valueIfNullOrNotParseable
@return | [
"Gets",
"a",
"system",
"property",
"int",
"or",
"a",
"replacement",
"value",
"if",
"the",
"property",
"is",
"null",
"or",
"blank",
"or",
"not",
"parseable"
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/core/src/main/java/org/eobjects/analyzer/util/SystemProperties.java#L83-L93 |
haraldk/TwelveMonkeys | imageio/imageio-clippath/src/main/java/com/twelvemonkeys/imageio/path/AdobePathBuilder.java | AdobePathBuilder.pathToShape | private Path2D pathToShape(final List<List<AdobePathSegment>> paths) {
"""
The Correct Order... P1, P2, P3, P4, P5, P6 (Closed) moveTo(P1)
curveTo(P1.cpl, P2.cpp, P2.ap); curveTo(P2.cpl, P3.cppy, P3.ap);
curveTo(P3.cpl, P4.cpp, P4.ap); curveTo(P4.cpl, P5.cpp, P5.ap);
curveTo(P5.cply, P6.cpp, P6.ap); curveTo(P6.... | java | private Path2D pathToShape(final List<List<AdobePathSegment>> paths) {
GeneralPath path = new GeneralPath(Path2D.WIND_EVEN_ODD, paths.size());
GeneralPath subpath = null;
for (List<AdobePathSegment> points : paths) {
int length = points.size();
for (int i = 0; i < point... | [
"private",
"Path2D",
"pathToShape",
"(",
"final",
"List",
"<",
"List",
"<",
"AdobePathSegment",
">",
">",
"paths",
")",
"{",
"GeneralPath",
"path",
"=",
"new",
"GeneralPath",
"(",
"Path2D",
".",
"WIND_EVEN_ODD",
",",
"paths",
".",
"size",
"(",
")",
")",
... | The Correct Order... P1, P2, P3, P4, P5, P6 (Closed) moveTo(P1)
curveTo(P1.cpl, P2.cpp, P2.ap); curveTo(P2.cpl, P3.cppy, P3.ap);
curveTo(P3.cpl, P4.cpp, P4.ap); curveTo(P4.cpl, P5.cpp, P5.ap);
curveTo(P5.cply, P6.cpp, P6.ap); curveTo(P6.cpl, P1.cpp, P1.ap);
closePath() | [
"The",
"Correct",
"Order",
"...",
"P1",
"P2",
"P3",
"P4",
"P5",
"P6",
"(",
"Closed",
")",
"moveTo",
"(",
"P1",
")",
"curveTo",
"(",
"P1",
".",
"cpl",
"P2",
".",
"cpp",
"P2",
".",
"ap",
")",
";",
"curveTo",
"(",
"P2",
".",
"cpl",
"P3",
".",
"c... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/imageio/imageio-clippath/src/main/java/com/twelvemonkeys/imageio/path/AdobePathBuilder.java#L151-L207 |
diffplug/JMatIO | src/main/java/ca/mjdsystems/jmatio/types/MLNumericArray.java | MLNumericArray.setReal | public void setReal(T value, int m, int n) {
"""
Sets single real array element.
@param value - element value
@param m - row index
@param n - column index
"""
setReal( value, getIndex(m,n) );
} | java | public void setReal(T value, int m, int n)
{
setReal( value, getIndex(m,n) );
} | [
"public",
"void",
"setReal",
"(",
"T",
"value",
",",
"int",
"m",
",",
"int",
"n",
")",
"{",
"setReal",
"(",
"value",
",",
"getIndex",
"(",
"m",
",",
"n",
")",
")",
";",
"}"
] | Sets single real array element.
@param value - element value
@param m - row index
@param n - column index | [
"Sets",
"single",
"real",
"array",
"element",
"."
] | train | https://github.com/diffplug/JMatIO/blob/dab8a54fa21a8faeaa81537cdc45323c5c4e6ca6/src/main/java/ca/mjdsystems/jmatio/types/MLNumericArray.java#L99-L102 |
Berico-Technologies/CLAVIN | src/main/java/com/bericotech/clavin/resolver/ClavinLocationResolver.java | ClavinLocationResolver.resolveLocations | public List<ResolvedLocation> resolveLocations(final List<LocationOccurrence> locations, final boolean fuzzy)
throws ClavinException {
"""
Resolves the supplied list of location names into
{@link ResolvedLocation}s containing {@link com.bericotech.clavin.gazetteer.GeoName} objects
using the defaults ... | java | public List<ResolvedLocation> resolveLocations(final List<LocationOccurrence> locations, final boolean fuzzy)
throws ClavinException {
return resolveLocations(locations, DEFAULT_MAX_HIT_DEPTH, DEFAULT_MAX_CONTEXT_WINDOW, fuzzy, DEFAULT_ANCESTRY_MODE);
} | [
"public",
"List",
"<",
"ResolvedLocation",
">",
"resolveLocations",
"(",
"final",
"List",
"<",
"LocationOccurrence",
">",
"locations",
",",
"final",
"boolean",
"fuzzy",
")",
"throws",
"ClavinException",
"{",
"return",
"resolveLocations",
"(",
"locations",
",",
"DE... | Resolves the supplied list of location names into
{@link ResolvedLocation}s containing {@link com.bericotech.clavin.gazetteer.GeoName} objects
using the defaults for maxHitDepth and maxContentWindow.
Calls {@link Gazetteer#getClosestLocations} on
each location name to find all possible matches, then uses
heuristics to... | [
"Resolves",
"the",
"supplied",
"list",
"of",
"location",
"names",
"into",
"{",
"@link",
"ResolvedLocation",
"}",
"s",
"containing",
"{",
"@link",
"com",
".",
"bericotech",
".",
"clavin",
".",
"gazetteer",
".",
"GeoName",
"}",
"objects",
"using",
"the",
"defa... | train | https://github.com/Berico-Technologies/CLAVIN/blob/f73c741f33a01b91aa5b06e71860bc354ef3010d/src/main/java/com/bericotech/clavin/resolver/ClavinLocationResolver.java#L115-L118 |
JetBrains/xodus | vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java | VirtualFileSystem.deleteFile | @Nullable
public File deleteFile(@NotNull final Transaction txn, @NotNull final String path) {
"""
Deletes existing file with the specified {@code path}.
@param txn {@linkplain Transaction} instance
@param path file path
@return deleted {@linkplain File} or {@code null} if no file with specified {@code p... | java | @Nullable
public File deleteFile(@NotNull final Transaction txn, @NotNull final String path) {
final ArrayByteIterable key = StringBinding.stringToEntry(path);
final ByteIterable fileMetadata;
try (Cursor cursor = pathnames.openCursor(txn)) {
fileMetadata = cursor.getSearchKey(ke... | [
"@",
"Nullable",
"public",
"File",
"deleteFile",
"(",
"@",
"NotNull",
"final",
"Transaction",
"txn",
",",
"@",
"NotNull",
"final",
"String",
"path",
")",
"{",
"final",
"ArrayByteIterable",
"key",
"=",
"StringBinding",
".",
"stringToEntry",
"(",
"path",
")",
... | Deletes existing file with the specified {@code path}.
@param txn {@linkplain Transaction} instance
@param path file path
@return deleted {@linkplain File} or {@code null} if no file with specified {@code path}exists.
@see File | [
"Deletes",
"existing",
"file",
"with",
"the",
"specified",
"{",
"@code",
"path",
"}",
"."
] | train | https://github.com/JetBrains/xodus/blob/7b3476c4e81db66f9c7529148c761605cc8eea6d/vfs/src/main/java/jetbrains/exodus/vfs/VirtualFileSystem.java#L309-L331 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java | Retryer.incrementingWait | public Retryer<R> incrementingWait(final long initialSleepTime, final long increment) {
"""
Sets the strategy that sleeps a fixed amount milliseconds after the first
failed attempt and in incrementing amounts milliseconds after each additional failed attempt.
@param initialSleepTime
@param increment
@return
... | java | public Retryer<R> incrementingWait(final long initialSleepTime, final long increment) {
checkArgument(initialSleepTime >= 0L, "initialSleepTime must be >= 0 but is %d", initialSleepTime);
return withWaitStrategy(new WaitStrategy() {
@Override public long computeSleepTime(int previousAttempt... | [
"public",
"Retryer",
"<",
"R",
">",
"incrementingWait",
"(",
"final",
"long",
"initialSleepTime",
",",
"final",
"long",
"increment",
")",
"{",
"checkArgument",
"(",
"initialSleepTime",
">=",
"0L",
",",
"\"initialSleepTime must be >= 0 but is %d\"",
",",
"initialSleepT... | Sets the strategy that sleeps a fixed amount milliseconds after the first
failed attempt and in incrementing amounts milliseconds after each additional failed attempt.
@param initialSleepTime
@param increment
@return | [
"Sets",
"the",
"strategy",
"that",
"sleeps",
"a",
"fixed",
"amount",
"milliseconds",
"after",
"the",
"first",
"failed",
"attempt",
"and",
"in",
"incrementing",
"amounts",
"milliseconds",
"after",
"each",
"additional",
"failed",
"attempt",
"."
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/thirdparty/Retryer.java#L451-L460 |
progolden/vraptor-boilerplate | vraptor-boilerplate-usercontrol/src/main/java/br/com/caelum/vraptor/boilerplate/user/UserBS.java | UserBS.generateAccessToken | public UserAccessToken generateAccessToken(User user, String device) {
"""
Retorna o token de acesso do usuário.
@param user Usuário para recuperar o token.
@param device ID do dispositivo da token.
@return token Token de acesso do usuário.
"""
if (user == null)
return null;
Criteria criteria = thi... | java | public UserAccessToken generateAccessToken(User user, String device) {
if (user == null)
return null;
Criteria criteria = this.dao.newCriteria(UserAccessToken.class)
.add(Restrictions.eq("user", user))
.add(Restrictions.eqOrIsNull("device", device))
.add(Restrictions.gt("expiration", new Date()))
... | [
"public",
"UserAccessToken",
"generateAccessToken",
"(",
"User",
"user",
",",
"String",
"device",
")",
"{",
"if",
"(",
"user",
"==",
"null",
")",
"return",
"null",
";",
"Criteria",
"criteria",
"=",
"this",
".",
"dao",
".",
"newCriteria",
"(",
"UserAccessToke... | Retorna o token de acesso do usuário.
@param user Usuário para recuperar o token.
@param device ID do dispositivo da token.
@return token Token de acesso do usuário. | [
"Retorna",
"o",
"token",
"de",
"acesso",
"do",
"usuário",
"."
] | train | https://github.com/progolden/vraptor-boilerplate/blob/3edf45cc0dc5aec61b16ca326b4d72c82d1d3e07/vraptor-boilerplate-usercontrol/src/main/java/br/com/caelum/vraptor/boilerplate/user/UserBS.java#L65-L87 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToXMLStream.java | ToXMLStream.addUniqueAttribute | public void addUniqueAttribute(String name, String value, int flags)
throws SAXException {
"""
This method is used to add an attribute to the currently open element.
The caller has guaranted that this attribute is unique, which means that it
not been seen before and will not be seen again.
@param name... | java | public void addUniqueAttribute(String name, String value, int flags)
throws SAXException
{
if (m_elemContext.m_startTagOpen)
{
try
{
final String patchedName = patchName(name);
final java.io.Writer writer = m_writer;
... | [
"public",
"void",
"addUniqueAttribute",
"(",
"String",
"name",
",",
"String",
"value",
",",
"int",
"flags",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"m_elemContext",
".",
"m_startTagOpen",
")",
"{",
"try",
"{",
"final",
"String",
"patchedName",
"=",
"p... | This method is used to add an attribute to the currently open element.
The caller has guaranted that this attribute is unique, which means that it
not been seen before and will not be seen again.
@param name the qualified name of the attribute
@param value the value of the attribute which can contain only
ASCII printa... | [
"This",
"method",
"is",
"used",
"to",
"add",
"an",
"attribute",
"to",
"the",
"currently",
"open",
"element",
".",
"The",
"caller",
"has",
"guaranted",
"that",
"this",
"attribute",
"is",
"unique",
"which",
"means",
"that",
"it",
"not",
"been",
"seen",
"befo... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToXMLStream.java#L381-L417 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.rebootAsync | public Observable<Void> rebootAsync(String poolId, String nodeId) {
"""
Restarts the specified compute node.
You can restart a node only if it is in an idle or running state.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node that you want to restart.
@t... | java | public Observable<Void> rebootAsync(String poolId, String nodeId) {
return rebootWithServiceResponseAsync(poolId, nodeId).map(new Func1<ServiceResponseWithHeaders<Void, ComputeNodeRebootHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, ComputeNodeRebootHeade... | [
"public",
"Observable",
"<",
"Void",
">",
"rebootAsync",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
")",
"{",
"return",
"rebootWithServiceResponseAsync",
"(",
"poolId",
",",
"nodeId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"ServiceResponseWithHeaders"... | Restarts the specified compute node.
You can restart a node only if it is in an idle or running state.
@param poolId The ID of the pool that contains the compute node.
@param nodeId The ID of the compute node that you want to restart.
@throws IllegalArgumentException thrown if parameters fail the validation
@return th... | [
"Restarts",
"the",
"specified",
"compute",
"node",
".",
"You",
"can",
"restart",
"a",
"node",
"only",
"if",
"it",
"is",
"in",
"an",
"idle",
"or",
"running",
"state",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L1091-L1098 |
zaproxy/zaproxy | src/org/zaproxy/zap/spider/Spider.java | Spider.addFileSeed | private void addFileSeed(URI baseUri, String fileName, Pattern condition) {
"""
Adds a file seed using the given base URI, file name and condition.
<p>
The file is added as part of the path, without existing file name. For example, with base URI as
{@code http://example.com/some/path/file.html} and file name as... | java | private void addFileSeed(URI baseUri, String fileName, Pattern condition) {
String fullpath = baseUri.getEscapedPath();
if (fullpath == null) {
fullpath = "";
}
String name = baseUri.getEscapedName();
if (name == null) {
name = "";
}
String pathminusfilename = fullpath.substring(0, fullpath.lastIn... | [
"private",
"void",
"addFileSeed",
"(",
"URI",
"baseUri",
",",
"String",
"fileName",
",",
"Pattern",
"condition",
")",
"{",
"String",
"fullpath",
"=",
"baseUri",
".",
"getEscapedPath",
"(",
")",
";",
"if",
"(",
"fullpath",
"==",
"null",
")",
"{",
"fullpath"... | Adds a file seed using the given base URI, file name and condition.
<p>
The file is added as part of the path, without existing file name. For example, with base URI as
{@code http://example.com/some/path/file.html} and file name as {@code .git/index} it's added the seed
{@code http://example.com/some/path/.git/index}.... | [
"Adds",
"a",
"file",
"seed",
"using",
"the",
"given",
"base",
"URI",
"file",
"name",
"and",
"condition",
".",
"<p",
">",
"The",
"file",
"is",
"added",
"as",
"part",
"of",
"the",
"path",
"without",
"existing",
"file",
"name",
".",
"For",
"example",
"wit... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/spider/Spider.java#L312-L339 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java | DefaultCacheableResourceService.areHashFilesEqual | private boolean areHashFilesEqual(File hashFile1, File hashFile2,
String remoteLocation) throws ResourceDownloadError {
"""
Compares the hashes contained in the resource files. The hashes in the
files are compared case-insensitively in order to support hexadecimal
variations on a-f and A-F.
@param... | java | private boolean areHashFilesEqual(File hashFile1, File hashFile2,
String remoteLocation) throws ResourceDownloadError {
try {
String resource1Hash = readFileToString(hashFile1, UTF_8);
String resource2Hash = readFileToString(hashFile2, UTF_8);
return resource1Has... | [
"private",
"boolean",
"areHashFilesEqual",
"(",
"File",
"hashFile1",
",",
"File",
"hashFile2",
",",
"String",
"remoteLocation",
")",
"throws",
"ResourceDownloadError",
"{",
"try",
"{",
"String",
"resource1Hash",
"=",
"readFileToString",
"(",
"hashFile1",
",",
"UTF_8... | Compares the hashes contained in the resource files. The hashes in the
files are compared case-insensitively in order to support hexadecimal
variations on a-f and A-F.
@param hashFile1 {@link File}, the first hash file
@param hashFile2 {@link File}, the second hash file
@param remoteLocation {@link String}, the resour... | [
"Compares",
"the",
"hashes",
"contained",
"in",
"the",
"resource",
"files",
".",
"The",
"hashes",
"in",
"the",
"files",
"are",
"compared",
"case",
"-",
"insensitively",
"in",
"order",
"to",
"support",
"hexadecimal",
"variations",
"on",
"a",
"-",
"f",
"and",
... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/cache/DefaultCacheableResourceService.java#L247-L257 |
tempodb/tempodb-java | src/main/java/com/tempodb/Client.java | Client.readMultiDataPoints | public Cursor<MultiDataPoint> readMultiDataPoints(Filter filter, Interval interval) {
"""
Returns a cursor of multi-datapoints specified by a series filter.
<p>This endpoint allows one to request datapoints for multiple series in one call.
The system default timezone is used for the returned DateTimes.
@par... | java | public Cursor<MultiDataPoint> readMultiDataPoints(Filter filter, Interval interval) {
return readMultiDataPoints(filter, interval, DateTimeZone.getDefault(), null, null);
} | [
"public",
"Cursor",
"<",
"MultiDataPoint",
">",
"readMultiDataPoints",
"(",
"Filter",
"filter",
",",
"Interval",
"interval",
")",
"{",
"return",
"readMultiDataPoints",
"(",
"filter",
",",
"interval",
",",
"DateTimeZone",
".",
"getDefault",
"(",
")",
",",
"null",... | Returns a cursor of multi-datapoints specified by a series filter.
<p>This endpoint allows one to request datapoints for multiple series in one call.
The system default timezone is used for the returned DateTimes.
@param filter The series filter
@param interval An interval of time for the query (start/end datetimes)
... | [
"Returns",
"a",
"cursor",
"of",
"multi",
"-",
"datapoints",
"specified",
"by",
"a",
"series",
"filter",
"."
] | train | https://github.com/tempodb/tempodb-java/blob/5733f204fe4c8dda48916ba1f67cf44f5a3f9c69/src/main/java/com/tempodb/Client.java#L870-L872 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.multTranA | public static void multTranA( DMatrixRMaj A , DMatrixRMaj B , DMatrixRMaj C , DMatrixRMaj output ) {
"""
Computes: D = A<sup>T</sup>*B*C
@param A (Input) 3x3 matrix
@param B (Input) 3x3 matrix
@param C (Input) 3x3 matrix
@param output (Output) 3x3 matrix. Can be same instance A or B.
"""
double t11 = A... | java | public static void multTranA( DMatrixRMaj A , DMatrixRMaj B , DMatrixRMaj C , DMatrixRMaj output )
{
double t11 = A.data[0]*B.data[0] + A.data[3]*B.data[3] + A.data[6]*B.data[6];
double t12 = A.data[0]*B.data[1] + A.data[3]*B.data[4] + A.data[6]*B.data[7];
double t13 = A.data[0]*B.data[2] + A.data[3]*B.data[5] +... | [
"public",
"static",
"void",
"multTranA",
"(",
"DMatrixRMaj",
"A",
",",
"DMatrixRMaj",
"B",
",",
"DMatrixRMaj",
"C",
",",
"DMatrixRMaj",
"output",
")",
"{",
"double",
"t11",
"=",
"A",
".",
"data",
"[",
"0",
"]",
"*",
"B",
".",
"data",
"[",
"0",
"]",
... | Computes: D = A<sup>T</sup>*B*C
@param A (Input) 3x3 matrix
@param B (Input) 3x3 matrix
@param C (Input) 3x3 matrix
@param output (Output) 3x3 matrix. Can be same instance A or B. | [
"Computes",
":",
"D",
"=",
"A<sup",
">",
"T<",
"/",
"sup",
">",
"*",
"B",
"*",
"C"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L789-L814 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/HelixAxisAligner.java | HelixAxisAligner.getMidPoint | private Point3d getMidPoint(Point3d p1, Point3d p2, Point3d p3) {
"""
Return a midpoint of a helix, calculated from three positions
of three adjacent subunit centers.
@param p1 center of first subunit
@param p2 center of second subunit
@param p3 center of third subunit
@return midpoint of helix
"""
Vect... | java | private Point3d getMidPoint(Point3d p1, Point3d p2, Point3d p3) {
Vector3d v1 = new Vector3d();
v1.sub(p1, p2);
Vector3d v2 = new Vector3d();
v2.sub(p3, p2);
Vector3d v3 = new Vector3d();
v3.add(v1);
v3.add(v2);
v3.normalize();
// calculat the total distance between to subunits
double dTotal = v1.l... | [
"private",
"Point3d",
"getMidPoint",
"(",
"Point3d",
"p1",
",",
"Point3d",
"p2",
",",
"Point3d",
"p3",
")",
"{",
"Vector3d",
"v1",
"=",
"new",
"Vector3d",
"(",
")",
";",
"v1",
".",
"sub",
"(",
"p1",
",",
"p2",
")",
";",
"Vector3d",
"v2",
"=",
"new"... | Return a midpoint of a helix, calculated from three positions
of three adjacent subunit centers.
@param p1 center of first subunit
@param p2 center of second subunit
@param p3 center of third subunit
@return midpoint of helix | [
"Return",
"a",
"midpoint",
"of",
"a",
"helix",
"calculated",
"from",
"three",
"positions",
"of",
"three",
"adjacent",
"subunit",
"centers",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/axis/HelixAxisAligner.java#L311-L342 |
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java | CFMLExpressionInterpreter.orOp | private Ref orOp() throws PageException {
"""
Transfomiert eine Or (or) Operation. Im Gegensatz zu CFMX , werden "||" Zeichen auch als Or
Operatoren anerkannt. <br />
EBNF:<br />
<code>andOp {("or" | "||") spaces andOp}; (* "||" Existiert in CFMX nicht *)</code>
@return CFXD Element
@throws PageException
... | java | private Ref orOp() throws PageException {
Ref ref = andOp();
while (cfml.isValidIndex() && (cfml.forwardIfCurrent("||") || cfml.forwardIfCurrent("or"))) {
cfml.removeSpace();
ref = new Or(ref, andOp(), limited);
}
return ref;
} | [
"private",
"Ref",
"orOp",
"(",
")",
"throws",
"PageException",
"{",
"Ref",
"ref",
"=",
"andOp",
"(",
")",
";",
"while",
"(",
"cfml",
".",
"isValidIndex",
"(",
")",
"&&",
"(",
"cfml",
".",
"forwardIfCurrent",
"(",
"\"||\"",
")",
"||",
"cfml",
".",
"fo... | Transfomiert eine Or (or) Operation. Im Gegensatz zu CFMX , werden "||" Zeichen auch als Or
Operatoren anerkannt. <br />
EBNF:<br />
<code>andOp {("or" | "||") spaces andOp}; (* "||" Existiert in CFMX nicht *)</code>
@return CFXD Element
@throws PageException | [
"Transfomiert",
"eine",
"Or",
"(",
"or",
")",
"Operation",
".",
"Im",
"Gegensatz",
"zu",
"CFMX",
"werden",
"||",
"Zeichen",
"auch",
"als",
"Or",
"Operatoren",
"anerkannt",
".",
"<br",
"/",
">",
"EBNF",
":",
"<br",
"/",
">",
"<code",
">",
"andOp",
"{",
... | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/CFMLExpressionInterpreter.java#L398-L405 |
onelogin/onelogin-java-sdk | src/main/java/com/onelogin/sdk/conn/Client.java | Client.getFactors | public List<AuthFactor> getFactors(long userId) throws OAuthSystemException, OAuthProblemException, URISyntaxException {
"""
Returns a list of authentication factors that are available for user enrollment
via API.
@param userId
The id of the user.
@return Array AuthFactor list
@throws OAuthSystemExcepti... | java | public List<AuthFactor> getFactors(long userId) throws OAuthSystemException, OAuthProblemException, URISyntaxException
{
cleanError();
prepareToken();
URIBuilder url = new URIBuilder(settings.getURL(Constants.GET_FACTORS_URL, userId));
OneloginURLConnectionClient httpClient = new OneloginURLConnectionClie... | [
"public",
"List",
"<",
"AuthFactor",
">",
"getFactors",
"(",
"long",
"userId",
")",
"throws",
"OAuthSystemException",
",",
"OAuthProblemException",
",",
"URISyntaxException",
"{",
"cleanError",
"(",
")",
";",
"prepareToken",
"(",
")",
";",
"URIBuilder",
"url",
"... | Returns a list of authentication factors that are available for user enrollment
via API.
@param userId
The id of the user.
@return Array AuthFactor list
@throws OAuthSystemException - if there is a IOException reading parameters of the httpURLConnection
@throws OAuthProblemException - if there are errors validating ... | [
"Returns",
"a",
"list",
"of",
"authentication",
"factors",
"that",
"are",
"available",
"for",
"user",
"enrollment",
"via",
"API",
"."
] | train | https://github.com/onelogin/onelogin-java-sdk/blob/1570b78033dcc1c7387099e77fe41b6b0638df8c/src/main/java/com/onelogin/sdk/conn/Client.java#L2624-L2660 |
FasterXML/woodstox | src/main/java/com/ctc/wstx/dtd/FullDTDReader.java | FullDTDReader.readNotationEntry | private String readNotationEntry(char c, PrefixedName attrName, Location refLoc)
throws XMLStreamException {
"""
Method called to read a notation reference entry; done both for
attributes of type NOTATION, and for external unparsed entities
that refer to a notation. In both cases, notation referenced
ne... | java | private String readNotationEntry(char c, PrefixedName attrName, Location refLoc)
throws XMLStreamException
{
String id = readDTDName(c);
/* Need to check whether we have a reference to a "pre-defined"
* notation: pre-defined here means that it was defined in the
* internal... | [
"private",
"String",
"readNotationEntry",
"(",
"char",
"c",
",",
"PrefixedName",
"attrName",
",",
"Location",
"refLoc",
")",
"throws",
"XMLStreamException",
"{",
"String",
"id",
"=",
"readDTDName",
"(",
"c",
")",
";",
"/* Need to check whether we have a reference to a... | Method called to read a notation reference entry; done both for
attributes of type NOTATION, and for external unparsed entities
that refer to a notation. In both cases, notation referenced
needs to have been defined earlier; but only if we are building
a fully validating DTD subset object (there is the alternative
of a... | [
"Method",
"called",
"to",
"read",
"a",
"notation",
"reference",
"entry",
";",
"done",
"both",
"for",
"attributes",
"of",
"type",
"NOTATION",
"and",
"for",
"external",
"unparsed",
"entities",
"that",
"refer",
"to",
"a",
"notation",
".",
"In",
"both",
"cases",... | train | https://github.com/FasterXML/woodstox/blob/ffcaabdc06672d9564c48c25d601d029b7fd6548/src/main/java/com/ctc/wstx/dtd/FullDTDReader.java#L2922-L2953 |
jpush/jmessage-api-java-client | src/main/java/cn/jmessage/api/JMessageClient.java | JMessageClient.getChatRoomMembers | public ChatRoomMemberList getChatRoomMembers(long roomId, int start, int count)
throws APIConnectionException, APIRequestException {
"""
Get all member info of chat room
@param roomId chat room id
@param start start index
@param count member count
@return {@link ChatRoomMemberList}
@throws APIC... | java | public ChatRoomMemberList getChatRoomMembers(long roomId, int start, int count)
throws APIConnectionException, APIRequestException {
return _chatRoomClient.getChatRoomMembers(roomId, start, count);
} | [
"public",
"ChatRoomMemberList",
"getChatRoomMembers",
"(",
"long",
"roomId",
",",
"int",
"start",
",",
"int",
"count",
")",
"throws",
"APIConnectionException",
",",
"APIRequestException",
"{",
"return",
"_chatRoomClient",
".",
"getChatRoomMembers",
"(",
"roomId",
",",... | Get all member info of chat room
@param roomId chat room id
@param start start index
@param count member count
@return {@link ChatRoomMemberList}
@throws APIConnectionException connect exception
@throws APIRequestException request exception | [
"Get",
"all",
"member",
"info",
"of",
"chat",
"room"
] | train | https://github.com/jpush/jmessage-api-java-client/blob/767f5fb15e9fe5a546c00f6e68b64f6dd53c617c/src/main/java/cn/jmessage/api/JMessageClient.java#L876-L879 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookFragment.java | FacebookFragment.openSessionForPublish | protected final void openSessionForPublish(String applicationId, List<String> permissions) {
"""
Opens a new session with publish permissions. If either applicationID is null,
this method will default to using the value from the associated
meta-data value. The permissions list cannot be null.
@param applicati... | java | protected final void openSessionForPublish(String applicationId, List<String> permissions) {
openSessionForPublish(applicationId, permissions, SessionLoginBehavior.SSO_WITH_FALLBACK,
Session.DEFAULT_AUTHORIZE_ACTIVITY_CODE);
} | [
"protected",
"final",
"void",
"openSessionForPublish",
"(",
"String",
"applicationId",
",",
"List",
"<",
"String",
">",
"permissions",
")",
"{",
"openSessionForPublish",
"(",
"applicationId",
",",
"permissions",
",",
"SessionLoginBehavior",
".",
"SSO_WITH_FALLBACK",
"... | Opens a new session with publish permissions. If either applicationID is null,
this method will default to using the value from the associated
meta-data value. The permissions list cannot be null.
@param applicationId the applicationID, can be null
@param permissions the permissions list, cannot be null | [
"Opens",
"a",
"new",
"session",
"with",
"publish",
"permissions",
".",
"If",
"either",
"applicationID",
"is",
"null",
"this",
"method",
"will",
"default",
"to",
"using",
"the",
"value",
"from",
"the",
"associated",
"meta",
"-",
"data",
"value",
".",
"The",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookFragment.java#L241-L244 |
guardtime/ksi-java-sdk | ksi-service-ha/src/main/java/com/guardtime/ksi/service/ha/HAConfUtil.java | HAConfUtil.isAfter | static boolean isAfter(Date a, Date b) {
"""
Is value of b after value of a.
@return True, if b is after a. Always true, if value of a is null.
"""
return a == null || (b != null && b.after(a));
} | java | static boolean isAfter(Date a, Date b) {
return a == null || (b != null && b.after(a));
} | [
"static",
"boolean",
"isAfter",
"(",
"Date",
"a",
",",
"Date",
"b",
")",
"{",
"return",
"a",
"==",
"null",
"||",
"(",
"b",
"!=",
"null",
"&&",
"b",
".",
"after",
"(",
"a",
")",
")",
";",
"}"
] | Is value of b after value of a.
@return True, if b is after a. Always true, if value of a is null. | [
"Is",
"value",
"of",
"b",
"after",
"value",
"of",
"a",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-service-ha/src/main/java/com/guardtime/ksi/service/ha/HAConfUtil.java#L52-L54 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.postGroupActivity | public ApiResponse postGroupActivity(String groupId, Activity activity) {
"""
Posts an activity to a group. Activity must already be created.
@param userId
@param activity
@return
"""
return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "groups",
groupI... | java | public ApiResponse postGroupActivity(String groupId, Activity activity) {
return apiRequest(HttpMethod.POST, null, activity, organizationId, applicationId, "groups",
groupId, "activities");
} | [
"public",
"ApiResponse",
"postGroupActivity",
"(",
"String",
"groupId",
",",
"Activity",
"activity",
")",
"{",
"return",
"apiRequest",
"(",
"HttpMethod",
".",
"POST",
",",
"null",
",",
"activity",
",",
"organizationId",
",",
"applicationId",
",",
"\"groups\"",
"... | Posts an activity to a group. Activity must already be created.
@param userId
@param activity
@return | [
"Posts",
"an",
"activity",
"to",
"a",
"group",
".",
"Activity",
"must",
"already",
"be",
"created",
"."
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L708-L711 |
ops4j/org.ops4j.pax.logging | pax-logging-log4j2/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java | ThrowableProxy.getCauseStackTraceAsString | public String getCauseStackTraceAsString(final List<String> packages, final String suffix) {
"""
Formats the Throwable that is the cause of this Throwable.
@param packages The List of packages to be suppressed from the trace.
@param suffix
@return The formatted Throwable that caused this Throwable.
"""
... | java | public String getCauseStackTraceAsString(final List<String> packages, final String suffix) {
return getCauseStackTraceAsString(packages, PlainTextRenderer.getInstance(), suffix);
} | [
"public",
"String",
"getCauseStackTraceAsString",
"(",
"final",
"List",
"<",
"String",
">",
"packages",
",",
"final",
"String",
"suffix",
")",
"{",
"return",
"getCauseStackTraceAsString",
"(",
"packages",
",",
"PlainTextRenderer",
".",
"getInstance",
"(",
")",
","... | Formats the Throwable that is the cause of this Throwable.
@param packages The List of packages to be suppressed from the trace.
@param suffix
@return The formatted Throwable that caused this Throwable. | [
"Formats",
"the",
"Throwable",
"that",
"is",
"the",
"cause",
"of",
"this",
"Throwable",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-log4j2/src/main/java/org/apache/logging/log4j/core/impl/ThrowableProxy.java#L410-L412 |
NoraUi/NoraUi | src/main/java/com/github/noraui/utils/Utilities.java | Utilities.getLocator | public static By getLocator(Page page, String code, Object... args) {
"""
This method read a application descriptor file and return a {@link org.openqa.selenium.By} object (xpath, id, link ...).
@param page
is target page
@param code
Name of element on the web Page.
@param args
list of description (xpath, ... | java | public static By getLocator(Page page, String code, Object... args) {
return getLocator(page.getApplication(), page.getPageKey() + code, args);
} | [
"public",
"static",
"By",
"getLocator",
"(",
"Page",
"page",
",",
"String",
"code",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"getLocator",
"(",
"page",
".",
"getApplication",
"(",
")",
",",
"page",
".",
"getPageKey",
"(",
")",
"+",
"code",
","... | This method read a application descriptor file and return a {@link org.openqa.selenium.By} object (xpath, id, link ...).
@param page
is target page
@param code
Name of element on the web Page.
@param args
list of description (xpath, id, link ...) for code.
@return a {@link org.openqa.selenium.By} object (xpath, id, li... | [
"This",
"method",
"read",
"a",
"application",
"descriptor",
"file",
"and",
"return",
"a",
"{",
"@link",
"org",
".",
"openqa",
".",
"selenium",
".",
"By",
"}",
"object",
"(",
"xpath",
"id",
"link",
"...",
")",
"."
] | train | https://github.com/NoraUi/NoraUi/blob/5f491a3339c7d3c20d7207760bdaf2acdb8f260c/src/main/java/com/github/noraui/utils/Utilities.java#L123-L125 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/PatternsImpl.java | PatternsImpl.deletePatterns | public OperationStatus deletePatterns(UUID appId, String versionId, List<UUID> patternIds) {
"""
Deletes the patterns with the specified IDs.
@param appId The application ID.
@param versionId The version ID.
@param patternIds The patterns IDs.
@throws IllegalArgumentException thrown if parameters fail the va... | java | public OperationStatus deletePatterns(UUID appId, String versionId, List<UUID> patternIds) {
return deletePatternsWithServiceResponseAsync(appId, versionId, patternIds).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"deletePatterns",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"List",
"<",
"UUID",
">",
"patternIds",
")",
"{",
"return",
"deletePatternsWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"patternIds",
")",
".",... | Deletes the patterns with the specified IDs.
@param appId The application ID.
@param versionId The version ID.
@param patternIds The patterns IDs.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws RuntimeExceptio... | [
"Deletes",
"the",
"patterns",
"with",
"the",
"specified",
"IDs",
"."
] | 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/PatternsImpl.java#L568-L570 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java | Hierarchy.findXMethod | @Deprecated
public static @CheckForNull
XMethod findXMethod(JavaClass javaClass, String methodName, String methodSig, JavaClassAndMethodChooser chooser) {
"""
Find a method in given class.
@param javaClass
the class
@param methodName
the name of the method
@param methodSig
the signature of the meth... | java | @Deprecated
public static @CheckForNull
XMethod findXMethod(JavaClass javaClass, String methodName, String methodSig, JavaClassAndMethodChooser chooser) {
JavaClassAndMethod result = findMethod(javaClass, methodName, methodSig, chooser);
return result == null ? null : XFactory.createXMethod(resu... | [
"@",
"Deprecated",
"public",
"static",
"@",
"CheckForNull",
"XMethod",
"findXMethod",
"(",
"JavaClass",
"javaClass",
",",
"String",
"methodName",
",",
"String",
"methodSig",
",",
"JavaClassAndMethodChooser",
"chooser",
")",
"{",
"JavaClassAndMethod",
"result",
"=",
... | Find a method in given class.
@param javaClass
the class
@param methodName
the name of the method
@param methodSig
the signature of the method
@param chooser
the JavaClassAndMethodChooser to use to screen possible
candidates
@return the XMethod, or null if no such method exists in the class | [
"Find",
"a",
"method",
"in",
"given",
"class",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/Hierarchy.java#L534-L539 |
jpelzer/pelzer-util | src/main/java/com/pelzer/util/json/JSONUtil.java | JSONUtil.fromJSON | public static <T> T fromJSON(String json, Class<T> classOfT) {
"""
Deserializes the given JSON into an instance of the given class.
"""
return gson.fromJson(json, classOfT);
} | java | public static <T> T fromJSON(String json, Class<T> classOfT) {
return gson.fromJson(json, classOfT);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromJSON",
"(",
"String",
"json",
",",
"Class",
"<",
"T",
">",
"classOfT",
")",
"{",
"return",
"gson",
".",
"fromJson",
"(",
"json",
",",
"classOfT",
")",
";",
"}"
] | Deserializes the given JSON into an instance of the given class. | [
"Deserializes",
"the",
"given",
"JSON",
"into",
"an",
"instance",
"of",
"the",
"given",
"class",
"."
] | train | https://github.com/jpelzer/pelzer-util/blob/ec14f2573fd977d1442dba5d1507a264f5ea9aa6/src/main/java/com/pelzer/util/json/JSONUtil.java#L27-L29 |
looly/hutool | hutool-crypto/src/main/java/cn/hutool/crypto/BCUtil.java | BCUtil.decodeECPoint | public static PublicKey decodeECPoint(byte[] encodeByte, String curveName) {
"""
解码恢复EC压缩公钥,支持Base64和Hex编码,(基于BouncyCastle)<br>
见:https://www.cnblogs.com/xinzhao/p/8963724.html
@param encodeByte 压缩公钥
@param curveName EC曲线名,例如{@link KeyUtil#SM2_DEFAULT_CURVE}
@since 4.4.4
"""
final ECNamedCurveParamete... | java | public static PublicKey decodeECPoint(byte[] encodeByte, String curveName) {
final ECNamedCurveParameterSpec namedSpec = ECNamedCurveTable.getParameterSpec(curveName);
final ECCurve curve = namedSpec.getCurve();
final EllipticCurve ecCurve = new EllipticCurve(//
new ECFieldFp(curve.getField().getCharacter... | [
"public",
"static",
"PublicKey",
"decodeECPoint",
"(",
"byte",
"[",
"]",
"encodeByte",
",",
"String",
"curveName",
")",
"{",
"final",
"ECNamedCurveParameterSpec",
"namedSpec",
"=",
"ECNamedCurveTable",
".",
"getParameterSpec",
"(",
"curveName",
")",
";",
"final",
... | 解码恢复EC压缩公钥,支持Base64和Hex编码,(基于BouncyCastle)<br>
见:https://www.cnblogs.com/xinzhao/p/8963724.html
@param encodeByte 压缩公钥
@param curveName EC曲线名,例如{@link KeyUtil#SM2_DEFAULT_CURVE}
@since 4.4.4 | [
"解码恢复EC压缩公钥",
"支持Base64和Hex编码",
"(基于BouncyCastle)<br",
">",
"见:https",
":",
"//",
"www",
".",
"cnblogs",
".",
"com",
"/",
"xinzhao",
"/",
"p",
"/",
"8963724",
".",
"html"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-crypto/src/main/java/cn/hutool/crypto/BCUtil.java#L70-L89 |
integration-technology/amazon-mws-orders | src/main/java/com/amazonservices/mws/client/MwsUtl.java | MwsUtl.getEnumValue | @SuppressWarnings("unchecked")
static <T> T getEnumValue(Class<T> cls, String name) {
"""
Gets an enum instance from the enum class and name.
<p>
Caches hashmaps of enum names. If enum has an Other entry it will be
returned instead of null when no match is found.
@param cls
@param name
@return The fo... | java | @SuppressWarnings("unchecked")
static <T> T getEnumValue(Class<T> cls, String name) {
HashMap<String, Object> enumMap = enumMaps.get(cls);
if (enumMap == null) {
T[] consts = cls.getEnumConstants();
enumMap = new HashMap<String, Object>(consts.length);
for (T e : ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"static",
"<",
"T",
">",
"T",
"getEnumValue",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"String",
"name",
")",
"{",
"HashMap",
"<",
"String",
",",
"Object",
">",
"enumMap",
"=",
"enumMaps",
".",
"get",... | Gets an enum instance from the enum class and name.
<p>
Caches hashmaps of enum names. If enum has an Other entry it will be
returned instead of null when no match is found.
@param cls
@param name
@return The found instance. | [
"Gets",
"an",
"enum",
"instance",
"from",
"the",
"enum",
"class",
"and",
"name",
".",
"<p",
">",
"Caches",
"hashmaps",
"of",
"enum",
"names",
".",
"If",
"enum",
"has",
"an",
"Other",
"entry",
"it",
"will",
"be",
"returned",
"instead",
"of",
"null",
"wh... | train | https://github.com/integration-technology/amazon-mws-orders/blob/042e8cd5b10588a30150222bf9c91faf4f130b3c/src/main/java/com/amazonservices/mws/client/MwsUtl.java#L326-L342 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java | KeyMap.put | public final V put(K key, V value) {
"""
Inserts the given value, mapped under the given key. If the table already contains a value for
the key, the value is replaced and returned. If no value is contained, yet, the function
returns null.
@param key The key to insert.
@param value The value to insert.
@retu... | java | public final V put(K key, V value) {
final int hash = hash(key);
final int slot = indexOf (hash);
// search the chain from the slot
for (Entry<K, V> e = table[slot]; e != null; e = e.next) {
Object k;
if (e.hashCode == hash && ((k = e.key) == key || key.equals(k))) {
// found match
V old = e.valu... | [
"public",
"final",
"V",
"put",
"(",
"K",
"key",
",",
"V",
"value",
")",
"{",
"final",
"int",
"hash",
"=",
"hash",
"(",
"key",
")",
";",
"final",
"int",
"slot",
"=",
"indexOf",
"(",
"hash",
")",
";",
"// search the chain from the slot",
"for",
"(",
"E... | Inserts the given value, mapped under the given key. If the table already contains a value for
the key, the value is replaced and returned. If no value is contained, yet, the function
returns null.
@param key The key to insert.
@param value The value to insert.
@return The previously mapped value for the key, or null,... | [
"Inserts",
"the",
"given",
"value",
"mapped",
"under",
"the",
"given",
"key",
".",
"If",
"the",
"table",
"already",
"contains",
"a",
"value",
"for",
"the",
"key",
"the",
"value",
"is",
"replaced",
"and",
"returned",
".",
"If",
"no",
"value",
"is",
"conta... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/runtime/operators/windowing/KeyMap.java#L123-L141 |
aws/aws-sdk-java | aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java | AmazonKinesisVideoPutMediaClient.getSslContext | private SslContext getSslContext(URI uri) {
"""
Create an {@link javax.net.ssl.SSLContext} for the Netty Bootstrap.
@param uri URI of request.
@return Null if not over SSL, otherwise configured {@link javax.net.ssl.SSLContext} to use.
"""
if (!"https".equalsIgnoreCase(uri.getScheme())) {
... | java | private SslContext getSslContext(URI uri) {
if (!"https".equalsIgnoreCase(uri.getScheme())) {
return null;
}
try {
return SslContextBuilder.forClient().build();
} catch (SSLException e) {
throw new SdkClientException("Could not create SSL context", e);... | [
"private",
"SslContext",
"getSslContext",
"(",
"URI",
"uri",
")",
"{",
"if",
"(",
"!",
"\"https\"",
".",
"equalsIgnoreCase",
"(",
"uri",
".",
"getScheme",
"(",
")",
")",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
"return",
"SslContextBuilder",
"."... | Create an {@link javax.net.ssl.SSLContext} for the Netty Bootstrap.
@param uri URI of request.
@return Null if not over SSL, otherwise configured {@link javax.net.ssl.SSLContext} to use. | [
"Create",
"an",
"{",
"@link",
"javax",
".",
"net",
".",
"ssl",
".",
"SSLContext",
"}",
"for",
"the",
"Netty",
"Bootstrap",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-kinesisvideo/src/main/java/com/amazonaws/services/kinesisvideo/AmazonKinesisVideoPutMediaClient.java#L209-L218 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/internal/Utils.java | Utils.assertNotNull | @NonNull
public static <T> T assertNotNull(T object, String item) {
"""
Throws a {@link NullPointerException} if the given object is null.
"""
if (object == null) {
throw new NullPointerException(item + " == null");
}
return object;
} | java | @NonNull
public static <T> T assertNotNull(T object, String item) {
if (object == null) {
throw new NullPointerException(item + " == null");
}
return object;
} | [
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"T",
"assertNotNull",
"(",
"T",
"object",
",",
"String",
"item",
")",
"{",
"if",
"(",
"object",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"item",
"+",
"\" == null\"",
")",
";... | Throws a {@link NullPointerException} if the given object is null. | [
"Throws",
"a",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/internal/Utils.java#L227-L233 |
sarl/sarl | main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java | SarlDocumentationParser.extractDynamicName | protected void extractDynamicName(Tag tag, CharSequence name, OutParameter<String> dynamicName) {
"""
Extract the dynamic name of that from the raw text.
@param tag the tag to extract for.
@param name the raw text.
@param dynamicName the dynamic name.
"""
if (tag.hasDynamicName()) {
final Pattern p... | java | protected void extractDynamicName(Tag tag, CharSequence name, OutParameter<String> dynamicName) {
if (tag.hasDynamicName()) {
final Pattern pattern = Pattern.compile(getDynamicNameExtractionPattern());
final Matcher matcher = pattern.matcher(name);
if (matcher.matches()) {
dynamicName.set(Strings.nu... | [
"protected",
"void",
"extractDynamicName",
"(",
"Tag",
"tag",
",",
"CharSequence",
"name",
",",
"OutParameter",
"<",
"String",
">",
"dynamicName",
")",
"{",
"if",
"(",
"tag",
".",
"hasDynamicName",
"(",
")",
")",
"{",
"final",
"Pattern",
"pattern",
"=",
"P... | Extract the dynamic name of that from the raw text.
@param tag the tag to extract for.
@param name the raw text.
@param dynamicName the dynamic name. | [
"Extract",
"the",
"dynamic",
"name",
"of",
"that",
"from",
"the",
"raw",
"text",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/externalmaven/io.sarl.maven.docs.generator/src/main/java/io/sarl/maven/docs/parser/SarlDocumentationParser.java#L621-L631 |
ocelotds/ocelot | ocelot-web/src/main/java/org/ocelotds/topic/TopicsMessagesBroadcaster.java | TopicsMessagesBroadcaster.sendMessageToTopic | public int sendMessageToTopic(Collection<Session> sessionTargets, MessageToClient mtc, Object payload) {
"""
Send message to all sessions for topic mtc.getId() and intersection of sessionTargets
return number sended
@param sessionTargets
@param mtc
@param payload
@return
"""
int sended = 0;
logger.d... | java | public int sendMessageToTopic(Collection<Session> sessionTargets, MessageToClient mtc, Object payload) {
int sended = 0;
logger.debug("Sending message to topic {}...", mtc);
Collection<Session> doublons = topicManager.getSessionsForTopic(mtc.getId());
if (doublons != null && !doublons.isEmpty()) {
Set<S... | [
"public",
"int",
"sendMessageToTopic",
"(",
"Collection",
"<",
"Session",
">",
"sessionTargets",
",",
"MessageToClient",
"mtc",
",",
"Object",
"payload",
")",
"{",
"int",
"sended",
"=",
"0",
";",
"logger",
".",
"debug",
"(",
"\"Sending message to topic {}...\"",
... | Send message to all sessions for topic mtc.getId() and intersection of sessionTargets
return number sended
@param sessionTargets
@param mtc
@param payload
@return | [
"Send",
"message",
"to",
"all",
"sessions",
"for",
"topic",
"mtc",
".",
"getId",
"()",
"and",
"intersection",
"of",
"sessionTargets",
"return",
"number",
"sended"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-web/src/main/java/org/ocelotds/topic/TopicsMessagesBroadcaster.java#L62-L76 |
DV8FromTheWorld/JDA | src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java | PermissionUtil.canInteract | public static boolean canInteract(Role issuer, Role target) {
"""
Checks if one given Role can interact with a 2nd given Role - in a permission sense (kick/ban/modify perms).
This only checks the Role-Position and does not check the actual permission (kick/ban/manage_role/...)
@param issuer
The role that tri... | java | public static boolean canInteract(Role issuer, Role target)
{
Checks.notNull(issuer, "Issuer Role");
Checks.notNull(target, "Target Role");
if(!issuer.getGuild().equals(target.getGuild()))
throw new IllegalArgumentException("The 2 Roles are not from same Guild!");
return... | [
"public",
"static",
"boolean",
"canInteract",
"(",
"Role",
"issuer",
",",
"Role",
"target",
")",
"{",
"Checks",
".",
"notNull",
"(",
"issuer",
",",
"\"Issuer Role\"",
")",
";",
"Checks",
".",
"notNull",
"(",
"target",
",",
"\"Target Role\"",
")",
";",
"if"... | Checks if one given Role can interact with a 2nd given Role - in a permission sense (kick/ban/modify perms).
This only checks the Role-Position and does not check the actual permission (kick/ban/manage_role/...)
@param issuer
The role that tries to interact with 2nd role
@param target
The role that is the target of ... | [
"Checks",
"if",
"one",
"given",
"Role",
"can",
"interact",
"with",
"a",
"2nd",
"given",
"Role",
"-",
"in",
"a",
"permission",
"sense",
"(",
"kick",
"/",
"ban",
"/",
"modify",
"perms",
")",
".",
"This",
"only",
"checks",
"the",
"Role",
"-",
"Position",
... | train | https://github.com/DV8FromTheWorld/JDA/blob/8ecbbe354d03f6bf448411bba573d0d4c268b560/src/main/java/net/dv8tion/jda/core/utils/PermissionUtil.java#L104-L112 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/LogQueryBean.java | LogQueryBean.setTime | public void setTime(Date minTime, Date maxTime) throws IllegalArgumentException {
"""
sets the current value for the minimum and maximum time
@param minTime minimum time
@param maxTime maximum time
@throws IllegalArgumentException if minTime is later than maxTime
"""
if (minTime != null && maxTime... | java | public void setTime(Date minTime, Date maxTime) throws IllegalArgumentException {
if (minTime != null && maxTime != null && minTime.after(maxTime)) {
throw new IllegalArgumentException("Value of the minTime parameter should specify time before the time specified by the value of the maxTime parameter... | [
"public",
"void",
"setTime",
"(",
"Date",
"minTime",
",",
"Date",
"maxTime",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"minTime",
"!=",
"null",
"&&",
"maxTime",
"!=",
"null",
"&&",
"minTime",
".",
"after",
"(",
"maxTime",
")",
")",
"{",
... | sets the current value for the minimum and maximum time
@param minTime minimum time
@param maxTime maximum time
@throws IllegalArgumentException if minTime is later than maxTime | [
"sets",
"the",
"current",
"value",
"for",
"the",
"minimum",
"and",
"maximum",
"time"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/LogQueryBean.java#L70-L76 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ExpressRouteLinksInner.java | ExpressRouteLinksInner.getAsync | public Observable<ExpressRouteLinkInner> getAsync(String resourceGroupName, String expressRoutePortName, String linkName) {
"""
Retrieves the specified ExpressRouteLink resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@pa... | java | public Observable<ExpressRouteLinkInner> getAsync(String resourceGroupName, String expressRoutePortName, String linkName) {
return getWithServiceResponseAsync(resourceGroupName, expressRoutePortName, linkName).map(new Func1<ServiceResponse<ExpressRouteLinkInner>, ExpressRouteLinkInner>() {
@Override... | [
"public",
"Observable",
"<",
"ExpressRouteLinkInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"expressRoutePortName",
",",
"String",
"linkName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"expressRoutePort... | Retrieves the specified ExpressRouteLink resource.
@param resourceGroupName The name of the resource group.
@param expressRoutePortName The name of the ExpressRoutePort resource.
@param linkName The name of the ExpressRouteLink resource.
@throws IllegalArgumentException thrown if parameters fail the validation
@return... | [
"Retrieves",
"the",
"specified",
"ExpressRouteLink",
"resource",
"."
] | 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/ExpressRouteLinksInner.java#L112-L119 |
grycap/coreutils | coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java | Http2Client.asyncPut | public void asyncPut(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) {
"""
Puts data to a server via a HTTP PUT request.
@param url - URL target of this request
@param mediaType - Content-Type header for this request
@param supplier - supplies the content of t... | java | public void asyncPut(final String url, final String mediaType, final Supplier<String> supplier, final Callback callback) {
requireNonNull(supplier, "A valid supplier expected");
asyncPutBytes(url, mediaType, () -> ofNullable(supplier.get()).orElse("").getBytes(), callback);
} | [
"public",
"void",
"asyncPut",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"mediaType",
",",
"final",
"Supplier",
"<",
"String",
">",
"supplier",
",",
"final",
"Callback",
"callback",
")",
"{",
"requireNonNull",
"(",
"supplier",
",",
"\"A valid suppl... | Puts data to a server via a HTTP PUT request.
@param url - URL target of this request
@param mediaType - Content-Type header for this request
@param supplier - supplies the content of this request
@param callback - is called back when the response is readable | [
"Puts",
"data",
"to",
"a",
"server",
"via",
"a",
"HTTP",
"PUT",
"request",
"."
] | train | https://github.com/grycap/coreutils/blob/e6db61dc50b49ea7276c0c29c7401204681a10c2/coreutils-fiber/src/main/java/es/upv/grycap/coreutils/fiber/http/Http2Client.java#L153-L156 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java | SVGAndroidRenderer.enumerateTextSpans | private void enumerateTextSpans(TextContainer obj, TextProcessor textprocessor) {
"""
/*
Given a text container, recursively visit its children invoking the TextDrawer
handler for each segment of text found.
"""
if (!display())
return;
Iterator<SvgObject> iter = obj.children.iterat... | java | private void enumerateTextSpans(TextContainer obj, TextProcessor textprocessor)
{
if (!display())
return;
Iterator<SvgObject> iter = obj.children.iterator();
boolean isFirstChild = true;
while (iter.hasNext())
{
SvgObject child = iter.next();... | [
"private",
"void",
"enumerateTextSpans",
"(",
"TextContainer",
"obj",
",",
"TextProcessor",
"textprocessor",
")",
"{",
"if",
"(",
"!",
"display",
"(",
")",
")",
"return",
";",
"Iterator",
"<",
"SvgObject",
">",
"iter",
"=",
"obj",
".",
"children",
".",
"it... | /*
Given a text container, recursively visit its children invoking the TextDrawer
handler for each segment of text found. | [
"/",
"*",
"Given",
"a",
"text",
"container",
"recursively",
"visit",
"its",
"children",
"invoking",
"the",
"TextDrawer",
"handler",
"for",
"each",
"segment",
"of",
"text",
"found",
"."
] | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVGAndroidRenderer.java#L1515-L1534 |
aws/aws-sdk-java | aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java | Hit.withExprs | public Hit withExprs(java.util.Map<String, String> exprs) {
"""
<p>
The expressions returned from a document that matches the search request.
</p>
@param exprs
The expressions returned from a document that matches the search request.
@return Returns a reference to this object so that method calls can be cha... | java | public Hit withExprs(java.util.Map<String, String> exprs) {
setExprs(exprs);
return this;
} | [
"public",
"Hit",
"withExprs",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"exprs",
")",
"{",
"setExprs",
"(",
"exprs",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The expressions returned from a document that matches the search request.
</p>
@param exprs
The expressions returned from a document that matches the search request.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"expressions",
"returned",
"from",
"a",
"document",
"that",
"matches",
"the",
"search",
"request",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-cloudsearch/src/main/java/com/amazonaws/services/cloudsearchdomain/model/Hit.java#L195-L198 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/ControlAnnotationProcessor.java | ControlAnnotationProcessor.getGenerator | protected CodeGenerator getGenerator() {
"""
Returns the CodeGenerator instance supporting this processor, instantiating a new
generator instance if necessary.
"""
if (_generator == null)
{
//
// Locate the class that wraps the Velocity code generation process
... | java | protected CodeGenerator getGenerator()
{
if (_generator == null)
{
//
// Locate the class that wraps the Velocity code generation process
//
AnnotationProcessorEnvironment env = getAnnotationProcessorEnvironment();
try
{
... | [
"protected",
"CodeGenerator",
"getGenerator",
"(",
")",
"{",
"if",
"(",
"_generator",
"==",
"null",
")",
"{",
"//",
"// Locate the class that wraps the Velocity code generation process",
"//",
"AnnotationProcessorEnvironment",
"env",
"=",
"getAnnotationProcessorEnvironment",
... | Returns the CodeGenerator instance supporting this processor, instantiating a new
generator instance if necessary. | [
"Returns",
"the",
"CodeGenerator",
"instance",
"supporting",
"this",
"processor",
"instantiating",
"a",
"new",
"generator",
"instance",
"if",
"necessary",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/apt/ControlAnnotationProcessor.java#L143-L162 |
kirgor/enklib | rest/src/main/java/com/kirgor/enklib/rest/RESTClient.java | RESTClient.putWithListResult | public <T> EntityResponse<List<T>> putWithListResult(Class<T> entityClass, String path) throws IOException, RESTException {
"""
Performs PUT request, while expected response entity is a list of specified type.
@param entityClass Class, which contains expected response entity fields.
@param path Request ... | java | public <T> EntityResponse<List<T>> putWithListResult(Class<T> entityClass, String path) throws IOException, RESTException {
return putWithListResult(entityClass, path, null, null);
} | [
"public",
"<",
"T",
">",
"EntityResponse",
"<",
"List",
"<",
"T",
">",
">",
"putWithListResult",
"(",
"Class",
"<",
"T",
">",
"entityClass",
",",
"String",
"path",
")",
"throws",
"IOException",
",",
"RESTException",
"{",
"return",
"putWithListResult",
"(",
... | Performs PUT request, while expected response entity is a list of specified type.
@param entityClass Class, which contains expected response entity fields.
@param path Request path.
@param <T> Type of class, which contains expected response entity fields.
@throws IOException If error during HTTP conne... | [
"Performs",
"PUT",
"request",
"while",
"expected",
"response",
"entity",
"is",
"a",
"list",
"of",
"specified",
"type",
"."
] | train | https://github.com/kirgor/enklib/blob/8a24db296dc43db5d8fe509cf64ace0a0c7be8f2/rest/src/main/java/com/kirgor/enklib/rest/RESTClient.java#L443-L445 |
kiegroup/jbpm | jbpm-services/jbpm-executor/src/main/java/org/jbpm/executor/impl/ClassCacheManager.java | ClassCacheManager.findCommandCallback | public CommandCallback findCommandCallback(String name, ClassLoader cl) {
"""
Finds command callback by FQCN and if not found loads the class and store the instance in
the cache.
@param name - fully qualified class name of the command callback
@return initialized class instance
"""
synchronized (cal... | java | public CommandCallback findCommandCallback(String name, ClassLoader cl) {
synchronized (callbackCache) {
if (!callbackCache.containsKey(name)) {
try {
CommandCallback commandCallbackInstance = (CommandCallback) Class.forName(name, true, cl).newInstanc... | [
"public",
"CommandCallback",
"findCommandCallback",
"(",
"String",
"name",
",",
"ClassLoader",
"cl",
")",
"{",
"synchronized",
"(",
"callbackCache",
")",
"{",
"if",
"(",
"!",
"callbackCache",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"try",
"{",
"Comma... | Finds command callback by FQCN and if not found loads the class and store the instance in
the cache.
@param name - fully qualified class name of the command callback
@return initialized class instance | [
"Finds",
"command",
"callback",
"by",
"FQCN",
"and",
"if",
"not",
"found",
"loads",
"the",
"class",
"and",
"store",
"the",
"instance",
"in",
"the",
"cache",
"."
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-services/jbpm-executor/src/main/java/org/jbpm/executor/impl/ClassCacheManager.java#L87-L114 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/ApplicationImpl.java | ApplicationImpl.createConverter | @Override
public final Converter createConverter(final String converterId) {
"""
Return an instance of the converter class that has been registered under the specified id.
<p>
Converters are registered via faces-config.xml files, and can also be registered via the addConverter(String id,
Class converterClas... | java | @Override
public final Converter createConverter(final String converterId)
{
checkNull(converterId, "converterId");
checkEmpty(converterId, "converterId");
final Class<? extends Converter> converterClass =
getObjectFromClassMap(converterId, _converterIdToClassMap);
... | [
"@",
"Override",
"public",
"final",
"Converter",
"createConverter",
"(",
"final",
"String",
"converterId",
")",
"{",
"checkNull",
"(",
"converterId",
",",
"\"converterId\"",
")",
";",
"checkEmpty",
"(",
"converterId",
",",
"\"converterId\"",
")",
";",
"final",
"... | Return an instance of the converter class that has been registered under the specified id.
<p>
Converters are registered via faces-config.xml files, and can also be registered via the addConverter(String id,
Class converterClass) method on this class. Here the the appropriate Class definition is found, then an instance... | [
"Return",
"an",
"instance",
"of",
"the",
"converter",
"class",
"that",
"has",
"been",
"registered",
"under",
"the",
"specified",
"id",
".",
"<p",
">",
"Converters",
"are",
"registered",
"via",
"faces",
"-",
"config",
".",
"xml",
"files",
"and",
"can",
"als... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/application/ApplicationImpl.java#L1550-L1578 |
jbundle/jbundle | base/model/src/main/java/org/jbundle/base/model/Utility.java | Utility.replaceResources | public static String replaceResources(String string, ResourceBundle reg, Map<String, Object> map, PropertyOwner propertyOwner) {
"""
Replace the {} resources in this string.
@param reg
@param map A map of key/values
@param strResource
@return
"""
return Utility.replaceResources(string, reg, map, pr... | java | public static String replaceResources(String string, ResourceBundle reg, Map<String, Object> map, PropertyOwner propertyOwner)
{
return Utility.replaceResources(string, reg, map, propertyOwner, false);
} | [
"public",
"static",
"String",
"replaceResources",
"(",
"String",
"string",
",",
"ResourceBundle",
"reg",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"PropertyOwner",
"propertyOwner",
")",
"{",
"return",
"Utility",
".",
"replaceResources",
"(",
"... | Replace the {} resources in this string.
@param reg
@param map A map of key/values
@param strResource
@return | [
"Replace",
"the",
"{}",
"resources",
"in",
"this",
"string",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/model/src/main/java/org/jbundle/base/model/Utility.java#L291-L294 |
phax/ph-commons | ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java | JAXBMarshallerHelper.setFormattedOutput | public static void setFormattedOutput (@Nonnull final Marshaller aMarshaller, final boolean bFormattedOutput) {
"""
Set the standard property for formatting the output or not.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param bFormattedOutput
the value to be set
... | java | public static void setFormattedOutput (@Nonnull final Marshaller aMarshaller, final boolean bFormattedOutput)
{
_setProperty (aMarshaller, Marshaller.JAXB_FORMATTED_OUTPUT, Boolean.valueOf (bFormattedOutput));
} | [
"public",
"static",
"void",
"setFormattedOutput",
"(",
"@",
"Nonnull",
"final",
"Marshaller",
"aMarshaller",
",",
"final",
"boolean",
"bFormattedOutput",
")",
"{",
"_setProperty",
"(",
"aMarshaller",
",",
"Marshaller",
".",
"JAXB_FORMATTED_OUTPUT",
",",
"Boolean",
"... | Set the standard property for formatting the output or not.
@param aMarshaller
The marshaller to set the property. May not be <code>null</code>.
@param bFormattedOutput
the value to be set | [
"Set",
"the",
"standard",
"property",
"for",
"formatting",
"the",
"output",
"or",
"not",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-jaxb/src/main/java/com/helger/jaxb/JAXBMarshallerHelper.java#L130-L133 |
opentok/Opentok-Java-SDK | src/main/java/com/opentok/OpenTok.java | OpenTok.forceDisconnect | public void forceDisconnect(String sessionId, String connectionId) throws OpenTokException , InvalidArgumentException, RequestException {
"""
Disconnect a client from an OpenTok session
<p>
Use this API to forcibly terminate a connection of a session.
@param sessionId The session ID of the connection
@param ... | java | public void forceDisconnect(String sessionId, String connectionId) throws OpenTokException , InvalidArgumentException, RequestException {
if (sessionId == null || sessionId.isEmpty() || connectionId == null || connectionId.isEmpty()) {
throw new InvalidArgumentException("Session or Connection string... | [
"public",
"void",
"forceDisconnect",
"(",
"String",
"sessionId",
",",
"String",
"connectionId",
")",
"throws",
"OpenTokException",
",",
"InvalidArgumentException",
",",
"RequestException",
"{",
"if",
"(",
"sessionId",
"==",
"null",
"||",
"sessionId",
".",
"isEmpty",... | Disconnect a client from an OpenTok session
<p>
Use this API to forcibly terminate a connection of a session.
@param sessionId The session ID of the connection
@param connectionId The connection ID to disconnect | [
"Disconnect",
"a",
"client",
"from",
"an",
"OpenTok",
"session",
"<p",
">",
"Use",
"this",
"API",
"to",
"forcibly",
"terminate",
"a",
"connection",
"of",
"a",
"session",
"."
] | train | https://github.com/opentok/Opentok-Java-SDK/blob/d71b7999facc3131c415aebea874ea55776d477f/src/main/java/com/opentok/OpenTok.java#L633-L644 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java | JobScheduleOperations.getJobSchedule | public CloudJobSchedule getJobSchedule(String jobScheduleId) throws BatchErrorException, IOException {
"""
Gets the specified {@link CloudJobSchedule}.
@param jobScheduleId The ID of the job schedule.
@return A {@link CloudJobSchedule} containing information about the specified Azure Batch job schedule.
@thro... | java | public CloudJobSchedule getJobSchedule(String jobScheduleId) throws BatchErrorException, IOException {
return getJobSchedule(jobScheduleId, null, null);
} | [
"public",
"CloudJobSchedule",
"getJobSchedule",
"(",
"String",
"jobScheduleId",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"return",
"getJobSchedule",
"(",
"jobScheduleId",
",",
"null",
",",
"null",
")",
";",
"}"
] | Gets the specified {@link CloudJobSchedule}.
@param jobScheduleId The ID of the job schedule.
@return A {@link CloudJobSchedule} containing information about the specified Azure Batch job schedule.
@throws BatchErrorException Exception thrown when an error response is received from the Batch service.
@throws IOExcepti... | [
"Gets",
"the",
"specified",
"{",
"@link",
"CloudJobSchedule",
"}",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/JobScheduleOperations.java#L132-L134 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jbatch.cdi/src/com/ibm/ws/jbatch/cdi/internal/CDIBatchArtifactFactoryImpl.java | CDIBatchArtifactFactoryImpl.getUniqueBeanForBatchXMLEntry | @FFDCIgnore(BatchCDIAmbiguousResolutionCheckedException.class)
protected Bean<?> getUniqueBeanForBatchXMLEntry(BeanManager bm, String batchId) {
"""
Use the given BeanManager to lookup a unique CDI-registered bean
with bean class equal to the batch.xml entry mapped to be the batchId parameter
@return the b... | java | @FFDCIgnore(BatchCDIAmbiguousResolutionCheckedException.class)
protected Bean<?> getUniqueBeanForBatchXMLEntry(BeanManager bm, String batchId) {
ClassLoader loader = getContextClassLoader();
BatchXMLMapper batchXMLMapper = new BatchXMLMapper(loader);
Class<?> clazz = batchXMLMapper.getArtifa... | [
"@",
"FFDCIgnore",
"(",
"BatchCDIAmbiguousResolutionCheckedException",
".",
"class",
")",
"protected",
"Bean",
"<",
"?",
">",
"getUniqueBeanForBatchXMLEntry",
"(",
"BeanManager",
"bm",
",",
"String",
"batchId",
")",
"{",
"ClassLoader",
"loader",
"=",
"getContextClassL... | Use the given BeanManager to lookup a unique CDI-registered bean
with bean class equal to the batch.xml entry mapped to be the batchId parameter
@return the bean with the given className. It returns null if there are zero matches or if there is no umabiguous resolution (i.e. more than 1 match) | [
"Use",
"the",
"given",
"BeanManager",
"to",
"lookup",
"a",
"unique",
"CDI",
"-",
"registered",
"bean",
"with",
"bean",
"class",
"equal",
"to",
"the",
"batch",
".",
"xml",
"entry",
"mapped",
"to",
"be",
"the",
"batchId",
"parameter"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jbatch.cdi/src/com/ibm/ws/jbatch/cdi/internal/CDIBatchArtifactFactoryImpl.java#L154-L171 |
mp911de/visualizr | visualizr-metrics/src/main/java/biz/paluch/visualizr/metrics/VisualizrReporter.java | VisualizrReporter.reportHistogram | private void reportHistogram(String name, Histogram histogram) {
"""
Report a histogram using fields max/mean/min/stddev,p50/p75/p95/p98/p99/p999/count
@param name
@param histogram
"""
final Snapshot snapshot = histogram.getSnapshot();
String prefixedName = prefix(name);
if (!snapsh... | java | private void reportHistogram(String name, Histogram histogram) {
final Snapshot snapshot = histogram.getSnapshot();
String prefixedName = prefix(name);
if (!snapshots.hasDescriptor(prefixedName)) {
MetricItem.Builder builder = MetricItem.Builder.create();
builder.count("... | [
"private",
"void",
"reportHistogram",
"(",
"String",
"name",
",",
"Histogram",
"histogram",
")",
"{",
"final",
"Snapshot",
"snapshot",
"=",
"histogram",
".",
"getSnapshot",
"(",
")",
";",
"String",
"prefixedName",
"=",
"prefix",
"(",
"name",
")",
";",
"if",
... | Report a histogram using fields max/mean/min/stddev,p50/p75/p95/p98/p99/p999/count
@param name
@param histogram | [
"Report",
"a",
"histogram",
"using",
"fields",
"max",
"/",
"mean",
"/",
"min",
"/",
"stddev",
"p50",
"/",
"p75",
"/",
"p95",
"/",
"p98",
"/",
"p99",
"/",
"p999",
"/",
"count"
] | train | https://github.com/mp911de/visualizr/blob/57206391692e88b2c59d52d4f18faa4cdfd32a98/visualizr-metrics/src/main/java/biz/paluch/visualizr/metrics/VisualizrReporter.java#L170-L208 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/yaml/YamlUtil.java | YamlUtil.asType | @SuppressWarnings("unchecked")
public static <T> T asType(YamlNode node, Class<T> type) {
"""
Takes a generic {@link YamlNode} instance and returns it casted to
the provided {@code type} if the node is an instance of that type.
@param node The generic node to cast
@return the casted node
@throws YamlExce... | java | @SuppressWarnings("unchecked")
public static <T> T asType(YamlNode node, Class<T> type) {
if (node != null && !type.isAssignableFrom(node.getClass())) {
String nodeName = node.nodeName();
throw new YamlException(String.format("Child %s is not a %s, it's actual type is %s", nodeName, ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"asType",
"(",
"YamlNode",
"node",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"if",
"(",
"node",
"!=",
"null",
"&&",
"!",
"type",
".",
"isAssignableFrom",
... | Takes a generic {@link YamlNode} instance and returns it casted to
the provided {@code type} if the node is an instance of that type.
@param node The generic node to cast
@return the casted node
@throws YamlException if the provided node is not the expected type | [
"Takes",
"a",
"generic",
"{",
"@link",
"YamlNode",
"}",
"instance",
"and",
"returns",
"it",
"casted",
"to",
"the",
"provided",
"{",
"@code",
"type",
"}",
"if",
"the",
"node",
"is",
"an",
"instance",
"of",
"that",
"type",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/yaml/YamlUtil.java#L94-L102 |
super-csv/super-csv | super-csv/src/main/java/org/supercsv/cellprocessor/constraint/UniqueHashCode.java | UniqueHashCode.execute | public Object execute(final Object value, final CsvContext context) {
"""
{@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null
@throws SuperCsvConstraintViolationException
if a non-unique value is encountered
"""
validateInputNotNull(value, context);
int hash = value.hashCode();
... | java | public Object execute(final Object value, final CsvContext context) {
validateInputNotNull(value, context);
int hash = value.hashCode();
if( !uniqueSet.add(hash) ) {
throw new SuperCsvConstraintViolationException(
String.format("duplicate value '%s' encountered with hashcode %d", value, hash), context, ... | [
"public",
"Object",
"execute",
"(",
"final",
"Object",
"value",
",",
"final",
"CsvContext",
"context",
")",
"{",
"validateInputNotNull",
"(",
"value",
",",
"context",
")",
";",
"int",
"hash",
"=",
"value",
".",
"hashCode",
"(",
")",
";",
"if",
"(",
"!",
... | {@inheritDoc}
@throws SuperCsvCellProcessorException
if value is null
@throws SuperCsvConstraintViolationException
if a non-unique value is encountered | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/super-csv/super-csv/blob/f18db724674dc1c4116e25142c1b5403ebf43e96/super-csv/src/main/java/org/supercsv/cellprocessor/constraint/UniqueHashCode.java#L72-L82 |
ixa-ehu/ixa-pipe-pos | src/main/java/eus/ixa/ixa/pipe/pos/Resources.java | Resources.getBinaryTaggerDict | public final URL getBinaryTaggerDict(final String lang, final String resourcesDirectory) {
"""
The the dictionary for the {@code MorfologikMorphoTagger}.
@param lang
the language
@param resourcesDirectory
the directory where the dictionary can be found.
If {@code null}, load from package resources.
@return... | java | public final URL getBinaryTaggerDict(final String lang, final String resourcesDirectory) {
return resourcesDirectory == null
? getBinaryTaggerDictFromResources(lang)
: getBinaryTaggerDictFromDirectory(lang, resourcesDirectory);
} | [
"public",
"final",
"URL",
"getBinaryTaggerDict",
"(",
"final",
"String",
"lang",
",",
"final",
"String",
"resourcesDirectory",
")",
"{",
"return",
"resourcesDirectory",
"==",
"null",
"?",
"getBinaryTaggerDictFromResources",
"(",
"lang",
")",
":",
"getBinaryTaggerDictF... | The the dictionary for the {@code MorfologikMorphoTagger}.
@param lang
the language
@param resourcesDirectory
the directory where the dictionary can be found.
If {@code null}, load from package resources.
@return the URL of the dictionary | [
"The",
"the",
"dictionary",
"for",
"the",
"{",
"@code",
"MorfologikMorphoTagger",
"}",
"."
] | train | https://github.com/ixa-ehu/ixa-pipe-pos/blob/083c986103f95ae8063b8ddc89a2caa8047d29b9/src/main/java/eus/ixa/ixa/pipe/pos/Resources.java#L117-L121 |
camunda/camunda-commons | logging/src/main/java/org/camunda/commons/logging/BaseLogger.java | BaseLogger.logWarn | protected void logWarn(String id, String messageTemplate, Object... parameters) {
"""
Logs an 'WARN' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters
"""
if(delegateLogger.isWarnEnabled()) {
Str... | java | protected void logWarn(String id, String messageTemplate, Object... parameters) {
if(delegateLogger.isWarnEnabled()) {
String msg = formatMessageTemplate(id, messageTemplate);
delegateLogger.warn(msg, parameters);
}
} | [
"protected",
"void",
"logWarn",
"(",
"String",
"id",
",",
"String",
"messageTemplate",
",",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"delegateLogger",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"String",
"msg",
"=",
"formatMessageTemplate",
"(",
"i... | Logs an 'WARN' message
@param id the unique id of this log message
@param messageTemplate the message template to use
@param parameters a list of optional parameters | [
"Logs",
"an",
"WARN",
"message"
] | train | https://github.com/camunda/camunda-commons/blob/bd3195db47c92c25717288fe9e6735f8e882f247/logging/src/main/java/org/camunda/commons/logging/BaseLogger.java#L143-L148 |
jbundle/jbundle | base/db/xml/src/main/java/org/jbundle/base/db/xml/XTable.java | XTable.writeData | public void writeData(FieldTable table) throws Exception {
"""
Write the data.
If this is the last copy being closed, write the XML data to the file.
<p />Notice I flush on close, rather than free, so the record object is
still usable - This will create a performance problem for tasks that are
processing the f... | java | public void writeData(FieldTable table) throws Exception
{
if (this.getLookupKey() instanceof String)
{
FieldList record = table.getRecord();
/** Write a tree object, and all the subtrees */
String strFilePath = (String)this.getLookupKey();
String strF... | [
"public",
"void",
"writeData",
"(",
"FieldTable",
"table",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"getLookupKey",
"(",
")",
"instanceof",
"String",
")",
"{",
"FieldList",
"record",
"=",
"table",
".",
"getRecord",
"(",
")",
";",
"/** Write... | Write the data.
If this is the last copy being closed, write the XML data to the file.
<p />Notice I flush on close, rather than free, so the record object is
still usable - This will create a performance problem for tasks that are
processing the file, but it should be rare to be using an XML file for
processing.
@para... | [
"Write",
"the",
"data",
".",
"If",
"this",
"is",
"the",
"last",
"copy",
"being",
"closed",
"write",
"the",
"XML",
"data",
"to",
"the",
"file",
".",
"<p",
"/",
">",
"Notice",
"I",
"flush",
"on",
"close",
"rather",
"than",
"free",
"so",
"the",
"record"... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/xml/src/main/java/org/jbundle/base/db/xml/XTable.java#L112-L128 |
couchbase/java-dcp-client | src/main/java/com/couchbase/client/dcp/transport/netty/DcpMessageHandler.java | DcpMessageHandler.unsafeSendRequest | private void unsafeSendRequest(final ChannelHandlerContext ctx,
final ByteBuf request,
final Promise<DcpResponse> promise) {
"""
Writes the request to the channel and records the promise in the
outstanding request queue.
<p>
"Unsafe" because this... | java | private void unsafeSendRequest(final ChannelHandlerContext ctx,
final ByteBuf request,
final Promise<DcpResponse> promise) {
if (!ctx.executor().inEventLoop()) {
throw new IllegalStateException("Must not be called outside event loop");
}
... | [
"private",
"void",
"unsafeSendRequest",
"(",
"final",
"ChannelHandlerContext",
"ctx",
",",
"final",
"ByteBuf",
"request",
",",
"final",
"Promise",
"<",
"DcpResponse",
">",
"promise",
")",
"{",
"if",
"(",
"!",
"ctx",
".",
"executor",
"(",
")",
".",
"inEventLo... | Writes the request to the channel and records the promise in the
outstanding request queue.
<p>
"Unsafe" because this method must only be called in the event loop thread,
to ensure it never runs concurrently with {@link #channelInactive},
and so that outstanding requests are enqueued in the same order
they are written ... | [
"Writes",
"the",
"request",
"to",
"the",
"channel",
"and",
"records",
"the",
"promise",
"in",
"the",
"outstanding",
"request",
"queue",
".",
"<p",
">",
"Unsafe",
"because",
"this",
"method",
"must",
"only",
"be",
"called",
"in",
"the",
"event",
"loop",
"th... | train | https://github.com/couchbase/java-dcp-client/blob/75359d8c081d6c575f8087cf7c28d24ab24c6421/src/main/java/com/couchbase/client/dcp/transport/netty/DcpMessageHandler.java#L256-L276 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/model/ParameterFactoryImpl.java | ParameterFactoryImpl.createParameter | public Parameter createParameter(final String name, final String value)
throws URISyntaxException {
"""
Creates a parameter.
@param name name of the parameter
@param value a parameter value
@return a component
@throws URISyntaxException thrown when the specified string is not a valid representat... | java | public Parameter createParameter(final String name, final String value)
throws URISyntaxException {
final ParameterFactory factory = getFactory(name);
Parameter parameter;
if (factory != null) {
parameter = factory.createParameter(value);
} else if (isExperimental... | [
"public",
"Parameter",
"createParameter",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"throws",
"URISyntaxException",
"{",
"final",
"ParameterFactory",
"factory",
"=",
"getFactory",
"(",
"name",
")",
";",
"Parameter",
"parameter",
";",
... | Creates a parameter.
@param name name of the parameter
@param value a parameter value
@return a component
@throws URISyntaxException thrown when the specified string is not a valid representation of a URI for selected
parameters | [
"Creates",
"a",
"parameter",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/model/ParameterFactoryImpl.java#L73-L87 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/list/Interval.java | Interval.fromTo | public static Interval fromTo(int from, int to) {
"""
Returns an Interval starting from the value from to the specified value to with a step value of 1.
"""
if (from <= to)
{
return Interval.fromToBy(from, to, 1);
}
return Interval.fromToBy(from, to, -1);
} | java | public static Interval fromTo(int from, int to)
{
if (from <= to)
{
return Interval.fromToBy(from, to, 1);
}
return Interval.fromToBy(from, to, -1);
} | [
"public",
"static",
"Interval",
"fromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"<=",
"to",
")",
"{",
"return",
"Interval",
".",
"fromToBy",
"(",
"from",
",",
"to",
",",
"1",
")",
";",
"}",
"return",
"Interval",
".",
... | Returns an Interval starting from the value from to the specified value to with a step value of 1. | [
"Returns",
"an",
"Interval",
"starting",
"from",
"the",
"value",
"from",
"to",
"the",
"specified",
"value",
"to",
"with",
"a",
"step",
"value",
"of",
"1",
"."
] | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/list/Interval.java#L176-L183 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/util/ThrowUnchecked.java | ThrowUnchecked.fireDeclared | public static void fireDeclared(Throwable t, Class... declaredTypes) {
"""
Throws the given exception if it is unchecked or an instance of any of
the given declared types. Otherwise, it is thrown as an
UndeclaredThrowableException. This method only returns normally if the
exception is null.
@param t exceptio... | java | public static void fireDeclared(Throwable t, Class... declaredTypes) {
org.cojen.util.ThrowUnchecked.fireDeclared(t, declaredTypes);
} | [
"public",
"static",
"void",
"fireDeclared",
"(",
"Throwable",
"t",
",",
"Class",
"...",
"declaredTypes",
")",
"{",
"org",
".",
"cojen",
".",
"util",
".",
"ThrowUnchecked",
".",
"fireDeclared",
"(",
"t",
",",
"declaredTypes",
")",
";",
"}"
] | Throws the given exception if it is unchecked or an instance of any of
the given declared types. Otherwise, it is thrown as an
UndeclaredThrowableException. This method only returns normally if the
exception is null.
@param t exception to throw
@param declaredTypes if exception is checked and is not an instance of
any... | [
"Throws",
"the",
"given",
"exception",
"if",
"it",
"is",
"unchecked",
"or",
"an",
"instance",
"of",
"any",
"of",
"the",
"given",
"declared",
"types",
".",
"Otherwise",
"it",
"is",
"thrown",
"as",
"an",
"UndeclaredThrowableException",
".",
"This",
"method",
"... | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/util/ThrowUnchecked.java#L72-L74 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SFStatement.java | SFStatement.cancelHelper | private void cancelHelper(String sql, String mediaType)
throws SnowflakeSQLException, SFException {
"""
A helper method to build URL and cancel the SQL for exec
@param sql sql statement
@param mediaType media type
@throws SnowflakeSQLException if failed to cancel the statement
@throws SFException ... | java | private void cancelHelper(String sql, String mediaType)
throws SnowflakeSQLException, SFException
{
synchronized (this)
{
if (isClosed)
{
throw new SFException(ErrorCode.INTERNAL_ERROR,
"statement already closed");
}
}
StmtUtil.StmtInput stmtI... | [
"private",
"void",
"cancelHelper",
"(",
"String",
"sql",
",",
"String",
"mediaType",
")",
"throws",
"SnowflakeSQLException",
",",
"SFException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"isClosed",
")",
"{",
"throw",
"new",
"SFException",
"(",
... | A helper method to build URL and cancel the SQL for exec
@param sql sql statement
@param mediaType media type
@throws SnowflakeSQLException if failed to cancel the statement
@throws SFException if statement is already closed | [
"A",
"helper",
"method",
"to",
"build",
"URL",
"and",
"cancel",
"the",
"SQL",
"for",
"exec"
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SFStatement.java#L601-L633 |
alkacon/opencms-core | src/org/opencms/db/CmsSecurityManager.java | CmsSecurityManager.incrementCounter | public int incrementCounter(CmsRequestContext context, String name) throws CmsException {
"""
Increments a counter and returns its old value.<p>
@param context the request context
@param name the name of the counter
@return the value of the counter before incrementing
@throws CmsException if something go... | java | public int incrementCounter(CmsRequestContext context, String name) throws CmsException {
CmsDbContext dbc = m_dbContextFactory.getDbContext(context);
try {
return m_driverManager.incrementCounter(dbc, name);
} catch (Exception e) {
dbc.report(null, Messages.get().contai... | [
"public",
"int",
"incrementCounter",
"(",
"CmsRequestContext",
"context",
",",
"String",
"name",
")",
"throws",
"CmsException",
"{",
"CmsDbContext",
"dbc",
"=",
"m_dbContextFactory",
".",
"getDbContext",
"(",
"context",
")",
";",
"try",
"{",
"return",
"m_driverMan... | Increments a counter and returns its old value.<p>
@param context the request context
@param name the name of the counter
@return the value of the counter before incrementing
@throws CmsException if something goes wrong | [
"Increments",
"a",
"counter",
"and",
"returns",
"its",
"old",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L3388-L3399 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/OptionsApi.java | OptionsApi.updateOptions | public void updateOptions(Map<String, Object> newOptions, Map<String, Object> changedOptions, Map<String, Object> deletedOptions) throws ProvisioningApiException {
"""
Add, edit or delete options values.
Add, edit or delete option values for the specified application.
@param newOptions options to add.
@pa... | java | public void updateOptions(Map<String, Object> newOptions, Map<String, Object> changedOptions, Map<String, Object> deletedOptions) throws ProvisioningApiException {
try {
OptionsPutResponseStatusSuccess resp = optionsApi.optionsPut(
new OptionsPut()
... | [
"public",
"void",
"updateOptions",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"newOptions",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"changedOptions",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"deletedOptions",
")",
"throws",
"ProvisioningApiE... | Add, edit or delete options values.
Add, edit or delete option values for the specified application.
@param newOptions options to add.
@param changedOptions options to change.
@param deletedOptions options to remove.
@throws ProvisioningApiException if the call is unsuccessful. | [
"Add",
"edit",
"or",
"delete",
"options",
"values",
".",
"Add",
"edit",
"or",
"delete",
"option",
"values",
"for",
"the",
"specified",
"application",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/OptionsApi.java#L84-L104 |
carewebframework/carewebframework-core | org.carewebframework.shell/src/main/java/org/carewebframework/shell/ancillary/RelatedClassMap.java | RelatedClassMap.addCardinality | public void addCardinality(Class<? extends ElementBase> sourceClass, Class<? extends ElementBase> targetClass,
int maxOccurrences) {
"""
Adds cardinality relationship between source and target classes.
@param sourceClass The source class.
@param targetClass Class to be registered... | java | public void addCardinality(Class<? extends ElementBase> sourceClass, Class<? extends ElementBase> targetClass,
int maxOccurrences) {
Cardinality cardinality = new Cardinality(sourceClass, targetClass, maxOccurrences);
getOrCreateCardinalities(sourceClass).addCardinality(ca... | [
"public",
"void",
"addCardinality",
"(",
"Class",
"<",
"?",
"extends",
"ElementBase",
">",
"sourceClass",
",",
"Class",
"<",
"?",
"extends",
"ElementBase",
">",
"targetClass",
",",
"int",
"maxOccurrences",
")",
"{",
"Cardinality",
"cardinality",
"=",
"new",
"C... | Adds cardinality relationship between source and target classes.
@param sourceClass The source class.
@param targetClass Class to be registered.
@param maxOccurrences Maximum occurrences for this relationship. | [
"Adds",
"cardinality",
"relationship",
"between",
"source",
"and",
"target",
"classes",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.shell/src/main/java/org/carewebframework/shell/ancillary/RelatedClassMap.java#L151-L155 |
igniterealtime/Smack | smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java | OXInstantMessagingManager.addOxMessage | public OpenPgpMetadata addOxMessage(Message message, Set<OpenPgpContact> contacts, List<ExtensionElement> payload)
throws SmackException.NotLoggedInException, IOException, PGPException {
"""
Add an OX-IM message element to a message.
@param message message
@param contacts recipients of the message
... | java | public OpenPgpMetadata addOxMessage(Message message, Set<OpenPgpContact> contacts, List<ExtensionElement> payload)
throws SmackException.NotLoggedInException, IOException, PGPException {
HashSet<OpenPgpContact> recipients = new HashSet<>(contacts);
OpenPgpContact self = openPgpManager.getOp... | [
"public",
"OpenPgpMetadata",
"addOxMessage",
"(",
"Message",
"message",
",",
"Set",
"<",
"OpenPgpContact",
">",
"contacts",
",",
"List",
"<",
"ExtensionElement",
">",
"payload",
")",
"throws",
"SmackException",
".",
"NotLoggedInException",
",",
"IOException",
",",
... | Add an OX-IM message element to a message.
@param message message
@param contacts recipients of the message
@param payload payload which will be encrypted and signed
@return metadata about the messages encryption + signatures.
@throws SmackException.NotLoggedInException in case we are not logged in
@throws PGPExcept... | [
"Add",
"an",
"OX",
"-",
"IM",
"message",
"element",
"to",
"a",
"message",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-openpgp/src/main/java/org/jivesoftware/smackx/ox_im/OXInstantMessagingManager.java#L271-L288 |
OpenLiberty/open-liberty | dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/utils/JAXRSUtils.java | JAXRSUtils.intersectMimeTypes | public static List<MediaType> intersectMimeTypes(List<MediaType> requiredMediaTypes,
List<MediaType> userMediaTypes,
boolean addRequiredParamsIfPossible) {
"""
intersect two mime types
@param mimeTypesA
@p... | java | public static List<MediaType> intersectMimeTypes(List<MediaType> requiredMediaTypes,
List<MediaType> userMediaTypes,
boolean addRequiredParamsIfPossible) {
return intersectMimeTypes(requiredMediaTypes, user... | [
"public",
"static",
"List",
"<",
"MediaType",
">",
"intersectMimeTypes",
"(",
"List",
"<",
"MediaType",
">",
"requiredMediaTypes",
",",
"List",
"<",
"MediaType",
">",
"userMediaTypes",
",",
"boolean",
"addRequiredParamsIfPossible",
")",
"{",
"return",
"intersectMime... | intersect two mime types
@param mimeTypesA
@param mimeTypesB
@return return a list of intersected mime types | [
"intersect",
"two",
"mime",
"types"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.org.apache.cxf.cxf.rt.frontend.jaxrs.3.2/src/org/apache/cxf/jaxrs/utils/JAXRSUtils.java#L1543-L1547 |
threerings/narya | core/src/main/java/com/threerings/presents/client/ClientDObjectMgr.java | ClientDObjectMgr.dispatchEvent | protected void dispatchEvent (DEvent event) {
"""
Called when a new event arrives from the server that should be dispatched to subscribers
here on the client.
"""
// Log.info("Dispatching event: " + evt);
// look up the object on which we're dispatching this event
int remoteOid = even... | java | protected void dispatchEvent (DEvent event)
{
// Log.info("Dispatching event: " + evt);
// look up the object on which we're dispatching this event
int remoteOid = event.getTargetOid();
DObject target = _ocache.get(remoteOid);
if (target == null) {
if (!_dead.con... | [
"protected",
"void",
"dispatchEvent",
"(",
"DEvent",
"event",
")",
"{",
"// Log.info(\"Dispatching event: \" + evt);",
"// look up the object on which we're dispatching this event",
"int",
"remoteOid",
"=",
"event",
".",
"getTargetOid",
"(",
")",
";",
"DObject",
"targ... | Called when a new event arrives from the server that should be dispatched to subscribers
here on the client. | [
"Called",
"when",
"a",
"new",
"event",
"arrives",
"from",
"the",
"server",
"that",
"should",
"be",
"dispatched",
"to",
"subscribers",
"here",
"on",
"the",
"client",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/presents/client/ClientDObjectMgr.java#L277-L314 |
broadinstitute/barclay | src/main/java/org/broadinstitute/barclay/help/HelpDoclet.java | HelpDoclet.processDocs | private void processDocs(final RootDoc rootDoc) {
"""
Process the classes that have been included by the javadoc process in the rootDoc object.
@param rootDoc root structure containing the the set of objects accumulated by the javadoc process
"""
this.rootDoc = rootDoc;
// Get a list of all... | java | private void processDocs(final RootDoc rootDoc) {
this.rootDoc = rootDoc;
// Get a list of all the features and groups that we'll actually retain
workUnits = computeWorkUnits();
final Set<String> uniqueGroups = new HashSet<>();
final List<Map<String, String>> featureMaps = new ... | [
"private",
"void",
"processDocs",
"(",
"final",
"RootDoc",
"rootDoc",
")",
"{",
"this",
".",
"rootDoc",
"=",
"rootDoc",
";",
"// Get a list of all the features and groups that we'll actually retain",
"workUnits",
"=",
"computeWorkUnits",
"(",
")",
";",
"final",
"Set",
... | Process the classes that have been included by the javadoc process in the rootDoc object.
@param rootDoc root structure containing the the set of objects accumulated by the javadoc process | [
"Process",
"the",
"classes",
"that",
"have",
"been",
"included",
"by",
"the",
"javadoc",
"process",
"in",
"the",
"rootDoc",
"object",
"."
] | train | https://github.com/broadinstitute/barclay/blob/7e56d725766b0da3baff23e79a31c3d01c3589c2/src/main/java/org/broadinstitute/barclay/help/HelpDoclet.java#L256-L282 |
apache/spark | common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java | YarnShuffleServiceMetrics.getMetrics | @Override
public void getMetrics(MetricsCollector collector, boolean all) {
"""
Get metrics from the source
@param collector to contain the resulting metrics snapshot
@param all if true, return all metrics even if unchanged.
"""
MetricsRecordBuilder metricsRecordBuilder = collector.addRecord("s... | java | @Override
public void getMetrics(MetricsCollector collector, boolean all) {
MetricsRecordBuilder metricsRecordBuilder = collector.addRecord("sparkShuffleService");
for (Map.Entry<String, Metric> entry : metricSet.getMetrics().entrySet()) {
collectMetric(metricsRecordBuilder, entry.getKey(), entry.getVa... | [
"@",
"Override",
"public",
"void",
"getMetrics",
"(",
"MetricsCollector",
"collector",
",",
"boolean",
"all",
")",
"{",
"MetricsRecordBuilder",
"metricsRecordBuilder",
"=",
"collector",
".",
"addRecord",
"(",
"\"sparkShuffleService\"",
")",
";",
"for",
"(",
"Map",
... | Get metrics from the source
@param collector to contain the resulting metrics snapshot
@param all if true, return all metrics even if unchanged. | [
"Get",
"metrics",
"from",
"the",
"source"
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/common/network-yarn/src/main/java/org/apache/spark/network/yarn/YarnShuffleServiceMetrics.java#L47-L54 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressRestrictionPersistenceImpl.java | CommerceAddressRestrictionPersistenceImpl.countByC_C | @Override
public int countByC_C(long classNameId, long classPK) {
"""
Returns the number of commerce address restrictions where classNameId = ? and classPK = ?.
@param classNameId the class name ID
@param classPK the class pk
@return the number of matching commerce address restrictions
"""
Find... | java | @Override
public int countByC_C(long classNameId, long classPK) {
FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C;
Object[] finderArgs = new Object[] { classNameId, classPK };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
StringBundler query = new StringBun... | [
"@",
"Override",
"public",
"int",
"countByC_C",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_COUNT_BY_C_C",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
"{",
"classNameId"... | Returns the number of commerce address restrictions where classNameId = ? and classPK = ?.
@param classNameId the class name ID
@param classPK the class pk
@return the number of matching commerce address restrictions | [
"Returns",
"the",
"number",
"of",
"commerce",
"address",
"restrictions",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceAddressRestrictionPersistenceImpl.java#L1128-L1175 |
rjeschke/txtmark | src/main/java/com/github/rjeschke/txtmark/Utils.java | Utils.codeEncode | public final static void codeEncode(final StringBuilder out, final String value, final int offset) {
"""
Appends the given string to the given StringBuilder, replacing '&',
'<' and '>' by their respective HTML entities.
@param out
The StringBuilder to append to.
@param value
The string to append.
... | java | public final static void codeEncode(final StringBuilder out, final String value, final int offset)
{
for (int i = offset; i < value.length(); i++)
{
final char c = value.charAt(i);
switch (c)
{
case '&':
out.append("&");
... | [
"public",
"final",
"static",
"void",
"codeEncode",
"(",
"final",
"StringBuilder",
"out",
",",
"final",
"String",
"value",
",",
"final",
"int",
"offset",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"offset",
";",
"i",
"<",
"value",
".",
"length",
"(",
")",
... | Appends the given string to the given StringBuilder, replacing '&',
'<' and '>' by their respective HTML entities.
@param out
The StringBuilder to append to.
@param value
The string to append.
@param offset
The character offset into value from where to start | [
"Appends",
"the",
"given",
"string",
"to",
"the",
"given",
"StringBuilder",
"replacing",
"&",
";",
"<",
";",
"and",
">",
";",
"by",
"their",
"respective",
"HTML",
"entities",
"."
] | train | https://github.com/rjeschke/txtmark/blob/108cee6b209a362843729c032c2d982625d12d98/src/main/java/com/github/rjeschke/txtmark/Utils.java#L743-L763 |
apache/incubator-shardingsphere | sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/sql/statement/dcl/DCLStatement.java | DCLStatement.isDCL | public static boolean isDCL(final TokenType primaryTokenType, final TokenType secondaryTokenType) {
"""
Is DCL statement.
@param primaryTokenType primary token type
@param secondaryTokenType secondary token type
@return is DCL or not
"""
return STATEMENT_PREFIX.contains(primaryTokenType) || (PRIMA... | java | public static boolean isDCL(final TokenType primaryTokenType, final TokenType secondaryTokenType) {
return STATEMENT_PREFIX.contains(primaryTokenType) || (PRIMARY_STATEMENT_PREFIX.contains(primaryTokenType) && SECONDARY_STATEMENT_PREFIX.contains(secondaryTokenType));
} | [
"public",
"static",
"boolean",
"isDCL",
"(",
"final",
"TokenType",
"primaryTokenType",
",",
"final",
"TokenType",
"secondaryTokenType",
")",
"{",
"return",
"STATEMENT_PREFIX",
".",
"contains",
"(",
"primaryTokenType",
")",
"||",
"(",
"PRIMARY_STATEMENT_PREFIX",
".",
... | Is DCL statement.
@param primaryTokenType primary token type
@param secondaryTokenType secondary token type
@return is DCL or not | [
"Is",
"DCL",
"statement",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-core/sharding-core-parse/sharding-core-parse-common/src/main/java/org/apache/shardingsphere/core/parse/antlr/sql/statement/dcl/DCLStatement.java#L56-L58 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java | AtomicIntegerFieldUpdater.updateAndGet | public final int updateAndGet(T obj, IntUnaryOperator updateFunction) {
"""
Atomically updates the field of the given object managed by this updater
with the results of applying the given function, returning the updated
value. The function should be side-effect-free, since it may be
re-applied when attempted up... | java | public final int updateAndGet(T obj, IntUnaryOperator updateFunction) {
int prev, next;
do {
prev = get(obj);
next = updateFunction.applyAsInt(prev);
} while (!compareAndSet(obj, prev, next));
return next;
} | [
"public",
"final",
"int",
"updateAndGet",
"(",
"T",
"obj",
",",
"IntUnaryOperator",
"updateFunction",
")",
"{",
"int",
"prev",
",",
"next",
";",
"do",
"{",
"prev",
"=",
"get",
"(",
"obj",
")",
";",
"next",
"=",
"updateFunction",
".",
"applyAsInt",
"(",
... | Atomically updates the field of the given object managed by this updater
with the results of applying the given function, returning the updated
value. The function should be side-effect-free, since it may be
re-applied when attempted updates fail due to contention among threads.
@param obj An object whose field to get... | [
"Atomically",
"updates",
"the",
"field",
"of",
"the",
"given",
"object",
"managed",
"by",
"this",
"updater",
"with",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"returning",
"the",
"updated",
"value",
".",
"The",
"function",
"should",
"be",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicIntegerFieldUpdater.java#L305-L312 |
yasserg/crawler4j | crawler4j/src/main/java/edu/uci/ics/crawler4j/crawler/WebCrawler.java | WebCrawler.shouldVisit | public boolean shouldVisit(Page referringPage, WebURL url) {
"""
Classes that extends WebCrawler should overwrite this function to tell the
crawler whether the given url should be crawled or not. The following
default implementation indicates that all urls should be included in the crawl
except those with a nof... | java | public boolean shouldVisit(Page referringPage, WebURL url) {
if (myController.getConfig().isRespectNoFollow()) {
return !((referringPage != null &&
referringPage.getContentType() != null &&
referringPage.getContentType().contains("html") &&
... | [
"public",
"boolean",
"shouldVisit",
"(",
"Page",
"referringPage",
",",
"WebURL",
"url",
")",
"{",
"if",
"(",
"myController",
".",
"getConfig",
"(",
")",
".",
"isRespectNoFollow",
"(",
")",
")",
"{",
"return",
"!",
"(",
"(",
"referringPage",
"!=",
"null",
... | Classes that extends WebCrawler should overwrite this function to tell the
crawler whether the given url should be crawled or not. The following
default implementation indicates that all urls should be included in the crawl
except those with a nofollow flag.
@param url
the url which we are interested to know whether i... | [
"Classes",
"that",
"extends",
"WebCrawler",
"should",
"overwrite",
"this",
"function",
"to",
"tell",
"the",
"crawler",
"whether",
"the",
"given",
"url",
"should",
"be",
"crawled",
"or",
"not",
".",
"The",
"following",
"default",
"implementation",
"indicates",
"t... | train | https://github.com/yasserg/crawler4j/blob/4fcddc86414d1831973aff94050af55c7aeff3bc/crawler4j/src/main/java/edu/uci/ics/crawler4j/crawler/WebCrawler.java#L369-L381 |
nohana/Amalgam | amalgam/src/main/java/com/amalgam/os/BundleUtils.java | BundleUtils.optBundle | @Nullable
public static Bundle optBundle(@Nullable Bundle bundle, @Nullable String key, @Nullable Bundle fallback) {
"""
Returns a optional {@link android.os.Bundle} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Bundle}.
The bundle argument is allowed to be {@c... | java | @Nullable
public static Bundle optBundle(@Nullable Bundle bundle, @Nullable String key, @Nullable Bundle fallback) {
if (bundle == null) {
return fallback;
}
return bundle.getBundle(key);
} | [
"@",
"Nullable",
"public",
"static",
"Bundle",
"optBundle",
"(",
"@",
"Nullable",
"Bundle",
"bundle",
",",
"@",
"Nullable",
"String",
"key",
",",
"@",
"Nullable",
"Bundle",
"fallback",
")",
"{",
"if",
"(",
"bundle",
"==",
"null",
")",
"{",
"return",
"fal... | Returns a optional {@link android.os.Bundle} value. In other words, returns the value mapped by key if it exists and is a {@link android.os.Bundle}.
The bundle argument is allowed to be {@code null}. If the bundle is null, this method returns null.
@param bundle a bundle. If the bundle is null, this method will return ... | [
"Returns",
"a",
"optional",
"{"
] | train | https://github.com/nohana/Amalgam/blob/57809ddbfe7897e979cf507982ce0b3aa5e0ed8a/amalgam/src/main/java/com/amalgam/os/BundleUtils.java#L197-L203 |
cdk/cdk | misc/extra/src/main/java/org/openscience/cdk/tools/AtomTypeTools.java | AtomTypeTools.assignAtomTypePropertiesToAtom | public IRingSet assignAtomTypePropertiesToAtom(IAtomContainer molecule, boolean aromaticity) throws Exception {
"""
Method assigns certain properties to an atom. Necessary for the atom type matching
Properties:
<ul>
<li>aromaticity)
<li>ChemicalGroup (CDKChemicalRingGroupConstant)
<li>SSSR
<li>Ring/Group, ri... | java | public IRingSet assignAtomTypePropertiesToAtom(IAtomContainer molecule, boolean aromaticity) throws Exception {
SmilesGenerator sg = new SmilesGenerator();
//logger.debug("assignAtomTypePropertiesToAtom Start ...");
logger.debug("assignAtomTypePropertiesToAtom Start ...");
String hoseCo... | [
"public",
"IRingSet",
"assignAtomTypePropertiesToAtom",
"(",
"IAtomContainer",
"molecule",
",",
"boolean",
"aromaticity",
")",
"throws",
"Exception",
"{",
"SmilesGenerator",
"sg",
"=",
"new",
"SmilesGenerator",
"(",
")",
";",
"//logger.debug(\"assignAtomTypePropertiesToAtom... | Method assigns certain properties to an atom. Necessary for the atom type matching
Properties:
<ul>
<li>aromaticity)
<li>ChemicalGroup (CDKChemicalRingGroupConstant)
<li>SSSR
<li>Ring/Group, ringSize, aromaticity
<li>SphericalMatcher (HoSe Code)
</ul>
@param aromaticity boolean true/false true if aromaticity should be... | [
"Method",
"assigns",
"certain",
"properties",
"to",
"an",
"atom",
".",
"Necessary",
"for",
"the",
"atom",
"type",
"matching",
"Properties",
":",
"<ul",
">",
"<li",
">",
"aromaticity",
")",
"<li",
">",
"ChemicalGroup",
"(",
"CDKChemicalRingGroupConstant",
")",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/tools/AtomTypeTools.java#L85-L133 |
morimekta/utils | io-util/src/main/java/net/morimekta/util/Base64.java | Base64.encodeToString | public static String encodeToString(final byte[] source, int off, int len) {
"""
Encodes a byte array into Base64 string.
@param source The data to convert
@param off The data offset of what to encode.
@param len The number of bytes to encode.
@return The Base64-encoded data as a String
@throws NullPointerE... | java | public static String encodeToString(final byte[] source, int off, int len) {
byte[] encoded = encode(source, off, len);
return new String(encoded, US_ASCII);
} | [
"public",
"static",
"String",
"encodeToString",
"(",
"final",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"len",
")",
"{",
"byte",
"[",
"]",
"encoded",
"=",
"encode",
"(",
"source",
",",
"off",
",",
"len",
")",
";",
"return",
"new",
... | Encodes a byte array into Base64 string.
@param source The data to convert
@param off The data offset of what to encode.
@param len The number of bytes to encode.
@return The Base64-encoded data as a String
@throws NullPointerException if source array is null
@since 2.0 | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"string",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/io-util/src/main/java/net/morimekta/util/Base64.java#L190-L193 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoImages.java | DaoImages.getEnvelope | public static ReferencedEnvelope getEnvelope( IHMConnection connection ) throws Exception {
"""
Get the current data envelope.
@param connection the db connection.
@return the envelope.
@throws Exception
"""
String query = "SELECT min(" + //
ImageTableFields.COLUMN_LON.getFieldName... | java | public static ReferencedEnvelope getEnvelope( IHMConnection connection ) throws Exception {
String query = "SELECT min(" + //
ImageTableFields.COLUMN_LON.getFieldName() + "), max(" + //
ImageTableFields.COLUMN_LON.getFieldName() + "), min(" + //
ImageTableFields.C... | [
"public",
"static",
"ReferencedEnvelope",
"getEnvelope",
"(",
"IHMConnection",
"connection",
")",
"throws",
"Exception",
"{",
"String",
"query",
"=",
"\"SELECT min(\"",
"+",
"//",
"ImageTableFields",
".",
"COLUMN_LON",
".",
"getFieldName",
"(",
")",
"+",
"\"), max(\... | Get the current data envelope.
@param connection the db connection.
@return the envelope.
@throws Exception | [
"Get",
"the",
"current",
"data",
"envelope",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/geopaparazzi/geopap4/DaoImages.java#L272-L292 |
yavijava/yavijava | src/main/java/com/vmware/vim25/mo/IoFilterManager.java | IoFilterManager.upgradeIoFilter_Task | public Task upgradeIoFilter_Task(String filterId, ComputeResource cluster, String vibUrl) throws InvalidArgument, InvalidState, NotFound, RuntimeFault, RemoteException {
"""
Upgrade an IO Filter on a compute resource.
@param filterId
- ID of the filter.
@param cluster
- The compute resource to install the IO... | java | public Task upgradeIoFilter_Task(String filterId, ComputeResource cluster, String vibUrl) throws InvalidArgument, InvalidState, NotFound, RuntimeFault, RemoteException {
return new Task(getServerConnection(), getVimService().upgradeIoFilter_Task(getMOR(), filterId, cluster.getMOR(), vibUrl));
} | [
"public",
"Task",
"upgradeIoFilter_Task",
"(",
"String",
"filterId",
",",
"ComputeResource",
"cluster",
",",
"String",
"vibUrl",
")",
"throws",
"InvalidArgument",
",",
"InvalidState",
",",
"NotFound",
",",
"RuntimeFault",
",",
"RemoteException",
"{",
"return",
"new"... | Upgrade an IO Filter on a compute resource.
@param filterId
- ID of the filter.
@param cluster
- The compute resource to install the IO Filter on. "compRes" must be a cluster.
@param vibUrl
- The URL that points to the IO Filter VIB package.
@return - This method returns a Task object with which to monitor the opera... | [
"Upgrade",
"an",
"IO",
"Filter",
"on",
"a",
"compute",
"resource",
"."
] | train | https://github.com/yavijava/yavijava/blob/27fd2c5826115782d5eeb934f86e3e39240179cd/src/main/java/com/vmware/vim25/mo/IoFilterManager.java#L241-L243 |
apiman/apiman | common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java | ReflectionUtils.callIfExists | public static <T> void callIfExists(T object, String methodName) throws SecurityException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
"""
Call a method if it exists. Use very sparingly and generally prefer interfaces.
@param object The object
@param methodName Metho... | java | public static <T> void callIfExists(T object, String methodName) throws SecurityException,
IllegalAccessException, IllegalArgumentException, InvocationTargetException {
try {
Method method = object.getClass().getMethod(methodName);
method.invoke(object);
} catch (NoSu... | [
"public",
"static",
"<",
"T",
">",
"void",
"callIfExists",
"(",
"T",
"object",
",",
"String",
"methodName",
")",
"throws",
"SecurityException",
",",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"try",
"{",
"Method... | Call a method if it exists. Use very sparingly and generally prefer interfaces.
@param object The object
@param methodName Method name to call on the object
@throws SecurityException reflection - security manager to indicate a security violation
@throws IllegalAccessException reflection - does not allow access
@throws ... | [
"Call",
"a",
"method",
"if",
"it",
"exists",
".",
"Use",
"very",
"sparingly",
"and",
"generally",
"prefer",
"interfaces",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/common/util/src/main/java/io/apiman/common/util/ReflectionUtils.java#L39-L46 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java | ComputeNodesImpl.listWithServiceResponseAsync | public Observable<ServiceResponseWithHeaders<Page<ComputeNode>, ComputeNodeListHeaders>> listWithServiceResponseAsync(final String poolId, final ComputeNodeListOptions computeNodeListOptions) {
"""
Lists the compute nodes in the specified pool.
@param poolId The ID of the pool from which you want to list nodes.... | java | public Observable<ServiceResponseWithHeaders<Page<ComputeNode>, ComputeNodeListHeaders>> listWithServiceResponseAsync(final String poolId, final ComputeNodeListOptions computeNodeListOptions) {
return listSinglePageAsync(poolId, computeNodeListOptions)
.concatMap(new Func1<ServiceResponseWithHea... | [
"public",
"Observable",
"<",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"ComputeNode",
">",
",",
"ComputeNodeListHeaders",
">",
">",
"listWithServiceResponseAsync",
"(",
"final",
"String",
"poolId",
",",
"final",
"ComputeNodeListOptions",
"computeNodeListOptions",
")... | Lists the compute nodes in the specified pool.
@param poolId The ID of the pool from which you want to list nodes.
@param computeNodeListOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<ComputeNode> o... | [
"Lists",
"the",
"compute",
"nodes",
"in",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/ComputeNodesImpl.java#L2797-L2816 |
JodaOrg/joda-time | src/main/java/org/joda/time/LocalDate.java | LocalDate.toLocalDateTime | public LocalDateTime toLocalDateTime(LocalTime time) {
"""
Converts this object to a LocalDateTime using a LocalTime to fill in
the missing fields.
<p>
The resulting chronology is determined by the chronology of this
LocalDate. The chronology of the time must also match.
If the time is null an exception is th... | java | public LocalDateTime toLocalDateTime(LocalTime time) {
if (time == null) {
throw new IllegalArgumentException("The time must not be null");
}
if (getChronology() != time.getChronology()) {
throw new IllegalArgumentException("The chronology of the time does not match");
... | [
"public",
"LocalDateTime",
"toLocalDateTime",
"(",
"LocalTime",
"time",
")",
"{",
"if",
"(",
"time",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The time must not be null\"",
")",
";",
"}",
"if",
"(",
"getChronology",
"(",
")",
... | Converts this object to a LocalDateTime using a LocalTime to fill in
the missing fields.
<p>
The resulting chronology is determined by the chronology of this
LocalDate. The chronology of the time must also match.
If the time is null an exception is thrown.
<p>
This instance is immutable and unaffected by this method ca... | [
"Converts",
"this",
"object",
"to",
"a",
"LocalDateTime",
"using",
"a",
"LocalTime",
"to",
"fill",
"in",
"the",
"missing",
"fields",
".",
"<p",
">",
"The",
"resulting",
"chronology",
"is",
"determined",
"by",
"the",
"chronology",
"of",
"this",
"LocalDate",
"... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/LocalDate.java#L887-L896 |
Javacord/Javacord | javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java | MessageSetImpl.getMessagesBetween | public static CompletableFuture<MessageSet> getMessagesBetween(TextChannel channel, long from, long to) {
"""
Gets all messages in the given channel between the first given message in any channel and the second given
message in any channel, excluding the boundaries.
Gets up to a given amount of messages in the g... | java | public static CompletableFuture<MessageSet> getMessagesBetween(TextChannel channel, long from, long to) {
CompletableFuture<MessageSet> future = new CompletableFuture<>();
channel.getApi().getThreadPool().getExecutorService().submit(() -> {
try {
future.complete(new MessageSe... | [
"public",
"static",
"CompletableFuture",
"<",
"MessageSet",
">",
"getMessagesBetween",
"(",
"TextChannel",
"channel",
",",
"long",
"from",
",",
"long",
"to",
")",
"{",
"CompletableFuture",
"<",
"MessageSet",
">",
"future",
"=",
"new",
"CompletableFuture",
"<>",
... | Gets all messages in the given channel between the first given message in any channel and the second given
message in any channel, excluding the boundaries.
Gets up to a given amount of messages in the given channel before a given message in any channel.
@param channel The channel of the messages.
@param from The id o... | [
"Gets",
"all",
"messages",
"in",
"the",
"given",
"channel",
"between",
"the",
"first",
"given",
"message",
"in",
"any",
"channel",
"and",
"the",
"second",
"given",
"message",
"in",
"any",
"channel",
"excluding",
"the",
"boundaries",
".",
"Gets",
"up",
"to",
... | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-core/src/main/java/org/javacord/core/entity/message/MessageSetImpl.java#L651-L662 |
zalando/problem-spring-web | problem-spring-common/src/main/java/org/zalando/problem/spring/common/Lists.java | Lists.lengthOfTrailingPartialSubList | static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) {
"""
Returns the length of the longest trailing partial sublist of the
target list within the specified source list, or 0 if there is no such
occurrence. More formally, returns the length <tt>i</tt>
such that
{@code source.... | java | static int lengthOfTrailingPartialSubList(final List<?> source, final List<?> target) {
final int s = source.size() - 1;
final int t = target.size() - 1;
int l = 0;
while (l <= s && l <= t && source.get(s - l).equals(target.get(t - l))) {
l++;
}
return l;
... | [
"static",
"int",
"lengthOfTrailingPartialSubList",
"(",
"final",
"List",
"<",
"?",
">",
"source",
",",
"final",
"List",
"<",
"?",
">",
"target",
")",
"{",
"final",
"int",
"s",
"=",
"source",
".",
"size",
"(",
")",
"-",
"1",
";",
"final",
"int",
"t",
... | Returns the length of the longest trailing partial sublist of the
target list within the specified source list, or 0 if there is no such
occurrence. More formally, returns the length <tt>i</tt>
such that
{@code source.subList(source.size() - i, source.size()).equals(target.subList(target.size() - i, target.size()))},
... | [
"Returns",
"the",
"length",
"of",
"the",
"longest",
"trailing",
"partial",
"sublist",
"of",
"the",
"target",
"list",
"within",
"the",
"specified",
"source",
"list",
"or",
"0",
"if",
"there",
"is",
"no",
"such",
"occurrence",
".",
"More",
"formally",
"returns... | train | https://github.com/zalando/problem-spring-web/blob/eae45765e6838ac8679f439470c1473f4f7bab37/problem-spring-common/src/main/java/org/zalando/problem/spring/common/Lists.java#L26-L36 |
structurizr/java | structurizr-core/src/com/structurizr/model/Person.java | Person.interactsWith | public Relationship interactsWith(Person destination, String description) {
"""
Adds an interaction between this person and another.
@param destination the Person being interacted with
@param description a description of the interaction
@return the resulting Relatioship
"""
... | java | public Relationship interactsWith(Person destination, String description) {
return interactsWith(destination, description, null);
} | [
"public",
"Relationship",
"interactsWith",
"(",
"Person",
"destination",
",",
"String",
"description",
")",
"{",
"return",
"interactsWith",
"(",
"destination",
",",
"description",
",",
"null",
")",
";",
"}"
] | Adds an interaction between this person and another.
@param destination the Person being interacted with
@param description a description of the interaction
@return the resulting Relatioship | [
"Adds",
"an",
"interaction",
"between",
"this",
"person",
"and",
"another",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Person.java#L75-L77 |
auth0/Auth0.Android | auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java | AuthenticationAPIClient.signUp | @SuppressWarnings("WeakerAccess")
public SignUpRequest signUp(@NonNull String email, @NonNull String password, @NonNull String username, @NonNull String connection) {
"""
Creates a user in a DB connection using <a href="https://auth0.com/docs/api/authentication#signup">'/dbconnections/signup' endpoint</a>
and... | java | @SuppressWarnings("WeakerAccess")
public SignUpRequest signUp(@NonNull String email, @NonNull String password, @NonNull String username, @NonNull String connection) {
final DatabaseConnectionRequest<DatabaseUser, AuthenticationException> createUserRequest = createUser(email, password, username, connection);... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"SignUpRequest",
"signUp",
"(",
"@",
"NonNull",
"String",
"email",
",",
"@",
"NonNull",
"String",
"password",
",",
"@",
"NonNull",
"String",
"username",
",",
"@",
"NonNull",
"String",
"connection",... | Creates a user in a DB connection using <a href="https://auth0.com/docs/api/authentication#signup">'/dbconnections/signup' endpoint</a>
and then logs in the user. How the user is logged in depends on the {@link Auth0#isOIDCConformant()} flag.
Example usage:
<pre>
{@code
client.signUp("{email}", "{password}", "{username... | [
"Creates",
"a",
"user",
"in",
"a",
"DB",
"connection",
"using",
"<a",
"href",
"=",
"https",
":",
"//",
"auth0",
".",
"com",
"/",
"docs",
"/",
"api",
"/",
"authentication#signup",
">",
"/",
"dbconnections",
"/",
"signup",
"endpoint<",
"/",
"a",
">",
"an... | train | https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/authentication/AuthenticationAPIClient.java#L587-L593 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java | NNStorage.setFields | @Override // Storage
protected void setFields(Properties props, StorageDirectory sd)
throws IOException {
"""
Write version file into the storage directory.
The version file should always be written last.
Missing or corrupted version file indicates that
the checkpoint is not valid.
@param sd stor... | java | @Override // Storage
protected void setFields(Properties props, StorageDirectory sd)
throws IOException {
super.setFields(props, sd);
boolean uState = getDistributedUpgradeState();
int uVersion = getDistributedUpgradeVersion();
if (uState && uVersion != getLayoutVersion()) {
props.setPro... | [
"@",
"Override",
"// Storage ",
"protected",
"void",
"setFields",
"(",
"Properties",
"props",
",",
"StorageDirectory",
"sd",
")",
"throws",
"IOException",
"{",
"super",
".",
"setFields",
"(",
"props",
",",
"sd",
")",
";",
"boolean",
"uState",
"=",
"getDistrib... | Write version file into the storage directory.
The version file should always be written last.
Missing or corrupted version file indicates that
the checkpoint is not valid.
@param sd storage directory
@throws IOException | [
"Write",
"version",
"file",
"into",
"the",
"storage",
"directory",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/NNStorage.java#L675-L686 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java | ManagedClustersInner.beginResetServicePrincipalProfile | public void beginResetServicePrincipalProfile(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
"""
Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The name of the resourc... | java | public void beginResetServicePrincipalProfile(String resourceGroupName, String resourceName, ManagedClusterServicePrincipalProfile parameters) {
beginResetServicePrincipalProfileWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"beginResetServicePrincipalProfile",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterServicePrincipalProfile",
"parameters",
")",
"{",
"beginResetServicePrincipalProfileWithServiceResponseAsync",
"(",
"resourceGroupName",
","... | Reset Service Principal Profile of a managed cluster.
Update the service principal Profile for a managed cluster.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Reset Service Principal Profile operation... | [
"Reset",
"Service",
"Principal",
"Profile",
"of",
"a",
"managed",
"cluster",
".",
"Update",
"the",
"service",
"principal",
"Profile",
"for",
"a",
"managed",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2019_02_01/src/main/java/com/microsoft/azure/management/containerservice/v2019_02_01/implementation/ManagedClustersInner.java#L1579-L1581 |
pedrovgs/Nox | nox/src/main/java/com/github/pedrovgs/nox/shape/Shape.java | Shape.setNoxItemXPosition | protected final void setNoxItemXPosition(int position, float x) {
"""
Configures the X position for a given NoxItem indicated with the item position. This method
uses two counters to calculate the Shape minimum and maximum X position used to configure the
Shape scroll.
"""
noxItemsXPositions[position] = ... | java | protected final void setNoxItemXPosition(int position, float x) {
noxItemsXPositions[position] = x;
minX = (int) Math.min(x, minX);
maxX = (int) Math.max(x, maxX);
} | [
"protected",
"final",
"void",
"setNoxItemXPosition",
"(",
"int",
"position",
",",
"float",
"x",
")",
"{",
"noxItemsXPositions",
"[",
"position",
"]",
"=",
"x",
";",
"minX",
"=",
"(",
"int",
")",
"Math",
".",
"min",
"(",
"x",
",",
"minX",
")",
";",
"m... | Configures the X position for a given NoxItem indicated with the item position. This method
uses two counters to calculate the Shape minimum and maximum X position used to configure the
Shape scroll. | [
"Configures",
"the",
"X",
"position",
"for",
"a",
"given",
"NoxItem",
"indicated",
"with",
"the",
"item",
"position",
".",
"This",
"method",
"uses",
"two",
"counters",
"to",
"calculate",
"the",
"Shape",
"minimum",
"and",
"maximum",
"X",
"position",
"used",
"... | train | https://github.com/pedrovgs/Nox/blob/b4dfe37895e1b7bf2084d60139931dd4fb12f3f4/nox/src/main/java/com/github/pedrovgs/nox/shape/Shape.java#L180-L184 |
jgroups-extras/jgroups-kubernetes | src/main/java/org/jgroups/protocols/kubernetes/pem/DerParser.java | DerParser.getLength | private int getLength() throws IOException {
"""
Decode the length of the field. Can only support length
encoding up to 4 octets.
<p/>In BER/DER encoding, length can be encoded in 2 forms,
<ul>
<li>Short form. One octet. Bit 8 has value "0" and bits 7-1
give the length.
<li>Long form. Two to 127 octets (on... | java | private int getLength() throws IOException {
int i = in.read();
if (i == -1)
throw new IOException("Invalid DER: length missing"); //$NON-NLS-1$
// A single byte short length
if ((i & ~0x7F) == 0)
return i;
int num = i & 0x7F;
// We... | [
"private",
"int",
"getLength",
"(",
")",
"throws",
"IOException",
"{",
"int",
"i",
"=",
"in",
".",
"read",
"(",
")",
";",
"if",
"(",
"i",
"==",
"-",
"1",
")",
"throw",
"new",
"IOException",
"(",
"\"Invalid DER: length missing\"",
")",
";",
"//$NON-NLS-1$... | Decode the length of the field. Can only support length
encoding up to 4 octets.
<p/>In BER/DER encoding, length can be encoded in 2 forms,
<ul>
<li>Short form. One octet. Bit 8 has value "0" and bits 7-1
give the length.
<li>Long form. Two to 127 octets (only 4 is supported here).
Bit 8 of first octet has value "1" a... | [
"Decode",
"the",
"length",
"of",
"the",
"field",
".",
"Can",
"only",
"support",
"length",
"encoding",
"up",
"to",
"4",
"octets",
"."
] | train | https://github.com/jgroups-extras/jgroups-kubernetes/blob/f3e42b540c61e860e749c501849312c0c224f3fb/src/main/java/org/jgroups/protocols/kubernetes/pem/DerParser.java#L145-L168 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/state2graphite/GraphiteConnection.java | GraphiteConnection.send | public void send(String msg) {
"""
Part of this code taken from http://neopatel.blogspot.de/2011/04/logging-to-graphite-monitoring-tool.html
"""
try {
Socket socket = new Socket(graphiteHost, graphitePort);
try {
Writer writer = new OutputStreamWriter(socket.getOutputStream());
... | java | public void send(String msg) {
try {
Socket socket = new Socket(graphiteHost, graphitePort);
try {
Writer writer = new OutputStreamWriter(socket.getOutputStream());
try {
writer.write(msg);
writer.flush();
} finally {
try {
writer.close(... | [
"public",
"void",
"send",
"(",
"String",
"msg",
")",
"{",
"try",
"{",
"Socket",
"socket",
"=",
"new",
"Socket",
"(",
"graphiteHost",
",",
"graphitePort",
")",
";",
"try",
"{",
"Writer",
"writer",
"=",
"new",
"OutputStreamWriter",
"(",
"socket",
".",
"get... | Part of this code taken from http://neopatel.blogspot.de/2011/04/logging-to-graphite-monitoring-tool.html | [
"Part",
"of",
"this",
"code",
"taken",
"from",
"http",
":",
"//",
"neopatel",
".",
"blogspot",
".",
"de",
"/",
"2011",
"/",
"04",
"/",
"logging",
"-",
"to",
"-",
"graphite",
"-",
"monitoring",
"-",
"tool",
".",
"html"
] | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/state2graphite/GraphiteConnection.java#L29-L62 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.