id int32 0 165k | 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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
41,000 | facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/OrcFile.java | OrcFile.createWriter | public static Writer createWriter(FileSystem fs,
Path path,
Configuration conf,
ObjectInspector inspector,
long stripeSize,
CompressionKind ... | java | public static Writer createWriter(FileSystem fs,
Path path,
Configuration conf,
ObjectInspector inspector,
long stripeSize,
CompressionKind ... | [
"public",
"static",
"Writer",
"createWriter",
"(",
"FileSystem",
"fs",
",",
"Path",
"path",
",",
"Configuration",
"conf",
",",
"ObjectInspector",
"inspector",
",",
"long",
"stripeSize",
",",
"CompressionKind",
"compress",
",",
"int",
"bufferSize",
",",
"int",
"r... | Create an ORC file streamFactory.
@param fs file system
@param path filename to write to
@param inspector the ObjectInspector that inspects the rows
@param stripeSize the number of bytes in a stripe
@param compress how to compress the file
@param bufferSize the number of bytes to compress at once
@param rowIndexStride ... | [
"Create",
"an",
"ORC",
"file",
"streamFactory",
"."
] | a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45 | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/OrcFile.java#L122-L132 |
41,001 | facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/StreamName.java | StreamName.compareKinds | private int compareKinds(Kind kind1, Kind kind2) {
if (kind1 == Kind.LENGTH && kind2 == Kind.DATA) {
return -1;
}
if (kind1 == Kind.DATA && kind2 == Kind.LENGTH) {
return 1;
}
return kind1.compareTo(kind2);
} | java | private int compareKinds(Kind kind1, Kind kind2) {
if (kind1 == Kind.LENGTH && kind2 == Kind.DATA) {
return -1;
}
if (kind1 == Kind.DATA && kind2 == Kind.LENGTH) {
return 1;
}
return kind1.compareTo(kind2);
} | [
"private",
"int",
"compareKinds",
"(",
"Kind",
"kind1",
",",
"Kind",
"kind2",
")",
"{",
"if",
"(",
"kind1",
"==",
"Kind",
".",
"LENGTH",
"&&",
"kind2",
"==",
"Kind",
".",
"DATA",
")",
"{",
"return",
"-",
"1",
";",
"}",
"if",
"(",
"kind1",
"==",
"... | stuck with it, this is just a hack to work around that. | [
"stuck",
"with",
"it",
"this",
"is",
"just",
"a",
"hack",
"to",
"work",
"around",
"that",
"."
] | a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45 | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/StreamName.java#L70-L80 |
41,002 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.sendMessage | protected void sendMessage(String dest, Message message) {
if (LOG.isTraceEnabled()) {
LOG.trace("Sends message {} to {}.",
TextFormat.shortDebugString(message),
dest);
}
this.transport.send(dest, message);
} | java | protected void sendMessage(String dest, Message message) {
if (LOG.isTraceEnabled()) {
LOG.trace("Sends message {} to {}.",
TextFormat.shortDebugString(message),
dest);
}
this.transport.send(dest, message);
} | [
"protected",
"void",
"sendMessage",
"(",
"String",
"dest",
",",
"Message",
"message",
")",
"{",
"if",
"(",
"LOG",
".",
"isTraceEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"trace",
"(",
"\"Sends message {} to {}.\"",
",",
"TextFormat",
".",
"shortDebugString",
... | Sends message to the specific destination.
@param dest the destination of the message.
@param message the message to be sent. | [
"Sends",
"message",
"to",
"the",
"specific",
"destination",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L265-L272 |
41,003 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.waitForSyncEnd | void waitForSyncEnd(String peerId)
throws TimeoutException, IOException, InterruptedException {
MessageTuple tuple = filter.getExpectedMessage(MessageType.SYNC_END,
peerId,
getSyncTimeoutMs());
ClusterCon... | java | void waitForSyncEnd(String peerId)
throws TimeoutException, IOException, InterruptedException {
MessageTuple tuple = filter.getExpectedMessage(MessageType.SYNC_END,
peerId,
getSyncTimeoutMs());
ClusterCon... | [
"void",
"waitForSyncEnd",
"(",
"String",
"peerId",
")",
"throws",
"TimeoutException",
",",
"IOException",
",",
"InterruptedException",
"{",
"MessageTuple",
"tuple",
"=",
"filter",
".",
"getExpectedMessage",
"(",
"MessageType",
".",
"SYNC_END",
",",
"peerId",
",",
... | Waits for the end of the synchronization and updates last seen config
file.
@param peerId the id of the peer.
@throws TimeoutException in case of timeout.
@throws IOException in case of IOException.
@throws InterruptedException if it's interrupted. | [
"Waits",
"for",
"the",
"end",
"of",
"the",
"synchronization",
"and",
"updates",
"last",
"seen",
"config",
"file",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L434-L451 |
41,004 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.restoreFromSnapshot | void restoreFromSnapshot() throws IOException {
Zxid snapshotZxid = persistence.getSnapshotZxid();
LOG.debug("The last applied zxid in snapshot is {}", snapshotZxid);
if (snapshotZxid != Zxid.ZXID_NOT_EXIST &&
lastDeliveredZxid == Zxid.ZXID_NOT_EXIST) {
// Restores from snapshot only if the la... | java | void restoreFromSnapshot() throws IOException {
Zxid snapshotZxid = persistence.getSnapshotZxid();
LOG.debug("The last applied zxid in snapshot is {}", snapshotZxid);
if (snapshotZxid != Zxid.ZXID_NOT_EXIST &&
lastDeliveredZxid == Zxid.ZXID_NOT_EXIST) {
// Restores from snapshot only if the la... | [
"void",
"restoreFromSnapshot",
"(",
")",
"throws",
"IOException",
"{",
"Zxid",
"snapshotZxid",
"=",
"persistence",
".",
"getSnapshotZxid",
"(",
")",
";",
"LOG",
".",
"debug",
"(",
"\"The last applied zxid in snapshot is {}\"",
",",
"snapshotZxid",
")",
";",
"if",
... | Restores the state of user's application from snapshot file. | [
"Restores",
"the",
"state",
"of",
"user",
"s",
"application",
"from",
"snapshot",
"file",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L472-L486 |
41,005 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.deliverUndeliveredTxns | void deliverUndeliveredTxns() throws IOException {
LOG.debug("Delivering all the undelivered txns after {}",
lastDeliveredZxid);
Zxid startZxid =
new Zxid(lastDeliveredZxid.getEpoch(), lastDeliveredZxid.getXid() + 1);
Log log = persistence.getLog();
try (Log.LogIterator iter = log.ge... | java | void deliverUndeliveredTxns() throws IOException {
LOG.debug("Delivering all the undelivered txns after {}",
lastDeliveredZxid);
Zxid startZxid =
new Zxid(lastDeliveredZxid.getEpoch(), lastDeliveredZxid.getXid() + 1);
Log log = persistence.getLog();
try (Log.LogIterator iter = log.ge... | [
"void",
"deliverUndeliveredTxns",
"(",
")",
"throws",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"Delivering all the undelivered txns after {}\"",
",",
"lastDeliveredZxid",
")",
";",
"Zxid",
"startZxid",
"=",
"new",
"Zxid",
"(",
"lastDeliveredZxid",
".",
"getEpoc... | Delivers all the transactions in the log after last delivered zxid.
@throws IOException in case of IO failures. | [
"Delivers",
"all",
"the",
"transactions",
"in",
"the",
"log",
"after",
"last",
"delivered",
"zxid",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L493-L509 |
41,006 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.clearMessageQueue | protected void clearMessageQueue() {
MessageTuple tuple = null;
while ((tuple = messageQueue.poll()) != null) {
Message msg = tuple.getMessage();
if (msg.getType() == MessageType.DISCONNECTED) {
this.transport.clear(msg.getDisconnected().getServerId());
} else if (msg.getType() == Mess... | java | protected void clearMessageQueue() {
MessageTuple tuple = null;
while ((tuple = messageQueue.poll()) != null) {
Message msg = tuple.getMessage();
if (msg.getType() == MessageType.DISCONNECTED) {
this.transport.clear(msg.getDisconnected().getServerId());
} else if (msg.getType() == Mess... | [
"protected",
"void",
"clearMessageQueue",
"(",
")",
"{",
"MessageTuple",
"tuple",
"=",
"null",
";",
"while",
"(",
"(",
"tuple",
"=",
"messageQueue",
".",
"poll",
"(",
")",
")",
"!=",
"null",
")",
"{",
"Message",
"msg",
"=",
"tuple",
".",
"getMessage",
... | Clears all the messages in the message queue, clears the peer in transport
if it's the DISCONNECTED message. This function should be called only
right before going back to recovery. | [
"Clears",
"all",
"the",
"messages",
"in",
"the",
"message",
"queue",
"clears",
"the",
"peer",
"in",
"transport",
"if",
"it",
"s",
"the",
"DISCONNECTED",
"message",
".",
"This",
"function",
"should",
"be",
"called",
"only",
"right",
"before",
"going",
"back",... | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L543-L553 |
41,007 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.incSyncTimeout | protected int incSyncTimeout() {
int syncTimeoutMs = getSyncTimeoutMs();
participantState.setSyncTimeoutMs(syncTimeoutMs * 2);
LOG.debug("Increase the sync timeout to {}", getSyncTimeoutMs());
return syncTimeoutMs;
} | java | protected int incSyncTimeout() {
int syncTimeoutMs = getSyncTimeoutMs();
participantState.setSyncTimeoutMs(syncTimeoutMs * 2);
LOG.debug("Increase the sync timeout to {}", getSyncTimeoutMs());
return syncTimeoutMs;
} | [
"protected",
"int",
"incSyncTimeout",
"(",
")",
"{",
"int",
"syncTimeoutMs",
"=",
"getSyncTimeoutMs",
"(",
")",
";",
"participantState",
".",
"setSyncTimeoutMs",
"(",
"syncTimeoutMs",
"*",
"2",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Increase the sync timeout to {}... | Doubles the synchronizing timeout.
@return the old synchronizing timeout in milliseconds. | [
"Doubles",
"the",
"synchronizing",
"timeout",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L569-L574 |
41,008 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/Participant.java | Participant.adjustSyncTimeout | protected void adjustSyncTimeout(int timeoutMs) {
int timeoutSec = (timeoutMs + 999) / 1000;
// Finds out the smallest timeout which is powers of 2 and larger than
// timeoutMs.
for (int i = 0; i < 32; ++i) {
if ((1 << i) >= timeoutSec) {
LOG.debug("Adjust timeout to {} sec", 1 << i);
... | java | protected void adjustSyncTimeout(int timeoutMs) {
int timeoutSec = (timeoutMs + 999) / 1000;
// Finds out the smallest timeout which is powers of 2 and larger than
// timeoutMs.
for (int i = 0; i < 32; ++i) {
if ((1 << i) >= timeoutSec) {
LOG.debug("Adjust timeout to {} sec", 1 << i);
... | [
"protected",
"void",
"adjustSyncTimeout",
"(",
"int",
"timeoutMs",
")",
"{",
"int",
"timeoutSec",
"=",
"(",
"timeoutMs",
"+",
"999",
")",
"/",
"1000",
";",
"// Finds out the smallest timeout which is powers of 2 and larger than",
"// timeoutMs.",
"for",
"(",
"int",
"i... | Adjusts the synchronizing timeout based on parameter timeoutMs. The new
synchronizing timeout will be smallest timeout which is power of 2 and
larger than timeoutMs.
@param timeoutMs the last synchronizing timeout in milliseconds. | [
"Adjusts",
"the",
"synchronizing",
"timeout",
"based",
"on",
"parameter",
"timeoutMs",
".",
"The",
"new",
"synchronizing",
"timeout",
"will",
"be",
"smallest",
"timeout",
"which",
"is",
"power",
"of",
"2",
"and",
"larger",
"than",
"timeoutMs",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/Participant.java#L592-L604 |
41,009 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/RollingLog.java | RollingLog.initFromDir | void initFromDir() {
for (File file : this.logDir.listFiles()) {
if (!file.isDirectory() &&
file.getName().matches("transaction\\.\\d+_\\d+")) {
// Appends the file with valid name to log file list.
this.logFiles.add(file);
}
}
if (!this.logFiles.isEmpty()) {
// S... | java | void initFromDir() {
for (File file : this.logDir.listFiles()) {
if (!file.isDirectory() &&
file.getName().matches("transaction\\.\\d+_\\d+")) {
// Appends the file with valid name to log file list.
this.logFiles.add(file);
}
}
if (!this.logFiles.isEmpty()) {
// S... | [
"void",
"initFromDir",
"(",
")",
"{",
"for",
"(",
"File",
"file",
":",
"this",
".",
"logDir",
".",
"listFiles",
"(",
")",
")",
"{",
"if",
"(",
"!",
"file",
".",
"isDirectory",
"(",
")",
"&&",
"file",
".",
"getName",
"(",
")",
".",
"matches",
"(",... | Initialize from the log directory. | [
"Initialize",
"from",
"the",
"log",
"directory",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/RollingLog.java#L239-L251 |
41,010 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/RollingLog.java | RollingLog.getFileIdx | int getFileIdx(Zxid zxid) {
if (logFiles.isEmpty() ||
zxid.compareTo(getZxidFromFileName(logFiles.get(0))) < 0) {
// If there's no log files or the zxid is smaller than the smallest zxid
// of the rolling log, returns -1.
return -1;
}
int idx = 0;
while (idx < logFiles.size() -... | java | int getFileIdx(Zxid zxid) {
if (logFiles.isEmpty() ||
zxid.compareTo(getZxidFromFileName(logFiles.get(0))) < 0) {
// If there's no log files or the zxid is smaller than the smallest zxid
// of the rolling log, returns -1.
return -1;
}
int idx = 0;
while (idx < logFiles.size() -... | [
"int",
"getFileIdx",
"(",
"Zxid",
"zxid",
")",
"{",
"if",
"(",
"logFiles",
".",
"isEmpty",
"(",
")",
"||",
"zxid",
".",
"compareTo",
"(",
"getZxidFromFileName",
"(",
"logFiles",
".",
"get",
"(",
"0",
")",
")",
")",
"<",
"0",
")",
"{",
"// If there's ... | Given the zxid, find out the idx of the file in list which contains the
transaction with this zxid if and only if the transaction with the zxid
is in RollingLog. If the zxid is smaller than the smallest zxid in log,
-1 will be returned.
@param zxid the zxid of the transaction.
@return the idx of file which possibly co... | [
"Given",
"the",
"zxid",
"find",
"out",
"the",
"idx",
"of",
"the",
"file",
"in",
"list",
"which",
"contains",
"the",
"transaction",
"with",
"this",
"zxid",
"if",
"and",
"only",
"if",
"the",
"transaction",
"with",
"the",
"zxid",
"is",
"in",
"RollingLog",
"... | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/RollingLog.java#L263-L291 |
41,011 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/RollingLog.java | RollingLog.getZxidFromFileName | Zxid getZxidFromFileName(File file) {
String fileName = file.getName();
String strZxid = fileName.substring(fileName.indexOf('.') + 1);
return Zxid.fromSimpleString(strZxid);
} | java | Zxid getZxidFromFileName(File file) {
String fileName = file.getName();
String strZxid = fileName.substring(fileName.indexOf('.') + 1);
return Zxid.fromSimpleString(strZxid);
} | [
"Zxid",
"getZxidFromFileName",
"(",
"File",
"file",
")",
"{",
"String",
"fileName",
"=",
"file",
".",
"getName",
"(",
")",
";",
"String",
"strZxid",
"=",
"fileName",
".",
"substring",
"(",
"fileName",
".",
"indexOf",
"(",
"'",
"'",
")",
"+",
"1",
")",
... | Given the log file, finds out the smallest allowed zxid for thi file. It's
infered by looking at the name of the file.
@return the smallest allowed zxid in this log file. | [
"Given",
"the",
"log",
"file",
"finds",
"out",
"the",
"smallest",
"allowed",
"zxid",
"for",
"thi",
"file",
".",
"It",
"s",
"infered",
"by",
"looking",
"at",
"the",
"name",
"of",
"the",
"file",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/RollingLog.java#L299-L303 |
41,012 | zk1931/jzab | src/main/java/com/github/zk1931/jzab/RollingLog.java | RollingLog.getLastLog | SimpleLog getLastLog() throws IOException {
if (logFiles.isEmpty()) {
return null;
}
return new SimpleLog(logFiles.get(logFiles.size() - 1));
} | java | SimpleLog getLastLog() throws IOException {
if (logFiles.isEmpty()) {
return null;
}
return new SimpleLog(logFiles.get(logFiles.size() - 1));
} | [
"SimpleLog",
"getLastLog",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"logFiles",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"SimpleLog",
"(",
"logFiles",
".",
"get",
"(",
"logFiles",
".",
"size",
"(",
")",... | Gets the last log file in the list of logs.
@return the SimpleLog instance of the last log. | [
"Gets",
"the",
"last",
"log",
"file",
"in",
"the",
"list",
"of",
"logs",
"."
] | 2a8893bcc1a125f3aebdaddee80ad49c9761bba1 | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/RollingLog.java#L310-L315 |
41,013 | 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 |
41,014 | 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 |
41,015 | 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 |
41,016 | 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 |
41,017 | 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 |
41,018 | 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 |
41,019 | 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 |
41,020 | 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 |
41,021 | 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 |
41,022 | 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 |
41,023 | 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 |
41,024 | 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 |
41,025 | 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 |
41,026 | 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 |
41,027 | 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 |
41,028 | 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 |
41,029 | 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 |
41,030 | 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 |
41,031 | 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 |
41,032 | 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 |
41,033 | 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 |
41,034 | 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 |
41,035 | 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 |
41,036 | 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 |
41,037 | 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 |
41,038 | 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 |
41,039 | 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 |
41,040 | 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 |
41,041 | 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 |
41,042 | 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 |
41,043 | 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 |
41,044 | 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 |
41,045 | 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 |
41,046 | 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 |
41,047 | 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 |
41,048 | 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 |
41,049 | 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 |
41,050 | 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 |
41,051 | 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 |
41,052 | 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 |
41,053 | 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 |
41,054 | 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 |
41,055 | 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 |
41,056 | 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 |
41,057 | 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 |
41,058 | 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 |
41,059 | 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 |
41,060 | 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 |
41,061 | 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 |
41,062 | 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 |
41,063 | 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 |
41,064 | 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 |
41,065 | 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 |
41,066 | 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 |
41,067 | 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 |
41,068 | 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 |
41,069 | 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 |
41,070 | 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 |
41,071 | 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 |
41,072 | 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 |
41,073 | 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 |
41,074 | 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 |
41,075 | 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 |
41,076 | 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 |
41,077 | 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 |
41,078 | 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 |
41,079 | 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 |
41,080 | 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 |
41,081 | 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 |
41,082 | 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 |
41,083 | 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 |
41,084 | 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 |
41,085 | 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 |
41,086 | 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 |
41,087 | 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 |
41,088 | 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 |
41,089 | 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 |
41,090 | 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 |
41,091 | 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 |
41,092 | 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 |
41,093 | 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 |
41,094 | 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 |
41,095 | 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 |
41,096 | 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 |
41,097 | 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 |
41,098 | 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 |
41,099 | 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.