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 |
|---|---|---|---|---|---|---|---|---|---|---|
twitter/hraven | hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java | JobHistoryService.getFlowSeries | public List<Flow> getFlowSeries(String cluster, String user, String appId,
String version, boolean populateTasks, long startTime, long endTime,
int limit) throws IOException {
"""
Returns the most recent {@link Flow} runs within that time range, up to
{@code limit} instances. If the {@code version} pa... | java | public List<Flow> getFlowSeries(String cluster, String user, String appId,
String version, boolean populateTasks, long startTime, long endTime,
int limit) throws IOException {
// TODO: use RunMatchFilter to limit scan on the server side
byte[] rowPrefix = Bytes.toBytes(
cluster + Constants.S... | [
"public",
"List",
"<",
"Flow",
">",
"getFlowSeries",
"(",
"String",
"cluster",
",",
"String",
"user",
",",
"String",
"appId",
",",
"String",
"version",
",",
"boolean",
"populateTasks",
",",
"long",
"startTime",
",",
"long",
"endTime",
",",
"int",
"limit",
... | Returns the most recent {@link Flow} runs within that time range, up to
{@code limit} instances. If the {@code version} parameter is non-null, the
returned results will be restricted to those matching this app version.
@param cluster the cluster where the jobs were run
@param user the user running the jobs
@param appI... | [
"Returns",
"the",
"most",
"recent",
"{",
"@link",
"Flow",
"}",
"runs",
"within",
"that",
"time",
"range",
"up",
"to",
"{",
"@code",
"limit",
"}",
"instances",
".",
"If",
"the",
"{",
"@code",
"version",
"}",
"parameter",
"is",
"non",
"-",
"null",
"the",... | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-core/src/main/java/com/twitter/hraven/datasource/JobHistoryService.java#L289-L316 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getHierarchicalEntityRolesAsync | public Observable<List<EntityRole>> getHierarchicalEntityRolesAsync(UUID appId, String versionId, UUID hEntityId) {
"""
Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@throws IllegalArgumentExce... | java | public Observable<List<EntityRole>> getHierarchicalEntityRolesAsync(UUID appId, String versionId, UUID hEntityId) {
return getHierarchicalEntityRolesWithServiceResponseAsync(appId, versionId, hEntityId).map(new Func1<ServiceResponse<List<EntityRole>>, List<EntityRole>>() {
@Override
publ... | [
"public",
"Observable",
"<",
"List",
"<",
"EntityRole",
">",
">",
"getHierarchicalEntityRolesAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"hEntityId",
")",
"{",
"return",
"getHierarchicalEntityRolesWithServiceResponseAsync",
"(",
"appId",
","... | Get All Entity Roles for a given entity.
@param appId The application ID.
@param versionId The version ID.
@param hEntityId The hierarchical entity extractor ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the List<EntityRole> object | [
"Get",
"All",
"Entity",
"Roles",
"for",
"a",
"given",
"entity",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L9366-L9373 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java | CollUtil.removeEmpty | public static <T extends CharSequence> Collection<T> removeEmpty(Collection<T> collection) {
"""
去除{@code null}或者"" 元素
@param collection 集合
@return 处理后的集合
@since 3.2.2
"""
return filter(collection, new Filter<T>() {
@Override
public boolean accept(T t) {
return false == StrUtil.isEmpty(t);... | java | public static <T extends CharSequence> Collection<T> removeEmpty(Collection<T> collection) {
return filter(collection, new Filter<T>() {
@Override
public boolean accept(T t) {
return false == StrUtil.isEmpty(t);
}
});
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"Collection",
"<",
"T",
">",
"removeEmpty",
"(",
"Collection",
"<",
"T",
">",
"collection",
")",
"{",
"return",
"filter",
"(",
"collection",
",",
"new",
"Filter",
"<",
"T",
">",
"(",
")",
"{... | 去除{@code null}或者"" 元素
@param collection 集合
@return 处理后的集合
@since 3.2.2 | [
"去除",
"{",
"@code",
"null",
"}",
"或者",
"元素"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/collection/CollUtil.java#L1090-L1097 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.generateThumbnail | public InputStream generateThumbnail(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) {
"""
This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (RO... | java | public InputStream generateThumbnail(int width, int height, String url, GenerateThumbnailOptionalParameter generateThumbnailOptionalParameter) {
return generateThumbnailWithServiceResponseAsync(width, height, url, generateThumbnailOptionalParameter).toBlocking().single().body();
} | [
"public",
"InputStream",
"generateThumbnail",
"(",
"int",
"width",
",",
"int",
"height",
",",
"String",
"url",
",",
"GenerateThumbnailOptionalParameter",
"generateThumbnailOptionalParameter",
")",
"{",
"return",
"generateThumbnailWithServiceResponseAsync",
"(",
"width",
","... | This operation generates a thumbnail image with the user-specified width and height. By default, the service analyzes the image, identifies the region of interest (ROI), and generates smart cropping coordinates based on the ROI. Smart cropping helps when you specify an aspect ratio that differs from that of the input i... | [
"This",
"operation",
"generates",
"a",
"thumbnail",
"image",
"with",
"the",
"user",
"-",
"specified",
"width",
"and",
"height",
".",
"By",
"default",
"the",
"service",
"analyzes",
"the",
"image",
"identifies",
"the",
"region",
"of",
"interest",
"(",
"ROI",
"... | 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#L2066-L2068 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java | Query.endBefore | @Nonnull
public Query endBefore(Object... fieldValues) {
"""
Creates and returns a new Query that ends before the provided fields relative to the order of
the query. The order of the field values must match the order of the order by clauses of the
query.
@param fieldValues The field values to end this query... | java | @Nonnull
public Query endBefore(Object... fieldValues) {
QueryOptions newOptions = new QueryOptions(options);
newOptions.endCursor = createCursor(newOptions.fieldOrders, fieldValues, true);
return new Query(firestore, path, newOptions);
} | [
"@",
"Nonnull",
"public",
"Query",
"endBefore",
"(",
"Object",
"...",
"fieldValues",
")",
"{",
"QueryOptions",
"newOptions",
"=",
"new",
"QueryOptions",
"(",
"options",
")",
";",
"newOptions",
".",
"endCursor",
"=",
"createCursor",
"(",
"newOptions",
".",
"fie... | Creates and returns a new Query that ends before the provided fields relative to the order of
the query. The order of the field values must match the order of the order by clauses of the
query.
@param fieldValues The field values to end this query before, in order of the query's order by.
@return The created Query. | [
"Creates",
"and",
"returns",
"a",
"new",
"Query",
"that",
"ends",
"before",
"the",
"provided",
"fields",
"relative",
"to",
"the",
"order",
"of",
"the",
"query",
".",
"The",
"order",
"of",
"the",
"field",
"values",
"must",
"match",
"the",
"order",
"of",
"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-firestore/src/main/java/com/google/cloud/firestore/Query.java#L828-L833 |
google/closure-compiler | src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java | Es6ConvertSuperConstructorCalls.isUnextendableNativeClass | private boolean isUnextendableNativeClass(NodeTraversal t, String className) {
"""
Is the given class a native class for which we cannot properly transpile extension?
@param t
@param className
"""
// This list originally taken from the list of built-in objects at
// https://developer.mozilla.org/en-U... | java | private boolean isUnextendableNativeClass(NodeTraversal t, String className) {
// This list originally taken from the list of built-in objects at
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference
// as of 2016-10-22.
// - Intl.* classes were left out, because it doesn't seem worth the... | [
"private",
"boolean",
"isUnextendableNativeClass",
"(",
"NodeTraversal",
"t",
",",
"String",
"className",
")",
"{",
"// This list originally taken from the list of built-in objects at",
"// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference",
"// as of 2016-10-22.",
"// - ... | Is the given class a native class for which we cannot properly transpile extension?
@param t
@param className | [
"Is",
"the",
"given",
"class",
"a",
"native",
"class",
"for",
"which",
"we",
"cannot",
"properly",
"transpile",
"extension?"
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/Es6ConvertSuperConstructorCalls.java#L434-L474 |
sebastiangraf/treetank | interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java | XPathParser.parseReverceAxis | private AbsAxis parseReverceAxis() {
"""
Parses the the rule ReverceAxis according to the following production
rule: [33] ReverseAxis ::= <"parent" "::"> | <"ancestor" "::"> |
<"preceding-sibling" "::">|<"preceding" "::">|<"ancestor-or-self" "::"> .
@return axis
"""
AbsAxis axis;
if (is("... | java | private AbsAxis parseReverceAxis() {
AbsAxis axis;
if (is("parent", true)) {
axis = new ParentAxis(getTransaction());
} else if (is("ancestor", true)) {
axis = new AncestorAxis(getTransaction());
} else if (is("ancestor-or-self", true)) {
axis = ... | [
"private",
"AbsAxis",
"parseReverceAxis",
"(",
")",
"{",
"AbsAxis",
"axis",
";",
"if",
"(",
"is",
"(",
"\"parent\"",
",",
"true",
")",
")",
"{",
"axis",
"=",
"new",
"ParentAxis",
"(",
"getTransaction",
"(",
")",
")",
";",
"}",
"else",
"if",
"(",
"is"... | Parses the the rule ReverceAxis according to the following production
rule: [33] ReverseAxis ::= <"parent" "::"> | <"ancestor" "::"> |
<"preceding-sibling" "::">|<"preceding" "::">|<"ancestor-or-self" "::"> .
@return axis | [
"Parses",
"the",
"the",
"rule",
"ReverceAxis",
"according",
"to",
"the",
"following",
"production",
"rule",
":",
"[",
"33",
"]",
"ReverseAxis",
"::",
"=",
"<",
"parent",
"::",
">",
"|",
"<",
"ancestor",
"::",
">",
"|",
"<",
"preceding",
"-",
"sibling",
... | train | https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/xpath/parser/XPathParser.java#L973-L1003 |
ggrandes/packer | src/main/java/org/javastack/packer/Packer.java | Packer.fromHex | static final byte[] fromHex(final String hex) throws ParseException {
"""
Transform Hex String to byte array
@param hex
@return
@throws ParseException
"""
final int len = hex.length();
final byte[] out = new byte[len / 2];
for (int i = 0, j = 0; i < len; i++) {
char c = hex.charAt(i);
int v = ... | java | static final byte[] fromHex(final String hex) throws ParseException {
final int len = hex.length();
final byte[] out = new byte[len / 2];
for (int i = 0, j = 0; i < len; i++) {
char c = hex.charAt(i);
int v = 0;
if ((c >= '0') && (c <= '9')) {
v = (c - '0');
} else if ((c >= 'A') && (c <= 'F')) {
... | [
"static",
"final",
"byte",
"[",
"]",
"fromHex",
"(",
"final",
"String",
"hex",
")",
"throws",
"ParseException",
"{",
"final",
"int",
"len",
"=",
"hex",
".",
"length",
"(",
")",
";",
"final",
"byte",
"[",
"]",
"out",
"=",
"new",
"byte",
"[",
"len",
... | Transform Hex String to byte array
@param hex
@return
@throws ParseException | [
"Transform",
"Hex",
"String",
"to",
"byte",
"array"
] | train | https://github.com/ggrandes/packer/blob/0b37b286a3d0555050eb2e65419dd74f8d8d3e78/src/main/java/org/javastack/packer/Packer.java#L1596-L1618 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java | LocalPDBDirectory.initPaths | protected void initPaths() {
"""
Should be called whenever any of the path variables change.
Thus, if {@link getSplitDirPath()} or {@link getObsoleteDirPath()}
depend on anything, they should call this function when that thing
changes (possibly including at the end of the constructor).
"""
// Hand-rolled ... | java | protected void initPaths() {
// Hand-rolled String.join(), for java 6
String[] split = getSplitDirPath();
String[] obsolete = getObsoleteDirPath();
//URLs are joined with '/'
StringBuilder splitURL = new StringBuilder("/pub/pdb");
for(int i=0;i<split.length;i++) {
splitURL.append("/");
splitURL.appen... | [
"protected",
"void",
"initPaths",
"(",
")",
"{",
"// Hand-rolled String.join(), for java 6",
"String",
"[",
"]",
"split",
"=",
"getSplitDirPath",
"(",
")",
";",
"String",
"[",
"]",
"obsolete",
"=",
"getObsoleteDirPath",
"(",
")",
";",
"//URLs are joined with '/'",
... | Should be called whenever any of the path variables change.
Thus, if {@link getSplitDirPath()} or {@link getObsoleteDirPath()}
depend on anything, they should call this function when that thing
changes (possibly including at the end of the constructor). | [
"Should",
"be",
"called",
"whenever",
"any",
"of",
"the",
"path",
"variables",
"change",
".",
"Thus",
"if",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/LocalPDBDirectory.java#L719-L749 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2Writable.java | Trie2Writable.setRange | public Trie2Writable setRange(Trie2.Range range, boolean overwrite) {
"""
Set the values from a Trie2.Range.
All code points within the range will get the value if
overwrite is TRUE or if the old value is the initial value.
Ranges with the lead surrogate flag set will set the alternate
lead-surrogate value... | java | public Trie2Writable setRange(Trie2.Range range, boolean overwrite) {
fHash = 0;
if (range.leadSurrogate) {
for (int c=range.startCodePoint; c<=range.endCodePoint; c++) {
if (overwrite || getFromU16SingleLead((char)c) == this.initialValue) {
set... | [
"public",
"Trie2Writable",
"setRange",
"(",
"Trie2",
".",
"Range",
"range",
",",
"boolean",
"overwrite",
")",
"{",
"fHash",
"=",
"0",
";",
"if",
"(",
"range",
".",
"leadSurrogate",
")",
"{",
"for",
"(",
"int",
"c",
"=",
"range",
".",
"startCodePoint",
... | Set the values from a Trie2.Range.
All code points within the range will get the value if
overwrite is TRUE or if the old value is the initial value.
Ranges with the lead surrogate flag set will set the alternate
lead-surrogate values in the Trie, rather than the code point values.
This function is intended to work ... | [
"Set",
"the",
"values",
"from",
"a",
"Trie2",
".",
"Range",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/impl/Trie2Writable.java#L528-L540 |
Arello-Mobile/Moxy | moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java | MvpViewState.restoreState | protected void restoreState(View view, Set<ViewCommand<View>> currentState) {
"""
Apply saved state to attached view
@param view mvp view to restore state
@param currentState commands that was applied already
"""
if (mViewCommands.isEmpty()) {
return;
}
mViewCommands.reapply(view, currentState);
... | java | protected void restoreState(View view, Set<ViewCommand<View>> currentState) {
if (mViewCommands.isEmpty()) {
return;
}
mViewCommands.reapply(view, currentState);
} | [
"protected",
"void",
"restoreState",
"(",
"View",
"view",
",",
"Set",
"<",
"ViewCommand",
"<",
"View",
">",
">",
"currentState",
")",
"{",
"if",
"(",
"mViewCommands",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"mViewCommands",
".",
"reapply"... | Apply saved state to attached view
@param view mvp view to restore state
@param currentState commands that was applied already | [
"Apply",
"saved",
"state",
"to",
"attached",
"view"
] | train | https://github.com/Arello-Mobile/Moxy/blob/83c608de22a55864f0cdd8c1eee878e72afa3e71/moxy/src/main/java/com/arellomobile/mvp/viewstate/MvpViewState.java#L36-L42 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.collectMany | public static <T,K,V> Collection<T> collectMany(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<Collection<? extends T>> projection) {
"""
Projects each item from a source map to a result collection and concatenates (flattens) the resulting
collections adding them into a collection.
<p>
<pre cl... | java | public static <T,K,V> Collection<T> collectMany(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure<Collection<? extends T>> projection) {
return collectMany(self, new ArrayList<T>(), projection);
} | [
"public",
"static",
"<",
"T",
",",
"K",
",",
"V",
">",
"Collection",
"<",
"T",
">",
"collectMany",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"self",
",",
"@",
"ClosureParams",
"(",
"MapEntryOrKeyValue",
".",
"class",
")",
"Closure",
"<",
"Collection",
"<"... | Projects each item from a source map to a result collection and concatenates (flattens) the resulting
collections adding them into a collection.
<p>
<pre class="groovyTestCase">
def map = [bread:3, milk:5, butter:2]
def result = map.collectMany{ k, v {@code ->} k.startsWith('b') ? k.toList() : [] }
assert result == ['b... | [
"Projects",
"each",
"item",
"from",
"a",
"source",
"map",
"to",
"a",
"result",
"collection",
"and",
"concatenates",
"(",
"flattens",
")",
"the",
"resulting",
"collections",
"adding",
"them",
"into",
"a",
"collection",
".",
"<p",
">",
"<pre",
"class",
"=",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L3872-L3874 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/ui/Widgets.java | Widgets.getText | public static String getText (TextBoxBase box, String defaultAsBlank) {
"""
Retrieve the text from the TextBox, unless it is the specified default, in which case
we return "".
"""
String s = box.getText().trim();
return s.equals(defaultAsBlank) ? "" : s;
} | java | public static String getText (TextBoxBase box, String defaultAsBlank)
{
String s = box.getText().trim();
return s.equals(defaultAsBlank) ? "" : s;
} | [
"public",
"static",
"String",
"getText",
"(",
"TextBoxBase",
"box",
",",
"String",
"defaultAsBlank",
")",
"{",
"String",
"s",
"=",
"box",
".",
"getText",
"(",
")",
".",
"trim",
"(",
")",
";",
"return",
"s",
".",
"equals",
"(",
"defaultAsBlank",
")",
"?... | Retrieve the text from the TextBox, unless it is the specified default, in which case
we return "". | [
"Retrieve",
"the",
"text",
"from",
"the",
"TextBox",
"unless",
"it",
"is",
"the",
"specified",
"default",
"in",
"which",
"case",
"we",
"return",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/ui/Widgets.java#L346-L350 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java | TypeVariableImpl.typeVarToString | static String typeVarToString(DocEnv env, TypeVar v, boolean full) {
"""
Return the string form of a type variable along with any
"extends" clause. Class names are qualified if "full" is true.
"""
StringBuilder s = new StringBuilder(v.toString());
List<Type> bounds = getBounds(v, env);
... | java | static String typeVarToString(DocEnv env, TypeVar v, boolean full) {
StringBuilder s = new StringBuilder(v.toString());
List<Type> bounds = getBounds(v, env);
if (bounds.nonEmpty()) {
boolean first = true;
for (Type b : bounds) {
s.append(first ? " extends... | [
"static",
"String",
"typeVarToString",
"(",
"DocEnv",
"env",
",",
"TypeVar",
"v",
",",
"boolean",
"full",
")",
"{",
"StringBuilder",
"s",
"=",
"new",
"StringBuilder",
"(",
"v",
".",
"toString",
"(",
")",
")",
";",
"List",
"<",
"Type",
">",
"bounds",
"=... | Return the string form of a type variable along with any
"extends" clause. Class names are qualified if "full" is true. | [
"Return",
"the",
"string",
"form",
"of",
"a",
"type",
"variable",
"along",
"with",
"any",
"extends",
"clause",
".",
"Class",
"names",
"are",
"qualified",
"if",
"full",
"is",
"true",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/main/TypeVariableImpl.java#L109-L121 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java | NaaccrXmlDictionaryUtils.writeDictionary | public static void writeDictionary(NaaccrDictionary dictionary, Writer writer) throws IOException {
"""
Writes the given dictionary to the provided writer.
@param dictionary dictionary to write, cannot be null
@param writer writer, cannot be null
@throws IOException if the dictionary could not be written
""... | java | public static void writeDictionary(NaaccrDictionary dictionary, Writer writer) throws IOException {
try {
instanciateXStream().marshal(dictionary, new NaaccrPrettyPrintWriter(dictionary, writer));
}
catch (XStreamException ex) {
throw new IOException("Unable to write dict... | [
"public",
"static",
"void",
"writeDictionary",
"(",
"NaaccrDictionary",
"dictionary",
",",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"try",
"{",
"instanciateXStream",
"(",
")",
".",
"marshal",
"(",
"dictionary",
",",
"new",
"NaaccrPrettyPrintWriter",
... | Writes the given dictionary to the provided writer.
@param dictionary dictionary to write, cannot be null
@param writer writer, cannot be null
@throws IOException if the dictionary could not be written | [
"Writes",
"the",
"given",
"dictionary",
"to",
"the",
"provided",
"writer",
"."
] | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlDictionaryUtils.java#L313-L320 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/utils/TempUtils.java | TempUtils.copyIntoTempFile | public static File copyIntoTempFile(String fileName, InputStream inputStream)
throws IOException {
"""
Copies <code>inputStream</code> into a temporary file <code>fileName</code>.
@param fileName file name
@param inputStream stream to copy from
@return temporary file
@throws IOException if an IO error ... | java | public static File copyIntoTempFile(String fileName, InputStream inputStream)
throws IOException {
BufferedInputStream bufferedStream = inputStream instanceof BufferedInputStream ? (BufferedInputStream) inputStream
: new BufferedInputStream(inputStream);
File destFile = null;
try {
destF... | [
"public",
"static",
"File",
"copyIntoTempFile",
"(",
"String",
"fileName",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"BufferedInputStream",
"bufferedStream",
"=",
"inputStream",
"instanceof",
"BufferedInputStream",
"?",
"(",
"BufferedInputStrea... | Copies <code>inputStream</code> into a temporary file <code>fileName</code>.
@param fileName file name
@param inputStream stream to copy from
@return temporary file
@throws IOException if an IO error occurs | [
"Copies",
"<code",
">",
"inputStream<",
"/",
"code",
">",
"into",
"a",
"temporary",
"file",
"<code",
">",
"fileName<",
"/",
"code",
">",
"."
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/utils/TempUtils.java#L64-L90 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java | CmsGalleryController.lookForParent | private CmsGalleryTreeEntry lookForParent(CmsGalleryTreeEntry possibleParent, String targetPath) {
"""
Looks for an ancestor tree entry for the given path.<p>
@param possibleParent the possible parent entry
@param targetPath the target path
@return the parent entry or <code>null</code> if there is none
... | java | private CmsGalleryTreeEntry lookForParent(CmsGalleryTreeEntry possibleParent, String targetPath) {
if (targetPath.startsWith(possibleParent.getPath())) {
return possibleParent;
}
if (possibleParent.getParent() != null) {
return lookForParent(possibleParent.getParent(), t... | [
"private",
"CmsGalleryTreeEntry",
"lookForParent",
"(",
"CmsGalleryTreeEntry",
"possibleParent",
",",
"String",
"targetPath",
")",
"{",
"if",
"(",
"targetPath",
".",
"startsWith",
"(",
"possibleParent",
".",
"getPath",
"(",
")",
")",
")",
"{",
"return",
"possibleP... | Looks for an ancestor tree entry for the given path.<p>
@param possibleParent the possible parent entry
@param targetPath the target path
@return the parent entry or <code>null</code> if there is none | [
"Looks",
"for",
"an",
"ancestor",
"tree",
"entry",
"for",
"the",
"given",
"path",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/CmsGalleryController.java#L1982-L1991 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.insertCuePoint | public InsertCuePointResponse insertCuePoint(InsertCuePointRequest request) {
"""
Insert a cue point into your live session by live session id.
@param request The request object containing all parameters for inserting a cue point into session.
@return the response
"""
checkNotNull(request, "The par... | java | public InsertCuePointResponse insertCuePoint(InsertCuePointRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getSessionId(),
"The parameter sessionId should NOT be null or empty string.");
checkStringNotEmpty(reques... | [
"public",
"InsertCuePointResponse",
"insertCuePoint",
"(",
"InsertCuePointRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getSessionId",
"(",
")",
"... | Insert a cue point into your live session by live session id.
@param request The request object containing all parameters for inserting a cue point into session.
@return the response | [
"Insert",
"a",
"cue",
"point",
"into",
"your",
"live",
"session",
"by",
"live",
"session",
"id",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1104-L1116 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/query/ServiceInstanceQuery.java | ServiceInstanceQuery.getPatternQueryCriterion | public ServiceInstanceQuery getPatternQueryCriterion(String key, String pattern) {
"""
Get a metadata value match regex pattern QueryCriterion.
Add a QueryCriterion to check ServiceInstance has metadata value
match the target regex pattern.
@param key
the metadata key.
@param pattern
the target regex pat... | java | public ServiceInstanceQuery getPatternQueryCriterion(String key, String pattern){
QueryCriterion c = new PatternQueryCriterion(key, pattern);
addQueryCriterion(c);
return this;
} | [
"public",
"ServiceInstanceQuery",
"getPatternQueryCriterion",
"(",
"String",
"key",
",",
"String",
"pattern",
")",
"{",
"QueryCriterion",
"c",
"=",
"new",
"PatternQueryCriterion",
"(",
"key",
",",
"pattern",
")",
";",
"addQueryCriterion",
"(",
"c",
")",
";",
"re... | Get a metadata value match regex pattern QueryCriterion.
Add a QueryCriterion to check ServiceInstance has metadata value
match the target regex pattern.
@param key
the metadata key.
@param pattern
the target regex pattern that metadata should match.
@return
the ServiceInstanceQuery. | [
"Get",
"a",
"metadata",
"value",
"match",
"regex",
"pattern",
"QueryCriterion",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/query/ServiceInstanceQuery.java#L99-L103 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/memory/AbstractPagedInputView.java | AbstractPagedInputView.seekInput | protected void seekInput(MemorySegment segment, int positionInSegment, int limitInSegment) {
"""
Sets the internal state of the view such that the next bytes will be read from the given memory segment,
starting at the given position. The memory segment will provide bytes up to the given limit position.
@param ... | java | protected void seekInput(MemorySegment segment, int positionInSegment, int limitInSegment) {
this.currentSegment = segment;
this.positionInSegment = positionInSegment;
this.limitInSegment = limitInSegment;
} | [
"protected",
"void",
"seekInput",
"(",
"MemorySegment",
"segment",
",",
"int",
"positionInSegment",
",",
"int",
"limitInSegment",
")",
"{",
"this",
".",
"currentSegment",
"=",
"segment",
";",
"this",
".",
"positionInSegment",
"=",
"positionInSegment",
";",
"this",... | Sets the internal state of the view such that the next bytes will be read from the given memory segment,
starting at the given position. The memory segment will provide bytes up to the given limit position.
@param segment The segment to read the next bytes from.
@param positionInSegment The position in the segment to ... | [
"Sets",
"the",
"internal",
"state",
"of",
"the",
"view",
"such",
"that",
"the",
"next",
"bytes",
"will",
"be",
"read",
"from",
"the",
"given",
"memory",
"segment",
"starting",
"at",
"the",
"given",
"position",
".",
"The",
"memory",
"segment",
"will",
"prov... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/memory/AbstractPagedInputView.java#L183-L187 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java | ServiceManagementRecord.findServiceManagementRecord | public static ServiceManagementRecord findServiceManagementRecord(EntityManager em, Service service) {
"""
Returns a record for the specified service.
@param em The entity manager to use. Cannot be null.
@param service The service for which to obtain the record. Cannot be null.
@return The manag... | java | public static ServiceManagementRecord findServiceManagementRecord(EntityManager em, Service service) {
requireArgument(em != null, "Entity manager can not be null.");
requireArgument(service != null, "Service cannot be null.");
TypedQuery<ServiceManagementRecord> query = em.createNamedQuery("Se... | [
"public",
"static",
"ServiceManagementRecord",
"findServiceManagementRecord",
"(",
"EntityManager",
"em",
",",
"Service",
"service",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"Entity manager can not be null.\"",
")",
";",
"requireArgument",
"(",
"serv... | Returns a record for the specified service.
@param em The entity manager to use. Cannot be null.
@param service The service for which to obtain the record. Cannot be null.
@return The management record for the specified service or null if no record exists. | [
"Returns",
"a",
"record",
"for",
"the",
"specified",
"service",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/ServiceManagementRecord.java#L117-L129 |
mgormley/prim | src/main/java/edu/jhu/prim/arrays/Multinomials.java | Multinomials.klDivergence | public static double klDivergence(double[] p, double[] q) {
"""
Gets the KL divergence between two multinomial distributions p and q.
@param p Array representing a multinomial distribution, p.
@param q Array representing a multinomial distribution, q.
@return KL(p || q)
"""
if (p.length != q.lengt... | java | public static double klDivergence(double[] p, double[] q) {
if (p.length != q.length) {
throw new IllegalStateException("The length of p and q must be the same.");
}
double delta = 1e-8;
if (!Multinomials.isMultinomial(p, delta)) {
throw new IllegalStateException(... | [
"public",
"static",
"double",
"klDivergence",
"(",
"double",
"[",
"]",
"p",
",",
"double",
"[",
"]",
"q",
")",
"{",
"if",
"(",
"p",
".",
"length",
"!=",
"q",
".",
"length",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The length of p and q ... | Gets the KL divergence between two multinomial distributions p and q.
@param p Array representing a multinomial distribution, p.
@param q Array representing a multinomial distribution, q.
@return KL(p || q) | [
"Gets",
"the",
"KL",
"divergence",
"between",
"two",
"multinomial",
"distributions",
"p",
"and",
"q",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/arrays/Multinomials.java#L131-L151 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java | WebConfigParamUtils.getInstanceInitParameter | @SuppressWarnings("unchecked")
public static <T> T getInstanceInitParameter(ExternalContext context, String name,
String deprecatedName, T defaultValue) {
"""
Gets the init parameter value from the specified context and instanciate it.
If the parameter was not specified, the default value is used... | java | @SuppressWarnings("unchecked")
public static <T> T getInstanceInitParameter(ExternalContext context, String name,
String deprecatedName, T defaultValue)
{
String param = getStringInitParameter(context, name, deprecatedName);
if (param == null)
{
return defaultVal... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"<",
"T",
">",
"T",
"getInstanceInitParameter",
"(",
"ExternalContext",
"context",
",",
"String",
"name",
",",
"String",
"deprecatedName",
",",
"T",
"defaultValue",
")",
"{",
"String",
"para... | Gets the init parameter value from the specified context and instanciate it.
If the parameter was not specified, the default value is used instead.
@param context
the application's external context
@param name
the init parameter's name
@param deprecatedName
the init parameter's deprecated name.
@param defaultValue
the... | [
"Gets",
"the",
"init",
"parameter",
"value",
"from",
"the",
"specified",
"context",
"and",
"instanciate",
"it",
".",
"If",
"the",
"parameter",
"was",
"not",
"specified",
"the",
"default",
"value",
"is",
"used",
"instead",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java#L687-L707 |
UrielCh/ovh-java-sdk | ovh-java-sdk-supplymondialRelay/src/main/java/net/minidev/ovh/api/ApiOvhSupplymondialRelay.java | ApiOvhSupplymondialRelay.POST | public OvhMondialRelayReturn POST(String address, String city, OvhCountryEnum country, String zipcode) throws IOException {
"""
Find the 10 nearest MondialRelay points from address or city.
REST: POST /supply/mondialRelay
@param city [required] City
@param address [required] Address
@param country [required]... | java | public OvhMondialRelayReturn POST(String address, String city, OvhCountryEnum country, String zipcode) throws IOException {
String qPath = "/supply/mondialRelay";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "address", address);
addBody(o, "city", city);... | [
"public",
"OvhMondialRelayReturn",
"POST",
"(",
"String",
"address",
",",
"String",
"city",
",",
"OvhCountryEnum",
"country",
",",
"String",
"zipcode",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/supply/mondialRelay\"",
";",
"StringBuilder",
"sb",... | Find the 10 nearest MondialRelay points from address or city.
REST: POST /supply/mondialRelay
@param city [required] City
@param address [required] Address
@param country [required] ISO country code
@param zipcode [required] Zip Code | [
"Find",
"the",
"10",
"nearest",
"MondialRelay",
"points",
"from",
"address",
"or",
"city",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-supplymondialRelay/src/main/java/net/minidev/ovh/api/ApiOvhSupplymondialRelay.java#L29-L39 |
gallandarakhneorg/afc | core/maths/mathgen/src/main/java/org/arakhne/afc/math/MathUtil.java | MathUtil.compareEpsilon | @Pure
public static int compareEpsilon(double v1, double v2, double epsilon) {
"""
Compares its two arguments for order.
Returns a negative integer,
zero, or a positive integer as the first argument is less than, equal
to, or greater than the second.
@param v1 first value.
@param v2 second value.
@param e... | java | @Pure
public static int compareEpsilon(double v1, double v2, double epsilon) {
final double v = v1 - v2;
final double eps = Double.isNaN(epsilon) ? Math.ulp(v) : epsilon;
if (Math.abs(v) <= eps) {
return 0;
}
if (v <= 0.) {
return -1;
}
return 1;
} | [
"@",
"Pure",
"public",
"static",
"int",
"compareEpsilon",
"(",
"double",
"v1",
",",
"double",
"v2",
",",
"double",
"epsilon",
")",
"{",
"final",
"double",
"v",
"=",
"v1",
"-",
"v2",
";",
"final",
"double",
"eps",
"=",
"Double",
".",
"isNaN",
"(",
"ep... | Compares its two arguments for order.
Returns a negative integer,
zero, or a positive integer as the first argument is less than, equal
to, or greater than the second.
@param v1 first value.
@param v2 second value.
@param epsilon approximation epsilon. If {@link Double#NaN}, the function {@link Math#ulp(double)} is
us... | [
"Compares",
"its",
"two",
"arguments",
"for",
"order",
".",
"Returns",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"as",
"the",
"first",
"argument",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
"than",
"the",
"second",
".... | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/maths/mathgen/src/main/java/org/arakhne/afc/math/MathUtil.java#L214-L225 |
betfair/cougar | cougar-framework/cougar-client/src/main/java/com/betfair/cougar/client/socket/IoSessionFactory.java | IoSessionFactory.closeSession | public void closeSession(SocketAddress endpoint, boolean reconnect) {
"""
If there is an active session to the specified endpoint, it will be closed
If not the reconnection task for the endpoint will be stopped
@param endpoint
@param reconnect whether to reconnect after closing the current session.
Only used... | java | public void closeSession(SocketAddress endpoint, boolean reconnect) {
synchronized (lock) {
// Submit a reconnect task for this address if one is not already present
if (pendingConnections.containsKey(endpoint)) {
final ReconnectTask task = pendingConnections.get(endpoint... | [
"public",
"void",
"closeSession",
"(",
"SocketAddress",
"endpoint",
",",
"boolean",
"reconnect",
")",
"{",
"synchronized",
"(",
"lock",
")",
"{",
"// Submit a reconnect task for this address if one is not already present",
"if",
"(",
"pendingConnections",
".",
"containsKey"... | If there is an active session to the specified endpoint, it will be closed
If not the reconnection task for the endpoint will be stopped
@param endpoint
@param reconnect whether to reconnect after closing the current session.
Only used if the session is active | [
"If",
"there",
"is",
"an",
"active",
"session",
"to",
"the",
"specified",
"endpoint",
"it",
"will",
"be",
"closed",
"If",
"not",
"the",
"reconnection",
"task",
"for",
"the",
"endpoint",
"will",
"be",
"stopped"
] | train | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/cougar-client/src/main/java/com/betfair/cougar/client/socket/IoSessionFactory.java#L202-L217 |
alkacon/opencms-core | src/org/opencms/module/CmsModuleManager.java | CmsModuleManager.checkModuleSelectionList | public void checkModuleSelectionList(List<String> moduleNames, String rfsAbsPath, boolean forDeletion)
throws CmsIllegalArgumentException, CmsConfigurationException {
"""
Checks the module selection list for consistency, that means
that if a module is selected, all its dependencies are also selected.<p>
Th... | java | public void checkModuleSelectionList(List<String> moduleNames, String rfsAbsPath, boolean forDeletion)
throws CmsIllegalArgumentException, CmsConfigurationException {
Map<String, List<String>> moduleDependencies = buildDepsForAllModules(rfsAbsPath, forDeletion);
Iterator<String> itMods = moduleName... | [
"public",
"void",
"checkModuleSelectionList",
"(",
"List",
"<",
"String",
">",
"moduleNames",
",",
"String",
"rfsAbsPath",
",",
"boolean",
"forDeletion",
")",
"throws",
"CmsIllegalArgumentException",
",",
"CmsConfigurationException",
"{",
"Map",
"<",
"String",
",",
... | Checks the module selection list for consistency, that means
that if a module is selected, all its dependencies are also selected.<p>
The module dependencies are get from the installed modules or
from the module manifest.xml files found in the given FRS path.<p>
@param moduleNames a list of module names
@param rfsAbs... | [
"Checks",
"the",
"module",
"selection",
"list",
"for",
"consistency",
"that",
"means",
"that",
"if",
"a",
"module",
"is",
"selected",
"all",
"its",
"dependencies",
"are",
"also",
"selected",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/module/CmsModuleManager.java#L450-L470 |
Kickflip/kickflip-android-sdk | sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java | KickflipApiClient.getStreamsByLocation | public void getStreamsByLocation(Location location, int radius, int pageNumber, int itemsPerPage, final KickflipCallback cb) {
"""
Get a List of {@link io.kickflip.sdk.api.json.Stream}s near a geographic location.
<p/>
This method searches all public recordings made by Users of your Kickflip app.
@param locat... | java | public void getStreamsByLocation(Location location, int radius, int pageNumber, int itemsPerPage, final KickflipCallback cb) {
if (!assertActiveUserAvailable(cb)) return;
GenericData data = new GenericData();
data.put("uuid", getActiveUser().getUUID());
data.put("lat", location.getLatitu... | [
"public",
"void",
"getStreamsByLocation",
"(",
"Location",
"location",
",",
"int",
"radius",
",",
"int",
"pageNumber",
",",
"int",
"itemsPerPage",
",",
"final",
"KickflipCallback",
"cb",
")",
"{",
"if",
"(",
"!",
"assertActiveUserAvailable",
"(",
"cb",
")",
")... | Get a List of {@link io.kickflip.sdk.api.json.Stream}s near a geographic location.
<p/>
This method searches all public recordings made by Users of your Kickflip app.
@param location The target Location
@param radius The target Radius in meters
@param cb A callback to receive the resulting List of Streams | [
"Get",
"a",
"List",
"of",
"{",
"@link",
"io",
".",
"kickflip",
".",
"sdk",
".",
"api",
".",
"json",
".",
"Stream",
"}",
"s",
"near",
"a",
"geographic",
"location",
".",
"<p",
"/",
">",
"This",
"method",
"searches",
"all",
"public",
"recordings",
"mad... | train | https://github.com/Kickflip/kickflip-android-sdk/blob/af3aae5f1128d7376e67aefe11a3a1a3844be734/sdk/src/main/java/io/kickflip/sdk/api/KickflipApiClient.java#L526-L536 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java | TypeExtractionUtils.getTypeHierarchy | public static Type getTypeHierarchy(List<Type> typeHierarchy, Type t, Class<?> stopAtClass) {
"""
Traverses the type hierarchy of a type up until a certain stop class is found.
@param t type for which a hierarchy need to be created
@return type of the immediate child of the stop class
"""
while (!(isClas... | java | public static Type getTypeHierarchy(List<Type> typeHierarchy, Type t, Class<?> stopAtClass) {
while (!(isClassType(t) && typeToClass(t).equals(stopAtClass))) {
typeHierarchy.add(t);
t = typeToClass(t).getGenericSuperclass();
if (t == null) {
break;
}
}
return t;
} | [
"public",
"static",
"Type",
"getTypeHierarchy",
"(",
"List",
"<",
"Type",
">",
"typeHierarchy",
",",
"Type",
"t",
",",
"Class",
"<",
"?",
">",
"stopAtClass",
")",
"{",
"while",
"(",
"!",
"(",
"isClassType",
"(",
"t",
")",
"&&",
"typeToClass",
"(",
"t",... | Traverses the type hierarchy of a type up until a certain stop class is found.
@param t type for which a hierarchy need to be created
@return type of the immediate child of the stop class | [
"Traverses",
"the",
"type",
"hierarchy",
"of",
"a",
"type",
"up",
"until",
"a",
"certain",
"stop",
"class",
"is",
"found",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/TypeExtractionUtils.java#L293-L303 |
togglz/togglz | core/src/main/java/org/togglz/core/activation/AbstractPropertyDrivenActivationStrategy.java | AbstractPropertyDrivenActivationStrategy.isActive | protected boolean isActive(FeatureState featureState, FeatureUser user, String propertyName, String propertyValue) {
"""
<p>
This method is called by {@link #isActive(FeatureState, FeatureUser)} with the property name and value to make
the decision as to whether the feature is active.
</p>
<p>
By default, thi... | java | protected boolean isActive(FeatureState featureState, FeatureUser user, String propertyName, String propertyValue) {
String expectedValue = featureState.getParameter(PARAM_PROPERTY_VALUE);
if(expectedValue == null) {
expectedValue = DEFAULT_STATE_VALUE;
}
return Strings.isNot... | [
"protected",
"boolean",
"isActive",
"(",
"FeatureState",
"featureState",
",",
"FeatureUser",
"user",
",",
"String",
"propertyName",
",",
"String",
"propertyValue",
")",
"{",
"String",
"expectedValue",
"=",
"featureState",
".",
"getParameter",
"(",
"PARAM_PROPERTY_VALU... | <p>
This method is called by {@link #isActive(FeatureState, FeatureUser)} with the property name and value to make
the decision as to whether the feature is active.
</p>
<p>
By default, this method will convert {@code propertyValue} into a boolean using
{@link Strings#toBoolean(String)} but implementations are free to ... | [
"<p",
">",
"This",
"method",
"is",
"called",
"by",
"{",
"@link",
"#isActive",
"(",
"FeatureState",
"FeatureUser",
")",
"}",
"with",
"the",
"property",
"name",
"and",
"value",
"to",
"make",
"the",
"decision",
"as",
"to",
"whether",
"the",
"feature",
"is",
... | train | https://github.com/togglz/togglz/blob/76d3ffbc8e3fac5a6cb566cc4afbd8dd5f06c4e5/core/src/main/java/org/togglz/core/activation/AbstractPropertyDrivenActivationStrategy.java#L129-L135 |
konmik/satellite | valuemap/src/main/java/valuemap/ValueMap.java | ValueMap.get | public <T> T get(String key, T defaultValue) {
"""
Returns the value of the mapping with the specified key, or the given default value.
"""
if (map.containsKey(key)) {
Object value = map.get(key);
return (T)(value instanceof byte[] ? unmarshall((byte[])value) : value);
}... | java | public <T> T get(String key, T defaultValue) {
if (map.containsKey(key)) {
Object value = map.get(key);
return (T)(value instanceof byte[] ? unmarshall((byte[])value) : value);
}
return defaultValue;
} | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"key",
",",
"T",
"defaultValue",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"Object",
"value",
"=",
"map",
".",
"get",
"(",
"key",
")",
";",
"return",
"(",
"T",... | Returns the value of the mapping with the specified key, or the given default value. | [
"Returns",
"the",
"value",
"of",
"the",
"mapping",
"with",
"the",
"specified",
"key",
"or",
"the",
"given",
"default",
"value",
"."
] | train | https://github.com/konmik/satellite/blob/7b0d3194bf84b3db4c233a131890a23e2d5825b9/valuemap/src/main/java/valuemap/ValueMap.java#L91-L97 |
wildfly/wildfly-core | patching/src/main/java/org/jboss/as/patching/IoUtils.java | IoUtils.copyStream | public static void copyStream(InputStream is, OutputStream os) throws IOException {
"""
Copy input stream to output stream without closing streams. Flushes output stream when done.
@param is input stream
@param os output stream
@throws IOException for any error
"""
copyStream(is, os, DEFAULT_BUF... | java | public static void copyStream(InputStream is, OutputStream os) throws IOException {
copyStream(is, os, DEFAULT_BUFFER_SIZE);
} | [
"public",
"static",
"void",
"copyStream",
"(",
"InputStream",
"is",
",",
"OutputStream",
"os",
")",
"throws",
"IOException",
"{",
"copyStream",
"(",
"is",
",",
"os",
",",
"DEFAULT_BUFFER_SIZE",
")",
";",
"}"
] | Copy input stream to output stream without closing streams. Flushes output stream when done.
@param is input stream
@param os output stream
@throws IOException for any error | [
"Copy",
"input",
"stream",
"to",
"output",
"stream",
"without",
"closing",
"streams",
".",
"Flushes",
"output",
"stream",
"when",
"done",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/patching/src/main/java/org/jboss/as/patching/IoUtils.java#L80-L82 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WAjaxControlRenderer.java | WAjaxControlRenderer.doRender | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
"""
Paints the given AjaxControl.
@param component the AjaxControl to paint
@param renderContext the RenderContext to paint to
"""
WAjaxControl ajaxControl = (WAjaxControl) component;
XmlStringBuilder... | java | @Override
public void doRender(final WComponent component, final WebXmlRenderContext renderContext) {
WAjaxControl ajaxControl = (WAjaxControl) component;
XmlStringBuilder xml = renderContext.getWriter();
WComponent trigger = ajaxControl.getTrigger() == null ? ajaxControl : ajaxControl.
getTrigger();
int d... | [
"@",
"Override",
"public",
"void",
"doRender",
"(",
"final",
"WComponent",
"component",
",",
"final",
"WebXmlRenderContext",
"renderContext",
")",
"{",
"WAjaxControl",
"ajaxControl",
"=",
"(",
"WAjaxControl",
")",
"component",
";",
"XmlStringBuilder",
"xml",
"=",
... | Paints the given AjaxControl.
@param component the AjaxControl to paint
@param renderContext the RenderContext to paint to | [
"Paints",
"the",
"given",
"AjaxControl",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/render/webxml/WAjaxControlRenderer.java#L24-L52 |
jdillon/gshell | gshell-launcher/src/main/java/com/planet57/gshell/launcher/Configuration.java | Configuration.getProperty | @Nullable
private String getProperty(final String name) {
"""
Get the value of a property, checking system properties, then configuration properties and evaluating the result.
"""
assert name != null;
ensureConfigured();
return evaluate(System.getProperty(name, props.getProperty(name)));
} | java | @Nullable
private String getProperty(final String name) {
assert name != null;
ensureConfigured();
return evaluate(System.getProperty(name, props.getProperty(name)));
} | [
"@",
"Nullable",
"private",
"String",
"getProperty",
"(",
"final",
"String",
"name",
")",
"{",
"assert",
"name",
"!=",
"null",
";",
"ensureConfigured",
"(",
")",
";",
"return",
"evaluate",
"(",
"System",
".",
"getProperty",
"(",
"name",
",",
"props",
".",
... | Get the value of a property, checking system properties, then configuration properties and evaluating the result. | [
"Get",
"the",
"value",
"of",
"a",
"property",
"checking",
"system",
"properties",
"then",
"configuration",
"properties",
"and",
"evaluating",
"the",
"result",
"."
] | train | https://github.com/jdillon/gshell/blob/b587c1a4672d2e4905871462fa3b38a1f7b94e90/gshell-launcher/src/main/java/com/planet57/gshell/launcher/Configuration.java#L141-L146 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.installationTemplate_templateName_partitionScheme_schemeName_PUT | public void installationTemplate_templateName_partitionScheme_schemeName_PUT(String templateName, String schemeName, OvhTemplatePartitioningSchemes body) throws IOException {
"""
Alter this object properties
REST: PUT /me/installationTemplate/{templateName}/partitionScheme/{schemeName}
@param body [required] N... | java | public void installationTemplate_templateName_partitionScheme_schemeName_PUT(String templateName, String schemeName, OvhTemplatePartitioningSchemes body) throws IOException {
String qPath = "/me/installationTemplate/{templateName}/partitionScheme/{schemeName}";
StringBuilder sb = path(qPath, templateName, schemeNam... | [
"public",
"void",
"installationTemplate_templateName_partitionScheme_schemeName_PUT",
"(",
"String",
"templateName",
",",
"String",
"schemeName",
",",
"OvhTemplatePartitioningSchemes",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/installationTemplat... | Alter this object properties
REST: PUT /me/installationTemplate/{templateName}/partitionScheme/{schemeName}
@param body [required] New object properties
@param templateName [required] This template name
@param schemeName [required] name of this partitioning scheme | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L3602-L3606 |
infinispan/infinispan | core/src/main/java/org/infinispan/io/GridFilesystem.java | GridFilesystem.getOutput | public OutputStream getOutput(String pathname, boolean append) throws IOException {
"""
Opens an OutputStream for writing to the file denoted by pathname. The OutputStream can either overwrite the
existing file or append to it.
@param pathname the path to write to
@param append if true, the bytes written to the... | java | public OutputStream getOutput(String pathname, boolean append) throws IOException {
return getOutput(pathname, append, defaultChunkSize);
} | [
"public",
"OutputStream",
"getOutput",
"(",
"String",
"pathname",
",",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"return",
"getOutput",
"(",
"pathname",
",",
"append",
",",
"defaultChunkSize",
")",
";",
"}"
] | Opens an OutputStream for writing to the file denoted by pathname. The OutputStream can either overwrite the
existing file or append to it.
@param pathname the path to write to
@param append if true, the bytes written to the OutputStream will be appended to the end of the file. If false,
the bytes will overwrite the or... | [
"Opens",
"an",
"OutputStream",
"for",
"writing",
"to",
"the",
"file",
"denoted",
"by",
"pathname",
".",
"The",
"OutputStream",
"can",
"either",
"overwrite",
"the",
"existing",
"file",
"or",
"append",
"to",
"it",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/io/GridFilesystem.java#L106-L108 |
yanzhenjie/Album | album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java | AlbumUtils.getColorStateList | public static ColorStateList getColorStateList(@ColorInt int normal, @ColorInt int highLight) {
"""
{@link ColorStateList}.
@param normal normal color.
@param highLight highLight color.
@return {@link ColorStateList}.
"""
int[][] states = new int[6][];
states[0] = new int[]{android.R.at... | java | public static ColorStateList getColorStateList(@ColorInt int normal, @ColorInt int highLight) {
int[][] states = new int[6][];
states[0] = new int[]{android.R.attr.state_checked};
states[1] = new int[]{android.R.attr.state_pressed};
states[2] = new int[]{android.R.attr.state_selected};
... | [
"public",
"static",
"ColorStateList",
"getColorStateList",
"(",
"@",
"ColorInt",
"int",
"normal",
",",
"@",
"ColorInt",
"int",
"highLight",
")",
"{",
"int",
"[",
"]",
"[",
"]",
"states",
"=",
"new",
"int",
"[",
"6",
"]",
"[",
"",
"]",
";",
"states",
... | {@link ColorStateList}.
@param normal normal color.
@param highLight highLight color.
@return {@link ColorStateList}. | [
"{",
"@link",
"ColorStateList",
"}",
"."
] | train | https://github.com/yanzhenjie/Album/blob/b17506440d32909d42aba41f6a388041a25c8363/album/src/main/java/com/yanzhenjie/album/util/AlbumUtils.java#L330-L340 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java | TransformerImpl.setParameters | public void setParameters(Properties params) {
"""
Set a bag of parameters for the transformation. Note that
these will not be additive, they will replace the existing
set of parameters.
NEEDSDOC @param params
"""
clearParameters();
Enumeration names = params.propertyNames();
while (names.h... | java | public void setParameters(Properties params)
{
clearParameters();
Enumeration names = params.propertyNames();
while (names.hasMoreElements())
{
String name = params.getProperty((String) names.nextElement());
StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);
try
... | [
"public",
"void",
"setParameters",
"(",
"Properties",
"params",
")",
"{",
"clearParameters",
"(",
")",
";",
"Enumeration",
"names",
"=",
"params",
".",
"propertyNames",
"(",
")",
";",
"while",
"(",
"names",
".",
"hasMoreElements",
"(",
")",
")",
"{",
"Stri... | Set a bag of parameters for the transformation. Note that
these will not be additive, they will replace the existing
set of parameters.
NEEDSDOC @param params | [
"Set",
"a",
"bag",
"of",
"parameters",
"for",
"the",
"transformation",
".",
"Note",
"that",
"these",
"will",
"not",
"be",
"additive",
"they",
"will",
"replace",
"the",
"existing",
"set",
"of",
"parameters",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/transformer/TransformerImpl.java#L1572-L1603 |
simonpercic/CollectionHelper | collectionhelper/src/main/java/com/github/simonpercic/collectionhelper/CollectionHelper.java | CollectionHelper.count | public static <T> int count(Collection<T> items, Predicate<T> predicate) {
"""
Returns the number of elements in a collection matching the given predicate.
@param items source items
@param predicate predicate function
@param <T> type of elements in the source collection
@return the number of elements in a co... | java | public static <T> int count(Collection<T> items, Predicate<T> predicate) {
int count = 0;
if (!isEmpty(items)) {
for (T element : items) {
if (predicate.apply(element)) {
count++;
}
}
}
return count;
} | [
"public",
"static",
"<",
"T",
">",
"int",
"count",
"(",
"Collection",
"<",
"T",
">",
"items",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"int",
"count",
"=",
"0",
";",
"if",
"(",
"!",
"isEmpty",
"(",
"items",
")",
")",
"{",
"for",
... | Returns the number of elements in a collection matching the given predicate.
@param items source items
@param predicate predicate function
@param <T> type of elements in the source collection
@return the number of elements in a collection matching the given predicate | [
"Returns",
"the",
"number",
"of",
"elements",
"in",
"a",
"collection",
"matching",
"the",
"given",
"predicate",
"."
] | train | https://github.com/simonpercic/CollectionHelper/blob/2425390ac14f3b6c0a7b04464cf5670060f2dc54/collectionhelper/src/main/java/com/github/simonpercic/collectionhelper/CollectionHelper.java#L263-L275 |
JosePaumard/streams-utils | src/main/java/org/paumard/streams/StreamsUtils.java | StreamsUtils.shiftingWindowAveragingDouble | public static DoubleStream shiftingWindowAveragingDouble(DoubleStream doubleStream, int rollingFactor) {
"""
<p>Generates a stream that is computed from a provided double stream by first rolling it in the same
way as the <code>roll()</code> method does. The average is then computed on each substream, to
form the... | java | public static DoubleStream shiftingWindowAveragingDouble(DoubleStream doubleStream, int rollingFactor) {
Objects.requireNonNull(doubleStream);
RollingOfDoubleSpliterator ofDoubleSpliterator = RollingOfDoubleSpliterator.of(doubleStream.spliterator(), rollingFactor);
return StreamSupport.stream(o... | [
"public",
"static",
"DoubleStream",
"shiftingWindowAveragingDouble",
"(",
"DoubleStream",
"doubleStream",
",",
"int",
"rollingFactor",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"doubleStream",
")",
";",
"RollingOfDoubleSpliterator",
"ofDoubleSpliterator",
"=",
"Rol... | <p>Generates a stream that is computed from a provided double stream by first rolling it in the same
way as the <code>roll()</code> method does. The average is then computed on each substream, to
form the final double stream. No boxing / unboxing is conducted in the process.
<p>The resulting stream has the same number ... | [
"<p",
">",
"Generates",
"a",
"stream",
"that",
"is",
"computed",
"from",
"a",
"provided",
"double",
"stream",
"by",
"first",
"rolling",
"it",
"in",
"the",
"same",
"way",
"as",
"the",
"<code",
">",
"roll",
"()",
"<",
"/",
"code",
">",
"method",
"does",
... | train | https://github.com/JosePaumard/streams-utils/blob/56152574af0aca44c5f679761202a8f90984ab73/src/main/java/org/paumard/streams/StreamsUtils.java#L672-L679 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java | DateTimeFormatter.parseResolved0 | private TemporalAccessor parseResolved0(final CharSequence text, final ParsePosition position) {
"""
Parses and resolves the specified text.
<p>
This parses to a {@code TemporalAccessor} ensuring that the text is fully parsed.
@param text the text to parse, not null
@param position the position to parse fr... | java | private TemporalAccessor parseResolved0(final CharSequence text, final ParsePosition position) {
ParsePosition pos = (position != null ? position : new ParsePosition(0));
DateTimeParseContext context = parseUnresolved0(text, pos);
if (context == null || pos.getErrorIndex() >= 0 || (position == n... | [
"private",
"TemporalAccessor",
"parseResolved0",
"(",
"final",
"CharSequence",
"text",
",",
"final",
"ParsePosition",
"position",
")",
"{",
"ParsePosition",
"pos",
"=",
"(",
"position",
"!=",
"null",
"?",
"position",
":",
"new",
"ParsePosition",
"(",
"0",
")",
... | Parses and resolves the specified text.
<p>
This parses to a {@code TemporalAccessor} ensuring that the text is fully parsed.
@param text the text to parse, not null
@param position the position to parse from, updated with length parsed
and the index of any error, null if parsing whole string
@return the resolved re... | [
"Parses",
"and",
"resolves",
"the",
"specified",
"text",
".",
"<p",
">",
"This",
"parses",
"to",
"a",
"{",
"@code",
"TemporalAccessor",
"}",
"ensuring",
"that",
"the",
"text",
"is",
"fully",
"parsed",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/format/DateTimeFormatter.java#L1937-L1956 |
aol/cyclops | cyclops-futurestream/src/main/java/com/oath/cyclops/internal/react/stream/traits/future/operators/LazyFutureStreamUtils.java | LazyFutureStreamUtils.forEachX | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachX(
final FutureStream<T> stream, final long x, final Consumer<? super T> consumerElement) {
"""
Perform a forEach operation over the Stream, without closing it, consuming only the... | java | public static <T, X extends Throwable> Tuple3<CompletableFuture<Subscription>, Runnable, CompletableFuture<Boolean>> forEachX(
final FutureStream<T> stream, final long x, final Consumer<? super T> consumerElement) {
final CompletableFuture<Subscription> subscription = new CompletableFuture<>();
... | [
"public",
"static",
"<",
"T",
",",
"X",
"extends",
"Throwable",
">",
"Tuple3",
"<",
"CompletableFuture",
"<",
"Subscription",
">",
",",
"Runnable",
",",
"CompletableFuture",
"<",
"Boolean",
">",
">",
"forEachX",
"(",
"final",
"FutureStream",
"<",
"T",
">",
... | Perform a forEach operation over the Stream, without closing it, consuming only the specified number of elements from
the Stream, at this time. More elements can be consumed later, by called request on the returned Subscription
<pre>
@{code
Subscription next = StreamUtils.forEach(Stream.of(1,2,3,4),2,System.out::print... | [
"Perform",
"a",
"forEach",
"operation",
"over",
"the",
"Stream",
"without",
"closing",
"it",
"consuming",
"only",
"the",
"specified",
"number",
"of",
"elements",
"from",
"the",
"Stream",
"at",
"this",
"time",
".",
"More",
"elements",
"can",
"be",
"consumed",
... | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/com/oath/cyclops/internal/react/stream/traits/future/operators/LazyFutureStreamUtils.java#L45-L79 |
kuali/ojb-1.0.4 | src/xdoclet/java/src/xdoclet/modules/ojb/constraints/InheritanceHelper.java | InheritanceHelper.isSameOrSubTypeOf | public boolean isSameOrSubTypeOf(ClassDescriptorDef type, String baseType, boolean checkActualClasses) throws ClassNotFoundException {
"""
Determines whether the given type is the same or a sub type of the other type.
@param type The type
@param baseType The possible base type
@param c... | java | public boolean isSameOrSubTypeOf(ClassDescriptorDef type, String baseType, boolean checkActualClasses) throws ClassNotFoundException
{
if (type.getQualifiedName().equals(baseType.replace('$', '.')))
{
return true;
}
else if (type.getOriginalClass() != null)
... | [
"public",
"boolean",
"isSameOrSubTypeOf",
"(",
"ClassDescriptorDef",
"type",
",",
"String",
"baseType",
",",
"boolean",
"checkActualClasses",
")",
"throws",
"ClassNotFoundException",
"{",
"if",
"(",
"type",
".",
"getQualifiedName",
"(",
")",
".",
"equals",
"(",
"b... | Determines whether the given type is the same or a sub type of the other type.
@param type The type
@param baseType The possible base type
@param checkActualClasses Whether to use the actual classes for the test
@return <code>true</code> If <code>type</code> specifies the same or a sub type of ... | [
"Determines",
"whether",
"the",
"given",
"type",
"is",
"the",
"same",
"or",
"a",
"sub",
"type",
"of",
"the",
"other",
"type",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/xdoclet/java/src/xdoclet/modules/ojb/constraints/InheritanceHelper.java#L110-L124 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/markup/AnnotatedTextBuilder.java | AnnotatedTextBuilder.build | public AnnotatedText build() {
"""
Create the annotated text to be passed into {@link org.languagetool.JLanguageTool#check(AnnotatedText)}.
"""
int plainTextPosition = 0;
int totalPosition = 0;
Map<Integer,Integer> mapping = new HashMap<>();
mapping.put(0, 0);
for (TextPart part : parts) {
... | java | public AnnotatedText build() {
int plainTextPosition = 0;
int totalPosition = 0;
Map<Integer,Integer> mapping = new HashMap<>();
mapping.put(0, 0);
for (TextPart part : parts) {
if (part.getType() == TextPart.Type.TEXT) {
plainTextPosition += part.getPart().length();
totalPosit... | [
"public",
"AnnotatedText",
"build",
"(",
")",
"{",
"int",
"plainTextPosition",
"=",
"0",
";",
"int",
"totalPosition",
"=",
"0",
";",
"Map",
"<",
"Integer",
",",
"Integer",
">",
"mapping",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"mapping",
".",
"put... | Create the annotated text to be passed into {@link org.languagetool.JLanguageTool#check(AnnotatedText)}. | [
"Create",
"the",
"annotated",
"text",
"to",
"be",
"passed",
"into",
"{"
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/markup/AnnotatedTextBuilder.java#L113-L130 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FunctionMultiArgs.java | FunctionMultiArgs.setArg | public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException {
"""
Set an argument expression for a function. This method is called by the
XPath compiler.
@param arg non-null expression that represents the argument.
@param argNum The argument number index.
@throws WrongNumberAr... | java | public void setArg(Expression arg, int argNum)
throws WrongNumberArgsException
{
if (argNum < 3)
super.setArg(arg, argNum);
else
{
if (null == m_args)
{
m_args = new Expression[1];
m_args[0] = arg;
}
else
{
// Slow but space conservat... | [
"public",
"void",
"setArg",
"(",
"Expression",
"arg",
",",
"int",
"argNum",
")",
"throws",
"WrongNumberArgsException",
"{",
"if",
"(",
"argNum",
"<",
"3",
")",
"super",
".",
"setArg",
"(",
"arg",
",",
"argNum",
")",
";",
"else",
"{",
"if",
"(",
"null",... | Set an argument expression for a function. This method is called by the
XPath compiler.
@param arg non-null expression that represents the argument.
@param argNum The argument number index.
@throws WrongNumberArgsException If a derived class determines that the
number of arguments is incorrect. | [
"Set",
"an",
"argument",
"expression",
"for",
"a",
"function",
".",
"This",
"method",
"is",
"called",
"by",
"the",
"XPath",
"compiler",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/functions/FunctionMultiArgs.java#L62-L88 |
alibaba/canal | server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java | CanalServerWithEmbedded.rollback | @Override
public void rollback(ClientIdentity clientIdentity, Long batchId) throws CanalServerException {
"""
回滚到未进行 {@link #ack} 的地方,下次fetch的时候,可以从最后一个没有 {@link #ack} 的地方开始拿
"""
checkStart(clientIdentity.getDestination());
CanalInstance canalInstance = canalInstances.get(clientIdentity.get... | java | @Override
public void rollback(ClientIdentity clientIdentity, Long batchId) throws CanalServerException {
checkStart(clientIdentity.getDestination());
CanalInstance canalInstance = canalInstances.get(clientIdentity.getDestination());
// 因为存在第一次链接时自动rollback的情况,所以需要忽略未订阅
boolean hasS... | [
"@",
"Override",
"public",
"void",
"rollback",
"(",
"ClientIdentity",
"clientIdentity",
",",
"Long",
"batchId",
")",
"throws",
"CanalServerException",
"{",
"checkStart",
"(",
"clientIdentity",
".",
"getDestination",
"(",
")",
")",
";",
"CanalInstance",
"canalInstanc... | 回滚到未进行 {@link #ack} 的地方,下次fetch的时候,可以从最后一个没有 {@link #ack} 的地方开始拿 | [
"回滚到未进行",
"{"
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/server/src/main/java/com/alibaba/otter/canal/server/embedded/CanalServerWithEmbedded.java#L464-L494 |
actframework/actframework | src/main/java/act/data/MultipartStream.java | MultipartStream.readBoundary | public boolean readBoundary()
throws MalformedStreamException {
"""
Skips a <code>boundary</code> token, and checks whether more
<code>encapsulations</code> are contained in the stream.
@return <code>true</code> if there are more encapsulations in
this stream; <code>false</code> otherwise.
@thr... | java | public boolean readBoundary()
throws MalformedStreamException {
byte[] marker = new byte[2];
boolean nextChunk = false;
head += boundaryLength;
try {
marker[0] = readByte();
if (marker[0] == LF) {
// Work around IE5 Mac bug with input ... | [
"public",
"boolean",
"readBoundary",
"(",
")",
"throws",
"MalformedStreamException",
"{",
"byte",
"[",
"]",
"marker",
"=",
"new",
"byte",
"[",
"2",
"]",
";",
"boolean",
"nextChunk",
"=",
"false",
";",
"head",
"+=",
"boundaryLength",
";",
"try",
"{",
"marke... | Skips a <code>boundary</code> token, and checks whether more
<code>encapsulations</code> are contained in the stream.
@return <code>true</code> if there are more encapsulations in
this stream; <code>false</code> otherwise.
@throws MalformedStreamException if the stream ends unexpecetedly or
fails to follow required s... | [
"Skips",
"a",
"<code",
">",
"boundary<",
"/",
"code",
">",
"token",
"and",
"checks",
"whether",
"more",
"<code",
">",
"encapsulations<",
"/",
"code",
">",
"are",
"contained",
"in",
"the",
"stream",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/data/MultipartStream.java#L411-L442 |
powermock/powermock | powermock-core/src/main/java/org/powermock/core/MockRepository.java | MockRepository.putMethodProxy | public static synchronized InvocationHandler putMethodProxy(Method method, InvocationHandler invocationHandler) {
"""
Set a proxy for a method. Whenever this method is called the invocation
handler will be invoked instead.
@return The method proxy if any.
"""
return methodProxies.put(method, invocationHa... | java | public static synchronized InvocationHandler putMethodProxy(Method method, InvocationHandler invocationHandler) {
return methodProxies.put(method, invocationHandler);
} | [
"public",
"static",
"synchronized",
"InvocationHandler",
"putMethodProxy",
"(",
"Method",
"method",
",",
"InvocationHandler",
"invocationHandler",
")",
"{",
"return",
"methodProxies",
".",
"put",
"(",
"method",
",",
"invocationHandler",
")",
";",
"}"
] | Set a proxy for a method. Whenever this method is called the invocation
handler will be invoked instead.
@return The method proxy if any. | [
"Set",
"a",
"proxy",
"for",
"a",
"method",
".",
"Whenever",
"this",
"method",
"is",
"called",
"the",
"invocation",
"handler",
"will",
"be",
"invoked",
"instead",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-core/src/main/java/org/powermock/core/MockRepository.java#L381-L383 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java | SARLQuickfixProvider.fixDisallowedFieldName | @Fix(org.eclipse.xtext.xbase.validation.IssueCodes.VARIABLE_NAME_DISALLOWED)
public void fixDisallowedFieldName(final Issue issue, IssueResolutionAcceptor acceptor) {
"""
Quick fix for "disallowed variable name".
@param issue the issue.
@param acceptor the quick fix acceptor.
"""
MemberRenameModificatio... | java | @Fix(org.eclipse.xtext.xbase.validation.IssueCodes.VARIABLE_NAME_DISALLOWED)
public void fixDisallowedFieldName(final Issue issue, IssueResolutionAcceptor acceptor) {
MemberRenameModification.accept(this, issue, acceptor);
MemberRemoveModification.accept(this, issue, acceptor);
} | [
"@",
"Fix",
"(",
"org",
".",
"eclipse",
".",
"xtext",
".",
"xbase",
".",
"validation",
".",
"IssueCodes",
".",
"VARIABLE_NAME_DISALLOWED",
")",
"public",
"void",
"fixDisallowedFieldName",
"(",
"final",
"Issue",
"issue",
",",
"IssueResolutionAcceptor",
"acceptor",
... | Quick fix for "disallowed variable name".
@param issue the issue.
@param acceptor the quick fix acceptor. | [
"Quick",
"fix",
"for",
"disallowed",
"variable",
"name",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/quickfix/SARLQuickfixProvider.java#L697-L701 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java | Levenshtein.NGram | public static <T extends Levenshtein> T NGram(String baseTarget, String compareTarget) {
"""
Returns an new n-Gram distance (Kondrak) instance with compare target string
@see NGram
@param baseTarget
@param compareTarget
@return
"""
return NGram(baseTarget, compareTarget, null);
} | java | public static <T extends Levenshtein> T NGram(String baseTarget, String compareTarget) {
return NGram(baseTarget, compareTarget, null);
} | [
"public",
"static",
"<",
"T",
"extends",
"Levenshtein",
">",
"T",
"NGram",
"(",
"String",
"baseTarget",
",",
"String",
"compareTarget",
")",
"{",
"return",
"NGram",
"(",
"baseTarget",
",",
"compareTarget",
",",
"null",
")",
";",
"}"
] | Returns an new n-Gram distance (Kondrak) instance with compare target string
@see NGram
@param baseTarget
@param compareTarget
@return | [
"Returns",
"an",
"new",
"n",
"-",
"Gram",
"distance",
"(",
"Kondrak",
")",
"instance",
"with",
"compare",
"target",
"string"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/Levenshtein.java#L221-L223 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/Messages.java | Messages.getFormattedMessageFromLocalizedMessage | public static String getFormattedMessageFromLocalizedMessage(String traceString, Object[] newParms, boolean b) {
"""
Retrieve a string from the bundle and format it using the parameters
@param traceString
localized string to be formatted
@param newParms
parameters to populate positional parameters in localiz... | java | public static String getFormattedMessageFromLocalizedMessage(String traceString, Object[] newParms, boolean b) {
String retVal = "";
try {
retVal = MessageFormat.format(traceString, newParms);
if (null == retVal && b) {
retVal = traceString;
// System.out.println("Using default key");
}
} catch (... | [
"public",
"static",
"String",
"getFormattedMessageFromLocalizedMessage",
"(",
"String",
"traceString",
",",
"Object",
"[",
"]",
"newParms",
",",
"boolean",
"b",
")",
"{",
"String",
"retVal",
"=",
"\"\"",
";",
"try",
"{",
"retVal",
"=",
"MessageFormat",
".",
"f... | Retrieve a string from the bundle and format it using the parameters
@param traceString
localized string to be formatted
@param newParms
parameters to populate positional parameters in localized
message
@param b
whether to return the initial string if formatting fails
@return formatted and localized message | [
"Retrieve",
"a",
"string",
"from",
"the",
"bundle",
"and",
"format",
"it",
"using",
"the",
"parameters"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/ejs/ras/hpel/Messages.java#L96-L114 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntry.java | MapEntry.isInitialized | private static <V> boolean isInitialized(Metadata metadata, V value) {
"""
Checks if is initialized.
@param <V> the value type
@param metadata the metadata
@param value the value
@return true, if is initialized
"""
if (metadata.valueType.getJavaType() == WireFormat.JavaType.MESSAGE) {
... | java | private static <V> boolean isInitialized(Metadata metadata, V value) {
if (metadata.valueType.getJavaType() == WireFormat.JavaType.MESSAGE) {
return value != null;
}
return true;
} | [
"private",
"static",
"<",
"V",
">",
"boolean",
"isInitialized",
"(",
"Metadata",
"metadata",
",",
"V",
"value",
")",
"{",
"if",
"(",
"metadata",
".",
"valueType",
".",
"getJavaType",
"(",
")",
"==",
"WireFormat",
".",
"JavaType",
".",
"MESSAGE",
")",
"{"... | Checks if is initialized.
@param <V> the value type
@param metadata the metadata
@param value the value
@return true, if is initialized | [
"Checks",
"if",
"is",
"initialized",
"."
] | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/MapEntry.java#L637-L642 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/TrashPolicy.java | TrashPolicy.getInstance | public static TrashPolicy getInstance(Configuration conf, FileSystem fs, Path home)
throws IOException {
"""
Get an instance of the configured TrashPolicy based on the value
of the configuration paramater fs.trash.classname.
@param conf the configuration to be used
@param fs the file system to be used
... | java | public static TrashPolicy getInstance(Configuration conf, FileSystem fs, Path home)
throws IOException {
Class<? extends TrashPolicy> trashClass = conf.getClass("fs.trash.classname",
TrashPolicyDefault.class,
... | [
"public",
"static",
"TrashPolicy",
"getInstance",
"(",
"Configuration",
"conf",
",",
"FileSystem",
"fs",
",",
"Path",
"home",
")",
"throws",
"IOException",
"{",
"Class",
"<",
"?",
"extends",
"TrashPolicy",
">",
"trashClass",
"=",
"conf",
".",
"getClass",
"(",
... | Get an instance of the configured TrashPolicy based on the value
of the configuration paramater fs.trash.classname.
@param conf the configuration to be used
@param fs the file system to be used
@param home the home directory
@return an instance of TrashPolicy | [
"Get",
"an",
"instance",
"of",
"the",
"configured",
"TrashPolicy",
"based",
"on",
"the",
"value",
"of",
"the",
"configuration",
"paramater",
"fs",
".",
"trash",
".",
"classname",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/TrashPolicy.java#L94-L102 |
EMCECS/nfs-client-java | src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java | RpcWrapper.callRpc | public Xdr callRpc(String serverIP, Xdr xdrRequest, boolean usePrivilegedPort) throws RpcException {
"""
Basic RPC call functionality only.
@param serverIP
The endpoint of the server being called.
@param xdrRequest
The Xdr data for the request.
@param usePrivilegedPort
<ul>
<li>If <code>true</code>, use a... | java | public Xdr callRpc(String serverIP, Xdr xdrRequest, boolean usePrivilegedPort) throws RpcException {
return NetMgr.getInstance().sendAndWait(serverIP, _port, usePrivilegedPort, xdrRequest, _rpcTimeout);
} | [
"public",
"Xdr",
"callRpc",
"(",
"String",
"serverIP",
",",
"Xdr",
"xdrRequest",
",",
"boolean",
"usePrivilegedPort",
")",
"throws",
"RpcException",
"{",
"return",
"NetMgr",
".",
"getInstance",
"(",
")",
".",
"sendAndWait",
"(",
"serverIP",
",",
"_port",
",",
... | Basic RPC call functionality only.
@param serverIP
The endpoint of the server being called.
@param xdrRequest
The Xdr data for the request.
@param usePrivilegedPort
<ul>
<li>If <code>true</code>, use a privileged local port (below
1024) for RPC communication.</li>
<li>If <code>false</code>, use any non-privileged loca... | [
"Basic",
"RPC",
"call",
"functionality",
"only",
"."
] | train | https://github.com/EMCECS/nfs-client-java/blob/7ba25bad5052b95cd286052745327729288b2843/src/main/java/com/emc/ecs/nfsclient/rpc/RpcWrapper.java#L227-L229 |
fcrepo3/fcrepo | fcrepo-server/src/main/java/org/fcrepo/server/storage/types/BasicDigitalObject.java | BasicDigitalObject.setExtProperty | public void setExtProperty(String propName, String propValue) {
"""
Sets an extended property on the object.
@param propName
The extended property name, either a string, or URI as string.
"""
if (m_extProperties == null) {
m_extProperties = new HashMap<String, String>();
}
... | java | public void setExtProperty(String propName, String propValue) {
if (m_extProperties == null) {
m_extProperties = new HashMap<String, String>();
}
m_extProperties.put(propName, propValue);
} | [
"public",
"void",
"setExtProperty",
"(",
"String",
"propName",
",",
"String",
"propValue",
")",
"{",
"if",
"(",
"m_extProperties",
"==",
"null",
")",
"{",
"m_extProperties",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(",
")",
";",
"}",
"m... | Sets an extended property on the object.
@param propName
The extended property name, either a string, or URI as string. | [
"Sets",
"an",
"extended",
"property",
"on",
"the",
"object",
"."
] | train | https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-server/src/main/java/org/fcrepo/server/storage/types/BasicDigitalObject.java#L271-L277 |
jbundle/jbundle | thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHelpPane.java | JHelpPane.handleAction | public boolean handleAction(String strAction, Component source, int iOptions) {
"""
Do some applet-wide action.
For example, submit or reset.
Here are how actions are handled:
When a BasePanel receives a command it calls it's doAction method. If the doAction
doesn't handle the action, it is passed to the paren... | java | public boolean handleAction(String strAction, Component source, int iOptions)
{
if (source == this.getParent())
return false; // Don't handle commands coming from the outside
if (source.getParent() == this)
source = this.getParent(); // This will keep my commands from bein... | [
"public",
"boolean",
"handleAction",
"(",
"String",
"strAction",
",",
"Component",
"source",
",",
"int",
"iOptions",
")",
"{",
"if",
"(",
"source",
"==",
"this",
".",
"getParent",
"(",
")",
")",
"return",
"false",
";",
"// Don't handle commands coming from the o... | Do some applet-wide action.
For example, submit or reset.
Here are how actions are handled:
When a BasePanel receives a command it calls it's doAction method. If the doAction
doesn't handle the action, it is passed to the parent's doAction method, until it
hits the (this) applet method. This applet method tries to pass... | [
"Do",
"some",
"applet",
"-",
"wide",
"action",
".",
"For",
"example",
"submit",
"or",
"reset",
".",
"Here",
"are",
"how",
"actions",
"are",
"handled",
":",
"When",
"a",
"BasePanel",
"receives",
"a",
"command",
"it",
"calls",
"it",
"s",
"doAction",
"metho... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/util-misc/src/main/java/org/jbundle/thin/base/screen/util/html/JHelpPane.java#L106-L113 |
lagom/lagom | service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java | MessageProtocol.withCharset | public MessageProtocol withCharset(String charset) {
"""
Return a copy of this message protocol with the charset set to the given charset.
@param charset The charset to set.
@return A copy of this message protocol.
"""
return new MessageProtocol(contentType, Optional.ofNullable(charset), version);
... | java | public MessageProtocol withCharset(String charset) {
return new MessageProtocol(contentType, Optional.ofNullable(charset), version);
} | [
"public",
"MessageProtocol",
"withCharset",
"(",
"String",
"charset",
")",
"{",
"return",
"new",
"MessageProtocol",
"(",
"contentType",
",",
"Optional",
".",
"ofNullable",
"(",
"charset",
")",
",",
"version",
")",
";",
"}"
] | Return a copy of this message protocol with the charset set to the given charset.
@param charset The charset to set.
@return A copy of this message protocol. | [
"Return",
"a",
"copy",
"of",
"this",
"message",
"protocol",
"with",
"the",
"charset",
"set",
"to",
"the",
"given",
"charset",
"."
] | train | https://github.com/lagom/lagom/blob/3763055a9d1aace793a5d970f4e688aea61b1a5a/service/javadsl/api/src/main/java/com/lightbend/lagom/javadsl/api/transport/MessageProtocol.java#L109-L111 |
spockframework/spock | spock-core/src/main/java/org/spockframework/mock/constraint/PositionalArgumentListConstraint.java | PositionalArgumentListConstraint.hasExpandableVarArgs | private boolean hasExpandableVarArgs(IMockMethod method, List<Object> args) {
"""
Tells if the given method call has expandable varargs. Note that Groovy
supports vararg syntax for all methods whose last parameter is of array type.
"""
List<Class<?>> paramTypes = method.getParameterTypes();
return !pa... | java | private boolean hasExpandableVarArgs(IMockMethod method, List<Object> args) {
List<Class<?>> paramTypes = method.getParameterTypes();
return !paramTypes.isEmpty()
&& CollectionUtil.getLastElement(paramTypes).isArray()
&& CollectionUtil.getLastElement(args) != null;
} | [
"private",
"boolean",
"hasExpandableVarArgs",
"(",
"IMockMethod",
"method",
",",
"List",
"<",
"Object",
">",
"args",
")",
"{",
"List",
"<",
"Class",
"<",
"?",
">",
">",
"paramTypes",
"=",
"method",
".",
"getParameterTypes",
"(",
")",
";",
"return",
"!",
... | Tells if the given method call has expandable varargs. Note that Groovy
supports vararg syntax for all methods whose last parameter is of array type. | [
"Tells",
"if",
"the",
"given",
"method",
"call",
"has",
"expandable",
"varargs",
".",
"Note",
"that",
"Groovy",
"supports",
"vararg",
"syntax",
"for",
"all",
"methods",
"whose",
"last",
"parameter",
"is",
"of",
"array",
"type",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/mock/constraint/PositionalArgumentListConstraint.java#L80-L85 |
code4everything/util | src/main/java/com/zhazhapan/config/JsonParser.java | JsonParser.set | public boolean set(String path, Object value) {
"""
根据路径设置值
@param path <a href= "https://github.com/alibaba/fastjson/wiki/JSONPath">路径语法</a>
@param value 值对象
@return 是否设置成功
"""
jsonStore.clear();
return JSONPath.set(jsonObject, checkPath(path), value);
} | java | public boolean set(String path, Object value) {
jsonStore.clear();
return JSONPath.set(jsonObject, checkPath(path), value);
} | [
"public",
"boolean",
"set",
"(",
"String",
"path",
",",
"Object",
"value",
")",
"{",
"jsonStore",
".",
"clear",
"(",
")",
";",
"return",
"JSONPath",
".",
"set",
"(",
"jsonObject",
",",
"checkPath",
"(",
"path",
")",
",",
"value",
")",
";",
"}"
] | 根据路径设置值
@param path <a href= "https://github.com/alibaba/fastjson/wiki/JSONPath">路径语法</a>
@param value 值对象
@return 是否设置成功 | [
"根据路径设置值"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/config/JsonParser.java#L111-L114 |
graknlabs/grakn | server/src/graql/gremlin/fragment/Fragments.java | Fragments.outSubs | static <T> GraphTraversal<T, Vertex> outSubs(GraphTraversal<T, Vertex> traversal) {
"""
Default unlimiteid depth sub-edge traversal
@param traversal
@param <T>
@return
"""
return outSubs(traversal, TRAVERSE_ALL_SUB_EDGES);
} | java | static <T> GraphTraversal<T, Vertex> outSubs(GraphTraversal<T, Vertex> traversal) {
return outSubs(traversal, TRAVERSE_ALL_SUB_EDGES);
} | [
"static",
"<",
"T",
">",
"GraphTraversal",
"<",
"T",
",",
"Vertex",
">",
"outSubs",
"(",
"GraphTraversal",
"<",
"T",
",",
"Vertex",
">",
"traversal",
")",
"{",
"return",
"outSubs",
"(",
"traversal",
",",
"TRAVERSE_ALL_SUB_EDGES",
")",
";",
"}"
] | Default unlimiteid depth sub-edge traversal
@param traversal
@param <T>
@return | [
"Default",
"unlimiteid",
"depth",
"sub",
"-",
"edge",
"traversal"
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/graql/gremlin/fragment/Fragments.java#L154-L156 |
JOML-CI/JOML | src/org/joml/Quaterniond.java | Quaterniond.rotateTo | public Quaterniond rotateTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ) {
"""
Apply a rotation to <code>this</code> that rotates the <code>fromDir</code> vector to point along <code>toDir</code>.
<p>
Since there can be multiple possible rotations, this method c... | java | public Quaterniond rotateTo(double fromDirX, double fromDirY, double fromDirZ, double toDirX, double toDirY, double toDirZ) {
return rotateTo(fromDirX, fromDirY, fromDirZ, toDirX, toDirY, toDirZ, this);
} | [
"public",
"Quaterniond",
"rotateTo",
"(",
"double",
"fromDirX",
",",
"double",
"fromDirY",
",",
"double",
"fromDirZ",
",",
"double",
"toDirX",
",",
"double",
"toDirY",
",",
"double",
"toDirZ",
")",
"{",
"return",
"rotateTo",
"(",
"fromDirX",
",",
"fromDirY",
... | Apply a rotation to <code>this</code> that rotates the <code>fromDir</code> vector to point along <code>toDir</code>.
<p>
Since there can be multiple possible rotations, this method chooses the one with the shortest arc.
<p>
If <code>Q</code> is <code>this</code> quaternion and <code>R</code> the quaternion representin... | [
"Apply",
"a",
"rotation",
"to",
"<code",
">",
"this<",
"/",
"code",
">",
"that",
"rotates",
"the",
"<code",
">",
"fromDir<",
"/",
"code",
">",
"vector",
"to",
"point",
"along",
"<code",
">",
"toDir<",
"/",
"code",
">",
".",
"<p",
">",
"Since",
"there... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L2098-L2100 |
playn/playn | robovm/src/playn/robovm/RoboFont.java | RoboFont.registerVariant | public static void registerVariant(String name, Style style, String variantName) {
"""
Registers a font for use when a bold, italic or bold italic variant is requested. iOS does not
programmatically generate bold, italic and bold italic variants of fonts. Instead it uses the
actual bold, italic or bold italic va... | java | public static void registerVariant(String name, Style style, String variantName) {
Map<String,String> styleVariants = _variants.get(style);
if (styleVariants == null) {
_variants.put(style, styleVariants = new HashMap<String,String>());
}
styleVariants.put(name, variantName);
} | [
"public",
"static",
"void",
"registerVariant",
"(",
"String",
"name",
",",
"Style",
"style",
",",
"String",
"variantName",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"styleVariants",
"=",
"_variants",
".",
"get",
"(",
"style",
")",
";",
"if",
"(... | Registers a font for use when a bold, italic or bold italic variant is requested. iOS does not
programmatically generate bold, italic and bold italic variants of fonts. Instead it uses the
actual bold, italic or bold italic variant of the font provided by the original designer.
<p> The built-in iOS fonts (Helvetica, C... | [
"Registers",
"a",
"font",
"for",
"use",
"when",
"a",
"bold",
"italic",
"or",
"bold",
"italic",
"variant",
"is",
"requested",
".",
"iOS",
"does",
"not",
"programmatically",
"generate",
"bold",
"italic",
"and",
"bold",
"italic",
"variants",
"of",
"fonts",
".",... | train | https://github.com/playn/playn/blob/7e7a9d048ba6afe550dc0cdeaca3e1d5b0d01c66/robovm/src/playn/robovm/RoboFont.java#L41-L47 |
alexvasilkov/AndroidCommons | library/src/main/java/com/alexvasilkov/android/commons/nav/handlers/PickPhoneHandler.java | PickPhoneHandler.onResult | @Nullable
public static Data onResult(@NonNull Context context, int resultCode, @Nullable Intent data) {
"""
Call this method from {@link Activity#onActivityResult(int, int, Intent)} method to
get picked contact info.
"""
if (resultCode != Activity.RESULT_OK || data == null || data.getData() == nu... | java | @Nullable
public static Data onResult(@NonNull Context context, int resultCode, @Nullable Intent data) {
if (resultCode != Activity.RESULT_OK || data == null || data.getData() == null) {
return null;
}
Cursor cursor = null;
try {
cursor = context.getContentRe... | [
"@",
"Nullable",
"public",
"static",
"Data",
"onResult",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"int",
"resultCode",
",",
"@",
"Nullable",
"Intent",
"data",
")",
"{",
"if",
"(",
"resultCode",
"!=",
"Activity",
".",
"RESULT_OK",
"||",
"data",
"==",... | Call this method from {@link Activity#onActivityResult(int, int, Intent)} method to
get picked contact info. | [
"Call",
"this",
"method",
"from",
"{"
] | train | https://github.com/alexvasilkov/AndroidCommons/blob/aca9f6d5acfc6bd3694984b7f89956e1a0146ddb/library/src/main/java/com/alexvasilkov/android/commons/nav/handlers/PickPhoneHandler.java#L18-L44 |
CODAIT/stocator | src/main/java/com/ibm/stocator/fs/cos/COSInputStream.java | COSInputStream.closeStream | private void closeStream(String reason, long length, boolean forceAbort) {
"""
Close a stream: decide whether to abort or close, based on
the length of the stream and the current position.
If a close() is attempted and fails, the operation escalates to
an abort.
This does not set the {@link #closed} flag.
@... | java | private void closeStream(String reason, long length, boolean forceAbort) {
if (wrappedStream != null) {
// if the amount of data remaining in the current request is greater
// than the readahead value: abort.
long remaining = remainingInCurrentRequest();
LOG.debug("Closing stream {}: {}", r... | [
"private",
"void",
"closeStream",
"(",
"String",
"reason",
",",
"long",
"length",
",",
"boolean",
"forceAbort",
")",
"{",
"if",
"(",
"wrappedStream",
"!=",
"null",
")",
"{",
"// if the amount of data remaining in the current request is greater",
"// than the readahead val... | Close a stream: decide whether to abort or close, based on
the length of the stream and the current position.
If a close() is attempted and fails, the operation escalates to
an abort.
This does not set the {@link #closed} flag.
@param reason reason for stream being closed; used in messages
@param length length of the ... | [
"Close",
"a",
"stream",
":",
"decide",
"whether",
"to",
"abort",
"or",
"close",
"based",
"on",
"the",
"length",
"of",
"the",
"stream",
"and",
"the",
"current",
"position",
".",
"If",
"a",
"close",
"()",
"is",
"attempted",
"and",
"fails",
"the",
"operatio... | train | https://github.com/CODAIT/stocator/blob/35969cadd2e8faa6fdac45e8bec1799fdd3d8299/src/main/java/com/ibm/stocator/fs/cos/COSInputStream.java#L390-L437 |
apache/flink | flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java | DescriptorProperties.putIndexedVariableProperties | public void putIndexedVariableProperties(String key, List<Map<String, String>> subKeyValues) {
"""
Adds an indexed mapping of properties under a common key.
<p>For example:
<pre>
schema.fields.0.type = INT, schema.fields.0.name = test
schema.fields.1.name = test2
</pre>
<p>The arity of the subKeyValues... | java | public void putIndexedVariableProperties(String key, List<Map<String, String>> subKeyValues) {
checkNotNull(key);
checkNotNull(subKeyValues);
for (int idx = 0; idx < subKeyValues.size(); idx++) {
final Map<String, String> values = subKeyValues.get(idx);
for (Map.Entry<String, String> value : values.entrySet... | [
"public",
"void",
"putIndexedVariableProperties",
"(",
"String",
"key",
",",
"List",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"subKeyValues",
")",
"{",
"checkNotNull",
"(",
"key",
")",
";",
"checkNotNull",
"(",
"subKeyValues",
")",
";",
"for",
"... | Adds an indexed mapping of properties under a common key.
<p>For example:
<pre>
schema.fields.0.type = INT, schema.fields.0.name = test
schema.fields.1.name = test2
</pre>
<p>The arity of the subKeyValues can differ. | [
"Adds",
"an",
"indexed",
"mapping",
"of",
"properties",
"under",
"a",
"common",
"key",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-table/flink-table-common/src/main/java/org/apache/flink/table/descriptors/DescriptorProperties.java#L229-L238 |
prometheus/client_java | simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java | SimpleCollector.setChild | public <T extends Collector> T setChild(Child child, String... labelValues) {
"""
Replace the Child with the given labels.
<p>
This is intended for advanced uses, in particular proxying metrics
from another monitoring system. This allows for callbacks for returning
values for {@link Counter} and {@link Gauge} ... | java | public <T extends Collector> T setChild(Child child, String... labelValues) {
if (labelValues.length != labelNames.size()) {
throw new IllegalArgumentException("Incorrect number of labels.");
}
children.put(Arrays.asList(labelValues), child);
return (T)this;
} | [
"public",
"<",
"T",
"extends",
"Collector",
">",
"T",
"setChild",
"(",
"Child",
"child",
",",
"String",
"...",
"labelValues",
")",
"{",
"if",
"(",
"labelValues",
".",
"length",
"!=",
"labelNames",
".",
"size",
"(",
")",
")",
"{",
"throw",
"new",
"Illeg... | Replace the Child with the given labels.
<p>
This is intended for advanced uses, in particular proxying metrics
from another monitoring system. This allows for callbacks for returning
values for {@link Counter} and {@link Gauge} without having to implement
a full {@link Collector}.
<p>
An example with {@link Gauge}:
<p... | [
"Replace",
"the",
"Child",
"with",
"the",
"given",
"labels",
".",
"<p",
">",
"This",
"is",
"intended",
"for",
"advanced",
"uses",
"in",
"particular",
"proxying",
"metrics",
"from",
"another",
"monitoring",
"system",
".",
"This",
"allows",
"for",
"callbacks",
... | train | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient/src/main/java/io/prometheus/client/SimpleCollector.java#L134-L140 |
kaazing/gateway | management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java | GatewayManagementBeanImpl.doMessageReceivedListeners | @Override
public void doMessageReceivedListeners(final long sessionId, final long sessionReadBytes, final Object message) {
"""
Notify the management listeners on a messageReceived.
<p/>
NOTE: this starts on the IO thread, but runs a task OFF the thread.
"""
runManagementTask(new Runnable() {
... | java | @Override
public void doMessageReceivedListeners(final long sessionId, final long sessionReadBytes, final Object message) {
runManagementTask(new Runnable() {
@Override
public void run() {
try {
// The particular management listeners change on stra... | [
"@",
"Override",
"public",
"void",
"doMessageReceivedListeners",
"(",
"final",
"long",
"sessionId",
",",
"final",
"long",
"sessionReadBytes",
",",
"final",
"Object",
"message",
")",
"{",
"runManagementTask",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override"... | Notify the management listeners on a messageReceived.
<p/>
NOTE: this starts on the IO thread, but runs a task OFF the thread. | [
"Notify",
"the",
"management",
"listeners",
"on",
"a",
"messageReceived",
".",
"<p",
"/",
">",
"NOTE",
":",
"this",
"starts",
"on",
"the",
"IO",
"thread",
"but",
"runs",
"a",
"task",
"OFF",
"the",
"thread",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/management/src/main/java/org/kaazing/gateway/management/gateway/GatewayManagementBeanImpl.java#L492-L509 |
autermann/yaml | src/main/java/com/github/autermann/yaml/YamlNodeRepresenter.java | YamlNodeRepresenter.bestStyle | private boolean bestStyle(Node node, boolean bestStyle) {
"""
Gets the best style for the supplied node.
@param node the node to check
@param bestStyle the current best style
@return the new best style
"""
if (node instanceof ScalarNode) {
ScalarNode scalar = (ScalarNode) node;
... | java | private boolean bestStyle(Node node, boolean bestStyle) {
if (node instanceof ScalarNode) {
ScalarNode scalar = (ScalarNode) node;
if (scalar.getStyle() == null) {
return false;
}
}
return bestStyle;
} | [
"private",
"boolean",
"bestStyle",
"(",
"Node",
"node",
",",
"boolean",
"bestStyle",
")",
"{",
"if",
"(",
"node",
"instanceof",
"ScalarNode",
")",
"{",
"ScalarNode",
"scalar",
"=",
"(",
"ScalarNode",
")",
"node",
";",
"if",
"(",
"scalar",
".",
"getStyle",
... | Gets the best style for the supplied node.
@param node the node to check
@param bestStyle the current best style
@return the new best style | [
"Gets",
"the",
"best",
"style",
"for",
"the",
"supplied",
"node",
"."
] | train | https://github.com/autermann/yaml/blob/5f8ab03e4fec3a2abe72c03561cdaa3a3936634d/src/main/java/com/github/autermann/yaml/YamlNodeRepresenter.java#L192-L200 |
greenjoe/lambdaFromString | src/main/java/pl/joegreen/lambdaFromString/LambdaFactory.java | LambdaFactory.createLambdaUnchecked | public <T> T createLambdaUnchecked(String code, TypeReference<T> type) {
"""
Convenience wrapper for {@link #createLambda(String, TypeReference)}
which throws unchecked exception instead of checked one.
@see #createLambda(String, TypeReference)
"""
try {
return createLambda(code, type);... | java | public <T> T createLambdaUnchecked(String code, TypeReference<T> type) {
try {
return createLambda(code, type);
} catch (LambdaCreationException e) {
throw new LambdaCreationRuntimeException(e);
}
} | [
"public",
"<",
"T",
">",
"T",
"createLambdaUnchecked",
"(",
"String",
"code",
",",
"TypeReference",
"<",
"T",
">",
"type",
")",
"{",
"try",
"{",
"return",
"createLambda",
"(",
"code",
",",
"type",
")",
";",
"}",
"catch",
"(",
"LambdaCreationException",
"... | Convenience wrapper for {@link #createLambda(String, TypeReference)}
which throws unchecked exception instead of checked one.
@see #createLambda(String, TypeReference) | [
"Convenience",
"wrapper",
"for",
"{",
"@link",
"#createLambda",
"(",
"String",
"TypeReference",
")",
"}",
"which",
"throws",
"unchecked",
"exception",
"instead",
"of",
"checked",
"one",
"."
] | train | https://github.com/greenjoe/lambdaFromString/blob/67d383f3922ab066e908b852a531880772bbdf29/src/main/java/pl/joegreen/lambdaFromString/LambdaFactory.java#L97-L103 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/dynamic/DefaultCommandMethodVerifier.java | DefaultCommandMethodVerifier.validate | public void validate(CommandSegments commandSegments, CommandMethod commandMethod) throws CommandMethodSyntaxException {
"""
Verify a {@link CommandMethod} with its {@link CommandSegments}. This method verifies that the command exists and that
the required number of arguments is declared.
@param commandSegment... | java | public void validate(CommandSegments commandSegments, CommandMethod commandMethod) throws CommandMethodSyntaxException {
LettuceAssert.notEmpty(commandSegments.getCommandType().name(), "Command name must not be empty");
CommandDetail commandDetail = findCommandDetail(commandSegments.getCommandType().n... | [
"public",
"void",
"validate",
"(",
"CommandSegments",
"commandSegments",
",",
"CommandMethod",
"commandMethod",
")",
"throws",
"CommandMethodSyntaxException",
"{",
"LettuceAssert",
".",
"notEmpty",
"(",
"commandSegments",
".",
"getCommandType",
"(",
")",
".",
"name",
... | Verify a {@link CommandMethod} with its {@link CommandSegments}. This method verifies that the command exists and that
the required number of arguments is declared.
@param commandSegments
@param commandMethod | [
"Verify",
"a",
"{",
"@link",
"CommandMethod",
"}",
"with",
"its",
"{",
"@link",
"CommandSegments",
"}",
".",
"This",
"method",
"verifies",
"that",
"the",
"command",
"exists",
"and",
"that",
"the",
"required",
"number",
"of",
"arguments",
"is",
"declared",
".... | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/dynamic/DefaultCommandMethodVerifier.java#L65-L73 |
JodaOrg/joda-time | src/main/java/org/joda/time/MutablePeriod.java | MutablePeriod.setPeriod | public void setPeriod(ReadableInstant start, ReadableInstant end) {
"""
Sets all the fields in one go from two instants representing an interval.
<p>
The chronology of the start instant is used, unless that is null when the
chronology of the end instant is used instead.
@param start the start instant, null ... | java | public void setPeriod(ReadableInstant start, ReadableInstant end) {
if (start == end) {
setPeriod(0L);
} else {
long startMillis = DateTimeUtils.getInstantMillis(start);
long endMillis = DateTimeUtils.getInstantMillis(end);
Chronology chrono = DateTimeUtil... | [
"public",
"void",
"setPeriod",
"(",
"ReadableInstant",
"start",
",",
"ReadableInstant",
"end",
")",
"{",
"if",
"(",
"start",
"==",
"end",
")",
"{",
"setPeriod",
"(",
"0L",
")",
";",
"}",
"else",
"{",
"long",
"startMillis",
"=",
"DateTimeUtils",
".",
"get... | Sets all the fields in one go from two instants representing an interval.
<p>
The chronology of the start instant is used, unless that is null when the
chronology of the end instant is used instead.
@param start the start instant, null means now
@param end the end instant, null means now
@throws ArithmeticException ... | [
"Sets",
"all",
"the",
"fields",
"in",
"one",
"go",
"from",
"two",
"instants",
"representing",
"an",
"interval",
".",
"<p",
">",
"The",
"chronology",
"of",
"the",
"start",
"instant",
"is",
"used",
"unless",
"that",
"is",
"null",
"when",
"the",
"chronology",... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/MutablePeriod.java#L515-L524 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java | ReUtil.findAllGroup0 | public static List<String> findAllGroup0(String regex, CharSequence content) {
"""
取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容
@param regex 正则
@param content 被查找的内容
@return 结果列表
@since 3.1.2
"""
return findAll(regex, content, 0);
} | java | public static List<String> findAllGroup0(String regex, CharSequence content) {
return findAll(regex, content, 0);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"findAllGroup0",
"(",
"String",
"regex",
",",
"CharSequence",
"content",
")",
"{",
"return",
"findAll",
"(",
"regex",
",",
"content",
",",
"0",
")",
";",
"}"
] | 取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容
@param regex 正则
@param content 被查找的内容
@return 结果列表
@since 3.1.2 | [
"取得内容中匹配的所有结果,获得匹配的所有结果中正则对应分组0的内容"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ReUtil.java#L363-L365 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDefinitionUtil.java | CPDefinitionUtil.findByUUID_G | public static CPDefinition findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPDefinitionException {
"""
Returns the cp definition where uuid = ? and groupId = ? or throws a {@link NoSuchCPDefinitionException} if it could not be found.
@param uuid the uuid
@p... | java | public static CPDefinition findByUUID_G(String uuid, long groupId)
throws com.liferay.commerce.product.exception.NoSuchCPDefinitionException {
return getPersistence().findByUUID_G(uuid, groupId);
} | [
"public",
"static",
"CPDefinition",
"findByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"product",
".",
"exception",
".",
"NoSuchCPDefinitionException",
"{",
"return",
"getPersistence",
"(",
... | Returns the cp definition where uuid = ? and groupId = ? or throws a {@link NoSuchCPDefinitionException} if it could not be found.
@param uuid the uuid
@param groupId the group ID
@return the matching cp definition
@throws NoSuchCPDefinitionException if a matching cp definition could not be found | [
"Returns",
"the",
"cp",
"definition",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"or",
"throws",
"a",
"{",
"@link",
"NoSuchCPDefinitionException",
"}",
"if",
"it",
"could",
"not",
"be",
"found",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPDefinitionUtil.java#L278-L281 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java | WorldToCameraToPixel.transform | public boolean transform( Point3D_F64 worldPt , Point2D_F64 pixelPt ) {
"""
Computes the observed location of the specified point in world coordinates in the camera pixel. If
the object can't be viewed because it is behind the camera then false is returned.
@param worldPt Location of point in world frame
@para... | java | public boolean transform( Point3D_F64 worldPt , Point2D_F64 pixelPt ) {
SePointOps_F64.transform(worldToCamera,worldPt,cameraPt);
// can't see the point
if( cameraPt.z <= 0 )
return false;
normToPixel.compute(cameraPt.x/cameraPt.z, cameraPt.y/cameraPt.z, pixelPt);
return true;
} | [
"public",
"boolean",
"transform",
"(",
"Point3D_F64",
"worldPt",
",",
"Point2D_F64",
"pixelPt",
")",
"{",
"SePointOps_F64",
".",
"transform",
"(",
"worldToCamera",
",",
"worldPt",
",",
"cameraPt",
")",
";",
"// can't see the point",
"if",
"(",
"cameraPt",
".",
"... | Computes the observed location of the specified point in world coordinates in the camera pixel. If
the object can't be viewed because it is behind the camera then false is returned.
@param worldPt Location of point in world frame
@param pixelPt Pixel observation of point.
@return True if visible (+z) or false if not v... | [
"Computes",
"the",
"observed",
"location",
"of",
"the",
"specified",
"point",
"in",
"world",
"coordinates",
"in",
"the",
"camera",
"pixel",
".",
"If",
"the",
"object",
"can",
"t",
"be",
"viewed",
"because",
"it",
"is",
"behind",
"the",
"camera",
"then",
"f... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/WorldToCameraToPixel.java#L80-L89 |
greese/dasein-persist | src/main/java/org/dasein/persist/RelationalReleaseCache.java | RelationalReleaseCache.init | protected void init(Class<T> cls, Key ... keys) {
"""
Constructs a new persistent factory for objects of the specified class with
the named unique identifier attributes.
@param cls the class of objects managed by this factory
@param keys a list of unique identifiers for instances of the specified class
"""
... | java | protected void init(Class<T> cls, Key ... keys) {
readDataSource = Execution.getDataSourceName(cls.getName(), true);
writeDataSource = Execution.getDataSourceName(cls.getName(), false);
if( readDataSource == null ) {
readDataSource = writeDataSource;
}
if( writeDataSo... | [
"protected",
"void",
"init",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"Key",
"...",
"keys",
")",
"{",
"readDataSource",
"=",
"Execution",
".",
"getDataSourceName",
"(",
"cls",
".",
"getName",
"(",
")",
",",
"true",
")",
";",
"writeDataSource",
"=",
"Ex... | Constructs a new persistent factory for objects of the specified class with
the named unique identifier attributes.
@param cls the class of objects managed by this factory
@param keys a list of unique identifiers for instances of the specified class | [
"Constructs",
"a",
"new",
"persistent",
"factory",
"for",
"objects",
"of",
"the",
"specified",
"class",
"with",
"the",
"named",
"unique",
"identifier",
"attributes",
"."
] | train | https://github.com/greese/dasein-persist/blob/1104621ad1670a45488b093b984ec1db4c7be781/src/main/java/org/dasein/persist/RelationalReleaseCache.java#L99-L116 |
threerings/playn | robovm/src/playn/robovm/RoboPlatform.java | RoboPlatform.willRotate | void willRotate(UIInterfaceOrientation toOrient, double duration) {
"""
with iOS for rotation notifications, game loop callbacks, and app lifecycle events
"""
if (orientListener != null) {
orientListener.willRotate(toOrient, duration);
}
} | java | void willRotate(UIInterfaceOrientation toOrient, double duration) {
if (orientListener != null) {
orientListener.willRotate(toOrient, duration);
}
} | [
"void",
"willRotate",
"(",
"UIInterfaceOrientation",
"toOrient",
",",
"double",
"duration",
")",
"{",
"if",
"(",
"orientListener",
"!=",
"null",
")",
"{",
"orientListener",
".",
"willRotate",
"(",
"toOrient",
",",
"duration",
")",
";",
"}",
"}"
] | with iOS for rotation notifications, game loop callbacks, and app lifecycle events | [
"with",
"iOS",
"for",
"rotation",
"notifications",
"game",
"loop",
"callbacks",
"and",
"app",
"lifecycle",
"events"
] | train | https://github.com/threerings/playn/blob/c266eeb39188dcada4b00992a0d1199759e03d42/robovm/src/playn/robovm/RoboPlatform.java#L257-L261 |
arquillian/arquillian-algeron | common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java | GitOperations.createBranchAndCheckout | public Ref createBranchAndCheckout(Git git, String branch) {
"""
Executes a checkout -b command using given branch.
@param git
instance.
@param branch
to create and checkout.
@return Ref to current branch.
"""
try {
return git.checkout()
.setCreateBranch(true)
... | java | public Ref createBranchAndCheckout(Git git, String branch) {
try {
return git.checkout()
.setCreateBranch(true)
.setName(branch)
.setUpstreamMode(CreateBranchCommand.SetupUpstreamMode.TRACK)
.call();
} catch (GitAPIException e) ... | [
"public",
"Ref",
"createBranchAndCheckout",
"(",
"Git",
"git",
",",
"String",
"branch",
")",
"{",
"try",
"{",
"return",
"git",
".",
"checkout",
"(",
")",
".",
"setCreateBranch",
"(",
"true",
")",
".",
"setName",
"(",
"branch",
")",
".",
"setUpstreamMode",
... | Executes a checkout -b command using given branch.
@param git
instance.
@param branch
to create and checkout.
@return Ref to current branch. | [
"Executes",
"a",
"checkout",
"-",
"b",
"command",
"using",
"given",
"branch",
"."
] | train | https://github.com/arquillian/arquillian-algeron/blob/ec79372defdafe99ab2f7bb696f1c1eabdbbacb6/common/git/src/main/java/org/arquillian/algeron/git/GitOperations.java#L186-L196 |
paypal/SeLion | server/src/main/java/com/paypal/selion/grid/InstallHelper.java | InstallHelper.copyFileFromResources | static void copyFileFromResources(String sourcePath, String destPath) throws IOException {
"""
Copy file from source path to destination location
@param sourcePath
Resource path of the source file
@param destPath
Path of the destination file
@throws IOException
"""
LOGGER.entering(new Object[] {... | java | static void copyFileFromResources(String sourcePath, String destPath) throws IOException {
LOGGER.entering(new Object[] { sourcePath, destPath });
File downloadFile = new File(destPath);
if (!downloadFile.exists()) {
InputStream stream = JarSpawner.class.getResourceAsStream(sourceP... | [
"static",
"void",
"copyFileFromResources",
"(",
"String",
"sourcePath",
",",
"String",
"destPath",
")",
"throws",
"IOException",
"{",
"LOGGER",
".",
"entering",
"(",
"new",
"Object",
"[",
"]",
"{",
"sourcePath",
",",
"destPath",
"}",
")",
";",
"File",
"downl... | Copy file from source path to destination location
@param sourcePath
Resource path of the source file
@param destPath
Path of the destination file
@throws IOException | [
"Copy",
"file",
"from",
"source",
"path",
"to",
"destination",
"location"
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/server/src/main/java/com/paypal/selion/grid/InstallHelper.java#L72-L83 |
groovy/groovy-core | src/examples/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java | DefaultGrailsDomainClassInjector.implementsMethod | private static boolean implementsMethod(ClassNode classNode, String methodName, Class[] argTypes) {
"""
Tests whether the ClassNode implements the specified method name
@param classNode The ClassNode
@param methodName The method name
@param argTypes
@return True if it implements the method
"""
L... | java | private static boolean implementsMethod(ClassNode classNode, String methodName, Class[] argTypes) {
List methods = classNode.getMethods();
if (argTypes == null || argTypes.length ==0) {
for (Iterator i = methods.iterator(); i.hasNext();) {
MethodNode mn = (MethodNode) i.n... | [
"private",
"static",
"boolean",
"implementsMethod",
"(",
"ClassNode",
"classNode",
",",
"String",
"methodName",
",",
"Class",
"[",
"]",
"argTypes",
")",
"{",
"List",
"methods",
"=",
"classNode",
".",
"getMethods",
"(",
")",
";",
"if",
"(",
"argTypes",
"==",
... | Tests whether the ClassNode implements the specified method name
@param classNode The ClassNode
@param methodName The method name
@param argTypes
@return True if it implements the method | [
"Tests",
"whether",
"the",
"ClassNode",
"implements",
"the",
"specified",
"method",
"name"
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/examples/org/codehaus/groovy/grails/compiler/injection/DefaultGrailsDomainClassInjector.java#L243-L254 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java | JBossASClient.getAttribute | public ModelNode getAttribute(String attributeName, Address address) throws Exception {
"""
Convienence method that allows you to obtain a single attribute's value from a resource.
@param attributeName the attribute whose value is to be returned
@param address identifies the resource
@return the attribute val... | java | public ModelNode getAttribute(String attributeName, Address address) throws Exception {
return getAttribute(false, attributeName, address);
} | [
"public",
"ModelNode",
"getAttribute",
"(",
"String",
"attributeName",
",",
"Address",
"address",
")",
"throws",
"Exception",
"{",
"return",
"getAttribute",
"(",
"false",
",",
"attributeName",
",",
"address",
")",
";",
"}"
] | Convienence method that allows you to obtain a single attribute's value from a resource.
@param attributeName the attribute whose value is to be returned
@param address identifies the resource
@return the attribute value
@throws Exception if failed to obtain the attribute value | [
"Convienence",
"method",
"that",
"allows",
"you",
"to",
"obtain",
"a",
"single",
"attribute",
"s",
"value",
"from",
"a",
"resource",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/JBossASClient.java#L347-L349 |
wcm-io/wcm-io-sling | commons/src/main/java/io/wcm/sling/commons/resource/ResourceType.java | ResourceType.makeRelative | public static @NotNull String makeRelative(@NotNull String resourceType, @NotNull ResourceResolver resourceResolver) {
"""
Makes the given resource type relative by stripping off any search path prefix.
In case the given resource type does not start with any of these prefixes it is returned unmodified.
@param re... | java | public static @NotNull String makeRelative(@NotNull String resourceType, @NotNull ResourceResolver resourceResolver) {
String[] searchPaths = resourceResolver.getSearchPath();
for (String prefix : searchPaths) {
if (StringUtils.startsWith(resourceType, prefix)) {
return resourceType.substring(pref... | [
"public",
"static",
"@",
"NotNull",
"String",
"makeRelative",
"(",
"@",
"NotNull",
"String",
"resourceType",
",",
"@",
"NotNull",
"ResourceResolver",
"resourceResolver",
")",
"{",
"String",
"[",
"]",
"searchPaths",
"=",
"resourceResolver",
".",
"getSearchPath",
"(... | Makes the given resource type relative by stripping off any search path prefix.
In case the given resource type does not start with any of these prefixes it is returned unmodified.
@param resourceType The resource type to make relative.
@param resourceResolver Resource resolver
@return Relative resource type | [
"Makes",
"the",
"given",
"resource",
"type",
"relative",
"by",
"stripping",
"off",
"any",
"search",
"path",
"prefix",
".",
"In",
"case",
"the",
"given",
"resource",
"type",
"does",
"not",
"start",
"with",
"any",
"of",
"these",
"prefixes",
"it",
"is",
"retu... | train | https://github.com/wcm-io/wcm-io-sling/blob/90adbe432469378794b5695c72e9cdfa2b7d36f1/commons/src/main/java/io/wcm/sling/commons/resource/ResourceType.java#L99-L107 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/TokenCachingStrategy.java | TokenCachingStrategy.getLastRefreshDate | public static Date getLastRefreshDate(Bundle bundle) {
"""
Gets the cached last refresh date from a Bundle.
@param bundle
A Bundle in which the last refresh date was stored.
@return the cached last refresh Date, or null.
@throws NullPointerException if the passed in Bundle is null
"""
Validate.... | java | public static Date getLastRefreshDate(Bundle bundle) {
Validate.notNull(bundle, "bundle");
return getDate(bundle, LAST_REFRESH_DATE_KEY);
} | [
"public",
"static",
"Date",
"getLastRefreshDate",
"(",
"Bundle",
"bundle",
")",
"{",
"Validate",
".",
"notNull",
"(",
"bundle",
",",
"\"bundle\"",
")",
";",
"return",
"getDate",
"(",
"bundle",
",",
"LAST_REFRESH_DATE_KEY",
")",
";",
"}"
] | Gets the cached last refresh date from a Bundle.
@param bundle
A Bundle in which the last refresh date was stored.
@return the cached last refresh Date, or null.
@throws NullPointerException if the passed in Bundle is null | [
"Gets",
"the",
"cached",
"last",
"refresh",
"date",
"from",
"a",
"Bundle",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/TokenCachingStrategy.java#L342-L345 |
google/closure-compiler | src/com/google/javascript/jscomp/CheckAccessControls.java | CheckAccessControls.checkNameDeprecation | private void checkNameDeprecation(NodeTraversal t, Node n) {
"""
Checks the given NAME node to ensure that access restrictions are obeyed.
"""
if (!n.isName()) {
return;
}
if (!shouldEmitDeprecationWarning(t, n)) {
return;
}
Var var = t.getScope().getVar(n.getString());
JS... | java | private void checkNameDeprecation(NodeTraversal t, Node n) {
if (!n.isName()) {
return;
}
if (!shouldEmitDeprecationWarning(t, n)) {
return;
}
Var var = t.getScope().getVar(n.getString());
JSDocInfo docInfo = var == null ? null : var.getJSDocInfo();
if (docInfo != null && docI... | [
"private",
"void",
"checkNameDeprecation",
"(",
"NodeTraversal",
"t",
",",
"Node",
"n",
")",
"{",
"if",
"(",
"!",
"n",
".",
"isName",
"(",
")",
")",
"{",
"return",
";",
"}",
"if",
"(",
"!",
"shouldEmitDeprecationWarning",
"(",
"t",
",",
"n",
")",
")"... | Checks the given NAME node to ensure that access restrictions are obeyed. | [
"Checks",
"the",
"given",
"NAME",
"node",
"to",
"ensure",
"that",
"access",
"restrictions",
"are",
"obeyed",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/CheckAccessControls.java#L448-L468 |
atomix/copycat | server/src/main/java/io/atomix/copycat/server/storage/Storage.java | Storage.openMetaStore | public MetaStore openMetaStore(String name) {
"""
Opens a new {@link MetaStore}, recovering metadata from disk if it exists.
<p>
The meta store will be loaded using based on the configured {@link StorageLevel}. If the storage level is persistent
then the meta store will be loaded from disk, otherwise a new meta... | java | public MetaStore openMetaStore(String name) {
return new MetaStore(name, this, ThreadContext.currentContextOrThrow().serializer().clone());
} | [
"public",
"MetaStore",
"openMetaStore",
"(",
"String",
"name",
")",
"{",
"return",
"new",
"MetaStore",
"(",
"name",
",",
"this",
",",
"ThreadContext",
".",
"currentContextOrThrow",
"(",
")",
".",
"serializer",
"(",
")",
".",
"clone",
"(",
")",
")",
";",
... | Opens a new {@link MetaStore}, recovering metadata from disk if it exists.
<p>
The meta store will be loaded using based on the configured {@link StorageLevel}. If the storage level is persistent
then the meta store will be loaded from disk, otherwise a new meta store will be created.
@param name The metastore name.
@... | [
"Opens",
"a",
"new",
"{",
"@link",
"MetaStore",
"}",
"recovering",
"metadata",
"from",
"disk",
"if",
"it",
"exists",
".",
"<p",
">",
"The",
"meta",
"store",
"will",
"be",
"loaded",
"using",
"based",
"on",
"the",
"configured",
"{",
"@link",
"StorageLevel",
... | train | https://github.com/atomix/copycat/blob/c90b88ccd5c63d6ea0b49fb77c25e2f3272a7b10/server/src/main/java/io/atomix/copycat/server/storage/Storage.java#L264-L266 |
google/error-prone | check_api/src/main/java/com/google/errorprone/matchers/Matchers.java | Matchers.methodIsNamed | public static Matcher<MethodTree> methodIsNamed(final String methodName) {
"""
Match a method declaration with a specific name.
@param methodName The name of the method to match, e.g., "equals"
"""
return new Matcher<MethodTree>() {
@Override
public boolean matches(MethodTree methodTree, Vis... | java | public static Matcher<MethodTree> methodIsNamed(final String methodName) {
return new Matcher<MethodTree>() {
@Override
public boolean matches(MethodTree methodTree, VisitorState state) {
return methodTree.getName().contentEquals(methodName);
}
};
} | [
"public",
"static",
"Matcher",
"<",
"MethodTree",
">",
"methodIsNamed",
"(",
"final",
"String",
"methodName",
")",
"{",
"return",
"new",
"Matcher",
"<",
"MethodTree",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"matches",
"(",
"MethodTree",
"me... | Match a method declaration with a specific name.
@param methodName The name of the method to match, e.g., "equals" | [
"Match",
"a",
"method",
"declaration",
"with",
"a",
"specific",
"name",
"."
] | train | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/matchers/Matchers.java#L918-L925 |
zxing/zxing | core/src/main/java/com/google/zxing/oned/UPCEANReader.java | UPCEANReader.checkStandardUPCEANChecksum | static boolean checkStandardUPCEANChecksum(CharSequence s) throws FormatException {
"""
Computes the UPC/EAN checksum on a string of digits, and reports
whether the checksum is correct or not.
@param s string of digits to check
@return true iff string of digits passes the UPC/EAN checksum algorithm
@throws F... | java | static boolean checkStandardUPCEANChecksum(CharSequence s) throws FormatException {
int length = s.length();
if (length == 0) {
return false;
}
int check = Character.digit(s.charAt(length - 1), 10);
return getStandardUPCEANChecksum(s.subSequence(0, length - 1)) == check;
} | [
"static",
"boolean",
"checkStandardUPCEANChecksum",
"(",
"CharSequence",
"s",
")",
"throws",
"FormatException",
"{",
"int",
"length",
"=",
"s",
".",
"length",
"(",
")",
";",
"if",
"(",
"length",
"==",
"0",
")",
"{",
"return",
"false",
";",
"}",
"int",
"c... | Computes the UPC/EAN checksum on a string of digits, and reports
whether the checksum is correct or not.
@param s string of digits to check
@return true iff string of digits passes the UPC/EAN checksum algorithm
@throws FormatException if the string does not contain only digits | [
"Computes",
"the",
"UPC",
"/",
"EAN",
"checksum",
"on",
"a",
"string",
"of",
"digits",
"and",
"reports",
"whether",
"the",
"checksum",
"is",
"correct",
"or",
"not",
"."
] | train | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/UPCEANReader.java#L263-L270 |
google/flatbuffers | java/com/google/flatbuffers/Table.java | Table.compareStrings | protected static int compareStrings(int offset_1, byte[] key, ByteBuffer bb) {
"""
Compare string from the buffer with the 'String' object.
@param offset_1 An 'int' index of the first string into the bb.
@param key Second string as a byte array.
@param bb A {@code ByteBuffer} to get the first string.
"""
... | java | protected static int compareStrings(int offset_1, byte[] key, ByteBuffer bb) {
offset_1 += bb.getInt(offset_1);
int len_1 = bb.getInt(offset_1);
int len_2 = key.length;
int startPos_1 = offset_1 + Constants.SIZEOF_INT;
int len = Math.min(len_1, len_2);
for (int i = 0; i < len; i++) {
if (b... | [
"protected",
"static",
"int",
"compareStrings",
"(",
"int",
"offset_1",
",",
"byte",
"[",
"]",
"key",
",",
"ByteBuffer",
"bb",
")",
"{",
"offset_1",
"+=",
"bb",
".",
"getInt",
"(",
"offset_1",
")",
";",
"int",
"len_1",
"=",
"bb",
".",
"getInt",
"(",
... | Compare string from the buffer with the 'String' object.
@param offset_1 An 'int' index of the first string into the bb.
@param key Second string as a byte array.
@param bb A {@code ByteBuffer} to get the first string. | [
"Compare",
"string",
"from",
"the",
"buffer",
"with",
"the",
"String",
"object",
"."
] | train | https://github.com/google/flatbuffers/blob/6cc30b3272d79c85db7d4871ac0aa69541dc89de/java/com/google/flatbuffers/Table.java#L253-L264 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/Record.java | Record.addSelectParams | public String addSelectParams(String seekSign, int areaDesc, boolean bAddOnlyMods, boolean bIncludeFileName, boolean bUseCurrentValues, Vector<BaseField> vParamList, boolean bForceUniqueKey, boolean bIncludeTempFields) {
"""
Setup the SQL Key Filter.
(ie., 'WHERE ID=10')
@param seekSign The seek sign.
@param bA... | java | public String addSelectParams(String seekSign, int areaDesc, boolean bAddOnlyMods, boolean bIncludeFileName, boolean bUseCurrentValues, Vector<BaseField> vParamList, boolean bForceUniqueKey, boolean bIncludeTempFields)
{
String sFilter = DBConstants.BLANK;
KeyArea keyArea = this.getKeyArea(-1);
... | [
"public",
"String",
"addSelectParams",
"(",
"String",
"seekSign",
",",
"int",
"areaDesc",
",",
"boolean",
"bAddOnlyMods",
",",
"boolean",
"bIncludeFileName",
",",
"boolean",
"bUseCurrentValues",
",",
"Vector",
"<",
"BaseField",
">",
"vParamList",
",",
"boolean",
"... | Setup the SQL Key Filter.
(ie., 'WHERE ID=10')
@param seekSign The seek sign.
@param bAddOnlyMods Add only the keys which have modified?
@param bIncludeFileName Include the file name in the string?
@param bUseCurrentValues Use current values?
@param vParamList The parameter list.
@param bForceUniqueKey If params must b... | [
"Setup",
"the",
"SQL",
"Key",
"Filter",
".",
"(",
"ie",
".",
"WHERE",
"ID",
"=",
"10",
")"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/Record.java#L1313-L1320 |
killbilling/recurly-java-library | src/main/java/com/ning/billing/recurly/RecurlyClient.java | RecurlyClient.pauseSubscription | public Subscription pauseSubscription(final String subscriptionUuid, final int remainingPauseCycles) {
"""
Pause a subscription or cancel a scheduled pause on a subscription.
<p>
* For an active subscription without a pause scheduled already, this will
schedule a pause period to begin at the next renewal date f... | java | public Subscription pauseSubscription(final String subscriptionUuid, final int remainingPauseCycles) {
Subscription request = new Subscription();
request.setRemainingPauseCycles(remainingPauseCycles);
return doPUT(Subscription.SUBSCRIPTION_RESOURCE + "/" + subscriptionUuid + "/pause",
... | [
"public",
"Subscription",
"pauseSubscription",
"(",
"final",
"String",
"subscriptionUuid",
",",
"final",
"int",
"remainingPauseCycles",
")",
"{",
"Subscription",
"request",
"=",
"new",
"Subscription",
"(",
")",
";",
"request",
".",
"setRemainingPauseCycles",
"(",
"r... | Pause a subscription or cancel a scheduled pause on a subscription.
<p>
* For an active subscription without a pause scheduled already, this will
schedule a pause period to begin at the next renewal date for the specified
number of billing cycles (remaining_pause_cycles).
* When a scheduled pause already exists, this w... | [
"Pause",
"a",
"subscription",
"or",
"cancel",
"a",
"scheduled",
"pause",
"on",
"a",
"subscription",
".",
"<p",
">",
"*",
"For",
"an",
"active",
"subscription",
"without",
"a",
"pause",
"scheduled",
"already",
"this",
"will",
"schedule",
"a",
"pause",
"period... | train | https://github.com/killbilling/recurly-java-library/blob/5e05eedd91885a51e1aa8293bd41139d082cf7f4/src/main/java/com/ning/billing/recurly/RecurlyClient.java#L520-L525 |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/extension/builtin/IncludeExcludeExtension.java | IncludeExcludeExtension.handleFeatureIncludes | private void handleFeatureIncludes(SpecInfo spec, IncludeExcludeCriteria criteria) {
"""
in contrast to the three other handleXXX methods, this one includes nodes
"""
if (criteria.isEmpty()) return;
for (FeatureInfo feature : spec.getAllFeatures())
if (hasAnyAnnotation(feature.getFeatureMethod()... | java | private void handleFeatureIncludes(SpecInfo spec, IncludeExcludeCriteria criteria) {
if (criteria.isEmpty()) return;
for (FeatureInfo feature : spec.getAllFeatures())
if (hasAnyAnnotation(feature.getFeatureMethod(), criteria.annotations))
feature.setExcluded(false);
} | [
"private",
"void",
"handleFeatureIncludes",
"(",
"SpecInfo",
"spec",
",",
"IncludeExcludeCriteria",
"criteria",
")",
"{",
"if",
"(",
"criteria",
".",
"isEmpty",
"(",
")",
")",
"return",
";",
"for",
"(",
"FeatureInfo",
"feature",
":",
"spec",
".",
"getAllFeatur... | in contrast to the three other handleXXX methods, this one includes nodes | [
"in",
"contrast",
"to",
"the",
"three",
"other",
"handleXXX",
"methods",
"this",
"one",
"includes",
"nodes"
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/extension/builtin/IncludeExcludeExtension.java#L58-L64 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFileVersionRetention.java | BoxFileVersionRetention.getRetentions | public static Iterable<BoxFileVersionRetention.Info> getRetentions(
final BoxAPIConnection api, QueryFilter filter, String ... fields) {
"""
Retrieves all file version retentions matching given filters as an Iterable.
@param api the API connection to be used by the resource.
@param filter filters for... | java | public static Iterable<BoxFileVersionRetention.Info> getRetentions(
final BoxAPIConnection api, QueryFilter filter, String ... fields) {
filter.addFields(fields);
return new BoxResourceIterable<BoxFileVersionRetention.Info>(api,
ALL_RETENTIONS_URL_TEMPLATE.buildWithQuery(api.... | [
"public",
"static",
"Iterable",
"<",
"BoxFileVersionRetention",
".",
"Info",
">",
"getRetentions",
"(",
"final",
"BoxAPIConnection",
"api",
",",
"QueryFilter",
"filter",
",",
"String",
"...",
"fields",
")",
"{",
"filter",
".",
"addFields",
"(",
"fields",
")",
... | Retrieves all file version retentions matching given filters as an Iterable.
@param api the API connection to be used by the resource.
@param filter filters for the query stored in QueryFilter object.
@param fields the fields to retrieve.
@return an iterable contains information about all file version retentions matchi... | [
"Retrieves",
"all",
"file",
"version",
"retentions",
"matching",
"given",
"filters",
"as",
"an",
"Iterable",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFileVersionRetention.java#L83-L96 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java | FindbugsPlugin.storeBugCollection | public static void storeBugCollection(IProject project, final SortedBugCollection bugCollection, IProgressMonitor monitor)
throws IOException, CoreException {
"""
Store a new bug collection for a project. The collection is stored in the
session, and also in a file in the project.
@param project
th... | java | public static void storeBugCollection(IProject project, final SortedBugCollection bugCollection, IProgressMonitor monitor)
throws IOException, CoreException {
// Store the bug collection and findbugs project in the session
project.setSessionProperty(SESSION_PROPERTY_BUG_COLLECTION, bugColle... | [
"public",
"static",
"void",
"storeBugCollection",
"(",
"IProject",
"project",
",",
"final",
"SortedBugCollection",
"bugCollection",
",",
"IProgressMonitor",
"monitor",
")",
"throws",
"IOException",
",",
"CoreException",
"{",
"// Store the bug collection and findbugs project i... | Store a new bug collection for a project. The collection is stored in the
session, and also in a file in the project.
@param project
the project
@param bugCollection
the bug collection
@param monitor
progress monitor
@throws IOException
@throws CoreException | [
"Store",
"a",
"new",
"bug",
"collection",
"for",
"a",
"project",
".",
"The",
"collection",
"is",
"stored",
"in",
"the",
"session",
"and",
"also",
"in",
"a",
"file",
"in",
"the",
"project",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/FindbugsPlugin.java#L744-L753 |
datasalt/pangool | core/src/main/java/com/datasalt/pangool/utils/InstancesDistributor.java | InstancesDistributor.locateFileInCache | private static Path locateFileInCache(Configuration conf, String filename) throws IOException {
"""
Locates a file in the temporal folder
@param conf
The Hadoop Configuration.
@param filename
The file name.
@throws IOException
"""
return new Path(getInstancesFolder(FileSystem.get(conf), conf), filen... | java | private static Path locateFileInCache(Configuration conf, String filename) throws IOException {
return new Path(getInstancesFolder(FileSystem.get(conf), conf), filename);
} | [
"private",
"static",
"Path",
"locateFileInCache",
"(",
"Configuration",
"conf",
",",
"String",
"filename",
")",
"throws",
"IOException",
"{",
"return",
"new",
"Path",
"(",
"getInstancesFolder",
"(",
"FileSystem",
".",
"get",
"(",
"conf",
")",
",",
"conf",
")",... | Locates a file in the temporal folder
@param conf
The Hadoop Configuration.
@param filename
The file name.
@throws IOException | [
"Locates",
"a",
"file",
"in",
"the",
"temporal",
"folder"
] | train | https://github.com/datasalt/pangool/blob/bfd312dd78cba03febaf7988ae96a3d4bc585408/core/src/main/java/com/datasalt/pangool/utils/InstancesDistributor.java#L149-L151 |
tvesalainen/lpg | src/main/java/org/vesalainen/grammar/state/NFAState.java | NFAState.hasTransitionTo | public boolean hasTransitionTo(CharRange condition, NFAState<T> state) {
"""
Returns true if transition with condition to state exists
@param condition
@param state
@return
"""
Set<Transition<NFAState<T>>> set = transitions.get(condition);
if (set != null)
{
for (Tran... | java | public boolean hasTransitionTo(CharRange condition, NFAState<T> state)
{
Set<Transition<NFAState<T>>> set = transitions.get(condition);
if (set != null)
{
for (Transition<NFAState<T>> tr : set)
{
if (state.equals(tr.getTo()))
{
... | [
"public",
"boolean",
"hasTransitionTo",
"(",
"CharRange",
"condition",
",",
"NFAState",
"<",
"T",
">",
"state",
")",
"{",
"Set",
"<",
"Transition",
"<",
"NFAState",
"<",
"T",
">>>",
"set",
"=",
"transitions",
".",
"get",
"(",
"condition",
")",
";",
"if",... | Returns true if transition with condition to state exists
@param condition
@param state
@return | [
"Returns",
"true",
"if",
"transition",
"with",
"condition",
"to",
"state",
"exists"
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/grammar/state/NFAState.java#L126-L140 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java | TrifocalExtractGeometries.setTensor | public void setTensor( TrifocalTensor tensor ) {
"""
Specifies the input tensor. The epipoles are immediately extracted since they
are needed to extract all other data structures
@param tensor The tensor. Reference is saved but not modified
"""
this.tensor = tensor;
if( !svd.decompose(tensor.T1) )
t... | java | public void setTensor( TrifocalTensor tensor ) {
this.tensor = tensor;
if( !svd.decompose(tensor.T1) )
throw new RuntimeException("SVD failed?!");
SingularOps_DDRM.nullVector(svd, true, v1);
SingularOps_DDRM.nullVector(svd, false,u1);
// DMatrixRMaj zero = new DMatrixRMaj(3,1);
// CommonOps_DDRM.mult(ten... | [
"public",
"void",
"setTensor",
"(",
"TrifocalTensor",
"tensor",
")",
"{",
"this",
".",
"tensor",
"=",
"tensor",
";",
"if",
"(",
"!",
"svd",
".",
"decompose",
"(",
"tensor",
".",
"T1",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
"\"SVD failed?!\"",
... | Specifies the input tensor. The epipoles are immediately extracted since they
are needed to extract all other data structures
@param tensor The tensor. Reference is saved but not modified | [
"Specifies",
"the",
"input",
"tensor",
".",
"The",
"epipoles",
"are",
"immediately",
"extracted",
"since",
"they",
"are",
"needed",
"to",
"extract",
"all",
"other",
"data",
"structures"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/trifocal/TrifocalExtractGeometries.java#L92-L135 |
opsgenie/opsgenieclient | sdk/src/main/java/com/ifountain/opsgenie/client/rest/RestApiRequest.java | RestApiRequest.convertObject | private <T> T convertObject(byte[] json, Class<T> claz) throws IOException {
"""
Map is used for generic deserialization (jackson returns LinkedHashMap by default when
generic type is used)
"""
TypeReference<RestSuccessResult<Map<?, ?>>> typeReference = new TypeReference<RestSuccessResult<Map<?, ?>>>(... | java | private <T> T convertObject(byte[] json, Class<T> claz) throws IOException {
TypeReference<RestSuccessResult<Map<?, ?>>> typeReference = new TypeReference<RestSuccessResult<Map<?, ?>>>() {
};
RestSuccessResult<T> successResponse = MAPPER.readValue(json, typeReference);
Map<?, ?> data = (... | [
"private",
"<",
"T",
">",
"T",
"convertObject",
"(",
"byte",
"[",
"]",
"json",
",",
"Class",
"<",
"T",
">",
"claz",
")",
"throws",
"IOException",
"{",
"TypeReference",
"<",
"RestSuccessResult",
"<",
"Map",
"<",
"?",
",",
"?",
">",
">",
">",
"typeRefe... | Map is used for generic deserialization (jackson returns LinkedHashMap by default when
generic type is used) | [
"Map",
"is",
"used",
"for",
"generic",
"deserialization",
"(",
"jackson",
"returns",
"LinkedHashMap",
"by",
"default",
"when",
"generic",
"type",
"is",
"used",
")"
] | train | https://github.com/opsgenie/opsgenieclient/blob/6d94efb16bbc74be189c86e9329af510ac8a048c/sdk/src/main/java/com/ifountain/opsgenie/client/rest/RestApiRequest.java#L207-L213 |
line/armeria | core/src/main/java/com/linecorp/armeria/server/AbstractHttpService.java | AbstractHttpService.doPatch | @Deprecated
protected void doPatch(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res)
throws Exception {
"""
Handles an {@link HttpMethod#PATCH PATCH} request.
This method sends a {@link HttpStatus#METHOD_NOT_ALLOWED 405 Method Not Allowed} response by default.
@deprecated Use ... | java | @Deprecated
protected void doPatch(ServiceRequestContext ctx, HttpRequest req, HttpResponseWriter res)
throws Exception {
res.respond(HttpStatus.METHOD_NOT_ALLOWED);
} | [
"@",
"Deprecated",
"protected",
"void",
"doPatch",
"(",
"ServiceRequestContext",
"ctx",
",",
"HttpRequest",
"req",
",",
"HttpResponseWriter",
"res",
")",
"throws",
"Exception",
"{",
"res",
".",
"respond",
"(",
"HttpStatus",
".",
"METHOD_NOT_ALLOWED",
")",
";",
"... | Handles an {@link HttpMethod#PATCH PATCH} request.
This method sends a {@link HttpStatus#METHOD_NOT_ALLOWED 405 Method Not Allowed} response by default.
@deprecated Use {@link #doPatch(ServiceRequestContext, HttpRequest)}. | [
"Handles",
"an",
"{",
"@link",
"HttpMethod#PATCH",
"PATCH",
"}",
"request",
".",
"This",
"method",
"sends",
"a",
"{",
"@link",
"HttpStatus#METHOD_NOT_ALLOWED",
"405",
"Method",
"Not",
"Allowed",
"}",
"response",
"by",
"default",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/AbstractHttpService.java#L228-L232 |
structr/structr | structr-ui/src/main/java/org/structr/web/importer/Importer.java | Importer.fileExists | private File fileExists(final String path, final long checksum) throws FrameworkException {
"""
Check whether a file with given path and checksum already exists
"""
final PropertyKey<Long> checksumKey = StructrApp.key(File.class, "checksum");
final PropertyKey<String> pathKey = StructrApp.key(File.class... | java | private File fileExists(final String path, final long checksum) throws FrameworkException {
final PropertyKey<Long> checksumKey = StructrApp.key(File.class, "checksum");
final PropertyKey<String> pathKey = StructrApp.key(File.class, "path");
return app.nodeQuery(File.class).and(pathKey, path).and(checksumKey,... | [
"private",
"File",
"fileExists",
"(",
"final",
"String",
"path",
",",
"final",
"long",
"checksum",
")",
"throws",
"FrameworkException",
"{",
"final",
"PropertyKey",
"<",
"Long",
">",
"checksumKey",
"=",
"StructrApp",
".",
"key",
"(",
"File",
".",
"class",
",... | Check whether a file with given path and checksum already exists | [
"Check",
"whether",
"a",
"file",
"with",
"given",
"path",
"and",
"checksum",
"already",
"exists"
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-ui/src/main/java/org/structr/web/importer/Importer.java#L1071-L1077 |
osglworks/java-tool | src/main/java/org/osgl/Lang.java | F2.andThen | public F2<P1, P2, R> andThen(final Func2<? super P1, ? super P2, ? extends R>... fs) {
"""
Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
throws an exception, it is relayed to the caller of the composed function.
I... | java | public F2<P1, P2, R> andThen(final Func2<? super P1, ? super P2, ? extends R>... fs) {
if (0 == fs.length) {
return this;
}
final Func2<P1, P2, R> me = this;
return new F2<P1, P2, R>() {
@Override
public R apply(P1 p1, P2 p2... | [
"public",
"F2",
"<",
"P1",
",",
"P2",
",",
"R",
">",
"andThen",
"(",
"final",
"Func2",
"<",
"?",
"super",
"P1",
",",
"?",
"super",
"P2",
",",
"?",
"extends",
"R",
">",
"...",
"fs",
")",
"{",
"if",
"(",
"0",
"==",
"fs",
".",
"length",
")",
"... | Returns a composed function that applied, in sequence, this function and
all functions specified one by one. If applying anyone of the functions
throws an exception, it is relayed to the caller of the composed function.
If an exception is thrown out, the following functions will not be applied.
<p>When apply the compos... | [
"Returns",
"a",
"composed",
"function",
"that",
"applied",
"in",
"sequence",
"this",
"function",
"and",
"all",
"functions",
"specified",
"one",
"by",
"one",
".",
"If",
"applying",
"anyone",
"of",
"the",
"functions",
"throws",
"an",
"exception",
"it",
"is",
"... | train | https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/Lang.java#L1012-L1027 |
apache/incubator-heron | heron/schedulers/src/java/org/apache/heron/scheduler/mesos/framework/MesosFramework.java | MesosFramework.waitForRegistered | public boolean waitForRegistered(long timeout, TimeUnit unit) {
"""
Causes the current thread to wait for MesosFramework got registered,
unless the thread is interrupted, or the specified waiting time elapses.
@param timeout the maximum time to wait
@param unit the time unit of the timeout argument
@return t... | java | public boolean waitForRegistered(long timeout, TimeUnit unit) {
try {
if (this.registeredLatch.await(timeout, unit)) {
return true;
}
} catch (InterruptedException e) {
LOG.severe("Failed to wait for mesos framework got registered");
return false;
}
return false;
} | [
"public",
"boolean",
"waitForRegistered",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"try",
"{",
"if",
"(",
"this",
".",
"registeredLatch",
".",
"await",
"(",
"timeout",
",",
"unit",
")",
")",
"{",
"return",
"true",
";",
"}",
"}",
"catc... | Causes the current thread to wait for MesosFramework got registered,
unless the thread is interrupted, or the specified waiting time elapses.
@param timeout the maximum time to wait
@param unit the time unit of the timeout argument
@return true MesosFramework got registered,
and false if the waiting time elapsed befor... | [
"Causes",
"the",
"current",
"thread",
"to",
"wait",
"for",
"MesosFramework",
"got",
"registered",
"unless",
"the",
"thread",
"is",
"interrupted",
"or",
"the",
"specified",
"waiting",
"time",
"elapses",
"."
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/schedulers/src/java/org/apache/heron/scheduler/mesos/framework/MesosFramework.java#L186-L197 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.