repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.toHexString | public static String toHexString(byte[] raw) {
byte[] hex = new byte[2 * raw.length];
int index = 0;
for (byte b : raw) {
int v = b & 0x00ff;
hex[index++] = HEX_CHARS[v >>> 4];
hex[index++] = HEX_CHARS[v & 0xf];
}
try {
return new S... | java | public static String toHexString(byte[] raw) {
byte[] hex = new byte[2 * raw.length];
int index = 0;
for (byte b : raw) {
int v = b & 0x00ff;
hex[index++] = HEX_CHARS[v >>> 4];
hex[index++] = HEX_CHARS[v & 0xf];
}
try {
return new S... | [
"public",
"static",
"String",
"toHexString",
"(",
"byte",
"[",
"]",
"raw",
")",
"{",
"byte",
"[",
"]",
"hex",
"=",
"new",
"byte",
"[",
"2",
"*",
"raw",
".",
"length",
"]",
";",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"byte",
"b",
":",
"raw",... | Converts an array of bytes into a hexadecimal representation.
This implementation is significantly faster than DatatypeConverter.printHexBinary().
@param raw the byte array to convert to a hexadecimal String
@return a hexadecimal String representing the bytes | [
"Converts",
"an",
"array",
"of",
"bytes",
"into",
"a",
"hexadecimal",
"representation",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L32-L45 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.toCamelCase | public static String toCamelCase(String text, char separator, boolean strict) {
char[] chars = text.toCharArray();
int base = 0, top = 0;
while (top < chars.length) {
while (top < chars.length && chars[top] == separator) {
++top;
}
if (top < c... | java | public static String toCamelCase(String text, char separator, boolean strict) {
char[] chars = text.toCharArray();
int base = 0, top = 0;
while (top < chars.length) {
while (top < chars.length && chars[top] == separator) {
++top;
}
if (top < c... | [
"public",
"static",
"String",
"toCamelCase",
"(",
"String",
"text",
",",
"char",
"separator",
",",
"boolean",
"strict",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"text",
".",
"toCharArray",
"(",
")",
";",
"int",
"base",
"=",
"0",
",",
"top",
"=",
"0"... | Converts a word sequence into a single camel-case sequence.
@param text - a word sequence with the given separator
@param separator - a word separator
@param strict - if true, all letters following the first are forced into lower case in each word
@return a single camel-case word | [
"Converts",
"a",
"word",
"sequence",
"into",
"a",
"single",
"camel",
"-",
"case",
"sequence",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L76-L99 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.toLowerCamelCase | public static String toLowerCamelCase(String text, char separator) {
char[] chars = text.toCharArray();
int base = 0, top = 0;
do {
while (top < chars.length && chars[top] != separator) {
chars[base++] = Character.toLowerCase(chars[top++]);
}
... | java | public static String toLowerCamelCase(String text, char separator) {
char[] chars = text.toCharArray();
int base = 0, top = 0;
do {
while (top < chars.length && chars[top] != separator) {
chars[base++] = Character.toLowerCase(chars[top++]);
}
... | [
"public",
"static",
"String",
"toLowerCamelCase",
"(",
"String",
"text",
",",
"char",
"separator",
")",
"{",
"char",
"[",
"]",
"chars",
"=",
"text",
".",
"toCharArray",
"(",
")",
";",
"int",
"base",
"=",
"0",
",",
"top",
"=",
"0",
";",
"do",
"{",
"... | Converts a word sequence into a single camel-case word that starts with a lowercase letter.
@param text - a word sequence with the given separator
@param separator - a word separator
@return a single camel-case word | [
"Converts",
"a",
"word",
"sequence",
"into",
"a",
"single",
"camel",
"-",
"case",
"word",
"that",
"starts",
"with",
"a",
"lowercase",
"letter",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L108-L125 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.splitCamelCase | public static String splitCamelCase(String text, String separator) {
return CAMEL_REGEX.matcher(text).replaceAll(separator);
} | java | public static String splitCamelCase(String text, String separator) {
return CAMEL_REGEX.matcher(text).replaceAll(separator);
} | [
"public",
"static",
"String",
"splitCamelCase",
"(",
"String",
"text",
",",
"String",
"separator",
")",
"{",
"return",
"CAMEL_REGEX",
".",
"matcher",
"(",
"text",
")",
".",
"replaceAll",
"(",
"separator",
")",
";",
"}"
] | Splits a single camel-case word into a word sequence.
@param text - a single camel-case word
@param separator - a word separator
@return a word sequence with each word separated by the given separator | [
"Splits",
"a",
"single",
"camel",
"-",
"case",
"word",
"into",
"a",
"word",
"sequence",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L138-L140 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.hash | public static String hash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
return Strings.toHexString(MessageDigest.getInstance("SHA").digest(text.getBytes("UTF-8")));
} | java | public static String hash(String text) throws NoSuchAlgorithmException, UnsupportedEncodingException {
return Strings.toHexString(MessageDigest.getInstance("SHA").digest(text.getBytes("UTF-8")));
} | [
"public",
"static",
"String",
"hash",
"(",
"String",
"text",
")",
"throws",
"NoSuchAlgorithmException",
",",
"UnsupportedEncodingException",
"{",
"return",
"Strings",
".",
"toHexString",
"(",
"MessageDigest",
".",
"getInstance",
"(",
"\"SHA\"",
")",
".",
"digest",
... | Generates a secure hash from a given text.
@param text - any text string
@return the SHA-1 hash as a hexadecimal string
@throws NoSuchAlgorithmException if the Java platform does not support SHA-1 algorithm
@throws UnsupportedEncodingException if the Java platform does not support UTF-8 encoding | [
"Generates",
"a",
"secure",
"hash",
"from",
"a",
"given",
"text",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L162-L164 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.extend | public static String extend(String text, char filler, int length) {
if (text.length() < length) {
char[] buffer = new char[length];
Arrays.fill(buffer, 0, length, filler);
System.arraycopy(text.toCharArray(), 0, buffer, 0, text.length());
return new String(buffer)... | java | public static String extend(String text, char filler, int length) {
if (text.length() < length) {
char[] buffer = new char[length];
Arrays.fill(buffer, 0, length, filler);
System.arraycopy(text.toCharArray(), 0, buffer, 0, text.length());
return new String(buffer)... | [
"public",
"static",
"String",
"extend",
"(",
"String",
"text",
",",
"char",
"filler",
",",
"int",
"length",
")",
"{",
"if",
"(",
"text",
".",
"length",
"(",
")",
"<",
"length",
")",
"{",
"char",
"[",
"]",
"buffer",
"=",
"new",
"char",
"[",
"length"... | Extends a string to have at least the given length. If the original string is already as long, it is returned
without modification.
@param text - a text string
@param filler - the filler character
@param length - the specified length
@return the extended string | [
"Extends",
"a",
"string",
"to",
"have",
"at",
"least",
"the",
"given",
"length",
".",
"If",
"the",
"original",
"string",
"is",
"already",
"as",
"long",
"it",
"is",
"returned",
"without",
"modification",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L175-L184 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.substringBefore | public static String substringBefore(String text, char stopper) {
int p = text.indexOf(stopper);
return p < 0 ? text : text.substring(0, p);
} | java | public static String substringBefore(String text, char stopper) {
int p = text.indexOf(stopper);
return p < 0 ? text : text.substring(0, p);
} | [
"public",
"static",
"String",
"substringBefore",
"(",
"String",
"text",
",",
"char",
"stopper",
")",
"{",
"int",
"p",
"=",
"text",
".",
"indexOf",
"(",
"stopper",
")",
";",
"return",
"p",
"<",
"0",
"?",
"text",
":",
"text",
".",
"substring",
"(",
"0"... | Returns a substring from position 0 up to just before the stopper character.
@param text - a text string
@param stopper - a stopper character
@return the substring | [
"Returns",
"a",
"substring",
"from",
"position",
"0",
"up",
"to",
"just",
"before",
"the",
"stopper",
"character",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L193-L196 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.substringAfter | public static String substringAfter(String text, char match) {
return text.substring(text.indexOf(match)+1);
} | java | public static String substringAfter(String text, char match) {
return text.substring(text.indexOf(match)+1);
} | [
"public",
"static",
"String",
"substringAfter",
"(",
"String",
"text",
",",
"char",
"match",
")",
"{",
"return",
"text",
".",
"substring",
"(",
"text",
".",
"indexOf",
"(",
"match",
")",
"+",
"1",
")",
";",
"}"
] | Returns the substring following a given character, or the original if the character is not found.
@param text - a text string
@param match - a match character
@return the substring | [
"Returns",
"the",
"substring",
"following",
"a",
"given",
"character",
"or",
"the",
"original",
"if",
"the",
"character",
"is",
"not",
"found",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L205-L207 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.join | public static String join(Object array, char separator, Object... pieces) {
StringBuilder sb = new StringBuilder();
for (int i = 0, ii = Array.getLength(array); i < ii; ++i) {
Object element = Array.get(array, i);
sb.append(element != null ? element.toString() : "null").append(se... | java | public static String join(Object array, char separator, Object... pieces) {
StringBuilder sb = new StringBuilder();
for (int i = 0, ii = Array.getLength(array); i < ii; ++i) {
Object element = Array.get(array, i);
sb.append(element != null ? element.toString() : "null").append(se... | [
"public",
"static",
"String",
"join",
"(",
"Object",
"array",
",",
"char",
"separator",
",",
"Object",
"...",
"pieces",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
",",
"ii",
"=",
"Ar... | Concatenates elements in an array into a single String, with elements separated by the given separator.
@param array - an array
@param separator - a separator character
@return the string from joining elements in the array | [
"Concatenates",
"elements",
"in",
"an",
"array",
"into",
"a",
"single",
"String",
"with",
"elements",
"separated",
"by",
"the",
"given",
"separator",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L347-L358 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.join | public static <T> String join(Iterable<T> iterable, char separator, T... pieces) {
StringBuilder sb = new StringBuilder();
for (T element: iterable) {
sb.append(element != null ? element.toString() : "null").append(separator);
}
for (int i = 0; i < pieces.length; ++i) {
... | java | public static <T> String join(Iterable<T> iterable, char separator, T... pieces) {
StringBuilder sb = new StringBuilder();
for (T element: iterable) {
sb.append(element != null ? element.toString() : "null").append(separator);
}
for (int i = 0; i < pieces.length; ++i) {
... | [
"public",
"static",
"<",
"T",
">",
"String",
"join",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"char",
"separator",
",",
"T",
"...",
"pieces",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"for",
"(",
"T",
"eleme... | Concatenates elements in an Iterable into a single String, with elements separated by the given separator.
@param <T> - the type of the elements in the iterable
@param iterable - an iterable
@param separator - a separator character
@return the string from joining elements in the iterable | [
"Concatenates",
"elements",
"in",
"an",
"Iterable",
"into",
"a",
"single",
"String",
"with",
"elements",
"separated",
"by",
"the",
"given",
"separator",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L368-L378 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/Types.java | Types.rawClassOf | public static Class<?> rawClassOf(Type type) {
if (type instanceof Class<?>) {
return (Class<?>) type;
} else if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
Type rawType = parameterizedType.getRawType();
... | java | public static Class<?> rawClassOf(Type type) {
if (type instanceof Class<?>) {
return (Class<?>) type;
} else if (type instanceof ParameterizedType) {
ParameterizedType parameterizedType = (ParameterizedType) type;
Type rawType = parameterizedType.getRawType();
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"rawClassOf",
"(",
"Type",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
"<",
"?",
">",
")",
"{",
"return",
"(",
"Class",
"<",
"?",
">",
")",
"type",
";",
"}",
"else",
"if",
"(",
"type",
... | Returns the raw class of the specified type.
@param type the type.
@return the raw class. | [
"Returns",
"the",
"raw",
"class",
"of",
"the",
"specified",
"type",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/Types.java#L41-L56 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ClassPredicates.java | ClassPredicates.classIs | public static Predicate<Class<?>> classIs(final Class<?> reference) {
return candidate -> candidate != null && candidate.equals(reference);
} | java | public static Predicate<Class<?>> classIs(final Class<?> reference) {
return candidate -> candidate != null && candidate.equals(reference);
} | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"classIs",
"(",
"final",
"Class",
"<",
"?",
">",
"reference",
")",
"{",
"return",
"candidate",
"->",
"candidate",
"!=",
"null",
"&&",
"candidate",
".",
"equals",
"(",
"reference",
")",
... | Checks if a candidate class is equal to the specified class.
@param reference the class to check for.
@return the predicate. | [
"Checks",
"if",
"a",
"candidate",
"class",
"is",
"equal",
"to",
"the",
"specified",
"class",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ClassPredicates.java#L25-L27 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ClassPredicates.java | ClassPredicates.classIsAssignableFrom | public static Predicate<Class<?>> classIsAssignableFrom(Class<?> ancestor) {
return candidate -> candidate != null && ancestor.isAssignableFrom(candidate);
} | java | public static Predicate<Class<?>> classIsAssignableFrom(Class<?> ancestor) {
return candidate -> candidate != null && ancestor.isAssignableFrom(candidate);
} | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"classIsAssignableFrom",
"(",
"Class",
"<",
"?",
">",
"ancestor",
")",
"{",
"return",
"candidate",
"->",
"candidate",
"!=",
"null",
"&&",
"ancestor",
".",
"isAssignableFrom",
"(",
"candidate"... | Check if a candidate class is assignable to the specified class.
@param ancestor the class to check for.
@return the predicate. | [
"Check",
"if",
"a",
"candidate",
"class",
"is",
"assignable",
"to",
"the",
"specified",
"class",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ClassPredicates.java#L35-L37 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ClassPredicates.java | ClassPredicates.classImplements | public static Predicate<Class<?>> classImplements(Class<?> anInterface) {
if (!anInterface.isInterface()) {
throw new IllegalArgumentException("Class " + anInterface.getName() + " is not an interface");
}
return candidate -> candidate != null && !candidate.isInterface() && anInterfac... | java | public static Predicate<Class<?>> classImplements(Class<?> anInterface) {
if (!anInterface.isInterface()) {
throw new IllegalArgumentException("Class " + anInterface.getName() + " is not an interface");
}
return candidate -> candidate != null && !candidate.isInterface() && anInterfac... | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"classImplements",
"(",
"Class",
"<",
"?",
">",
"anInterface",
")",
"{",
"if",
"(",
"!",
"anInterface",
".",
"isInterface",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
... | Checks if a candidate class is an interface.
@return the predicate. | [
"Checks",
"if",
"a",
"candidate",
"class",
"is",
"an",
"interface",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ClassPredicates.java#L56-L62 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ClassPredicates.java | ClassPredicates.executableModifierIs | public static <T extends Executable> Predicate<T> executableModifierIs(final int modifier) {
return candidate -> (candidate.getModifiers() & modifier) != 0;
} | java | public static <T extends Executable> Predicate<T> executableModifierIs(final int modifier) {
return candidate -> (candidate.getModifiers() & modifier) != 0;
} | [
"public",
"static",
"<",
"T",
"extends",
"Executable",
">",
"Predicate",
"<",
"T",
">",
"executableModifierIs",
"(",
"final",
"int",
"modifier",
")",
"{",
"return",
"candidate",
"->",
"(",
"candidate",
".",
"getModifiers",
"(",
")",
"&",
"modifier",
")",
"... | Checks if a candidate class has the specified modifier.
@param modifier the modifier to check for.
@return the predicate. | [
"Checks",
"if",
"a",
"candidate",
"class",
"has",
"the",
"specified",
"modifier",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ClassPredicates.java#L98-L100 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/ClassPredicates.java | ClassPredicates.atLeastOneConstructorIsPublic | public static Predicate<Class<?>> atLeastOneConstructorIsPublic() {
return candidate -> candidate != null && Classes.from(candidate)
.constructors()
.anyMatch(executableModifierIs(Modifier.PUBLIC));
} | java | public static Predicate<Class<?>> atLeastOneConstructorIsPublic() {
return candidate -> candidate != null && Classes.from(candidate)
.constructors()
.anyMatch(executableModifierIs(Modifier.PUBLIC));
} | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"atLeastOneConstructorIsPublic",
"(",
")",
"{",
"return",
"candidate",
"->",
"candidate",
"!=",
"null",
"&&",
"Classes",
".",
"from",
"(",
"candidate",
")",
".",
"constructors",
"(",
")",
"... | Checks if a candidate class has at least one public constructor.
@return the predicate. | [
"Checks",
"if",
"a",
"candidate",
"class",
"has",
"at",
"least",
"one",
"public",
"constructor",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/ClassPredicates.java#L116-L120 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/Workbook.java | Workbook.getOffset | protected int getOffset(long dt)
{
int ret = 0;
TimeZone tz = DateUtilities.getCurrentTimeZone();
if(tz != null)
ret = tz.getOffset(dt);
return ret;
} | java | protected int getOffset(long dt)
{
int ret = 0;
TimeZone tz = DateUtilities.getCurrentTimeZone();
if(tz != null)
ret = tz.getOffset(dt);
return ret;
} | [
"protected",
"int",
"getOffset",
"(",
"long",
"dt",
")",
"{",
"int",
"ret",
"=",
"0",
";",
"TimeZone",
"tz",
"=",
"DateUtilities",
".",
"getCurrentTimeZone",
"(",
")",
";",
"if",
"(",
"tz",
"!=",
"null",
")",
"ret",
"=",
"tz",
".",
"getOffset",
"(",
... | Returns the current offset for the given date allowing for daylight savings.
@param dt The date to be checked
@return The current offset for the given date allowing for daylight savings | [
"Returns",
"the",
"current",
"offset",
"for",
"the",
"given",
"date",
"allowing",
"for",
"daylight",
"savings",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/Workbook.java#L189-L196 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java | Util.isDeprecated | public static boolean isDeprecated(Doc doc) {
if (doc.tags("deprecated").length > 0) {
return true;
}
AnnotationDesc[] annotationDescList;
if (doc instanceof PackageDoc)
annotationDescList = ((PackageDoc)doc).annotations();
else
annotationDescL... | java | public static boolean isDeprecated(Doc doc) {
if (doc.tags("deprecated").length > 0) {
return true;
}
AnnotationDesc[] annotationDescList;
if (doc instanceof PackageDoc)
annotationDescList = ((PackageDoc)doc).annotations();
else
annotationDescL... | [
"public",
"static",
"boolean",
"isDeprecated",
"(",
"Doc",
"doc",
")",
"{",
"if",
"(",
"doc",
".",
"tags",
"(",
"\"deprecated\"",
")",
".",
"length",
">",
"0",
")",
"{",
"return",
"true",
";",
"}",
"AnnotationDesc",
"[",
"]",
"annotationDescList",
";",
... | Return true if the given Doc is deprecated.
@param doc the Doc to check.
@return true if the given Doc is deprecated. | [
"Return",
"true",
"if",
"the",
"given",
"Doc",
"is",
"deprecated",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java#L704-L720 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java | Util.propertyNameFromMethodName | public static String propertyNameFromMethodName(Configuration configuration, String name) {
String propertyName = null;
if (name.startsWith("get") || name.startsWith("set")) {
propertyName = name.substring(3);
} else if (name.startsWith("is")) {
propertyName = name.substr... | java | public static String propertyNameFromMethodName(Configuration configuration, String name) {
String propertyName = null;
if (name.startsWith("get") || name.startsWith("set")) {
propertyName = name.substring(3);
} else if (name.startsWith("is")) {
propertyName = name.substr... | [
"public",
"static",
"String",
"propertyNameFromMethodName",
"(",
"Configuration",
"configuration",
",",
"String",
"name",
")",
"{",
"String",
"propertyName",
"=",
"null",
";",
"if",
"(",
"name",
".",
"startsWith",
"(",
"\"get\"",
")",
"||",
"name",
".",
"start... | A convenience method to get property name from the name of the
getter or setter method.
@param name name of the getter or setter method.
@return the name of the property of the given setter of getter. | [
"A",
"convenience",
"method",
"to",
"get",
"property",
"name",
"from",
"the",
"name",
"of",
"the",
"getter",
"or",
"setter",
"method",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java#L728-L740 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java | Util.isJava5DeclarationElementType | public static boolean isJava5DeclarationElementType(FieldDoc elt) {
return elt.name().contentEquals(ElementType.ANNOTATION_TYPE.name()) ||
elt.name().contentEquals(ElementType.CONSTRUCTOR.name()) ||
elt.name().contentEquals(ElementType.FIELD.name()) ||
elt.name().... | java | public static boolean isJava5DeclarationElementType(FieldDoc elt) {
return elt.name().contentEquals(ElementType.ANNOTATION_TYPE.name()) ||
elt.name().contentEquals(ElementType.CONSTRUCTOR.name()) ||
elt.name().contentEquals(ElementType.FIELD.name()) ||
elt.name().... | [
"public",
"static",
"boolean",
"isJava5DeclarationElementType",
"(",
"FieldDoc",
"elt",
")",
"{",
"return",
"elt",
".",
"name",
"(",
")",
".",
"contentEquals",
"(",
"ElementType",
".",
"ANNOTATION_TYPE",
".",
"name",
"(",
")",
")",
"||",
"elt",
".",
"name",
... | Test whether the given FieldDoc is one of the declaration annotation ElementTypes
defined in Java 5.
Instead of testing for one of the new enum constants added in Java 8, test for
the old constants. This prevents bootstrapping problems.
@param elt The FieldDoc to test
@return true, iff the given ElementType is one of ... | [
"Test",
"whether",
"the",
"given",
"FieldDoc",
"is",
"one",
"of",
"the",
"declaration",
"annotation",
"ElementTypes",
"defined",
"in",
"Java",
"5",
".",
"Instead",
"of",
"testing",
"for",
"one",
"of",
"the",
"new",
"enum",
"constants",
"added",
"in",
"Java",... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java#L782-L791 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.normalizeMethod | void normalizeMethod(JCMethodDecl md, List<JCStatement> initCode, List<TypeCompound> initTAs) {
if (md.name == names.init && TreeInfo.isInitialConstructor(md)) {
// We are seeing a constructor that does not call another
// constructor of the same class.
List<JCStatement> stat... | java | void normalizeMethod(JCMethodDecl md, List<JCStatement> initCode, List<TypeCompound> initTAs) {
if (md.name == names.init && TreeInfo.isInitialConstructor(md)) {
// We are seeing a constructor that does not call another
// constructor of the same class.
List<JCStatement> stat... | [
"void",
"normalizeMethod",
"(",
"JCMethodDecl",
"md",
",",
"List",
"<",
"JCStatement",
">",
"initCode",
",",
"List",
"<",
"TypeCompound",
">",
"initTAs",
")",
"{",
"if",
"(",
"md",
".",
"name",
"==",
"names",
".",
"init",
"&&",
"TreeInfo",
".",
"isInitia... | Insert instance initializer code into initial constructor.
@param md The tree potentially representing a
constructor's definition.
@param initCode The list of instance initializer statements.
@param initTAs Type annotations from the initializer expression. | [
"Insert",
"instance",
"initializer",
"code",
"into",
"initial",
"constructor",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L601-L638 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.implementInterfaceMethods | void implementInterfaceMethods(ClassSymbol c, ClassSymbol site) {
for (List<Type> l = types.interfaces(c.type); l.nonEmpty(); l = l.tail) {
ClassSymbol i = (ClassSymbol)l.head.tsym;
for (Scope.Entry e = i.members().elems;
e != null;
e = e.sibling)
... | java | void implementInterfaceMethods(ClassSymbol c, ClassSymbol site) {
for (List<Type> l = types.interfaces(c.type); l.nonEmpty(); l = l.tail) {
ClassSymbol i = (ClassSymbol)l.head.tsym;
for (Scope.Entry e = i.members().elems;
e != null;
e = e.sibling)
... | [
"void",
"implementInterfaceMethods",
"(",
"ClassSymbol",
"c",
",",
"ClassSymbol",
"site",
")",
"{",
"for",
"(",
"List",
"<",
"Type",
">",
"l",
"=",
"types",
".",
"interfaces",
"(",
"c",
".",
"type",
")",
";",
"l",
".",
"nonEmpty",
"(",
")",
";",
"l",... | Add abstract methods for all methods defined in one of
the interfaces of a given class,
provided they are not already implemented in the class.
@param c The class whose interfaces are searched for methods
for which Miranda methods should be added.
@param site The class in which a definition may be needed. | [
"Add",
"abstract",
"methods",
"for",
"all",
"methods",
"defined",
"in",
"one",
"of",
"the",
"interfaces",
"of",
"a",
"given",
"class",
"provided",
"they",
"are",
"not",
"already",
"implemented",
"in",
"the",
"class",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L663-L682 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.addAbstractMethod | private void addAbstractMethod(ClassSymbol c,
MethodSymbol m) {
MethodSymbol absMeth = new MethodSymbol(
m.flags() | IPROXY | SYNTHETIC, m.name,
m.type, // was c.type.memberType(m), but now only !generics supported
c);
c.members().en... | java | private void addAbstractMethod(ClassSymbol c,
MethodSymbol m) {
MethodSymbol absMeth = new MethodSymbol(
m.flags() | IPROXY | SYNTHETIC, m.name,
m.type, // was c.type.memberType(m), but now only !generics supported
c);
c.members().en... | [
"private",
"void",
"addAbstractMethod",
"(",
"ClassSymbol",
"c",
",",
"MethodSymbol",
"m",
")",
"{",
"MethodSymbol",
"absMeth",
"=",
"new",
"MethodSymbol",
"(",
"m",
".",
"flags",
"(",
")",
"|",
"IPROXY",
"|",
"SYNTHETIC",
",",
"m",
".",
"name",
",",
"m"... | Add an abstract methods to a class
which implicitly implements a method defined in some interface
implemented by the class. These methods are called "Miranda methods".
Enter the newly created method into its enclosing class scope.
Note that it is not entered into the class tree, as the emitter
doesn't need to see it th... | [
"Add",
"an",
"abstract",
"methods",
"to",
"a",
"class",
"which",
"implicitly",
"implements",
"a",
"method",
"defined",
"in",
"some",
"interface",
"implemented",
"by",
"the",
"class",
".",
"These",
"methods",
"are",
"called",
"Miranda",
"methods",
".",
"Enter",... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L695-L702 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.makeStringBuffer | void makeStringBuffer(DiagnosticPosition pos) {
code.emitop2(new_, makeRef(pos, stringBufferType));
code.emitop0(dup);
callMethod(
pos, stringBufferType, names.init, List.<Type>nil(), false);
} | java | void makeStringBuffer(DiagnosticPosition pos) {
code.emitop2(new_, makeRef(pos, stringBufferType));
code.emitop0(dup);
callMethod(
pos, stringBufferType, names.init, List.<Type>nil(), false);
} | [
"void",
"makeStringBuffer",
"(",
"DiagnosticPosition",
"pos",
")",
"{",
"code",
".",
"emitop2",
"(",
"new_",
",",
"makeRef",
"(",
"pos",
",",
"stringBufferType",
")",
")",
";",
"code",
".",
"emitop0",
"(",
"dup",
")",
";",
"callMethod",
"(",
"pos",
",",
... | Make a new string buffer. | [
"Make",
"a",
"new",
"string",
"buffer",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L2159-L2164 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.appendStrings | void appendStrings(JCTree tree) {
tree = TreeInfo.skipParens(tree);
if (tree.hasTag(PLUS) && tree.type.constValue() == null) {
JCBinary op = (JCBinary) tree;
if (op.operator.kind == MTH &&
((OperatorSymbol) op.operator).opcode == string_add) {
... | java | void appendStrings(JCTree tree) {
tree = TreeInfo.skipParens(tree);
if (tree.hasTag(PLUS) && tree.type.constValue() == null) {
JCBinary op = (JCBinary) tree;
if (op.operator.kind == MTH &&
((OperatorSymbol) op.operator).opcode == string_add) {
... | [
"void",
"appendStrings",
"(",
"JCTree",
"tree",
")",
"{",
"tree",
"=",
"TreeInfo",
".",
"skipParens",
"(",
"tree",
")",
";",
"if",
"(",
"tree",
".",
"hasTag",
"(",
"PLUS",
")",
"&&",
"tree",
".",
"type",
".",
"constValue",
"(",
")",
"==",
"null",
"... | Add all strings in tree to string buffer. | [
"Add",
"all",
"strings",
"in",
"tree",
"to",
"string",
"buffer",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L2192-L2205 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/Gen.java | Gen.bufferToString | void bufferToString(DiagnosticPosition pos) {
callMethod(
pos,
stringBufferType,
names.toString,
List.<Type>nil(),
false);
} | java | void bufferToString(DiagnosticPosition pos) {
callMethod(
pos,
stringBufferType,
names.toString,
List.<Type>nil(),
false);
} | [
"void",
"bufferToString",
"(",
"DiagnosticPosition",
"pos",
")",
"{",
"callMethod",
"(",
"pos",
",",
"stringBufferType",
",",
"names",
".",
"toString",
",",
"List",
".",
"<",
"Type",
">",
"nil",
"(",
")",
",",
"false",
")",
";",
"}"
] | Convert string buffer on tos to string. | [
"Convert",
"string",
"buffer",
"on",
"tos",
"to",
"string",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/Gen.java#L2209-L2216 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/element/Elements.java | Elements.getValue | public static <E> OptionalFunction<Selection<Element>, E> getValue() {
return OptionalFunction.of(selection -> selection.result().getValue());
} | java | public static <E> OptionalFunction<Selection<Element>, E> getValue() {
return OptionalFunction.of(selection -> selection.result().getValue());
} | [
"public",
"static",
"<",
"E",
">",
"OptionalFunction",
"<",
"Selection",
"<",
"Element",
">",
",",
"E",
">",
"getValue",
"(",
")",
"{",
"return",
"OptionalFunction",
".",
"of",
"(",
"selection",
"->",
"selection",
".",
"result",
"(",
")",
".",
"getValue"... | Returns a function that gets the value of a selected element.
@return a function that gets the value of a selected element. | [
"Returns",
"a",
"function",
"that",
"gets",
"the",
"value",
"of",
"a",
"selected",
"element",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/element/Elements.java#L98-L100 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/element/Elements.java | Elements.setValue | public static Consumer<Selection<Element>> setValue(Object newValue) {
return selection -> selection.result().setValue(newValue);
} | java | public static Consumer<Selection<Element>> setValue(Object newValue) {
return selection -> selection.result().setValue(newValue);
} | [
"public",
"static",
"Consumer",
"<",
"Selection",
"<",
"Element",
">",
">",
"setValue",
"(",
"Object",
"newValue",
")",
"{",
"return",
"selection",
"->",
"selection",
".",
"result",
"(",
")",
".",
"setValue",
"(",
"newValue",
")",
";",
"}"
] | Returns a function that sets the value of a selected element.
@param newValue the value to set
@return a function that sets the value of a selected element. | [
"Returns",
"a",
"function",
"that",
"sets",
"the",
"value",
"of",
"a",
"selected",
"element",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/element/Elements.java#L108-L110 | train |
qsardb/qsardb | model/src/main/java/org/qsardb/model/IdUtil.java | IdUtil.validate | static
public boolean validate(String id){
if(id.equals("")){
return false;
} else
if(id.equals(".") || id.equals("..")){
return false;
}
Matcher matcher = IdUtil.pattern.matcher(id);
return matcher.matches();
} | java | static
public boolean validate(String id){
if(id.equals("")){
return false;
} else
if(id.equals(".") || id.equals("..")){
return false;
}
Matcher matcher = IdUtil.pattern.matcher(id);
return matcher.matches();
} | [
"static",
"public",
"boolean",
"validate",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"id",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",
"return",
"false",
";",
"}",
"else",
"if",
"(",
"id",
".",
"equals",
"(",
"\".\"",
")",
"||",
"id",
".",
"equals... | Verifies the correctness of an identifier.
A valid identifier consists of one or more visible US-ASCII characters,
except for the path delimiter characters '/', '\' and ':'.
<p>
Additionally, an identifier is considered invalid if it:
<ul>
<li>Equals to path components "." or "..".
</ul>
@see Con... | [
"Verifies",
"the",
"correctness",
"of",
"an",
"identifier",
"."
] | 9798f524abd973878b9040927aed8131885127fa | https://github.com/qsardb/qsardb/blob/9798f524abd973878b9040927aed8131885127fa/model/src/main/java/org/qsardb/model/IdUtil.java#L28-L42 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/UiSelector.java | UiSelector.buildSelector | private UiSelector buildSelector(int selectorId, Object selectorValue) {
if (selectorId == SELECTOR_CHILD || selectorId == SELECTOR_PARENT) {
throw new UnsupportedOperationException();
// selector.getLastSubSelector().mSelectorAttributes.put(selectorId, selectorValue);
} else {
... | java | private UiSelector buildSelector(int selectorId, Object selectorValue) {
if (selectorId == SELECTOR_CHILD || selectorId == SELECTOR_PARENT) {
throw new UnsupportedOperationException();
// selector.getLastSubSelector().mSelectorAttributes.put(selectorId, selectorValue);
} else {
... | [
"private",
"UiSelector",
"buildSelector",
"(",
"int",
"selectorId",
",",
"Object",
"selectorValue",
")",
"{",
"if",
"(",
"selectorId",
"==",
"SELECTOR_CHILD",
"||",
"selectorId",
"==",
"SELECTOR_PARENT",
")",
"{",
"throw",
"new",
"UnsupportedOperationException",
"("... | Building a UiSelector always returns a new UiSelector and never modifies the
existing UiSelector being used. | [
"Building",
"a",
"UiSelector",
"always",
"returns",
"a",
"new",
"UiSelector",
"and",
"never",
"modifies",
"the",
"existing",
"UiSelector",
"being",
"used",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/UiSelector.java#L649-L657 | train |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/core/UserData.java | UserData.get | public void get(String key, UserDataHandler handler) {
if (cache.containsKey(key)) {
try {
handler.data(key, cache.get(key));
} catch (Exception e) {
e.printStackTrace();
}
return;
}
user.sendGlobal("JWWF-storageGet", "{\"key\":" + Json.escapeString(key) + "}");
if (waitingHandlers.contain... | java | public void get(String key, UserDataHandler handler) {
if (cache.containsKey(key)) {
try {
handler.data(key, cache.get(key));
} catch (Exception e) {
e.printStackTrace();
}
return;
}
user.sendGlobal("JWWF-storageGet", "{\"key\":" + Json.escapeString(key) + "}");
if (waitingHandlers.contain... | [
"public",
"void",
"get",
"(",
"String",
"key",
",",
"UserDataHandler",
"handler",
")",
"{",
"if",
"(",
"cache",
".",
"containsKey",
"(",
"key",
")",
")",
"{",
"try",
"{",
"handler",
".",
"data",
"(",
"key",
",",
"cache",
".",
"get",
"(",
"key",
")"... | Gets userData string. if data exists in cache the callback is fired
immediately, if not async request is sent to user. If user don't have
requested data, empty string will arrive
@param key Requested key
@param handler Handler to be invoked when data arrives | [
"Gets",
"userData",
"string",
".",
"if",
"data",
"exists",
"in",
"cache",
"the",
"callback",
"is",
"fired",
"immediately",
"if",
"not",
"async",
"request",
"is",
"sent",
"to",
"user",
".",
"If",
"user",
"don",
"t",
"have",
"requested",
"data",
"empty",
"... | 8ba334501396c3301495da8708733f6014f20665 | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/core/UserData.java#L32-L51 | train |
magik6k/JWWF | src/main/java/net/magik6k/jwwf/core/UserData.java | UserData.set | public void set(String key, String value) {
cache.put(key, value);
user.sendGlobal("JWWF-storageSet", "{\"key\":" + Json.escapeString(key) + ",\"value\":" + Json.escapeString(value) + "}");
} | java | public void set(String key, String value) {
cache.put(key, value);
user.sendGlobal("JWWF-storageSet", "{\"key\":" + Json.escapeString(key) + ",\"value\":" + Json.escapeString(value) + "}");
} | [
"public",
"void",
"set",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"cache",
".",
"put",
"(",
"key",
",",
"value",
")",
";",
"user",
".",
"sendGlobal",
"(",
"\"JWWF-storageSet\"",
",",
"\"{\\\"key\\\":\"",
"+",
"Json",
".",
"escapeString",
"... | Sets userData for user, data is set in cache and sent to user
@param key Name of value
@param value Data to be set | [
"Sets",
"userData",
"for",
"user",
"data",
"is",
"set",
"in",
"cache",
"and",
"sent",
"to",
"user"
] | 8ba334501396c3301495da8708733f6014f20665 | https://github.com/magik6k/JWWF/blob/8ba334501396c3301495da8708733f6014f20665/src/main/java/net/magik6k/jwwf/core/UserData.java#L70-L73 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/Scriptable.java | Scriptable.setObjects | public void setObjects(Map<String, Object> objects) {
for (Map.Entry<String, Object> entry: objects.entrySet()) {
js.put(entry.getKey(), entry.getValue());
}
} | java | public void setObjects(Map<String, Object> objects) {
for (Map.Entry<String, Object> entry: objects.entrySet()) {
js.put(entry.getKey(), entry.getValue());
}
} | [
"public",
"void",
"setObjects",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"objects",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
"String",
",",
"Object",
">",
"entry",
":",
"objects",
".",
"entrySet",
"(",
")",
")",
"{",
"js",
".",
"put",
... | Provides objects to the JavaScript engine under various names. | [
"Provides",
"objects",
"to",
"the",
"JavaScript",
"engine",
"under",
"various",
"names",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/Scriptable.java#L32-L36 | train |
petrbouda/joyrest | joyrest-core/src/main/java/org/joyrest/context/configurer/AbstractConfigurer.java | AbstractConfigurer.initializeContext | protected ApplicationContext initializeContext() {
Function<Class<Object>, List<Object>> getBeans = this::getBeans;
BeanFactory beanFactory = new BeanFactory(getBeans);
InitContext context = new InitContext();
AutoConfigurer.configureInitializers()
.forEach(initializer -> i... | java | protected ApplicationContext initializeContext() {
Function<Class<Object>, List<Object>> getBeans = this::getBeans;
BeanFactory beanFactory = new BeanFactory(getBeans);
InitContext context = new InitContext();
AutoConfigurer.configureInitializers()
.forEach(initializer -> i... | [
"protected",
"ApplicationContext",
"initializeContext",
"(",
")",
"{",
"Function",
"<",
"Class",
"<",
"Object",
">",
",",
"List",
"<",
"Object",
">",
">",
"getBeans",
"=",
"this",
"::",
"getBeans",
";",
"BeanFactory",
"beanFactory",
"=",
"new",
"BeanFactory",
... | Method causes the initialization of the application context using the methods which returns a collection of beans such as
@return initialized {@code application context} | [
"Method",
"causes",
"the",
"initialization",
"of",
"the",
"application",
"context",
"using",
"the",
"methods",
"which",
"returns",
"a",
"collection",
"of",
"beans",
"such",
"as"
] | 58903f06fb7f0b8fdf1ef91318fb48a88bf970e0 | https://github.com/petrbouda/joyrest/blob/58903f06fb7f0b8fdf1ef91318fb48a88bf970e0/joyrest-core/src/main/java/org/joyrest/context/configurer/AbstractConfigurer.java#L83-L136 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/Singleton.java | Singleton.slow | public synchronized T slow(Factory<T> p, Object... args) throws Exception {
T result = _value;
if (isMissing(result)) {
_value = result = p.make(args);
}
return result;
} | java | public synchronized T slow(Factory<T> p, Object... args) throws Exception {
T result = _value;
if (isMissing(result)) {
_value = result = p.make(args);
}
return result;
} | [
"public",
"synchronized",
"T",
"slow",
"(",
"Factory",
"<",
"T",
">",
"p",
",",
"Object",
"...",
"args",
")",
"throws",
"Exception",
"{",
"T",
"result",
"=",
"_value",
";",
"if",
"(",
"isMissing",
"(",
"result",
")",
")",
"{",
"_value",
"=",
"result"... | For performance evaluation only - do not use.
@param p a {@link org.xillium.base.Factory Factory} that can be called to create a new value with more than 1 arguments
@param args the arguments to pass to the factory
@return the singleton object
@throws Exception if the factory fails to create a new value | [
"For",
"performance",
"evaluation",
"only",
"-",
"do",
"not",
"use",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/Singleton.java#L101-L107 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java | PointerCoords.clear | public void clear() {
mPackedAxisBits = 0;
x = 0;
y = 0;
pressure = 0;
size = 0;
touchMajor = 0;
touchMinor = 0;
toolMajor = 0;
toolMinor = 0;
orientation = 0;
} | java | public void clear() {
mPackedAxisBits = 0;
x = 0;
y = 0;
pressure = 0;
size = 0;
touchMajor = 0;
touchMinor = 0;
toolMajor = 0;
toolMinor = 0;
orientation = 0;
} | [
"public",
"void",
"clear",
"(",
")",
"{",
"mPackedAxisBits",
"=",
"0",
";",
"x",
"=",
"0",
";",
"y",
"=",
"0",
";",
"pressure",
"=",
"0",
";",
"size",
"=",
"0",
";",
"touchMajor",
"=",
"0",
";",
"touchMinor",
"=",
"0",
";",
"toolMajor",
"=",
"0... | Clears the contents of this object.
Resets all axes to zero. | [
"Clears",
"the",
"contents",
"of",
"this",
"object",
".",
"Resets",
"all",
"axes",
"to",
"zero",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java#L397-L409 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java | PointerCoords.copyFrom | public void copyFrom(PointerCoords other) {
final long bits = other.mPackedAxisBits;
mPackedAxisBits = bits;
if (bits != 0) {
final float[] otherValues = other.mPackedAxisValues;
final int count = Long.bitCount(bits);
float[] values = mPackedAxisValues;
... | java | public void copyFrom(PointerCoords other) {
final long bits = other.mPackedAxisBits;
mPackedAxisBits = bits;
if (bits != 0) {
final float[] otherValues = other.mPackedAxisValues;
final int count = Long.bitCount(bits);
float[] values = mPackedAxisValues;
... | [
"public",
"void",
"copyFrom",
"(",
"PointerCoords",
"other",
")",
"{",
"final",
"long",
"bits",
"=",
"other",
".",
"mPackedAxisBits",
";",
"mPackedAxisBits",
"=",
"bits",
";",
"if",
"(",
"bits",
"!=",
"0",
")",
"{",
"final",
"float",
"[",
"]",
"otherValu... | Copies the contents of another pointer coords object.
@param other The pointer coords object to copy. | [
"Copies",
"the",
"contents",
"of",
"another",
"pointer",
"coords",
"object",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java#L416-L439 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java | PointerCoords.getAxisValue | public float getAxisValue(int axis) {
switch (axis) {
case AXIS_X:
return x;
case AXIS_Y:
return y;
case AXIS_PRESSURE:
return pressure;
case AXIS_SIZE:
return size;
case AXIS_TOUCH_MAJOR:... | java | public float getAxisValue(int axis) {
switch (axis) {
case AXIS_X:
return x;
case AXIS_Y:
return y;
case AXIS_PRESSURE:
return pressure;
case AXIS_SIZE:
return size;
case AXIS_TOUCH_MAJOR:... | [
"public",
"float",
"getAxisValue",
"(",
"int",
"axis",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"AXIS_X",
":",
"return",
"x",
";",
"case",
"AXIS_Y",
":",
"return",
"y",
";",
"case",
"AXIS_PRESSURE",
":",
"return",
"pressure",
";",
"case",
"AX... | Gets the value associated with the specified axis.
@param axis The axis identifier for the axis value to retrieve.
@return The value associated with the axis, or 0 if none. | [
"Gets",
"the",
"value",
"associated",
"with",
"the",
"specified",
"axis",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java#L448-L481 | train |
wanglinsong/thx-android | uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java | PointerCoords.setAxisValue | public void setAxisValue(int axis, float value) {
switch (axis) {
case AXIS_X:
x = value;
break;
case AXIS_Y:
y = value;
break;
case AXIS_PRESSURE:
pressure = value;
break;
... | java | public void setAxisValue(int axis, float value) {
switch (axis) {
case AXIS_X:
x = value;
break;
case AXIS_Y:
y = value;
break;
case AXIS_PRESSURE:
pressure = value;
break;
... | [
"public",
"void",
"setAxisValue",
"(",
"int",
"axis",
",",
"float",
"value",
")",
"{",
"switch",
"(",
"axis",
")",
"{",
"case",
"AXIS_X",
":",
"x",
"=",
"value",
";",
"break",
";",
"case",
"AXIS_Y",
":",
"y",
"=",
"value",
";",
"break",
";",
"case"... | Sets the value associated with the specified axis.
@param axis The axis identifier for the axis value to assign.
@param value The value to set. | [
"Sets",
"the",
"value",
"associated",
"with",
"the",
"specified",
"axis",
"."
] | 4a98c4181b3e8876e688591737da37627c07e72b | https://github.com/wanglinsong/thx-android/blob/4a98c4181b3e8876e688591737da37627c07e72b/uia-client/src/main/java/com/android/uiautomator/stub/PointerCoords.java#L489-L551 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/Util.java | Util.set | public static Set<String> set(String... ss) {
Set<String> set = new HashSet<String>();
set.addAll(Arrays.asList(ss));
return set;
} | java | public static Set<String> set(String... ss) {
Set<String> set = new HashSet<String>();
set.addAll(Arrays.asList(ss));
return set;
} | [
"public",
"static",
"Set",
"<",
"String",
">",
"set",
"(",
"String",
"...",
"ss",
")",
"{",
"Set",
"<",
"String",
">",
"set",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
")",
";",
"set",
".",
"addAll",
"(",
"Arrays",
".",
"asList",
"(",
"ss",... | Convenience method to create a set with strings. | [
"Convenience",
"method",
"to",
"create",
"a",
"set",
"with",
"strings",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/Util.java#L123-L127 | train |
arakelian/more-commons | src/main/java/com/arakelian/core/utils/ExecutorUtils.java | ExecutorUtils.newThreadFactory | public static ThreadFactory newThreadFactory(final String format, final boolean daemon) {
final String nameFormat;
if (!format.contains("%d")) {
nameFormat = format + "-%d";
} else {
nameFormat = format;
}
return new ThreadFactoryBuilder() //
... | java | public static ThreadFactory newThreadFactory(final String format, final boolean daemon) {
final String nameFormat;
if (!format.contains("%d")) {
nameFormat = format + "-%d";
} else {
nameFormat = format;
}
return new ThreadFactoryBuilder() //
... | [
"public",
"static",
"ThreadFactory",
"newThreadFactory",
"(",
"final",
"String",
"format",
",",
"final",
"boolean",
"daemon",
")",
"{",
"final",
"String",
"nameFormat",
";",
"if",
"(",
"!",
"format",
".",
"contains",
"(",
"\"%d\"",
")",
")",
"{",
"nameFormat... | Returns a new thread factory that uses the given pattern to set the thread name.
@param format
thread name pattern, where %d can be used to specify the thread number.
@param daemon
true for daemon threads
@return thread factory that uses the given pattern to set the thread name | [
"Returns",
"a",
"new",
"thread",
"factory",
"that",
"uses",
"the",
"given",
"pattern",
"to",
"set",
"the",
"thread",
"name",
"."
] | 83c607044f64a7f6c005a67866c0ef7cb68d6e29 | https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/ExecutorUtils.java#L89-L101 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/Comment.java | Comment.tags | Tag[] tags(String tagname) {
ListBuffer<Tag> found = new ListBuffer<Tag>();
String target = tagname;
if (target.charAt(0) != '@') {
target = "@" + target;
}
for (Tag tag : tagList) {
if (tag.kind().equals(target)) {
found.append(tag);
... | java | Tag[] tags(String tagname) {
ListBuffer<Tag> found = new ListBuffer<Tag>();
String target = tagname;
if (target.charAt(0) != '@') {
target = "@" + target;
}
for (Tag tag : tagList) {
if (tag.kind().equals(target)) {
found.append(tag);
... | [
"Tag",
"[",
"]",
"tags",
"(",
"String",
"tagname",
")",
"{",
"ListBuffer",
"<",
"Tag",
">",
"found",
"=",
"new",
"ListBuffer",
"<",
"Tag",
">",
"(",
")",
";",
"String",
"target",
"=",
"tagname",
";",
"if",
"(",
"target",
".",
"charAt",
"(",
"0",
... | Return tags of the specified kind in this comment. | [
"Return",
"tags",
"of",
"the",
"specified",
"kind",
"in",
"this",
"comment",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/Comment.java#L210-L222 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/Comment.java | Comment.paramTags | private ParamTag[] paramTags(boolean typeParams) {
ListBuffer<ParamTag> found = new ListBuffer<ParamTag>();
for (Tag next : tagList) {
if (next instanceof ParamTag) {
ParamTag p = (ParamTag)next;
if (typeParams == p.isTypeParameter()) {
fou... | java | private ParamTag[] paramTags(boolean typeParams) {
ListBuffer<ParamTag> found = new ListBuffer<ParamTag>();
for (Tag next : tagList) {
if (next instanceof ParamTag) {
ParamTag p = (ParamTag)next;
if (typeParams == p.isTypeParameter()) {
fou... | [
"private",
"ParamTag",
"[",
"]",
"paramTags",
"(",
"boolean",
"typeParams",
")",
"{",
"ListBuffer",
"<",
"ParamTag",
">",
"found",
"=",
"new",
"ListBuffer",
"<",
"ParamTag",
">",
"(",
")",
";",
"for",
"(",
"Tag",
"next",
":",
"tagList",
")",
"{",
"if",... | Return param tags in this comment. If typeParams is true
include only type param tags, otherwise include only ordinary
param tags. | [
"Return",
"param",
"tags",
"in",
"this",
"comment",
".",
"If",
"typeParams",
"is",
"true",
"include",
"only",
"type",
"param",
"tags",
"otherwise",
"include",
"only",
"ordinary",
"param",
"tags",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/Comment.java#L256-L267 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/Comment.java | Comment.seeTags | SeeTag[] seeTags() {
ListBuffer<SeeTag> found = new ListBuffer<SeeTag>();
for (Tag next : tagList) {
if (next instanceof SeeTag) {
found.append((SeeTag)next);
}
}
return found.toArray(new SeeTag[found.length()]);
} | java | SeeTag[] seeTags() {
ListBuffer<SeeTag> found = new ListBuffer<SeeTag>();
for (Tag next : tagList) {
if (next instanceof SeeTag) {
found.append((SeeTag)next);
}
}
return found.toArray(new SeeTag[found.length()]);
} | [
"SeeTag",
"[",
"]",
"seeTags",
"(",
")",
"{",
"ListBuffer",
"<",
"SeeTag",
">",
"found",
"=",
"new",
"ListBuffer",
"<",
"SeeTag",
">",
"(",
")",
";",
"for",
"(",
"Tag",
"next",
":",
"tagList",
")",
"{",
"if",
"(",
"next",
"instanceof",
"SeeTag",
")... | Return see also tags in this comment. | [
"Return",
"see",
"also",
"tags",
"in",
"this",
"comment",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/Comment.java#L272-L280 | train |
qsardb/qsardb | model/src/main/java/org/qsardb/model/ContainerRegistry.java | ContainerRegistry.get | public C get(String id){
C container = this.containerMap.get(id);
if(container != null && (container.getState()).equals(State.REMOVED)){
return null;
}
return container;
} | java | public C get(String id){
C container = this.containerMap.get(id);
if(container != null && (container.getState()).equals(State.REMOVED)){
return null;
}
return container;
} | [
"public",
"C",
"get",
"(",
"String",
"id",
")",
"{",
"C",
"container",
"=",
"this",
".",
"containerMap",
".",
"get",
"(",
"id",
")",
";",
"if",
"(",
"container",
"!=",
"null",
"&&",
"(",
"container",
".",
"getState",
"(",
")",
")",
".",
"equals",
... | Looks up a Container by its identifier.
@return The Container instance or <code>null</code> | [
"Looks",
"up",
"a",
"Container",
"by",
"its",
"identifier",
"."
] | 9798f524abd973878b9040927aed8131885127fa | https://github.com/qsardb/qsardb/blob/9798f524abd973878b9040927aed8131885127fa/model/src/main/java/org/qsardb/model/ContainerRegistry.java#L94-L102 | train |
qsardb/qsardb | model/src/main/java/org/qsardb/model/ContainerRegistry.java | ContainerRegistry.getAll | public Collection<C> getAll(Collection<String> ids){
Set<C> list = new LinkedHashSet<C>();
for(String id : ids){
C container = get(id);
if(container != null){
list.add(container);
}
}
return list;
} | java | public Collection<C> getAll(Collection<String> ids){
Set<C> list = new LinkedHashSet<C>();
for(String id : ids){
C container = get(id);
if(container != null){
list.add(container);
}
}
return list;
} | [
"public",
"Collection",
"<",
"C",
">",
"getAll",
"(",
"Collection",
"<",
"String",
">",
"ids",
")",
"{",
"Set",
"<",
"C",
">",
"list",
"=",
"new",
"LinkedHashSet",
"<",
"C",
">",
"(",
")",
";",
"for",
"(",
"String",
"id",
":",
"ids",
")",
"{",
... | Looks up a Collection of Containers by their identifiers.
The returned Collection preserves the iteration order of the passed-in Collection.
@return Collection of Containers. | [
"Looks",
"up",
"a",
"Collection",
"of",
"Containers",
"by",
"their",
"identifiers",
"."
] | 9798f524abd973878b9040927aed8131885127fa | https://github.com/qsardb/qsardb/blob/9798f524abd973878b9040927aed8131885127fa/model/src/main/java/org/qsardb/model/ContainerRegistry.java#L111-L123 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Idl2Java.java | Idl2Java.main | public static void main(String argv[]) throws Exception {
String idlFile = null;
String pkgName = null;
String outDir = null;
String nsPkgName = null;
boolean allImmutable = false;
List<String> immutableSubstr = new ArrayList<String>();
for (int i = 0; i < argv.l... | java | public static void main(String argv[]) throws Exception {
String idlFile = null;
String pkgName = null;
String outDir = null;
String nsPkgName = null;
boolean allImmutable = false;
List<String> immutableSubstr = new ArrayList<String>();
for (int i = 0; i < argv.l... | [
"public",
"static",
"void",
"main",
"(",
"String",
"argv",
"[",
"]",
")",
"throws",
"Exception",
"{",
"String",
"idlFile",
"=",
"null",
";",
"String",
"pkgName",
"=",
"null",
";",
"String",
"outDir",
"=",
"null",
";",
"String",
"nsPkgName",
"=",
"null",
... | Runs the code generator on the command line. | [
"Runs",
"the",
"code",
"generator",
"on",
"the",
"command",
"line",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Idl2Java.java#L24-L63 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/HttpServiceDispatcher.java | HttpServiceDispatcher.init | public void init() throws ServletException {
_application = ((ManagedPlatform)ServicePlatform.getService(ManagedPlatform.INSTANCE).first).getName();
/*
ApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
if (wac.containsBean("persistence")) { // pe... | java | public void init() throws ServletException {
_application = ((ManagedPlatform)ServicePlatform.getService(ManagedPlatform.INSTANCE).first).getName();
/*
ApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
if (wac.containsBean("persistence")) { // pe... | [
"public",
"void",
"init",
"(",
")",
"throws",
"ServletException",
"{",
"_application",
"=",
"(",
"(",
"ManagedPlatform",
")",
"ServicePlatform",
".",
"getService",
"(",
"ManagedPlatform",
".",
"INSTANCE",
")",
".",
"first",
")",
".",
"getName",
"(",
")",
";"... | Initializes the servlet | [
"Initializes",
"the",
"servlet"
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/HttpServiceDispatcher.java#L50-L59 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.getInstance | public static ProfileSummaryBuilder getInstance(Context context,
Profile profile, ProfileSummaryWriter profileWriter) {
return new ProfileSummaryBuilder(context, profile, profileWriter);
} | java | public static ProfileSummaryBuilder getInstance(Context context,
Profile profile, ProfileSummaryWriter profileWriter) {
return new ProfileSummaryBuilder(context, profile, profileWriter);
} | [
"public",
"static",
"ProfileSummaryBuilder",
"getInstance",
"(",
"Context",
"context",
",",
"Profile",
"profile",
",",
"ProfileSummaryWriter",
"profileWriter",
")",
"{",
"return",
"new",
"ProfileSummaryBuilder",
"(",
"context",
",",
"profile",
",",
"profileWriter",
")... | Construct a new ProfileSummaryBuilder.
@param context the build context.
@param profile the profile being documented.
@param profileWriter the doclet specific writer that will output the
result.
@return an instance of a ProfileSummaryBuilder. | [
"Construct",
"a",
"new",
"ProfileSummaryBuilder",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L96-L99 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildProfileDoc | public void buildProfileDoc(XMLNode node, Content contentTree) throws Exception {
contentTree = profileWriter.getProfileHeader(profile.name);
buildChildren(node, contentTree);
profileWriter.addProfileFooter(contentTree);
profileWriter.printDocument(contentTree);
profileWriter.clo... | java | public void buildProfileDoc(XMLNode node, Content contentTree) throws Exception {
contentTree = profileWriter.getProfileHeader(profile.name);
buildChildren(node, contentTree);
profileWriter.addProfileFooter(contentTree);
profileWriter.printDocument(contentTree);
profileWriter.clo... | [
"public",
"void",
"buildProfileDoc",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"throws",
"Exception",
"{",
"contentTree",
"=",
"profileWriter",
".",
"getProfileHeader",
"(",
"profile",
".",
"name",
")",
";",
"buildChildren",
"(",
"node",
",",
... | Build the profile documentation.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the documentation will be added | [
"Build",
"the",
"profile",
"documentation",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L125-L132 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildContent | public void buildContent(XMLNode node, Content contentTree) {
Content profileContentTree = profileWriter.getContentHeader();
buildChildren(node, profileContentTree);
contentTree.addContent(profileContentTree);
} | java | public void buildContent(XMLNode node, Content contentTree) {
Content profileContentTree = profileWriter.getContentHeader();
buildChildren(node, profileContentTree);
contentTree.addContent(profileContentTree);
} | [
"public",
"void",
"buildContent",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"Content",
"profileContentTree",
"=",
"profileWriter",
".",
"getContentHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"profileContentTree",
")",
";",
"... | Build the content for the profile doc.
@param node the XML element that specifies which components to document
@param contentTree the content tree to which the profile contents
will be added | [
"Build",
"the",
"content",
"for",
"the",
"profile",
"doc",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L141-L145 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildSummary | public void buildSummary(XMLNode node, Content profileContentTree) {
Content summaryContentTree = profileWriter.getSummaryHeader();
buildChildren(node, summaryContentTree);
profileContentTree.addContent(profileWriter.getSummaryTree(summaryContentTree));
} | java | public void buildSummary(XMLNode node, Content profileContentTree) {
Content summaryContentTree = profileWriter.getSummaryHeader();
buildChildren(node, summaryContentTree);
profileContentTree.addContent(profileWriter.getSummaryTree(summaryContentTree));
} | [
"public",
"void",
"buildSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"profileContentTree",
")",
"{",
"Content",
"summaryContentTree",
"=",
"profileWriter",
".",
"getSummaryHeader",
"(",
")",
";",
"buildChildren",
"(",
"node",
",",
"summaryContentTree",
")",
"... | Build the profile summary.
@param node the XML element that specifies which components to document
@param profileContentTree the profile content tree to which the summaries will
be added | [
"Build",
"the",
"profile",
"summary",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L154-L158 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildPackageSummary | public void buildPackageSummary(XMLNode node, Content summaryContentTree) {
PackageDoc[] packages = configuration.profilePackages.get(profile.name);
for (int i = 0; i < packages.length; i++) {
this.pkg = packages[i];
Content packageSummaryContentTree = profileWriter.getPackageSum... | java | public void buildPackageSummary(XMLNode node, Content summaryContentTree) {
PackageDoc[] packages = configuration.profilePackages.get(profile.name);
for (int i = 0; i < packages.length; i++) {
this.pkg = packages[i];
Content packageSummaryContentTree = profileWriter.getPackageSum... | [
"public",
"void",
"buildPackageSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summaryContentTree",
")",
"{",
"PackageDoc",
"[",
"]",
"packages",
"=",
"configuration",
".",
"profilePackages",
".",
"get",
"(",
"profile",
".",
"name",
")",
";",
"for",
"(",
... | Build the profile package summary.
@param node the XML element that specifies which components to document
@param summaryContentTree the content tree to which the summaries will
be added | [
"Build",
"the",
"profile",
"package",
"summary",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L167-L176 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildInterfaceSummary | public void buildInterfaceSummary(XMLNode node, Content packageSummaryContentTree) {
String interfaceTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Interface_Summary"),
configuration.getText("doclet.interfaces"));... | java | public void buildInterfaceSummary(XMLNode node, Content packageSummaryContentTree) {
String interfaceTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Interface_Summary"),
configuration.getText("doclet.interfaces"));... | [
"public",
"void",
"buildInterfaceSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"interfaceTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",... | Build the summary for the interfaces in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the interface summary
will be added | [
"Build",
"the",
"summary",
"for",
"the",
"interfaces",
"in",
"the",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L185-L201 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildClassSummary | public void buildClassSummary(XMLNode node, Content packageSummaryContentTree) {
String classTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Class_Summary"),
configuration.getText("doclet.classes"));
String... | java | public void buildClassSummary(XMLNode node, Content packageSummaryContentTree) {
String classTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Class_Summary"),
configuration.getText("doclet.classes"));
String... | [
"public",
"void",
"buildClassSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"classTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",
... | Build the summary for the classes in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the class summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"classes",
"in",
"the",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L210-L226 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildEnumSummary | public void buildEnumSummary(XMLNode node, Content packageSummaryContentTree) {
String enumTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Enum_Summary"),
configuration.getText("doclet.enums"));
String[] en... | java | public void buildEnumSummary(XMLNode node, Content packageSummaryContentTree) {
String enumTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Enum_Summary"),
configuration.getText("doclet.enums"));
String[] en... | [
"public",
"void",
"buildEnumSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"enumTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",
... | Build the summary for the enums in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the enum summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"enums",
"in",
"the",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L235-L251 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildExceptionSummary | public void buildExceptionSummary(XMLNode node, Content packageSummaryContentTree) {
String exceptionTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Exception_Summary"),
configuration.getText("doclet.exceptions"));... | java | public void buildExceptionSummary(XMLNode node, Content packageSummaryContentTree) {
String exceptionTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Exception_Summary"),
configuration.getText("doclet.exceptions"));... | [
"public",
"void",
"buildExceptionSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"exceptionTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",... | Build the summary for the exceptions in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the exception summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"exceptions",
"in",
"the",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L260-L276 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildErrorSummary | public void buildErrorSummary(XMLNode node, Content packageSummaryContentTree) {
String errorTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Error_Summary"),
configuration.getText("doclet.errors"));
String[... | java | public void buildErrorSummary(XMLNode node, Content packageSummaryContentTree) {
String errorTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Error_Summary"),
configuration.getText("doclet.errors"));
String[... | [
"public",
"void",
"buildErrorSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"errorTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
"getText",
"(",
... | Build the summary for the errors in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the error summary will
be added | [
"Build",
"the",
"summary",
"for",
"the",
"errors",
"in",
"the",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L285-L301 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java | ProfileSummaryBuilder.buildAnnotationTypeSummary | public void buildAnnotationTypeSummary(XMLNode node, Content packageSummaryContentTree) {
String annotationtypeTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Annotation_Types_Summary"),
configuration.getText("docl... | java | public void buildAnnotationTypeSummary(XMLNode node, Content packageSummaryContentTree) {
String annotationtypeTableSummary =
configuration.getText("doclet.Member_Table_Summary",
configuration.getText("doclet.Annotation_Types_Summary"),
configuration.getText("docl... | [
"public",
"void",
"buildAnnotationTypeSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"packageSummaryContentTree",
")",
"{",
"String",
"annotationtypeTableSummary",
"=",
"configuration",
".",
"getText",
"(",
"\"doclet.Member_Table_Summary\"",
",",
"configuration",
".",
... | Build the summary for the annotation type in the package.
@param node the XML element that specifies which components to document
@param packageSummaryContentTree the tree to which the annotation type
summary will be added | [
"Build",
"the",
"summary",
"for",
"the",
"annotation",
"type",
"in",
"the",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java#L310-L327 | train |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/BooleanExtensions.java | BooleanExtensions.trueOrFalse | public static <T> T trueOrFalse(final T trueCase, final T falseCase, final boolean... flags)
{
boolean interlink = true;
if (flags != null && 0 < flags.length)
{
interlink = false;
}
for (int i = 0; i < flags.length; i++)
{
if (i == 0)
{
interlink = !flags[i];
continue;
}
interlink &... | java | public static <T> T trueOrFalse(final T trueCase, final T falseCase, final boolean... flags)
{
boolean interlink = true;
if (flags != null && 0 < flags.length)
{
interlink = false;
}
for (int i = 0; i < flags.length; i++)
{
if (i == 0)
{
interlink = !flags[i];
continue;
}
interlink &... | [
"public",
"static",
"<",
"T",
">",
"T",
"trueOrFalse",
"(",
"final",
"T",
"trueCase",
",",
"final",
"T",
"falseCase",
",",
"final",
"boolean",
"...",
"flags",
")",
"{",
"boolean",
"interlink",
"=",
"true",
";",
"if",
"(",
"flags",
"!=",
"null",
"&&",
... | Decides over the given flags if the true-case or the false-case will be return.
@param <T>
the generic type
@param trueCase
the object to return in true case
@param falseCase
the object to return in false case
@param flags
the flags whice decide what to return
@return the false-case if all false or empty otherwise the... | [
"Decides",
"over",
"the",
"given",
"flags",
"if",
"the",
"true",
"-",
"case",
"or",
"the",
"false",
"-",
"case",
"will",
"be",
"return",
"."
] | 000e1f198e949ec3e721fd0fc3f5946e945232a3 | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/BooleanExtensions.java#L49-L70 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/AlertChannelCache.java | AlertChannelCache.add | public void add(Collection<AlertChannel> channels)
{
for(AlertChannel channel : channels)
this.channels.put(channel.getId(), channel);
} | java | public void add(Collection<AlertChannel> channels)
{
for(AlertChannel channel : channels)
this.channels.put(channel.getId(), channel);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"AlertChannel",
">",
"channels",
")",
"{",
"for",
"(",
"AlertChannel",
"channel",
":",
"channels",
")",
"this",
".",
"channels",
".",
"put",
"(",
"channel",
".",
"getId",
"(",
")",
",",
"channel",
")",
"... | Adds the channel list to the channels for the account.
@param channels The channels to add | [
"Adds",
"the",
"channel",
"list",
"to",
"the",
"channels",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/AlertChannelCache.java#L75-L79 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java | ClassDocImpl.addAllClasses | void addAllClasses(ListBuffer<ClassDocImpl> l, boolean filtered) {
try {
if (isSynthetic()) return;
// sometimes synthetic classes are not marked synthetic
if (!JavadocTool.isValidClassName(tsym.name.toString())) return;
if (filtered && !env.shouldDocument(tsym)) ... | java | void addAllClasses(ListBuffer<ClassDocImpl> l, boolean filtered) {
try {
if (isSynthetic()) return;
// sometimes synthetic classes are not marked synthetic
if (!JavadocTool.isValidClassName(tsym.name.toString())) return;
if (filtered && !env.shouldDocument(tsym)) ... | [
"void",
"addAllClasses",
"(",
"ListBuffer",
"<",
"ClassDocImpl",
">",
"l",
",",
"boolean",
"filtered",
")",
"{",
"try",
"{",
"if",
"(",
"isSynthetic",
"(",
")",
")",
"return",
";",
"// sometimes synthetic classes are not marked synthetic",
"if",
"(",
"!",
"Javad... | Adds all inner classes of this class, and their
inner classes recursively, to the list l. | [
"Adds",
"all",
"inner",
"classes",
"of",
"this",
"class",
"and",
"their",
"inner",
"classes",
"recursively",
"to",
"the",
"list",
"l",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java#L674-L699 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MathUtils.java | MathUtils.randomLong | public static long randomLong(final long min, final long max) {
return Math.round(Math.random() * (max - min) + min);
} | java | public static long randomLong(final long min, final long max) {
return Math.round(Math.random() * (max - min) + min);
} | [
"public",
"static",
"long",
"randomLong",
"(",
"final",
"long",
"min",
",",
"final",
"long",
"max",
")",
"{",
"return",
"Math",
".",
"round",
"(",
"Math",
".",
"random",
"(",
")",
"*",
"(",
"max",
"-",
"min",
")",
"+",
"min",
")",
";",
"}"
] | Returns a natural long value between given minimum value and max value.
@param min
the minimum value to random.
@param max
the max value to random.
@return a natural long value between given minimum value and max value. | [
"Returns",
"a",
"natural",
"long",
"value",
"between",
"given",
"minimum",
"value",
"and",
"max",
"value",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MathUtils.java#L88-L91 | train |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/AnnotationExtensions.java | AnnotationExtensions.getAllAnnotatedClasses | public static Set<Class<?>> getAllAnnotatedClasses(final String packagePath,
final Class<? extends Annotation> annotationClass)
throws ClassNotFoundException, IOException, URISyntaxException
{
final List<File> directories = ClassExtensions.getDirectoriesFromResources(packagePath,
true);
final Set<Class<?>> ... | java | public static Set<Class<?>> getAllAnnotatedClasses(final String packagePath,
final Class<? extends Annotation> annotationClass)
throws ClassNotFoundException, IOException, URISyntaxException
{
final List<File> directories = ClassExtensions.getDirectoriesFromResources(packagePath,
true);
final Set<Class<?>> ... | [
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"getAllAnnotatedClasses",
"(",
"final",
"String",
"packagePath",
",",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"throws",
"ClassNotFoundException",
",",
"IOExcep... | Gets all annotated classes that belongs from the given package path and the given annotation
class.
@param packagePath
the package path
@param annotationClass
the annotation class
@return the all classes
@throws ClassNotFoundException
occurs if a given class cannot be located by the specified class loader
@throws IOEx... | [
"Gets",
"all",
"annotated",
"classes",
"that",
"belongs",
"from",
"the",
"given",
"package",
"path",
"and",
"the",
"given",
"annotation",
"class",
"."
] | 000e1f198e949ec3e721fd0fc3f5946e945232a3 | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L70-L82 | train |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/AnnotationExtensions.java | AnnotationExtensions.getAllAnnotatedClassesFromSet | public static Set<Class<?>> getAllAnnotatedClassesFromSet(final String packagePath,
final Set<Class<? extends Annotation>> annotationClasses)
throws ClassNotFoundException, IOException, URISyntaxException
{
final List<File> directories = ClassExtensions.getDirectoriesFromResources(packagePath,
true);
final ... | java | public static Set<Class<?>> getAllAnnotatedClassesFromSet(final String packagePath,
final Set<Class<? extends Annotation>> annotationClasses)
throws ClassNotFoundException, IOException, URISyntaxException
{
final List<File> directories = ClassExtensions.getDirectoriesFromResources(packagePath,
true);
final ... | [
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"getAllAnnotatedClassesFromSet",
"(",
"final",
"String",
"packagePath",
",",
"final",
"Set",
"<",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
">",
"annotationClasses",
")",
"throws",
"ClassNotFo... | Gets all annotated classes that belongs from the given package path and the given list with
annotation classes.
@param packagePath
the package path
@param annotationClasses
the list with the annotation classes
@return the all classes
@throws ClassNotFoundException
occurs if a given class cannot be located by the spec... | [
"Gets",
"all",
"annotated",
"classes",
"that",
"belongs",
"from",
"the",
"given",
"package",
"path",
"and",
"the",
"given",
"list",
"with",
"annotation",
"classes",
"."
] | 000e1f198e949ec3e721fd0fc3f5946e945232a3 | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L103-L116 | train |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/AnnotationExtensions.java | AnnotationExtensions.getAnnotation | public static <T extends Annotation> T getAnnotation(final Class<?> componentClass,
final Class<T> annotationClass)
{
T annotation = componentClass.getAnnotation(annotationClass);
if (annotation != null)
{
return annotation;
}
for (final Class<?> ifc : componentClass.getInterfaces())
{
annotation =... | java | public static <T extends Annotation> T getAnnotation(final Class<?> componentClass,
final Class<T> annotationClass)
{
T annotation = componentClass.getAnnotation(annotationClass);
if (annotation != null)
{
return annotation;
}
for (final Class<?> ifc : componentClass.getInterfaces())
{
annotation =... | [
"public",
"static",
"<",
"T",
"extends",
"Annotation",
">",
"T",
"getAnnotation",
"(",
"final",
"Class",
"<",
"?",
">",
"componentClass",
",",
"final",
"Class",
"<",
"T",
">",
"annotationClass",
")",
"{",
"T",
"annotation",
"=",
"componentClass",
".",
"get... | Search for the given annotationClass in the given componentClass and return it if search was
successful.
@param <T>
the generic type
@param componentClass
the component class
@param annotationClass
the annotation class
@return the annotation | [
"Search",
"for",
"the",
"given",
"annotationClass",
"in",
"the",
"given",
"componentClass",
"and",
"return",
"it",
"if",
"search",
"was",
"successful",
"."
] | 000e1f198e949ec3e721fd0fc3f5946e945232a3 | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L175-L208 | train |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/AnnotationExtensions.java | AnnotationExtensions.scanForClasses | public static Set<Class<?>> scanForClasses(final File directory, final String packagePath)
throws ClassNotFoundException
{
return AnnotationExtensions.scanForAnnotatedClasses(directory, packagePath, null);
} | java | public static Set<Class<?>> scanForClasses(final File directory, final String packagePath)
throws ClassNotFoundException
{
return AnnotationExtensions.scanForAnnotatedClasses(directory, packagePath, null);
} | [
"public",
"static",
"Set",
"<",
"Class",
"<",
"?",
">",
">",
"scanForClasses",
"(",
"final",
"File",
"directory",
",",
"final",
"String",
"packagePath",
")",
"throws",
"ClassNotFoundException",
"{",
"return",
"AnnotationExtensions",
".",
"scanForAnnotatedClasses",
... | Scan recursive for classes in the given directory.
@param directory
the directory
@param packagePath
the package path
@return the list
@throws ClassNotFoundException
occurs if a given class cannot be located by the specified class loader | [
"Scan",
"recursive",
"for",
"classes",
"in",
"the",
"given",
"directory",
"."
] | 000e1f198e949ec3e721fd0fc3f5946e945232a3 | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L416-L420 | train |
lightblueseas/jcommons-lang | src/main/java/de/alpharogroup/lang/AnnotationExtensions.java | AnnotationExtensions.setAnnotationValue | @SuppressWarnings("unchecked")
public static Object setAnnotationValue(final Annotation annotation, final String key,
final Object value) throws NoSuchFieldException, SecurityException,
IllegalArgumentException, IllegalAccessException
{
final Object invocationHandler = Proxy.getInvocationHandler(annotation);
... | java | @SuppressWarnings("unchecked")
public static Object setAnnotationValue(final Annotation annotation, final String key,
final Object value) throws NoSuchFieldException, SecurityException,
IllegalArgumentException, IllegalAccessException
{
final Object invocationHandler = Proxy.getInvocationHandler(annotation);
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Object",
"setAnnotationValue",
"(",
"final",
"Annotation",
"annotation",
",",
"final",
"String",
"key",
",",
"final",
"Object",
"value",
")",
"throws",
"NoSuchFieldException",
",",
"SecurityExc... | Sets the annotation value for the given key of the given annotation to the given new value at
runtime.
@param annotation
the annotation
@param key
the key
@param value
the value to set
@return the old value or default value if not set
@throws NoSuchFieldException
the no such field exception
@throws SecurityException
T... | [
"Sets",
"the",
"annotation",
"value",
"for",
"the",
"given",
"key",
"of",
"the",
"given",
"annotation",
"to",
"the",
"given",
"new",
"value",
"at",
"runtime",
"."
] | 000e1f198e949ec3e721fd0fc3f5946e945232a3 | https://github.com/lightblueseas/jcommons-lang/blob/000e1f198e949ec3e721fd0fc3f5946e945232a3/src/main/java/de/alpharogroup/lang/AnnotationExtensions.java#L442-L458 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/ServiceLoader.java | ServiceLoader.iterator | public Iterator<S> iterator() {
return new Iterator<S>() {
Iterator<Map.Entry<String,S>> knownProviders
= providers.entrySet().iterator();
public boolean hasNext() {
if (knownProviders.hasNext())
return true;
return lo... | java | public Iterator<S> iterator() {
return new Iterator<S>() {
Iterator<Map.Entry<String,S>> knownProviders
= providers.entrySet().iterator();
public boolean hasNext() {
if (knownProviders.hasNext())
return true;
return lo... | [
"public",
"Iterator",
"<",
"S",
">",
"iterator",
"(",
")",
"{",
"return",
"new",
"Iterator",
"<",
"S",
">",
"(",
")",
"{",
"Iterator",
"<",
"Map",
".",
"Entry",
"<",
"String",
",",
"S",
">",
">",
"knownProviders",
"=",
"providers",
".",
"entrySet",
... | Lazily loads the available providers of this loader's service.
<p> The iterator returned by this method first yields all of the
elements of the provider cache, in instantiation order. It then lazily
loads and instantiates any remaining providers, adding each one to the
cache in turn.
<p> To achieve laziness the actu... | [
"Lazily",
"loads",
"the",
"available",
"providers",
"of",
"this",
"loader",
"s",
"service",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/ServiceLoader.java#L322-L345 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Interface.java | Interface.getFunction | public Function getFunction(String name) {
for (Function f : functions) {
if (f.getName().equals(name))
return f;
}
return null;
} | java | public Function getFunction(String name) {
for (Function f : functions) {
if (f.getName().equals(name))
return f;
}
return null;
} | [
"public",
"Function",
"getFunction",
"(",
"String",
"name",
")",
"{",
"for",
"(",
"Function",
"f",
":",
"functions",
")",
"{",
"if",
"(",
"f",
".",
"getName",
"(",
")",
".",
"equals",
"(",
"name",
")",
")",
"return",
"f",
";",
"}",
"return",
"null"... | Returns the Function with the given name, or null if none matches. | [
"Returns",
"the",
"Function",
"with",
"the",
"given",
"name",
"or",
"null",
"if",
"none",
"matches",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Interface.java#L40-L47 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/Interface.java | Interface.setContract | @Override
public void setContract(Contract c) {
super.setContract(c);
for (Function f : functions) {
f.setContract(c);
}
} | java | @Override
public void setContract(Contract c) {
super.setContract(c);
for (Function f : functions) {
f.setContract(c);
}
} | [
"@",
"Override",
"public",
"void",
"setContract",
"(",
"Contract",
"c",
")",
"{",
"super",
".",
"setContract",
"(",
"c",
")",
";",
"for",
"(",
"Function",
"f",
":",
"functions",
")",
"{",
"f",
".",
"setContract",
"(",
"c",
")",
";",
"}",
"}"
] | Sets the Contract this Interface is a part of. Propegates to its Functions | [
"Sets",
"the",
"Contract",
"this",
"Interface",
"is",
"a",
"part",
"of",
".",
"Propegates",
"to",
"its",
"Functions"
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/Interface.java#L52-L58 | train |
trellis-ldp-archive/trellis-api | src/main/java/org/trellisldp/api/RDFUtils.java | RDFUtils.toGraph | public static Collector<Triple, ?, Graph> toGraph() {
return of(rdf::createGraph, Graph::add, (left, right) -> {
right.iterate().forEach(left::add);
return left;
}, UNORDERED);
} | java | public static Collector<Triple, ?, Graph> toGraph() {
return of(rdf::createGraph, Graph::add, (left, right) -> {
right.iterate().forEach(left::add);
return left;
}, UNORDERED);
} | [
"public",
"static",
"Collector",
"<",
"Triple",
",",
"?",
",",
"Graph",
">",
"toGraph",
"(",
")",
"{",
"return",
"of",
"(",
"rdf",
"::",
"createGraph",
",",
"Graph",
"::",
"add",
",",
"(",
"left",
",",
"right",
")",
"->",
"{",
"right",
".",
"iterat... | Collect a stream of Triples into a Graph
@return a graph | [
"Collect",
"a",
"stream",
"of",
"Triples",
"into",
"a",
"Graph"
] | 9538979dc90e2d37c83d98870cd3795a2c96915e | https://github.com/trellis-ldp-archive/trellis-api/blob/9538979dc90e2d37c83d98870cd3795a2c96915e/src/main/java/org/trellisldp/api/RDFUtils.java#L61-L66 | train |
trellis-ldp-archive/trellis-api | src/main/java/org/trellisldp/api/RDFUtils.java | RDFUtils.toDataset | public static Collector<Quad, ?, Dataset> toDataset() {
return of(rdf::createDataset, Dataset::add, (left, right) -> {
right.iterate().forEach(left::add);
return left;
}, UNORDERED);
} | java | public static Collector<Quad, ?, Dataset> toDataset() {
return of(rdf::createDataset, Dataset::add, (left, right) -> {
right.iterate().forEach(left::add);
return left;
}, UNORDERED);
} | [
"public",
"static",
"Collector",
"<",
"Quad",
",",
"?",
",",
"Dataset",
">",
"toDataset",
"(",
")",
"{",
"return",
"of",
"(",
"rdf",
"::",
"createDataset",
",",
"Dataset",
"::",
"add",
",",
"(",
"left",
",",
"right",
")",
"->",
"{",
"right",
".",
"... | Collect a stream of Quads into a Dataset
@return a dataset | [
"Collect",
"a",
"stream",
"of",
"Quads",
"into",
"a",
"Dataset"
] | 9538979dc90e2d37c83d98870cd3795a2c96915e | https://github.com/trellis-ldp-archive/trellis-api/blob/9538979dc90e2d37c83d98870cd3795a2c96915e/src/main/java/org/trellisldp/api/RDFUtils.java#L72-L77 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/factory/ContextFactory.java | ContextFactory.toCreate | public ContextFactory toCreate(BiFunction<Constructor, Object[], Object> function) {
return new ContextFactory(this.context, function);
} | java | public ContextFactory toCreate(BiFunction<Constructor, Object[], Object> function) {
return new ContextFactory(this.context, function);
} | [
"public",
"ContextFactory",
"toCreate",
"(",
"BiFunction",
"<",
"Constructor",
",",
"Object",
"[",
"]",
",",
"Object",
">",
"function",
")",
"{",
"return",
"new",
"ContextFactory",
"(",
"this",
".",
"context",
",",
"function",
")",
";",
"}"
] | Changes the way the objects are created by using the given function.
@param function the function to use for creating the objects.
@return a new ContextFactory that uses the given function and this context | [
"Changes",
"the",
"way",
"the",
"objects",
"are",
"created",
"by",
"using",
"the",
"given",
"function",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/factory/ContextFactory.java#L89-L91 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/factory/ContextFactory.java | ContextFactory.create | public <E> Optional<E> create(Class<E> type) {
List<Constructor<?>> constructors = reflect().constructors()
.filter(declared(Modifier.PUBLIC))
.from(type);
Optional created;
for (Constructor<?> constructor : constructors) {
created = tryCreate(constructor);
if (created.isPresent(... | java | public <E> Optional<E> create(Class<E> type) {
List<Constructor<?>> constructors = reflect().constructors()
.filter(declared(Modifier.PUBLIC))
.from(type);
Optional created;
for (Constructor<?> constructor : constructors) {
created = tryCreate(constructor);
if (created.isPresent(... | [
"public",
"<",
"E",
">",
"Optional",
"<",
"E",
">",
"create",
"(",
"Class",
"<",
"E",
">",
"type",
")",
"{",
"List",
"<",
"Constructor",
"<",
"?",
">",
">",
"constructors",
"=",
"reflect",
"(",
")",
".",
"constructors",
"(",
")",
".",
"filter",
"... | Creates a new instance of the given type by looping through its public
constructors to find one which all parameters are resolved by the context.
@param type the type of the object to create.
@return the created object | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"given",
"type",
"by",
"looping",
"through",
"its",
"public",
"constructors",
"to",
"find",
"one",
"which",
"all",
"parameters",
"are",
"resolved",
"by",
"the",
"context",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/factory/ContextFactory.java#L100-L112 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/factory/ContextFactory.java | ContextFactory.tryCreate | private Optional tryCreate(Constructor<?> constructor) {
Object[] args = new Object[constructor.getParameterCount()];
Object arg;
Optional<Object> resolved;
int i = 0;
for (Parameter parameter : constructor.getParameters()) {
resolved = context.resolve(parameter);
if (!resolved.isPresent... | java | private Optional tryCreate(Constructor<?> constructor) {
Object[] args = new Object[constructor.getParameterCount()];
Object arg;
Optional<Object> resolved;
int i = 0;
for (Parameter parameter : constructor.getParameters()) {
resolved = context.resolve(parameter);
if (!resolved.isPresent... | [
"private",
"Optional",
"tryCreate",
"(",
"Constructor",
"<",
"?",
">",
"constructor",
")",
"{",
"Object",
"[",
"]",
"args",
"=",
"new",
"Object",
"[",
"constructor",
".",
"getParameterCount",
"(",
")",
"]",
";",
"Object",
"arg",
";",
"Optional",
"<",
"Ob... | tries to create the object using the given constructor | [
"tries",
"to",
"create",
"the",
"object",
"using",
"the",
"given",
"constructor"
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/factory/ContextFactory.java#L115-L129 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/comp/JavaCompilerWithDeps.java | JavaCompilerWithDeps.reportPublicApi | @Override
public void reportPublicApi(ClassSymbol sym) {
// The next test will catch when source files are located in the wrong directory!
// This ought to be moved into javac as a new warning, or perhaps as part
// of the auxiliary class warning.
// For example if sun.swing.BeanInf... | java | @Override
public void reportPublicApi(ClassSymbol sym) {
// The next test will catch when source files are located in the wrong directory!
// This ought to be moved into javac as a new warning, or perhaps as part
// of the auxiliary class warning.
// For example if sun.swing.BeanInf... | [
"@",
"Override",
"public",
"void",
"reportPublicApi",
"(",
"ClassSymbol",
"sym",
")",
"{",
"// The next test will catch when source files are located in the wrong directory!",
"// This ought to be moved into javac as a new warning, or perhaps as part",
"// of the auxiliary class warning.",
... | Collect the public apis of classes supplied explicitly for compilation.
@param sym The class to visit. | [
"Collect",
"the",
"public",
"apis",
"of",
"classes",
"supplied",
"explicitly",
"for",
"compilation",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/comp/JavaCompilerWithDeps.java#L69-L108 | train |
mcpat/microjiac-public | tools/microjiac-midlet-maven-plugin/src/main/java/de/jiac/micro/mojo/JADMojo.java | JADMojo.execute | public void execute() throws MojoExecutionException {
getLog().debug("starting packaging");
AbstractConfiguration[] configurations= (AbstractConfiguration[]) getPluginContext().get(ConfiguratorMojo.GENERATED_CONFIGURATIONS_KEY);
try {
for(AbstractConfiguration confi... | java | public void execute() throws MojoExecutionException {
getLog().debug("starting packaging");
AbstractConfiguration[] configurations= (AbstractConfiguration[]) getPluginContext().get(ConfiguratorMojo.GENERATED_CONFIGURATIONS_KEY);
try {
for(AbstractConfiguration confi... | [
"public",
"void",
"execute",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"getLog",
"(",
")",
".",
"debug",
"(",
"\"starting packaging\"",
")",
";",
"AbstractConfiguration",
"[",
"]",
"configurations",
"=",
"(",
"AbstractConfiguration",
"[",
"]",
")",
"get... | Generates the JAD. | [
"Generates",
"the",
"JAD",
"."
] | 3c649e44846981a68e84cc4578719532414d8d35 | https://github.com/mcpat/microjiac-public/blob/3c649e44846981a68e84cc4578719532414d8d35/tools/microjiac-midlet-maven-plugin/src/main/java/de/jiac/micro/mojo/JADMojo.java#L51-L77 | train |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/report/connectors/FreemarkerSQLDataReportConnector.java | FreemarkerSQLDataReportConnector.resultSetToMap | public List<Map<String,Object>> resultSetToMap(ResultSet rows) {
try {
List<Map<String,Object>> beans = new ArrayList<Map<String,Object>>();
int columnCount = rows.getMetaData().getColumnCount();
while (rows.next()) {
LinkedHashMap<String,Object> bean = new Li... | java | public List<Map<String,Object>> resultSetToMap(ResultSet rows) {
try {
List<Map<String,Object>> beans = new ArrayList<Map<String,Object>>();
int columnCount = rows.getMetaData().getColumnCount();
while (rows.next()) {
LinkedHashMap<String,Object> bean = new Li... | [
"public",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"resultSetToMap",
"(",
"ResultSet",
"rows",
")",
"{",
"try",
"{",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"beans",
"=",
"new",
"ArrayList",
"<",
"Map",
"<",
"... | Returns a preparedStatement result into a List of Maps. Not the most efficient way of storing the values, however
the results should be limited at this stage.
@param rows The result set.
@return Mapped results.
@throws RuntimeException upon any error, adds values to "errors" | [
"Returns",
"a",
"preparedStatement",
"result",
"into",
"a",
"List",
"of",
"Maps",
".",
"Not",
"the",
"most",
"efficient",
"way",
"of",
"storing",
"the",
"values",
"however",
"the",
"results",
"should",
"be",
"limited",
"at",
"this",
"stage",
"."
] | 5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/report/connectors/FreemarkerSQLDataReportConnector.java#L234-L253 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java | LambdaToMethod.makeMetafactoryIndyCall | private JCExpression makeMetafactoryIndyCall(TranslationContext<?> context,
int refKind, Symbol refSym, List<JCExpression> indy_args) {
JCFunctionalExpression tree = context.tree;
//determine the static bsm args
MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.typ... | java | private JCExpression makeMetafactoryIndyCall(TranslationContext<?> context,
int refKind, Symbol refSym, List<JCExpression> indy_args) {
JCFunctionalExpression tree = context.tree;
//determine the static bsm args
MethodSymbol samSym = (MethodSymbol) types.findDescriptorSymbol(tree.typ... | [
"private",
"JCExpression",
"makeMetafactoryIndyCall",
"(",
"TranslationContext",
"<",
"?",
">",
"context",
",",
"int",
"refKind",
",",
"Symbol",
"refSym",
",",
"List",
"<",
"JCExpression",
">",
"indy_args",
")",
"{",
"JCFunctionalExpression",
"tree",
"=",
"context... | Generate an indy method call to the meta factory | [
"Generate",
"an",
"indy",
"method",
"call",
"to",
"the",
"meta",
"factory"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java#L983-L1051 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java | LambdaToMethod.makeIndyCall | private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmName,
List<Object> staticArgs, MethodType indyType, List<JCExpression> indyArgs,
Name methName) {
int prevPos = make.pos;
try {
make.at(pos);
List<Type> bsm_staticArgs = List.of(s... | java | private JCExpression makeIndyCall(DiagnosticPosition pos, Type site, Name bsmName,
List<Object> staticArgs, MethodType indyType, List<JCExpression> indyArgs,
Name methName) {
int prevPos = make.pos;
try {
make.at(pos);
List<Type> bsm_staticArgs = List.of(s... | [
"private",
"JCExpression",
"makeIndyCall",
"(",
"DiagnosticPosition",
"pos",
",",
"Type",
"site",
",",
"Name",
"bsmName",
",",
"List",
"<",
"Object",
">",
"staticArgs",
",",
"MethodType",
"indyType",
",",
"List",
"<",
"JCExpression",
">",
"indyArgs",
",",
"Nam... | Generate an indy method call with given name, type and static bootstrap
arguments types | [
"Generate",
"an",
"indy",
"method",
"call",
"with",
"given",
"name",
"type",
"and",
"static",
"bootstrap",
"arguments",
"types"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java#L1057-L1090 | train |
brianwhu/xillium | core/src/main/java/org/xillium/core/util/ProxyService.java | ProxyService.lookupServerURL | protected String lookupServerURL(DataBinder binder) {
_logger.info("STANDARD lookupServerURL: servers=" + _servers + ", selector='" + _selector + '\'');
if (_servers != null) {
if (_selector != null) {
return _servers.get(binder.get(_selector));
} else if (_server... | java | protected String lookupServerURL(DataBinder binder) {
_logger.info("STANDARD lookupServerURL: servers=" + _servers + ", selector='" + _selector + '\'');
if (_servers != null) {
if (_selector != null) {
return _servers.get(binder.get(_selector));
} else if (_server... | [
"protected",
"String",
"lookupServerURL",
"(",
"DataBinder",
"binder",
")",
"{",
"_logger",
".",
"info",
"(",
"\"STANDARD lookupServerURL: servers=\"",
"+",
"_servers",
"+",
"\", selector='\"",
"+",
"_selector",
"+",
"'",
"'",
")",
";",
"if",
"(",
"_servers",
"!... | Looks up server URL based on request parameters in the data binder.
The default implementation uses a servers looup map and a selector parameter. You may choose not to use a selector if the
lookup map contains only 1 entry.
@return the URL to a remote server, or null if lookup fails | [
"Looks",
"up",
"server",
"URL",
"based",
"on",
"request",
"parameters",
"in",
"the",
"data",
"binder",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/core/src/main/java/org/xillium/core/util/ProxyService.java#L30-L43 | train |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.clean | public void clean() {
log.debug("[clean] Cleaning world");
for (Robot bot : robotsPosition.keySet()) {
bot.die("World cleanup");
if (robotsPosition.containsKey(bot)) {
log.warn("[clean] Robot did not unregister itself. Removing it");
remove(bot);
}
}
} | java | public void clean() {
log.debug("[clean] Cleaning world");
for (Robot bot : robotsPosition.keySet()) {
bot.die("World cleanup");
if (robotsPosition.containsKey(bot)) {
log.warn("[clean] Robot did not unregister itself. Removing it");
remove(bot);
}
}
} | [
"public",
"void",
"clean",
"(",
")",
"{",
"log",
".",
"debug",
"(",
"\"[clean] Cleaning world\"",
")",
";",
"for",
"(",
"Robot",
"bot",
":",
"robotsPosition",
".",
"keySet",
"(",
")",
")",
"{",
"bot",
".",
"die",
"(",
"\"World cleanup\"",
")",
";",
"if... | Called to dispose of the world | [
"Called",
"to",
"dispose",
"of",
"the",
"world"
] | 0e31c1ecf1006e35f68c229ff66c37640effffac | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L170-L181 | train |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.move | public void move(Robot robot) {
if (!robotsPosition.containsKey(robot)) {
throw new IllegalArgumentException("Robot doesn't exist");
}
if (!robot.getData().isMobile()) {
throw new IllegalArgumentException("Robot can't move");
}
Point newPosition = getReferenceField(robot, 1);
if (!isOccupied(newPositio... | java | public void move(Robot robot) {
if (!robotsPosition.containsKey(robot)) {
throw new IllegalArgumentException("Robot doesn't exist");
}
if (!robot.getData().isMobile()) {
throw new IllegalArgumentException("Robot can't move");
}
Point newPosition = getReferenceField(robot, 1);
if (!isOccupied(newPositio... | [
"public",
"void",
"move",
"(",
"Robot",
"robot",
")",
"{",
"if",
"(",
"!",
"robotsPosition",
".",
"containsKey",
"(",
"robot",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Robot doesn't exist\"",
")",
";",
"}",
"if",
"(",
"!",
"robot"... | Changes the position of a robot to its current reference field
@param robot the robot | [
"Changes",
"the",
"position",
"of",
"a",
"robot",
"to",
"its",
"current",
"reference",
"field"
] | 0e31c1ecf1006e35f68c229ff66c37640effffac | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L188-L203 | train |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.getNeighbour | public Robot getNeighbour(Robot robot) {
Point neighbourPos = getReferenceField(robot, 1);
return getRobotAt(neighbourPos);
} | java | public Robot getNeighbour(Robot robot) {
Point neighbourPos = getReferenceField(robot, 1);
return getRobotAt(neighbourPos);
} | [
"public",
"Robot",
"getNeighbour",
"(",
"Robot",
"robot",
")",
"{",
"Point",
"neighbourPos",
"=",
"getReferenceField",
"(",
"robot",
",",
"1",
")",
";",
"return",
"getRobotAt",
"(",
"neighbourPos",
")",
";",
"}"
] | Gets the robot in the reference field
@param robot the robot to use as centre
@return the robot in front, or null if field is empty | [
"Gets",
"the",
"robot",
"in",
"the",
"reference",
"field"
] | 0e31c1ecf1006e35f68c229ff66c37640effffac | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L252-L256 | train |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.scan | public ScanResult scan(Robot robot, int dist) {
Point space = getReferenceField(robot, dist);
Robot inPosition = getRobotAt(space);
ScanResult ret = null;
if (inPosition == null) {
ret = new ScanResult(Found.EMPTY, dist);
} else {
if (robot.getData().getTeamId() == inPosition.getData().getTeamId()) {
r... | java | public ScanResult scan(Robot robot, int dist) {
Point space = getReferenceField(robot, dist);
Robot inPosition = getRobotAt(space);
ScanResult ret = null;
if (inPosition == null) {
ret = new ScanResult(Found.EMPTY, dist);
} else {
if (robot.getData().getTeamId() == inPosition.getData().getTeamId()) {
r... | [
"public",
"ScanResult",
"scan",
"(",
"Robot",
"robot",
",",
"int",
"dist",
")",
"{",
"Point",
"space",
"=",
"getReferenceField",
"(",
"robot",
",",
"dist",
")",
";",
"Robot",
"inPosition",
"=",
"getRobotAt",
"(",
"space",
")",
";",
"ScanResult",
"ret",
"... | Scans up to a number of fields in front of the robot, stopping on the first field that
contains a robot
@param robot scanning robot
@param dist maximum distance
@return a container of information about the scan
@see ScanResult | [
"Scans",
"up",
"to",
"a",
"number",
"of",
"fields",
"in",
"front",
"of",
"the",
"robot",
"stopping",
"on",
"the",
"first",
"field",
"that",
"contains",
"a",
"robot"
] | 0e31c1ecf1006e35f68c229ff66c37640effffac | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L277-L292 | train |
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java | World.getBotsCount | public int getBotsCount(int teamId, boolean invert) {
int total = 0;
for (Robot bot : robotsPosition.keySet()) {
if (bot.getData().getTeamId() == teamId) {
if (!invert) {
total++;
}
} else {
if (invert) {
total++;
}
}
}
return total;
} | java | public int getBotsCount(int teamId, boolean invert) {
int total = 0;
for (Robot bot : robotsPosition.keySet()) {
if (bot.getData().getTeamId() == teamId) {
if (!invert) {
total++;
}
} else {
if (invert) {
total++;
}
}
}
return total;
} | [
"public",
"int",
"getBotsCount",
"(",
"int",
"teamId",
",",
"boolean",
"invert",
")",
"{",
"int",
"total",
"=",
"0",
";",
"for",
"(",
"Robot",
"bot",
":",
"robotsPosition",
".",
"keySet",
"(",
")",
")",
"{",
"if",
"(",
"bot",
".",
"getData",
"(",
"... | Get the total number of living robots from or not from a team
@param teamId the team to search for
@param invert if true, find robots NOT in teamId
@return number of robots in the specified group | [
"Get",
"the",
"total",
"number",
"of",
"living",
"robots",
"from",
"or",
"not",
"from",
"a",
"team"
] | 0e31c1ecf1006e35f68c229ff66c37640effffac | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/World.java#L301-L316 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/sjavac/server/CompilerPool.java | CompilerPool.grabCompilerThread | public CompilerThread grabCompilerThread() throws InterruptedException {
available.acquire();
if (compilers.empty()) {
return new CompilerThread(this);
}
return compilers.pop();
} | java | public CompilerThread grabCompilerThread() throws InterruptedException {
available.acquire();
if (compilers.empty()) {
return new CompilerThread(this);
}
return compilers.pop();
} | [
"public",
"CompilerThread",
"grabCompilerThread",
"(",
")",
"throws",
"InterruptedException",
"{",
"available",
".",
"acquire",
"(",
")",
";",
"if",
"(",
"compilers",
".",
"empty",
"(",
")",
")",
"{",
"return",
"new",
"CompilerThread",
"(",
"this",
")",
";",... | Acquire a compiler thread from the pool, or block until a thread is available.
If the pools is empty, create a new thread, but never more than is "available". | [
"Acquire",
"a",
"compiler",
"thread",
"from",
"the",
"pool",
"or",
"block",
"until",
"a",
"thread",
"is",
"available",
".",
"If",
"the",
"pools",
"is",
"empty",
"create",
"a",
"new",
"thread",
"but",
"never",
"more",
"than",
"is",
"available",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/sjavac/server/CompilerPool.java#L147-L153 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/ServerCache.java | ServerCache.add | public void add(Collection<Server> servers)
{
for(Server server : servers)
this.servers.put(server.getId(), server);
} | java | public void add(Collection<Server> servers)
{
for(Server server : servers)
this.servers.put(server.getId(), server);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"Server",
">",
"servers",
")",
"{",
"for",
"(",
"Server",
"server",
":",
"servers",
")",
"this",
".",
"servers",
".",
"put",
"(",
"server",
".",
"getId",
"(",
")",
",",
"server",
")",
";",
"}"
] | Adds the server list to the servers for the account.
@param servers The servers to add | [
"Adds",
"the",
"server",
"list",
"to",
"the",
"servers",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/ServerCache.java#L55-L59 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.resolveIdent | public Symbol resolveIdent(String name) {
if (name.equals(""))
return syms.errSymbol;
JavaFileObject prev = log.useSource(null);
try {
JCExpression tree = null;
for (String s : name.split("\\.", -1)) {
if (!SourceVersion.isIdentifier(s)) // TOD... | java | public Symbol resolveIdent(String name) {
if (name.equals(""))
return syms.errSymbol;
JavaFileObject prev = log.useSource(null);
try {
JCExpression tree = null;
for (String s : name.split("\\.", -1)) {
if (!SourceVersion.isIdentifier(s)) // TOD... | [
"public",
"Symbol",
"resolveIdent",
"(",
"String",
"name",
")",
"{",
"if",
"(",
"name",
".",
"equals",
"(",
"\"\"",
")",
")",
"return",
"syms",
".",
"errSymbol",
";",
"JavaFileObject",
"prev",
"=",
"log",
".",
"useSource",
"(",
"null",
")",
";",
"try",... | Resolve an identifier.
@param name The identifier to resolve | [
"Resolve",
"an",
"identifier",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L690-L709 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.printSource | JavaFileObject printSource(Env<AttrContext> env, JCClassDecl cdef) throws IOException {
JavaFileObject outFile
= fileManager.getJavaFileForOutput(CLASS_OUTPUT,
cdef.sym.flatname.toString(),
JavaFileObject.K... | java | JavaFileObject printSource(Env<AttrContext> env, JCClassDecl cdef) throws IOException {
JavaFileObject outFile
= fileManager.getJavaFileForOutput(CLASS_OUTPUT,
cdef.sym.flatname.toString(),
JavaFileObject.K... | [
"JavaFileObject",
"printSource",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"JCClassDecl",
"cdef",
")",
"throws",
"IOException",
"{",
"JavaFileObject",
"outFile",
"=",
"fileManager",
".",
"getJavaFileForOutput",
"(",
"CLASS_OUTPUT",
",",
"cdef",
".",
"sym",
... | Emit plain Java source for a class.
@param env The attribution environment of the outermost class
containing this class.
@param cdef The class definition to be printed. | [
"Emit",
"plain",
"Java",
"source",
"for",
"a",
"class",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L716-L736 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.enterTreesIfNeeded | public List<JCCompilationUnit> enterTreesIfNeeded(List<JCCompilationUnit> roots) {
if (shouldStop(CompileState.ATTR))
return List.nil();
return enterTrees(roots);
} | java | public List<JCCompilationUnit> enterTreesIfNeeded(List<JCCompilationUnit> roots) {
if (shouldStop(CompileState.ATTR))
return List.nil();
return enterTrees(roots);
} | [
"public",
"List",
"<",
"JCCompilationUnit",
">",
"enterTreesIfNeeded",
"(",
"List",
"<",
"JCCompilationUnit",
">",
"roots",
")",
"{",
"if",
"(",
"shouldStop",
"(",
"CompileState",
".",
"ATTR",
")",
")",
"return",
"List",
".",
"nil",
"(",
")",
";",
"return"... | Enter the symbols found in a list of parse trees if the compilation
is expected to proceed beyond anno processing into attr.
As a side-effect, this puts elements on the "todo" list.
Also stores a list of all top level classes in rootClasses. | [
"Enter",
"the",
"symbols",
"found",
"in",
"a",
"list",
"of",
"parse",
"trees",
"if",
"the",
"compilation",
"is",
"expected",
"to",
"proceed",
"beyond",
"anno",
"processing",
"into",
"attr",
".",
"As",
"a",
"side",
"-",
"effect",
"this",
"puts",
"elements",... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L962-L966 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.enterTrees | public List<JCCompilationUnit> enterTrees(List<JCCompilationUnit> roots) {
//enter symbols for all files
if (!taskListener.isEmpty()) {
for (JCCompilationUnit unit: roots) {
TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit);
taskListener.started(e);
... | java | public List<JCCompilationUnit> enterTrees(List<JCCompilationUnit> roots) {
//enter symbols for all files
if (!taskListener.isEmpty()) {
for (JCCompilationUnit unit: roots) {
TaskEvent e = new TaskEvent(TaskEvent.Kind.ENTER, unit);
taskListener.started(e);
... | [
"public",
"List",
"<",
"JCCompilationUnit",
">",
"enterTrees",
"(",
"List",
"<",
"JCCompilationUnit",
">",
"roots",
")",
"{",
"//enter symbols for all files",
"if",
"(",
"!",
"taskListener",
".",
"isEmpty",
"(",
")",
")",
"{",
"for",
"(",
"JCCompilationUnit",
... | Enter the symbols found in a list of parse trees.
As a side-effect, this puts elements on the "todo" list.
Also stores a list of all top level classes in rootClasses. | [
"Enter",
"the",
"symbols",
"found",
"in",
"a",
"list",
"of",
"parse",
"trees",
".",
"As",
"a",
"side",
"-",
"effect",
"this",
"puts",
"elements",
"on",
"the",
"todo",
"list",
".",
"Also",
"stores",
"a",
"list",
"of",
"all",
"top",
"level",
"classes",
... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L973-L1016 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.flow | protected void flow(Env<AttrContext> env, Queue<Env<AttrContext>> results) {
if (compileStates.isDone(env, CompileState.FLOW)) {
results.add(env);
return;
}
try {
if (shouldStop(CompileState.FLOW))
return;
if (relax) {
... | java | protected void flow(Env<AttrContext> env, Queue<Env<AttrContext>> results) {
if (compileStates.isDone(env, CompileState.FLOW)) {
results.add(env);
return;
}
try {
if (shouldStop(CompileState.FLOW))
return;
if (relax) {
... | [
"protected",
"void",
"flow",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Queue",
"<",
"Env",
"<",
"AttrContext",
">",
">",
"results",
")",
"{",
"if",
"(",
"compileStates",
".",
"isDone",
"(",
"env",
",",
"CompileState",
".",
"FLOW",
")",
")",
"... | Perform dataflow checks on an attributed parse tree. | [
"Perform",
"dataflow",
"checks",
"on",
"an",
"attributed",
"parse",
"tree",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L1303-L1345 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/main/JavaCompiler.java | JavaCompiler.desugar | public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
for (Env<AttrContext> env: envs)
desugar(env, results);
return stopIfError(CompileState.FLOW, results);
}
H... | java | public Queue<Pair<Env<AttrContext>, JCClassDecl>> desugar(Queue<Env<AttrContext>> envs) {
ListBuffer<Pair<Env<AttrContext>, JCClassDecl>> results = new ListBuffer<>();
for (Env<AttrContext> env: envs)
desugar(env, results);
return stopIfError(CompileState.FLOW, results);
}
H... | [
"public",
"Queue",
"<",
"Pair",
"<",
"Env",
"<",
"AttrContext",
">",
",",
"JCClassDecl",
">",
">",
"desugar",
"(",
"Queue",
"<",
"Env",
"<",
"AttrContext",
">",
">",
"envs",
")",
"{",
"ListBuffer",
"<",
"Pair",
"<",
"Env",
"<",
"AttrContext",
">",
",... | Prepare attributed parse trees, in conjunction with their attribution contexts,
for source or code generation.
If any errors occur, an empty list will be returned.
@returns a list containing the classes to be generated | [
"Prepare",
"attributed",
"parse",
"trees",
"in",
"conjunction",
"with",
"their",
"attribution",
"contexts",
"for",
"source",
"or",
"code",
"generation",
".",
"If",
"any",
"errors",
"occur",
"an",
"empty",
"list",
"will",
"be",
"returned",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java#L1353-L1528 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/RootDocImpl.java | RootDocImpl.setPackages | private void setPackages(DocEnv env, List<String> packages) {
ListBuffer<PackageDocImpl> packlist = new ListBuffer<PackageDocImpl>();
for (String name : packages) {
PackageDocImpl pkg = env.lookupPackage(name);
if (pkg != null) {
pkg.isIncluded = true;
... | java | private void setPackages(DocEnv env, List<String> packages) {
ListBuffer<PackageDocImpl> packlist = new ListBuffer<PackageDocImpl>();
for (String name : packages) {
PackageDocImpl pkg = env.lookupPackage(name);
if (pkg != null) {
pkg.isIncluded = true;
... | [
"private",
"void",
"setPackages",
"(",
"DocEnv",
"env",
",",
"List",
"<",
"String",
">",
"packages",
")",
"{",
"ListBuffer",
"<",
"PackageDocImpl",
">",
"packlist",
"=",
"new",
"ListBuffer",
"<",
"PackageDocImpl",
">",
"(",
")",
";",
"for",
"(",
"String",
... | Initialize packages information.
@param env the compilation environment
@param packages a list of package names (String) | [
"Initialize",
"packages",
"information",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java#L139-L151 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/RootDocImpl.java | RootDocImpl.specifiedClasses | public ClassDoc[] specifiedClasses() {
ListBuffer<ClassDocImpl> classesToDocument = new ListBuffer<ClassDocImpl>();
for (ClassDocImpl cd : cmdLineClasses) {
cd.addAllClasses(classesToDocument, true);
}
return (ClassDoc[])classesToDocument.toArray(new ClassDocImpl[classesToDoc... | java | public ClassDoc[] specifiedClasses() {
ListBuffer<ClassDocImpl> classesToDocument = new ListBuffer<ClassDocImpl>();
for (ClassDocImpl cd : cmdLineClasses) {
cd.addAllClasses(classesToDocument, true);
}
return (ClassDoc[])classesToDocument.toArray(new ClassDocImpl[classesToDoc... | [
"public",
"ClassDoc",
"[",
"]",
"specifiedClasses",
"(",
")",
"{",
"ListBuffer",
"<",
"ClassDocImpl",
">",
"classesToDocument",
"=",
"new",
"ListBuffer",
"<",
"ClassDocImpl",
">",
"(",
")",
";",
"for",
"(",
"ClassDocImpl",
"cd",
":",
"cmdLineClasses",
")",
"... | Classes and interfaces specified on the command line. | [
"Classes",
"and",
"interfaces",
"specified",
"on",
"the",
"command",
"line",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java#L185-L191 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/EnumTypeConverter.java | EnumTypeConverter.unmarshal | @SuppressWarnings("unchecked")
public Object unmarshal(Object obj) throws RpcException {
if (obj == null) {
return returnNullIfOptional();
}
else if (obj.getClass() != String.class) {
String msg = "'" + obj + "' enum must be String, got: " +
obj.getC... | java | @SuppressWarnings("unchecked")
public Object unmarshal(Object obj) throws RpcException {
if (obj == null) {
return returnNullIfOptional();
}
else if (obj.getClass() != String.class) {
String msg = "'" + obj + "' enum must be String, got: " +
obj.getC... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"unmarshal",
"(",
"Object",
"obj",
")",
"throws",
"RpcException",
"{",
"if",
"(",
"obj",
"==",
"null",
")",
"{",
"return",
"returnNullIfOptional",
"(",
")",
";",
"}",
"else",
"if",
"("... | Enforces that obj is a String contained in the Enum's values list | [
"Enforces",
"that",
"obj",
"is",
"a",
"String",
"contained",
"in",
"the",
"Enum",
"s",
"values",
"list"
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/EnumTypeConverter.java#L27-L52 | train |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/storage/ReportsProvider.java | ReportsProvider.loadReport | protected boolean loadReport(ReportsConfig result, InputStream report, String reportName) {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
ReportConfig reportConfig = null;
try {
reportConfig = mapper.readValue(report, ReportConfig.class);
} catch (IOException e) ... | java | protected boolean loadReport(ReportsConfig result, InputStream report, String reportName) {
ObjectMapper mapper = new ObjectMapper(new YAMLFactory());
ReportConfig reportConfig = null;
try {
reportConfig = mapper.readValue(report, ReportConfig.class);
} catch (IOException e) ... | [
"protected",
"boolean",
"loadReport",
"(",
"ReportsConfig",
"result",
",",
"InputStream",
"report",
",",
"String",
"reportName",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
"new",
"YAMLFactory",
"(",
")",
")",
";",
"ReportConfig",
"repor... | Loads a report, this does the deserialization, this method can be substituted with another, called by child
classes. Once it has deserialized it, it put it into the map.
@param result
@param report
@param reportName
@return | [
"Loads",
"a",
"report",
"this",
"does",
"the",
"deserialization",
"this",
"method",
"can",
"be",
"substituted",
"with",
"another",
"called",
"by",
"child",
"classes",
".",
"Once",
"it",
"has",
"deserialized",
"it",
"it",
"put",
"it",
"into",
"the",
"map",
... | 5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/storage/ReportsProvider.java#L64-L77 | train |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/storage/ReportsProvider.java | ReportsProvider.getReportsConfig | public ReportsConfig getReportsConfig(Collection<String> restrictToNamed) {
resetErrors();
ReportsConfig result = new ReportsConfig();
InternalType[] reports = getReportList();
if (reports == null)
{
errors.add("No reports found.");
return result;
... | java | public ReportsConfig getReportsConfig(Collection<String> restrictToNamed) {
resetErrors();
ReportsConfig result = new ReportsConfig();
InternalType[] reports = getReportList();
if (reports == null)
{
errors.add("No reports found.");
return result;
... | [
"public",
"ReportsConfig",
"getReportsConfig",
"(",
"Collection",
"<",
"String",
">",
"restrictToNamed",
")",
"{",
"resetErrors",
"(",
")",
";",
"ReportsConfig",
"result",
"=",
"new",
"ReportsConfig",
"(",
")",
";",
"InternalType",
"[",
"]",
"reports",
"=",
"g... | Returns a list of reports in a ReportsConfig-uration object, it only loads reports in "restrictedToNamed", this
is useful as a secondary report-restriction mechanism. So you would pass in all reports the user can access.
@param restrictToNamed A list of report names to load. No error if one is not found.
@return | [
"Returns",
"a",
"list",
"of",
"reports",
"in",
"a",
"ReportsConfig",
"-",
"uration",
"object",
"it",
"only",
"loads",
"reports",
"in",
"restrictedToNamed",
"this",
"is",
"useful",
"as",
"a",
"secondary",
"report",
"-",
"restriction",
"mechanism",
".",
"So",
... | 5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/storage/ReportsProvider.java#L96-L119 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.