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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/LazyIntDirectTreeReader.java | LazyIntDirectTreeReader.readInt | private int readInt() throws IOException {
latestRead = (int)SerializationUtils.readIntegerType(input, WriterImpl.INT_BYTE_SIZE,
true, input.useVInts());
return latestRead;
} | java | private int readInt() throws IOException {
latestRead = (int)SerializationUtils.readIntegerType(input, WriterImpl.INT_BYTE_SIZE,
true, input.useVInts());
return latestRead;
} | [
"private",
"int",
"readInt",
"(",
")",
"throws",
"IOException",
"{",
"latestRead",
"=",
"(",
"int",
")",
"SerializationUtils",
".",
"readIntegerType",
"(",
"input",
",",
"WriterImpl",
".",
"INT_BYTE_SIZE",
",",
"true",
",",
"input",
".",
"useVInts",
"(",
")"... | Read an int value from the stream. | [
"Read",
"an",
"int",
"value",
"from",
"the",
"stream",
"."
] | a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45 | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/LazyIntDirectTreeReader.java#L42-L46 | train |
rpau/javalang-compiler | src/main/java/org/walkmod/javalang/compiler/symbols/AnonymousClassUtil.java | AnonymousClassUtil.needsSymbolData | public static boolean needsSymbolData(ObjectCreationExpr n) {
final SymbolType st = symbolDataType(n);
return st == null || !st.isLoadedAnonymousClass();
} | java | public static boolean needsSymbolData(ObjectCreationExpr n) {
final SymbolType st = symbolDataType(n);
return st == null || !st.isLoadedAnonymousClass();
} | [
"public",
"static",
"boolean",
"needsSymbolData",
"(",
"ObjectCreationExpr",
"n",
")",
"{",
"final",
"SymbolType",
"st",
"=",
"symbolDataType",
"(",
"n",
")",
";",
"return",
"st",
"==",
"null",
"||",
"!",
"st",
".",
"isLoadedAnonymousClass",
"(",
")",
";",
... | For anonymous creations the initial symbol data is symbol data of super class.
That needs to be replaced with symbol data of anonymous class.
If we don't have symbol data we assume we need one. ;-)
@param n object creation expression
@return if the expression does NOT contains a resolved type | [
"For",
"anonymous",
"creations",
"the",
"initial",
"symbol",
"data",
"is",
"symbol",
"data",
"of",
"super",
"class",
".",
"That",
"needs",
"to",
"be",
"replaced",
"with",
"symbol",
"data",
"of",
"anonymous",
"class",
".",
"If",
"we",
"don",
"t",
"have",
... | d7da81359161feef2bc7ff186c4e1b73c6a5a8ef | https://github.com/rpau/javalang-compiler/blob/d7da81359161feef2bc7ff186c4e1b73c6a5a8ef/src/main/java/org/walkmod/javalang/compiler/symbols/AnonymousClassUtil.java#L20-L23 | train |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/OrcStruct.java | OrcStruct.setFieldNames | public void setFieldNames(List<String> fieldNames) {
this.fieldNames = fieldNames;
if (fields.length != fieldNames.size()) {
Object[] oldFields = fields;
fields = new Object[fieldNames.size()];
System.arraycopy(oldFields, 0, fields, 0,
Math.min(oldFields.length, fieldNames.size()));
... | java | public void setFieldNames(List<String> fieldNames) {
this.fieldNames = fieldNames;
if (fields.length != fieldNames.size()) {
Object[] oldFields = fields;
fields = new Object[fieldNames.size()];
System.arraycopy(oldFields, 0, fields, 0,
Math.min(oldFields.length, fieldNames.size()));
... | [
"public",
"void",
"setFieldNames",
"(",
"List",
"<",
"String",
">",
"fieldNames",
")",
"{",
"this",
".",
"fieldNames",
"=",
"fieldNames",
";",
"if",
"(",
"fields",
".",
"length",
"!=",
"fieldNames",
".",
"size",
"(",
")",
")",
"{",
"Object",
"[",
"]",
... | Change the names and number of fields in the struct. No effect if the number of
fields is the same. The old field values are copied to the new array.
@param numFields the new number of fields | [
"Change",
"the",
"names",
"and",
"number",
"of",
"fields",
"in",
"the",
"struct",
".",
"No",
"effect",
"if",
"the",
"number",
"of",
"fields",
"is",
"the",
"same",
".",
"The",
"old",
"field",
"values",
"are",
"copied",
"to",
"the",
"new",
"array",
"."
] | a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45 | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/OrcStruct.java#L81-L89 | train |
neo4j/license-maven-plugin | src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java | HeaderDefinition.isSkipLine | public boolean isSkipLine(String line) {
return skipLinePattern != null && line != null && skipLinePattern.matcher(line).matches();
} | java | public boolean isSkipLine(String line) {
return skipLinePattern != null && line != null && skipLinePattern.matcher(line).matches();
} | [
"public",
"boolean",
"isSkipLine",
"(",
"String",
"line",
")",
"{",
"return",
"skipLinePattern",
"!=",
"null",
"&&",
"line",
"!=",
"null",
"&&",
"skipLinePattern",
".",
"matcher",
"(",
"line",
")",
".",
"matches",
"(",
")",
";",
"}"
] | Tells if the given content line must be skipped according to this header definition. The header is outputted
after any skipped line if any pattern defined on this point or on the first line if not pattern defined.
@param line The line to test.
@return true if this line must be skipped or false. | [
"Tells",
"if",
"the",
"given",
"content",
"line",
"must",
"be",
"skipped",
"according",
"to",
"this",
"header",
"definition",
".",
"The",
"header",
"is",
"outputted",
"after",
"any",
"skipped",
"line",
"if",
"any",
"pattern",
"defined",
"on",
"this",
"point"... | 2850cc6809820f15458400e687de2c84099a49c2 | https://github.com/neo4j/license-maven-plugin/blob/2850cc6809820f15458400e687de2c84099a49c2/src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java#L114-L116 | train |
neo4j/license-maven-plugin | src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java | HeaderDefinition.isFirstHeaderLine | public boolean isFirstHeaderLine(String line) {
return firstLineDetectionPattern != null && line != null && firstLineDetectionPattern.matcher(line).matches();
} | java | public boolean isFirstHeaderLine(String line) {
return firstLineDetectionPattern != null && line != null && firstLineDetectionPattern.matcher(line).matches();
} | [
"public",
"boolean",
"isFirstHeaderLine",
"(",
"String",
"line",
")",
"{",
"return",
"firstLineDetectionPattern",
"!=",
"null",
"&&",
"line",
"!=",
"null",
"&&",
"firstLineDetectionPattern",
".",
"matcher",
"(",
"line",
")",
".",
"matches",
"(",
")",
";",
"}"
... | Tells if the given content line is the first line of a possible header of this definition kind.
@param line The line to test.
@return true if the first line of a header have been recognized or false. | [
"Tells",
"if",
"the",
"given",
"content",
"line",
"is",
"the",
"first",
"line",
"of",
"a",
"possible",
"header",
"of",
"this",
"definition",
"kind",
"."
] | 2850cc6809820f15458400e687de2c84099a49c2 | https://github.com/neo4j/license-maven-plugin/blob/2850cc6809820f15458400e687de2c84099a49c2/src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java#L124-L126 | train |
neo4j/license-maven-plugin | src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java | HeaderDefinition.isLastHeaderLine | public boolean isLastHeaderLine(String line) {
return lastLineDetectionPattern != null && line != null && lastLineDetectionPattern.matcher(line).matches();
} | java | public boolean isLastHeaderLine(String line) {
return lastLineDetectionPattern != null && line != null && lastLineDetectionPattern.matcher(line).matches();
} | [
"public",
"boolean",
"isLastHeaderLine",
"(",
"String",
"line",
")",
"{",
"return",
"lastLineDetectionPattern",
"!=",
"null",
"&&",
"line",
"!=",
"null",
"&&",
"lastLineDetectionPattern",
".",
"matcher",
"(",
"line",
")",
".",
"matches",
"(",
")",
";",
"}"
] | Tells if the given content line is the last line of a possible header of this definition kind.
@param line The line to test.
@return true if the last line of a header have been recognized or false. | [
"Tells",
"if",
"the",
"given",
"content",
"line",
"is",
"the",
"last",
"line",
"of",
"a",
"possible",
"header",
"of",
"this",
"definition",
"kind",
"."
] | 2850cc6809820f15458400e687de2c84099a49c2 | https://github.com/neo4j/license-maven-plugin/blob/2850cc6809820f15458400e687de2c84099a49c2/src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java#L134-L136 | train |
neo4j/license-maven-plugin | src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java | HeaderDefinition.validate | public void validate() {
check("firstLine", this.firstLine);
check("beforeEachLine", this.beforeEachLine);
check("endLine", this.endLine);
check("firstLineDetectionPattern", this.firstLineDetectionPattern);
check("lastLineDetectionPattern", this.lastLineDetectionPattern);
... | java | public void validate() {
check("firstLine", this.firstLine);
check("beforeEachLine", this.beforeEachLine);
check("endLine", this.endLine);
check("firstLineDetectionPattern", this.firstLineDetectionPattern);
check("lastLineDetectionPattern", this.lastLineDetectionPattern);
... | [
"public",
"void",
"validate",
"(",
")",
"{",
"check",
"(",
"\"firstLine\"",
",",
"this",
".",
"firstLine",
")",
";",
"check",
"(",
"\"beforeEachLine\"",
",",
"this",
".",
"beforeEachLine",
")",
";",
"check",
"(",
"\"endLine\"",
",",
"this",
".",
"endLine",... | Checks this header definition consistency, in other words if all the mandatory properties of the definition have
been set.
@throws IllegalStateException If a mandatory property has not been set. | [
"Checks",
"this",
"header",
"definition",
"consistency",
"in",
"other",
"words",
"if",
"all",
"the",
"mandatory",
"properties",
"of",
"the",
"definition",
"have",
"been",
"set",
"."
] | 2850cc6809820f15458400e687de2c84099a49c2 | https://github.com/neo4j/license-maven-plugin/blob/2850cc6809820f15458400e687de2c84099a49c2/src/main/java/com/google/code/mojo/license/header/HeaderDefinition.java#L180-L189 | train |
xvik/guice-ext-annotations | src/main/java/ru/vyarus/guice/ext/ExtAnnotationsModule.java | ExtAnnotationsModule.configureManager | protected DestroyableManager configureManager(final DestroyableManager manager) {
bind(DestroyableManager.class).toInstance(manager);
// if logic will not call destroy at least it will be called before jvm shutdown
Runtime.getRuntime().addShutdownHook(new Thread(manager));
return manager... | java | protected DestroyableManager configureManager(final DestroyableManager manager) {
bind(DestroyableManager.class).toInstance(manager);
// if logic will not call destroy at least it will be called before jvm shutdown
Runtime.getRuntime().addShutdownHook(new Thread(manager));
return manager... | [
"protected",
"DestroyableManager",
"configureManager",
"(",
"final",
"DestroyableManager",
"manager",
")",
"{",
"bind",
"(",
"DestroyableManager",
".",
"class",
")",
".",
"toInstance",
"(",
"manager",
")",
";",
"// if logic will not call destroy at least it will be called b... | Registers destroyable manager in injector and adds shutdown hook to process destroy on jvm shutdown.
@param manager destroyable manager instance
@return manager instance | [
"Registers",
"destroyable",
"manager",
"in",
"injector",
"and",
"adds",
"shutdown",
"hook",
"to",
"process",
"destroy",
"on",
"jvm",
"shutdown",
"."
] | 101685e266a468298cb00e6b81f314e2ac95d724 | https://github.com/xvik/guice-ext-annotations/blob/101685e266a468298cb00e6b81f314e2ac95d724/src/main/java/ru/vyarus/guice/ext/ExtAnnotationsModule.java#L82-L87 | train |
boivie/skip32-java | src/main/java/com/boivie/skip32/Skip32.java | Skip32.skip32 | public static void skip32(byte[] key, int[] buf, boolean encrypt) {
int k; /* round number */
int i; /* round counter */
int kstep;
int wl, wr;
/* sort out direction */
if (encrypt) {
kstep = 1;
k = 0;
} else {
kstep = -1;
k = 23;
}
/* pack into words */
wl = (buf[0] << 8) + buf[1];
... | java | public static void skip32(byte[] key, int[] buf, boolean encrypt) {
int k; /* round number */
int i; /* round counter */
int kstep;
int wl, wr;
/* sort out direction */
if (encrypt) {
kstep = 1;
k = 0;
} else {
kstep = -1;
k = 23;
}
/* pack into words */
wl = (buf[0] << 8) + buf[1];
... | [
"public",
"static",
"void",
"skip32",
"(",
"byte",
"[",
"]",
"key",
",",
"int",
"[",
"]",
"buf",
",",
"boolean",
"encrypt",
")",
"{",
"int",
"k",
";",
"/* round number */",
"int",
"i",
";",
"/* round counter */",
"int",
"kstep",
";",
"int",
"wl",
",",
... | Applies the SKIP32 function on the provided value stored in buf and
modifies it inplace. This is a low-level function used by the encrypt and
decrypt functions.
@param key
@param buf
@param encrypt | [
"Applies",
"the",
"SKIP32",
"function",
"on",
"the",
"provided",
"value",
"stored",
"in",
"buf",
"and",
"modifies",
"it",
"inplace",
".",
"This",
"is",
"a",
"low",
"-",
"level",
"function",
"used",
"by",
"the",
"encrypt",
"and",
"decrypt",
"functions",
"."... | f95e5caf38d2ee5beea5e7cb834d441ddadd00a1 | https://github.com/boivie/skip32-java/blob/f95e5caf38d2ee5beea5e7cb834d441ddadd00a1/src/main/java/com/boivie/skip32/Skip32.java#L52-L84 | train |
boivie/skip32-java | src/main/java/com/boivie/skip32/Skip32.java | Skip32.encrypt | public static int encrypt(int value, byte[] key) {
int[] buf = new int[4];
buf[0] = ((value >> 24) & 0xff);
buf[1] = ((value >> 16) & 0xff);
buf[2] = ((value >> 8) & 0xff);
buf[3] = ((value >> 0) & 0xff);
skip32(key, buf, true);
int out = ((buf[0]) << 24) | ((buf[1]) << 16) | ((buf[2]) << 8)
| (buf[... | java | public static int encrypt(int value, byte[] key) {
int[] buf = new int[4];
buf[0] = ((value >> 24) & 0xff);
buf[1] = ((value >> 16) & 0xff);
buf[2] = ((value >> 8) & 0xff);
buf[3] = ((value >> 0) & 0xff);
skip32(key, buf, true);
int out = ((buf[0]) << 24) | ((buf[1]) << 16) | ((buf[2]) << 8)
| (buf[... | [
"public",
"static",
"int",
"encrypt",
"(",
"int",
"value",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"int",
"[",
"]",
"buf",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"buf",
"[",
"0",
"]",
"=",
"(",
"(",
"value",
">>",
"24",
")",
"&",
"0xff",
")... | Encrypts the provided value using the specified key
The key should be a byte array of 10 elements.
@param value
@param key
@return The encrypted value | [
"Encrypts",
"the",
"provided",
"value",
"using",
"the",
"specified",
"key"
] | f95e5caf38d2ee5beea5e7cb834d441ddadd00a1 | https://github.com/boivie/skip32-java/blob/f95e5caf38d2ee5beea5e7cb834d441ddadd00a1/src/main/java/com/boivie/skip32/Skip32.java#L95-L108 | train |
boivie/skip32-java | src/main/java/com/boivie/skip32/Skip32.java | Skip32.decrypt | public static int decrypt(int value, byte[] key) {
int[] buf = new int[4];
buf[0] = ((value >> 24) & 0xff);
buf[1] = ((value >> 16) & 0xff);
buf[2] = ((value >> 8) & 0xff);
buf[3] = ((value >> 0) & 0xff);
skip32(key, buf, false);
int out = ((buf[0]) << 24) | ((buf[1]) << 16) | ((buf[2]) << 8)
| (bu... | java | public static int decrypt(int value, byte[] key) {
int[] buf = new int[4];
buf[0] = ((value >> 24) & 0xff);
buf[1] = ((value >> 16) & 0xff);
buf[2] = ((value >> 8) & 0xff);
buf[3] = ((value >> 0) & 0xff);
skip32(key, buf, false);
int out = ((buf[0]) << 24) | ((buf[1]) << 16) | ((buf[2]) << 8)
| (bu... | [
"public",
"static",
"int",
"decrypt",
"(",
"int",
"value",
",",
"byte",
"[",
"]",
"key",
")",
"{",
"int",
"[",
"]",
"buf",
"=",
"new",
"int",
"[",
"4",
"]",
";",
"buf",
"[",
"0",
"]",
"=",
"(",
"(",
"value",
">>",
"24",
")",
"&",
"0xff",
")... | Decrypts the provided value using the specified key
The key should be a byte array of 10 elements.
@param value
@param key
@return The decrypted value | [
"Decrypts",
"the",
"provided",
"value",
"using",
"the",
"specified",
"key"
] | f95e5caf38d2ee5beea5e7cb834d441ddadd00a1 | https://github.com/boivie/skip32-java/blob/f95e5caf38d2ee5beea5e7cb834d441ddadd00a1/src/main/java/com/boivie/skip32/Skip32.java#L119-L133 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/BeanUtils.java | BeanUtils.toBasicType | public static Object toBasicType(String value, String type) throws SQLException {
// Early return from first "if" condition that evaluates to true
if (value == null) {
return null;
}
if (type == null || type.equals(String.class.getName())) {
return value;
... | java | public static Object toBasicType(String value, String type) throws SQLException {
// Early return from first "if" condition that evaluates to true
if (value == null) {
return null;
}
if (type == null || type.equals(String.class.getName())) {
return value;
... | [
"public",
"static",
"Object",
"toBasicType",
"(",
"String",
"value",
",",
"String",
"type",
")",
"throws",
"SQLException",
"{",
"// Early return from first \"if\" condition that evaluates to true",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"... | Transforms the given value to an instance of the given type.
@param value the value
@param type the type
@return an instance of the type having the wrapped value
@throws SQLException if the conversion is not possible. | [
"Transforms",
"the",
"given",
"value",
"to",
"an",
"instance",
"of",
"the",
"given",
"type",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/BeanUtils.java#L91-L158 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/BeanUtils.java | BeanUtils.throwSQLException | public static void throwSQLException(Exception cause, String theType, String value)
throws SQLException {
throw new SQLException("Invalid " + theType + " value: " + value, cause);
} | java | public static void throwSQLException(Exception cause, String theType, String value)
throws SQLException {
throw new SQLException("Invalid " + theType + " value: " + value, cause);
} | [
"public",
"static",
"void",
"throwSQLException",
"(",
"Exception",
"cause",
",",
"String",
"theType",
",",
"String",
"value",
")",
"throws",
"SQLException",
"{",
"throw",
"new",
"SQLException",
"(",
"\"Invalid \"",
"+",
"theType",
"+",
"\" value: \"",
"+",
"valu... | An helper method to build and throw a SQL Exception when a property cannot be set.
@param cause the cause
@param theType the type of the property
@param value the value of the property
@throws SQLException the SQL Exception | [
"An",
"helper",
"method",
"to",
"build",
"and",
"throw",
"a",
"SQL",
"Exception",
"when",
"a",
"property",
"cannot",
"be",
"set",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/BeanUtils.java#L167-L170 | train |
nmdp-bioinformatics/genotype-list | gl-config/src/main/java/org/nmdp/gl/config/ConfigurationModule.java | ConfigurationModule.bindPropertiesWithOverrides | protected final void bindPropertiesWithOverrides(final String propertyFile) {
checkNotNull(propertyFile, "classpath resource property file must not be null");
Properties properties = new Properties();
// load classpath resource properties
InputStream inputStream = getClass().getResourc... | java | protected final void bindPropertiesWithOverrides(final String propertyFile) {
checkNotNull(propertyFile, "classpath resource property file must not be null");
Properties properties = new Properties();
// load classpath resource properties
InputStream inputStream = getClass().getResourc... | [
"protected",
"final",
"void",
"bindPropertiesWithOverrides",
"(",
"final",
"String",
"propertyFile",
")",
"{",
"checkNotNull",
"(",
"propertyFile",
",",
"\"classpath resource property file must not be null\"",
")",
";",
"Properties",
"properties",
"=",
"new",
"Properties",
... | Bind properties from the specified classpath resource property file, overriding those values
with system properties and with environment variables after replacing key underscores '_' by dots '.'.
@param propertyFile classpath resource property file, must not be null | [
"Bind",
"properties",
"from",
"the",
"specified",
"classpath",
"resource",
"property",
"file",
"overriding",
"those",
"values",
"with",
"system",
"properties",
"and",
"with",
"environment",
"variables",
"after",
"replacing",
"key",
"underscores",
"_",
"by",
"dots",
... | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-config/src/main/java/org/nmdp/gl/config/ConfigurationModule.java#L54-L85 | train |
nmdp-bioinformatics/genotype-list | gl-config/src/main/java/org/nmdp/gl/config/ConfigurationModule.java | ConfigurationModule.looksLikeAnnotationName | protected static final boolean looksLikeAnnotationName(final String name) {
return name.startsWith("org.nmdp") && Character.isUpperCase(name.charAt(name.lastIndexOf(".") + 1));
} | java | protected static final boolean looksLikeAnnotationName(final String name) {
return name.startsWith("org.nmdp") && Character.isUpperCase(name.charAt(name.lastIndexOf(".") + 1));
} | [
"protected",
"static",
"final",
"boolean",
"looksLikeAnnotationName",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"name",
".",
"startsWith",
"(",
"\"org.nmdp\"",
")",
"&&",
"Character",
".",
"isUpperCase",
"(",
"name",
".",
"charAt",
"(",
"name",
".",
... | Return true if the specified property name looks like an annotation name.
@param name property name
@return true if the specified property name looks like an annotation name | [
"Return",
"true",
"if",
"the",
"specified",
"property",
"name",
"looks",
"like",
"an",
"annotation",
"name",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-config/src/main/java/org/nmdp/gl/config/ConfigurationModule.java#L111-L113 | train |
nmdp-bioinformatics/genotype-list | gl-config/src/main/java/org/nmdp/gl/config/ConfigurationModule.java | ConfigurationModule.annotation | @SuppressWarnings("unchecked")
protected static final <A extends Annotation> Class<A> annotation(final String annotationClassName) {
try {
return (Class<A>) Class.forName(annotationClassName);
}
catch (ClassNotFoundException e) {
throw new ProvisionException(format("c... | java | @SuppressWarnings("unchecked")
protected static final <A extends Annotation> Class<A> annotation(final String annotationClassName) {
try {
return (Class<A>) Class.forName(annotationClassName);
}
catch (ClassNotFoundException e) {
throw new ProvisionException(format("c... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"static",
"final",
"<",
"A",
"extends",
"Annotation",
">",
"Class",
"<",
"A",
">",
"annotation",
"(",
"final",
"String",
"annotationClassName",
")",
"{",
"try",
"{",
"return",
"(",
"Class",
"<"... | Return an instance of an annotation with the specified class name.
@param annotationClassName annotation class name
@return an instance of an annotation with the specified class name | [
"Return",
"an",
"instance",
"of",
"an",
"annotation",
"with",
"the",
"specified",
"class",
"name",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-config/src/main/java/org/nmdp/gl/config/ConfigurationModule.java#L121-L129 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/util/factory/AlexaIntentHandlerFactory.java | AlexaIntentHandlerFactory.createHandler | @SuppressWarnings("unchecked")
public static Optional<AlexaIntentHandler> createHandler(final AlexaInput input) {
try {
final Class factoryImpl = Class.forName(FACTORY_PACKAGE + "." + FACTORY_CLASS_NAME);
final Method method = factoryImpl.getMethod(FACTORY_METHOD_NAME, AlexaInput.cla... | java | @SuppressWarnings("unchecked")
public static Optional<AlexaIntentHandler> createHandler(final AlexaInput input) {
try {
final Class factoryImpl = Class.forName(FACTORY_PACKAGE + "." + FACTORY_CLASS_NAME);
final Method method = factoryImpl.getMethod(FACTORY_METHOD_NAME, AlexaInput.cla... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"Optional",
"<",
"AlexaIntentHandler",
">",
"createHandler",
"(",
"final",
"AlexaInput",
"input",
")",
"{",
"try",
"{",
"final",
"Class",
"factoryImpl",
"=",
"Class",
".",
"forName",
"(",
... | Constructs the AlexaIntentHandler which is tagged with the AlexaIntentListener-annotation.
If more than one handler for an intent is found it returns the one whose verify-method returns
true. If even then there's more than one handler the one with the highest priority wins (you
set the priority of an AlexaIntentHanlder... | [
"Constructs",
"the",
"AlexaIntentHandler",
"which",
"is",
"tagged",
"with",
"the",
"AlexaIntentListener",
"-",
"annotation",
".",
"If",
"more",
"than",
"one",
"handler",
"for",
"an",
"intent",
"is",
"found",
"it",
"returns",
"the",
"one",
"whose",
"verify",
"-... | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/util/factory/AlexaIntentHandlerFactory.java#L42-L53 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java | HowlLog.setLogFileDir | public void setLogFileDir(String logDirName) {
File logDir = new File(logDirName);
if (!logDir.isAbsolute()) {
logDir = new File(serverBaseDir, logDirName);
}
this.logFileDir = logDirName;
if (started) {
configuration.setLogFileDir(logDir.getAbsolutePath(... | java | public void setLogFileDir(String logDirName) {
File logDir = new File(logDirName);
if (!logDir.isAbsolute()) {
logDir = new File(serverBaseDir, logDirName);
}
this.logFileDir = logDirName;
if (started) {
configuration.setLogFileDir(logDir.getAbsolutePath(... | [
"public",
"void",
"setLogFileDir",
"(",
"String",
"logDirName",
")",
"{",
"File",
"logDir",
"=",
"new",
"File",
"(",
"logDirName",
")",
";",
"if",
"(",
"!",
"logDir",
".",
"isAbsolute",
"(",
")",
")",
"{",
"logDir",
"=",
"new",
"File",
"(",
"serverBase... | Sets the log dir.
@param logDirName the directory name | [
"Sets",
"the",
"log",
"dir",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java#L122-L132 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java | HowlLog.start | public void start() throws Exception {
started = true;
setLogFileDir(logFileDir);
LOGGER.debug("Initiating transaction manager recovery");
recovered = new HashMap<>();
logger.open(null);
ReplayListener replayListener = new GeronimoReplayListener(xidFactory, recovered);
... | java | public void start() throws Exception {
started = true;
setLogFileDir(logFileDir);
LOGGER.debug("Initiating transaction manager recovery");
recovered = new HashMap<>();
logger.open(null);
ReplayListener replayListener = new GeronimoReplayListener(xidFactory, recovered);
... | [
"public",
"void",
"start",
"(",
")",
"throws",
"Exception",
"{",
"started",
"=",
"true",
";",
"setLogFileDir",
"(",
"logFileDir",
")",
";",
"LOGGER",
".",
"debug",
"(",
"\"Initiating transaction manager recovery\"",
")",
";",
"recovered",
"=",
"new",
"HashMap",
... | Starts the logger.
@throws Exception cannot be started | [
"Starts",
"the",
"logger",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java#L138-L150 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java | HowlLog.prepare | public Object prepare(Xid xid, List<? extends TransactionBranchInfo> branches) throws LogException {
int branchCount = branches.size();
byte[][] data = new byte[3 + 2 * branchCount][];
data[0] = intToBytes(xid.getFormatId());
data[1] = xid.getGlobalTransactionId();
data[2] = xid.... | java | public Object prepare(Xid xid, List<? extends TransactionBranchInfo> branches) throws LogException {
int branchCount = branches.size();
byte[][] data = new byte[3 + 2 * branchCount][];
data[0] = intToBytes(xid.getFormatId());
data[1] = xid.getGlobalTransactionId();
data[2] = xid.... | [
"public",
"Object",
"prepare",
"(",
"Xid",
"xid",
",",
"List",
"<",
"?",
"extends",
"TransactionBranchInfo",
">",
"branches",
")",
"throws",
"LogException",
"{",
"int",
"branchCount",
"=",
"branches",
".",
"size",
"(",
")",
";",
"byte",
"[",
"]",
"[",
"]... | Prepares a transaction
@param xid the id
@param branches the branches
@return the log mark to use in commit/rollback calls.
@throws LogException on error | [
"Prepares",
"a",
"transaction"
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java#L177-L195 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java | HowlLog.commit | public void commit(Xid xid, Object logMark) throws LogException {
//the data is theoretically unnecessary but is included to help with debugging
// and because HOWL currently requires it.
byte[][] data = new byte[4][];
data[0] = new byte[]{COMMIT};
data[1] = intToBytes(xid.getFor... | java | public void commit(Xid xid, Object logMark) throws LogException {
//the data is theoretically unnecessary but is included to help with debugging
// and because HOWL currently requires it.
byte[][] data = new byte[4][];
data[0] = new byte[]{COMMIT};
data[1] = intToBytes(xid.getFor... | [
"public",
"void",
"commit",
"(",
"Xid",
"xid",
",",
"Object",
"logMark",
")",
"throws",
"LogException",
"{",
"//the data is theoretically unnecessary but is included to help with debugging",
"// and because HOWL currently requires it.",
"byte",
"[",
"]",
"[",
"]",
"data",
"... | Commits a transaction
@param xid the id
@param logMark the mark
@throws LogException on error | [
"Commits",
"a",
"transaction"
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/HowlLog.java#L203-L216 | train |
nmdp-bioinformatics/genotype-list | gl-service/src/main/java/org/nmdp/gl/service/nomenclature/AbstractNomenclature.java | AbstractNomenclature.loadAllele | protected final Allele loadAllele(final String glstring, final String accession) throws IOException {
final String id = glstringResolver.resolveAllele(glstring);
Allele allele = idResolver.findAllele(id);
if (allele == null) {
Matcher m = ALLELE_PATTERN.matcher(glstring);
... | java | protected final Allele loadAllele(final String glstring, final String accession) throws IOException {
final String id = glstringResolver.resolveAllele(glstring);
Allele allele = idResolver.findAllele(id);
if (allele == null) {
Matcher m = ALLELE_PATTERN.matcher(glstring);
... | [
"protected",
"final",
"Allele",
"loadAllele",
"(",
"final",
"String",
"glstring",
",",
"final",
"String",
"accession",
")",
"throws",
"IOException",
"{",
"final",
"String",
"id",
"=",
"glstringResolver",
".",
"resolveAllele",
"(",
"glstring",
")",
";",
"Allele",... | Load and register the specified allele in GL String format.
@param glstring allele in GL String format, must not be null or empty
@param accession allele accession, must not be null
@return the registered allele
@throws IOException if an I/O error occurs | [
"Load",
"and",
"register",
"the",
"specified",
"allele",
"in",
"GL",
"String",
"format",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-service/src/main/java/org/nmdp/gl/service/nomenclature/AbstractNomenclature.java#L96-L112 | train |
viltgroup/minium | minium-actions/src/main/java/minium/actions/internal/AbstractInteraction.java | AbstractInteraction.getFirst | protected Elements getFirst(Elements elems) {
@SuppressWarnings("unchecked")
IterableElements<Elements> iterableElems = elems.as(IterableElements.class);
return Iterables.getFirst(iterableElems, null);
} | java | protected Elements getFirst(Elements elems) {
@SuppressWarnings("unchecked")
IterableElements<Elements> iterableElems = elems.as(IterableElements.class);
return Iterables.getFirst(iterableElems, null);
} | [
"protected",
"Elements",
"getFirst",
"(",
"Elements",
"elems",
")",
"{",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"IterableElements",
"<",
"Elements",
">",
"iterableElems",
"=",
"elems",
".",
"as",
"(",
"IterableElements",
".",
"class",
")",
";",
"r... | Gets the first.
@param elems
the elems
@return the first | [
"Gets",
"the",
"first",
"."
] | f512fdd966ed4034d3ed53518eae7ad993562ab1 | https://github.com/viltgroup/minium/blob/f512fdd966ed4034d3ed53518eae7ad993562ab1/minium-actions/src/main/java/minium/actions/internal/AbstractInteraction.java#L148-L152 | train |
viltgroup/minium | minium-actions/src/main/java/minium/actions/internal/AbstractInteraction.java | AbstractInteraction.triggerReverse | protected boolean triggerReverse(Type type, Throwable e) {
return trigger(Lists.reverse(getAllListeners()), type, e);
} | java | protected boolean triggerReverse(Type type, Throwable e) {
return trigger(Lists.reverse(getAllListeners()), type, e);
} | [
"protected",
"boolean",
"triggerReverse",
"(",
"Type",
"type",
",",
"Throwable",
"e",
")",
"{",
"return",
"trigger",
"(",
"Lists",
".",
"reverse",
"(",
"getAllListeners",
"(",
")",
")",
",",
"type",
",",
"e",
")",
";",
"}"
] | Trigger reverse.
@param type
the type | [
"Trigger",
"reverse",
"."
] | f512fdd966ed4034d3ed53518eae7ad993562ab1 | https://github.com/viltgroup/minium/blob/f512fdd966ed4034d3ed53518eae7ad993562ab1/minium-actions/src/main/java/minium/actions/internal/AbstractInteraction.java#L170-L172 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java | AbstractDataSourceFactory.createDataSource | public DataSource createDataSource(Properties props) throws SQLException {
if (props == null) {
props = new Properties();
}
DataSource dataSource = newDataSource();
setBeanProperties(dataSource, props);
return dataSource;
} | java | public DataSource createDataSource(Properties props) throws SQLException {
if (props == null) {
props = new Properties();
}
DataSource dataSource = newDataSource();
setBeanProperties(dataSource, props);
return dataSource;
} | [
"public",
"DataSource",
"createDataSource",
"(",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"props",
"==",
"null",
")",
"{",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"}",
"DataSource",
"dataSource",
"=",
"newDataSource",
"... | Creates a DataSource object.
@param props The properties that define the DataSource implementation to create and how the DataSource is
configured
@return The configured DataSource
@throws SQLException If the data source cannot be created | [
"Creates",
"a",
"DataSource",
"object",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java#L62-L70 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java | AbstractDataSourceFactory.createConnectionPoolDataSource | public ConnectionPoolDataSource createConnectionPoolDataSource(Properties props) throws SQLException {
if (props == null) props = new Properties();
ConnectionPoolDataSource dataSource = newConnectionPoolDataSource();
setBeanProperties(dataSource, props);
return dataSource;
} | java | public ConnectionPoolDataSource createConnectionPoolDataSource(Properties props) throws SQLException {
if (props == null) props = new Properties();
ConnectionPoolDataSource dataSource = newConnectionPoolDataSource();
setBeanProperties(dataSource, props);
return dataSource;
} | [
"public",
"ConnectionPoolDataSource",
"createConnectionPoolDataSource",
"(",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"props",
"==",
"null",
")",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"ConnectionPoolDataSource",
"dataSource",
... | Create a ConnectionPoolDataSource object.
@param props The properties that define the ConnectionPoolDataSource implementation to create and how the
ConnectionPoolDataSource is configured
@return The configured ConnectionPoolDataSource
@throws SQLException If the data source cannot be created | [
"Create",
"a",
"ConnectionPoolDataSource",
"object",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java#L80-L85 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java | AbstractDataSourceFactory.createXADataSource | public XADataSource createXADataSource(Properties props) throws SQLException {
if (props == null) props = new Properties();
XADataSource dataSource = newXADataSource();
setBeanProperties(dataSource, props);
return dataSource;
} | java | public XADataSource createXADataSource(Properties props) throws SQLException {
if (props == null) props = new Properties();
XADataSource dataSource = newXADataSource();
setBeanProperties(dataSource, props);
return dataSource;
} | [
"public",
"XADataSource",
"createXADataSource",
"(",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"props",
"==",
"null",
")",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"XADataSource",
"dataSource",
"=",
"newXADataSource",
"(",
... | Creates an XADataSource object.
@param props The properties that define the XADataSource implementation to create and how the XADataSource is
configured
@return The configured XADataSource
@throws SQLException If the data source cannot be created | [
"Creates",
"an",
"XADataSource",
"object",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java#L95-L100 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java | AbstractDataSourceFactory.createDriver | public Driver createDriver(Properties props) throws SQLException {
Driver driver = newJdbcDriver();
setBeanProperties(driver, props);
return driver;
} | java | public Driver createDriver(Properties props) throws SQLException {
Driver driver = newJdbcDriver();
setBeanProperties(driver, props);
return driver;
} | [
"public",
"Driver",
"createDriver",
"(",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"Driver",
"driver",
"=",
"newJdbcDriver",
"(",
")",
";",
"setBeanProperties",
"(",
"driver",
",",
"props",
")",
";",
"return",
"driver",
";",
"}"
] | Creates a new JDBC Driver instance.
@param props The properties used to configure the Driver. {@literal null} indicates no properties. If the
property cannot be set on the Driver being created then an SQLException must be thrown.
@return A configured java.sql.Driver.
@throws SQLException If the driver instance cannot... | [
"Creates",
"a",
"new",
"JDBC",
"Driver",
"instance",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java#L110-L114 | train |
wisdom-framework/wisdom-jdbc | wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java | AbstractDataSourceFactory.setBeanProperties | static void setBeanProperties(Object object, Properties props)
throws SQLException {
if (props != null) {
Enumeration<?> enumeration = props.keys();
while (enumeration.hasMoreElements()) {
String name = (String) enumeration.nextElement();
setP... | java | static void setBeanProperties(Object object, Properties props)
throws SQLException {
if (props != null) {
Enumeration<?> enumeration = props.keys();
while (enumeration.hasMoreElements()) {
String name = (String) enumeration.nextElement();
setP... | [
"static",
"void",
"setBeanProperties",
"(",
"Object",
"object",
",",
"Properties",
"props",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"props",
"!=",
"null",
")",
"{",
"Enumeration",
"<",
"?",
">",
"enumeration",
"=",
"props",
".",
"keys",
"(",
")",
... | Sets the given properties on the target object.
@param object the object on which the properties need to be set
@param props the properties
@throws SQLException if a property cannot be set. | [
"Sets",
"the",
"given",
"properties",
"on",
"the",
"target",
"object",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jdbc-drivers/abstract-jdbc-driver/src/main/java/org/wisdom/jdbc/driver/helpers/AbstractDataSourceFactory.java#L123-L133 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/osgi/QuotedTokenizer.java | QuotedTokenizer.nextToken | public String nextToken(String separators) {
separator = 0;
if (peek != null) {
String tmp = peek;
peek = null;
return tmp;
}
if (index == string.length()) {
return null;
}
StringBuilder sb = new StringBuilder();
... | java | public String nextToken(String separators) {
separator = 0;
if (peek != null) {
String tmp = peek;
peek = null;
return tmp;
}
if (index == string.length()) {
return null;
}
StringBuilder sb = new StringBuilder();
... | [
"public",
"String",
"nextToken",
"(",
"String",
"separators",
")",
"{",
"separator",
"=",
"0",
";",
"if",
"(",
"peek",
"!=",
"null",
")",
"{",
"String",
"tmp",
"=",
"peek",
";",
"peek",
"=",
"null",
";",
"return",
"tmp",
";",
"}",
"if",
"(",
"index... | Retrieve next token.
@param separators the separators
@return the next token. | [
"Retrieve",
"next",
"token",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/osgi/QuotedTokenizer.java#L67-L131 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/TransactionalEntityManager.java | TransactionalEntityManager.getEM | private EntityManager getEM() throws IllegalStateException {
if (!open) {
throw new IllegalStateException("The JPA bridge has closed");
}
try {
// Do we already have one on this thread?
EntityManager em = perThreadEntityManager.get();
if (em != ... | java | private EntityManager getEM() throws IllegalStateException {
if (!open) {
throw new IllegalStateException("The JPA bridge has closed");
}
try {
// Do we already have one on this thread?
EntityManager em = perThreadEntityManager.get();
if (em != ... | [
"private",
"EntityManager",
"getEM",
"(",
")",
"throws",
"IllegalStateException",
"{",
"if",
"(",
"!",
"open",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"The JPA bridge has closed\"",
")",
";",
"}",
"try",
"{",
"// Do we already have one on this thread... | The delegated methods call this method to get the delegate. This method
verifies if we're still open, if there already is an Entity Manager for
this thread and otherwise creates it and enlists it for auto close at the
current transaction.
@return an Entity Manager | [
"The",
"delegated",
"methods",
"call",
"this",
"method",
"to",
"get",
"the",
"delegate",
".",
"This",
"method",
"verifies",
"if",
"we",
"re",
"still",
"open",
"if",
"there",
"already",
"is",
"an",
"Entity",
"Manager",
"for",
"this",
"thread",
"and",
"other... | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/TransactionalEntityManager.java#L64-L122 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaSpeechletResponse.java | AlexaSpeechletResponse.getOutputSpeech | @Override
public OutputSpeech getOutputSpeech() {
if (outputSpeech != null) {
return outputSpeech;
}
final String utterance;
try {
utterance = yamlReader.getRandomUtterance(output).orElseThrow(IOException::new);
LOG.debug("Random utterance read o... | java | @Override
public OutputSpeech getOutputSpeech() {
if (outputSpeech != null) {
return outputSpeech;
}
final String utterance;
try {
utterance = yamlReader.getRandomUtterance(output).orElseThrow(IOException::new);
LOG.debug("Random utterance read o... | [
"@",
"Override",
"public",
"OutputSpeech",
"getOutputSpeech",
"(",
")",
"{",
"if",
"(",
"outputSpeech",
"!=",
"null",
")",
"{",
"return",
"outputSpeech",
";",
"}",
"final",
"String",
"utterance",
";",
"try",
"{",
"utterance",
"=",
"yamlReader",
".",
"getRand... | Gets the generated output speech.
@return the generated output speech. | [
"Gets",
"the",
"generated",
"output",
"speech",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaSpeechletResponse.java#L94-L115 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaSpeechletResponse.java | AlexaSpeechletResponse.getReprompt | @Override
public Reprompt getReprompt() {
if (reprompt != null || !output.shouldReprompt()) {
return reprompt;
}
final String repromptSpeech = yamlReader.getRandomReprompt(output).orElse(null);
if (repromptSpeech != null) {
final String utteranceSsml = resol... | java | @Override
public Reprompt getReprompt() {
if (reprompt != null || !output.shouldReprompt()) {
return reprompt;
}
final String repromptSpeech = yamlReader.getRandomReprompt(output).orElse(null);
if (repromptSpeech != null) {
final String utteranceSsml = resol... | [
"@",
"Override",
"public",
"Reprompt",
"getReprompt",
"(",
")",
"{",
"if",
"(",
"reprompt",
"!=",
"null",
"||",
"!",
"output",
".",
"shouldReprompt",
"(",
")",
")",
"{",
"return",
"reprompt",
";",
"}",
"final",
"String",
"repromptSpeech",
"=",
"yamlReader"... | Gets the generated reprompt.
@return the generated reprompt | [
"Gets",
"the",
"generated",
"reprompt",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaSpeechletResponse.java#L121-L138 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java | PropagationManager.getActiveTransaction | private Transaction getActiveTransaction() throws SystemException {
Transaction tx = manager.getTransaction();
if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION) {
return tx;
} else {
return null;
}
} | java | private Transaction getActiveTransaction() throws SystemException {
Transaction tx = manager.getTransaction();
if (tx != null && tx.getStatus() != Status.STATUS_NO_TRANSACTION) {
return tx;
} else {
return null;
}
} | [
"private",
"Transaction",
"getActiveTransaction",
"(",
")",
"throws",
"SystemException",
"{",
"Transaction",
"tx",
"=",
"manager",
".",
"getTransaction",
"(",
")",
";",
"if",
"(",
"tx",
"!=",
"null",
"&&",
"tx",
".",
"getStatus",
"(",
")",
"!=",
"Status",
... | Checks whether or not we have an active transaction. If so, returns it.
@return the activate transaction, {@code null} if none.
@throws SystemException thrown by the transaction manager to indicate that it has encountered an
unexpected error condition that prevents future transaction services from
proceeding. | [
"Checks",
"whether",
"or",
"not",
"we",
"have",
"an",
"active",
"transaction",
".",
"If",
"so",
"returns",
"it",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java#L60-L67 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java | PropagationManager.onEntry | public void onEntry(Propagation propagation, int timeout, String interceptionId) throws SystemException,
NotSupportedException, RollbackException {
Transaction transaction = getActiveTransaction();
switch (propagation) {
case REQUIRES:
// Are we already in a tran... | java | public void onEntry(Propagation propagation, int timeout, String interceptionId) throws SystemException,
NotSupportedException, RollbackException {
Transaction transaction = getActiveTransaction();
switch (propagation) {
case REQUIRES:
// Are we already in a tran... | [
"public",
"void",
"onEntry",
"(",
"Propagation",
"propagation",
",",
"int",
"timeout",
",",
"String",
"interceptionId",
")",
"throws",
"SystemException",
",",
"NotSupportedException",
",",
"RollbackException",
"{",
"Transaction",
"transaction",
"=",
"getActiveTransactio... | Enters a transactional bloc.
@param propagation the propagation strategy
@param timeout the transaction timeout
@param interceptionId an identifier for the interception, used for logging.
@throws SystemException thrown by the transaction manager to indicate that it has encountered an
unexpected error c... | [
"Enters",
"a",
"transactional",
"bloc",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java#L83-L161 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java | PropagationManager.onExit | public void onExit(Propagation propagation, String interceptionId,
TransactionCallback callback) throws HeuristicRollbackException, HeuristicMixedException, SystemException,
InvalidTransactionException {
Transaction current = getActiveTransaction();
if (callback == nul... | java | public void onExit(Propagation propagation, String interceptionId,
TransactionCallback callback) throws HeuristicRollbackException, HeuristicMixedException, SystemException,
InvalidTransactionException {
Transaction current = getActiveTransaction();
if (callback == nul... | [
"public",
"void",
"onExit",
"(",
"Propagation",
"propagation",
",",
"String",
"interceptionId",
",",
"TransactionCallback",
"callback",
")",
"throws",
"HeuristicRollbackException",
",",
"HeuristicMixedException",
",",
"SystemException",
",",
"InvalidTransactionException",
"... | Leaves a transactional bloc. This method decides what do to with the current transaction. This includes
committing or resuming a transaction.
@param propagation the propagation strategy
@param interceptionId an identifier for the interception, used for logging.
@param callback the transaction callback
@throws... | [
"Leaves",
"a",
"transactional",
"bloc",
".",
"This",
"method",
"decides",
"what",
"do",
"to",
"with",
"the",
"current",
"transaction",
".",
"This",
"includes",
"committing",
"or",
"resuming",
"a",
"transaction",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java#L179-L269 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java | PropagationManager.onError | public void onError(Exception e, Propagation propagation, Class<? extends Exception>[] noRollbackFor,
Class<? extends Exception>[] rollbackFor, String interceptionId, TransactionCallback callback) throws SystemException, HeuristicRollbackException, HeuristicMixedException, InvalidTransactionExce... | java | public void onError(Exception e, Propagation propagation, Class<? extends Exception>[] noRollbackFor,
Class<? extends Exception>[] rollbackFor, String interceptionId, TransactionCallback callback) throws SystemException, HeuristicRollbackException, HeuristicMixedException, InvalidTransactionExce... | [
"public",
"void",
"onError",
"(",
"Exception",
"e",
",",
"Propagation",
"propagation",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"[",
"]",
"noRollbackFor",
",",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"[",
"]",
"rollbackFor",
",",
"Strin... | A transactional bloc has thrown an exception. This method decides what needs to be done in that case.
@param e the exception
@param propagation the propagation strategy
@param noRollbackFor the set of exceptions that does not make the current transaction to rollback
@param rollbackFor the set of ex... | [
"A",
"transactional",
"bloc",
"has",
"thrown",
"an",
"exception",
".",
"This",
"method",
"decides",
"what",
"needs",
"to",
"be",
"done",
"in",
"that",
"case",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/PropagationManager.java#L307-L320 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/util/factory/AlexaSpeechletFactory.java | AlexaSpeechletFactory.createSpeechletFromRequest | public static <T extends AlexaSpeechlet> T createSpeechletFromRequest(final byte[] serializedSpeechletRequest, final Class<T> speechletClass, final UtteranceReader utteranceReader) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
final JsonNode parser = mapper.readTree(serializedSpe... | java | public static <T extends AlexaSpeechlet> T createSpeechletFromRequest(final byte[] serializedSpeechletRequest, final Class<T> speechletClass, final UtteranceReader utteranceReader) throws IOException {
final ObjectMapper mapper = new ObjectMapper();
final JsonNode parser = mapper.readTree(serializedSpe... | [
"public",
"static",
"<",
"T",
"extends",
"AlexaSpeechlet",
">",
"T",
"createSpeechletFromRequest",
"(",
"final",
"byte",
"[",
"]",
"serializedSpeechletRequest",
",",
"final",
"Class",
"<",
"T",
">",
"speechletClass",
",",
"final",
"UtteranceReader",
"utteranceReader... | Creates an AlexaSpeechlet from bytes of a speechlet request. It will extract the
locale from the request and uses it for creating a new instance of AlexaSpeechlet
@param serializedSpeechletRequest bytes of a speechlet request
@param speechletClass the class of your AlexaSpeechlet to instantiate
@param utteranceReader t... | [
"Creates",
"an",
"AlexaSpeechlet",
"from",
"bytes",
"of",
"a",
"speechlet",
"request",
".",
"It",
"will",
"extract",
"the",
"locale",
"from",
"the",
"request",
"and",
"uses",
"it",
"for",
"creating",
"a",
"new",
"instance",
"of",
"AlexaSpeechlet"
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/util/factory/AlexaSpeechletFactory.java#L37-L54 | train |
nmdp-bioinformatics/genotype-list | gl-client/src/main/java/org/nmdp/gl/client/GlstringBuilder.java | GlstringBuilder.build | public String build() {
if (locus == null && tree.isEmpty()) {
throw new IllegalStateException("must call locus(String) or allele(String) at least once");
}
if (tree.isEmpty()) {
return locus;
}
String glstring = tree.toString();
char last = glstri... | java | public String build() {
if (locus == null && tree.isEmpty()) {
throw new IllegalStateException("must call locus(String) or allele(String) at least once");
}
if (tree.isEmpty()) {
return locus;
}
String glstring = tree.toString();
char last = glstri... | [
"public",
"String",
"build",
"(",
")",
"{",
"if",
"(",
"locus",
"==",
"null",
"&&",
"tree",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"must call locus(String) or allele(String) at least once\"",
")",
";",
"}",
"if",
"(... | Build and return a new GL String configured from the properties of this GL String builder.
@return a new GL String configured from the properties of this GL String builder
@throws IllegalStateException if {@link #locus(String)} or {@link #allele(String)} has not been called at least once
@throws IllegalStateException ... | [
"Build",
"and",
"return",
"a",
"new",
"GL",
"String",
"configured",
"from",
"the",
"properties",
"of",
"this",
"GL",
"String",
"builder",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-client/src/main/java/org/nmdp/gl/client/GlstringBuilder.java#L222-L235 | train |
dimaki/refuel | src/main/java/de/dimaki/refuel/appcast/boundary/AppcastManager.java | AppcastManager.download | public Path download(Appcast appcast, Path targetDir) throws IOException, Exception {
Path downloaded = null;
Enclosure enclosure = appcast.getLatestEnclosure();
if (enclosure != null) {
String url = enclosure.getUrl();
if (url != null && !url.isEmpty()) {
... | java | public Path download(Appcast appcast, Path targetDir) throws IOException, Exception {
Path downloaded = null;
Enclosure enclosure = appcast.getLatestEnclosure();
if (enclosure != null) {
String url = enclosure.getUrl();
if (url != null && !url.isEmpty()) {
... | [
"public",
"Path",
"download",
"(",
"Appcast",
"appcast",
",",
"Path",
"targetDir",
")",
"throws",
"IOException",
",",
"Exception",
"{",
"Path",
"downloaded",
"=",
"null",
";",
"Enclosure",
"enclosure",
"=",
"appcast",
".",
"getLatestEnclosure",
"(",
")",
";",
... | Download the file from the given URL to the specified target
@param appcast The appcast content
@param targetDir The target download dir (update directory)
@return Path to the downloaded update file
@throws IOException in case of an error | [
"Download",
"the",
"file",
"from",
"the",
"given",
"URL",
"to",
"the",
"specified",
"target"
] | 8024ac34f52b33de291d859c3b12fc237783f873 | https://github.com/dimaki/refuel/blob/8024ac34f52b33de291d859c3b12fc237783f873/src/main/java/de/dimaki/refuel/appcast/boundary/AppcastManager.java#L197-L256 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/util/resource/YamlReader.java | YamlReader.flatten | private Stream<Object> flatten(final Object o) {
if (o instanceof Map<?, ?>) {
return ((Map<?, ?>) o).values().stream().flatMap(this::flatten);
}
return Stream.of(o);
} | java | private Stream<Object> flatten(final Object o) {
if (o instanceof Map<?, ?>) {
return ((Map<?, ?>) o).values().stream().flatMap(this::flatten);
}
return Stream.of(o);
} | [
"private",
"Stream",
"<",
"Object",
">",
"flatten",
"(",
"final",
"Object",
"o",
")",
"{",
"if",
"(",
"o",
"instanceof",
"Map",
"<",
"?",
",",
"?",
">",
")",
"{",
"return",
"(",
"(",
"Map",
"<",
"?",
",",
"?",
">",
")",
"o",
")",
".",
"values... | Recursively go along yaml nodes beneath the given one to flatten string values
@param o YAML node point of start
@return flattened values beneath given YAML node | [
"Recursively",
"go",
"along",
"yaml",
"nodes",
"beneath",
"the",
"given",
"one",
"to",
"flatten",
"string",
"values"
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/util/resource/YamlReader.java#L136-L141 | train |
wisdom-framework/wisdom-jdbc | wisdom-openjpa-enhancer-plugin/src/main/java/org/wisdom/openjpa/enhancer/OpenJPAEnhancerMojo.java | OpenJPAEnhancerMojo.findEntityClassFiles | protected List<File> findEntityClassFiles() throws MojoExecutionException {
try {
return FileUtils.getFiles(classes, includes, excludes);
} catch (IOException e) {
throw new MojoExecutionException("Error while scanning for '" + includes + "' in " + "'"
+ class... | java | protected List<File> findEntityClassFiles() throws MojoExecutionException {
try {
return FileUtils.getFiles(classes, includes, excludes);
} catch (IOException e) {
throw new MojoExecutionException("Error while scanning for '" + includes + "' in " + "'"
+ class... | [
"protected",
"List",
"<",
"File",
">",
"findEntityClassFiles",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"try",
"{",
"return",
"FileUtils",
".",
"getFiles",
"(",
"classes",
",",
"includes",
",",
"excludes",
")",
";",
"}",
"catch",
"(",
"IOException",
... | Locates and returns a list of class files found under specified class
directory.
@return list of class files.
@throws MojoExecutionException if there was an error scanning class file
resources. | [
"Locates",
"and",
"returns",
"a",
"list",
"of",
"class",
"files",
"found",
"under",
"specified",
"class",
"directory",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-openjpa-enhancer-plugin/src/main/java/org/wisdom/openjpa/enhancer/OpenJPAEnhancerMojo.java#L351-L358 | train |
wisdom-framework/wisdom-jdbc | wisdom-openjpa-enhancer-plugin/src/main/java/org/wisdom/openjpa/enhancer/OpenJPAEnhancerMojo.java | OpenJPAEnhancerMojo.getOptions | protected Options getOptions() throws MojoExecutionException {
File persistence = ensurePersistenceXml();
Options opts = new Options();
if (toolProperties != null) {
opts.putAll(toolProperties);
}
opts.put(OPTION_PROPERTIES_FILE, persistence.getAbsolutePath());
... | java | protected Options getOptions() throws MojoExecutionException {
File persistence = ensurePersistenceXml();
Options opts = new Options();
if (toolProperties != null) {
opts.putAll(toolProperties);
}
opts.put(OPTION_PROPERTIES_FILE, persistence.getAbsolutePath());
... | [
"protected",
"Options",
"getOptions",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"persistence",
"=",
"ensurePersistenceXml",
"(",
")",
";",
"Options",
"opts",
"=",
"new",
"Options",
"(",
")",
";",
"if",
"(",
"toolProperties",
"!=",
"null",
")",... | Get the options for the OpenJPA enhancer tool.
@return populated Options | [
"Get",
"the",
"options",
"for",
"the",
"OpenJPA",
"enhancer",
"tool",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-openjpa-enhancer-plugin/src/main/java/org/wisdom/openjpa/enhancer/OpenJPAEnhancerMojo.java#L380-L403 | train |
wisdom-framework/wisdom-jdbc | wisdom-openjpa-enhancer-plugin/src/main/java/org/wisdom/openjpa/enhancer/OpenJPAEnhancerMojo.java | OpenJPAEnhancerMojo.enhance | private void enhance(List<File> files) throws MojoExecutionException {
Options opts = getOptions();
// list of input files
String[] args = getFilePaths(files);
boolean ok;
final ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
if... | java | private void enhance(List<File> files) throws MojoExecutionException {
Options opts = getOptions();
// list of input files
String[] args = getFilePaths(files);
boolean ok;
final ClassLoader original = Thread.currentThread().getContextClassLoader();
try {
if... | [
"private",
"void",
"enhance",
"(",
"List",
"<",
"File",
">",
"files",
")",
"throws",
"MojoExecutionException",
"{",
"Options",
"opts",
"=",
"getOptions",
"(",
")",
";",
"// list of input files",
"String",
"[",
"]",
"args",
"=",
"getFilePaths",
"(",
"files",
... | Processes a list of class file resources that are to be enhanced.
@param files class file resources to enhance.
@throws MojoExecutionException if the enhancer encountered a failure | [
"Processes",
"a",
"list",
"of",
"class",
"file",
"resources",
"that",
"are",
"to",
"be",
"enhanced",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-openjpa-enhancer-plugin/src/main/java/org/wisdom/openjpa/enhancer/OpenJPAEnhancerMojo.java#L411-L434 | train |
viltgroup/minium | minium-webelements/src/main/java/minium/web/internal/actions/DefaultOnUnhandledAlertInteractionListener.java | DefaultOnUnhandledAlertInteractionListener.handleAlert | protected void handleAlert(Alert alert) {
if (LOGGEER.isDebugEnabled()) {
LOGGEER.debug("Accepting alert box with message: {}", alert.getText());
}
alert.accept();
} | java | protected void handleAlert(Alert alert) {
if (LOGGEER.isDebugEnabled()) {
LOGGEER.debug("Accepting alert box with message: {}", alert.getText());
}
alert.accept();
} | [
"protected",
"void",
"handleAlert",
"(",
"Alert",
"alert",
")",
"{",
"if",
"(",
"LOGGEER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGEER",
".",
"debug",
"(",
"\"Accepting alert box with message: {}\"",
",",
"alert",
".",
"getText",
"(",
")",
")",
";",
... | by default, we accept the alert | [
"by",
"default",
"we",
"accept",
"the",
"alert"
] | f512fdd966ed4034d3ed53518eae7ad993562ab1 | https://github.com/viltgroup/minium/blob/f512fdd966ed4034d3ed53518eae7ad993562ab1/minium-webelements/src/main/java/minium/web/internal/actions/DefaultOnUnhandledAlertInteractionListener.java#L50-L55 | train |
dimaki/refuel | src/main/java/de/dimaki/refuel/Bootstrap.java | Bootstrap.update | public static Path update(Path applicationFile, Path updateDir, boolean removeUpdateFiles) throws IOException {
Path newApplicationJar = null;
// Extract the application name from the application file
String applicationName = applicationFile.getFileName().toString();
// Strip the extensi... | java | public static Path update(Path applicationFile, Path updateDir, boolean removeUpdateFiles) throws IOException {
Path newApplicationJar = null;
// Extract the application name from the application file
String applicationName = applicationFile.getFileName().toString();
// Strip the extensi... | [
"public",
"static",
"Path",
"update",
"(",
"Path",
"applicationFile",
",",
"Path",
"updateDir",
",",
"boolean",
"removeUpdateFiles",
")",
"throws",
"IOException",
"{",
"Path",
"newApplicationJar",
"=",
"null",
";",
"// Extract the application name from the application fil... | Update the application file with the content from the update directory.
@param applicationFile The application file to be updated
@param updateDir The update directory holding the new file versions
@param removeUpdateFiles If true, the updated files are deleted from the update directory
@return The path to the newly up... | [
"Update",
"the",
"application",
"file",
"with",
"the",
"content",
"from",
"the",
"update",
"directory",
"."
] | 8024ac34f52b33de291d859c3b12fc237783f873 | https://github.com/dimaki/refuel/blob/8024ac34f52b33de291d859c3b12fc237783f873/src/main/java/de/dimaki/refuel/Bootstrap.java#L48-L74 | train |
viltgroup/minium | minium-webelements/src/main/java/minium/web/internal/actions/AbstractWebInteraction.java | AbstractWebInteraction.getFirstElement | protected WebElement getFirstElement(Elements elems) {
DocumentWebElement documentWebElement = Iterables.getFirst(elems.as(InternalWebElements.class).wrappedNativeElements(), null);
return documentWebElement == null ? null : documentWebElement.getWrappedWebElement();
} | java | protected WebElement getFirstElement(Elements elems) {
DocumentWebElement documentWebElement = Iterables.getFirst(elems.as(InternalWebElements.class).wrappedNativeElements(), null);
return documentWebElement == null ? null : documentWebElement.getWrappedWebElement();
} | [
"protected",
"WebElement",
"getFirstElement",
"(",
"Elements",
"elems",
")",
"{",
"DocumentWebElement",
"documentWebElement",
"=",
"Iterables",
".",
"getFirst",
"(",
"elems",
".",
"as",
"(",
"InternalWebElements",
".",
"class",
")",
".",
"wrappedNativeElements",
"("... | Gets the first element.
@param elems the elems
@return the first element | [
"Gets",
"the",
"first",
"element",
"."
] | f512fdd966ed4034d3ed53518eae7ad993562ab1 | https://github.com/viltgroup/minium/blob/f512fdd966ed4034d3ed53518eae7ad993562ab1/minium-webelements/src/main/java/minium/web/internal/actions/AbstractWebInteraction.java#L48-L51 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.transaction | @Override
public <R> FluentTransaction<R>.Intermediate transaction(Callable<R> callable) {
return FluentTransaction.transaction(getTransactionManager()).with(callable);
} | java | @Override
public <R> FluentTransaction<R>.Intermediate transaction(Callable<R> callable) {
return FluentTransaction.transaction(getTransactionManager()).with(callable);
} | [
"@",
"Override",
"public",
"<",
"R",
">",
"FluentTransaction",
"<",
"R",
">",
".",
"Intermediate",
"transaction",
"(",
"Callable",
"<",
"R",
">",
"callable",
")",
"{",
"return",
"FluentTransaction",
".",
"transaction",
"(",
"getTransactionManager",
"(",
")",
... | Create a FluentTransaction, with the given transaction block.
@param <R> the return type of the transaction block
@param callable, The transaction block to be executed by the returned FluentTransaction
@return a new FluentTransaction with a transaction block already defined.
@throws java.lang.UnsupportedOperatio... | [
"Create",
"a",
"FluentTransaction",
"with",
"the",
"given",
"transaction",
"block",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L142-L145 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.findOne | @Override
public T findOne(final I id) {
return inTransaction(new Callable<T>() {
@Override
public T call() throws Exception {
return entityManager.find(entity, id);
}
});
} | java | @Override
public T findOne(final I id) {
return inTransaction(new Callable<T>() {
@Override
public T call() throws Exception {
return entityManager.find(entity, id);
}
});
} | [
"@",
"Override",
"public",
"T",
"findOne",
"(",
"final",
"I",
"id",
")",
"{",
"return",
"inTransaction",
"(",
"new",
"Callable",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"T",
"call",
"(",
")",
"throws",
"Exception",
"{",
"return",
"en... | Retrieves an entity by its id.
@param id the id, must not be null
@return the entity instance, {@literal null} if there are no entities matching the given id. | [
"Retrieves",
"an",
"entity",
"by",
"its",
"id",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L199-L207 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.findAll | @Override
public Iterable<T> findAll() {
return inTransaction(new Callable<Iterable<T>>() {
@Override
public Iterable<T> call() throws Exception {
CriteriaQuery<T> cq = entityManager.getCriteriaBuilder().createQuery(entity);
Root<T> pet = cq.from(entit... | java | @Override
public Iterable<T> findAll() {
return inTransaction(new Callable<Iterable<T>>() {
@Override
public Iterable<T> call() throws Exception {
CriteriaQuery<T> cq = entityManager.getCriteriaBuilder().createQuery(entity);
Root<T> pet = cq.from(entit... | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"findAll",
"(",
")",
"{",
"return",
"inTransaction",
"(",
"new",
"Callable",
"<",
"Iterable",
"<",
"T",
">",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"call",
"(",
... | Returns all instances of the entity.
@return the instances, empty if none. | [
"Returns",
"all",
"instances",
"of",
"the",
"entity",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L215-L226 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.findOne | @Override
public T findOne(EntityFilter<T> filter) {
for (T object : findAll()) {
if (filter.accept(object)) {
return object;
}
}
return null;
} | java | @Override
public T findOne(EntityFilter<T> filter) {
for (T object : findAll()) {
if (filter.accept(object)) {
return object;
}
}
return null;
} | [
"@",
"Override",
"public",
"T",
"findOne",
"(",
"EntityFilter",
"<",
"T",
">",
"filter",
")",
"{",
"for",
"(",
"T",
"object",
":",
"findAll",
"(",
")",
")",
"{",
"if",
"(",
"filter",
".",
"accept",
"(",
"object",
")",
")",
"{",
"return",
"object",
... | Retrieves the entity matching the given filter. If several entities matches, the first is returned.
@param filter the filter
@return the first matching instance, {@literal null} if none | [
"Retrieves",
"the",
"entity",
"matching",
"the",
"given",
"filter",
".",
"If",
"several",
"entities",
"matches",
"the",
"first",
"is",
"returned",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L234-L242 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.findAll | @Override
public Iterable<T> findAll(Iterable<I> ids) {
List<T> results = new ArrayList<>();
for (I id : ids) {
T t = findOne(id);
if (t != null) {
results.add(t);
}
}
return results;
} | java | @Override
public Iterable<T> findAll(Iterable<I> ids) {
List<T> results = new ArrayList<>();
for (I id : ids) {
T t = findOne(id);
if (t != null) {
results.add(t);
}
}
return results;
} | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"findAll",
"(",
"Iterable",
"<",
"I",
">",
"ids",
")",
"{",
"List",
"<",
"T",
">",
"results",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"I",
"id",
":",
"ids",
")",
"{",
"T",
... | Returns all instances of the type with the given IDs.
@param ids the ids.
@return the instances, empty if none. | [
"Returns",
"all",
"instances",
"of",
"the",
"type",
"with",
"the",
"given",
"IDs",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L250-L260 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.findAll | @Override
public Iterable<T> findAll(EntityFilter<T> filter) {
List<T> results = new ArrayList<>();
for (T object : findAll()) {
if (filter.accept(object)) {
results.add(object);
}
}
return results;
} | java | @Override
public Iterable<T> findAll(EntityFilter<T> filter) {
List<T> results = new ArrayList<>();
for (T object : findAll()) {
if (filter.accept(object)) {
results.add(object);
}
}
return results;
} | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"findAll",
"(",
"EntityFilter",
"<",
"T",
">",
"filter",
")",
"{",
"List",
"<",
"T",
">",
"results",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"T",
"object",
":",
"findAll",
"(",... | Retrieves the entities matching the given filter.
Be aware that the implementation may load all stored entities in memory to retrieve the right set of entities.
@param filter the filter
@return the matching instances, empty if none. | [
"Retrieves",
"the",
"entities",
"matching",
"the",
"given",
"filter",
".",
"Be",
"aware",
"that",
"the",
"implementation",
"may",
"load",
"all",
"stored",
"entities",
"in",
"memory",
"to",
"retrieve",
"the",
"right",
"set",
"of",
"entities",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L269-L278 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.delete | @Override
public T delete(final T t) {
return inTransaction(
new Callable<T>() {
@Override
public T call() throws Exception {
T attached = getAttached(t);
if (attached != null) {
... | java | @Override
public T delete(final T t) {
return inTransaction(
new Callable<T>() {
@Override
public T call() throws Exception {
T attached = getAttached(t);
if (attached != null) {
... | [
"@",
"Override",
"public",
"T",
"delete",
"(",
"final",
"T",
"t",
")",
"{",
"return",
"inTransaction",
"(",
"new",
"Callable",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"T",
"call",
"(",
")",
"throws",
"Exception",
"{",
"T",
"attached"... | Deletes the given entity instance. The instance is removed from the persistent layer.
@param t the instance
@return the entity instance, may be the same as the parameter t but can also be different | [
"Deletes",
"the",
"given",
"entity",
"instance",
".",
"The",
"instance",
"is",
"removed",
"from",
"the",
"persistent",
"layer",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L286-L300 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.getAttached | @SuppressWarnings("unchecked")
private T getAttached(T object) {
if (entityManager.contains(object)) {
return object;
} else {
return findOne((I) entityManager.getEntityManagerFactory()
.getPersistenceUnitUtil().getIdentifier(object));
}
} | java | @SuppressWarnings("unchecked")
private T getAttached(T object) {
if (entityManager.contains(object)) {
return object;
} else {
return findOne((I) entityManager.getEntityManagerFactory()
.getPersistenceUnitUtil().getIdentifier(object));
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"T",
"getAttached",
"(",
"T",
"object",
")",
"{",
"if",
"(",
"entityManager",
".",
"contains",
"(",
"object",
")",
")",
"{",
"return",
"object",
";",
"}",
"else",
"{",
"return",
"findOne",
"(... | Gets the 'managed' version of the given entity instance.
@param object the entity
@return the managed version, it can be the given object is the instance is not detached. If we can't find the
'managed' version of the object, return {@code null}. | [
"Gets",
"the",
"managed",
"version",
"of",
"the",
"given",
"entity",
"instance",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L333-L341 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.delete | @Override
public Iterable<T> delete(final Iterable<T> entities) {
return inTransaction(new Callable<Iterable<T>>() {
@Override
public Iterable<T> call() throws Exception {
for (T object : entities) {
T attached = getAttached(object);
... | java | @Override
public Iterable<T> delete(final Iterable<T> entities) {
return inTransaction(new Callable<Iterable<T>>() {
@Override
public Iterable<T> call() throws Exception {
for (T object : entities) {
T attached = getAttached(object);
... | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"delete",
"(",
"final",
"Iterable",
"<",
"T",
">",
"entities",
")",
"{",
"return",
"inTransaction",
"(",
"new",
"Callable",
"<",
"Iterable",
"<",
"T",
">",
">",
"(",
")",
"{",
"@",
"Override",
"pu... | Deletes the given entity instances. The instances are removed from the persistent layer.
@param entities the entities to remove from the persistent layer
@return the set of entity instances | [
"Deletes",
"the",
"given",
"entity",
"instances",
".",
"The",
"instances",
"are",
"removed",
"from",
"the",
"persistent",
"layer",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L349-L363 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java | AbstractJTACrud.save | @Override
public Iterable<T> save(final Iterable<T> entities) {
return inTransaction(new Callable<Iterable<T>>() {
@Override
public Iterable<T> call() throws Exception {
for (T object : entities) {
entityManager.persist(object);
}
... | java | @Override
public Iterable<T> save(final Iterable<T> entities) {
return inTransaction(new Callable<Iterable<T>>() {
@Override
public Iterable<T> call() throws Exception {
for (T object : entities) {
entityManager.persist(object);
}
... | [
"@",
"Override",
"public",
"Iterable",
"<",
"T",
">",
"save",
"(",
"final",
"Iterable",
"<",
"T",
">",
"entities",
")",
"{",
"return",
"inTransaction",
"(",
"new",
"Callable",
"<",
"Iterable",
"<",
"T",
">",
">",
"(",
")",
"{",
"@",
"Override",
"publ... | Saves all given entities. Use the returned instances for further operations as the operation might have
changed the entity instances completely.
@param entities the entities to save, must not contains {@literal null} values
@return the saved entities | [
"Saves",
"all",
"given",
"entities",
".",
"Use",
"the",
"returned",
"instances",
"for",
"further",
"operations",
"as",
"the",
"operation",
"might",
"have",
"changed",
"the",
"entity",
"instances",
"completely",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/AbstractJTACrud.java#L420-L431 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistentBundle.java | PersistentBundle.createUnitInstance | private ComponentInstance createUnitInstance(Persistence.PersistenceUnit unit) throws MissingHandlerException,
UnacceptableConfiguration, ConfigurationException {
LOGGER.info("Creating persistence unit instance for unit {}", unit.getName());
Dictionary<String, Object> configuration = new Has... | java | private ComponentInstance createUnitInstance(Persistence.PersistenceUnit unit) throws MissingHandlerException,
UnacceptableConfiguration, ConfigurationException {
LOGGER.info("Creating persistence unit instance for unit {}", unit.getName());
Dictionary<String, Object> configuration = new Has... | [
"private",
"ComponentInstance",
"createUnitInstance",
"(",
"Persistence",
".",
"PersistenceUnit",
"unit",
")",
"throws",
"MissingHandlerException",
",",
"UnacceptableConfiguration",
",",
"ConfigurationException",
"{",
"LOGGER",
".",
"info",
"(",
"\"Creating persistence unit i... | Creates the component instance for the given unit.
This function computes the filters to retrieve the data sources. If a data source is not set in inject a
filter that will never match.
@param unit the persistence unit
@return the created instance
@throws MissingHandlerException the instance cannot be created becaus... | [
"Creates",
"the",
"component",
"instance",
"for",
"the",
"given",
"unit",
".",
"This",
"function",
"computes",
"the",
"filters",
"to",
"retrieve",
"the",
"data",
"sources",
".",
"If",
"a",
"data",
"source",
"is",
"not",
"set",
"in",
"inject",
"a",
"filter"... | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistentBundle.java#L96-L116 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlot | public boolean hasSlot(final String slotName) {
return intentRequest != null && intentRequest.getIntent().getSlots().containsKey(slotName);
} | java | public boolean hasSlot(final String slotName) {
return intentRequest != null && intentRequest.getIntent().getSlots().containsKey(slotName);
} | [
"public",
"boolean",
"hasSlot",
"(",
"final",
"String",
"slotName",
")",
"{",
"return",
"intentRequest",
"!=",
"null",
"&&",
"intentRequest",
".",
"getIntent",
"(",
")",
".",
"getSlots",
"(",
")",
".",
"containsKey",
"(",
"slotName",
")",
";",
"}"
] | Checks if a slot is contained in the intent request. This is no guarantee that the slot
value is not null.
@param slotName name of the slot to look after
@return True, if the slot exists in the intent request | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
".",
"This",
"is",
"no",
"guarantee",
"that",
"the",
"slot",
"value",
"is",
"not",
"null",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L113-L115 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsEqual | public boolean hasSlotIsEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return (slotValue != null && slotValue.equals(value)) ||
slotValue == value;
} | java | public boolean hasSlotIsEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return (slotValue != null && slotValue.equals(value)) ||
slotValue == value;
} | [
"public",
"boolean",
"hasSlotIsEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"slotValue",
"=",
"getSlotValue",
"(",
"slotName",
")",
";",
"return",
"(",
"slotValue",
"!=",
"null",
"&&",
"slotValue",
... | Checks if a slot is contained in the intent request and also got the value provided.
@param slotName name of the slot to look after
@param value the value
@return True, if slot with slotName has a value equal to the given value | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"also",
"got",
"the",
"value",
"provided",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L123-L127 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsDoubleMetaphoneEqual | public boolean hasSlotIsDoubleMetaphoneEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return hasSlotNotBlank(slotName) && value != null &&
new DoubleMetaphone().isDoubleMetaphoneEqual(slotValue, value);
} | java | public boolean hasSlotIsDoubleMetaphoneEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return hasSlotNotBlank(slotName) && value != null &&
new DoubleMetaphone().isDoubleMetaphoneEqual(slotValue, value);
} | [
"public",
"boolean",
"hasSlotIsDoubleMetaphoneEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"slotValue",
"=",
"getSlotValue",
"(",
"slotName",
")",
";",
"return",
"hasSlotNotBlank",
"(",
"slotName",
")",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. Double metaphone algorithm
is optimized for English language and in this case is used to match slot value with
value given to this method.
@param slotName name of the slot to look after
@p... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"Double",
"metaphone",
"algorithm",
"is",
... | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L138-L142 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsCologneEqual | public boolean hasSlotIsCologneEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return hasSlotNotBlank(slotName) && value != null &&
new ColognePhonetic().isEncodeEqual(slotValue, value);
} | java | public boolean hasSlotIsCologneEqual(final String slotName, final String value) {
final String slotValue = getSlotValue(slotName);
return hasSlotNotBlank(slotName) && value != null &&
new ColognePhonetic().isEncodeEqual(slotValue, value);
} | [
"public",
"boolean",
"hasSlotIsCologneEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"final",
"String",
"slotValue",
"=",
"getSlotValue",
"(",
"slotName",
")",
";",
"return",
"hasSlotNotBlank",
"(",
"slotName",
")",
"&&",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. Cologne phonetic algorithm
is optimized for German language and in this case is used to match slot value with
value given to this method.
@param slotName name of the slot to look after
@pa... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"Cologne",
"phonetic",
"algorithm",
"is",
... | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L153-L157 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsPhoneticallyEqual | public boolean hasSlotIsPhoneticallyEqual(final String slotName, final String value) {
return getLocale().equals("de-DE") ? hasSlotIsCologneEqual(slotName, value) :
hasSlotIsDoubleMetaphoneEqual(slotName, value);
} | java | public boolean hasSlotIsPhoneticallyEqual(final String slotName, final String value) {
return getLocale().equals("de-DE") ? hasSlotIsCologneEqual(slotName, value) :
hasSlotIsDoubleMetaphoneEqual(slotName, value);
} | [
"public",
"boolean",
"hasSlotIsPhoneticallyEqual",
"(",
"final",
"String",
"slotName",
",",
"final",
"String",
"value",
")",
"{",
"return",
"getLocale",
"(",
")",
".",
"equals",
"(",
"\"de-DE\"",
")",
"?",
"hasSlotIsCologneEqual",
"(",
"slotName",
",",
"value",
... | Checks if a slot is contained in the intent request and has a value which is a
phonetic sibling of the string given to this method. This method picks the correct
algorithm depending on the locale coming in with the speechlet request. For example the
German locale compares the slot value and the given value with the Col... | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"has",
"a",
"value",
"which",
"is",
"a",
"phonetic",
"sibling",
"of",
"the",
"string",
"given",
"to",
"this",
"method",
".",
"This",
"method",
"picks",
"the",
"corre... | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L169-L172 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotNotBlank | public boolean hasSlotNotBlank(final String slotName) {
return hasSlot(slotName) && StringUtils.isNotBlank(intentRequest.getIntent().getSlot(slotName).getValue());
} | java | public boolean hasSlotNotBlank(final String slotName) {
return hasSlot(slotName) && StringUtils.isNotBlank(intentRequest.getIntent().getSlot(slotName).getValue());
} | [
"public",
"boolean",
"hasSlotNotBlank",
"(",
"final",
"String",
"slotName",
")",
"{",
"return",
"hasSlot",
"(",
"slotName",
")",
"&&",
"StringUtils",
".",
"isNotBlank",
"(",
"intentRequest",
".",
"getIntent",
"(",
")",
".",
"getSlot",
"(",
"slotName",
")",
"... | Checks if a slot is contained in the intent request and its value is not blank.
@param slotName name of the slot to look after
@return True, if the slot exists in the intent request and is not blank. | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"its",
"value",
"is",
"not",
"blank",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L179-L181 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.hasSlotIsNumber | public boolean hasSlotIsNumber(final String slotName) {
return hasSlot(slotName) && NumberUtils.isNumber(intentRequest.getIntent().getSlot(slotName).getValue());
} | java | public boolean hasSlotIsNumber(final String slotName) {
return hasSlot(slotName) && NumberUtils.isNumber(intentRequest.getIntent().getSlot(slotName).getValue());
} | [
"public",
"boolean",
"hasSlotIsNumber",
"(",
"final",
"String",
"slotName",
")",
"{",
"return",
"hasSlot",
"(",
"slotName",
")",
"&&",
"NumberUtils",
".",
"isNumber",
"(",
"intentRequest",
".",
"getIntent",
"(",
")",
".",
"getSlot",
"(",
"slotName",
")",
"."... | Checks if a slot is contained in the intent request and its value is a number.
@param slotName name of the slot to look after
@return True, if the slot exists in the intent request and is a number. | [
"Checks",
"if",
"a",
"slot",
"is",
"contained",
"in",
"the",
"intent",
"request",
"and",
"its",
"value",
"is",
"a",
"number",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L188-L190 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java | AlexaInput.getSlotValue | public String getSlotValue(final String slotName) {
return hasSlot(slotName) ? intentRequest.getIntent().getSlot(slotName).getValue() : null;
} | java | public String getSlotValue(final String slotName) {
return hasSlot(slotName) ? intentRequest.getIntent().getSlot(slotName).getValue() : null;
} | [
"public",
"String",
"getSlotValue",
"(",
"final",
"String",
"slotName",
")",
"{",
"return",
"hasSlot",
"(",
"slotName",
")",
"?",
"intentRequest",
".",
"getIntent",
"(",
")",
".",
"getSlot",
"(",
"slotName",
")",
".",
"getValue",
"(",
")",
":",
"null",
"... | Gets the slot value as a string in case slot exists otherwise null
@param slotName name of the slot to look after
@return slot value as a string in case slot exists otherwise null | [
"Gets",
"the",
"slot",
"value",
"as",
"a",
"string",
"in",
"case",
"slot",
"exists",
"otherwise",
"null"
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/AlexaInput.java#L207-L209 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaRequestStreamHandler.java | AlexaRequestStreamHandler.getSpeechlet | public Class<? extends AlexaSpeechlet> getSpeechlet() {
final AlexaApplication app = this.getClass().getAnnotation(AlexaApplication.class);
return app != null ? app.speechlet() : AlexaSpeechlet.class;
} | java | public Class<? extends AlexaSpeechlet> getSpeechlet() {
final AlexaApplication app = this.getClass().getAnnotation(AlexaApplication.class);
return app != null ? app.speechlet() : AlexaSpeechlet.class;
} | [
"public",
"Class",
"<",
"?",
"extends",
"AlexaSpeechlet",
">",
"getSpeechlet",
"(",
")",
"{",
"final",
"AlexaApplication",
"app",
"=",
"this",
".",
"getClass",
"(",
")",
".",
"getAnnotation",
"(",
"AlexaApplication",
".",
"class",
")",
";",
"return",
"app",
... | Provides the speechlet used to handle the request.
@return speechlet used to handle the request. | [
"Provides",
"the",
"speechlet",
"used",
"to",
"handle",
"the",
"request",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaRequestStreamHandler.java#L69-L72 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaRequestStreamHandler.java | AlexaRequestStreamHandler.handleRequest | @Override
public void handleRequest(final InputStream input, final OutputStream output, final Context context) throws IOException {
byte[] serializedSpeechletRequest = IOUtils.toByteArray(input);
final AlexaSpeechlet speechlet = AlexaSpeechletFactory.createSpeechletFromRequest(serializedSpeechletReq... | java | @Override
public void handleRequest(final InputStream input, final OutputStream output, final Context context) throws IOException {
byte[] serializedSpeechletRequest = IOUtils.toByteArray(input);
final AlexaSpeechlet speechlet = AlexaSpeechletFactory.createSpeechletFromRequest(serializedSpeechletReq... | [
"@",
"Override",
"public",
"void",
"handleRequest",
"(",
"final",
"InputStream",
"input",
",",
"final",
"OutputStream",
"output",
",",
"final",
"Context",
"context",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"serializedSpeechletRequest",
"=",
"IOUtils",... | The handler method is called on a Lambda execution.
@param input the input stream containing the Lambda request payload
@param output the output stream containing the Lambda response payload
@param context a context for a Lambda execution.
@throws IOException exception is thrown on invalid request payload or on a provi... | [
"The",
"handler",
"method",
"is",
"called",
"on",
"a",
"Lambda",
"execution",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaRequestStreamHandler.java#L82-L94 | train |
KayLerch/alexa-skills-kit-tellask-java | src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaRequestStreamHandler.java | AlexaRequestStreamHandler.getRequestStreamHandler | private SpeechletRequestHandler getRequestStreamHandler() {
final Set<String> supportedApplicationIds = getSupportedApplicationIds();
// at least one supported application-id need to be provided
Validate.notEmpty(supportedApplicationIds, "Must provide supported application-id either with overrid... | java | private SpeechletRequestHandler getRequestStreamHandler() {
final Set<String> supportedApplicationIds = getSupportedApplicationIds();
// at least one supported application-id need to be provided
Validate.notEmpty(supportedApplicationIds, "Must provide supported application-id either with overrid... | [
"private",
"SpeechletRequestHandler",
"getRequestStreamHandler",
"(",
")",
"{",
"final",
"Set",
"<",
"String",
">",
"supportedApplicationIds",
"=",
"getSupportedApplicationIds",
"(",
")",
";",
"// at least one supported application-id need to be provided",
"Validate",
".",
"n... | Constructs the stream handler giving it all the provided information.
@return stream handler | [
"Constructs",
"the",
"stream",
"handler",
"giving",
"it",
"all",
"the",
"provided",
"information",
"."
] | 2c19028e775c2512dd4649d12962c0b48bf7f2bc | https://github.com/KayLerch/alexa-skills-kit-tellask-java/blob/2c19028e775c2512dd4649d12962c0b48bf7f2bc/src/main/java/io/klerch/alexa/tellask/model/wrapper/AlexaRequestStreamHandler.java#L100-L112 | train |
nmdp-bioinformatics/genotype-list | gl-client-local/src/main/java/org/nmdp/gl/client/local/LocalGlClient.java | LocalGlClient.create | public static GlClient create() {
Injector injector = Guice.createInjector(getLocalModules());
return injector.getInstance(GlClient.class);
} | java | public static GlClient create() {
Injector injector = Guice.createInjector(getLocalModules());
return injector.getInstance(GlClient.class);
} | [
"public",
"static",
"GlClient",
"create",
"(",
")",
"{",
"Injector",
"injector",
"=",
"Guice",
".",
"createInjector",
"(",
"getLocalModules",
"(",
")",
")",
";",
"return",
"injector",
".",
"getInstance",
"(",
"GlClient",
".",
"class",
")",
";",
"}"
] | Create and return a new instance of LocalGlClient configured with the default nomenclature.
@return a new instance of LocalGlClient configured with the default nomenclature | [
"Create",
"and",
"return",
"a",
"new",
"instance",
"of",
"LocalGlClient",
"configured",
"with",
"the",
"default",
"nomenclature",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-client-local/src/main/java/org/nmdp/gl/client/local/LocalGlClient.java#L194-L197 | train |
nmdp-bioinformatics/genotype-list | gl-client-local/src/main/java/org/nmdp/gl/client/local/LocalGlClient.java | LocalGlClient.createStrict | public static GlClient createStrict(final Class<? extends Nomenclature> nomenclatureClass) throws IOException {
checkNotNull(nomenclatureClass);
Injector injector = Guice.createInjector(getLocalStrictModules(nomenclatureClass));
Nomenclature nomenclature = injector.getInstance(Nomenclature.class... | java | public static GlClient createStrict(final Class<? extends Nomenclature> nomenclatureClass) throws IOException {
checkNotNull(nomenclatureClass);
Injector injector = Guice.createInjector(getLocalStrictModules(nomenclatureClass));
Nomenclature nomenclature = injector.getInstance(Nomenclature.class... | [
"public",
"static",
"GlClient",
"createStrict",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Nomenclature",
">",
"nomenclatureClass",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"nomenclatureClass",
")",
";",
"Injector",
"injector",
"=",
"Guice",
".",
... | Create and return a new instance of LocalGlClient configured in strict mode with the specified nomenclature.
@param nomenclatureClass nomenclature class, must not be null
@return a new instance of LocalGlClient configured in strict mode with the specified nomenclature
@throws IOException if an I/O error occurs | [
"Create",
"and",
"return",
"a",
"new",
"instance",
"of",
"LocalGlClient",
"configured",
"in",
"strict",
"mode",
"with",
"the",
"specified",
"nomenclature",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-client-local/src/main/java/org/nmdp/gl/client/local/LocalGlClient.java#L219-L225 | train |
nmdp-bioinformatics/genotype-list | gl-client-local/src/main/java/org/nmdp/gl/client/local/LocalGlClient.java | LocalGlClient.getLocalStrictModules | public static List<AbstractModule> getLocalStrictModules(final Class<? extends Nomenclature> nomenclatureClass) {
checkNotNull(nomenclatureClass);
return ImmutableList.of(new LocalStrictModule(), new CacheModule(), new IdModule(), new AbstractModule() {
@Override
protecte... | java | public static List<AbstractModule> getLocalStrictModules(final Class<? extends Nomenclature> nomenclatureClass) {
checkNotNull(nomenclatureClass);
return ImmutableList.of(new LocalStrictModule(), new CacheModule(), new IdModule(), new AbstractModule() {
@Override
protecte... | [
"public",
"static",
"List",
"<",
"AbstractModule",
">",
"getLocalStrictModules",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Nomenclature",
">",
"nomenclatureClass",
")",
"{",
"checkNotNull",
"(",
"nomenclatureClass",
")",
";",
"return",
"ImmutableList",
".",
"of... | Return the list of modules that configure LocalGlClient in strict mode with the specified nomenclature.
<p>
Note the nomenclature provided by an injector created from these modules must be loaded, e.g.
<pre>
Injector injector = Guice.createInjector(getLocalStrictModules(nomenclatureClass));
Nomenclature nomenclature =... | [
"Return",
"the",
"list",
"of",
"modules",
"that",
"configure",
"LocalGlClient",
"in",
"strict",
"mode",
"with",
"the",
"specified",
"nomenclature",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-client-local/src/main/java/org/nmdp/gl/client/local/LocalGlClient.java#L251-L259 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/JPARepository.java | JPARepository.getCrudServices | @Override
public Collection<Crud<?, ?>> getCrudServices() {
List<Crud<?, ?>> list = new ArrayList<>();
list.addAll(cruds);
return list;
} | java | @Override
public Collection<Crud<?, ?>> getCrudServices() {
List<Crud<?, ?>> list = new ArrayList<>();
list.addAll(cruds);
return list;
} | [
"@",
"Override",
"public",
"Collection",
"<",
"Crud",
"<",
"?",
",",
"?",
">",
">",
"getCrudServices",
"(",
")",
"{",
"List",
"<",
"Crud",
"<",
"?",
",",
"?",
">",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"list",
".",
"addAll",
... | Gets the list of Crud service managed by the current repository.
@return the list of crud services, empty if none | [
"Gets",
"the",
"list",
"of",
"Crud",
"service",
"managed",
"by",
"the",
"current",
"repository",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/JPARepository.java#L88-L93 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/JPARepository.java | JPARepository.dispose | public void dispose() {
for (ServiceRegistration registration : registrations) {
registration.unregister();
}
registrations.clear();
for (AbstractJTACrud crud : cruds) {
crud.dispose();
}
} | java | public void dispose() {
for (ServiceRegistration registration : registrations) {
registration.unregister();
}
registrations.clear();
for (AbstractJTACrud crud : cruds) {
crud.dispose();
}
} | [
"public",
"void",
"dispose",
"(",
")",
"{",
"for",
"(",
"ServiceRegistration",
"registration",
":",
"registrations",
")",
"{",
"registration",
".",
"unregister",
"(",
")",
";",
"}",
"registrations",
".",
"clear",
"(",
")",
";",
"for",
"(",
"AbstractJTACrud",... | Stops the repository. It un-registers all crud services. | [
"Stops",
"the",
"repository",
".",
"It",
"un",
"-",
"registers",
"all",
"crud",
"services",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/crud/JPARepository.java#L139-L147 | train |
nmdp-bioinformatics/genotype-list | gl-client/src/main/java/org/nmdp/gl/client/GlResourceBuilder.java | GlResourceBuilder.reset | public GlResourceBuilder reset() {
alleles.clear();
alleleLists.clear();
haplotypes.clear();
genotypes.clear();
genotypeLists.clear();
locus = null;
allele = null;
alleleList = null;
haplotype = null;
genotype = null;
genotypeList =... | java | public GlResourceBuilder reset() {
alleles.clear();
alleleLists.clear();
haplotypes.clear();
genotypes.clear();
genotypeLists.clear();
locus = null;
allele = null;
alleleList = null;
haplotype = null;
genotype = null;
genotypeList =... | [
"public",
"GlResourceBuilder",
"reset",
"(",
")",
"{",
"alleles",
".",
"clear",
"(",
")",
";",
"alleleLists",
".",
"clear",
"(",
")",
";",
"haplotypes",
".",
"clear",
"(",
")",
";",
"genotypes",
".",
"clear",
"(",
")",
";",
"genotypeLists",
".",
"clear... | Return this gl resource builder with its configuration reset.
@return this gl resource builder with its configuration reset | [
"Return",
"this",
"gl",
"resource",
"builder",
"with",
"its",
"configuration",
"reset",
"."
] | 03b2579552cb9f680a62ffaaecdca9c2a5d12ee4 | https://github.com/nmdp-bioinformatics/genotype-list/blob/03b2579552cb9f680a62ffaaecdca9c2a5d12ee4/gl-client/src/main/java/org/nmdp/gl/client/GlResourceBuilder.java#L165-L178 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistenceUnitComponent.java | PersistenceUnitComponent.start | @Validate
public void start() {
try {
Map<String, Object> map = new HashMap<>();
for (Persistence.PersistenceUnit.Properties.Property p :
persistenceUnitXml.getProperties().getProperty()) {
map.put(p.getName(), p.getValue());
}
... | java | @Validate
public void start() {
try {
Map<String, Object> map = new HashMap<>();
for (Persistence.PersistenceUnit.Properties.Property p :
persistenceUnitXml.getProperties().getProperty()) {
map.put(p.getName(), p.getValue());
}
... | [
"@",
"Validate",
"public",
"void",
"start",
"(",
")",
"{",
"try",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"for",
"(",
"Persistence",
".",
"PersistenceUnit",
".",
"Properties",
".",
"Property",
... | Starts the unit. It creates the entity manager factory and entity manager, as well as the repository and crud
services. | [
"Starts",
"the",
"unit",
".",
"It",
"creates",
"the",
"entity",
"manager",
"factory",
"and",
"entity",
"manager",
"as",
"well",
"as",
"the",
"repository",
"and",
"crud",
"services",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistenceUnitComponent.java#L171-L227 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistenceUnitComponent.java | PersistenceUnitComponent.getNewTempClassLoader | @Override
public ClassLoader getNewTempClassLoader() {
return new ClassLoader(getClassLoader()) { //NOSONAR
/**
* Searches for the .class file and define it using the current class loader.
* @param className the class name
* @return the class object
... | java | @Override
public ClassLoader getNewTempClassLoader() {
return new ClassLoader(getClassLoader()) { //NOSONAR
/**
* Searches for the .class file and define it using the current class loader.
* @param className the class name
* @return the class object
... | [
"@",
"Override",
"public",
"ClassLoader",
"getNewTempClassLoader",
"(",
")",
"{",
"return",
"new",
"ClassLoader",
"(",
"getClassLoader",
"(",
")",
")",
"{",
"//NOSONAR",
"/**\n * Searches for the .class file and define it using the current class loader.\n ... | In this method we just create a simple temporary class loader. This class
loader uses the bundle's class loader as parent but defines the classes
in this class loader. This has the implicit assumption that the temp
class loader is used BEFORE any bundle's classes are loaded since a class
loader does parent delegation f... | [
"In",
"this",
"method",
"we",
"just",
"create",
"a",
"simple",
"temporary",
"class",
"loader",
".",
"This",
"class",
"loader",
"uses",
"the",
"bundle",
"s",
"class",
"loader",
"as",
"parent",
"but",
"defines",
"the",
"classes",
"in",
"this",
"class",
"load... | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/jpa/PersistenceUnitComponent.java#L314-L365 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java | XidFactoryImpl.createXid | public Xid createXid() {
byte[] globalId = baseId.clone();
long id;
synchronized (this) {
id = count++;
}
insertLong(id, globalId, 0);
return new XidImpl(globalId);
} | java | public Xid createXid() {
byte[] globalId = baseId.clone();
long id;
synchronized (this) {
id = count++;
}
insertLong(id, globalId, 0);
return new XidImpl(globalId);
} | [
"public",
"Xid",
"createXid",
"(",
")",
"{",
"byte",
"[",
"]",
"globalId",
"=",
"baseId",
".",
"clone",
"(",
")",
";",
"long",
"id",
";",
"synchronized",
"(",
"this",
")",
"{",
"id",
"=",
"count",
"++",
";",
"}",
"insertLong",
"(",
"id",
",",
"gl... | Creates the Xid.
@return the new Xid | [
"Creates",
"the",
"Xid",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java#L54-L62 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java | XidFactoryImpl.createBranch | public Xid createBranch(Xid globalId, int branch) {
byte[] branchId = baseId.clone();
branchId[0] = (byte) branch;
branchId[1] = (byte) (branch >>> 8);
branchId[2] = (byte) (branch >>> 16);
branchId[3] = (byte) (branch >>> 24);
insertLong(start, branchId, 4);
retu... | java | public Xid createBranch(Xid globalId, int branch) {
byte[] branchId = baseId.clone();
branchId[0] = (byte) branch;
branchId[1] = (byte) (branch >>> 8);
branchId[2] = (byte) (branch >>> 16);
branchId[3] = (byte) (branch >>> 24);
insertLong(start, branchId, 4);
retu... | [
"public",
"Xid",
"createBranch",
"(",
"Xid",
"globalId",
",",
"int",
"branch",
")",
"{",
"byte",
"[",
"]",
"branchId",
"=",
"baseId",
".",
"clone",
"(",
")",
";",
"branchId",
"[",
"0",
"]",
"=",
"(",
"byte",
")",
"branch",
";",
"branchId",
"[",
"1"... | Create a branch Xid.
@param globalId the global Xid
@param branch the branch number
@return the new Xid. | [
"Create",
"a",
"branch",
"Xid",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java#L70-L78 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java | XidFactoryImpl.matchesGlobalId | public boolean matchesGlobalId(byte[] globalTransactionId) {
if (globalTransactionId.length != Xid.MAXGTRIDSIZE) {
return false;
}
for (int i = 8; i < globalTransactionId.length; i++) {
if (globalTransactionId[i] != baseId[i]) {
return false;
}... | java | public boolean matchesGlobalId(byte[] globalTransactionId) {
if (globalTransactionId.length != Xid.MAXGTRIDSIZE) {
return false;
}
for (int i = 8; i < globalTransactionId.length; i++) {
if (globalTransactionId[i] != baseId[i]) {
return false;
}... | [
"public",
"boolean",
"matchesGlobalId",
"(",
"byte",
"[",
"]",
"globalTransactionId",
")",
"{",
"if",
"(",
"globalTransactionId",
".",
"length",
"!=",
"Xid",
".",
"MAXGTRIDSIZE",
")",
"{",
"return",
"false",
";",
"}",
"for",
"(",
"int",
"i",
"=",
"8",
";... | Checks whether or not the given byte array matches the global id.
@param globalTransactionId the global transaction id
@return true if it matches | [
"Checks",
"whether",
"or",
"not",
"the",
"given",
"byte",
"array",
"matches",
"the",
"global",
"id",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java#L85-L97 | train |
wisdom-framework/wisdom-jdbc | wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java | XidFactoryImpl.matchesBranchId | public boolean matchesBranchId(byte[] branchQualifier) {
if (branchQualifier.length != Xid.MAXBQUALSIZE) {
return false;
}
long id = extractLong(branchQualifier, 4);
if (id >= start) {
// newly created branch, not recoverable
return false;
}
... | java | public boolean matchesBranchId(byte[] branchQualifier) {
if (branchQualifier.length != Xid.MAXBQUALSIZE) {
return false;
}
long id = extractLong(branchQualifier, 4);
if (id >= start) {
// newly created branch, not recoverable
return false;
}
... | [
"public",
"boolean",
"matchesBranchId",
"(",
"byte",
"[",
"]",
"branchQualifier",
")",
"{",
"if",
"(",
"branchQualifier",
".",
"length",
"!=",
"Xid",
".",
"MAXBQUALSIZE",
")",
"{",
"return",
"false",
";",
"}",
"long",
"id",
"=",
"extractLong",
"(",
"branch... | Checks whether or not the given byte array matches the branch id.
@param branchQualifier the branch qualifier
@return true if it matches | [
"Checks",
"whether",
"or",
"not",
"the",
"given",
"byte",
"array",
"matches",
"the",
"branch",
"id",
"."
] | 931f5acf0b2bcb0a8f3b683d60d326caafd09a72 | https://github.com/wisdom-framework/wisdom-jdbc/blob/931f5acf0b2bcb0a8f3b683d60d326caafd09a72/wisdom-jpa-manager/src/main/java/org/wisdom/framework/transaction/impl/XidFactoryImpl.java#L104-L120 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java | ActivityUtils.isPackageInstalled | public static boolean isPackageInstalled(Context context, String packageName) {
try {
context.getPackageManager().getApplicationInfo(packageName, 0);
return true;
} catch (Exception e) {
return false;
}
} | java | public static boolean isPackageInstalled(Context context, String packageName) {
try {
context.getPackageManager().getApplicationInfo(packageName, 0);
return true;
} catch (Exception e) {
return false;
}
} | [
"public",
"static",
"boolean",
"isPackageInstalled",
"(",
"Context",
"context",
",",
"String",
"packageName",
")",
"{",
"try",
"{",
"context",
".",
"getPackageManager",
"(",
")",
".",
"getApplicationInfo",
"(",
"packageName",
",",
"0",
")",
";",
"return",
"tru... | Checks if a package is installed.
@param context Context to be used to verify the existence of the package.
@param packageName Package name to be searched.
@return true if the package is discovered; false otherwise | [
"Checks",
"if",
"a",
"package",
"is",
"installed",
"."
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java#L26-L33 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java | ActivityUtils.getBaseActivityClassName | public static String getBaseActivityClassName(Context context) {
ComponentName activity = getBaseActivity(context);
if (activity == null) {
return null;
}
return activity.getClassName();
} | java | public static String getBaseActivityClassName(Context context) {
ComponentName activity = getBaseActivity(context);
if (activity == null) {
return null;
}
return activity.getClassName();
} | [
"public",
"static",
"String",
"getBaseActivityClassName",
"(",
"Context",
"context",
")",
"{",
"ComponentName",
"activity",
"=",
"getBaseActivity",
"(",
"context",
")",
";",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Returns Class name of base activity
@param context Context to provide activity information
@return String representing class name of base activity | [
"Returns",
"Class",
"name",
"of",
"base",
"activity"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java#L53-L59 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java | ActivityUtils.getTopActivityPackageName | public static String getTopActivityPackageName(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return null;
}
return activity.getPackageName();
} | java | public static String getTopActivityPackageName(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return null;
}
return activity.getPackageName();
} | [
"public",
"static",
"String",
"getTopActivityPackageName",
"(",
"Context",
"context",
")",
"{",
"ComponentName",
"activity",
"=",
"getTopActivity",
"(",
"context",
")",
";",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
... | Returns Package name of top activity
@param context Context to provide activity information
@return String representing package name of top activity | [
"Returns",
"Package",
"name",
"of",
"top",
"activity"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java#L66-L72 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java | ActivityUtils.getTopActivityClassName | public static String getTopActivityClassName(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return null;
}
return activity.getClassName();
} | java | public static String getTopActivityClassName(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return null;
}
return activity.getClassName();
} | [
"public",
"static",
"String",
"getTopActivityClassName",
"(",
"Context",
"context",
")",
"{",
"ComponentName",
"activity",
"=",
"getTopActivity",
"(",
"context",
")",
";",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"... | Returns Class name of top activity
@param context Context to provide activity information
@return String representing class name of top activity | [
"Returns",
"Class",
"name",
"of",
"top",
"activity"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java#L79-L85 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java | ActivityUtils.isTopApplication | public static boolean isTopApplication(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return false;
}
return activity.getPackageName().equals(context.getApplicationInfo().packageName);
} | java | public static boolean isTopApplication(Context context) {
ComponentName activity = getTopActivity(context);
if (activity == null) {
return false;
}
return activity.getPackageName().equals(context.getApplicationInfo().packageName);
} | [
"public",
"static",
"boolean",
"isTopApplication",
"(",
"Context",
"context",
")",
"{",
"ComponentName",
"activity",
"=",
"getTopActivity",
"(",
"context",
")",
";",
"if",
"(",
"activity",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"return",
"activ... | Determines if this application is top activity
@param context Context to be examined
@return true if this application is a top activity; false otherwise | [
"Determines",
"if",
"this",
"application",
"is",
"top",
"activity"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java#L94-L100 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java | ActivityUtils.isContextForeground | public static boolean isContextForeground(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> appProcesses = activityManager.getRunningAppProcesses();
int pid = getPid();
for (RunningAppProcessInfo appProcess : a... | java | public static boolean isContextForeground(Context context) {
ActivityManager activityManager = (ActivityManager) context.getSystemService(Context.ACTIVITY_SERVICE);
List<RunningAppProcessInfo> appProcesses = activityManager.getRunningAppProcesses();
int pid = getPid();
for (RunningAppProcessInfo appProcess : a... | [
"public",
"static",
"boolean",
"isContextForeground",
"(",
"Context",
"context",
")",
"{",
"ActivityManager",
"activityManager",
"=",
"(",
"ActivityManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"ACTIVITY_SERVICE",
")",
";",
"List",
"<",
"... | Checks if this application is foreground
@param context Context to be examined
@return true if this application is running on the top; false otherwise | [
"Checks",
"if",
"this",
"application",
"is",
"foreground"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/ui/ActivityUtils.java#L109-L120 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/device/DeviceTypeDetector.java | DeviceTypeDetector.getDeviceType | public DeviceType getDeviceType(Context activityContext) {
// Verifies if the Generalized Size of the device is XLARGE to be
// considered a Tablet
boolean xlarge = ((activityContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == SCREENLAYOUT_SIZE_XLARGE);
// If XLarg... | java | public DeviceType getDeviceType(Context activityContext) {
// Verifies if the Generalized Size of the device is XLARGE to be
// considered a Tablet
boolean xlarge = ((activityContext.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) == SCREENLAYOUT_SIZE_XLARGE);
// If XLarg... | [
"public",
"DeviceType",
"getDeviceType",
"(",
"Context",
"activityContext",
")",
"{",
"// Verifies if the Generalized Size of the device is XLARGE to be",
"// considered a Tablet",
"boolean",
"xlarge",
"=",
"(",
"(",
"activityContext",
".",
"getResources",
"(",
")",
".",
"g... | Checks if the device is a tablet or a phone
@param activityContext The Activity Context.
@return Returns true if the device is a Tablet | [
"Checks",
"if",
"the",
"device",
"is",
"a",
"tablet",
"or",
"a",
"phone"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/device/DeviceTypeDetector.java#L25-L52 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java | VolumeUtils.getCurrentVolume | public static int getCurrentVolume(Context context) {
AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
} | java | public static int getCurrentVolume(Context context) {
AudioManager mAudioManager = (AudioManager) context.getSystemService(Context.AUDIO_SERVICE);
return mAudioManager.getStreamVolume(AudioManager.STREAM_MUSIC);
} | [
"public",
"static",
"int",
"getCurrentVolume",
"(",
"Context",
"context",
")",
"{",
"AudioManager",
"mAudioManager",
"=",
"(",
"AudioManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"AUDIO_SERVICE",
")",
";",
"return",
"mAudioManager",
".",
... | Returns current media volume
@param context
@return current volume | [
"Returns",
"current",
"media",
"volume"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java#L20-L23 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java | VolumeUtils.getMaximumVolume | public static int getMaximumVolume(Context context) {
return ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).getStreamMaxVolume(AudioManager.STREAM_MUSIC);
} | java | public static int getMaximumVolume(Context context) {
return ((AudioManager) context.getSystemService(Context.AUDIO_SERVICE)).getStreamMaxVolume(AudioManager.STREAM_MUSIC);
} | [
"public",
"static",
"int",
"getMaximumVolume",
"(",
"Context",
"context",
")",
"{",
"return",
"(",
"(",
"AudioManager",
")",
"context",
".",
"getSystemService",
"(",
"Context",
".",
"AUDIO_SERVICE",
")",
")",
".",
"getStreamMaxVolume",
"(",
"AudioManager",
".",
... | Returns maximum volume the media volume can have
@param context Context
@return Maximum volume | [
"Returns",
"maximum",
"volume",
"the",
"media",
"volume",
"can",
"have"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/audio/VolumeUtils.java#L90-L92 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java | NetworkMonitor.registerConnectivityReceiver | private void registerConnectivityReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
context.registerReceiver(connectivityReceiver, intentFilter);
} | java | private void registerConnectivityReceiver() {
IntentFilter intentFilter = new IntentFilter();
intentFilter.addAction(ConnectivityManager.CONNECTIVITY_ACTION);
context.registerReceiver(connectivityReceiver, intentFilter);
} | [
"private",
"void",
"registerConnectivityReceiver",
"(",
")",
"{",
"IntentFilter",
"intentFilter",
"=",
"new",
"IntentFilter",
"(",
")",
";",
"intentFilter",
".",
"addAction",
"(",
"ConnectivityManager",
".",
"CONNECTIVITY_ACTION",
")",
";",
"context",
".",
"register... | Registers receiver to be notified of broadcast event when network
connection changes | [
"Registers",
"receiver",
"to",
"be",
"notified",
"of",
"broadcast",
"event",
"when",
"network",
"connection",
"changes"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java#L246-L250 | train |
naver/android-utilset | UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java | NetworkMonitor.isWifiFake | public boolean isWifiFake(String ipAddress, int port) {
SocketChannel socketChannel = null;
try {
socketChannel = SocketChannel.open();
socketChannel.connect(new InetSocketAddress(ipAddress, port));
} catch (IOException e) {
Log.d(TAG, "Current Wifi is stupid!!! by IOException");
return true;
} catc... | java | public boolean isWifiFake(String ipAddress, int port) {
SocketChannel socketChannel = null;
try {
socketChannel = SocketChannel.open();
socketChannel.connect(new InetSocketAddress(ipAddress, port));
} catch (IOException e) {
Log.d(TAG, "Current Wifi is stupid!!! by IOException");
return true;
} catc... | [
"public",
"boolean",
"isWifiFake",
"(",
"String",
"ipAddress",
",",
"int",
"port",
")",
"{",
"SocketChannel",
"socketChannel",
"=",
"null",
";",
"try",
"{",
"socketChannel",
"=",
"SocketChannel",
".",
"open",
"(",
")",
";",
"socketChannel",
".",
"connect",
"... | Checks if currently connected Access Point is either rogue or incapable
of routing packet
@param ipAddress
Any valid IP addresses will work to check if the device is
connected to properly working AP
@param port
Port number bound with ipAddress parameter
@return true if currently connected AP is not working normally; f... | [
"Checks",
"if",
"currently",
"connected",
"Access",
"Point",
"is",
"either",
"rogue",
"or",
"incapable",
"of",
"routing",
"packet"
] | 4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b | https://github.com/naver/android-utilset/blob/4af5f821466bc5bec4ea221ca6d87e0ac9b87e0b/UtilSet/src/com/navercorp/utilset/network/NetworkMonitor.java#L756-L776 | train |
hayribakici/infiniteviewpager | infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java | InfinitePagerAdapter.instantiateItem | @Override
public final Object instantiateItem(final ViewGroup container, final int position) {
if (Constants.DEBUG) {
Log.i("InfiniteViewPager", String.format("instantiating position %s", position));
}
final PageModel<T> model = createPageModel(position);
mPageModels[posi... | java | @Override
public final Object instantiateItem(final ViewGroup container, final int position) {
if (Constants.DEBUG) {
Log.i("InfiniteViewPager", String.format("instantiating position %s", position));
}
final PageModel<T> model = createPageModel(position);
mPageModels[posi... | [
"@",
"Override",
"public",
"final",
"Object",
"instantiateItem",
"(",
"final",
"ViewGroup",
"container",
",",
"final",
"int",
"position",
")",
"{",
"if",
"(",
"Constants",
".",
"DEBUG",
")",
"{",
"Log",
".",
"i",
"(",
"\"InfiniteViewPager\"",
",",
"String",
... | This method is only called, when this pagerAdapter is initialized. | [
"This",
"method",
"is",
"only",
"called",
"when",
"this",
"pagerAdapter",
"is",
"initialized",
"."
] | cb3ca2a3833bbb3aeef02b9693787987b970bb89 | https://github.com/hayribakici/infiniteviewpager/blob/cb3ca2a3833bbb3aeef02b9693787987b970bb89/infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java#L63-L72 | train |
hayribakici/infiniteviewpager | infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java | InfinitePagerAdapter.printPageModels | private void printPageModels(final String tag) {
for (int i = 0; i < PAGE_COUNT; i++) {
printPageModel(tag, mPageModels[i], i);
}
} | java | private void printPageModels(final String tag) {
for (int i = 0; i < PAGE_COUNT; i++) {
printPageModel(tag, mPageModels[i], i);
}
} | [
"private",
"void",
"printPageModels",
"(",
"final",
"String",
"tag",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"PAGE_COUNT",
";",
"i",
"++",
")",
"{",
"printPageModel",
"(",
"tag",
",",
"mPageModels",
"[",
"i",
"]",
",",
"i",
")",
... | Debug related methods | [
"Debug",
"related",
"methods"
] | cb3ca2a3833bbb3aeef02b9693787987b970bb89 | https://github.com/hayribakici/infiniteviewpager/blob/cb3ca2a3833bbb3aeef02b9693787987b970bb89/infiniteviewpager/src/com/thehayro/view/InfinitePagerAdapter.java#L239-L243 | train |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.predict | public final Position predict(double distanceKm, double courseDegrees) {
assertWithMsg(alt == 0.0, "Predictions only valid for Earth's surface");
double dr = distanceKm / EARTH_RADIUS_KM;
double latR = toRadians(lat);
double lonR = toRadians(lon);
double courseR = toRadians(cours... | java | public final Position predict(double distanceKm, double courseDegrees) {
assertWithMsg(alt == 0.0, "Predictions only valid for Earth's surface");
double dr = distanceKm / EARTH_RADIUS_KM;
double latR = toRadians(lat);
double lonR = toRadians(lon);
double courseR = toRadians(cours... | [
"public",
"final",
"Position",
"predict",
"(",
"double",
"distanceKm",
",",
"double",
"courseDegrees",
")",
"{",
"assertWithMsg",
"(",
"alt",
"==",
"0.0",
",",
"\"Predictions only valid for Earth's surface\"",
")",
";",
"double",
"dr",
"=",
"distanceKm",
"/",
"EAR... | Predicts position travelling along a great circle arc based on the
Haversine formula.
From http://www.movable-type.co.uk/scripts/latlong.html
@param distanceKm
@param courseDegrees
@return | [
"Predicts",
"position",
"travelling",
"along",
"a",
"great",
"circle",
"arc",
"based",
"on",
"the",
"Haversine",
"formula",
"."
] | f2d03e6b9771f15425fb3f76314837efc08c1233 | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L104-L115 | train |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.getBearingDegrees | public final double getBearingDegrees(Position position) {
double lat1 = toRadians(lat);
double lat2 = toRadians(position.lat);
double lon1 = toRadians(lon);
double lon2 = toRadians(position.lon);
double dLon = lon2 - lon1;
double sinDLon = sin(dLon);
double cosLa... | java | public final double getBearingDegrees(Position position) {
double lat1 = toRadians(lat);
double lat2 = toRadians(position.lat);
double lon1 = toRadians(lon);
double lon2 = toRadians(position.lon);
double dLon = lon2 - lon1;
double sinDLon = sin(dLon);
double cosLa... | [
"public",
"final",
"double",
"getBearingDegrees",
"(",
"Position",
"position",
")",
"{",
"double",
"lat1",
"=",
"toRadians",
"(",
"lat",
")",
";",
"double",
"lat2",
"=",
"toRadians",
"(",
"position",
".",
"lat",
")",
";",
"double",
"lon1",
"=",
"toRadians"... | Returns a great circle bearing in degrees in the range 0 to 360.
@param position
@return | [
"Returns",
"a",
"great",
"circle",
"bearing",
"in",
"degrees",
"in",
"the",
"range",
"0",
"to",
"360",
"."
] | f2d03e6b9771f15425fb3f76314837efc08c1233 | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L290-L304 | train |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.getBearingDifferenceDegrees | public static double getBearingDifferenceDegrees(double bearing1, double bearing2) {
if (bearing1 < 0)
bearing1 += 360;
if (bearing2 > 180)
bearing2 -= 360;
double result = bearing1 - bearing2;
if (result > 180)
result -= 360;
return result;
... | java | public static double getBearingDifferenceDegrees(double bearing1, double bearing2) {
if (bearing1 < 0)
bearing1 += 360;
if (bearing2 > 180)
bearing2 -= 360;
double result = bearing1 - bearing2;
if (result > 180)
result -= 360;
return result;
... | [
"public",
"static",
"double",
"getBearingDifferenceDegrees",
"(",
"double",
"bearing1",
",",
"double",
"bearing2",
")",
"{",
"if",
"(",
"bearing1",
"<",
"0",
")",
"bearing1",
"+=",
"360",
";",
"if",
"(",
"bearing2",
">",
"180",
")",
"bearing2",
"-=",
"360"... | returns difference in degrees in the range -180 to 180
@param bearing1
degrees between -360 and 360
@param bearing2
degrees between -360 and 360
@return | [
"returns",
"difference",
"in",
"degrees",
"in",
"the",
"range",
"-",
"180",
"to",
"180"
] | f2d03e6b9771f15425fb3f76314837efc08c1233 | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L315-L324 | train |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.getPositionAlongPath | public final Position getPositionAlongPath(Position position, double proportion) {
if (proportion >= 0 && proportion <= 1) {
// Get bearing degrees for course
double courseDegrees = this.getBearingDegrees(position);
// Get distance from position arg and this objects locati... | java | public final Position getPositionAlongPath(Position position, double proportion) {
if (proportion >= 0 && proportion <= 1) {
// Get bearing degrees for course
double courseDegrees = this.getBearingDegrees(position);
// Get distance from position arg and this objects locati... | [
"public",
"final",
"Position",
"getPositionAlongPath",
"(",
"Position",
"position",
",",
"double",
"proportion",
")",
"{",
"if",
"(",
"proportion",
">=",
"0",
"&&",
"proportion",
"<=",
"1",
")",
"{",
"// Get bearing degrees for course",
"double",
"courseDegrees",
... | Returns a position along a path according to the proportion value
@param position
@param proportion
is between 0 and 1 inclusive
@return | [
"Returns",
"a",
"position",
"along",
"a",
"path",
"according",
"to",
"the",
"proportion",
"value"
] | f2d03e6b9771f15425fb3f76314837efc08c1233 | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L387-L405 | train |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.longitudeDiff | public static double longitudeDiff(double a, double b) {
a = to180(a);
b = to180(b);
return Math.abs(to180(a - b));
} | java | public static double longitudeDiff(double a, double b) {
a = to180(a);
b = to180(b);
return Math.abs(to180(a - b));
} | [
"public",
"static",
"double",
"longitudeDiff",
"(",
"double",
"a",
",",
"double",
"b",
")",
"{",
"a",
"=",
"to180",
"(",
"a",
")",
";",
"b",
"=",
"to180",
"(",
"b",
")",
";",
"return",
"Math",
".",
"abs",
"(",
"to180",
"(",
"a",
"-",
"b",
")",
... | Returns the difference between two longitude values. The returned value
is always >=0.
@param a
@param b
@return | [
"Returns",
"the",
"difference",
"between",
"two",
"longitude",
"values",
".",
"The",
"returned",
"value",
"is",
"always",
">",
"=",
"0",
"."
] | f2d03e6b9771f15425fb3f76314837efc08c1233 | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L568-L572 | train |
davidmoten/grumpy | grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java | Position.to180 | public static double to180(double d) {
if (d < 0)
return -to180(abs(d));
else {
if (d > 180) {
long n = round(floor((d + 180) / 360.0));
return d - n * 360;
} else
return d;
}
} | java | public static double to180(double d) {
if (d < 0)
return -to180(abs(d));
else {
if (d > 180) {
long n = round(floor((d + 180) / 360.0));
return d - n * 360;
} else
return d;
}
} | [
"public",
"static",
"double",
"to180",
"(",
"double",
"d",
")",
"{",
"if",
"(",
"d",
"<",
"0",
")",
"return",
"-",
"to180",
"(",
"abs",
"(",
"d",
")",
")",
";",
"else",
"{",
"if",
"(",
"d",
">",
"180",
")",
"{",
"long",
"n",
"=",
"round",
"... | Converts an angle in degrees to range -180< x <= 180.
@param d
@return | [
"Converts",
"an",
"angle",
"in",
"degrees",
"to",
"range",
"-",
"180<",
"x",
"<",
"=",
"180",
"."
] | f2d03e6b9771f15425fb3f76314837efc08c1233 | https://github.com/davidmoten/grumpy/blob/f2d03e6b9771f15425fb3f76314837efc08c1233/grumpy-core/src/main/java/com/github/davidmoten/grumpy/core/Position.java#L580-L590 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.