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 |
|---|---|---|---|---|---|---|---|---|---|---|
xmlunit/xmlunit | xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java | DefaultComparisonFormatter.appendDocumentType | protected boolean appendDocumentType(StringBuilder sb, DocumentType type) {
"""
Appends the XML DOCTYPE for {@link #getShortString} or {@link #appendFullDocumentHeader} if present.
@param sb the builder to append to
@param type the document type
@return true if the DOCTPYE has been appended
@since XMLUnit ... | java | protected boolean appendDocumentType(StringBuilder sb, DocumentType type) {
if (type == null) {
return false;
}
sb.append("<!DOCTYPE ").append(type.getName());
boolean hasNoPublicId = true;
if (type.getPublicId() != null && type.getPublicId().length() > 0) {
... | [
"protected",
"boolean",
"appendDocumentType",
"(",
"StringBuilder",
"sb",
",",
"DocumentType",
"type",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"sb",
".",
"append",
"(",
"\"<!DOCTYPE \"",
")",
".",
"append",
"(",
... | Appends the XML DOCTYPE for {@link #getShortString} or {@link #appendFullDocumentHeader} if present.
@param sb the builder to append to
@param type the document type
@return true if the DOCTPYE has been appended
@since XMLUnit 2.4.0 | [
"Appends",
"the",
"XML",
"DOCTYPE",
"for",
"{",
"@link",
"#getShortString",
"}",
"or",
"{",
"@link",
"#appendFullDocumentHeader",
"}",
"if",
"present",
"."
] | train | https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-core/src/main/java/org/xmlunit/diff/DefaultComparisonFormatter.java#L220-L238 |
konvergeio/cofoja | src/main/java/com/google/java/contract/util/Predicates.java | Predicates.allEntries | public static <K, V> Predicate<Map<K, V>> allEntries(
Predicate<? super Map.Entry<K, V>> p) {
"""
Returns a predicate that applies {@code all(p)} to the entries of
its argument.
"""
return forEntries(Predicates.<Map.Entry<K, V>>all(p));
} | java | public static <K, V> Predicate<Map<K, V>> allEntries(
Predicate<? super Map.Entry<K, V>> p) {
return forEntries(Predicates.<Map.Entry<K, V>>all(p));
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"Predicate",
"<",
"Map",
"<",
"K",
",",
"V",
">",
">",
"allEntries",
"(",
"Predicate",
"<",
"?",
"super",
"Map",
".",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"p",
")",
"{",
"return",
"forEntries",
"("... | Returns a predicate that applies {@code all(p)} to the entries of
its argument. | [
"Returns",
"a",
"predicate",
"that",
"applies",
"{"
] | train | https://github.com/konvergeio/cofoja/blob/6ded58fa05eb5bf85f16353c8dd4c70bee59121a/src/main/java/com/google/java/contract/util/Predicates.java#L307-L310 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/Collections.java | Collections.anyWithin | public static SatisfiesBuilder anyWithin(String variable, Expression expression) {
"""
Create an ANY comprehension with a first WITHIN range.
ANY is a range predicate that allows you to test a Boolean condition over the
elements or attributes of a collection, object, or objects. It uses the IN and WITHIN opera... | java | public static SatisfiesBuilder anyWithin(String variable, Expression expression) {
return new SatisfiesBuilder(x("ANY"), variable, expression, false);
} | [
"public",
"static",
"SatisfiesBuilder",
"anyWithin",
"(",
"String",
"variable",
",",
"Expression",
"expression",
")",
"{",
"return",
"new",
"SatisfiesBuilder",
"(",
"x",
"(",
"\"ANY\"",
")",
",",
"variable",
",",
"expression",
",",
"false",
")",
";",
"}"
] | Create an ANY comprehension with a first WITHIN range.
ANY is a range predicate that allows you to test a Boolean condition over the
elements or attributes of a collection, object, or objects. It uses the IN and WITHIN operators to range through
the collection.
IN ranges in the direct elements of its array expression,... | [
"Create",
"an",
"ANY",
"comprehension",
"with",
"a",
"first",
"WITHIN",
"range",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/Collections.java#L184-L186 |
JodaOrg/joda-time | src/main/java/org/joda/time/Duration.java | Duration.withDurationAdded | public Duration withDurationAdded(long durationToAdd, int scalar) {
"""
Returns a new duration with this length plus that specified multiplied by the scalar.
This instance is immutable and is not altered.
<p>
If the addition is zero, this instance is returned.
@param durationToAdd the duration to add to thi... | java | public Duration withDurationAdded(long durationToAdd, int scalar) {
if (durationToAdd == 0 || scalar == 0) {
return this;
}
long add = FieldUtils.safeMultiply(durationToAdd, scalar);
long duration = FieldUtils.safeAdd(getMillis(), add);
return new Duration(duration);
... | [
"public",
"Duration",
"withDurationAdded",
"(",
"long",
"durationToAdd",
",",
"int",
"scalar",
")",
"{",
"if",
"(",
"durationToAdd",
"==",
"0",
"||",
"scalar",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"long",
"add",
"=",
"FieldUtils",
".",
"safeM... | Returns a new duration with this length plus that specified multiplied by the scalar.
This instance is immutable and is not altered.
<p>
If the addition is zero, this instance is returned.
@param durationToAdd the duration to add to this one
@param scalar the amount of times to add, such as -1 to subtract once
@retu... | [
"Returns",
"a",
"new",
"duration",
"with",
"this",
"length",
"plus",
"that",
"specified",
"multiplied",
"by",
"the",
"scalar",
".",
"This",
"instance",
"is",
"immutable",
"and",
"is",
"not",
"altered",
".",
"<p",
">",
"If",
"the",
"addition",
"is",
"zero",... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/Duration.java#L390-L397 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java | PathfindableModel.checkObjectId | private boolean checkObjectId(int dtx, int dty) {
"""
Check if the object id location is available for the pathfindable.
@param dtx The tile horizontal destination.
@param dty The tile vertical destination.
@return <code>true</code> if available, <code>false</code> else.
"""
final int tw = transfo... | java | private boolean checkObjectId(int dtx, int dty)
{
final int tw = transformable.getWidth() / map.getTileWidth();
final int th = transformable.getHeight() / map.getTileHeight();
for (int tx = dtx; tx < dtx + tw; tx++)
{
for (int ty = dty; ty < dty + th; ty++)
{
... | [
"private",
"boolean",
"checkObjectId",
"(",
"int",
"dtx",
",",
"int",
"dty",
")",
"{",
"final",
"int",
"tw",
"=",
"transformable",
".",
"getWidth",
"(",
")",
"/",
"map",
".",
"getTileWidth",
"(",
")",
";",
"final",
"int",
"th",
"=",
"transformable",
".... | Check if the object id location is available for the pathfindable.
@param dtx The tile horizontal destination.
@param dty The tile vertical destination.
@return <code>true</code> if available, <code>false</code> else. | [
"Check",
"if",
"the",
"object",
"id",
"location",
"is",
"available",
"for",
"the",
"pathfindable",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/pathfinding/PathfindableModel.java#L434-L450 |
ben-manes/caffeine | jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java | CacheProxy.deleteAllToCacheWriter | private @Nullable CacheWriterException deleteAllToCacheWriter(Set<? extends K> keys) {
"""
Deletes all of the entries using the cache writer, retaining only the keys that succeeded.
"""
if (!configuration.isWriteThrough() || keys.isEmpty()) {
return null;
}
List<K> keysToDelete = new ArrayLis... | java | private @Nullable CacheWriterException deleteAllToCacheWriter(Set<? extends K> keys) {
if (!configuration.isWriteThrough() || keys.isEmpty()) {
return null;
}
List<K> keysToDelete = new ArrayList<>(keys);
try {
writer.deleteAll(keysToDelete);
return null;
} catch (CacheWriterExcept... | [
"private",
"@",
"Nullable",
"CacheWriterException",
"deleteAllToCacheWriter",
"(",
"Set",
"<",
"?",
"extends",
"K",
">",
"keys",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"isWriteThrough",
"(",
")",
"||",
"keys",
".",
"isEmpty",
"(",
")",
")",
"{",
... | Deletes all of the entries using the cache writer, retaining only the keys that succeeded. | [
"Deletes",
"all",
"of",
"the",
"entries",
"using",
"the",
"cache",
"writer",
"retaining",
"only",
"the",
"keys",
"that",
"succeeded",
"."
] | train | https://github.com/ben-manes/caffeine/blob/4cf6d6e6a18ea2e8088f166261e5949343b0f2eb/jcache/src/main/java/com/github/benmanes/caffeine/jcache/CacheProxy.java#L1032-L1047 |
OwlPlatform/java-owl-worldmodel | src/main/java/com/owlplatform/worldmodel/client/WorldState.java | WorldState.addState | public void addState(final String id, final Collection<Attribute> attributes) {
"""
Binds a set of Attribute values to an identifier.
@param id
the identifier
@param attributes
the set of attributes.
"""
this.stateMap.put(id, attributes);
} | java | public void addState(final String id, final Collection<Attribute> attributes) {
this.stateMap.put(id, attributes);
} | [
"public",
"void",
"addState",
"(",
"final",
"String",
"id",
",",
"final",
"Collection",
"<",
"Attribute",
">",
"attributes",
")",
"{",
"this",
".",
"stateMap",
".",
"put",
"(",
"id",
",",
"attributes",
")",
";",
"}"
] | Binds a set of Attribute values to an identifier.
@param id
the identifier
@param attributes
the set of attributes. | [
"Binds",
"a",
"set",
"of",
"Attribute",
"values",
"to",
"an",
"identifier",
"."
] | train | https://github.com/OwlPlatform/java-owl-worldmodel/blob/a850e8b930c6e9787c7cad30c0de887858ca563d/src/main/java/com/owlplatform/worldmodel/client/WorldState.java#L50-L52 |
landawn/AbacusUtil | src/com/landawn/abacus/util/StringUtil.java | StringUtil.deleteWhitespace | public static String deleteWhitespace(final String str) {
"""
<p>
Deletes all white spaces from a String as defined by
{@link Character#isWhitespace(char)}.
</p>
<pre>
N.deleteWhitespace(null) = null
N.deleteWhitespace("") = ""
N.deleteWhitespace("abc") = "abc"
N.deleteWhitespace... | java | public static String deleteWhitespace(final String str) {
if (N.isNullOrEmpty(str)) {
return str;
}
final char[] chars = getCharsForReadOnly(str);
final char[] cbuf = new char[chars.length];
int count = 0;
for (int i = 0, len = chars.length; i < len; ... | [
"public",
"static",
"String",
"deleteWhitespace",
"(",
"final",
"String",
"str",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"str",
")",
")",
"{",
"return",
"str",
";",
"}",
"final",
"char",
"[",
"]",
"chars",
"=",
"getCharsForReadOnly",
"(",
... | <p>
Deletes all white spaces from a String as defined by
{@link Character#isWhitespace(char)}.
</p>
<pre>
N.deleteWhitespace(null) = null
N.deleteWhitespace("") = ""
N.deleteWhitespace("abc") = "abc"
N.deleteWhitespace(" ab c ") = "abc"
</pre>
@param str
the String to delete whitespace fr... | [
"<p",
">",
"Deletes",
"all",
"white",
"spaces",
"from",
"a",
"String",
"as",
"defined",
"by",
"{",
"@link",
"Character#isWhitespace",
"(",
"char",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L2246-L2261 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java | XBaseGridScreen.printEndRecordData | public void printEndRecordData(Rec record, PrintWriter out, int iPrintOptions) {
"""
Display the end record in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception.
"""
String strRecordName = record.getTableNa... | java | public void printEndRecordData(Rec record, PrintWriter out, int iPrintOptions)
{
String strRecordName = record.getTableNames(false);
if ((strRecordName == null) || (strRecordName.length() == 0))
strRecordName = "Record";
out.println(Utility.endTag(strRecordName));
} | [
"public",
"void",
"printEndRecordData",
"(",
"Rec",
"record",
",",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"String",
"strRecordName",
"=",
"record",
".",
"getTableNames",
"(",
"false",
")",
";",
"if",
"(",
"(",
"strRecordName",
"==",
"nu... | Display the end record in input format.
@return true if default params were found for this form.
@param out The http output stream.
@exception DBException File exception. | [
"Display",
"the",
"end",
"record",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBaseGridScreen.java#L223-L229 |
perwendel/spark | src/main/java/spark/serialization/Serializer.java | Serializer.processElement | public void processElement(OutputStream outputStream, Object element) throws IOException {
"""
Wraps {@link Serializer#process(java.io.OutputStream, Object)} and calls next serializer in chain.
@param outputStream the output stream.
@param element the element to process.
@throws IOException IOException i... | java | public void processElement(OutputStream outputStream, Object element) throws IOException {
if (canProcess(element)) {
process(outputStream, element);
} else {
if (next != null) {
this.next.processElement(outputStream, element);
}
}
} | [
"public",
"void",
"processElement",
"(",
"OutputStream",
"outputStream",
",",
"Object",
"element",
")",
"throws",
"IOException",
"{",
"if",
"(",
"canProcess",
"(",
"element",
")",
")",
"{",
"process",
"(",
"outputStream",
",",
"element",
")",
";",
"}",
"else... | Wraps {@link Serializer#process(java.io.OutputStream, Object)} and calls next serializer in chain.
@param outputStream the output stream.
@param element the element to process.
@throws IOException IOException in case of IO error. | [
"Wraps",
"{",
"@link",
"Serializer#process",
"(",
"java",
".",
"io",
".",
"OutputStream",
"Object",
")",
"}",
"and",
"calls",
"next",
"serializer",
"in",
"chain",
"."
] | train | https://github.com/perwendel/spark/blob/080fb1f9d6e580f6742e9589044c7420d3157b8b/src/main/java/spark/serialization/Serializer.java#L47-L55 |
cdk/cdk | tool/sdg/src/main/java/org/openscience/cdk/layout/OverlapResolver.java | OverlapResolver.areIntersected | public boolean areIntersected(IBond bond1, IBond bond2) {
"""
Checks if two bonds cross each other.
@param bond1 Description of the Parameter
@param bond2 Description of the Parameter
@return Description of the Return Value
"""
double x1 = 0, x2 = 0, x3 = 0, x4 = 0;
double y1 = ... | java | public boolean areIntersected(IBond bond1, IBond bond2) {
double x1 = 0, x2 = 0, x3 = 0, x4 = 0;
double y1 = 0, y2 = 0, y3 = 0, y4 = 0;
//Point2D.Double p1 = null, p2 = null, p3 = null, p4 = null;
x1 = bond1.getBegin().getPoint2d().x;
x2 = bond1.getEnd().getPoint2d().x;
... | [
"public",
"boolean",
"areIntersected",
"(",
"IBond",
"bond1",
",",
"IBond",
"bond2",
")",
"{",
"double",
"x1",
"=",
"0",
",",
"x2",
"=",
"0",
",",
"x3",
"=",
"0",
",",
"x4",
"=",
"0",
";",
"double",
"y1",
"=",
"0",
",",
"y2",
"=",
"0",
",",
"... | Checks if two bonds cross each other.
@param bond1 Description of the Parameter
@param bond2 Description of the Parameter
@return Description of the Return Value | [
"Checks",
"if",
"two",
"bonds",
"cross",
"each",
"other",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/sdg/src/main/java/org/openscience/cdk/layout/OverlapResolver.java#L245-L268 |
stevespringett/Alpine | alpine/src/main/java/alpine/crypto/DataEncryption.java | DataEncryption.encryptAsBytes | public static byte[] encryptAsBytes(final String plainText) throws Exception {
"""
Encrypts the specified plainText using AES-256. This method uses the default secret key.
@param plainText the text to encrypt
@return the encrypted bytes
@throws Exception a number of exceptions may be thrown
@since 1.3.0
""... | java | public static byte[] encryptAsBytes(final String plainText) throws Exception {
final SecretKey secretKey = KeyManager.getInstance().getSecretKey();
return encryptAsBytes(secretKey, plainText);
} | [
"public",
"static",
"byte",
"[",
"]",
"encryptAsBytes",
"(",
"final",
"String",
"plainText",
")",
"throws",
"Exception",
"{",
"final",
"SecretKey",
"secretKey",
"=",
"KeyManager",
".",
"getInstance",
"(",
")",
".",
"getSecretKey",
"(",
")",
";",
"return",
"e... | Encrypts the specified plainText using AES-256. This method uses the default secret key.
@param plainText the text to encrypt
@return the encrypted bytes
@throws Exception a number of exceptions may be thrown
@since 1.3.0 | [
"Encrypts",
"the",
"specified",
"plainText",
"using",
"AES",
"-",
"256",
".",
"This",
"method",
"uses",
"the",
"default",
"secret",
"key",
"."
] | train | https://github.com/stevespringett/Alpine/blob/6c5ef5e1ba4f38922096f1307d3950c09edb3093/alpine/src/main/java/alpine/crypto/DataEncryption.java#L81-L84 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.getAccountAdjustments | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type) {
"""
Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@return the adjustments on the account
"""
... | java | public Adjustments getAccountAdjustments(final String accountCode, final Adjustments.AdjustmentType type) {
return getAccountAdjustments(accountCode, type, null, new QueryParams());
} | [
"public",
"Adjustments",
"getAccountAdjustments",
"(",
"final",
"String",
"accountCode",
",",
"final",
"Adjustments",
".",
"AdjustmentType",
"type",
")",
"{",
"return",
"getAccountAdjustments",
"(",
"accountCode",
",",
"type",
",",
"null",
",",
"new",
"QueryParams",... | Get Account Adjustments
<p>
@param accountCode recurly account id
@param type {@link com.ning.billing.recurly.model.Adjustments.AdjustmentType}
@return the adjustments on the account | [
"Get",
"Account",
"Adjustments",
"<p",
">"
] | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L387-L389 |
jparsec/jparsec | jparsec/src/main/java/org/jparsec/ParseContext.java | ParseContext.applyNewNode | final boolean applyNewNode(Parser<?> parser, String name) {
"""
Applies {@code parser} as a new tree node with {@code name}, and if fails, reports
"expecting $name".
"""
int physical = at;
int logical = step;
TreeNode latestChild = trace.getLatestChild();
trace.push(name);
if (parser.apply... | java | final boolean applyNewNode(Parser<?> parser, String name) {
int physical = at;
int logical = step;
TreeNode latestChild = trace.getLatestChild();
trace.push(name);
if (parser.apply(this)) {
trace.setCurrentResult(result);
trace.pop();
return true;
}
if (stillThere(physical,... | [
"final",
"boolean",
"applyNewNode",
"(",
"Parser",
"<",
"?",
">",
"parser",
",",
"String",
"name",
")",
"{",
"int",
"physical",
"=",
"at",
";",
"int",
"logical",
"=",
"step",
";",
"TreeNode",
"latestChild",
"=",
"trace",
".",
"getLatestChild",
"(",
")",
... | Applies {@code parser} as a new tree node with {@code name}, and if fails, reports
"expecting $name". | [
"Applies",
"{"
] | train | https://github.com/jparsec/jparsec/blob/df1280259f5da9eb5ffc537437569dddba66cb94/jparsec/src/main/java/org/jparsec/ParseContext.java#L140-L155 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/masterslave/AsyncConnections.java | AsyncConnections.addConnection | public void addConnection(RedisURI redisURI, CompletableFuture<StatefulRedisConnection<String, String>> connection) {
"""
Add a connection for a {@link RedisURI}
@param redisURI
@param connection
"""
connections.put(redisURI, connection);
} | java | public void addConnection(RedisURI redisURI, CompletableFuture<StatefulRedisConnection<String, String>> connection) {
connections.put(redisURI, connection);
} | [
"public",
"void",
"addConnection",
"(",
"RedisURI",
"redisURI",
",",
"CompletableFuture",
"<",
"StatefulRedisConnection",
"<",
"String",
",",
"String",
">",
">",
"connection",
")",
"{",
"connections",
".",
"put",
"(",
"redisURI",
",",
"connection",
")",
";",
"... | Add a connection for a {@link RedisURI}
@param redisURI
@param connection | [
"Add",
"a",
"connection",
"for",
"a",
"{",
"@link",
"RedisURI",
"}"
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/masterslave/AsyncConnections.java#L50-L52 |
wwadge/bonecp | bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java | MemorizeTransactionProxy.runWithPossibleProxySwap | private Object runWithPossibleProxySwap(Method method, Object target, Object[] args)
throws IllegalAccessException, InvocationTargetException {
"""
Runs the given method with the specified arguments, substituting with proxies where necessary
@param method
@param target proxy target
@param args
@return Proxy... | java | private Object runWithPossibleProxySwap(Method method, Object target, Object[] args)
throws IllegalAccessException, InvocationTargetException {
Object result;
// swap with proxies to these too.
if (method.getName().equals("createStatement")){
result = memorize((Statement)method.invoke(target, args), this.co... | [
"private",
"Object",
"runWithPossibleProxySwap",
"(",
"Method",
"method",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"Object",
"result",
";",
"// swap with proxies to these to... | Runs the given method with the specified arguments, substituting with proxies where necessary
@param method
@param target proxy target
@param args
@return Proxy-fied result for statements, actual call result otherwise
@throws IllegalAccessException
@throws InvocationTargetException | [
"Runs",
"the",
"given",
"method",
"with",
"the",
"specified",
"arguments",
"substituting",
"with",
"proxies",
"where",
"necessary"
] | train | https://github.com/wwadge/bonecp/blob/74bc3287025fc137ca28909f0f7693edae37a15d/bonecp/src/main/java/com/jolbox/bonecp/MemorizeTransactionProxy.java#L246-L261 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_plesk_duration_GET | public OvhOrder vps_serviceName_plesk_duration_GET(String serviceName, String duration, OvhPleskLicenseDomainNumberEnum domainNumber) throws IOException {
"""
Get prices and contracts information
REST: GET /order/vps/{serviceName}/plesk/{duration}
@param domainNumber [required] Domain number you want to order ... | java | public OvhOrder vps_serviceName_plesk_duration_GET(String serviceName, String duration, OvhPleskLicenseDomainNumberEnum domainNumber) throws IOException {
String qPath = "/order/vps/{serviceName}/plesk/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
query(sb, "domainNumber", domainNumber);
S... | [
"public",
"OvhOrder",
"vps_serviceName_plesk_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhPleskLicenseDomainNumberEnum",
"domainNumber",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/plesk/{duration}\"... | Get prices and contracts information
REST: GET /order/vps/{serviceName}/plesk/{duration}
@param domainNumber [required] Domain number you want to order a licence for
@param serviceName [required] The internal name of your VPS offer
@param duration [required] Duration
@deprecated | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3325-L3331 |
fullcontact/hadoop-sstable | sstable-core/src/main/java/com/fullcontact/cassandra/io/compress/CompressionMetadata.java | CompressionMetadata.chunkFor | public Chunk chunkFor(long position) {
"""
Get a chunk of compressed data (offset, length) corresponding to given position
@param position Position in the file.
@return pair of chunk offset and length.
"""
// position of the chunk
int idx = 8 * (int) (position / parameters.chunkLength());
... | java | public Chunk chunkFor(long position) {
// position of the chunk
int idx = 8 * (int) (position / parameters.chunkLength());
if (idx >= chunkOffsets.size())
throw new CorruptSSTableException(new EOFException(), indexFilePath);
long chunkOffset = chunkOffsets.getLong(idx);
... | [
"public",
"Chunk",
"chunkFor",
"(",
"long",
"position",
")",
"{",
"// position of the chunk",
"int",
"idx",
"=",
"8",
"*",
"(",
"int",
")",
"(",
"position",
"/",
"parameters",
".",
"chunkLength",
"(",
")",
")",
";",
"if",
"(",
"idx",
">=",
"chunkOffsets"... | Get a chunk of compressed data (offset, length) corresponding to given position
@param position Position in the file.
@return pair of chunk offset and length. | [
"Get",
"a",
"chunk",
"of",
"compressed",
"data",
"(",
"offset",
"length",
")",
"corresponding",
"to",
"given",
"position"
] | train | https://github.com/fullcontact/hadoop-sstable/blob/1189c2cb3a2cbbe03b75fda1cf02698e6283dfb2/sstable-core/src/main/java/com/fullcontact/cassandra/io/compress/CompressionMetadata.java#L163-L176 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnformssoaction.java | vpnformssoaction.get | public static vpnformssoaction get(nitro_service service, String name) throws Exception {
"""
Use this API to fetch vpnformssoaction resource of given name .
"""
vpnformssoaction obj = new vpnformssoaction();
obj.set_name(name);
vpnformssoaction response = (vpnformssoaction) obj.get_resource(service);
... | java | public static vpnformssoaction get(nitro_service service, String name) throws Exception{
vpnformssoaction obj = new vpnformssoaction();
obj.set_name(name);
vpnformssoaction response = (vpnformssoaction) obj.get_resource(service);
return response;
} | [
"public",
"static",
"vpnformssoaction",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"name",
")",
"throws",
"Exception",
"{",
"vpnformssoaction",
"obj",
"=",
"new",
"vpnformssoaction",
"(",
")",
";",
"obj",
".",
"set_name",
"(",
"name",
")",
";",
"... | Use this API to fetch vpnformssoaction resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"vpnformssoaction",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/vpn/vpnformssoaction.java#L450-L455 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/DemoRule.java | DemoRule.match | @Override
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException {
"""
This is the method with the error detection logic that you need to implement:
"""
List<RuleMatch> ruleMatches = new ArrayList<>();
// Let's get all the tokens (i.e. words) of this sentence, but not the spaces:
... | java | @Override
public RuleMatch[] match(AnalyzedSentence sentence) throws IOException {
List<RuleMatch> ruleMatches = new ArrayList<>();
// Let's get all the tokens (i.e. words) of this sentence, but not the spaces:
AnalyzedTokenReadings[] tokens = sentence.getTokensWithoutWhitespace();
// No let's i... | [
"@",
"Override",
"public",
"RuleMatch",
"[",
"]",
"match",
"(",
"AnalyzedSentence",
"sentence",
")",
"throws",
"IOException",
"{",
"List",
"<",
"RuleMatch",
">",
"ruleMatches",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"// Let's get all the tokens (i.e. words)... | This is the method with the error detection logic that you need to implement: | [
"This",
"is",
"the",
"method",
"with",
"the",
"error",
"detection",
"logic",
"that",
"you",
"need",
"to",
"implement",
":"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/DemoRule.java#L52-L83 |
googleapis/cloud-bigtable-client | bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java | BigtableClusterUtilities.lookupInstanceId | public static String lookupInstanceId(String projectId, String clusterId, String zoneId)
throws IOException {
"""
@return The instance id associated with the given project, zone and cluster. We expect instance
and cluster to have one-to-one relationship.
@throws IllegalStateException if the cluster is not ... | java | public static String lookupInstanceId(String projectId, String clusterId, String zoneId)
throws IOException {
BigtableClusterUtilities utils;
try {
utils = BigtableClusterUtilities.forAllInstances(projectId);
} catch (GeneralSecurityException e) {
throw new RuntimeException("Could not initia... | [
"public",
"static",
"String",
"lookupInstanceId",
"(",
"String",
"projectId",
",",
"String",
"clusterId",
",",
"String",
"zoneId",
")",
"throws",
"IOException",
"{",
"BigtableClusterUtilities",
"utils",
";",
"try",
"{",
"utils",
"=",
"BigtableClusterUtilities",
".",... | @return The instance id associated with the given project, zone and cluster. We expect instance
and cluster to have one-to-one relationship.
@throws IllegalStateException if the cluster is not found | [
"@return",
"The",
"instance",
"id",
"associated",
"with",
"the",
"given",
"project",
"zone",
"and",
"cluster",
".",
"We",
"expect",
"instance",
"and",
"cluster",
"to",
"have",
"one",
"-",
"to",
"-",
"one",
"relationship",
"."
] | train | https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/grpc/BigtableClusterUtilities.java#L79-L98 |
alkacon/opencms-core | src/org/opencms/ui/contextmenu/CmsContextMenu.java | CmsContextMenu.openForTable | public void openForTable(ClickEvent event, Object itemId, Object propertyId, Table table) {
"""
Opens the context menu of the given table.<p>
@param event the click event
@param itemId of clicked item
@param propertyId of clicked item
@param table the table
"""
fireEvent(new ContextMenuOpenedOnT... | java | public void openForTable(ClickEvent event, Object itemId, Object propertyId, Table table) {
fireEvent(new ContextMenuOpenedOnTableRowEvent(this, table, itemId, propertyId));
open(event.getClientX(), event.getClientY());
} | [
"public",
"void",
"openForTable",
"(",
"ClickEvent",
"event",
",",
"Object",
"itemId",
",",
"Object",
"propertyId",
",",
"Table",
"table",
")",
"{",
"fireEvent",
"(",
"new",
"ContextMenuOpenedOnTableRowEvent",
"(",
"this",
",",
"table",
",",
"itemId",
",",
"pr... | Opens the context menu of the given table.<p>
@param event the click event
@param itemId of clicked item
@param propertyId of clicked item
@param table the table | [
"Opens",
"the",
"context",
"menu",
"of",
"the",
"given",
"table",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/contextmenu/CmsContextMenu.java#L1135-L1140 |
OpenTSDB/opentsdb | src/core/Internal.java | Internal.extractDataPoints | public static ArrayList<Cell> extractDataPoints(final KeyValue column) {
"""
Extracts the data points from a single column.
While it's meant for use on a compacted column, you can pass any other type
of column and it will be returned. If the column represents a data point,
a single cell will be returned. If the... | java | public static ArrayList<Cell> extractDataPoints(final KeyValue column) {
final ArrayList<KeyValue> row = new ArrayList<KeyValue>(1);
row.add(column);
return extractDataPoints(row, column.qualifier().length / 2);
} | [
"public",
"static",
"ArrayList",
"<",
"Cell",
">",
"extractDataPoints",
"(",
"final",
"KeyValue",
"column",
")",
"{",
"final",
"ArrayList",
"<",
"KeyValue",
">",
"row",
"=",
"new",
"ArrayList",
"<",
"KeyValue",
">",
"(",
"1",
")",
";",
"row",
".",
"add",... | Extracts the data points from a single column.
While it's meant for use on a compacted column, you can pass any other type
of column and it will be returned. If the column represents a data point,
a single cell will be returned. If the column contains an annotation or
other object, the result will be an empty array lis... | [
"Extracts",
"the",
"data",
"points",
"from",
"a",
"single",
"column",
".",
"While",
"it",
"s",
"meant",
"for",
"use",
"on",
"a",
"compacted",
"column",
"you",
"can",
"pass",
"any",
"other",
"type",
"of",
"column",
"and",
"it",
"will",
"be",
"returned",
... | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/core/Internal.java#L216-L220 |
iron-io/iron_mq_java | src/main/java/io/iron/ironmq/Queue.java | Queue.touchMessage | public MessageOptions touchMessage(String id, String reservationId) throws IOException {
"""
Touching a reserved message extends its timeout to the duration specified when the message was created.
@param id The ID of the message to delete.
@param reservationId This id is returned when you reserve a message and... | java | public MessageOptions touchMessage(String id, String reservationId) throws IOException {
return touchMessage(id, reservationId, null);
} | [
"public",
"MessageOptions",
"touchMessage",
"(",
"String",
"id",
",",
"String",
"reservationId",
")",
"throws",
"IOException",
"{",
"return",
"touchMessage",
"(",
"id",
",",
"reservationId",
",",
"null",
")",
";",
"}"
] | Touching a reserved message extends its timeout to the duration specified when the message was created.
@param id The ID of the message to delete.
@param reservationId This id is returned when you reserve a message and must be provided to delete a message that is reserved.
@throws io.iron.ironmq.HTTPException If the ... | [
"Touching",
"a",
"reserved",
"message",
"extends",
"its",
"timeout",
"to",
"the",
"duration",
"specified",
"when",
"the",
"message",
"was",
"created",
"."
] | train | https://github.com/iron-io/iron_mq_java/blob/62d6a86545ca7ef31b7b4797aae0c5b31394a507/src/main/java/io/iron/ironmq/Queue.java#L222-L224 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java | StrSpliter.split | public static List<String> split(String str, char separator, int limit, boolean isTrim, boolean ignoreEmpty) {
"""
切分字符串,大小写敏感
@param str 被切分的字符串
@param separator 分隔符字符
@param limit 限制分片数,-1不限制
@param isTrim 是否去除切分字符串后每个元素两边的空格
@param ignoreEmpty 是否忽略空串
@return 切分后的集合
@since 3.0.8
"""
return split(... | java | public static List<String> split(String str, char separator, int limit, boolean isTrim, boolean ignoreEmpty){
return split(str, separator, limit, isTrim, ignoreEmpty, false);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"split",
"(",
"String",
"str",
",",
"char",
"separator",
",",
"int",
"limit",
",",
"boolean",
"isTrim",
",",
"boolean",
"ignoreEmpty",
")",
"{",
"return",
"split",
"(",
"str",
",",
"separator",
",",
"limit"... | 切分字符串,大小写敏感
@param str 被切分的字符串
@param separator 分隔符字符
@param limit 限制分片数,-1不限制
@param isTrim 是否去除切分字符串后每个元素两边的空格
@param ignoreEmpty 是否忽略空串
@return 切分后的集合
@since 3.0.8 | [
"切分字符串,大小写敏感"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L119-L121 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResult.java | UpdateRouteResult.withRequestModels | public UpdateRouteResult withRequestModels(java.util.Map<String, String> requestModels) {
"""
<p>
The request models for the route.
</p>
@param requestModels
The request models for the route.
@return Returns a reference to this object so that method calls can be chained together.
"""
setRequestM... | java | public UpdateRouteResult withRequestModels(java.util.Map<String, String> requestModels) {
setRequestModels(requestModels);
return this;
} | [
"public",
"UpdateRouteResult",
"withRequestModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestModels",
")",
"{",
"setRequestModels",
"(",
"requestModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The request models for the route.
</p>
@param requestModels
The request models for the route.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"request",
"models",
"for",
"the",
"route",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/UpdateRouteResult.java#L486-L489 |
osglworks/java-tool | src/main/java/org/osgl/util/IO.java | IO.readContentAsString | public static String readContentAsString(File file, String encoding) {
"""
Read file content to a String
@param file
The file to read
@param encoding
encoding used to read the file into string content
@return The String content
"""
try {
return readContentAsString(new FileInputStream... | java | public static String readContentAsString(File file, String encoding) {
try {
return readContentAsString(new FileInputStream(file), encoding);
} catch (FileNotFoundException e) {
throw E.ioException(e);
}
} | [
"public",
"static",
"String",
"readContentAsString",
"(",
"File",
"file",
",",
"String",
"encoding",
")",
"{",
"try",
"{",
"return",
"readContentAsString",
"(",
"new",
"FileInputStream",
"(",
"file",
")",
",",
"encoding",
")",
";",
"}",
"catch",
"(",
"FileNo... | Read file content to a String
@param file
The file to read
@param encoding
encoding used to read the file into string content
@return The String content | [
"Read",
"file",
"content",
"to",
"a",
"String"
] | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/IO.java#L1553-L1559 |
federkasten/appbundle-maven-plugin | src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java | CreateApplicationBundleMojo.copyDependencies | private List<String> copyDependencies(File javaDirectory) throws MojoExecutionException {
"""
Copy all dependencies into the $JAVAROOT directory
@param javaDirectory where to put jar files
@return A list of file names added
@throws MojoExecutionException
"""
ArtifactRepositoryLayout layout = new D... | java | private List<String> copyDependencies(File javaDirectory) throws MojoExecutionException {
ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();
List<String> list = new ArrayList<String>();
// First, copy the project's own artifact
File artifactFile = project.getArtifact().ge... | [
"private",
"List",
"<",
"String",
">",
"copyDependencies",
"(",
"File",
"javaDirectory",
")",
"throws",
"MojoExecutionException",
"{",
"ArtifactRepositoryLayout",
"layout",
"=",
"new",
"DefaultRepositoryLayout",
"(",
")",
";",
"List",
"<",
"String",
">",
"list",
"... | Copy all dependencies into the $JAVAROOT directory
@param javaDirectory where to put jar files
@return A list of file names added
@throws MojoExecutionException | [
"Copy",
"all",
"dependencies",
"into",
"the",
"$JAVAROOT",
"directory"
] | train | https://github.com/federkasten/appbundle-maven-plugin/blob/4cdaf7e0da95c83bc8a045ba40cb3eef45d25a5f/src/main/java/sh/tak/appbundler/CreateApplicationBundleMojo.java#L511-L547 |
grpc/grpc-java | okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/DistinguishedNameParser.java | DistinguishedNameParser.quotedAV | private String quotedAV() {
"""
gets quoted attribute value: QUOTATION *( quotechar / pair ) QUOTATION
"""
pos++;
beg = pos;
end = beg;
while (true) {
if (pos == length) {
throw new IllegalStateException("Unexpected end of DN: " + dn);
}
if (chars[pos] == '"') {
... | java | private String quotedAV() {
pos++;
beg = pos;
end = beg;
while (true) {
if (pos == length) {
throw new IllegalStateException("Unexpected end of DN: " + dn);
}
if (chars[pos] == '"') {
// enclosing quotation was found
pos++;
break;
} else if (char... | [
"private",
"String",
"quotedAV",
"(",
")",
"{",
"pos",
"++",
";",
"beg",
"=",
"pos",
";",
"end",
"=",
"beg",
";",
"while",
"(",
"true",
")",
"{",
"if",
"(",
"pos",
"==",
"length",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Unexpected ... | gets quoted attribute value: QUOTATION *( quotechar / pair ) QUOTATION | [
"gets",
"quoted",
"attribute",
"value",
":",
"QUOTATION",
"*",
"(",
"quotechar",
"/",
"pair",
")",
"QUOTATION"
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/okhttp/third_party/okhttp/main/java/io/grpc/okhttp/internal/DistinguishedNameParser.java#L107-L137 |
alkacon/opencms-core | src/org/opencms/widgets/CmsHtmlWidget.java | CmsHtmlWidget.getJSONConfiguration | protected JSONObject getJSONConfiguration(CmsObject cms, CmsResource resource, Locale contentLocale) {
"""
Returns the WYSIWYG editor configuration as a JSON object.<p>
@param cms the OpenCms context
@param resource the edited resource
@param contentLocale the edited content locale
@return the configuratio... | java | protected JSONObject getJSONConfiguration(CmsObject cms, CmsResource resource, Locale contentLocale) {
return getJSONConfiguration(getHtmlWidgetOption(), cms, resource, contentLocale);
} | [
"protected",
"JSONObject",
"getJSONConfiguration",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
",",
"Locale",
"contentLocale",
")",
"{",
"return",
"getJSONConfiguration",
"(",
"getHtmlWidgetOption",
"(",
")",
",",
"cms",
",",
"resource",
",",
"contentLo... | Returns the WYSIWYG editor configuration as a JSON object.<p>
@param cms the OpenCms context
@param resource the edited resource
@param contentLocale the edited content locale
@return the configuration | [
"Returns",
"the",
"WYSIWYG",
"editor",
"configuration",
"as",
"a",
"JSON",
"object",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/CmsHtmlWidget.java#L440-L443 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/text/StrBuilder.java | StrBuilder.appendln | @GwtIncompatible("incompatible method")
public StrBuilder appendln(final String format, final Object... objs) {
"""
Calls {@link String#format(String, Object...)} and appends the result.
@param format the format string
@param objs the objects to use in the format string
@return {@code this} to enable chai... | java | @GwtIncompatible("incompatible method")
public StrBuilder appendln(final String format, final Object... objs) {
return append(format, objs).appendNewLine();
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"StrBuilder",
"appendln",
"(",
"final",
"String",
"format",
",",
"final",
"Object",
"...",
"objs",
")",
"{",
"return",
"append",
"(",
"format",
",",
"objs",
")",
".",
"appendNewLine",
"(",
... | Calls {@link String#format(String, Object...)} and appends the result.
@param format the format string
@param objs the objects to use in the format string
@return {@code this} to enable chaining
@see String#format(String, Object...)
@since 3.2 | [
"Calls",
"{",
"@link",
"String#format",
"(",
"String",
"Object",
"...",
")",
"}",
"and",
"appends",
"the",
"result",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/text/StrBuilder.java#L1003-L1006 |
DDTH/ddth-dao | ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java | GenericBoJdbcDao.getAllSorted | protected Stream<T> getAllSorted(Connection conn) {
"""
Fetch all existing BOs from storage, sorted by primary key(s) and return the result as a
stream.
@param conn
@return
@since 0.9.0
"""
return executeSelectAsStream(rowMapper, conn, true, calcSqlSelectAllSorted());
} | java | protected Stream<T> getAllSorted(Connection conn) {
return executeSelectAsStream(rowMapper, conn, true, calcSqlSelectAllSorted());
} | [
"protected",
"Stream",
"<",
"T",
">",
"getAllSorted",
"(",
"Connection",
"conn",
")",
"{",
"return",
"executeSelectAsStream",
"(",
"rowMapper",
",",
"conn",
",",
"true",
",",
"calcSqlSelectAllSorted",
"(",
")",
")",
";",
"}"
] | Fetch all existing BOs from storage, sorted by primary key(s) and return the result as a
stream.
@param conn
@return
@since 0.9.0 | [
"Fetch",
"all",
"existing",
"BOs",
"from",
"storage",
"sorted",
"by",
"primary",
"key",
"(",
"s",
")",
"and",
"return",
"the",
"result",
"as",
"a",
"stream",
"."
] | train | https://github.com/DDTH/ddth-dao/blob/8d059ddf641a1629aa53851f9d1b41abf175a180/ddth-dao-core/src/main/java/com/github/ddth/dao/jdbc/GenericBoJdbcDao.java#L616-L618 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java | ErrorBuilder.createErrorDescription | Description createErrorDescription(
ErrorMessage errorMessage, TreePath path, Description.Builder descriptionBuilder) {
"""
create an error description for a nullability warning
@param errorMessage the error message object.
@param path the TreePath to the error location. Used to compute a suggested fix a... | java | Description createErrorDescription(
ErrorMessage errorMessage, TreePath path, Description.Builder descriptionBuilder) {
Tree enclosingSuppressTree = suppressibleNode(path);
return createErrorDescription(errorMessage, enclosingSuppressTree, descriptionBuilder);
} | [
"Description",
"createErrorDescription",
"(",
"ErrorMessage",
"errorMessage",
",",
"TreePath",
"path",
",",
"Description",
".",
"Builder",
"descriptionBuilder",
")",
"{",
"Tree",
"enclosingSuppressTree",
"=",
"suppressibleNode",
"(",
"path",
")",
";",
"return",
"creat... | create an error description for a nullability warning
@param errorMessage the error message object.
@param path the TreePath to the error location. Used to compute a suggested fix at the
enclosing method for the error location
@param descriptionBuilder the description builder for the error.
@return the error descripti... | [
"create",
"an",
"error",
"description",
"for",
"a",
"nullability",
"warning"
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/ErrorBuilder.java#L78-L82 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicylabel_appfwpolicy_binding.java | appfwpolicylabel_appfwpolicy_binding.count_filtered | public static long count_filtered(nitro_service service, String labelname, String filter) throws Exception {
"""
Use this API to count the filtered set of appfwpolicylabel_appfwpolicy_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP".
"""
appfwpolicylabel_appfwpolicy_b... | java | public static long count_filtered(nitro_service service, String labelname, String filter) throws Exception{
appfwpolicylabel_appfwpolicy_binding obj = new appfwpolicylabel_appfwpolicy_binding();
obj.set_labelname(labelname);
options option = new options();
option.set_count(true);
option.set_filter(filter);
... | [
"public",
"static",
"long",
"count_filtered",
"(",
"nitro_service",
"service",
",",
"String",
"labelname",
",",
"String",
"filter",
")",
"throws",
"Exception",
"{",
"appfwpolicylabel_appfwpolicy_binding",
"obj",
"=",
"new",
"appfwpolicylabel_appfwpolicy_binding",
"(",
"... | Use this API to count the filtered set of appfwpolicylabel_appfwpolicy_binding resources.
filter string should be in JSON format.eg: "port:80,servicetype:HTTP". | [
"Use",
"this",
"API",
"to",
"count",
"the",
"filtered",
"set",
"of",
"appfwpolicylabel_appfwpolicy_binding",
"resources",
".",
"filter",
"string",
"should",
"be",
"in",
"JSON",
"format",
".",
"eg",
":",
"port",
":",
"80",
"servicetype",
":",
"HTTP",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/appfw/appfwpolicylabel_appfwpolicy_binding.java#L335-L346 |
protostuff/protostuff-compiler | protostuff-generator/src/main/java/io/protostuff/generator/html/uml/PlantUmlVerbatimSerializer.java | PlantUmlVerbatimSerializer.addToMap | public static void addToMap(final Map<String, VerbatimSerializer> serializerMap) {
"""
Register an instance of {@link PlantUmlVerbatimSerializer} in the given serializer's map.
"""
PlantUmlVerbatimSerializer serializer = new PlantUmlVerbatimSerializer();
for (Type type : Type.values()) {
... | java | public static void addToMap(final Map<String, VerbatimSerializer> serializerMap) {
PlantUmlVerbatimSerializer serializer = new PlantUmlVerbatimSerializer();
for (Type type : Type.values()) {
String name = type.getName();
serializerMap.put(name, serializer);
}
} | [
"public",
"static",
"void",
"addToMap",
"(",
"final",
"Map",
"<",
"String",
",",
"VerbatimSerializer",
">",
"serializerMap",
")",
"{",
"PlantUmlVerbatimSerializer",
"serializer",
"=",
"new",
"PlantUmlVerbatimSerializer",
"(",
")",
";",
"for",
"(",
"Type",
"type",
... | Register an instance of {@link PlantUmlVerbatimSerializer} in the given serializer's map. | [
"Register",
"an",
"instance",
"of",
"{"
] | train | https://github.com/protostuff/protostuff-compiler/blob/665256c42cb41da849e8321ffcab088350ace171/protostuff-generator/src/main/java/io/protostuff/generator/html/uml/PlantUmlVerbatimSerializer.java#L27-L33 |
structurizr/java | structurizr-core/src/com/structurizr/model/Model.java | Model.addPerson | @Nonnull
public Person addPerson(Location location, @Nonnull String name, @Nullable String description) {
"""
Creates a person and adds it to the model.
@param location the location of the person (e.g. internal, external, etc)
@param name the name of the person (e.g. "Admin User" or "Bob the Busi... | java | @Nonnull
public Person addPerson(Location location, @Nonnull String name, @Nullable String description) {
if (getPersonWithName(name) == null) {
Person person = new Person();
person.setLocation(location);
person.setName(name);
person.setDescription(description... | [
"@",
"Nonnull",
"public",
"Person",
"addPerson",
"(",
"Location",
"location",
",",
"@",
"Nonnull",
"String",
"name",
",",
"@",
"Nullable",
"String",
"description",
")",
"{",
"if",
"(",
"getPersonWithName",
"(",
"name",
")",
"==",
"null",
")",
"{",
"Person"... | Creates a person and adds it to the model.
@param location the location of the person (e.g. internal, external, etc)
@param name the name of the person (e.g. "Admin User" or "Bob the Business User")
@param description a short description of the person
@return the Person instance created and added to the mode... | [
"Creates",
"a",
"person",
"and",
"adds",
"it",
"to",
"the",
"model",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/model/Model.java#L109-L126 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.tagImage | public TagResult tagImage(String url, TagImageOptionalParameter tagImageOptionalParameter) {
"""
This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Un... | java | public TagResult tagImage(String url, TagImageOptionalParameter tagImageOptionalParameter) {
return tagImageWithServiceResponseAsync(url, tagImageOptionalParameter).toBlocking().single().body();
} | [
"public",
"TagResult",
"tagImage",
"(",
"String",
"url",
",",
"TagImageOptionalParameter",
"tagImageOptionalParameter",
")",
"{",
"return",
"tagImageWithServiceResponseAsync",
"(",
"url",
",",
"tagImageOptionalParameter",
")",
".",
"toBlocking",
"(",
")",
".",
"single",... | This operation generates a list of words, or tags, that are relevant to the content of the supplied image. The Computer Vision API can return tags based on objects, living beings, scenery or actions found in images. Unlike categories, tags are not organized according to a hierarchical classification system, but corresp... | [
"This",
"operation",
"generates",
"a",
"list",
"of",
"words",
"or",
"tags",
"that",
"are",
"relevant",
"to",
"the",
"content",
"of",
"the",
"supplied",
"image",
".",
"The",
"Computer",
"Vision",
"API",
"can",
"return",
"tags",
"based",
"on",
"objects",
"li... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1584-L1586 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.describeImageInStreamWithServiceResponseAsync | public Observable<ServiceResponse<ImageDescription>> describeImageInStreamWithServiceResponseAsync(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter) {
"""
This operation generates a description of an image in human readable language with complete sentences. The descripti... | java | public Observable<ServiceResponse<ImageDescription>> describeImageInStreamWithServiceResponseAsync(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter) {
if (this.client.endpoint() == null) {
throw new IllegalArgumentException("Parameter this.client.endpoint()... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"ImageDescription",
">",
">",
"describeImageInStreamWithServiceResponseAsync",
"(",
"byte",
"[",
"]",
"image",
",",
"DescribeImageInStreamOptionalParameter",
"describeImageInStreamOptionalParameter",
")",
"{",
"if",
"(",
... | This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All ... | [
"This",
"operation",
"generates",
"a",
"description",
"of",
"an",
"image",
"in",
"human",
"readable",
"language",
"with",
"complete",
"sentences",
".",
"The",
"description",
"is",
"based",
"on",
"a",
"collection",
"of",
"content",
"tags",
"which",
"are",
"also... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L620-L631 |
huahin/huahin-core | src/main/java/org/huahinframework/core/SimpleJob.java | SimpleJob.setSummarizer | public SimpleJob setSummarizer(Class<? extends Reducer<Key, Value, Key, Value>> clazz) {
"""
Job {@link Summarizer} class setting.
@param clazz {@link Summarizer} class
@return this
"""
return setSummarizer(clazz, false, 0);
} | java | public SimpleJob setSummarizer(Class<? extends Reducer<Key, Value, Key, Value>> clazz) {
return setSummarizer(clazz, false, 0);
} | [
"public",
"SimpleJob",
"setSummarizer",
"(",
"Class",
"<",
"?",
"extends",
"Reducer",
"<",
"Key",
",",
"Value",
",",
"Key",
",",
"Value",
">",
">",
"clazz",
")",
"{",
"return",
"setSummarizer",
"(",
"clazz",
",",
"false",
",",
"0",
")",
";",
"}"
] | Job {@link Summarizer} class setting.
@param clazz {@link Summarizer} class
@return this | [
"Job",
"{"
] | train | https://github.com/huahin/huahin-core/blob/a87921b5a12be92a822f753c075ab2431036e6f5/src/main/java/org/huahinframework/core/SimpleJob.java#L160-L162 |
zmarko/sss | src/main/java/rs/in/zivanovic/sss/SasUtils.java | SasUtils.decodeIntegerToString | @SuppressWarnings("empty-statement")
public static String decodeIntegerToString(BigInteger num) {
"""
Decode integer encoded with {@link #encodeStringToInteger(java.lang.String) } back to Unicode string form.
@param num integer to decode back to string.
@return decoded string.
"""
byte[] bytes ... | java | @SuppressWarnings("empty-statement")
public static String decodeIntegerToString(BigInteger num) {
byte[] bytes = num.toByteArray();
int count;
for (count = 0; count < bytes.length && bytes[count] == 0; count++);
byte[] trimmed = new byte[bytes.length - count];
System.arraycop... | [
"@",
"SuppressWarnings",
"(",
"\"empty-statement\"",
")",
"public",
"static",
"String",
"decodeIntegerToString",
"(",
"BigInteger",
"num",
")",
"{",
"byte",
"[",
"]",
"bytes",
"=",
"num",
".",
"toByteArray",
"(",
")",
";",
"int",
"count",
";",
"for",
"(",
... | Decode integer encoded with {@link #encodeStringToInteger(java.lang.String) } back to Unicode string form.
@param num integer to decode back to string.
@return decoded string. | [
"Decode",
"integer",
"encoded",
"with",
"{",
"@link",
"#encodeStringToInteger",
"(",
"java",
".",
"lang",
".",
"String",
")",
"}",
"back",
"to",
"Unicode",
"string",
"form",
"."
] | train | https://github.com/zmarko/sss/blob/a41d9d39ca9a4ca1a2719c441c88e209ffc511f5/src/main/java/rs/in/zivanovic/sss/SasUtils.java#L70-L78 |
redkale/redkale | src/org/redkale/util/ResourceFactory.java | ResourceFactory.register | public <A> A register(final boolean autoSync, final String name, final Type clazz, final A rs) {
"""
将对象以指定资源名和类型注入到资源池中
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param name 资源名
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象
"""
checkResourceName(name);
Concurrent... | java | public <A> A register(final boolean autoSync, final String name, final Type clazz, final A rs) {
checkResourceName(name);
ConcurrentHashMap<String, ResourceEntry> map = this.store.get(clazz);
if (map == null) {
synchronized (clazz) {
map = this.store.get(clazz);
... | [
"public",
"<",
"A",
">",
"A",
"register",
"(",
"final",
"boolean",
"autoSync",
",",
"final",
"String",
"name",
",",
"final",
"Type",
"clazz",
",",
"final",
"A",
"rs",
")",
"{",
"checkResourceName",
"(",
"name",
")",
";",
"ConcurrentHashMap",
"<",
"String... | 将对象以指定资源名和类型注入到资源池中
@param <A> 泛型
@param autoSync 是否同步已被注入的资源
@param name 资源名
@param clazz 资源类型
@param rs 资源对象
@return 旧资源对象 | [
"将对象以指定资源名和类型注入到资源池中"
] | train | https://github.com/redkale/redkale/blob/ea5169b5c5ea7412fd762331c0c497165832e901/src/org/redkale/util/ResourceFactory.java#L401-L420 |
gallandarakhneorg/afc | core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java | Path3d.getPathIteratorProperty | @Pure
public PathIterator3d getPathIteratorProperty(Transform3D transform, double flatness) {
"""
Replies an iterator on the path elements.
<p>
Only {@link PathElementType#MOVE_TO},
{@link PathElementType#LINE_TO}, and
{@link PathElementType#CLOSE} types are returned by the iterator.
<p>
The amount of subdi... | java | @Pure
public PathIterator3d getPathIteratorProperty(Transform3D transform, double flatness) {
return new FlatteningPathIterator3d(getWindingRule(), getPathIteratorProperty(transform), flatness, 10);
} | [
"@",
"Pure",
"public",
"PathIterator3d",
"getPathIteratorProperty",
"(",
"Transform3D",
"transform",
",",
"double",
"flatness",
")",
"{",
"return",
"new",
"FlatteningPathIterator3d",
"(",
"getWindingRule",
"(",
")",
",",
"getPathIteratorProperty",
"(",
"transform",
")... | Replies an iterator on the path elements.
<p>
Only {@link PathElementType#MOVE_TO},
{@link PathElementType#LINE_TO}, and
{@link PathElementType#CLOSE} types are returned by the iterator.
<p>
The amount of subdivision of the curved segments is controlled by the
flatness parameter, which specifies the maximum distance th... | [
"Replies",
"an",
"iterator",
"on",
"the",
"path",
"elements",
".",
"<p",
">",
"Only",
"{",
"@link",
"PathElementType#MOVE_TO",
"}",
"{",
"@link",
"PathElementType#LINE_TO",
"}",
"and",
"{",
"@link",
"PathElementType#CLOSE",
"}",
"types",
"are",
"returned",
"by",... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgeom/tobeincluded/src/d3/continuous/Path3d.java#L1835-L1838 |
Labs64/swid-generator | src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java | DefaultSwidProcessor.setProductVersion | public DefaultSwidProcessor setProductVersion(final String productVersion,
final long productVersionMajor,
final long productVersionMinor,
final long productVersionBuild,
final long productVersionReview) {
"""
Identifies the product version (tag: product_version) usi... | java | public DefaultSwidProcessor setProductVersion(final String productVersion,
final long productVersionMajor,
final long productVersionMinor,
final long productVersionBuild,
final long productVersionReview) {
final NumericVersionComplexType numericVersion = new Numer... | [
"public",
"DefaultSwidProcessor",
"setProductVersion",
"(",
"final",
"String",
"productVersion",
",",
"final",
"long",
"productVersionMajor",
",",
"final",
"long",
"productVersionMinor",
",",
"final",
"long",
"productVersionBuild",
",",
"final",
"long",
"productVersionRev... | Identifies the product version (tag: product_version) using two values – numeric version and version string.
@param productVersion
product version
@param productVersionMajor
product major version
@param productVersionMinor
product minor version
@param productVersionBuild
product build version
@param productVersionRevi... | [
"Identifies",
"the",
"product",
"version",
"(",
"tag",
":",
"product_version",
")",
"using",
"two",
"values",
"–",
"numeric",
"version",
"and",
"version",
"string",
"."
] | train | https://github.com/Labs64/swid-generator/blob/cf78d2469469a09701bce7c5f966ac6de2b7c613/src/main/java/com/labs64/utils/swid/processor/DefaultSwidProcessor.java#L111-L126 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java | AbstractRegionPainter.getFocusPaint | public Paint getFocusPaint(Shape s, FocusType focusType, boolean useToolBarFocus) {
"""
Get the paint to use for a focus ring.
@param s the shape to paint.
@param focusType the focus type.
@param useToolBarFocus whether we should use the colors for a toolbar control.
@return the pain... | java | public Paint getFocusPaint(Shape s, FocusType focusType, boolean useToolBarFocus) {
if (focusType == FocusType.OUTER_FOCUS) {
return useToolBarFocus ? outerToolBarFocus : outerFocus;
} else {
return useToolBarFocus ? innerToolBarFocus : innerFocus;
}
} | [
"public",
"Paint",
"getFocusPaint",
"(",
"Shape",
"s",
",",
"FocusType",
"focusType",
",",
"boolean",
"useToolBarFocus",
")",
"{",
"if",
"(",
"focusType",
"==",
"FocusType",
".",
"OUTER_FOCUS",
")",
"{",
"return",
"useToolBarFocus",
"?",
"outerToolBarFocus",
":"... | Get the paint to use for a focus ring.
@param s the shape to paint.
@param focusType the focus type.
@param useToolBarFocus whether we should use the colors for a toolbar control.
@return the paint to use to paint the focus ring. | [
"Get",
"the",
"paint",
"to",
"use",
"for",
"a",
"focus",
"ring",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/AbstractRegionPainter.java#L175-L181 |
fuinorg/srcgen4j-commons | src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java | JaxbHelper.containsStartTag | public boolean containsStartTag(@NotNull @FileExists @IsFile final File file, @NotNull final String tagName) {
"""
Checks if the given file contains a start tag within the first 1024 bytes.
@param file
File to check.
@param tagName
Name of the tag. A "<" will be added to this name internally to locate the... | java | public boolean containsStartTag(@NotNull @FileExists @IsFile final File file, @NotNull final String tagName) {
Contract.requireArgNotNull("file", file);
FileExistsValidator.requireArgValid("file", file);
IsFileValidator.requireArgValid("file", file);
Contract.requireArgNotNull("tagNa... | [
"public",
"boolean",
"containsStartTag",
"(",
"@",
"NotNull",
"@",
"FileExists",
"@",
"IsFile",
"final",
"File",
"file",
",",
"@",
"NotNull",
"final",
"String",
"tagName",
")",
"{",
"Contract",
".",
"requireArgNotNull",
"(",
"\"file\"",
",",
"file",
")",
";"... | Checks if the given file contains a start tag within the first 1024 bytes.
@param file
File to check.
@param tagName
Name of the tag. A "<" will be added to this name internally to locate the start tag.
@return If the file contains the start tag TRUE else FALSE. | [
"Checks",
"if",
"the",
"given",
"file",
"contains",
"a",
"start",
"tag",
"within",
"the",
"first",
"1024",
"bytes",
"."
] | train | https://github.com/fuinorg/srcgen4j-commons/blob/bce26fd3167ea91fb2f3ad3fc9a1836d3d9fb14b/src/main/java/org/fuin/srcgen4j/commons/JaxbHelper.java#L76-L84 |
Azure/azure-sdk-for-java | policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java | PolicyStatesInner.summarizeForResourceGroupLevelPolicyAssignmentAsync | public Observable<SummarizeResultsInner> summarizeForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
"""
Summarizes policy states for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param... | java | public Observable<SummarizeResultsInner> summarizeForResourceGroupLevelPolicyAssignmentAsync(String subscriptionId, String resourceGroupName, String policyAssignmentName) {
return summarizeForResourceGroupLevelPolicyAssignmentWithServiceResponseAsync(subscriptionId, resourceGroupName, policyAssignmentName).map(... | [
"public",
"Observable",
"<",
"SummarizeResultsInner",
">",
"summarizeForResourceGroupLevelPolicyAssignmentAsync",
"(",
"String",
"subscriptionId",
",",
"String",
"resourceGroupName",
",",
"String",
"policyAssignmentName",
")",
"{",
"return",
"summarizeForResourceGroupLevelPolicyA... | Summarizes policy states for the resource group level policy assignment.
@param subscriptionId Microsoft Azure subscription ID.
@param resourceGroupName Resource group name.
@param policyAssignmentName Policy assignment name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observa... | [
"Summarizes",
"policy",
"states",
"for",
"the",
"resource",
"group",
"level",
"policy",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policyinsights/resource-manager/v2018_04_04/src/main/java/com/microsoft/azure/management/policyinsights/v2018_04_04/implementation/PolicyStatesInner.java#L3136-L3143 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java | JpaControllerManagement.isUpdatingActionStatusAllowed | private boolean isUpdatingActionStatusAllowed(final JpaAction action, final JpaActionStatus actionStatus) {
"""
ActionStatus updates are allowed mainly if the action is active. If the
action is not active we accept further status updates if permitted so
by repository configuration. In this case, only the values:... | java | private boolean isUpdatingActionStatusAllowed(final JpaAction action, final JpaActionStatus actionStatus) {
final boolean isIntermediateFeedback = !FINISHED.equals(actionStatus.getStatus())
&& !Status.ERROR.equals(actionStatus.getStatus());
final boolean isAllowedByRepositoryConfigurat... | [
"private",
"boolean",
"isUpdatingActionStatusAllowed",
"(",
"final",
"JpaAction",
"action",
",",
"final",
"JpaActionStatus",
"actionStatus",
")",
"{",
"final",
"boolean",
"isIntermediateFeedback",
"=",
"!",
"FINISHED",
".",
"equals",
"(",
"actionStatus",
".",
"getStat... | ActionStatus updates are allowed mainly if the action is active. If the
action is not active we accept further status updates if permitted so
by repository configuration. In this case, only the values: Status.ERROR
and Status.FINISHED are allowed. In the case of a DOWNLOAD_ONLY action,
we accept status updates only onc... | [
"ActionStatus",
"updates",
"are",
"allowed",
"mainly",
"if",
"the",
"action",
"is",
"active",
".",
"If",
"the",
"action",
"is",
"not",
"active",
"we",
"accept",
"further",
"status",
"updates",
"if",
"permitted",
"so",
"by",
"repository",
"configuration",
".",
... | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaControllerManagement.java#L589-L600 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java | MainClassFinder.findMainClass | public static String findMainClass(JarFile jarFile, String classesLocation)
throws IOException {
"""
Find the main class in a given jar file.
@param jarFile the jar file to search
@param classesLocation the location within the jar containing classes
@return the main class or {@code null}
@throws IOException... | java | public static String findMainClass(JarFile jarFile, String classesLocation)
throws IOException {
return doWithMainClasses(jarFile, classesLocation, MainClass::getName);
} | [
"public",
"static",
"String",
"findMainClass",
"(",
"JarFile",
"jarFile",
",",
"String",
"classesLocation",
")",
"throws",
"IOException",
"{",
"return",
"doWithMainClasses",
"(",
"jarFile",
",",
"classesLocation",
",",
"MainClass",
"::",
"getName",
")",
";",
"}"
] | Find the main class in a given jar file.
@param jarFile the jar file to search
@param classesLocation the location within the jar containing classes
@return the main class or {@code null}
@throws IOException if the jar file cannot be read | [
"Find",
"the",
"main",
"class",
"in",
"a",
"given",
"jar",
"file",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/MainClassFinder.java#L173-L176 |
WASdev/ci.maven | liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/SpringBootUtil.java | SpringBootUtil.getSpringBootUberJARLocation | public static File getSpringBootUberJARLocation(MavenProject project, Log log) {
"""
Get the Spring Boot Uber JAR in its expected location, taking into account the
spring-boot-maven-plugin classifier configuration as well. No validation is done,
that is, there is no guarantee the JAR file actually exists at the... | java | public static File getSpringBootUberJARLocation(MavenProject project, Log log) {
String classifier = getSpringBootMavenPluginClassifier(project, log);
if (classifier == null) {
classifier = "";
}
if (!classifier.isEmpty() && !classifier.startsWith("-")) {
classif... | [
"public",
"static",
"File",
"getSpringBootUberJARLocation",
"(",
"MavenProject",
"project",
",",
"Log",
"log",
")",
"{",
"String",
"classifier",
"=",
"getSpringBootMavenPluginClassifier",
"(",
"project",
",",
"log",
")",
";",
"if",
"(",
"classifier",
"==",
"null",... | Get the Spring Boot Uber JAR in its expected location, taking into account the
spring-boot-maven-plugin classifier configuration as well. No validation is done,
that is, there is no guarantee the JAR file actually exists at the returned location.
@param outputDirectory
@param project
@param log
@return the File repre... | [
"Get",
"the",
"Spring",
"Boot",
"Uber",
"JAR",
"in",
"its",
"expected",
"location",
"taking",
"into",
"account",
"the",
"spring",
"-",
"boot",
"-",
"maven",
"-",
"plugin",
"classifier",
"configuration",
"as",
"well",
".",
"No",
"validation",
"is",
"done",
... | train | https://github.com/WASdev/ci.maven/blob/4fcf2d314299a4c02e2c740e4fc99a4f6aba6918/liberty-maven-plugin/src/main/java/net/wasdev/wlp/maven/plugins/utils/SpringBootUtil.java#L79-L92 |
loldevs/riotapi | rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java | ThrottledApiHandler.getSummonerSpells | public Future<Collection<SummonerSpell>> getSummonerSpells(SpellData data) {
"""
<p>
Get a list of all summoner spells as Java Collection
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional information to retrieve
@return The summoner spells
@see ... | java | public Future<Collection<SummonerSpell>> getSummonerSpells(SpellData data) {
return new DummyFuture<>(handler.getSummonerSpells(data));
} | [
"public",
"Future",
"<",
"Collection",
"<",
"SummonerSpell",
">",
">",
"getSummonerSpells",
"(",
"SpellData",
"data",
")",
"{",
"return",
"new",
"DummyFuture",
"<>",
"(",
"handler",
".",
"getSummonerSpells",
"(",
"data",
")",
")",
";",
"}"
] | <p>
Get a list of all summoner spells as Java Collection
</p>
This method does not count towards the rate limit and is not affected by the throttle
@param data Additional information to retrieve
@return The summoner spells
@see <a href=https://developer.riotgames.com/api/methods#!/649/2174>Official API documentation</a... | [
"<p",
">",
"Get",
"a",
"list",
"of",
"all",
"summoner",
"spells",
"as",
"Java",
"Collection",
"<",
"/",
"p",
">",
"This",
"method",
"does",
"not",
"count",
"towards",
"the",
"rate",
"limit",
"and",
"is",
"not",
"affected",
"by",
"the",
"throttle"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rest/src/main/java/net/boreeas/riotapi/rest/ThrottledApiHandler.java#L766-L768 |
looly/hutool | hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java | StyleUtil.setAlign | public static CellStyle setAlign(CellStyle cellStyle, HorizontalAlignment halign, VerticalAlignment valign) {
"""
设置cell文本对齐样式
@param cellStyle {@link CellStyle}
@param halign 横向位置
@param valign 纵向位置
@return {@link CellStyle}
"""
cellStyle.setAlignment(halign);
cellStyle.setVerticalAlignment(valign... | java | public static CellStyle setAlign(CellStyle cellStyle, HorizontalAlignment halign, VerticalAlignment valign) {
cellStyle.setAlignment(halign);
cellStyle.setVerticalAlignment(valign);
return cellStyle;
} | [
"public",
"static",
"CellStyle",
"setAlign",
"(",
"CellStyle",
"cellStyle",
",",
"HorizontalAlignment",
"halign",
",",
"VerticalAlignment",
"valign",
")",
"{",
"cellStyle",
".",
"setAlignment",
"(",
"halign",
")",
";",
"cellStyle",
".",
"setVerticalAlignment",
"(",
... | 设置cell文本对齐样式
@param cellStyle {@link CellStyle}
@param halign 横向位置
@param valign 纵向位置
@return {@link CellStyle} | [
"设置cell文本对齐样式"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-poi/src/main/java/cn/hutool/poi/excel/style/StyleUtil.java#L55-L59 |
michael-rapp/AndroidUtil | library/src/main/java/de/mrapp/android/util/ThemeUtil.java | ThemeUtil.getString | public static String getString(@NonNull final Context context, @AttrRes final int resourceId) {
"""
Obtains the string, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoundException} will be thrown.
@param context
The context, which should... | java | public static String getString(@NonNull final Context context, @AttrRes final int resourceId) {
return getString(context, -1, resourceId);
} | [
"public",
"static",
"String",
"getString",
"(",
"@",
"NonNull",
"final",
"Context",
"context",
",",
"@",
"AttrRes",
"final",
"int",
"resourceId",
")",
"{",
"return",
"getString",
"(",
"context",
",",
"-",
"1",
",",
"resourceId",
")",
";",
"}"
] | Obtains the string, which corresponds to a specific resource id, from a context's theme. If
the given resource id is invalid, a {@link NotFoundException} will be thrown.
@param context
The context, which should be used, as an instance of the class {@link Context}. The
context may not be null
@param resourceId
The reso... | [
"Obtains",
"the",
"string",
"which",
"corresponds",
"to",
"a",
"specific",
"resource",
"id",
"from",
"a",
"context",
"s",
"theme",
".",
"If",
"the",
"given",
"resource",
"id",
"is",
"invalid",
"a",
"{",
"@link",
"NotFoundException",
"}",
"will",
"be",
"thr... | train | https://github.com/michael-rapp/AndroidUtil/blob/67ec0e5732344eeb4d946dd1f96d782939e449f4/library/src/main/java/de/mrapp/android/util/ThemeUtil.java#L202-L204 |
NessComputing/components-ness-config | src/main/java/com/nesscomputing/config/Config.java | Config.getFixedConfig | public static Config getFixedConfig(@Nonnull Map<String, String> config) {
"""
Creates a fixed configuration for the supplied Map. Only key/value
pairs from this map will be present in the final configuration.
There is no implicit override from system properties.
"""
return getFixedConfig(new MapCo... | java | public static Config getFixedConfig(@Nonnull Map<String, String> config)
{
return getFixedConfig(new MapConfiguration(config));
} | [
"public",
"static",
"Config",
"getFixedConfig",
"(",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"config",
")",
"{",
"return",
"getFixedConfig",
"(",
"new",
"MapConfiguration",
"(",
"config",
")",
")",
";",
"}"
] | Creates a fixed configuration for the supplied Map. Only key/value
pairs from this map will be present in the final configuration.
There is no implicit override from system properties. | [
"Creates",
"a",
"fixed",
"configuration",
"for",
"the",
"supplied",
"Map",
".",
"Only",
"key",
"/",
"value",
"pairs",
"from",
"this",
"map",
"will",
"be",
"present",
"in",
"the",
"final",
"configuration",
"."
] | train | https://github.com/NessComputing/components-ness-config/blob/eb9b37327a9e612a097f1258eb09d288f475e2cb/src/main/java/com/nesscomputing/config/Config.java#L92-L95 |
padrig64/ValidationFramework | validationframework-core/src/main/java/com/google/code/validationframework/base/dataprovider/MapCompositeDataProvider.java | MapCompositeDataProvider.addDataProvider | public void addDataProvider(K key, DataProvider<DPO> dataProvider) {
"""
Adds the specified data provider with the specified key.
@param key Key associated to the data provider.
@param dataProvider Data provider associated to the key.
"""
dataProviders.put(key, dataProvider);
} | java | public void addDataProvider(K key, DataProvider<DPO> dataProvider) {
dataProviders.put(key, dataProvider);
} | [
"public",
"void",
"addDataProvider",
"(",
"K",
"key",
",",
"DataProvider",
"<",
"DPO",
">",
"dataProvider",
")",
"{",
"dataProviders",
".",
"put",
"(",
"key",
",",
"dataProvider",
")",
";",
"}"
] | Adds the specified data provider with the specified key.
@param key Key associated to the data provider.
@param dataProvider Data provider associated to the key. | [
"Adds",
"the",
"specified",
"data",
"provider",
"with",
"the",
"specified",
"key",
"."
] | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/dataprovider/MapCompositeDataProvider.java#L56-L58 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java | SymmetryAxes.getRepeatsCyclicForm | public List<List<Integer>> getRepeatsCyclicForm(int level, int firstRepeat) {
"""
Get the indices of participating repeats in cyclic form.
<p>
Each inner list gives a set of equivalent repeats and should have length
equal to the order of the axis' operator.
@param level
@param firstRepeat
@return
"""
A... | java | public List<List<Integer>> getRepeatsCyclicForm(int level, int firstRepeat) {
Axis axis = axes.get(level);
int m = getNumRepeats(level+1);//size of the children
int d = axis.getOrder(); // degree of this node
int n = m*d; // number of repeats included
if(firstRepeat % n != 0) {
throw new IllegalArgumentExc... | [
"public",
"List",
"<",
"List",
"<",
"Integer",
">",
">",
"getRepeatsCyclicForm",
"(",
"int",
"level",
",",
"int",
"firstRepeat",
")",
"{",
"Axis",
"axis",
"=",
"axes",
".",
"get",
"(",
"level",
")",
";",
"int",
"m",
"=",
"getNumRepeats",
"(",
"level",
... | Get the indices of participating repeats in cyclic form.
<p>
Each inner list gives a set of equivalent repeats and should have length
equal to the order of the axis' operator.
@param level
@param firstRepeat
@return | [
"Get",
"the",
"indices",
"of",
"participating",
"repeats",
"in",
"cyclic",
"form",
".",
"<p",
">",
"Each",
"inner",
"list",
"gives",
"a",
"set",
"of",
"equivalent",
"repeats",
"and",
"should",
"have",
"length",
"equal",
"to",
"the",
"order",
"of",
"the",
... | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/symmetry/internal/SymmetryAxes.java#L333-L354 |
rimerosolutions/ant-git-tasks | src/main/java/com/rimerosolutions/ant/git/tasks/TagListTask.java | TagListTask.processReferencesAndOutput | protected void processReferencesAndOutput(List<Ref> refList) {
"""
Processes a list of references, check references names and output to a file if requested.
@param refList The list of references to process
"""
List<String> refNames = new ArrayList<String>(refList.size());
fo... | java | protected void processReferencesAndOutput(List<Ref> refList) {
List<String> refNames = new ArrayList<String>(refList.size());
for (Ref ref : refList) {
refNames.add(GitTaskUtils.sanitizeRefName(ref.getName()));
}
if (!namesToCheck... | [
"protected",
"void",
"processReferencesAndOutput",
"(",
"List",
"<",
"Ref",
">",
"refList",
")",
"{",
"List",
"<",
"String",
">",
"refNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"refList",
".",
"size",
"(",
")",
")",
";",
"for",
"(",
"Ref... | Processes a list of references, check references names and output to a file if requested.
@param refList The list of references to process | [
"Processes",
"a",
"list",
"of",
"references",
"check",
"references",
"names",
"and",
"output",
"to",
"a",
"file",
"if",
"requested",
"."
] | train | https://github.com/rimerosolutions/ant-git-tasks/blob/bfb32fe68afe6b9dcfd0a5194497d748ef3e8a6f/src/main/java/com/rimerosolutions/ant/git/tasks/TagListTask.java#L104-L134 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/PagedGrid.java | PagedGrid.formatCell | protected void formatCell (HTMLTable.CellFormatter formatter, int row, int col, int limit) {
"""
Configures the formatting for a particular cell based on its location in the grid.
"""
formatter.setHorizontalAlignment(row, col, _cellHorizAlign);
formatter.setVerticalAlignment(row, col, _cellVert... | java | protected void formatCell (HTMLTable.CellFormatter formatter, int row, int col, int limit)
{
formatter.setHorizontalAlignment(row, col, _cellHorizAlign);
formatter.setVerticalAlignment(row, col, _cellVertAlign);
formatter.setStyleName(row, col, "Cell");
if (row == (limit-1)/_cols) {
... | [
"protected",
"void",
"formatCell",
"(",
"HTMLTable",
".",
"CellFormatter",
"formatter",
",",
"int",
"row",
",",
"int",
"col",
",",
"int",
"limit",
")",
"{",
"formatter",
".",
"setHorizontalAlignment",
"(",
"row",
",",
"col",
",",
"_cellHorizAlign",
")",
";",... | Configures the formatting for a particular cell based on its location in the grid. | [
"Configures",
"the",
"formatting",
"for",
"a",
"particular",
"cell",
"based",
"on",
"its",
"location",
"in",
"the",
"grid",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/PagedGrid.java#L99-L111 |
pravega/pravega | controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java | StreamMetrics.deleteStreamFailed | public void deleteStreamFailed(String scope, String streamName) {
"""
This method increments the counter of failed Stream deletions in the system as well as the failed deletion
attempts for this specific Stream.
@param scope Scope.
@param streamName Name of the Stream.
"""
DYNAMIC_LOGGE... | java | public void deleteStreamFailed(String scope, String streamName) {
DYNAMIC_LOGGER.incCounterValue(globalMetricName(DELETE_STREAM_FAILED), 1);
DYNAMIC_LOGGER.incCounterValue(DELETE_STREAM_FAILED, 1, streamTags(scope, streamName));
} | [
"public",
"void",
"deleteStreamFailed",
"(",
"String",
"scope",
",",
"String",
"streamName",
")",
"{",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
"(",
"globalMetricName",
"(",
"DELETE_STREAM_FAILED",
")",
",",
"1",
")",
";",
"DYNAMIC_LOGGER",
".",
"incCounterValue",
... | This method increments the counter of failed Stream deletions in the system as well as the failed deletion
attempts for this specific Stream.
@param scope Scope.
@param streamName Name of the Stream. | [
"This",
"method",
"increments",
"the",
"counter",
"of",
"failed",
"Stream",
"deletions",
"in",
"the",
"system",
"as",
"well",
"as",
"the",
"failed",
"deletion",
"attempts",
"for",
"this",
"specific",
"Stream",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/metrics/StreamMetrics.java#L100-L103 |
google/closure-compiler | src/com/google/javascript/refactoring/Matchers.java | Matchers.enumDefinitionOfType | public static Matcher enumDefinitionOfType(final String type) {
"""
Returns a Matcher that matches definitions of an enum of the given type.
"""
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
JSType providedJsType = getJsType(metadata, type);
... | java | public static Matcher enumDefinitionOfType(final String type) {
return new Matcher() {
@Override public boolean matches(Node node, NodeMetadata metadata) {
JSType providedJsType = getJsType(metadata, type);
if (providedJsType == null) {
return false;
}
providedJsType ... | [
"public",
"static",
"Matcher",
"enumDefinitionOfType",
"(",
"final",
"String",
"type",
")",
"{",
"return",
"new",
"Matcher",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"Node",
"node",
",",
"NodeMetadata",
"metadata",
")",
"{",
"JSTy... | Returns a Matcher that matches definitions of an enum of the given type. | [
"Returns",
"a",
"Matcher",
"that",
"matches",
"definitions",
"of",
"an",
"enum",
"of",
"the",
"given",
"type",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/refactoring/Matchers.java#L286-L300 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/AbstractSessionBasedScope.java | AbstractSessionBasedScope.addToList | protected void addToList(List<IEObjectDescription> descriptions, List<IEObjectDescription> result) {
"""
Clients may override to reject certain descriptions from the result. All subtypes of {@link AbstractSessionBasedScope}
in the framework code will delegate to this method to accumulate descriptions in a list.
... | java | protected void addToList(List<IEObjectDescription> descriptions, List<IEObjectDescription> result) {
result.addAll(descriptions);
} | [
"protected",
"void",
"addToList",
"(",
"List",
"<",
"IEObjectDescription",
">",
"descriptions",
",",
"List",
"<",
"IEObjectDescription",
">",
"result",
")",
"{",
"result",
".",
"addAll",
"(",
"descriptions",
")",
";",
"}"
] | Clients may override to reject certain descriptions from the result. All subtypes of {@link AbstractSessionBasedScope}
in the framework code will delegate to this method to accumulate descriptions in a list.
@see #addToList(IEObjectDescription, List) | [
"Clients",
"may",
"override",
"to",
"reject",
"certain",
"descriptions",
"from",
"the",
"result",
".",
"All",
"subtypes",
"of",
"{",
"@link",
"AbstractSessionBasedScope",
"}",
"in",
"the",
"framework",
"code",
"will",
"delegate",
"to",
"this",
"method",
"to",
... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/scoping/batch/AbstractSessionBasedScope.java#L165-L167 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.toSortedString | public static <T> String toSortedString(Counter<T> counter, int k, String itemFormat, String joiner) {
"""
Returns a string representation of a Counter, displaying the keys and their
counts in decreasing order of count. At most k keys are displayed.
@param counter
A Counter.
@param k
The number of keys to i... | java | public static <T> String toSortedString(Counter<T> counter, int k, String itemFormat, String joiner) {
return toSortedString(counter, k, itemFormat, joiner, "%s");
} | [
"public",
"static",
"<",
"T",
">",
"String",
"toSortedString",
"(",
"Counter",
"<",
"T",
">",
"counter",
",",
"int",
"k",
",",
"String",
"itemFormat",
",",
"String",
"joiner",
")",
"{",
"return",
"toSortedString",
"(",
"counter",
",",
"k",
",",
"itemForm... | Returns a string representation of a Counter, displaying the keys and their
counts in decreasing order of count. At most k keys are displayed.
@param counter
A Counter.
@param k
The number of keys to include. Use Integer.MAX_VALUE to include
all keys.
@param itemFormat
The format string for key/count pairs, where the ... | [
"Returns",
"a",
"string",
"representation",
"of",
"a",
"Counter",
"displaying",
"the",
"keys",
"and",
"their",
"counts",
"in",
"decreasing",
"order",
"of",
"count",
".",
"At",
"most",
"k",
"keys",
"are",
"displayed",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1792-L1794 |
alkacon/opencms-core | src/org/opencms/jsp/CmsJspActionElement.java | CmsJspActionElement.includeSilent | public void includeSilent(String target, String element) {
"""
Includes a named sub-element suppressing all Exceptions that occur during the include,
otherwise the same as using {@link #include(String, String, Map)}.<p>
This is a convenience method that allows to include elements on a page without checking
if... | java | public void includeSilent(String target, String element) {
try {
include(target, element, null);
} catch (Throwable t) {
// ignore
}
} | [
"public",
"void",
"includeSilent",
"(",
"String",
"target",
",",
"String",
"element",
")",
"{",
"try",
"{",
"include",
"(",
"target",
",",
"element",
",",
"null",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"// ignore",
"}",
"}"
] | Includes a named sub-element suppressing all Exceptions that occur during the include,
otherwise the same as using {@link #include(String, String, Map)}.<p>
This is a convenience method that allows to include elements on a page without checking
if they exist or not. If the target element does not exist, nothing is pri... | [
"Includes",
"a",
"named",
"sub",
"-",
"element",
"suppressing",
"all",
"Exceptions",
"that",
"occur",
"during",
"the",
"include",
"otherwise",
"the",
"same",
"as",
"using",
"{",
"@link",
"#include",
"(",
"String",
"String",
"Map",
")",
"}",
".",
"<p",
">"
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/CmsJspActionElement.java#L587-L594 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.createImportOperation | public ImportExportResponseInner createImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequest parameters) {
"""
Creates an import operation that imports a bacpac into an existing database. The existing database must be empty.
@param resourceGroupName The name of... | java | public ImportExportResponseInner createImportOperation(String resourceGroupName, String serverName, String databaseName, ImportExtensionRequest parameters) {
return createImportOperationWithServiceResponseAsync(resourceGroupName, serverName, databaseName, parameters).toBlocking().last().body();
} | [
"public",
"ImportExportResponseInner",
"createImportOperation",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"ImportExtensionRequest",
"parameters",
")",
"{",
"return",
"createImportOperationWithServiceResponseAsync",
"(",... | Creates an import operation that imports a bacpac into an existing database. The existing database must be empty.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@p... | [
"Creates",
"an",
"import",
"operation",
"that",
"imports",
"a",
"bacpac",
"into",
"an",
"existing",
"database",
".",
"The",
"existing",
"database",
"must",
"be",
"empty",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L1910-L1912 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.mapping | public static void mapping(String mappedFieldName, String mappedClassName) {
"""
Thrown when the length of classes and attribute parameter isn't the same.
@param mappedFieldName name of the mapped field
@param mappedClassName name of the mapped field's class
"""
throw new MappingErrorException(MSG.INSTANC... | java | public static void mapping(String mappedFieldName, String mappedClassName){
throw new MappingErrorException(MSG.INSTANCE.message(mappingErrorException2length,mappedFieldName,mappedClassName));
} | [
"public",
"static",
"void",
"mapping",
"(",
"String",
"mappedFieldName",
",",
"String",
"mappedClassName",
")",
"{",
"throw",
"new",
"MappingErrorException",
"(",
"MSG",
".",
"INSTANCE",
".",
"message",
"(",
"mappingErrorException2length",
",",
"mappedFieldName",
",... | Thrown when the length of classes and attribute parameter isn't the same.
@param mappedFieldName name of the mapped field
@param mappedClassName name of the mapped field's class | [
"Thrown",
"when",
"the",
"length",
"of",
"classes",
"and",
"attribute",
"parameter",
"isn",
"t",
"the",
"same",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L463-L465 |
adyliu/jafka | src/main/java/io/jafka/api/FetchRequest.java | FetchRequest.readFrom | public static FetchRequest readFrom(ByteBuffer buffer) {
"""
Read a fetch request from buffer(socket data)
@param buffer the buffer data
@return a fetch request
@throws IllegalArgumentException while error data format(no topic)
"""
String topic = Utils.readShortString(buffer);
int partitio... | java | public static FetchRequest readFrom(ByteBuffer buffer) {
String topic = Utils.readShortString(buffer);
int partition = buffer.getInt();
long offset = buffer.getLong();
int size = buffer.getInt();
return new FetchRequest(topic, partition, offset, size);
} | [
"public",
"static",
"FetchRequest",
"readFrom",
"(",
"ByteBuffer",
"buffer",
")",
"{",
"String",
"topic",
"=",
"Utils",
".",
"readShortString",
"(",
"buffer",
")",
";",
"int",
"partition",
"=",
"buffer",
".",
"getInt",
"(",
")",
";",
"long",
"offset",
"=",... | Read a fetch request from buffer(socket data)
@param buffer the buffer data
@return a fetch request
@throws IllegalArgumentException while error data format(no topic) | [
"Read",
"a",
"fetch",
"request",
"from",
"buffer",
"(",
"socket",
"data",
")"
] | train | https://github.com/adyliu/jafka/blob/cc14d2ed60c039b12d7b106bb5269ef21d0add7e/src/main/java/io/jafka/api/FetchRequest.java#L105-L111 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/memorymanager/CheckedMemorySegment.java | CheckedMemorySegment.putChar | public final CheckedMemorySegment putChar(int index, char value) {
"""
Writes two memory containing the given char value, in the current byte
order, into this buffer at the given position.
@param position The position at which the memory will be written.
@param value The char value to be written.
@return Thi... | java | public final CheckedMemorySegment putChar(int index, char value) {
if (index >= 0 && index < this.size - 1) {
this.memory[this.offset + index + 0] = (byte) (value >> 8);
this.memory[this.offset + index + 1] = (byte) value;
return this;
} else {
throw new IndexOutOfBoundsException();
}
} | [
"public",
"final",
"CheckedMemorySegment",
"putChar",
"(",
"int",
"index",
",",
"char",
"value",
")",
"{",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"this",
".",
"size",
"-",
"1",
")",
"{",
"this",
".",
"memory",
"[",
"this",
".",
"offset",
... | Writes two memory containing the given char value, in the current byte
order, into this buffer at the given position.
@param position The position at which the memory will be written.
@param value The char value to be written.
@return This view itself.
@throws IndexOutOfBoundsException Thrown, if the index is negativ... | [
"Writes",
"two",
"memory",
"containing",
"the",
"given",
"char",
"value",
"in",
"the",
"current",
"byte",
"order",
"into",
"this",
"buffer",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/memorymanager/CheckedMemorySegment.java#L386-L394 |
geomajas/geomajas-project-client-gwt2 | server-extension/src/main/java/org/geomajas/gwt2/client/GeomajasServerExtension.java | GeomajasServerExtension.initializeMap | public void initializeMap(final MapPresenter mapPresenter, String applicationId, String id) {
"""
Initialize the map by fetching a configuration on the server. This method will create a map and add the default
map widgets (zoom in/out, zoom to rectangle and scale bar).
@param mapPresenter The map to initialize... | java | public void initializeMap(final MapPresenter mapPresenter, String applicationId, String id) {
initializeMap(mapPresenter, applicationId, id, new DefaultMapWidget[] { DefaultMapWidget.ZOOM_CONTROL,
DefaultMapWidget.ZOOM_TO_RECTANGLE_CONTROL, DefaultMapWidget.SCALEBAR });
} | [
"public",
"void",
"initializeMap",
"(",
"final",
"MapPresenter",
"mapPresenter",
",",
"String",
"applicationId",
",",
"String",
"id",
")",
"{",
"initializeMap",
"(",
"mapPresenter",
",",
"applicationId",
",",
"id",
",",
"new",
"DefaultMapWidget",
"[",
"]",
"{",
... | Initialize the map by fetching a configuration on the server. This method will create a map and add the default
map widgets (zoom in/out, zoom to rectangle and scale bar).
@param mapPresenter The map to initialize.
@param applicationId The application ID in the backend configuration.
@param id The map ID in the backen... | [
"Initialize",
"the",
"map",
"by",
"fetching",
"a",
"configuration",
"on",
"the",
"server",
".",
"This",
"method",
"will",
"create",
"a",
"map",
"and",
"add",
"the",
"default",
"map",
"widgets",
"(",
"zoom",
"in",
"/",
"out",
"zoom",
"to",
"rectangle",
"a... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/server-extension/src/main/java/org/geomajas/gwt2/client/GeomajasServerExtension.java#L146-L149 |
jmurty/java-xmlbuilder | src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java | BaseXMLBuilder.attributeImpl | protected void attributeImpl(String name, String value) {
"""
Add a named attribute value to the element for this builder node.
@param name
the attribute's name.
@param value
the attribute's value.
"""
if (! (this.xmlNode instanceof Element)) {
throw new RuntimeException(
... | java | protected void attributeImpl(String name, String value) {
if (! (this.xmlNode instanceof Element)) {
throw new RuntimeException(
"Cannot add an attribute to non-Element underlying node: "
+ this.xmlNode);
}
((Element) xmlNode).setAttribute(name, value)... | [
"protected",
"void",
"attributeImpl",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"if",
"(",
"!",
"(",
"this",
".",
"xmlNode",
"instanceof",
"Element",
")",
")",
"{",
"throw",
"new",
"RuntimeException",
"(",
"\"Cannot add an attribute to non-Element... | Add a named attribute value to the element for this builder node.
@param name
the attribute's name.
@param value
the attribute's value. | [
"Add",
"a",
"named",
"attribute",
"value",
"to",
"the",
"element",
"for",
"this",
"builder",
"node",
"."
] | train | https://github.com/jmurty/java-xmlbuilder/blob/7c224b8e8ed79808509322cb141dab5a88dd3cec/src/main/java/com/jamesmurty/utils/BaseXMLBuilder.java#L806-L813 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java | TrustingSSLSocketFactory.createSimulatedSocket | private Socket createSimulatedSocket(SSLSocket socket) {
"""
just an helper function to wrap a normal sslSocket into a simulated one so we can do throttling
"""
SimulatedSocketFactory.configure(socket);
socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name... | java | private Socket createSimulatedSocket(SSLSocket socket) {
SimulatedSocketFactory.configure(socket);
socket.setEnabledProtocols(new String[] { SSLAlgorithm.SSLv3.name(), SSLAlgorithm.TLSv1.name() } );
//socket.setEnabledCipherSuites(new String[] { "SSL_RSA_WITH_RC4_128_MD5" });
return new ... | [
"private",
"Socket",
"createSimulatedSocket",
"(",
"SSLSocket",
"socket",
")",
"{",
"SimulatedSocketFactory",
".",
"configure",
"(",
"socket",
")",
";",
"socket",
".",
"setEnabledProtocols",
"(",
"new",
"String",
"[",
"]",
"{",
"SSLAlgorithm",
".",
"SSLv3",
".",... | just an helper function to wrap a normal sslSocket into a simulated one so we can do throttling | [
"just",
"an",
"helper",
"function",
"to",
"wrap",
"a",
"normal",
"sslSocket",
"into",
"a",
"simulated",
"one",
"so",
"we",
"can",
"do",
"throttling"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/http/TrustingSSLSocketFactory.java#L74-L79 |
aws/aws-sdk-java | aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddWaiters.java | AddWaiters.executeToAstProcess | private Process executeToAstProcess(String argument) throws IOException {
"""
Execute the jp-to-ast.py command and wait for it to complete.
@param argument JP expression to compile to AST.
@return Process with access to output streams.
"""
try {
Process p = new ProcessBuilder("python", ... | java | private Process executeToAstProcess(String argument) throws IOException {
try {
Process p = new ProcessBuilder("python", codeGenBinDirectory + "/jp-to-ast.py", argument).start();
p.waitFor();
return p;
} catch (InterruptedException e) {
Thread.currentThrea... | [
"private",
"Process",
"executeToAstProcess",
"(",
"String",
"argument",
")",
"throws",
"IOException",
"{",
"try",
"{",
"Process",
"p",
"=",
"new",
"ProcessBuilder",
"(",
"\"python\"",
",",
"codeGenBinDirectory",
"+",
"\"/jp-to-ast.py\"",
",",
"argument",
")",
".",... | Execute the jp-to-ast.py command and wait for it to complete.
@param argument JP expression to compile to AST.
@return Process with access to output streams. | [
"Execute",
"the",
"jp",
"-",
"to",
"-",
"ast",
".",
"py",
"command",
"and",
"wait",
"for",
"it",
"to",
"complete",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-code-generator/src/main/java/com/amazonaws/codegen/AddWaiters.java#L116-L125 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CategoryUrl.java | CategoryUrl.deleteCategoryByIdUrl | public static MozuUrl deleteCategoryByIdUrl(Boolean cascadeDelete, Integer categoryId, Boolean forceDelete, Boolean reassignToParent) {
"""
Get Resource Url for DeleteCategoryById
@param cascadeDelete Specifies whether to also delete all subcategories associated with the specified category.If you set this value i... | java | public static MozuUrl deleteCategoryByIdUrl(Boolean cascadeDelete, Integer categoryId, Boolean forceDelete, Boolean reassignToParent)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/{categoryId}/?cascadeDelete={cascadeDelete}&forceDelete={forceDelete}&reassignToParent={reassignT... | [
"public",
"static",
"MozuUrl",
"deleteCategoryByIdUrl",
"(",
"Boolean",
"cascadeDelete",
",",
"Integer",
"categoryId",
",",
"Boolean",
"forceDelete",
",",
"Boolean",
"reassignToParent",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/co... | Get Resource Url for DeleteCategoryById
@param cascadeDelete Specifies whether to also delete all subcategories associated with the specified category.If you set this value is false, only the specified category is deleted.The default value is false.
@param categoryId Unique identifier of the category to modify.
@param ... | [
"Get",
"Resource",
"Url",
"for",
"DeleteCategoryById"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CategoryUrl.java#L152-L160 |
jenkinsci/jenkins | core/src/main/java/jenkins/org/apache/commons/validator/routines/DomainValidator.java | DomainValidator.isValidLocalTld | public boolean isValidLocalTld(String lTld) {
"""
Returns true if the specified <code>String</code> matches any
widely used "local" domains (localhost or localdomain). Leading dots are
ignored if present. The search is case-insensitive.
@param lTld the parameter to check for local TLD status, not null
@return ... | java | public boolean isValidLocalTld(String lTld) {
final String key = chompLeadingDot(unicodeToASCII(lTld).toLowerCase(Locale.ENGLISH));
return arrayContains(LOCAL_TLDS, key);
} | [
"public",
"boolean",
"isValidLocalTld",
"(",
"String",
"lTld",
")",
"{",
"final",
"String",
"key",
"=",
"chompLeadingDot",
"(",
"unicodeToASCII",
"(",
"lTld",
")",
".",
"toLowerCase",
"(",
"Locale",
".",
"ENGLISH",
")",
")",
";",
"return",
"arrayContains",
"... | Returns true if the specified <code>String</code> matches any
widely used "local" domains (localhost or localdomain). Leading dots are
ignored if present. The search is case-insensitive.
@param lTld the parameter to check for local TLD status, not null
@return true if the parameter is an local TLD | [
"Returns",
"true",
"if",
"the",
"specified",
"<code",
">",
"String<",
"/",
"code",
">",
"matches",
"any",
"widely",
"used",
"local",
"domains",
"(",
"localhost",
"or",
"localdomain",
")",
".",
"Leading",
"dots",
"are",
"ignored",
"if",
"present",
".",
"The... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/org/apache/commons/validator/routines/DomainValidator.java#L258-L261 |
goldmansachs/reladomo | reladomo/src/main/java/com/gs/fw/common/mithra/attribute/Attribute.java | Attribute.joinEqWithSourceAndAsOfCheck | protected Operation joinEqWithSourceAndAsOfCheck(Attribute other) {
"""
/*
public Operation in(List dataHolders, Extractor extractor)
{
return new InOperationWithExtractor(this, dataHolders, extractor);
}
"""
Mapper mapper = null;
if (this.getSourceAttributeType() != null && !(other insta... | java | protected Operation joinEqWithSourceAndAsOfCheck(Attribute other)
{
Mapper mapper = null;
if (this.getSourceAttributeType() != null && !(other instanceof MappedAttribute) && this.getSourceAttributeType().equals(other.getSourceAttributeType()))
{
MultiEqualityMapper mem = new... | [
"protected",
"Operation",
"joinEqWithSourceAndAsOfCheck",
"(",
"Attribute",
"other",
")",
"{",
"Mapper",
"mapper",
"=",
"null",
";",
"if",
"(",
"this",
".",
"getSourceAttributeType",
"(",
")",
"!=",
"null",
"&&",
"!",
"(",
"other",
"instanceof",
"MappedAttribute... | /*
public Operation in(List dataHolders, Extractor extractor)
{
return new InOperationWithExtractor(this, dataHolders, extractor);
} | [
"/",
"*",
"public",
"Operation",
"in",
"(",
"List",
"dataHolders",
"Extractor",
"extractor",
")",
"{",
"return",
"new",
"InOperationWithExtractor",
"(",
"this",
"dataHolders",
"extractor",
")",
";",
"}"
] | train | https://github.com/goldmansachs/reladomo/blob/e9a069452eece7a6ef9551caf81a69d3d9a3d990/reladomo/src/main/java/com/gs/fw/common/mithra/attribute/Attribute.java#L275-L296 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSchemeManipulator.java | ReactionSchemeManipulator.setScheme | private static IReactionScheme setScheme(IReaction reaction, IReactionSet reactionSet) {
"""
Create a IReactionScheme given as a top a IReaction. If it doesn't exist any subsequent reaction
return null;
@param reaction The IReaction as a top
@param reactionSet The IReactionSet to extract a IReactionS... | java | private static IReactionScheme setScheme(IReaction reaction, IReactionSet reactionSet) {
IReactionScheme reactionScheme = reaction.getBuilder().newInstance(IReactionScheme.class);
IReactionSet reactConSet = extractSubsequentReaction(reaction, reactionSet);
if (reactConSet.getReactionCount() != ... | [
"private",
"static",
"IReactionScheme",
"setScheme",
"(",
"IReaction",
"reaction",
",",
"IReactionSet",
"reactionSet",
")",
"{",
"IReactionScheme",
"reactionScheme",
"=",
"reaction",
".",
"getBuilder",
"(",
")",
".",
"newInstance",
"(",
"IReactionScheme",
".",
"clas... | Create a IReactionScheme given as a top a IReaction. If it doesn't exist any subsequent reaction
return null;
@param reaction The IReaction as a top
@param reactionSet The IReactionSet to extract a IReactionScheme
@return The IReactionScheme | [
"Create",
"a",
"IReactionScheme",
"given",
"as",
"a",
"top",
"a",
"IReaction",
".",
"If",
"it",
"doesn",
"t",
"exist",
"any",
"subsequent",
"reaction",
"return",
"null",
";"
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/tools/manipulator/ReactionSchemeManipulator.java#L186-L200 |
pravega/pravega | client/src/main/java/io/pravega/client/stream/impl/ReaderGroupStateManager.java | ReaderGroupStateManager.releaseSegment | boolean releaseSegment(Segment segment, long lastOffset, long timeLag) throws ReaderNotInReaderGroupException {
"""
Releases a segment to another reader. This reader should no longer read from the segment.
@param segment The segment to be released
@param lastOffset The offset from which the new owner should st... | java | boolean releaseSegment(Segment segment, long lastOffset, long timeLag) throws ReaderNotInReaderGroupException {
sync.updateState((state, updates) -> {
Set<Segment> segments = state.getSegments(readerId);
if (segments != null && segments.contains(segment) && state.getCheckpointForReader(r... | [
"boolean",
"releaseSegment",
"(",
"Segment",
"segment",
",",
"long",
"lastOffset",
",",
"long",
"timeLag",
")",
"throws",
"ReaderNotInReaderGroupException",
"{",
"sync",
".",
"updateState",
"(",
"(",
"state",
",",
"updates",
")",
"->",
"{",
"Set",
"<",
"Segmen... | Releases a segment to another reader. This reader should no longer read from the segment.
@param segment The segment to be released
@param lastOffset The offset from which the new owner should start reading from.
@param timeLag How far the reader is from the tail of the stream in time.
@return a boolean indicating if ... | [
"Releases",
"a",
"segment",
"to",
"another",
"reader",
".",
"This",
"reader",
"should",
"no",
"longer",
"read",
"from",
"the",
"segment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/client/src/main/java/io/pravega/client/stream/impl/ReaderGroupStateManager.java#L251-L267 |
bitcoinj/bitcoinj | core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java | KeyChainGroup.createBasic | public static KeyChainGroup createBasic(NetworkParameters params) {
"""
Creates a keychain group with just a basic chain. No deterministic chains will be created automatically.
"""
return new KeyChainGroup(params, new BasicKeyChain(), null, -1, -1, null, null);
} | java | public static KeyChainGroup createBasic(NetworkParameters params) {
return new KeyChainGroup(params, new BasicKeyChain(), null, -1, -1, null, null);
} | [
"public",
"static",
"KeyChainGroup",
"createBasic",
"(",
"NetworkParameters",
"params",
")",
"{",
"return",
"new",
"KeyChainGroup",
"(",
"params",
",",
"new",
"BasicKeyChain",
"(",
")",
",",
"null",
",",
"-",
"1",
",",
"-",
"1",
",",
"null",
",",
"null",
... | Creates a keychain group with just a basic chain. No deterministic chains will be created automatically. | [
"Creates",
"a",
"keychain",
"group",
"with",
"just",
"a",
"basic",
"chain",
".",
"No",
"deterministic",
"chains",
"will",
"be",
"created",
"automatically",
"."
] | train | https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/wallet/KeyChainGroup.java#L198-L200 |
Netflix/zeno | src/examples/java/com/netflix/zeno/examples/framework/IntSumFrameworkSerializer.java | IntSumFrameworkSerializer.serializePrimitive | @Override
public void serializePrimitive(IntSumRecord rec, String fieldName, Object value) {
"""
We need to implement serializePrimitive to describe what happens when we encounter one of the following types:
Integer, Long, Float, Double, Boolean, String.
"""
/// only interested in int values.
... | java | @Override
public void serializePrimitive(IntSumRecord rec, String fieldName, Object value) {
/// only interested in int values.
if(value instanceof Integer) {
rec.addValue(((Integer) value).intValue());
}
} | [
"@",
"Override",
"public",
"void",
"serializePrimitive",
"(",
"IntSumRecord",
"rec",
",",
"String",
"fieldName",
",",
"Object",
"value",
")",
"{",
"/// only interested in int values.",
"if",
"(",
"value",
"instanceof",
"Integer",
")",
"{",
"rec",
".",
"addValue",
... | We need to implement serializePrimitive to describe what happens when we encounter one of the following types:
Integer, Long, Float, Double, Boolean, String. | [
"We",
"need",
"to",
"implement",
"serializePrimitive",
"to",
"describe",
"what",
"happens",
"when",
"we",
"encounter",
"one",
"of",
"the",
"following",
"types",
":",
"Integer",
"Long",
"Float",
"Double",
"Boolean",
"String",
"."
] | train | https://github.com/Netflix/zeno/blob/e571a3f1e304942724d454408fe6417fe18c20fd/src/examples/java/com/netflix/zeno/examples/framework/IntSumFrameworkSerializer.java#L43-L49 |
hibernate/hibernate-ogm | infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/common/externalizer/impl/VersionChecker.java | VersionChecker.readAndCheckVersion | public static void readAndCheckVersion(ObjectInput input, int supportedVersion, Class<?> externalizedType) throws IOException {
"""
Consumes the version field from the given input and raises an exception if the record is in a newer version,
written by a newer version of Hibernate OGM.
@param input the input to... | java | public static void readAndCheckVersion(ObjectInput input, int supportedVersion, Class<?> externalizedType) throws IOException {
int version = input.readInt();
if ( version != supportedVersion ) {
throw LOG.unexpectedKeyVersion( externalizedType, version, supportedVersion );
}
} | [
"public",
"static",
"void",
"readAndCheckVersion",
"(",
"ObjectInput",
"input",
",",
"int",
"supportedVersion",
",",
"Class",
"<",
"?",
">",
"externalizedType",
")",
"throws",
"IOException",
"{",
"int",
"version",
"=",
"input",
".",
"readInt",
"(",
")",
";",
... | Consumes the version field from the given input and raises an exception if the record is in a newer version,
written by a newer version of Hibernate OGM.
@param input the input to read from
@param supportedVersion the type version supported by this version of OGM
@param externalizedType the type to be unmarshalled
@t... | [
"Consumes",
"the",
"version",
"field",
"from",
"the",
"given",
"input",
"and",
"raises",
"an",
"exception",
"if",
"the",
"record",
"is",
"in",
"a",
"newer",
"version",
"written",
"by",
"a",
"newer",
"version",
"of",
"Hibernate",
"OGM",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/infinispan-embedded/src/main/java/org/hibernate/ogm/datastore/infinispan/persistencestrategy/common/externalizer/impl/VersionChecker.java#L35-L41 |
synchronoss/cpo-api | cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java | JdbcCpoXaAdapter.updateObject | @Override
public <T> long updateObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Update the Object in the datasource. The CpoAdapter will check to see if the object exists in the datasource. If it
e... | java | @Override
public <T> long updateObject(String name, T obj, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
return getCurrentResource().updateObject(name, obj, wheres, orderBy, nativeExpressions);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"updateObject",
"(",
"String",
"name",
",",
"T",
"obj",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
"<",
"CpoNativeFunction",
... | Update the Object in the datasource. The CpoAdapter will check to see if the object exists in the datasource. If it
exists then the object will be updated. If it does not exist, an exception will be thrown
<p>
<pre>Example:
<code>
<p>
class SomeObject so = new SomeObject();
class CpoAdapter cpo = null;
<p>
try {
cpo = ... | [
"Update",
"the",
"Object",
"in",
"the",
"datasource",
".",
"The",
"CpoAdapter",
"will",
"check",
"to",
"see",
"if",
"the",
"object",
"exists",
"in",
"the",
"datasource",
".",
"If",
"it",
"exists",
"then",
"the",
"object",
"will",
"be",
"updated",
".",
"I... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/jta/JdbcCpoXaAdapter.java#L1668-L1671 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.listFromJobSchedule | public PagedList<CloudJob> listFromJobSchedule(final String jobScheduleId, final JobListFromJobScheduleOptions jobListFromJobScheduleOptions) {
"""
Lists the jobs that have been created under the specified job schedule.
@param jobScheduleId The ID of the job schedule from which you want to get a list of jobs.
... | java | public PagedList<CloudJob> listFromJobSchedule(final String jobScheduleId, final JobListFromJobScheduleOptions jobListFromJobScheduleOptions) {
ServiceResponseWithHeaders<Page<CloudJob>, JobListFromJobScheduleHeaders> response = listFromJobScheduleSinglePageAsync(jobScheduleId, jobListFromJobScheduleOptions).to... | [
"public",
"PagedList",
"<",
"CloudJob",
">",
"listFromJobSchedule",
"(",
"final",
"String",
"jobScheduleId",
",",
"final",
"JobListFromJobScheduleOptions",
"jobListFromJobScheduleOptions",
")",
"{",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudJob",
">",
",",
"... | Lists the jobs that have been created under the specified job schedule.
@param jobScheduleId The ID of the job schedule from which you want to get a list of jobs.
@param jobListFromJobScheduleOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@thro... | [
"Lists",
"the",
"jobs",
"that",
"have",
"been",
"created",
"under",
"the",
"specified",
"job",
"schedule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L2635-L2650 |
gallandarakhneorg/afc | advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPolyline.java | MapPolyline.getNearestEndIndex | @Pure
public final int getNearestEndIndex(double x, double y, OutputParameter<Double> distance) {
"""
Replies the index of the nearest end of line according to the specified point.
@param x is the point coordinate from which the distance must be computed
@param y is the point coordinate from which the distanc... | java | @Pure
public final int getNearestEndIndex(double x, double y, OutputParameter<Double> distance) {
final int count = getPointCount();
final Point2d firstPoint = getPointAt(0);
final Point2d lastPoint = getPointAt(count - 1);
final double d1 = Point2D.getDistancePointPoint(firstPoint.getX(), firstPoint.getY(), x... | [
"@",
"Pure",
"public",
"final",
"int",
"getNearestEndIndex",
"(",
"double",
"x",
",",
"double",
"y",
",",
"OutputParameter",
"<",
"Double",
">",
"distance",
")",
"{",
"final",
"int",
"count",
"=",
"getPointCount",
"(",
")",
";",
"final",
"Point2d",
"firstP... | Replies the index of the nearest end of line according to the specified point.
@param x is the point coordinate from which the distance must be computed
@param y is the point coordinate from which the distance must be computed
@param distance is the distance value that will be set by this function (if the parameter is... | [
"Replies",
"the",
"index",
"of",
"the",
"nearest",
"end",
"of",
"line",
"according",
"to",
"the",
"specified",
"point",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/giscore/src/main/java/org/arakhne/afc/gis/mapelement/MapPolyline.java#L248-L265 |
mikepenz/MaterialDrawer | library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java | AccountHeader.setActiveProfile | public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged) {
"""
Selects the given profile and sets it to the new active profile
@param profile
"""
final boolean isCurrentSelectedProfile = mAccountHeaderBuilder.switchProfiles(profile);
//if the selectionList is shown we sho... | java | public void setActiveProfile(IProfile profile, boolean fireOnProfileChanged) {
final boolean isCurrentSelectedProfile = mAccountHeaderBuilder.switchProfiles(profile);
//if the selectionList is shown we should also update the current selected profile in the list
if (mAccountHeaderBuilder.mDrawer ... | [
"public",
"void",
"setActiveProfile",
"(",
"IProfile",
"profile",
",",
"boolean",
"fireOnProfileChanged",
")",
"{",
"final",
"boolean",
"isCurrentSelectedProfile",
"=",
"mAccountHeaderBuilder",
".",
"switchProfiles",
"(",
"profile",
")",
";",
"//if the selectionList is sh... | Selects the given profile and sets it to the new active profile
@param profile | [
"Selects",
"the",
"given",
"profile",
"and",
"sets",
"it",
"to",
"the",
"new",
"active",
"profile"
] | train | https://github.com/mikepenz/MaterialDrawer/blob/f4fb31635767edead0a01cee7b7588942b89d8d9/library/src/main/java/com/mikepenz/materialdrawer/AccountHeader.java#L190-L200 |
facebookarchive/hadoop-20 | src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java | SimulatorTaskTracker.progressTaskStatus | private void progressTaskStatus(SimulatorTaskInProgress tip, long now) {
"""
Updates the progress indicator of a task if it is running.
@param tip simulator task in progress whose progress is to be updated
@param now current simulation time
"""
TaskStatus status = tip.getTaskStatus();
if (status.ge... | java | private void progressTaskStatus(SimulatorTaskInProgress tip, long now) {
TaskStatus status = tip.getTaskStatus();
if (status.getRunState() != State.RUNNING) {
return; // nothing to be done
}
boolean isMap = tip.isMapTask();
// Time when the user space code started
long startTime = -1;
... | [
"private",
"void",
"progressTaskStatus",
"(",
"SimulatorTaskInProgress",
"tip",
",",
"long",
"now",
")",
"{",
"TaskStatus",
"status",
"=",
"tip",
".",
"getTaskStatus",
"(",
")",
";",
"if",
"(",
"status",
".",
"getRunState",
"(",
")",
"!=",
"State",
".",
"R... | Updates the progress indicator of a task if it is running.
@param tip simulator task in progress whose progress is to be updated
@param now current simulation time | [
"Updates",
"the",
"progress",
"indicator",
"of",
"a",
"task",
"if",
"it",
"is",
"running",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/mumak/src/java/org/apache/hadoop/mapred/SimulatorTaskTracker.java#L440-L491 |
alkacon/opencms-core | src/org/opencms/security/CmsPrincipal.java | CmsPrincipal.readPrincipalIncludingHistory | public static I_CmsPrincipal readPrincipalIncludingHistory(CmsObject cms, CmsUUID id) throws CmsException {
"""
Utility function to read a principal by its id from the OpenCms database using the
provided OpenCms user context.<p>
@param cms the OpenCms user context to use when reading the principal
@param id t... | java | public static I_CmsPrincipal readPrincipalIncludingHistory(CmsObject cms, CmsUUID id) throws CmsException {
try {
// first try to read the principal as a user
return cms.readUser(id);
} catch (CmsException exc) {
// assume user does not exist
}
try {
... | [
"public",
"static",
"I_CmsPrincipal",
"readPrincipalIncludingHistory",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"id",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"// first try to read the principal as a user",
"return",
"cms",
".",
"readUser",
"(",
"id",
")",
";",... | Utility function to read a principal by its id from the OpenCms database using the
provided OpenCms user context.<p>
@param cms the OpenCms user context to use when reading the principal
@param id the id of the principal to read
@return the principal read from the OpenCms database
@throws CmsException in case the pr... | [
"Utility",
"function",
"to",
"read",
"a",
"principal",
"by",
"its",
"id",
"from",
"the",
"OpenCms",
"database",
"using",
"the",
"provided",
"OpenCms",
"user",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/security/CmsPrincipal.java#L338-L360 |
ksclarke/freelib-utils | src/main/java/info/freelibrary/util/Logger.java | Logger.getMessage | public String getMessage(final String aMessage, final Object... aDetails) {
"""
Gets a message from the logger's backing resource bundle if what's passed in is a message key; if it's not then
what's passed in is, itself, returned. If what's passed in is the same thing as what's returned, any additional
details p... | java | public String getMessage(final String aMessage, final Object... aDetails) {
if (hasI18nKey(aMessage)) {
return getI18n(aMessage, aDetails);
} else if (aDetails.length == 0) {
return aMessage;
} else {
return StringUtils.format(aMessage, aDetails);
}
... | [
"public",
"String",
"getMessage",
"(",
"final",
"String",
"aMessage",
",",
"final",
"Object",
"...",
"aDetails",
")",
"{",
"if",
"(",
"hasI18nKey",
"(",
"aMessage",
")",
")",
"{",
"return",
"getI18n",
"(",
"aMessage",
",",
"aDetails",
")",
";",
"}",
"els... | Gets a message from the logger's backing resource bundle if what's passed in is a message key; if it's not then
what's passed in is, itself, returned. If what's passed in is the same thing as what's returned, any additional
details passed in are ignored.
@param aMessage A message to check against the backing resource ... | [
"Gets",
"a",
"message",
"from",
"the",
"logger",
"s",
"backing",
"resource",
"bundle",
"if",
"what",
"s",
"passed",
"in",
"is",
"a",
"message",
"key",
";",
"if",
"it",
"s",
"not",
"then",
"what",
"s",
"passed",
"in",
"is",
"itself",
"returned",
".",
... | train | https://github.com/ksclarke/freelib-utils/blob/54e822ae4c11b3d74793fd82a1a535ffafffaf45/src/main/java/info/freelibrary/util/Logger.java#L1144-L1152 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java | WTemplate.addParameter | public void addParameter(final String tag, final Object value) {
"""
Add a template parameter.
@param tag the tag for the template parameter
@param value the value for the template parameter
"""
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided");
}
TemplateModel m... | java | public void addParameter(final String tag, final Object value) {
if (Util.empty(tag)) {
throw new IllegalArgumentException("A tag must be provided");
}
TemplateModel model = getOrCreateComponentModel();
if (model.parameters == null) {
model.parameters = new HashMap<>();
}
model.parameters.put(tag, va... | [
"public",
"void",
"addParameter",
"(",
"final",
"String",
"tag",
",",
"final",
"Object",
"value",
")",
"{",
"if",
"(",
"Util",
".",
"empty",
"(",
"tag",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"A tag must be provided\"",
")",
";",
... | Add a template parameter.
@param tag the tag for the template parameter
@param value the value for the template parameter | [
"Add",
"a",
"template",
"parameter",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/WTemplate.java#L223-L233 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java | AptControlImplementation.getControlInterface | public AptControlInterface getControlInterface() {
"""
Returns the ControlInterface implemented by this ControlImpl.
"""
if ( _implDecl == null || _implDecl.getSuperinterfaces() == null )
return null;
Collection<InterfaceType> superInterfaces = _implDecl.getSuperinterfaces(... | java | public AptControlInterface getControlInterface()
{
if ( _implDecl == null || _implDecl.getSuperinterfaces() == null )
return null;
Collection<InterfaceType> superInterfaces = _implDecl.getSuperinterfaces();
for (InterfaceType intfType : superInterfaces)
{
... | [
"public",
"AptControlInterface",
"getControlInterface",
"(",
")",
"{",
"if",
"(",
"_implDecl",
"==",
"null",
"||",
"_implDecl",
".",
"getSuperinterfaces",
"(",
")",
"==",
"null",
")",
"return",
"null",
";",
"Collection",
"<",
"InterfaceType",
">",
"superInterfac... | Returns the ControlInterface implemented by this ControlImpl. | [
"Returns",
"the",
"ControlInterface",
"implemented",
"by",
"this",
"ControlImpl",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/generator/AptControlImplementation.java#L283-L298 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/RESTAppListener.java | RESTAppListener.setVirtualHost | @Reference(service = VirtualHost.class,
target = "(&(enabled=true)(id=default_host)(httpsAlias=*))",
policy = ReferencePolicy.STATIC,
cardinality = ReferenceCardinality.MANDATORY)
protected void setVirtualHost(VirtualHost vhost, Map<String, Object> props) {
"""
Set ... | java | @Reference(service = VirtualHost.class,
target = "(&(enabled=true)(id=default_host)(httpsAlias=*))",
policy = ReferencePolicy.STATIC,
cardinality = ReferenceCardinality.MANDATORY)
protected void setVirtualHost(VirtualHost vhost, Map<String, Object> props) {
if (T... | [
"@",
"Reference",
"(",
"service",
"=",
"VirtualHost",
".",
"class",
",",
"target",
"=",
"\"(&(enabled=true)(id=default_host)(httpsAlias=*))\"",
",",
"policy",
"=",
"ReferencePolicy",
".",
"STATIC",
",",
"cardinality",
"=",
"ReferenceCardinality",
".",
"MANDATORY",
")"... | Set required VirtualHost. This will be called before activate.
The target filter will only allow the enabled default_host virtual
host to be bound if/when it has an SSL port available | [
"Set",
"required",
"VirtualHost",
".",
"This",
"will",
"be",
"called",
"before",
"activate",
".",
"The",
"target",
"filter",
"will",
"only",
"allow",
"the",
"enabled",
"default_host",
"virtual",
"host",
"to",
"be",
"bound",
"if",
"/",
"when",
"it",
"has",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/RESTAppListener.java#L131-L142 |
crnk-project/crnk-framework | crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaEntityRepositoryBase.java | JpaEntityRepositoryBase.getIdFromEntity | @SuppressWarnings("unchecked")
protected I getIdFromEntity(EntityManager em, Object entity, ResourceField idField) {
"""
Extracts the resource ID from the entity.
By default it uses the entity's primary key if the field name matches the DTO's ID field.
Override in subclasses if a different entity field shoul... | java | @SuppressWarnings("unchecked")
protected I getIdFromEntity(EntityManager em, Object entity, ResourceField idField) {
Object pk = em.getEntityManagerFactory().getPersistenceUnitUtil().getIdentifier(entity);
PreconditionUtil.verify(pk != null, "pk not available for entity %s", entity);
if (pk ... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"I",
"getIdFromEntity",
"(",
"EntityManager",
"em",
",",
"Object",
"entity",
",",
"ResourceField",
"idField",
")",
"{",
"Object",
"pk",
"=",
"em",
".",
"getEntityManagerFactory",
"(",
")",
".",
"... | Extracts the resource ID from the entity.
By default it uses the entity's primary key if the field name matches the DTO's ID field.
Override in subclasses if a different entity field should be used.
@return the resource ID or <code>null</code> when it could not be determined | [
"Extracts",
"the",
"resource",
"ID",
"from",
"the",
"entity",
".",
"By",
"default",
"it",
"uses",
"the",
"entity",
"s",
"primary",
"key",
"if",
"the",
"field",
"name",
"matches",
"the",
"DTO",
"s",
"ID",
"field",
".",
"Override",
"in",
"subclasses",
"if"... | train | https://github.com/crnk-project/crnk-framework/blob/2fd3ef9a991788d46fd2e83b43c8ea37cbaf8681/crnk-data/crnk-data-jpa/src/main/java/io/crnk/data/jpa/JpaEntityRepositoryBase.java#L200-L208 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.requestState | @ObjectiveCName("requestStateWithFileId:withCallback:")
public void requestState(long fileId, final FileCallback callback) {
"""
Request file state
@param fileId file id
@param callback file state callback
"""
modules.getFilesModule().requestState(fileId, callback);
} | java | @ObjectiveCName("requestStateWithFileId:withCallback:")
public void requestState(long fileId, final FileCallback callback) {
modules.getFilesModule().requestState(fileId, callback);
} | [
"@",
"ObjectiveCName",
"(",
"\"requestStateWithFileId:withCallback:\"",
")",
"public",
"void",
"requestState",
"(",
"long",
"fileId",
",",
"final",
"FileCallback",
"callback",
")",
"{",
"modules",
".",
"getFilesModule",
"(",
")",
".",
"requestState",
"(",
"fileId",
... | Request file state
@param fileId file id
@param callback file state callback | [
"Request",
"file",
"state"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1975-L1978 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/stats/Counters.java | Counters.saveCounter | public static <E> void saveCounter(Counter<E> c, OutputStream stream) {
"""
Saves a Counter as one key/count pair per line separated by white space to
the given OutputStream. Does not close the stream.
"""
PrintStream out = new PrintStream(stream);
for (E key : c.keySet()) {
out.println(key +... | java | public static <E> void saveCounter(Counter<E> c, OutputStream stream) {
PrintStream out = new PrintStream(stream);
for (E key : c.keySet()) {
out.println(key + " " + c.getCount(key));
}
} | [
"public",
"static",
"<",
"E",
">",
"void",
"saveCounter",
"(",
"Counter",
"<",
"E",
">",
"c",
",",
"OutputStream",
"stream",
")",
"{",
"PrintStream",
"out",
"=",
"new",
"PrintStream",
"(",
"stream",
")",
";",
"for",
"(",
"E",
"key",
":",
"c",
".",
... | Saves a Counter as one key/count pair per line separated by white space to
the given OutputStream. Does not close the stream. | [
"Saves",
"a",
"Counter",
"as",
"one",
"key",
"/",
"count",
"pair",
"per",
"line",
"separated",
"by",
"white",
"space",
"to",
"the",
"given",
"OutputStream",
".",
"Does",
"not",
"close",
"the",
"stream",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/stats/Counters.java#L1632-L1637 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/AESUtils.java | AESUtils.createCipher | public static Cipher createCipher(int mode, byte[] keyData, byte[] iv,
String cipherTransformation) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException {
"""
Create and initialize a {@link Cipher} instance.
@param mode
either ... | java | public static Cipher createCipher(int mode, byte[] keyData, byte[] iv,
String cipherTransformation) throws NoSuchAlgorithmException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException {
if (StringUtils.isBlank(cipherTransformation)) {
cipherTransf... | [
"public",
"static",
"Cipher",
"createCipher",
"(",
"int",
"mode",
",",
"byte",
"[",
"]",
"keyData",
",",
"byte",
"[",
"]",
"iv",
",",
"String",
"cipherTransformation",
")",
"throws",
"NoSuchAlgorithmException",
",",
"NoSuchPaddingException",
",",
"InvalidKeyExcept... | Create and initialize a {@link Cipher} instance.
@param mode
either {@link Cipher#ENCRYPT_MODE} or {@link Cipher#DECRYPT_MODE}
@param keyData
@param iv
@param cipherTransformation
@return
@throws NoSuchPaddingException
@throws NoSuchAlgorithmException
@throws InvalidKeyException
@throws InvalidAlgorithmParameterExcept... | [
"Create",
"and",
"initialize",
"a",
"{",
"@link",
"Cipher",
"}",
"instance",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/AESUtils.java#L110-L136 |
oehf/ipf-oht-atna | auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java | GenericIHEAuditEventMessage.addValueSetParticipantObject | public void addValueSetParticipantObject(String valueSetUniqueId, String valueSetName, String valueSetVersion) {
"""
Adds a Participant Object representing a value set for SVS Exports
@param valueSetUniqueId unique id (OID) of the returned value set
@param valueSetName name associated with the unique id (OID) of... | java | public void addValueSetParticipantObject(String valueSetUniqueId, String valueSetName, String valueSetVersion)
{
if (valueSetName == null){
valueSetName = "";
}
if (valueSetVersion == null){
valueSetVersion = "";
}
List<TypeValuePairType> tvp = new LinkedList<>();
tvp.add(getTypeValuePair("Value Set ... | [
"public",
"void",
"addValueSetParticipantObject",
"(",
"String",
"valueSetUniqueId",
",",
"String",
"valueSetName",
",",
"String",
"valueSetVersion",
")",
"{",
"if",
"(",
"valueSetName",
"==",
"null",
")",
"{",
"valueSetName",
"=",
"\"\"",
";",
"}",
"if",
"(",
... | Adds a Participant Object representing a value set for SVS Exports
@param valueSetUniqueId unique id (OID) of the returned value set
@param valueSetName name associated with the unique id (OID) of the returned value set
@param valueSetVersion version of the returned value set | [
"Adds",
"a",
"Participant",
"Object",
"representing",
"a",
"value",
"set",
"for",
"SVS",
"Exports"
] | train | https://github.com/oehf/ipf-oht-atna/blob/25ed1e926825169c94923a2c89a4618f60478ae8/auditor/src/main/java/org/openhealthtools/ihe/atna/auditor/events/ihe/GenericIHEAuditEventMessage.java#L262-L282 |
paypal/SeLion | codegen/src/main/java/com/paypal/selion/plugins/GUIObjectDetails.java | GUIObjectDetails.transformKeys | public static List<GUIObjectDetails> transformKeys(List<String> keys) {
"""
A overloaded version of transformKeys method which internally specifies {@link TestPlatform#WEB} as the
{@link TestPlatform}
@param keys
keys for which {@link GUIObjectDetails} is to be created.
@return the {@link List} of {@link GUI... | java | public static List<GUIObjectDetails> transformKeys(List<String> keys) {
return transformKeys(keys, TestPlatform.WEB);
} | [
"public",
"static",
"List",
"<",
"GUIObjectDetails",
">",
"transformKeys",
"(",
"List",
"<",
"String",
">",
"keys",
")",
"{",
"return",
"transformKeys",
"(",
"keys",
",",
"TestPlatform",
".",
"WEB",
")",
";",
"}"
] | A overloaded version of transformKeys method which internally specifies {@link TestPlatform#WEB} as the
{@link TestPlatform}
@param keys
keys for which {@link GUIObjectDetails} is to be created.
@return the {@link List} of {@link GUIObjectDetails} | [
"A",
"overloaded",
"version",
"of",
"transformKeys",
"method",
"which",
"internally",
"specifies",
"{",
"@link",
"TestPlatform#WEB",
"}",
"as",
"the",
"{",
"@link",
"TestPlatform",
"}"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/codegen/src/main/java/com/paypal/selion/plugins/GUIObjectDetails.java#L124-L126 |
apereo/cas | core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java | AbstractCasWebflowConfigurer.createTransitionForState | public Transition createTransitionForState(final TransitionableState state, final String criteriaOutcome, final String targetState) {
"""
Create transition for state transition.
@param state the state
@param criteriaOutcome the criteria outcome
@param targetState the target state
@return the tr... | java | public Transition createTransitionForState(final TransitionableState state, final String criteriaOutcome, final String targetState) {
return createTransitionForState(state, criteriaOutcome, targetState, false);
} | [
"public",
"Transition",
"createTransitionForState",
"(",
"final",
"TransitionableState",
"state",
",",
"final",
"String",
"criteriaOutcome",
",",
"final",
"String",
"targetState",
")",
"{",
"return",
"createTransitionForState",
"(",
"state",
",",
"criteriaOutcome",
",",... | Create transition for state transition.
@param state the state
@param criteriaOutcome the criteria outcome
@param targetState the target state
@return the transition | [
"Create",
"transition",
"for",
"state",
"transition",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-webflow-api/src/main/java/org/apereo/cas/web/flow/configurer/AbstractCasWebflowConfigurer.java#L295-L297 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_plesk_serviceName_upgrade_GET | public ArrayList<String> license_plesk_serviceName_upgrade_GET(String serviceName, OvhOrderableAntispamEnum antispam, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, B... | java | public ArrayList<String> license_plesk_serviceName_upgrade_GET(String serviceName, OvhOrderableAntispamEnum antispam, OvhOrderableAntivirusEnum antivirus, OvhPleskApplicationSetEnum applicationSet, OvhOrderablePleskDomainNumberEnum domainNumber, OvhOrderablePleskLanguagePackEnum languagePackNumber, Boolean powerpack, B... | [
"public",
"ArrayList",
"<",
"String",
">",
"license_plesk_serviceName_upgrade_GET",
"(",
"String",
"serviceName",
",",
"OvhOrderableAntispamEnum",
"antispam",
",",
"OvhOrderableAntivirusEnum",
"antivirus",
",",
"OvhPleskApplicationSetEnum",
"applicationSet",
",",
"OvhOrderableP... | Get allowed durations for 'upgrade' option
REST: GET /order/license/plesk/{serviceName}/upgrade
@param antispam [required] The antispam currently enabled on this Plesk License
@param resellerManagement [required] Reseller management option activation
@param languagePackNumber [required] The amount (between 0 and 5) of... | [
"Get",
"allowed",
"durations",
"for",
"upgrade",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1863-L1877 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDisplayLayoutPersistenceImpl.java | CPDisplayLayoutPersistenceImpl.findByC_C | @Override
public CPDisplayLayout findByC_C(long classNameId, long classPK)
throws NoSuchCPDisplayLayoutException {
"""
Returns the cp display layout where classNameId = ? and classPK = ? or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found.
@param classNameId the class name ID
... | java | @Override
public CPDisplayLayout findByC_C(long classNameId, long classPK)
throws NoSuchCPDisplayLayoutException {
CPDisplayLayout cpDisplayLayout = fetchByC_C(classNameId, classPK);
if (cpDisplayLayout == null) {
StringBundler msg = new StringBundler(6);
msg.append(_NO_SUCH_ENTITY_WITH_KEY);
msg.app... | [
"@",
"Override",
"public",
"CPDisplayLayout",
"findByC_C",
"(",
"long",
"classNameId",
",",
"long",
"classPK",
")",
"throws",
"NoSuchCPDisplayLayoutException",
"{",
"CPDisplayLayout",
"cpDisplayLayout",
"=",
"fetchByC_C",
"(",
"classNameId",
",",
"classPK",
")",
";",
... | Returns the cp display layout where classNameId = ? and classPK = ? or throws a {@link NoSuchCPDisplayLayoutException} if it could not be found.
@param classNameId the class name ID
@param classPK the class pk
@return the matching cp display layout
@throws NoSuchCPDisplayLayoutException if a matching cp displa... | [
"Returns",
"the",
"cp",
"display",
"layout",
"where",
"classNameId",
"=",
"?",
";",
"and",
"classPK",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDisplayLayoutException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDisplayLayoutPersistenceImpl.java#L1501-L1527 |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/sid/StableUniqueStanzaIdManager.java | StableUniqueStanzaIdManager.enable | public synchronized void enable() {
"""
Start appending origin-id elements to outgoing stanzas and add the feature to disco.
"""
ServiceDiscoveryManager.getInstanceFor(connection()).addFeature(NAMESPACE);
StanzaFilter filter = new AndFilter(OUTGOING_FILTER, new NotFilter(OUTGOING_FILTER));
... | java | public synchronized void enable() {
ServiceDiscoveryManager.getInstanceFor(connection()).addFeature(NAMESPACE);
StanzaFilter filter = new AndFilter(OUTGOING_FILTER, new NotFilter(OUTGOING_FILTER));
connection().addStanzaInterceptor(ADD_ORIGIN_ID_INTERCEPTOR, filter);
} | [
"public",
"synchronized",
"void",
"enable",
"(",
")",
"{",
"ServiceDiscoveryManager",
".",
"getInstanceFor",
"(",
"connection",
"(",
")",
")",
".",
"addFeature",
"(",
"NAMESPACE",
")",
";",
"StanzaFilter",
"filter",
"=",
"new",
"AndFilter",
"(",
"OUTGOING_FILTER... | Start appending origin-id elements to outgoing stanzas and add the feature to disco. | [
"Start",
"appending",
"origin",
"-",
"id",
"elements",
"to",
"outgoing",
"stanzas",
"and",
"add",
"the",
"feature",
"to",
"disco",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/sid/StableUniqueStanzaIdManager.java#L93-L97 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_util.java | Dcs_util.cs_spalloc | public static Dcs cs_spalloc(int m, int n, int nzmax, boolean values, boolean triplet) {
"""
Allocate a sparse matrix (triplet form or compressed-column form).
@param m
number of rows
@param n
number of columns
@param nzmax
maximum number of entries
@param values
allocate pattern only if false, values an... | java | public static Dcs cs_spalloc(int m, int n, int nzmax, boolean values, boolean triplet) {
Dcs A = new Dcs(); /* allocate the Dcs struct */
A.m = m; /* define dimensions and nzmax */
A.n = n;
A.nzmax = nzmax = Math.max(nzmax, 1);
A.nz = triplet ? 0 : -1; /* allocate triplet or... | [
"public",
"static",
"Dcs",
"cs_spalloc",
"(",
"int",
"m",
",",
"int",
"n",
",",
"int",
"nzmax",
",",
"boolean",
"values",
",",
"boolean",
"triplet",
")",
"{",
"Dcs",
"A",
"=",
"new",
"Dcs",
"(",
")",
";",
"/* allocate the Dcs struct */",
"A",
".",
"m",... | Allocate a sparse matrix (triplet form or compressed-column form).
@param m
number of rows
@param n
number of columns
@param nzmax
maximum number of entries
@param values
allocate pattern only if false, values and pattern otherwise
@param triplet
compressed-column if false, triplet form otherwise
@return sparse matrix | [
"Allocate",
"a",
"sparse",
"matrix",
"(",
"triplet",
"form",
"or",
"compressed",
"-",
"column",
"form",
")",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdouble/Dcs_util.java#L53-L63 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/FilePathProcessor.java | FilePathProcessor.processPath | public static void processPath(File path, String suffix, boolean recursively, FileProcessor processor) {
"""
Apply a method to the files under a given directory and
perhaps its subdirectories.
@param path file or directory to load from
@param suffix suffix (normally "File extension") of files to l... | java | public static void processPath(File path, String suffix, boolean recursively, FileProcessor processor) {
processPath(path, new ExtensionFileFilter(suffix, recursively), processor);
} | [
"public",
"static",
"void",
"processPath",
"(",
"File",
"path",
",",
"String",
"suffix",
",",
"boolean",
"recursively",
",",
"FileProcessor",
"processor",
")",
"{",
"processPath",
"(",
"path",
",",
"new",
"ExtensionFileFilter",
"(",
"suffix",
",",
"recursively",... | Apply a method to the files under a given directory and
perhaps its subdirectories.
@param path file or directory to load from
@param suffix suffix (normally "File extension") of files to load
@param recursively true means descend into subdirectories as well
@param processor The <code>FileProcessor</code... | [
"Apply",
"a",
"method",
"to",
"the",
"files",
"under",
"a",
"given",
"directory",
"and",
"perhaps",
"its",
"subdirectories",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/FilePathProcessor.java#L49-L51 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.