repo stringlengths 7 58 | path stringlengths 12 218 | func_name stringlengths 3 140 | original_string stringlengths 73 34.1k | language stringclasses 1
value | code stringlengths 73 34.1k | code_tokens list | docstring stringlengths 3 16k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 105 339 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
theHilikus/JRoboCom | jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/Player.java | Player.loadPlayers | public static List<Player> loadPlayers(List<String> playersFiles) throws PlayerException {
log.info("[loadPlayers] Loading all players");
List<Player> players = new ArrayList<>();
if (playersFiles.size() < 1) {
log.warn("[loadPlayers] No players to load");
}
for (String singlePath : playersFiles) {
Play... | java | public static List<Player> loadPlayers(List<String> playersFiles) throws PlayerException {
log.info("[loadPlayers] Loading all players");
List<Player> players = new ArrayList<>();
if (playersFiles.size() < 1) {
log.warn("[loadPlayers] No players to load");
}
for (String singlePath : playersFiles) {
Play... | [
"public",
"static",
"List",
"<",
"Player",
">",
"loadPlayers",
"(",
"List",
"<",
"String",
">",
"playersFiles",
")",
"throws",
"PlayerException",
"{",
"log",
".",
"info",
"(",
"\"[loadPlayers] Loading all players\"",
")",
";",
"List",
"<",
"Player",
">",
"play... | Creates a list of players using the paths provided
@param playersFiles list of paths (jars or dirs) to the players code
@return list of all created players
@throws PlayerException if there was a problem loading one of the players | [
"Creates",
"a",
"list",
"of",
"players",
"using",
"the",
"paths",
"provided"
] | 0e31c1ecf1006e35f68c229ff66c37640effffac | https://github.com/theHilikus/JRoboCom/blob/0e31c1ecf1006e35f68c229ff66c37640effffac/jrobocom-core/src/main/java/com/github/thehilikus/jrobocom/Player.java#L221-L234 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/DashboardCache.java | DashboardCache.add | public void add(Collection<Dashboard> dashboards)
{
for(Dashboard dashboard : dashboards)
this.dashboards.put(dashboard.getId(), dashboard);
} | java | public void add(Collection<Dashboard> dashboards)
{
for(Dashboard dashboard : dashboards)
this.dashboards.put(dashboard.getId(), dashboard);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"Dashboard",
">",
"dashboards",
")",
"{",
"for",
"(",
"Dashboard",
"dashboard",
":",
"dashboards",
")",
"this",
".",
"dashboards",
".",
"put",
"(",
"dashboard",
".",
"getId",
"(",
")",
",",
"dashboard",
")... | Adds the dashboard list to the dashboards for the account.
@param dashboards The dashboards to add | [
"Adds",
"the",
"dashboard",
"list",
"to",
"the",
"dashboards",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/DashboardCache.java#L55-L59 | train |
pierre/serialization | writer/src/main/java/com/ning/metrics/serialization/writer/ThresholdEventWriter.java | ThresholdEventWriter.write | @Override
public synchronized void write(final Event event) throws IOException
{
if (!acceptsEvents) {
log.warn("Writer not ready, discarding event: {}", event);
return;
}
delegate.write(event);
uncommittedWriteCount++;
commitIfNeeded();
} | java | @Override
public synchronized void write(final Event event) throws IOException
{
if (!acceptsEvents) {
log.warn("Writer not ready, discarding event: {}", event);
return;
}
delegate.write(event);
uncommittedWriteCount++;
commitIfNeeded();
} | [
"@",
"Override",
"public",
"synchronized",
"void",
"write",
"(",
"final",
"Event",
"event",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"acceptsEvents",
")",
"{",
"log",
".",
"warn",
"(",
"\"Writer not ready, discarding event: {}\"",
",",
"event",
")",
... | Write an Event via the delegate writer
@param event the Event to write
@throws IOException as thrown by the delegate writer | [
"Write",
"an",
"Event",
"via",
"the",
"delegate",
"writer"
] | b15b7c749ba78bfe94dce8fc22f31b30b2e6830b | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/writer/src/main/java/com/ning/metrics/serialization/writer/ThresholdEventWriter.java#L84-L96 | train |
pierre/serialization | writer/src/main/java/com/ning/metrics/serialization/writer/ThresholdEventWriter.java | ThresholdEventWriter.forceCommit | @Managed(description = "Commit locally spooled events for flushing")
@Override
public synchronized void forceCommit() throws IOException
{
log.debug("Performing commit on delegate EventWriter [{}]", delegate.getClass());
delegate.commit();
uncommittedWriteCount = 0;
lastComm... | java | @Managed(description = "Commit locally spooled events for flushing")
@Override
public synchronized void forceCommit() throws IOException
{
log.debug("Performing commit on delegate EventWriter [{}]", delegate.getClass());
delegate.commit();
uncommittedWriteCount = 0;
lastComm... | [
"@",
"Managed",
"(",
"description",
"=",
"\"Commit locally spooled events for flushing\"",
")",
"@",
"Override",
"public",
"synchronized",
"void",
"forceCommit",
"(",
")",
"throws",
"IOException",
"{",
"log",
".",
"debug",
"(",
"\"Performing commit on delegate EventWriter... | Perform a commit via the delegate writer
@throws IOException as thrown by the delegate writer | [
"Perform",
"a",
"commit",
"via",
"the",
"delegate",
"writer"
] | b15b7c749ba78bfe94dce8fc22f31b30b2e6830b | https://github.com/pierre/serialization/blob/b15b7c749ba78bfe94dce8fc22f31b30b2e6830b/writer/src/main/java/com/ning/metrics/serialization/writer/ThresholdEventWriter.java#L103-L112 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/OptionalFunction.java | OptionalFunction.orElse | public OptionalFunction<T, R> orElse(Supplier<R> supplier) {
return new OptionalFunction<>(function, supplier);
} | java | public OptionalFunction<T, R> orElse(Supplier<R> supplier) {
return new OptionalFunction<>(function, supplier);
} | [
"public",
"OptionalFunction",
"<",
"T",
",",
"R",
">",
"orElse",
"(",
"Supplier",
"<",
"R",
">",
"supplier",
")",
"{",
"return",
"new",
"OptionalFunction",
"<>",
"(",
"function",
",",
"supplier",
")",
";",
"}"
] | Creates a new OptionalFunction that will use the given function for null values.
@param supplier the supplier to use for null values.
@return a new OptionalFunction | [
"Creates",
"a",
"new",
"OptionalFunction",
"that",
"will",
"use",
"the",
"given",
"function",
"for",
"null",
"values",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/OptionalFunction.java#L52-L54 | train |
devnull-tools/trugger | src/main/java/tools/devnull/trugger/util/OptionalFunction.java | OptionalFunction.orElseThrow | public OptionalFunction<T, R> orElseThrow(Supplier<? extends RuntimeException> exceptionSupplier) {
return new OptionalFunction<>(this.function, () -> {
throw exceptionSupplier.get();
});
} | java | public OptionalFunction<T, R> orElseThrow(Supplier<? extends RuntimeException> exceptionSupplier) {
return new OptionalFunction<>(this.function, () -> {
throw exceptionSupplier.get();
});
} | [
"public",
"OptionalFunction",
"<",
"T",
",",
"R",
">",
"orElseThrow",
"(",
"Supplier",
"<",
"?",
"extends",
"RuntimeException",
">",
"exceptionSupplier",
")",
"{",
"return",
"new",
"OptionalFunction",
"<>",
"(",
"this",
".",
"function",
",",
"(",
")",
"->",
... | Creates a new OptionalFunction that will throw the exception supplied by the given
supplier for null values.
@param exceptionSupplier the supplier to use when this function is called with a null value
@return a new OptionalFunction | [
"Creates",
"a",
"new",
"OptionalFunction",
"that",
"will",
"throw",
"the",
"exception",
"supplied",
"by",
"the",
"given",
"supplier",
"for",
"null",
"values",
"."
] | 614d5f0b30daf82fc251a46fb436d0fc5e787627 | https://github.com/devnull-tools/trugger/blob/614d5f0b30daf82fc251a46fb436d0fc5e787627/src/main/java/tools/devnull/trugger/util/OptionalFunction.java#L74-L78 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/AppTimeZone.java | AppTimeZone.getTimeZone | public static TimeZone getTimeZone(String name)
{
TimeZone ret = null;
if(timezones != null)
{
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getName().equals(name))
ret = timezones[i].getTimeZone();
... | java | public static TimeZone getTimeZone(String name)
{
TimeZone ret = null;
if(timezones != null)
{
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getName().equals(name))
ret = timezones[i].getTimeZone();
... | [
"public",
"static",
"TimeZone",
"getTimeZone",
"(",
"String",
"name",
")",
"{",
"TimeZone",
"ret",
"=",
"null",
";",
"if",
"(",
"timezones",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"timezones",
".",
"length",
"&&",
... | Returns the cached timezone with the given name.
@param name The name of the timezone
@return The cached timezone with the given name | [
"Returns",
"the",
"cached",
"timezone",
"with",
"the",
"given",
"name",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/AppTimeZone.java#L176-L188 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/AppTimeZone.java | AppTimeZone.getTimeZoneById | public static TimeZone getTimeZoneById(String id)
{
TimeZone ret = null;
if(timezones != null)
{
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getId().equals(id))
ret = timezones[i].getTimeZone();
... | java | public static TimeZone getTimeZoneById(String id)
{
TimeZone ret = null;
if(timezones != null)
{
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getId().equals(id))
ret = timezones[i].getTimeZone();
... | [
"public",
"static",
"TimeZone",
"getTimeZoneById",
"(",
"String",
"id",
")",
"{",
"TimeZone",
"ret",
"=",
"null",
";",
"if",
"(",
"timezones",
"!=",
"null",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"timezones",
".",
"length",
"&&",
... | Returns the cached timezone with the given ID.
@param id The id of the timezone
@return The cached timezone with the given ID | [
"Returns",
"the",
"cached",
"timezone",
"with",
"the",
"given",
"ID",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/AppTimeZone.java#L195-L207 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/AppTimeZone.java | AppTimeZone.getTimeZoneByIdIgnoreCase | public static TimeZone getTimeZoneByIdIgnoreCase(String id)
{
TimeZone ret = null;
if(timezones != null)
{
id = id.toLowerCase();
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getId().toLowerCase().equals(id))
... | java | public static TimeZone getTimeZoneByIdIgnoreCase(String id)
{
TimeZone ret = null;
if(timezones != null)
{
id = id.toLowerCase();
for(int i = 0; i < timezones.length && ret == null; i++)
{
if(timezones[i].getId().toLowerCase().equals(id))
... | [
"public",
"static",
"TimeZone",
"getTimeZoneByIdIgnoreCase",
"(",
"String",
"id",
")",
"{",
"TimeZone",
"ret",
"=",
"null",
";",
"if",
"(",
"timezones",
"!=",
"null",
")",
"{",
"id",
"=",
"id",
".",
"toLowerCase",
"(",
")",
";",
"for",
"(",
"int",
"i",... | Returns the cached timezone with the given ID ignoring case.
@param id The id of the timezone
@return The cached timezone with the given ID | [
"Returns",
"the",
"cached",
"timezone",
"with",
"the",
"given",
"ID",
"ignoring",
"case",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/AppTimeZone.java#L214-L227 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/util/AppTimeZone.java | AppTimeZone.getDisplayName | private String getDisplayName()
{
long hours = TimeUnit.MILLISECONDS.toHours(tz.getRawOffset());
long minutes = Math.abs(TimeUnit.MILLISECONDS.toMinutes(tz.getRawOffset())
-TimeUnit.HOURS.toMinutes(hours));
return String.format("(GMT%+d:%02d) %s", hours, minutes, tz.getID());
... | java | private String getDisplayName()
{
long hours = TimeUnit.MILLISECONDS.toHours(tz.getRawOffset());
long minutes = Math.abs(TimeUnit.MILLISECONDS.toMinutes(tz.getRawOffset())
-TimeUnit.HOURS.toMinutes(hours));
return String.format("(GMT%+d:%02d) %s", hours, minutes, tz.getID());
... | [
"private",
"String",
"getDisplayName",
"(",
")",
"{",
"long",
"hours",
"=",
"TimeUnit",
".",
"MILLISECONDS",
".",
"toHours",
"(",
"tz",
".",
"getRawOffset",
"(",
")",
")",
";",
"long",
"minutes",
"=",
"Math",
".",
"abs",
"(",
"TimeUnit",
".",
"MILLISECON... | Returns the display name of the timezone.
@return The display name of the timezone | [
"Returns",
"the",
"display",
"name",
"of",
"the",
"timezone",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/util/AppTimeZone.java#L233-L239 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java | MandatoryWarningHandler.report | public void report(DiagnosticPosition pos, String msg, Object... args) {
JavaFileObject currentSource = log.currentSourceFile();
if (verbose) {
if (sourcesWithReportedWarnings == null)
sourcesWithReportedWarnings = new HashSet<JavaFileObject>();
if (log.nwarning... | java | public void report(DiagnosticPosition pos, String msg, Object... args) {
JavaFileObject currentSource = log.currentSourceFile();
if (verbose) {
if (sourcesWithReportedWarnings == null)
sourcesWithReportedWarnings = new HashSet<JavaFileObject>();
if (log.nwarning... | [
"public",
"void",
"report",
"(",
"DiagnosticPosition",
"pos",
",",
"String",
"msg",
",",
"Object",
"...",
"args",
")",
"{",
"JavaFileObject",
"currentSource",
"=",
"log",
".",
"currentSourceFile",
"(",
")",
";",
"if",
"(",
"verbose",
")",
"{",
"if",
"(",
... | Report a mandatory warning. | [
"Report",
"a",
"mandatory",
"warning",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java#L124-L166 | train |
syphr42/libmythtv-java | protocol/src/main/java/org/syphr/mythtv/protocol/impl/ProtocolUtils.java | ProtocolUtils.combineInts | public static long combineInts(String high, String low) throws NumberFormatException
{
int highInt = Integer.parseInt(high);
int lowInt = Integer.parseInt(low);
/*
* Shift the high integer into the upper 32 bits and add the low
* integer. However, since this is really a si... | java | public static long combineInts(String high, String low) throws NumberFormatException
{
int highInt = Integer.parseInt(high);
int lowInt = Integer.parseInt(low);
/*
* Shift the high integer into the upper 32 bits and add the low
* integer. However, since this is really a si... | [
"public",
"static",
"long",
"combineInts",
"(",
"String",
"high",
",",
"String",
"low",
")",
"throws",
"NumberFormatException",
"{",
"int",
"highInt",
"=",
"Integer",
".",
"parseInt",
"(",
"high",
")",
";",
"int",
"lowInt",
"=",
"Integer",
".",
"parseInt",
... | Combine two numbers that represent the high and low bits of a 64-bit
number.
@see #splitLong(long)
@param high
the high 32 bits
@param low
the low 32 bits
@return a 64 bit number comprised of the given high and low bits
concatenated together
@throws NumberFormatException
if the strings cannot be parsed as integers | [
"Combine",
"two",
"numbers",
"that",
"represent",
"the",
"high",
"and",
"low",
"bits",
"of",
"a",
"64",
"-",
"bit",
"number",
"."
] | cc7a2012fbd4a4ba2562dda6b2614fb0548526ea | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/protocol/src/main/java/org/syphr/mythtv/protocol/impl/ProtocolUtils.java#L43-L56 | train |
syphr42/libmythtv-java | protocol/src/main/java/org/syphr/mythtv/protocol/impl/ProtocolUtils.java | ProtocolUtils.splitLong | public static Pair<String, String> splitLong(long value)
{
return Pair.of(String.valueOf((int)(value >> 32)), String.valueOf((int)value));
} | java | public static Pair<String, String> splitLong(long value)
{
return Pair.of(String.valueOf((int)(value >> 32)), String.valueOf((int)value));
} | [
"public",
"static",
"Pair",
"<",
"String",
",",
"String",
">",
"splitLong",
"(",
"long",
"value",
")",
"{",
"return",
"Pair",
".",
"of",
"(",
"String",
".",
"valueOf",
"(",
"(",
"int",
")",
"(",
"value",
">>",
"32",
")",
")",
",",
"String",
".",
... | Split a single 64 bit number into integers representing the high and low
32 bits.
@see #combineInts(String, String)
@param value
the value to split
@return a pair of integers where the left is the high 32 bits and the
right is the low 32 bits, represented as strings | [
"Split",
"a",
"single",
"64",
"bit",
"number",
"into",
"integers",
"representing",
"the",
"high",
"and",
"low",
"32",
"bits",
"."
] | cc7a2012fbd4a4ba2562dda6b2614fb0548526ea | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/protocol/src/main/java/org/syphr/mythtv/protocol/impl/ProtocolUtils.java#L69-L72 | train |
syphr42/libmythtv-java | commons/src/main/java/org/syphr/mythtv/commons/socket/CommandUtils.java | CommandUtils.sendExpectOk | public static void sendExpectOk(SocketManager socketManager, String message) throws IOException
{
expectOk(socketManager.sendAndWait(message));
} | java | public static void sendExpectOk(SocketManager socketManager, String message) throws IOException
{
expectOk(socketManager.sendAndWait(message));
} | [
"public",
"static",
"void",
"sendExpectOk",
"(",
"SocketManager",
"socketManager",
",",
"String",
"message",
")",
"throws",
"IOException",
"{",
"expectOk",
"(",
"socketManager",
".",
"sendAndWait",
"(",
"message",
")",
")",
";",
"}"
] | Send a message via the given socket manager which should always receive a case
insensitive "OK" as the reply.
@param socketManager
the socket manager that will be used to send and receive over the
network
@param message
the message to send
@throws IOException
if there is a communication error or an unexpected response | [
"Send",
"a",
"message",
"via",
"the",
"given",
"socket",
"manager",
"which",
"should",
"always",
"receive",
"a",
"case",
"insensitive",
"OK",
"as",
"the",
"reply",
"."
] | cc7a2012fbd4a4ba2562dda6b2614fb0548526ea | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/commons/src/main/java/org/syphr/mythtv/commons/socket/CommandUtils.java#L37-L40 | train |
syphr42/libmythtv-java | commons/src/main/java/org/syphr/mythtv/commons/socket/CommandUtils.java | CommandUtils.expectOk | public static void expectOk(String response) throws ProtocolException
{
if (!"OK".equalsIgnoreCase(response))
{
throw new ProtocolException(response, Direction.RECEIVE);
}
} | java | public static void expectOk(String response) throws ProtocolException
{
if (!"OK".equalsIgnoreCase(response))
{
throw new ProtocolException(response, Direction.RECEIVE);
}
} | [
"public",
"static",
"void",
"expectOk",
"(",
"String",
"response",
")",
"throws",
"ProtocolException",
"{",
"if",
"(",
"!",
"\"OK\"",
".",
"equalsIgnoreCase",
"(",
"response",
")",
")",
"{",
"throw",
"new",
"ProtocolException",
"(",
"response",
",",
"Direction... | Check the response for an "OK" message. Throw an exception if response is not
expected.
@param response
the response to check
@throws ProtocolException
if the response is not the expected case-insensitive "OK" | [
"Check",
"the",
"response",
"for",
"an",
"OK",
"message",
".",
"Throw",
"an",
"exception",
"if",
"response",
"is",
"not",
"expected",
"."
] | cc7a2012fbd4a4ba2562dda6b2614fb0548526ea | https://github.com/syphr42/libmythtv-java/blob/cc7a2012fbd4a4ba2562dda6b2614fb0548526ea/commons/src/main/java/org/syphr/mythtv/commons/socket/CommandUtils.java#L51-L57 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javadoc/Messager.java | Messager.printError | public void printError(SourcePosition pos, String msg) {
if (diagListener != null) {
report(DiagnosticType.ERROR, pos, msg);
return;
}
if (nerrors < MaxErrors) {
String prefix = (pos == null) ? programName : pos.toString();
errWriter.println(prefi... | java | public void printError(SourcePosition pos, String msg) {
if (diagListener != null) {
report(DiagnosticType.ERROR, pos, msg);
return;
}
if (nerrors < MaxErrors) {
String prefix = (pos == null) ? programName : pos.toString();
errWriter.println(prefi... | [
"public",
"void",
"printError",
"(",
"SourcePosition",
"pos",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"diagListener",
"!=",
"null",
")",
"{",
"report",
"(",
"DiagnosticType",
".",
"ERROR",
",",
"pos",
",",
"msg",
")",
";",
"return",
";",
"}",
"if",
... | Print error message, increment error count.
Part of DocErrorReporter.
@param pos the position where the error occurs
@param msg message to print | [
"Print",
"error",
"message",
"increment",
"error",
"count",
".",
"Part",
"of",
"DocErrorReporter",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javadoc/Messager.java#L165-L178 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/StructTypeConverter.java | StructTypeConverter.unmarshal | public Object unmarshal(Object map) throws RpcException {
return unmarshal(getTypeClass(), map, this.s, this.isOptional);
} | java | public Object unmarshal(Object map) throws RpcException {
return unmarshal(getTypeClass(), map, this.s, this.isOptional);
} | [
"public",
"Object",
"unmarshal",
"(",
"Object",
"map",
")",
"throws",
"RpcException",
"{",
"return",
"unmarshal",
"(",
"getTypeClass",
"(",
")",
",",
"map",
",",
"this",
".",
"s",
",",
"this",
".",
"isOptional",
")",
";",
"}"
] | Converts o from a Map back to the Java Class associated with this Struct.
Recursively unmarshals all the members of the map.
@param map Map to unmarshal
@throws RpcException If o does not comply with the IDL definition for this Struct | [
"Converts",
"o",
"from",
"a",
"Map",
"back",
"to",
"the",
"Java",
"Class",
"associated",
"with",
"this",
"Struct",
".",
"Recursively",
"unmarshals",
"all",
"the",
"members",
"of",
"the",
"map",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/StructTypeConverter.java#L52-L54 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/StructTypeConverter.java | StructTypeConverter.marshal | @SuppressWarnings("unchecked")
public Object marshal(Object o) throws RpcException {
if (o == null) {
return returnNullIfOptional();
}
else if (o instanceof BStruct) {
return validateMap(structToMap(o, this.s), this.s);
}
else if (o instanceof Map) {
... | java | @SuppressWarnings("unchecked")
public Object marshal(Object o) throws RpcException {
if (o == null) {
return returnNullIfOptional();
}
else if (o instanceof BStruct) {
return validateMap(structToMap(o, this.s), this.s);
}
else if (o instanceof Map) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Object",
"marshal",
"(",
"Object",
"o",
")",
"throws",
"RpcException",
"{",
"if",
"(",
"o",
"==",
"null",
")",
"{",
"return",
"returnNullIfOptional",
"(",
")",
";",
"}",
"else",
"if",
"(",
"o... | Marshals native Java type o to a Map that can be serialized.
Recursively marshals all of the Struct fields from o onto the map.
@param o Java object to marshal to Map
@return Map containing the marshaled data
@throws RpcException If o does not validate against the Struct spec in the IDL.
The most common validation err... | [
"Marshals",
"native",
"Java",
"type",
"o",
"to",
"a",
"Map",
"that",
"can",
"be",
"serialized",
".",
"Recursively",
"marshals",
"all",
"of",
"the",
"Struct",
"fields",
"from",
"o",
"onto",
"the",
"map",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/StructTypeConverter.java#L66-L81 | train |
Wadpam/guja | guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java | GAEBlobServlet.getUploadUrl | private void getUploadUrl(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
LOGGER.debug("Get blobstore upload url");
String callback = req.getParameter(CALLBACK_PARAM);
if (null == callback) {
callback = req.getRequestURI();
}
String keepQueryParam = r... | java | private void getUploadUrl(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
LOGGER.debug("Get blobstore upload url");
String callback = req.getParameter(CALLBACK_PARAM);
if (null == callback) {
callback = req.getRequestURI();
}
String keepQueryParam = r... | [
"private",
"void",
"getUploadUrl",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"resp",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Get blobstore upload url\"",
")",
";",
"String",
"callback",
"=",
"re... | Get an upload URL
@param req
@param resp
@throws ServletException
@throws IOException | [
"Get",
"an",
"upload",
"URL"
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java#L104-L128 | train |
Wadpam/guja | guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java | GAEBlobServlet.getEncodeFileName | private static String getEncodeFileName(String userAgent, String fileName) {
String encodedFileName = fileName;
try {
if (userAgent.contains("MSIE") || userAgent.contains("Opera")) {
encodedFileName = URLEncoder.encode(fileName, "UTF-8");
} else {
encodedFileName = "=?UTF-8?B?" + new... | java | private static String getEncodeFileName(String userAgent, String fileName) {
String encodedFileName = fileName;
try {
if (userAgent.contains("MSIE") || userAgent.contains("Opera")) {
encodedFileName = URLEncoder.encode(fileName, "UTF-8");
} else {
encodedFileName = "=?UTF-8?B?" + new... | [
"private",
"static",
"String",
"getEncodeFileName",
"(",
"String",
"userAgent",
",",
"String",
"fileName",
")",
"{",
"String",
"encodedFileName",
"=",
"fileName",
";",
"try",
"{",
"if",
"(",
"userAgent",
".",
"contains",
"(",
"\"MSIE\"",
")",
"||",
"userAgent"... | Encode header value for Content-Disposition | [
"Encode",
"header",
"value",
"for",
"Content",
"-",
"Disposition"
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-gae/src/main/java/com/wadpam/guja/servlet/GAEBlobServlet.java#L215-L228 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Annotate.java | Annotate.enterAnnotation | Attribute.Compound enterAnnotation(JCAnnotation a,
Type expected,
Env<AttrContext> env) {
return enterAnnotation(a, expected, env, false);
} | java | Attribute.Compound enterAnnotation(JCAnnotation a,
Type expected,
Env<AttrContext> env) {
return enterAnnotation(a, expected, env, false);
} | [
"Attribute",
".",
"Compound",
"enterAnnotation",
"(",
"JCAnnotation",
"a",
",",
"Type",
"expected",
",",
"Env",
"<",
"AttrContext",
">",
"env",
")",
"{",
"return",
"enterAnnotation",
"(",
"a",
",",
"expected",
",",
"env",
",",
"false",
")",
";",
"}"
] | Process a single compound annotation, returning its
Attribute. Used from MemberEnter for attaching the attributes
to the annotated symbol. | [
"Process",
"a",
"single",
"compound",
"annotation",
"returning",
"its",
"Attribute",
".",
"Used",
"from",
"MemberEnter",
"for",
"attaching",
"the",
"attributes",
"to",
"the",
"annotated",
"symbol",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Annotate.java#L233-L237 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Annotate.java | Annotate.getContainingType | private Type getContainingType(Attribute.Compound currentAnno,
DiagnosticPosition pos,
boolean reportError)
{
Type origAnnoType = currentAnno.type;
TypeSymbol origAnnoDecl = origAnnoType.tsym;
// Fetch the Repeatable annotation from the current
// annotation'... | java | private Type getContainingType(Attribute.Compound currentAnno,
DiagnosticPosition pos,
boolean reportError)
{
Type origAnnoType = currentAnno.type;
TypeSymbol origAnnoDecl = origAnnoType.tsym;
// Fetch the Repeatable annotation from the current
// annotation'... | [
"private",
"Type",
"getContainingType",
"(",
"Attribute",
".",
"Compound",
"currentAnno",
",",
"DiagnosticPosition",
"pos",
",",
"boolean",
"reportError",
")",
"{",
"Type",
"origAnnoType",
"=",
"currentAnno",
".",
"type",
";",
"TypeSymbol",
"origAnnoDecl",
"=",
"o... | Fetches the actual Type that should be the containing annotation. | [
"Fetches",
"the",
"actual",
"Type",
"that",
"should",
"be",
"the",
"containing",
"annotation",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Annotate.java#L556-L574 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java | XlsxWorkbook.getSheetNames | @Override
public String[] getSheetNames()
{
String[] ret = null;
if(sheets != null)
{
ret = new String[sheets.size()];
for(int i = 0; i < sheets.size(); i++)
{
Sheet sheet = (Sheet)sheets.get(i);
ret[i] = sheet.getName()... | java | @Override
public String[] getSheetNames()
{
String[] ret = null;
if(sheets != null)
{
ret = new String[sheets.size()];
for(int i = 0; i < sheets.size(); i++)
{
Sheet sheet = (Sheet)sheets.get(i);
ret[i] = sheet.getName()... | [
"@",
"Override",
"public",
"String",
"[",
"]",
"getSheetNames",
"(",
")",
"{",
"String",
"[",
"]",
"ret",
"=",
"null",
";",
"if",
"(",
"sheets",
"!=",
"null",
")",
"{",
"ret",
"=",
"new",
"String",
"[",
"sheets",
".",
"size",
"(",
")",
"]",
";",
... | Returns the list of worksheet names from the given Excel XLSX file.
@return The list of worksheet names from the given workbook | [
"Returns",
"the",
"list",
"of",
"worksheet",
"names",
"from",
"the",
"given",
"Excel",
"XLSX",
"file",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java#L308-L322 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java | XlsxWorkbook.getSharedString | public String getSharedString(int i)
{
String ret = null;
CTRst string = strings.getSi().get(i);
if(string != null && string.getT() != null)
ret = string.getT().getValue();
if(ret == null) // cell has multiple formats or fonts
{
List<CTRElt> list = str... | java | public String getSharedString(int i)
{
String ret = null;
CTRst string = strings.getSi().get(i);
if(string != null && string.getT() != null)
ret = string.getT().getValue();
if(ret == null) // cell has multiple formats or fonts
{
List<CTRElt> list = str... | [
"public",
"String",
"getSharedString",
"(",
"int",
"i",
")",
"{",
"String",
"ret",
"=",
"null",
";",
"CTRst",
"string",
"=",
"strings",
".",
"getSi",
"(",
")",
".",
"get",
"(",
"i",
")",
";",
"if",
"(",
"string",
"!=",
"null",
"&&",
"string",
".",
... | Returns the string at the given index in SharedStrings.xml.
@param i The index of the string
@return The string at the given index in SharedStrings.xml | [
"Returns",
"the",
"string",
"at",
"the",
"given",
"index",
"in",
"SharedStrings",
".",
"xml",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java#L358-L382 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java | XlsxWorkbook.getFormatCode | public String getFormatCode(long id)
{
if(numFmts == null)
cacheFormatCodes();
return (String)numFmts.get(new Long(id));
} | java | public String getFormatCode(long id)
{
if(numFmts == null)
cacheFormatCodes();
return (String)numFmts.get(new Long(id));
} | [
"public",
"String",
"getFormatCode",
"(",
"long",
"id",
")",
"{",
"if",
"(",
"numFmts",
"==",
"null",
")",
"cacheFormatCodes",
"(",
")",
";",
"return",
"(",
"String",
")",
"numFmts",
".",
"get",
"(",
"new",
"Long",
"(",
"id",
")",
")",
";",
"}"
] | Returns the number format code for given id in styles.xml.
@param id The number format id
@return The number format code for given id in styles.xml | [
"Returns",
"the",
"number",
"format",
"code",
"for",
"given",
"id",
"in",
"styles",
".",
"xml",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java#L398-L403 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java | XlsxWorkbook.addFormatCode | private void addFormatCode(CTNumFmt fmt)
{
if(numFmts == null)
numFmts = new HashMap();
numFmts.put(fmt.getNumFmtId(),
fmt.getFormatCode());
} | java | private void addFormatCode(CTNumFmt fmt)
{
if(numFmts == null)
numFmts = new HashMap();
numFmts.put(fmt.getNumFmtId(),
fmt.getFormatCode());
} | [
"private",
"void",
"addFormatCode",
"(",
"CTNumFmt",
"fmt",
")",
"{",
"if",
"(",
"numFmts",
"==",
"null",
")",
"numFmts",
"=",
"new",
"HashMap",
"(",
")",
";",
"numFmts",
".",
"put",
"(",
"fmt",
".",
"getNumFmtId",
"(",
")",
",",
"fmt",
".",
"getForm... | Adds the given number format to the cache.
@param fmt The number format to be added | [
"Adds",
"the",
"given",
"number",
"format",
"to",
"the",
"cache",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java#L409-L415 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java | XlsxWorkbook.getFormatId | private long getFormatId(String formatCode)
{
long ret = 0L;
if(formatCode != null && formatCode.length() > 0)
{
if(numFmts != null)
{
Iterator it = numFmts.entrySet().iterator();
while(it.hasNext() && ret == 0L)
{
... | java | private long getFormatId(String formatCode)
{
long ret = 0L;
if(formatCode != null && formatCode.length() > 0)
{
if(numFmts != null)
{
Iterator it = numFmts.entrySet().iterator();
while(it.hasNext() && ret == 0L)
{
... | [
"private",
"long",
"getFormatId",
"(",
"String",
"formatCode",
")",
"{",
"long",
"ret",
"=",
"0L",
";",
"if",
"(",
"formatCode",
"!=",
"null",
"&&",
"formatCode",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"if",
"(",
"numFmts",
"!=",
"null",
")",
... | Returns the id for the given number format from the cache.
@param formatCode The number format code to be checked
@return The id for the given number format from the cache | [
"Returns",
"the",
"id",
"for",
"the",
"given",
"number",
"format",
"from",
"the",
"cache",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java#L422-L473 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java | XlsxWorkbook.getMaxNumFmtId | private long getMaxNumFmtId()
{
long ret = 163;
List list = stylesheet.getNumFmts().getNumFmt();
for(int i = 0; i < list.size(); i++)
{
CTNumFmt numFmt = (CTNumFmt)list.get(i);
if(numFmt.getNumFmtId() > ret)
ret = numFmt.getNumFmtId();
... | java | private long getMaxNumFmtId()
{
long ret = 163;
List list = stylesheet.getNumFmts().getNumFmt();
for(int i = 0; i < list.size(); i++)
{
CTNumFmt numFmt = (CTNumFmt)list.get(i);
if(numFmt.getNumFmtId() > ret)
ret = numFmt.getNumFmtId();
... | [
"private",
"long",
"getMaxNumFmtId",
"(",
")",
"{",
"long",
"ret",
"=",
"163",
";",
"List",
"list",
"=",
"stylesheet",
".",
"getNumFmts",
"(",
")",
".",
"getNumFmt",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"list",
".",
"si... | Returns the maximum numFmtId in styles.xml.
@return The maximum numFmtId in styles.xml | [
"Returns",
"the",
"maximum",
"numFmtId",
"in",
"styles",
".",
"xml",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/documents/XlsxWorkbook.java#L479-L490 | train |
jcuda/jcufft | JCufftJava/src/main/java/jcuda/jcufft/cufftHandle.java | cufftHandle.setSize | void setSize(int x, int y, int z)
{
this.sizeX = x;
this.sizeY = y;
this.sizeZ = z;
} | java | void setSize(int x, int y, int z)
{
this.sizeX = x;
this.sizeY = y;
this.sizeZ = z;
} | [
"void",
"setSize",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"z",
")",
"{",
"this",
".",
"sizeX",
"=",
"x",
";",
"this",
".",
"sizeY",
"=",
"y",
";",
"this",
".",
"sizeZ",
"=",
"z",
";",
"}"
] | Set the size of this plan
@param x Size in x
@param y Size in y
@param z Size in z | [
"Set",
"the",
"size",
"of",
"this",
"plan"
] | 833c87ffb0864f7ee7270fddef8af57f48939b3a | https://github.com/jcuda/jcufft/blob/833c87ffb0864f7ee7270fddef8af57f48939b3a/JCufftJava/src/main/java/jcuda/jcufft/cufftHandle.java#L137-L142 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MethodUtils.java | MethodUtils.invoke | public static Object invoke(Object source, String methodName, Class<?>[] parameterTypes,
Object[] parameterValues) throws MethodException {
Class<? extends Object> clazz = source.getClass();
Method method;
if (ArrayUtils.isEmpty(parameterTypes)) {
method = findMethod(cla... | java | public static Object invoke(Object source, String methodName, Class<?>[] parameterTypes,
Object[] parameterValues) throws MethodException {
Class<? extends Object> clazz = source.getClass();
Method method;
if (ArrayUtils.isEmpty(parameterTypes)) {
method = findMethod(cla... | [
"public",
"static",
"Object",
"invoke",
"(",
"Object",
"source",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"parameterTypes",
",",
"Object",
"[",
"]",
"parameterValues",
")",
"throws",
"MethodException",
"{",
"Class",
"<",
"?",
"ex... | Invokes method which name equals given method name and parameter types
equals given parameter types on the given source with the given
parameters.
@param source
the object which you want to handle.
@param methodName
the name of the method which you want to call.
@param parameterTypes
the parameter types of the method ... | [
"Invokes",
"method",
"which",
"name",
"equals",
"given",
"method",
"name",
"and",
"parameter",
"types",
"equals",
"given",
"parameter",
"types",
"on",
"the",
"given",
"source",
"with",
"the",
"given",
"parameters",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MethodUtils.java#L97-L108 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/MethodUtils.java | MethodUtils.invoke | public static Object invoke(Object source, Method method, Object[] parameterValues)
throws MethodException {
try {
return method.invoke(source, parameterValues);
} catch (Exception e) {
throw new MethodException(INVOKE_METHOD_FAILED, e);
}
} | java | public static Object invoke(Object source, Method method, Object[] parameterValues)
throws MethodException {
try {
return method.invoke(source, parameterValues);
} catch (Exception e) {
throw new MethodException(INVOKE_METHOD_FAILED, e);
}
} | [
"public",
"static",
"Object",
"invoke",
"(",
"Object",
"source",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"parameterValues",
")",
"throws",
"MethodException",
"{",
"try",
"{",
"return",
"method",
".",
"invoke",
"(",
"source",
",",
"parameterValues",
... | Invokes given method on the given source object with the specified
parameters.
@param source
the object which you want to handle.
@param method
the method which you want to call.
@param parameterValues
the parameter values of the method which you want to call.
@return an object which is invoked method returns.
@throws... | [
"Invokes",
"given",
"method",
"on",
"the",
"given",
"source",
"object",
"with",
"the",
"specified",
"parameters",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/MethodUtils.java#L123-L131 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/ApplicationHostCache.java | ApplicationHostCache.add | public void add(Collection<ApplicationHost> applicationHosts)
{
for(ApplicationHost applicationHost : applicationHosts)
this.applicationHosts.put(applicationHost.getId(), applicationHost);
} | java | public void add(Collection<ApplicationHost> applicationHosts)
{
for(ApplicationHost applicationHost : applicationHosts)
this.applicationHosts.put(applicationHost.getId(), applicationHost);
} | [
"public",
"void",
"add",
"(",
"Collection",
"<",
"ApplicationHost",
">",
"applicationHosts",
")",
"{",
"for",
"(",
"ApplicationHost",
"applicationHost",
":",
"applicationHosts",
")",
"this",
".",
"applicationHosts",
".",
"put",
"(",
"applicationHost",
".",
"getId"... | Adds the application host list to the application hosts for the account.
@param applicationHosts The application hosts to add | [
"Adds",
"the",
"application",
"host",
"list",
"to",
"the",
"application",
"hosts",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/ApplicationHostCache.java#L72-L76 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/ApplicationHostCache.java | ApplicationHostCache.applicationInstances | public ApplicationInstanceCache applicationInstances(long applicationHostId)
{
ApplicationInstanceCache cache = applicationInstances.get(applicationHostId);
if(cache == null)
applicationInstances.put(applicationHostId, cache = new ApplicationInstanceCache(applicationHostId));
ret... | java | public ApplicationInstanceCache applicationInstances(long applicationHostId)
{
ApplicationInstanceCache cache = applicationInstances.get(applicationHostId);
if(cache == null)
applicationInstances.put(applicationHostId, cache = new ApplicationInstanceCache(applicationHostId));
ret... | [
"public",
"ApplicationInstanceCache",
"applicationInstances",
"(",
"long",
"applicationHostId",
")",
"{",
"ApplicationInstanceCache",
"cache",
"=",
"applicationInstances",
".",
"get",
"(",
"applicationHostId",
")",
";",
"if",
"(",
"cache",
"==",
"null",
")",
"applicat... | Returns the cache of application instances for the given application host, creating one if it doesn't exist .
@param applicationHostId The id of the application host for the cache of application instances
@return The cache of application instances for the given application host | [
"Returns",
"the",
"cache",
"of",
"application",
"instances",
"for",
"the",
"given",
"application",
"host",
"creating",
"one",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/ApplicationHostCache.java#L118-L124 | train |
opsmatters/opsmatters-core | src/main/java/com/opsmatters/core/provider/newrelic/ApplicationHostCache.java | ApplicationHostCache.addApplicationInstances | public void addApplicationInstances(Collection<ApplicationInstance> applicationInstances)
{
for(ApplicationInstance applicationInstance : applicationInstances)
{
// Add the instance to any application hosts it is associated with
long applicationHostId = applicationInstance.ge... | java | public void addApplicationInstances(Collection<ApplicationInstance> applicationInstances)
{
for(ApplicationInstance applicationInstance : applicationInstances)
{
// Add the instance to any application hosts it is associated with
long applicationHostId = applicationInstance.ge... | [
"public",
"void",
"addApplicationInstances",
"(",
"Collection",
"<",
"ApplicationInstance",
">",
"applicationInstances",
")",
"{",
"for",
"(",
"ApplicationInstance",
"applicationInstance",
":",
"applicationInstances",
")",
"{",
"// Add the instance to any application hosts it i... | Adds the application instances to the applications for the account.
@param applicationInstances The application instances to add | [
"Adds",
"the",
"application",
"instances",
"to",
"the",
"applications",
"for",
"the",
"account",
"."
] | c48904f7e8d029fd45357811ec38a735e261e3fd | https://github.com/opsmatters/opsmatters-core/blob/c48904f7e8d029fd45357811ec38a735e261e3fd/src/main/java/com/opsmatters/core/provider/newrelic/ApplicationHostCache.java#L130-L142 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.instance | public static ClassReader instance(Context context) {
ClassReader instance = context.get(classReaderKey);
if (instance == null)
instance = new ClassReader(context, true);
return instance;
} | java | public static ClassReader instance(Context context) {
ClassReader instance = context.get(classReaderKey);
if (instance == null)
instance = new ClassReader(context, true);
return instance;
} | [
"public",
"static",
"ClassReader",
"instance",
"(",
"Context",
"context",
")",
"{",
"ClassReader",
"instance",
"=",
"context",
".",
"get",
"(",
"classReaderKey",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"instance",
"=",
"new",
"ClassReader",
"(",
... | Get the ClassReader instance for this invocation. | [
"Get",
"the",
"ClassReader",
"instance",
"for",
"this",
"invocation",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L250-L255 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.init | private void init(Symtab syms, boolean definitive) {
if (classes != null) return;
if (definitive) {
Assert.check(packages == null || packages == syms.packages);
packages = syms.packages;
Assert.check(classes == null || classes == syms.classes);
classes = ... | java | private void init(Symtab syms, boolean definitive) {
if (classes != null) return;
if (definitive) {
Assert.check(packages == null || packages == syms.packages);
packages = syms.packages;
Assert.check(classes == null || classes == syms.classes);
classes = ... | [
"private",
"void",
"init",
"(",
"Symtab",
"syms",
",",
"boolean",
"definitive",
")",
"{",
"if",
"(",
"classes",
"!=",
"null",
")",
"return",
";",
"if",
"(",
"definitive",
")",
"{",
"Assert",
".",
"check",
"(",
"packages",
"==",
"null",
"||",
"packages"... | Initialize classes and packages, optionally treating this as
the definitive classreader. | [
"Initialize",
"classes",
"and",
"packages",
"optionally",
"treating",
"this",
"as",
"the",
"definitive",
"classreader",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L265-L281 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.readClassFile | private void readClassFile(ClassSymbol c) throws IOException {
int magic = nextInt();
if (magic != JAVA_MAGIC)
throw badClassFile("illegal.start.of.class.file");
minorVersion = nextChar();
majorVersion = nextChar();
int maxMajor = Target.MAX().majorVersion;
i... | java | private void readClassFile(ClassSymbol c) throws IOException {
int magic = nextInt();
if (magic != JAVA_MAGIC)
throw badClassFile("illegal.start.of.class.file");
minorVersion = nextChar();
majorVersion = nextChar();
int maxMajor = Target.MAX().majorVersion;
i... | [
"private",
"void",
"readClassFile",
"(",
"ClassSymbol",
"c",
")",
"throws",
"IOException",
"{",
"int",
"magic",
"=",
"nextInt",
"(",
")",
";",
"if",
"(",
"magic",
"!=",
"JAVA_MAGIC",
")",
"throw",
"badClassFile",
"(",
"\"illegal.start.of.class.file\"",
")",
";... | Read a class file. | [
"Read",
"a",
"class",
"file",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2300-L2338 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.enterPackage | public PackageSymbol enterPackage(Name name, PackageSymbol owner) {
return enterPackage(TypeSymbol.formFullName(name, owner));
} | java | public PackageSymbol enterPackage(Name name, PackageSymbol owner) {
return enterPackage(TypeSymbol.formFullName(name, owner));
} | [
"public",
"PackageSymbol",
"enterPackage",
"(",
"Name",
"name",
",",
"PackageSymbol",
"owner",
")",
"{",
"return",
"enterPackage",
"(",
"TypeSymbol",
".",
"formFullName",
"(",
"name",
",",
"owner",
")",
")",
";",
"}"
] | Make a package, given its unqualified name and enclosing package. | [
"Make",
"a",
"package",
"given",
"its",
"unqualified",
"name",
"and",
"enclosing",
"package",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2672-L2674 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/DaySchedule.java | DaySchedule.shutdown | public void shutdown() {
interrupt();
try { join(); } catch (Exception x) { _logger.log(Level.WARNING, "Failed to see DaySchedule thread joining", x); }
} | java | public void shutdown() {
interrupt();
try { join(); } catch (Exception x) { _logger.log(Level.WARNING, "Failed to see DaySchedule thread joining", x); }
} | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"interrupt",
"(",
")",
";",
"try",
"{",
"join",
"(",
")",
";",
"}",
"catch",
"(",
"Exception",
"x",
")",
"{",
"_logger",
".",
"log",
"(",
"Level",
".",
"WARNING",
",",
"\"Failed to see DaySchedule thread joini... | Shuts down the DaySchedule thread. | [
"Shuts",
"down",
"the",
"DaySchedule",
"thread",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/DaySchedule.java#L353-L356 | train |
eiichiro/gig | gig-core/src/main/java/org/eiichiro/gig/WebListener.java | WebListener.contextInitialized | @Override
public void contextInitialized(ServletContextEvent sce) {
Gig.bootstrap(sce.getServletContext());
Jaguar.assemble(this);
} | java | @Override
public void contextInitialized(ServletContextEvent sce) {
Gig.bootstrap(sce.getServletContext());
Jaguar.assemble(this);
} | [
"@",
"Override",
"public",
"void",
"contextInitialized",
"(",
"ServletContextEvent",
"sce",
")",
"{",
"Gig",
".",
"bootstrap",
"(",
"sce",
".",
"getServletContext",
"(",
")",
")",
";",
"Jaguar",
".",
"assemble",
"(",
"this",
")",
";",
"}"
] | Bootstraps Gig application in web environment.
@param sce {@code ServletContextEvent}. | [
"Bootstraps",
"Gig",
"application",
"in",
"web",
"environment",
"."
] | 21181fb36a17d2154f989e5e8c6edbb39fc81900 | https://github.com/eiichiro/gig/blob/21181fb36a17d2154f989e5e8c6edbb39fc81900/gig-core/src/main/java/org/eiichiro/gig/WebListener.java#L35-L39 | train |
incodehq-legacy/incode-module-document | dom/src/main/java/org/incode/module/document/fixture/DocumentTemplateFSAbstract.java | DocumentTemplateFSAbstract.upsertType | protected DocumentType upsertType(
String reference,
String name,
ExecutionContext executionContext) {
DocumentType documentType = documentTypeRepository.findByReference(reference);
if(documentType != null) {
documentType.setName(name);
} else {
... | java | protected DocumentType upsertType(
String reference,
String name,
ExecutionContext executionContext) {
DocumentType documentType = documentTypeRepository.findByReference(reference);
if(documentType != null) {
documentType.setName(name);
} else {
... | [
"protected",
"DocumentType",
"upsertType",
"(",
"String",
"reference",
",",
"String",
"name",
",",
"ExecutionContext",
"executionContext",
")",
"{",
"DocumentType",
"documentType",
"=",
"documentTypeRepository",
".",
"findByReference",
"(",
"reference",
")",
";",
"if"... | convenience, as templates and types often created together
@param reference
@param name
@param executionContext
@return | [
"convenience",
"as",
"templates",
"and",
"types",
"often",
"created",
"together"
] | c62f064e96d6e6007f7fd6a4bc06e03b78b1816c | https://github.com/incodehq-legacy/incode-module-document/blob/c62f064e96d6e6007f7fd6a4bc06e03b78b1816c/dom/src/main/java/org/incode/module/document/fixture/DocumentTemplateFSAbstract.java#L46-L58 | train |
wanglinsong/th-lipermi | src/main/java/net/sf/lipermi/handler/CallLookup.java | CallLookup.getCurrentSocket | public static Socket getCurrentSocket() {
ConnectionHandler handler = connectionMap.get(Thread.currentThread());
return (handler == null ? null : handler.getSocket());
} | java | public static Socket getCurrentSocket() {
ConnectionHandler handler = connectionMap.get(Thread.currentThread());
return (handler == null ? null : handler.getSocket());
} | [
"public",
"static",
"Socket",
"getCurrentSocket",
"(",
")",
"{",
"ConnectionHandler",
"handler",
"=",
"connectionMap",
".",
"get",
"(",
"Thread",
".",
"currentThread",
"(",
")",
")",
";",
"return",
"(",
"handler",
"==",
"null",
"?",
"null",
":",
"handler",
... | Get the current Socket for this call.
Only works in the main thread call.
@return Socket which started the Delegator Thread | [
"Get",
"the",
"current",
"Socket",
"for",
"this",
"call",
".",
"Only",
"works",
"in",
"the",
"main",
"thread",
"call",
"."
] | 5fa9ab1d7085b5133dc37ce3ba201d44a7bf25f0 | https://github.com/wanglinsong/th-lipermi/blob/5fa9ab1d7085b5133dc37ce3ba201d44a7bf25f0/src/main/java/net/sf/lipermi/handler/CallLookup.java#L50-L53 | train |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/report/parameterTypes/ParamConfig.java | ParamConfig.prepareParameter | public void prepareParameter(Map<String, Object> extra) {
if (from != null)
{
from.prepareParameter(extra);
}
} | java | public void prepareParameter(Map<String, Object> extra) {
if (from != null)
{
from.prepareParameter(extra);
}
} | [
"public",
"void",
"prepareParameter",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"extra",
")",
"{",
"if",
"(",
"from",
"!=",
"null",
")",
"{",
"from",
".",
"prepareParameter",
"(",
"extra",
")",
";",
"}",
"}"
] | Prepares the parameter's datasource, passing it the extra options and if necessary executing the appropriate
code and caching the value.
@param extra | [
"Prepares",
"the",
"parameter",
"s",
"datasource",
"passing",
"it",
"the",
"extra",
"options",
"and",
"if",
"necessary",
"executing",
"the",
"appropriate",
"code",
"and",
"caching",
"the",
"value",
"."
] | 5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/report/parameterTypes/ParamConfig.java#L263-L268 | train |
eiichiro/gig | gig-jpa-heroku-postgres/src/main/java/org/eiichiro/gig/heroku/PersistenceXMLProcessor.java | PersistenceXMLProcessor.process | public void process() {
try {
Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources("META-INF/persistence.xml");
XMLInputFactory factory = XMLInputFactory.newInstance();
List<String> persistenceUnits = new ArrayList<String>();
while (urls.hasMoreElements()) {
URL url ... | java | public void process() {
try {
Enumeration<URL> urls = Thread.currentThread().getContextClassLoader().getResources("META-INF/persistence.xml");
XMLInputFactory factory = XMLInputFactory.newInstance();
List<String> persistenceUnits = new ArrayList<String>();
while (urls.hasMoreElements()) {
URL url ... | [
"public",
"void",
"process",
"(",
")",
"{",
"try",
"{",
"Enumeration",
"<",
"URL",
">",
"urls",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getContextClassLoader",
"(",
")",
".",
"getResources",
"(",
"\"META-INF/persistence.xml\"",
")",
";",
"XMLInp... | Parses persistence.xml files on the current ClassLoader's search path
entries and detects persistence unit declarations from them. | [
"Parses",
"persistence",
".",
"xml",
"files",
"on",
"the",
"current",
"ClassLoader",
"s",
"search",
"path",
"entries",
"and",
"detects",
"persistence",
"unit",
"declarations",
"from",
"them",
"."
] | 21181fb36a17d2154f989e5e8c6edbb39fc81900 | https://github.com/eiichiro/gig/blob/21181fb36a17d2154f989e5e8c6edbb39fc81900/gig-jpa-heroku-postgres/src/main/java/org/eiichiro/gig/heroku/PersistenceXMLProcessor.java#L46-L73 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/DownloadUtils.java | DownloadUtils.getInputStreamFromHttp | public static InputStream getInputStreamFromHttp(String httpFileURL) throws IOException {
URLConnection urlConnection = null;
urlConnection = new URL(httpFileURL).openConnection();
urlConnection.connect();
return urlConnection.getInputStream();
} | java | public static InputStream getInputStreamFromHttp(String httpFileURL) throws IOException {
URLConnection urlConnection = null;
urlConnection = new URL(httpFileURL).openConnection();
urlConnection.connect();
return urlConnection.getInputStream();
} | [
"public",
"static",
"InputStream",
"getInputStreamFromHttp",
"(",
"String",
"httpFileURL",
")",
"throws",
"IOException",
"{",
"URLConnection",
"urlConnection",
"=",
"null",
";",
"urlConnection",
"=",
"new",
"URL",
"(",
"httpFileURL",
")",
".",
"openConnection",
"(",... | Get destination web file input stream.
@param httpFileURL
the web file url which you want to download.
@return the destination page input stream.
@throws IOException | [
"Get",
"destination",
"web",
"file",
"input",
"stream",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DownloadUtils.java#L33-L39 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/DownloadUtils.java | DownloadUtils.getBytesFromHttp | public static byte[] getBytesFromHttp(String httpFileURL) throws IOException {
InputStream bufferedInputStream = null;
try {
bufferedInputStream = getInputStreamFromHttp(httpFileURL);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
by... | java | public static byte[] getBytesFromHttp(String httpFileURL) throws IOException {
InputStream bufferedInputStream = null;
try {
bufferedInputStream = getInputStreamFromHttp(httpFileURL);
ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream();
by... | [
"public",
"static",
"byte",
"[",
"]",
"getBytesFromHttp",
"(",
"String",
"httpFileURL",
")",
"throws",
"IOException",
"{",
"InputStream",
"bufferedInputStream",
"=",
"null",
";",
"try",
"{",
"bufferedInputStream",
"=",
"getInputStreamFromHttp",
"(",
"httpFileURL",
"... | Get destination web file bytes.
@param httpFileURL
the web file url which you want to download.
@return the destination file bytes.
@throws IOException | [
"Get",
"destination",
"web",
"file",
"bytes",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/DownloadUtils.java#L49-L65 | train |
brianwhu/xillium | base/src/main/java/org/xillium/base/util/Link.java | Link.make | public static <T> Link<T> make(Link<T> root, T object) {
Link<T> link = new Link<>(object);
if (root == null) {
root = link;
} else if (root.last == null) {
root.next = link;
} else {
root.last.next = link;
}
root.last = link... | java | public static <T> Link<T> make(Link<T> root, T object) {
Link<T> link = new Link<>(object);
if (root == null) {
root = link;
} else if (root.last == null) {
root.next = link;
} else {
root.last.next = link;
}
root.last = link... | [
"public",
"static",
"<",
"T",
">",
"Link",
"<",
"T",
">",
"make",
"(",
"Link",
"<",
"T",
">",
"root",
",",
"T",
"object",
")",
"{",
"Link",
"<",
"T",
">",
"link",
"=",
"new",
"Link",
"<>",
"(",
"object",
")",
";",
"if",
"(",
"root",
"==",
"... | Adds a new object at the end of the list identified by the root link.
@param root - the root link of the list, which can be null
@param object - the data object to add
@return the root link | [
"Adds",
"a",
"new",
"object",
"at",
"the",
"end",
"of",
"the",
"list",
"identified",
"by",
"the",
"root",
"link",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/util/Link.java#L38-L50 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java | Group.foundGroupFormat | boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
if (map.containsKey(pkgFormat)) {
configuration.message.error("doclet.Same_package_name_used", pkgFormat);
return true;
}
return false;
} | java | boolean foundGroupFormat(Map<String,?> map, String pkgFormat) {
if (map.containsKey(pkgFormat)) {
configuration.message.error("doclet.Same_package_name_used", pkgFormat);
return true;
}
return false;
} | [
"boolean",
"foundGroupFormat",
"(",
"Map",
"<",
"String",
",",
"?",
">",
"map",
",",
"String",
"pkgFormat",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
"(",
"pkgFormat",
")",
")",
"{",
"configuration",
".",
"message",
".",
"error",
"(",
"\"doclet.Sam... | Search if the given map has given the package format.
@param map Map to be searched.
@param pkgFormat The pacakge format to search.
@return true if package name format found in the map, else false. | [
"Search",
"if",
"the",
"given",
"map",
"has",
"given",
"the",
"package",
"format",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java#L157-L163 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java | Group.groupPackages | public Map<String,List<PackageDoc>> groupPackages(PackageDoc[] packages) {
Map<String,List<PackageDoc>> groupPackageMap = new HashMap<String,List<PackageDoc>>();
String defaultGroupName =
(pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
configuration.message.getText("... | java | public Map<String,List<PackageDoc>> groupPackages(PackageDoc[] packages) {
Map<String,List<PackageDoc>> groupPackageMap = new HashMap<String,List<PackageDoc>>();
String defaultGroupName =
(pkgNameGroupMap.isEmpty() && regExpGroupMap.isEmpty())?
configuration.message.getText("... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"PackageDoc",
">",
">",
"groupPackages",
"(",
"PackageDoc",
"[",
"]",
"packages",
")",
"{",
"Map",
"<",
"String",
",",
"List",
"<",
"PackageDoc",
">",
">",
"groupPackageMap",
"=",
"new",
"HashMap",
"<",
... | Group the packages according the grouping information provided on the
command line. Given a list of packages, search each package name in
regular expression map as well as package name map to get the
corresponding group name. Create another map with mapping of group name
to the package list, which will fall under the s... | [
"Group",
"the",
"packages",
"according",
"the",
"grouping",
"information",
"provided",
"on",
"the",
"command",
"line",
".",
"Given",
"a",
"list",
"of",
"packages",
"search",
"each",
"package",
"name",
"in",
"regular",
"expression",
"map",
"as",
"well",
"as",
... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java#L178-L205 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java | Group.regExpGroupName | String regExpGroupName(String pkgName) {
for (int j = 0; j < sortedRegExpList.size(); j++) {
String regexp = sortedRegExpList.get(j);
if (pkgName.startsWith(regexp)) {
return regExpGroupMap.get(regexp);
}
}
return null;
} | java | String regExpGroupName(String pkgName) {
for (int j = 0; j < sortedRegExpList.size(); j++) {
String regexp = sortedRegExpList.get(j);
if (pkgName.startsWith(regexp)) {
return regExpGroupMap.get(regexp);
}
}
return null;
} | [
"String",
"regExpGroupName",
"(",
"String",
"pkgName",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"sortedRegExpList",
".",
"size",
"(",
")",
";",
"j",
"++",
")",
"{",
"String",
"regexp",
"=",
"sortedRegExpList",
".",
"get",
"(",
"j",
... | Search for package name in the sorted regular expression
list, if found return the group name. If not, return null.
@param pkgName Name of package to be found in the regular
expression list. | [
"Search",
"for",
"package",
"name",
"in",
"the",
"sorted",
"regular",
"expression",
"list",
"if",
"found",
"return",
"the",
"group",
"name",
".",
"If",
"not",
"return",
"null",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java#L214-L222 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/RpcRequest.java | RpcRequest.marshal | @SuppressWarnings("unchecked")
public Map marshal(Contract contract) throws RpcException {
Map map = new HashMap();
map.put("jsonrpc", "2.0");
if (id != null)
map.put("id", id);
map.put("method", method.getMethod());
if (params != null && params.length > 0) {
... | java | @SuppressWarnings("unchecked")
public Map marshal(Contract contract) throws RpcException {
Map map = new HashMap();
map.put("jsonrpc", "2.0");
if (id != null)
map.put("id", id);
map.put("method", method.getMethod());
if (params != null && params.length > 0) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Map",
"marshal",
"(",
"Contract",
"contract",
")",
"throws",
"RpcException",
"{",
"Map",
"map",
"=",
"new",
"HashMap",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"jsonrpc\"",
",",
"\"2.0\"",
")",... | Marshals this request to a Map that can be serialized and sent over the wire.
Uses the Contract to resolve the Function associated with the method.
@param contract Contract to use to resolve Function
@return JSON-RPC formatted Map based on the request id, method, and params | [
"Marshals",
"this",
"request",
"to",
"a",
"Map",
"that",
"can",
"be",
"serialized",
"and",
"sent",
"over",
"the",
"wire",
".",
"Uses",
"the",
"Contract",
"to",
"resolve",
"the",
"Function",
"associated",
"with",
"the",
"method",
"."
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/RpcRequest.java#L94-L110 | train |
DDTH/ddth-redis | src/main/java/com/github/ddth/redis/RedisClientFactory.java | RedisClientFactory.init | public void init() {
int numProcessors = Runtime.getRuntime().availableProcessors();
cacheRedisClientPools = CacheBuilder.newBuilder().concurrencyLevel(numProcessors)
.expireAfterAccess(3600, TimeUnit.SECONDS)
.removalListener(new RemovalListener<String, JedisClientPool>(... | java | public void init() {
int numProcessors = Runtime.getRuntime().availableProcessors();
cacheRedisClientPools = CacheBuilder.newBuilder().concurrencyLevel(numProcessors)
.expireAfterAccess(3600, TimeUnit.SECONDS)
.removalListener(new RemovalListener<String, JedisClientPool>(... | [
"public",
"void",
"init",
"(",
")",
"{",
"int",
"numProcessors",
"=",
"Runtime",
".",
"getRuntime",
"(",
")",
".",
"availableProcessors",
"(",
")",
";",
"cacheRedisClientPools",
"=",
"CacheBuilder",
".",
"newBuilder",
"(",
")",
".",
"concurrencyLevel",
"(",
... | Initializes the factory. | [
"Initializes",
"the",
"factory",
"."
] | 7e6abc3e43c9efe7e9c293d421c94227253ded87 | https://github.com/DDTH/ddth-redis/blob/7e6abc3e43c9efe7e9c293d421c94227253ded87/src/main/java/com/github/ddth/redis/RedisClientFactory.java#L50-L61 | train |
DDTH/ddth-redis | src/main/java/com/github/ddth/redis/RedisClientFactory.java | RedisClientFactory.calcRedisPoolName | protected static String calcRedisPoolName(String host, int port, String username,
String password, PoolConfig poolConfig) {
StringBuilder sb = new StringBuilder();
sb.append(host != null ? host : "NULL");
sb.append(".");
sb.append(port);
sb.append(".");
sb.app... | java | protected static String calcRedisPoolName(String host, int port, String username,
String password, PoolConfig poolConfig) {
StringBuilder sb = new StringBuilder();
sb.append(host != null ? host : "NULL");
sb.append(".");
sb.append(port);
sb.append(".");
sb.app... | [
"protected",
"static",
"String",
"calcRedisPoolName",
"(",
"String",
"host",
",",
"int",
"port",
",",
"String",
"username",
",",
"String",
"password",
",",
"PoolConfig",
"poolConfig",
")",
"{",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",
")",
";",... | Builds a unique pool name from configurations.
@param host
@param port
@param username
@param password
@param poolConfig
@return | [
"Builds",
"a",
"unique",
"pool",
"name",
"from",
"configurations",
"."
] | 7e6abc3e43c9efe7e9c293d421c94227253ded87 | https://github.com/DDTH/ddth-redis/blob/7e6abc3e43c9efe7e9c293d421c94227253ded87/src/main/java/com/github/ddth/redis/RedisClientFactory.java#L94-L106 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java | JavacProcessingEnvironment.importStringToPattern | private static Pattern importStringToPattern(String s, Processor p, Log log) {
if (isValidImportString(s)) {
return validImportStringToPattern(s);
} else {
log.warning("proc.malformed.supported.string", s, p.getClass().getName());
return noMatches; // won't match any ... | java | private static Pattern importStringToPattern(String s, Processor p, Log log) {
if (isValidImportString(s)) {
return validImportStringToPattern(s);
} else {
log.warning("proc.malformed.supported.string", s, p.getClass().getName());
return noMatches; // won't match any ... | [
"private",
"static",
"Pattern",
"importStringToPattern",
"(",
"String",
"s",
",",
"Processor",
"p",
",",
"Log",
"log",
")",
"{",
"if",
"(",
"isValidImportString",
"(",
"s",
")",
")",
"{",
"return",
"validImportStringToPattern",
"(",
"s",
")",
";",
"}",
"el... | Convert import-style string for supported annotations into a
regex matching that string. If the string is a valid
import-style string, return a regex that won't match anything. | [
"Convert",
"import",
"-",
"style",
"string",
"for",
"supported",
"annotations",
"into",
"a",
"regex",
"matching",
"that",
"string",
".",
"If",
"the",
"string",
"is",
"a",
"valid",
"import",
"-",
"style",
"string",
"return",
"a",
"regex",
"that",
"won",
"t"... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java#L1456-L1463 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java | BuilderFactory.getProfileSummaryBuilder | public AbstractBuilder getProfileSummaryBuilder(Profile profile, Profile prevProfile,
Profile nextProfile) throws Exception {
return ProfileSummaryBuilder.getInstance(context, profile,
writerFactory.getProfileSummaryWriter(profile, prevProfile, nextProfile));
} | java | public AbstractBuilder getProfileSummaryBuilder(Profile profile, Profile prevProfile,
Profile nextProfile) throws Exception {
return ProfileSummaryBuilder.getInstance(context, profile,
writerFactory.getProfileSummaryWriter(profile, prevProfile, nextProfile));
} | [
"public",
"AbstractBuilder",
"getProfileSummaryBuilder",
"(",
"Profile",
"profile",
",",
"Profile",
"prevProfile",
",",
"Profile",
"nextProfile",
")",
"throws",
"Exception",
"{",
"return",
"ProfileSummaryBuilder",
".",
"getInstance",
"(",
"context",
",",
"profile",
",... | Return the builder that builds the profile summary.
@param profile the profile being documented.
@param prevProfile the previous profile being documented.
@param nextProfile the next profile being documented.
@return the builder that builds the profile summary. | [
"Return",
"the",
"builder",
"that",
"builds",
"the",
"profile",
"summary",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java#L107-L111 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java | BuilderFactory.getProfilePackageSummaryBuilder | public AbstractBuilder getProfilePackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg,
PackageDoc nextPkg, Profile profile) throws Exception {
return ProfilePackageSummaryBuilder.getInstance(context, pkg,
writerFactory.getProfilePackageSummaryWriter(pkg, prevPkg, nextPkg,
... | java | public AbstractBuilder getProfilePackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg,
PackageDoc nextPkg, Profile profile) throws Exception {
return ProfilePackageSummaryBuilder.getInstance(context, pkg,
writerFactory.getProfilePackageSummaryWriter(pkg, prevPkg, nextPkg,
... | [
"public",
"AbstractBuilder",
"getProfilePackageSummaryBuilder",
"(",
"PackageDoc",
"pkg",
",",
"PackageDoc",
"prevPkg",
",",
"PackageDoc",
"nextPkg",
",",
"Profile",
"profile",
")",
"throws",
"Exception",
"{",
"return",
"ProfilePackageSummaryBuilder",
".",
"getInstance",
... | Return the builder that builds the profile package summary.
@param pkg the profile package being documented.
@param prevPkg the previous profile package being documented.
@param nextPkg the next profile package being documented.
@param profile the profile being documented.
@return the builder that builds the profile p... | [
"Return",
"the",
"builder",
"that",
"builds",
"the",
"profile",
"package",
"summary",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java#L122-L127 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java | ParamTaglet.getInheritedTagletOutput | private Content getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
TagletWriter writer, Object[] formalParameters,
Set<String> alreadyDocumented) {
Content result = writer.getOutputInstance();
if ((! alreadyDocumented.contains(null)) &&
holder instanceo... | java | private Content getInheritedTagletOutput(boolean isNonTypeParams, Doc holder,
TagletWriter writer, Object[] formalParameters,
Set<String> alreadyDocumented) {
Content result = writer.getOutputInstance();
if ((! alreadyDocumented.contains(null)) &&
holder instanceo... | [
"private",
"Content",
"getInheritedTagletOutput",
"(",
"boolean",
"isNonTypeParams",
",",
"Doc",
"holder",
",",
"TagletWriter",
"writer",
",",
"Object",
"[",
"]",
"formalParameters",
",",
"Set",
"<",
"String",
">",
"alreadyDocumented",
")",
"{",
"Content",
"result... | Loop through each indivitual parameter. It it does not have a
corresponding param tag, try to inherit it. | [
"Loop",
"through",
"each",
"indivitual",
"parameter",
".",
"It",
"it",
"does",
"not",
"have",
"a",
"corresponding",
"param",
"tag",
"try",
"to",
"inherit",
"it",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java#L218-L247 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/TimeLimitedStrategy.java | TimeLimitedStrategy.observe | @Override
public void observe(int age) throws InterruptedException {
if (System.currentTimeMillis() >= _limit) {
throw new InterruptedException("Time{" + System.currentTimeMillis() + "}HasPassed{" + _limit + '}');
}
} | java | @Override
public void observe(int age) throws InterruptedException {
if (System.currentTimeMillis() >= _limit) {
throw new InterruptedException("Time{" + System.currentTimeMillis() + "}HasPassed{" + _limit + '}');
}
} | [
"@",
"Override",
"public",
"void",
"observe",
"(",
"int",
"age",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"System",
".",
"currentTimeMillis",
"(",
")",
">=",
"_limit",
")",
"{",
"throw",
"new",
"InterruptedException",
"(",
"\"Time{\"",
"+",
"Sy... | Checks the current system time against the time limit, throwing an InterruptedException if the time is up. | [
"Checks",
"the",
"current",
"system",
"time",
"against",
"the",
"time",
"limit",
"throwing",
"an",
"InterruptedException",
"if",
"the",
"time",
"is",
"up",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/TimeLimitedStrategy.java#L21-L26 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/model/JavacElements.java | JavacElements.nameToSymbol | private <S extends Symbol> S nameToSymbol(String nameStr, Class<S> clazz) {
Name name = names.fromString(nameStr);
// First check cache.
Symbol sym = (clazz == ClassSymbol.class)
? syms.classes.get(name)
: syms.packages.get(name);
try {
... | java | private <S extends Symbol> S nameToSymbol(String nameStr, Class<S> clazz) {
Name name = names.fromString(nameStr);
// First check cache.
Symbol sym = (clazz == ClassSymbol.class)
? syms.classes.get(name)
: syms.packages.get(name);
try {
... | [
"private",
"<",
"S",
"extends",
"Symbol",
">",
"S",
"nameToSymbol",
"(",
"String",
"nameStr",
",",
"Class",
"<",
"S",
">",
"clazz",
")",
"{",
"Name",
"name",
"=",
"names",
".",
"fromString",
"(",
"nameStr",
")",
";",
"// First check cache.",
"Symbol",
"s... | Returns a symbol given the type's or packages's canonical name,
or null if the name isn't found. | [
"Returns",
"a",
"symbol",
"given",
"the",
"type",
"s",
"or",
"packages",
"s",
"canonical",
"name",
"or",
"null",
"if",
"the",
"name",
"isn",
"t",
"found",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/model/JavacElements.java#L116-L138 | train |
seedstack/shed | src/main/java/org/seedstack/shed/text/TextUtils.java | TextUtils.leftPad | public static String leftPad(String text, String padding, int linesToIgnore) {
StringBuilder result = new StringBuilder();
Matcher matcher = LINE_START_PATTERN.matcher(text);
while (matcher.find()) {
if (linesToIgnore > 0) {
linesToIgnore--;
} else {
... | java | public static String leftPad(String text, String padding, int linesToIgnore) {
StringBuilder result = new StringBuilder();
Matcher matcher = LINE_START_PATTERN.matcher(text);
while (matcher.find()) {
if (linesToIgnore > 0) {
linesToIgnore--;
} else {
... | [
"public",
"static",
"String",
"leftPad",
"(",
"String",
"text",
",",
"String",
"padding",
",",
"int",
"linesToIgnore",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"Matcher",
"matcher",
"=",
"LINE_START_PATTERN",
".",
"match... | Inserts the specified string at the beginning of each newline of the specified text.
@param text the text to pad.
@param padding the padding.
@param linesToIgnore the number of lines to ignore before starting the padding.
@return the padded text. | [
"Inserts",
"the",
"specified",
"string",
"at",
"the",
"beginning",
"of",
"each",
"newline",
"of",
"the",
"specified",
"text",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/text/TextUtils.java#L37-L50 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java | AnnotationPredicates.classOrAncestorAnnotatedWith | public static Predicate<Class<?>> classOrAncestorAnnotatedWith(final Class<? extends Annotation> annotationClass,
boolean includeMetaAnnotations) {
return candidate -> candidate != null && Classes.from(candidate)
.traversingSuperclasses()
.traversingInterfaces()
... | java | public static Predicate<Class<?>> classOrAncestorAnnotatedWith(final Class<? extends Annotation> annotationClass,
boolean includeMetaAnnotations) {
return candidate -> candidate != null && Classes.from(candidate)
.traversingSuperclasses()
.traversingInterfaces()
... | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"classOrAncestorAnnotatedWith",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"boolean",
"includeMetaAnnotations",
")",
"{",
"return",
"candidate",
"->",
... | Checks if the candidate or one of its superclasses or interfaces is annotated with the
specified annotation.
@param annotationClass the requested annotation
@param includeMetaAnnotations if true, meta-annotations are included in the search.
@return the predicate. | [
"Checks",
"if",
"the",
"candidate",
"or",
"one",
"of",
"its",
"superclasses",
"or",
"interfaces",
"is",
"annotated",
"with",
"the",
"specified",
"annotation",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java#L61-L68 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java | AnnotationPredicates.annotationIsOfClass | public static Predicate<Annotation> annotationIsOfClass(final Class<? extends Annotation> annotationClass) {
return candidate -> candidate != null && candidate.annotationType().equals(annotationClass);
} | java | public static Predicate<Annotation> annotationIsOfClass(final Class<? extends Annotation> annotationClass) {
return candidate -> candidate != null && candidate.annotationType().equals(annotationClass);
} | [
"public",
"static",
"Predicate",
"<",
"Annotation",
">",
"annotationIsOfClass",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
")",
"{",
"return",
"candidate",
"->",
"candidate",
"!=",
"null",
"&&",
"candidate",
".",
"annotatio... | Checks if the candidate annotation is of the specified annotation class.
@param annotationClass the annotation class to check for.
@return the predicate. | [
"Checks",
"if",
"the",
"candidate",
"annotation",
"is",
"of",
"the",
"specified",
"annotation",
"class",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java#L76-L78 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java | AnnotationPredicates.atLeastOneFieldAnnotatedWith | public static Predicate<Class<?>> atLeastOneFieldAnnotatedWith(final Class<? extends Annotation> annotationClass,
boolean includeMetaAnnotations) {
return candidate -> candidate != null && Classes.from(candidate)
.traversingSuperclasses()
.fields()
.an... | java | public static Predicate<Class<?>> atLeastOneFieldAnnotatedWith(final Class<? extends Annotation> annotationClass,
boolean includeMetaAnnotations) {
return candidate -> candidate != null && Classes.from(candidate)
.traversingSuperclasses()
.fields()
.an... | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"atLeastOneFieldAnnotatedWith",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"boolean",
"includeMetaAnnotations",
")",
"{",
"return",
"candidate",
"->",
... | Checks if the candidate or one of its superclasses has at least one field annotated or
meta-annotated by the given annotation.
@param annotationClass the requested annotation
@param includeMetaAnnotations if true, meta-annotations are included in the search.
@return the predicate. | [
"Checks",
"if",
"the",
"candidate",
"or",
"one",
"of",
"its",
"superclasses",
"has",
"at",
"least",
"one",
"field",
"annotated",
"or",
"meta",
"-",
"annotated",
"by",
"the",
"given",
"annotation",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java#L88-L94 | train |
seedstack/shed | src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java | AnnotationPredicates.atLeastOneMethodAnnotatedWith | public static Predicate<Class<?>> atLeastOneMethodAnnotatedWith(final Class<? extends Annotation>
annotationClass, boolean includeMetaAnnotations) {
return candidate -> Classes.from(candidate)
.traversingInterfaces()
.traversingSuperclasses()
.methods(... | java | public static Predicate<Class<?>> atLeastOneMethodAnnotatedWith(final Class<? extends Annotation>
annotationClass, boolean includeMetaAnnotations) {
return candidate -> Classes.from(candidate)
.traversingInterfaces()
.traversingSuperclasses()
.methods(... | [
"public",
"static",
"Predicate",
"<",
"Class",
"<",
"?",
">",
">",
"atLeastOneMethodAnnotatedWith",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"boolean",
"includeMetaAnnotations",
")",
"{",
"return",
"candidate",
"->",
... | Checks if the candidate or one of its superclasses or interfaces has at least one method
annotated or meta-annotated
by the given annotation.
@param annotationClass the requested annotation
@param includeMetaAnnotations if true, meta-annotations are included in the search.
@return the predicate. | [
"Checks",
"if",
"the",
"candidate",
"or",
"one",
"of",
"its",
"superclasses",
"or",
"interfaces",
"has",
"at",
"least",
"one",
"method",
"annotated",
"or",
"meta",
"-",
"annotated",
"by",
"the",
"given",
"annotation",
"."
] | 49ecb25aa3777539ab0f29f89abaae5ee93b572e | https://github.com/seedstack/shed/blob/49ecb25aa3777539ab0f29f89abaae5ee93b572e/src/main/java/org/seedstack/shed/reflect/AnnotationPredicates.java#L105-L113 | train |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINSyntaxChecker.java | VATINSyntaxChecker.isValidVATIN | public static boolean isValidVATIN (@Nonnull final String sVATIN, final boolean bIfNoValidator)
{
ValueEnforcer.notNull (sVATIN, "VATIN");
if (sVATIN.length () > 2)
{
final String sCountryCode = sVATIN.substring (0, 2).toUpperCase (Locale.US);
final IToBooleanFunction <String> aValidator = s_a... | java | public static boolean isValidVATIN (@Nonnull final String sVATIN, final boolean bIfNoValidator)
{
ValueEnforcer.notNull (sVATIN, "VATIN");
if (sVATIN.length () > 2)
{
final String sCountryCode = sVATIN.substring (0, 2).toUpperCase (Locale.US);
final IToBooleanFunction <String> aValidator = s_a... | [
"public",
"static",
"boolean",
"isValidVATIN",
"(",
"@",
"Nonnull",
"final",
"String",
"sVATIN",
",",
"final",
"boolean",
"bIfNoValidator",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sVATIN",
",",
"\"VATIN\"",
")",
";",
"if",
"(",
"sVATIN",
".",
"lengt... | Check if the provided VATIN is valid. This method handles VATINs for all
countries. This check uses only the checksum algorithm and does not call
any webservice etc.
@param sVATIN
VATIN to check. May not be <code>null</code>.
@param bIfNoValidator
What to return if no validator was found?
@return <code>true</code> if ... | [
"Check",
"if",
"the",
"provided",
"VATIN",
"is",
"valid",
".",
"This",
"method",
"handles",
"VATINs",
"for",
"all",
"countries",
".",
"This",
"check",
"uses",
"only",
"the",
"checksum",
"algorithm",
"and",
"does",
"not",
"call",
"any",
"webservice",
"etc",
... | ca5e0b03c735b30b47930c018bfb5e71f00d0ff4 | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINSyntaxChecker.java#L105-L118 | train |
phax/ph-masterdata | ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINSyntaxChecker.java | VATINSyntaxChecker.isValidatorPresent | public static boolean isValidatorPresent (@Nonnull final String sVATIN)
{
ValueEnforcer.notNull (sVATIN, "VATIN");
if (sVATIN.length () <= 2)
return false;
final String sCountryCode = sVATIN.substring (0, 2).toUpperCase (Locale.US);
return s_aMap.containsKey (sCountryCode);
} | java | public static boolean isValidatorPresent (@Nonnull final String sVATIN)
{
ValueEnforcer.notNull (sVATIN, "VATIN");
if (sVATIN.length () <= 2)
return false;
final String sCountryCode = sVATIN.substring (0, 2).toUpperCase (Locale.US);
return s_aMap.containsKey (sCountryCode);
} | [
"public",
"static",
"boolean",
"isValidatorPresent",
"(",
"@",
"Nonnull",
"final",
"String",
"sVATIN",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"sVATIN",
",",
"\"VATIN\"",
")",
";",
"if",
"(",
"sVATIN",
".",
"length",
"(",
")",
"<=",
"2",
")",
"re... | Check if a validator is present for the provided VATIN.
@param sVATIN
VATIN to check. May not be <code>null</code>.
@return <code>true</code> if a validator is present, <code>false</code> if
not. | [
"Check",
"if",
"a",
"validator",
"is",
"present",
"for",
"the",
"provided",
"VATIN",
"."
] | ca5e0b03c735b30b47930c018bfb5e71f00d0ff4 | https://github.com/phax/ph-masterdata/blob/ca5e0b03c735b30b47930c018bfb5e71f00d0ff4/ph-masterdata/src/main/java/com/helger/masterdata/vat/VATINSyntaxChecker.java#L128-L136 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java | HtmlDocWriter.printFramesetDocument | public void printFramesetDocument(String title, boolean noTimeStamp,
Content frameset) throws IOException {
Content htmlDocType = DocType.FRAMESET;
Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
Content head = new HtmlTree(HtmlTag.HEAD);
head.add... | java | public void printFramesetDocument(String title, boolean noTimeStamp,
Content frameset) throws IOException {
Content htmlDocType = DocType.FRAMESET;
Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
Content head = new HtmlTree(HtmlTag.HEAD);
head.add... | [
"public",
"void",
"printFramesetDocument",
"(",
"String",
"title",
",",
"boolean",
"noTimeStamp",
",",
"Content",
"frameset",
")",
"throws",
"IOException",
"{",
"Content",
"htmlDocType",
"=",
"DocType",
".",
"FRAMESET",
";",
"Content",
"htmlComment",
"=",
"new",
... | Print the frameset version of the Html file header.
Called only when generating an HTML frameset file.
@param title Title of this HTML document
@param noTimeStamp If true, don't print time stamp in header
@param frameset the frameset to be added to the HTML document | [
"Print",
"the",
"frameset",
"version",
"of",
"the",
"Html",
"file",
"header",
".",
"Called",
"only",
"when",
"generating",
"an",
"HTML",
"frameset",
"file",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java#L308-L327 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.skip | private void skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement) {
while (true) {
switch (token.kind) {
case SEMI:
nextToken();
return;
case PUBLIC:
case FINA... | java | private void skip(boolean stopAtImport, boolean stopAtMemberDecl, boolean stopAtIdentifier, boolean stopAtStatement) {
while (true) {
switch (token.kind) {
case SEMI:
nextToken();
return;
case PUBLIC:
case FINA... | [
"private",
"void",
"skip",
"(",
"boolean",
"stopAtImport",
",",
"boolean",
"stopAtMemberDecl",
",",
"boolean",
"stopAtIdentifier",
",",
"boolean",
"stopAtStatement",
")",
"{",
"while",
"(",
"true",
")",
"{",
"switch",
"(",
"token",
".",
"kind",
")",
"{",
"ca... | Skip forward until a suitable stop token is found. | [
"Skip",
"forward",
"until",
"a",
"suitable",
"stop",
"token",
"is",
"found",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L368-L436 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.checkNoMods | void checkNoMods(long mods) {
if (mods != 0) {
long lowestMod = mods & -mods;
error(token.pos, "mod.not.allowed.here",
Flags.asFlagSet(lowestMod));
}
} | java | void checkNoMods(long mods) {
if (mods != 0) {
long lowestMod = mods & -mods;
error(token.pos, "mod.not.allowed.here",
Flags.asFlagSet(lowestMod));
}
} | [
"void",
"checkNoMods",
"(",
"long",
"mods",
")",
"{",
"if",
"(",
"mods",
"!=",
"0",
")",
"{",
"long",
"lowestMod",
"=",
"mods",
"&",
"-",
"mods",
";",
"error",
"(",
"token",
".",
"pos",
",",
"\"mod.not.allowed.here\"",
",",
"Flags",
".",
"asFlagSet",
... | Diagnose a modifier flag from the set, if any. | [
"Diagnose",
"a",
"modifier",
"flag",
"from",
"the",
"set",
"if",
"any",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L529-L535 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.attach | void attach(JCTree tree, Comment dc) {
if (keepDocComments && dc != null) {
// System.out.println("doc comment = ");System.out.println(dc);//DEBUG
docComments.putComment(tree, dc);
}
} | java | void attach(JCTree tree, Comment dc) {
if (keepDocComments && dc != null) {
// System.out.println("doc comment = ");System.out.println(dc);//DEBUG
docComments.putComment(tree, dc);
}
} | [
"void",
"attach",
"(",
"JCTree",
"tree",
",",
"Comment",
"dc",
")",
"{",
"if",
"(",
"keepDocComments",
"&&",
"dc",
"!=",
"null",
")",
"{",
"// System.out.println(\"doc comment = \");System.out.println(dc);//DEBUG",
"docComments",
".",
"putComment",
"(",
"tree... | Make an entry into docComments hashtable,
provided flag keepDocComments is set and given doc comment is non-null.
@param tree The tree to be used as index in the hashtable
@param dc The doc comment to associate with the tree, or null. | [
"Make",
"an",
"entry",
"into",
"docComments",
"hashtable",
"provided",
"flag",
"keepDocComments",
"is",
"set",
"and",
"given",
"doc",
"comment",
"is",
"non",
"-",
"null",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L550-L555 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.forInit | List<JCStatement> forInit() {
ListBuffer<JCStatement> stats = new ListBuffer<>();
int pos = token.pos;
if (token.kind == FINAL || token.kind == MONKEYS_AT) {
return variableDeclarators(optFinal(0), parseType(), stats).toList();
} else {
JCExpression t = term(EXPR ... | java | List<JCStatement> forInit() {
ListBuffer<JCStatement> stats = new ListBuffer<>();
int pos = token.pos;
if (token.kind == FINAL || token.kind == MONKEYS_AT) {
return variableDeclarators(optFinal(0), parseType(), stats).toList();
} else {
JCExpression t = term(EXPR ... | [
"List",
"<",
"JCStatement",
">",
"forInit",
"(",
")",
"{",
"ListBuffer",
"<",
"JCStatement",
">",
"stats",
"=",
"new",
"ListBuffer",
"<>",
"(",
")",
";",
"int",
"pos",
"=",
"token",
".",
"pos",
";",
"if",
"(",
"token",
".",
"kind",
"==",
"FINAL",
"... | ForInit = StatementExpression MoreStatementExpressions
| { FINAL | '@' Annotation } Type VariableDeclarators | [
"ForInit",
"=",
"StatementExpression",
"MoreStatementExpressions",
"|",
"{",
"FINAL",
"|"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L2769-L2785 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/parser/JavacParser.java | JavacParser.resource | protected JCTree resource() {
JCModifiers optFinal = optFinal(Flags.FINAL);
JCExpression type = parseType();
int pos = token.pos;
Name ident = ident();
return variableDeclaratorRest(pos, optFinal, type, ident, true, null);
} | java | protected JCTree resource() {
JCModifiers optFinal = optFinal(Flags.FINAL);
JCExpression type = parseType();
int pos = token.pos;
Name ident = ident();
return variableDeclaratorRest(pos, optFinal, type, ident, true, null);
} | [
"protected",
"JCTree",
"resource",
"(",
")",
"{",
"JCModifiers",
"optFinal",
"=",
"optFinal",
"(",
"Flags",
".",
"FINAL",
")",
";",
"JCExpression",
"type",
"=",
"parseType",
"(",
")",
";",
"int",
"pos",
"=",
"token",
".",
"pos",
";",
"Name",
"ident",
"... | Resource = VariableModifiersOpt Type VariableDeclaratorId = Expression | [
"Resource",
"=",
"VariableModifiersOpt",
"Type",
"VariableDeclaratorId",
"=",
"Expression"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/parser/JavacParser.java#L3122-L3128 | train |
brianwhu/xillium | gear/src/main/java/org/xillium/gear/util/VitalTask.java | VitalTask.run | public final void run() {
_interrupted = null;
_age = 0;
while (true) {
try {
_strategy.observe(_age);
if (_preparation != null) _preparation.run();
_result = execute();
if (_age > 0) {
_reporting.emi... | java | public final void run() {
_interrupted = null;
_age = 0;
while (true) {
try {
_strategy.observe(_age);
if (_preparation != null) _preparation.run();
_result = execute();
if (_age > 0) {
_reporting.emi... | [
"public",
"final",
"void",
"run",
"(",
")",
"{",
"_interrupted",
"=",
"null",
";",
"_age",
"=",
"0",
";",
"while",
"(",
"true",
")",
"{",
"try",
"{",
"_strategy",
".",
"observe",
"(",
"_age",
")",
";",
"if",
"(",
"_preparation",
"!=",
"null",
")",
... | Task entry point. | [
"Task",
"entry",
"point",
"."
] | e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799 | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/gear/src/main/java/org/xillium/gear/util/VitalTask.java#L117-L145 | train |
base2Services/kagura | shared/reporting-core/src/main/java/com/base2/kagura/core/storage/FileReportsProvider.java | FileReportsProvider.loadReport | protected void loadReport(ReportsConfig result, File report, String reportId) throws IOException {
if (report.isDirectory())
{
FilenameFilter configYamlFilter = new PatternFilenameFilter("^reportconf.(yaml|json)$");
File[] selectYaml = report.listFiles(configYamlFilter);
... | java | protected void loadReport(ReportsConfig result, File report, String reportId) throws IOException {
if (report.isDirectory())
{
FilenameFilter configYamlFilter = new PatternFilenameFilter("^reportconf.(yaml|json)$");
File[] selectYaml = report.listFiles(configYamlFilter);
... | [
"protected",
"void",
"loadReport",
"(",
"ReportsConfig",
"result",
",",
"File",
"report",
",",
"String",
"reportId",
")",
"throws",
"IOException",
"{",
"if",
"(",
"report",
".",
"isDirectory",
"(",
")",
")",
"{",
"FilenameFilter",
"configYamlFilter",
"=",
"new... | Custom separate dload report component, so it can be called elsewhere, or overwritten by child Providers. Checks
the "report" to ensure it is a directory then looks for reportconf.yaml or reportconf.json inside the file. If it
exists loads it.
@param result The collection of reports to load the contents into.
@param re... | [
"Custom",
"separate",
"dload",
"report",
"component",
"so",
"it",
"can",
"be",
"called",
"elsewhere",
"or",
"overwritten",
"by",
"child",
"Providers",
".",
"Checks",
"the",
"report",
"to",
"ensure",
"it",
"is",
"a",
"directory",
"then",
"looks",
"for",
"repo... | 5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee | https://github.com/base2Services/kagura/blob/5564aa71bfa2cb3baaae2eb098c6c673dd4e82ee/shared/reporting-core/src/main/java/com/base2/kagura/core/storage/FileReportsProvider.java#L74-L85 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/RpcException.java | RpcException.toMap | @SuppressWarnings("unchecked")
public Map toMap() {
HashMap map = new HashMap();
map.put("code", code);
map.put("message", message);
if (data != null)
map.put("data", data);
return map;
} | java | @SuppressWarnings("unchecked")
public Map toMap() {
HashMap map = new HashMap();
map.put("code", code);
map.put("message", message);
if (data != null)
map.put("data", data);
return map;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"Map",
"toMap",
"(",
")",
"{",
"HashMap",
"map",
"=",
"new",
"HashMap",
"(",
")",
";",
"map",
".",
"put",
"(",
"\"code\"",
",",
"code",
")",
";",
"map",
".",
"put",
"(",
"\"message\"",
","... | Used to marshal this exception to a Map suiteable for serialization to JSON | [
"Used",
"to",
"marshal",
"this",
"exception",
"to",
"a",
"Map",
"suiteable",
"for",
"serialization",
"to",
"JSON"
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/RpcException.java#L99-L107 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/util/Options.java | Options.lint | public boolean lint(String s) {
// return true if either the specific option is enabled, or
// they are all enabled without the specific one being
// disabled
return
isSet(XLINT_CUSTOM, s) ||
(isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) &&
isUnset(... | java | public boolean lint(String s) {
// return true if either the specific option is enabled, or
// they are all enabled without the specific one being
// disabled
return
isSet(XLINT_CUSTOM, s) ||
(isSet(XLINT) || isSet(XLINT_CUSTOM, "all")) &&
isUnset(... | [
"public",
"boolean",
"lint",
"(",
"String",
"s",
")",
"{",
"// return true if either the specific option is enabled, or",
"// they are all enabled without the specific one being",
"// disabled",
"return",
"isSet",
"(",
"XLINT_CUSTOM",
",",
"s",
")",
"||",
"(",
"isSet",
"(",... | Check for a lint suboption. | [
"Check",
"for",
"a",
"lint",
"suboption",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/util/Options.java#L174-L182 | train |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/OAuth2AuthorizationResource.java | OAuth2AuthorizationResource.refreshAccessToken | @POST
@Path("refresh")
@Consumes(MediaType.APPLICATION_JSON)
public Response refreshAccessToken(RefreshTokenRequest refreshToken) {
// Perform all validation here to control the exact error message returned to comply with the Oauth2 standard
if (null == refreshToken.getRefresh_token() ||
null == ... | java | @POST
@Path("refresh")
@Consumes(MediaType.APPLICATION_JSON)
public Response refreshAccessToken(RefreshTokenRequest refreshToken) {
// Perform all validation here to control the exact error message returned to comply with the Oauth2 standard
if (null == refreshToken.getRefresh_token() ||
null == ... | [
"@",
"POST",
"@",
"Path",
"(",
"\"refresh\"",
")",
"@",
"Consumes",
"(",
"MediaType",
".",
"APPLICATION_JSON",
")",
"public",
"Response",
"refreshAccessToken",
"(",
"RefreshTokenRequest",
"refreshToken",
")",
"{",
"// Perform all validation here to control the exact error... | Refresh an access_token using the refresh token
@param refreshToken refresh token
@return @return access_token and refresh token if successful.
Success response http://tools.ietf.org/html/rfc6749#section-5.1
Failure response http://tools.ietf.org/html/rfc6749#section-5.2 | [
"Refresh",
"an",
"access_token",
"using",
"the",
"refresh",
"token"
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/OAuth2AuthorizationResource.java#L206-L243 | train |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/OAuth2AuthorizationResource.java | OAuth2AuthorizationResource.validate | @GET
@Path("tokeninfo")
public Response validate(@QueryParam("access_token") String access_token) {
checkNotNull(access_token);
DConnection connection = connectionDao.findByAccessToken(access_token);
LOGGER.debug("Connection {}", connection);
if (null == connection || hasAccessTokenExpired(connecti... | java | @GET
@Path("tokeninfo")
public Response validate(@QueryParam("access_token") String access_token) {
checkNotNull(access_token);
DConnection connection = connectionDao.findByAccessToken(access_token);
LOGGER.debug("Connection {}", connection);
if (null == connection || hasAccessTokenExpired(connecti... | [
"@",
"GET",
"@",
"Path",
"(",
"\"tokeninfo\"",
")",
"public",
"Response",
"validate",
"(",
"@",
"QueryParam",
"(",
"\"access_token\"",
")",
"String",
"access_token",
")",
"{",
"checkNotNull",
"(",
"access_token",
")",
";",
"DConnection",
"connection",
"=",
"co... | Validate an access_token.
The Oauth2 specification does not specify how this should be done. Do similar to what Google does
@param access_token access token to validate. Be careful about using url safe tokens or use url encoding.
@return http 200 if success and some basic info about the access_token | [
"Validate",
"an",
"access_token",
".",
"The",
"Oauth2",
"specification",
"does",
"not",
"specify",
"how",
"this",
"should",
"be",
"done",
".",
"Do",
"similar",
"to",
"what",
"Google",
"does"
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/OAuth2AuthorizationResource.java#L357-L374 | train |
Wadpam/guja | guja-core/src/main/java/com/wadpam/guja/oauth2/api/OAuth2AuthorizationResource.java | OAuth2AuthorizationResource.logout | @GET
@Path("logout")
public Response logout() throws URISyntaxException {
return Response
.temporaryRedirect(new URI("/"))
.cookie(createCookie(null, 0))
.build();
} | java | @GET
@Path("logout")
public Response logout() throws URISyntaxException {
return Response
.temporaryRedirect(new URI("/"))
.cookie(createCookie(null, 0))
.build();
} | [
"@",
"GET",
"@",
"Path",
"(",
"\"logout\"",
")",
"public",
"Response",
"logout",
"(",
")",
"throws",
"URISyntaxException",
"{",
"return",
"Response",
".",
"temporaryRedirect",
"(",
"new",
"URI",
"(",
"\"/\"",
")",
")",
".",
"cookie",
"(",
"createCookie",
"... | Remove cookie from the user agent.
@return Redirect to requests
@throws URISyntaxException | [
"Remove",
"cookie",
"from",
"the",
"user",
"agent",
"."
] | eb8ba8e6794a96ea0dd9744cada4f9ad9618f114 | https://github.com/Wadpam/guja/blob/eb8ba8e6794a96ea0dd9744cada4f9ad9618f114/guja-core/src/main/java/com/wadpam/guja/oauth2/api/OAuth2AuthorizationResource.java#L387-L394 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java | DocFinder.search | public static Output search(Input input) {
Output output = new Output();
if (input.isInheritDocTag) {
//Do nothing because "element" does not have any documentation.
//All it has it {@inheritDoc}.
} else if (input.taglet == null) {
//We want overall documentat... | java | public static Output search(Input input) {
Output output = new Output();
if (input.isInheritDocTag) {
//Do nothing because "element" does not have any documentation.
//All it has it {@inheritDoc}.
} else if (input.taglet == null) {
//We want overall documentat... | [
"public",
"static",
"Output",
"search",
"(",
"Input",
"input",
")",
"{",
"Output",
"output",
"=",
"new",
"Output",
"(",
")",
";",
"if",
"(",
"input",
".",
"isInheritDocTag",
")",
"{",
"//Do nothing because \"element\" does not have any documentation.",
"//All it has... | Search for the requested comments in the given element. If it does not
have comments, return documentation from the overriden element if possible.
If the overriden element does not exist or does not have documentation to
inherit, search for documentation to inherit from implemented methods.
@param input the input obj... | [
"Search",
"for",
"the",
"requested",
"comments",
"in",
"the",
"given",
"element",
".",
"If",
"it",
"does",
"not",
"have",
"comments",
"return",
"documentation",
"from",
"the",
"overriden",
"element",
"if",
"possible",
".",
"If",
"the",
"overriden",
"element",
... | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java#L187-L243 | train |
coopernurse/barrister-java | src/main/java/com/bitmechanic/barrister/BarristerServlet.java | BarristerServlet.init | public void init(ServletConfig config) throws ServletException {
try {
String idlPath = config.getInitParameter("idl");
if (idlPath == null) {
throw new ServletException("idl init param is required. Set to path to .json file, or classpath:/mycontract.json");
... | java | public void init(ServletConfig config) throws ServletException {
try {
String idlPath = config.getInitParameter("idl");
if (idlPath == null) {
throw new ServletException("idl init param is required. Set to path to .json file, or classpath:/mycontract.json");
... | [
"public",
"void",
"init",
"(",
"ServletConfig",
"config",
")",
"throws",
"ServletException",
"{",
"try",
"{",
"String",
"idlPath",
"=",
"config",
".",
"getInitParameter",
"(",
"\"idl\"",
")",
";",
"if",
"(",
"idlPath",
"==",
"null",
")",
"{",
"throw",
"new... | Initializes the servlet based on the init parameters in web.xml | [
"Initializes",
"the",
"servlet",
"based",
"on",
"the",
"init",
"parameters",
"in",
"web",
".",
"xml"
] | c2b639634c88a25002b66d1fb4a8f5fb51ade6a2 | https://github.com/coopernurse/barrister-java/blob/c2b639634c88a25002b66d1fb4a8f5fb51ade6a2/src/main/java/com/bitmechanic/barrister/BarristerServlet.java#L72-L122 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getTargetProfilePackageLink | public Content getTargetProfilePackageLink(PackageDoc pd, String target,
Content label, String profileName) {
return getHyperLink(pathString(pd, DocPaths.profilePackageSummary(profileName)),
label, "", target);
} | java | public Content getTargetProfilePackageLink(PackageDoc pd, String target,
Content label, String profileName) {
return getHyperLink(pathString(pd, DocPaths.profilePackageSummary(profileName)),
label, "", target);
} | [
"public",
"Content",
"getTargetProfilePackageLink",
"(",
"PackageDoc",
"pd",
",",
"String",
"target",
",",
"Content",
"label",
",",
"String",
"profileName",
")",
"{",
"return",
"getHyperLink",
"(",
"pathString",
"(",
"pd",
",",
"DocPaths",
".",
"profilePackageSumm... | Get Profile Package link, with target frame.
@param pd the packageDoc object
@param target name of the target frame
@param label tag for the link
@param profileName the name of the profile being documented
@return a content for the target profile packages link | [
"Get",
"Profile",
"Package",
"link",
"with",
"target",
"frame",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L291-L295 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getTargetProfileLink | public Content getTargetProfileLink(String target, Content label,
String profileName) {
return getHyperLink(pathToRoot.resolve(
DocPaths.profileSummary(profileName)), label, "", target);
} | java | public Content getTargetProfileLink(String target, Content label,
String profileName) {
return getHyperLink(pathToRoot.resolve(
DocPaths.profileSummary(profileName)), label, "", target);
} | [
"public",
"Content",
"getTargetProfileLink",
"(",
"String",
"target",
",",
"Content",
"label",
",",
"String",
"profileName",
")",
"{",
"return",
"getHyperLink",
"(",
"pathToRoot",
".",
"resolve",
"(",
"DocPaths",
".",
"profileSummary",
"(",
"profileName",
")",
"... | Get Profile link, with target frame.
@param target name of the target frame
@param label tag for the link
@param profileName the name of the profile being documented
@return a content for the target profile link | [
"Get",
"Profile",
"link",
"with",
"target",
"frame",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L305-L309 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getTypeNameForProfile | public String getTypeNameForProfile(ClassDoc cd) {
StringBuilder typeName =
new StringBuilder((cd.containingPackage()).name().replace(".", "/"));
typeName.append("/")
.append(cd.name().replace(".", "$"));
return typeName.toString();
} | java | public String getTypeNameForProfile(ClassDoc cd) {
StringBuilder typeName =
new StringBuilder((cd.containingPackage()).name().replace(".", "/"));
typeName.append("/")
.append(cd.name().replace(".", "$"));
return typeName.toString();
} | [
"public",
"String",
"getTypeNameForProfile",
"(",
"ClassDoc",
"cd",
")",
"{",
"StringBuilder",
"typeName",
"=",
"new",
"StringBuilder",
"(",
"(",
"cd",
".",
"containingPackage",
"(",
")",
")",
".",
"name",
"(",
")",
".",
"replace",
"(",
"\".\"",
",",
"\"/\... | Get the type name for profile search.
@param cd the classDoc object for which the type name conversion is needed
@return a type name string for the type | [
"Get",
"the",
"type",
"name",
"for",
"profile",
"search",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L317-L323 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.isTypeInProfile | public boolean isTypeInProfile(ClassDoc cd, int profileValue) {
return (configuration.profiles.getProfile(getTypeNameForProfile(cd)) <= profileValue);
} | java | public boolean isTypeInProfile(ClassDoc cd, int profileValue) {
return (configuration.profiles.getProfile(getTypeNameForProfile(cd)) <= profileValue);
} | [
"public",
"boolean",
"isTypeInProfile",
"(",
"ClassDoc",
"cd",
",",
"int",
"profileValue",
")",
"{",
"return",
"(",
"configuration",
".",
"profiles",
".",
"getProfile",
"(",
"getTypeNameForProfile",
"(",
"cd",
")",
")",
"<=",
"profileValue",
")",
";",
"}"
] | Check if a type belongs to a profile.
@param cd the classDoc object that needs to be checked
@param profileValue the profile in which the type needs to be checked
@return true if the type is in the profile | [
"Check",
"if",
"a",
"type",
"belongs",
"to",
"a",
"profile",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L332-L334 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addBottom | public void addBottom(Content body) {
Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
Content small = HtmlTree.SMALL(bottom);
Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
body.addContent(p);
} | java | public void addBottom(Content body) {
Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
Content small = HtmlTree.SMALL(bottom);
Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
body.addContent(p);
} | [
"public",
"void",
"addBottom",
"(",
"Content",
"body",
")",
"{",
"Content",
"bottom",
"=",
"new",
"RawHtml",
"(",
"replaceDocRootDir",
"(",
"configuration",
".",
"bottom",
")",
")",
";",
"Content",
"small",
"=",
"HtmlTree",
".",
"SMALL",
"(",
"bottom",
")"... | Adds the user specified bottom.
@param body the content tree to which user specified bottom will be added | [
"Adds",
"the",
"user",
"specified",
"bottom",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L472-L477 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addPackageDeprecatedAPI | protected void addPackageDeprecatedAPI(List<Doc> deprPkgs, String headingKey,
String tableSummary, String[] tableHeader, Content contentTree) {
if (deprPkgs.size() > 0) {
Content table = HtmlTree.TABLE(HtmlStyle.deprecatedSummary, 0, 3, 0, tableSummary,
getTableCaptio... | java | protected void addPackageDeprecatedAPI(List<Doc> deprPkgs, String headingKey,
String tableSummary, String[] tableHeader, Content contentTree) {
if (deprPkgs.size() > 0) {
Content table = HtmlTree.TABLE(HtmlStyle.deprecatedSummary, 0, 3, 0, tableSummary,
getTableCaptio... | [
"protected",
"void",
"addPackageDeprecatedAPI",
"(",
"List",
"<",
"Doc",
">",
"deprPkgs",
",",
"String",
"headingKey",
",",
"String",
"tableSummary",
",",
"String",
"[",
"]",
"tableHeader",
",",
"Content",
"contentTree",
")",
"{",
"if",
"(",
"deprPkgs",
".",
... | Add package deprecation information to the documentation tree
@param deprPkgs list of deprecated packages
@param headingKey the caption for the deprecated package table
@param tableSummary the summary for the deprecated package table
@param tableHeader table headers for the deprecated package table
@param contentTree ... | [
"Add",
"package",
"deprecation",
"information",
"to",
"the",
"documentation",
"tree"
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L940-L967 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.getScriptProperties | public HtmlTree getScriptProperties() {
HtmlTree script = HtmlTree.SCRIPT("text/javascript",
pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
return script;
} | java | public HtmlTree getScriptProperties() {
HtmlTree script = HtmlTree.SCRIPT("text/javascript",
pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
return script;
} | [
"public",
"HtmlTree",
"getScriptProperties",
"(",
")",
"{",
"HtmlTree",
"script",
"=",
"HtmlTree",
".",
"SCRIPT",
"(",
"\"text/javascript\"",
",",
"pathToRoot",
".",
"resolve",
"(",
"DocPaths",
".",
"JAVASCRIPT",
")",
".",
"getPath",
"(",
")",
")",
";",
"ret... | Returns a link to the JavaScript file.
@return an HtmlTree for the Script tag which provides the JavaScript location | [
"Returns",
"a",
"link",
"to",
"the",
"JavaScript",
"file",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L1815-L1819 | train |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java | HtmlDocletWriter.addAnnotationInfo | private boolean addAnnotationInfo(int indent, Doc doc,
AnnotationDesc[] descList, boolean lineBreak, Content htmltree) {
List<Content> annotations = getAnnotations(indent, descList, lineBreak);
String sep ="";
if (annotations.isEmpty()) {
return false;
}
f... | java | private boolean addAnnotationInfo(int indent, Doc doc,
AnnotationDesc[] descList, boolean lineBreak, Content htmltree) {
List<Content> annotations = getAnnotations(indent, descList, lineBreak);
String sep ="";
if (annotations.isEmpty()) {
return false;
}
f... | [
"private",
"boolean",
"addAnnotationInfo",
"(",
"int",
"indent",
",",
"Doc",
"doc",
",",
"AnnotationDesc",
"[",
"]",
"descList",
",",
"boolean",
"lineBreak",
",",
"Content",
"htmltree",
")",
"{",
"List",
"<",
"Content",
">",
"annotations",
"=",
"getAnnotations... | Adds the annotation types for the given doc.
@param indent the number of extra spaces to indent the annotations.
@param doc the doc to write annotations for.
@param descList the array of {@link AnnotationDesc}.
@param htmltree the documentation tree to which the annotation info will be
added | [
"Adds",
"the",
"annotation",
"types",
"for",
"the",
"given",
"doc",
"."
] | 8812d28c20f4de070a0dd6de1b45602431379834 | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java#L1899-L1912 | train |
apruve/apruve-java | src/main/java/com/apruve/models/Payment.java | Payment.get | public static ApruveResponse<Payment> get(String paymentRequestId, String paymentId) {
return ApruveClient.getInstance().get(
getPaymentsPath(paymentRequestId) + paymentId, Payment.class);
} | java | public static ApruveResponse<Payment> get(String paymentRequestId, String paymentId) {
return ApruveClient.getInstance().get(
getPaymentsPath(paymentRequestId) + paymentId, Payment.class);
} | [
"public",
"static",
"ApruveResponse",
"<",
"Payment",
">",
"get",
"(",
"String",
"paymentRequestId",
",",
"String",
"paymentId",
")",
"{",
"return",
"ApruveClient",
".",
"getInstance",
"(",
")",
".",
"get",
"(",
"getPaymentsPath",
"(",
"paymentRequestId",
")",
... | Fetches the Payment with the given ID from Apruve.
@see <a
href="https://www.apruve.com/doc/developers/rest-api/">https://www.apruve.com/doc/developers/rest-api/</a>
@param paymentRequestId
The ID of the PaymentRequest that owns the Payment
@param paymentId
The ID of the Payment
@return Payment, or null if not found | [
"Fetches",
"the",
"Payment",
"with",
"the",
"given",
"ID",
"from",
"Apruve",
"."
] | b188d6b17f777823c2e46427847318849978685e | https://github.com/apruve/apruve-java/blob/b188d6b17f777823c2e46427847318849978685e/src/main/java/com/apruve/models/Payment.java#L102-L105 | train |
apruve/apruve-java | src/main/java/com/apruve/models/Payment.java | Payment.getAll | public static ApruveResponse<List<Payment>> getAll(String paymentRequestId) {
return ApruveClient.getInstance().index(
getPaymentsPath(paymentRequestId),
new GenericType<List<Payment>>() {
});
} | java | public static ApruveResponse<List<Payment>> getAll(String paymentRequestId) {
return ApruveClient.getInstance().index(
getPaymentsPath(paymentRequestId),
new GenericType<List<Payment>>() {
});
} | [
"public",
"static",
"ApruveResponse",
"<",
"List",
"<",
"Payment",
">",
">",
"getAll",
"(",
"String",
"paymentRequestId",
")",
"{",
"return",
"ApruveClient",
".",
"getInstance",
"(",
")",
".",
"index",
"(",
"getPaymentsPath",
"(",
"paymentRequestId",
")",
",",... | Fetches all Payments belonging to the PaymentRequest with the specified
ID.
@see <a
href="https://www.apruve.com/doc/developers/rest-api/">https://www.apruve.com/doc/developers/rest-api/</a>
@param paymentRequestId
The ID of the PaymentRequest that owns the Payment
@return List of Payments, or null if the PaymentReque... | [
"Fetches",
"all",
"Payments",
"belonging",
"to",
"the",
"PaymentRequest",
"with",
"the",
"specified",
"ID",
"."
] | b188d6b17f777823c2e46427847318849978685e | https://github.com/apruve/apruve-java/blob/b188d6b17f777823c2e46427847318849978685e/src/main/java/com/apruve/models/Payment.java#L117-L122 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.init | public void init()
{
Dictionary<String, String> properties = getConfigurationProperties(this.getProperties(), false);
this.setProperties(properties);
this.setProperty(BundleConstants.SERVICE_PID, getServicePid());
this.setProperty(BundleConstants.SERVICE_CLASS, getServiceClassName());
} | java | public void init()
{
Dictionary<String, String> properties = getConfigurationProperties(this.getProperties(), false);
this.setProperties(properties);
this.setProperty(BundleConstants.SERVICE_PID, getServicePid());
this.setProperty(BundleConstants.SERVICE_CLASS, getServiceClassName());
} | [
"public",
"void",
"init",
"(",
")",
"{",
"Dictionary",
"<",
"String",
",",
"String",
">",
"properties",
"=",
"getConfigurationProperties",
"(",
"this",
".",
"getProperties",
"(",
")",
",",
"false",
")",
";",
"this",
".",
"setProperties",
"(",
"properties",
... | Setup the application properties.
Override this to set the properties.
@param bundleContext BundleContext | [
"Setup",
"the",
"application",
"properties",
".",
"Override",
"this",
"to",
"set",
"the",
"properties",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L70-L76 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.start | public void start(BundleContext context) throws Exception {
ClassServiceUtility.log(context, LogService.LOG_INFO, "Starting " + this.getClass().getName() + " Bundle");
this.context = context;
this.init(); // Setup the properties
String interfaceClassName = getInterfaceClassNa... | java | public void start(BundleContext context) throws Exception {
ClassServiceUtility.log(context, LogService.LOG_INFO, "Starting " + this.getClass().getName() + " Bundle");
this.context = context;
this.init(); // Setup the properties
String interfaceClassName = getInterfaceClassNa... | [
"public",
"void",
"start",
"(",
"BundleContext",
"context",
")",
"throws",
"Exception",
"{",
"ClassServiceUtility",
".",
"log",
"(",
"context",
",",
"LogService",
".",
"LOG_INFO",
",",
"\"Starting \"",
"+",
"this",
".",
"getClass",
"(",
")",
".",
"getName",
... | Bundle starting up.
Don't override this, override startupService. | [
"Bundle",
"starting",
"up",
".",
"Don",
"t",
"override",
"this",
"override",
"startupService",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L113-L137 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.stop | public void stop(BundleContext context) throws Exception {
ClassServiceUtility.log(context, LogService.LOG_INFO, "Stopping " + this.getClass().getName() + " Bundle");
if (this.shutdownService(service, context))
service = null;
// Unregisters automatically
this.context = null;
} | java | public void stop(BundleContext context) throws Exception {
ClassServiceUtility.log(context, LogService.LOG_INFO, "Stopping " + this.getClass().getName() + " Bundle");
if (this.shutdownService(service, context))
service = null;
// Unregisters automatically
this.context = null;
} | [
"public",
"void",
"stop",
"(",
"BundleContext",
"context",
")",
"throws",
"Exception",
"{",
"ClassServiceUtility",
".",
"log",
"(",
"context",
",",
"LogService",
".",
"LOG_INFO",
",",
"\"Stopping \"",
"+",
"this",
".",
"getClass",
"(",
")",
".",
"getName",
"... | Bundle stopping.
Don't override this, override shutdownService. | [
"Bundle",
"stopping",
".",
"Don",
"t",
"override",
"this",
"override",
"shutdownService",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L142-L148 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.registerService | public void registerService(Object service)
{
this.setService(service);
String serviceClass = getInterfaceClassName();
if (service != null)
serviceRegistration = context.registerService(serviceClass, this.service, properties);
} | java | public void registerService(Object service)
{
this.setService(service);
String serviceClass = getInterfaceClassName();
if (service != null)
serviceRegistration = context.registerService(serviceClass, this.service, properties);
} | [
"public",
"void",
"registerService",
"(",
"Object",
"service",
")",
"{",
"this",
".",
"setService",
"(",
"service",
")",
";",
"String",
"serviceClass",
"=",
"getInterfaceClassName",
"(",
")",
";",
"if",
"(",
"service",
"!=",
"null",
")",
"serviceRegistration",... | Get the service for this implementation class.
@param interfaceClassName
@return | [
"Get",
"the",
"service",
"for",
"this",
"implementation",
"class",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L253-L260 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.getService | public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter)
{
return ClassServiceUtility.getClassService().getClassFinder(context).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, -1);
} | java | public Object getService(String interfaceClassName, String serviceClassName, String versionRange, Dictionary<String,String> filter)
{
return ClassServiceUtility.getClassService().getClassFinder(context).getClassBundleService(interfaceClassName, serviceClassName, versionRange, filter, -1);
} | [
"public",
"Object",
"getService",
"(",
"String",
"interfaceClassName",
",",
"String",
"serviceClassName",
",",
"String",
"versionRange",
",",
"Dictionary",
"<",
"String",
",",
"String",
">",
"filter",
")",
"{",
"return",
"ClassServiceUtility",
".",
"getClassService"... | Convenience method to get the service for this implementation class.
@param interfaceClassName
@return | [
"Convenience",
"method",
"to",
"get",
"the",
"service",
"for",
"this",
"implementation",
"class",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L284-L287 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.getServicePid | public String getServicePid()
{
String servicePid = context.getProperty(BundleConstants.SERVICE_PID);
if (servicePid != null)
return servicePid;
servicePid = this.getServiceClassName();
if (servicePid == null)
servicePid = this.getClass().getName();
re... | java | public String getServicePid()
{
String servicePid = context.getProperty(BundleConstants.SERVICE_PID);
if (servicePid != null)
return servicePid;
servicePid = this.getServiceClassName();
if (servicePid == null)
servicePid = this.getClass().getName();
re... | [
"public",
"String",
"getServicePid",
"(",
")",
"{",
"String",
"servicePid",
"=",
"context",
".",
"getProperty",
"(",
"BundleConstants",
".",
"SERVICE_PID",
")",
";",
"if",
"(",
"servicePid",
"!=",
"null",
")",
"return",
"servicePid",
";",
"servicePid",
"=",
... | The service key in the config admin system.
@return By default the package name, else override this. | [
"The",
"service",
"key",
"in",
"the",
"config",
"admin",
"system",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L293-L302 | train |
jbundle/osgi | core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java | BaseBundleActivator.putAll | public static Dictionary<String, String> putAll(Dictionary<String, String> sourceDictionary, Dictionary<String, String> destDictionary)
{
if (destDictionary == null)
destDictionary = new Hashtable<String, String>();
if (sourceDictionary != null)
{
Enumeration<String> ... | java | public static Dictionary<String, String> putAll(Dictionary<String, String> sourceDictionary, Dictionary<String, String> destDictionary)
{
if (destDictionary == null)
destDictionary = new Hashtable<String, String>();
if (sourceDictionary != null)
{
Enumeration<String> ... | [
"public",
"static",
"Dictionary",
"<",
"String",
",",
"String",
">",
"putAll",
"(",
"Dictionary",
"<",
"String",
",",
"String",
">",
"sourceDictionary",
",",
"Dictionary",
"<",
"String",
",",
"String",
">",
"destDictionary",
")",
"{",
"if",
"(",
"destDiction... | Copy all the values from one dictionary to another.
@param sourceDictionary
@param destDictionary
@return | [
"Copy",
"all",
"the",
"values",
"from",
"one",
"dictionary",
"to",
"another",
"."
] | beb02aef78736a4f799aaac001c8f0327bf0536c | https://github.com/jbundle/osgi/blob/beb02aef78736a4f799aaac001c8f0327bf0536c/core/src/main/java/org/jbundle/util/osgi/bundle/BaseBundleActivator.java#L409-L423 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/CollectionUtils.java | CollectionUtils.getFirstNotNullValue | public static <T> T getFirstNotNullValue(final Collection<T> collection) {
if (isNotEmpty(collection)) {
for (T element : collection) {
if (element != null) {
return element;
}
}
}
return null;
} | java | public static <T> T getFirstNotNullValue(final Collection<T> collection) {
if (isNotEmpty(collection)) {
for (T element : collection) {
if (element != null) {
return element;
}
}
}
return null;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"getFirstNotNullValue",
"(",
"final",
"Collection",
"<",
"T",
">",
"collection",
")",
"{",
"if",
"(",
"isNotEmpty",
"(",
"collection",
")",
")",
"{",
"for",
"(",
"T",
"element",
":",
"collection",
")",
"{",
"if",... | Returns the first not null element if the collection is not null and have
not null value, else return null.
@param collection
the collection to be handled.
@return the first not null element if the collection is not null and have
not null value, else null. | [
"Returns",
"the",
"first",
"not",
"null",
"element",
"if",
"the",
"collection",
"is",
"not",
"null",
"and",
"have",
"not",
"null",
"value",
"else",
"return",
"null",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/CollectionUtils.java#L90-L100 | train |
defei/codelogger-utils | src/main/java/org/codelogger/utils/CollectionUtils.java | CollectionUtils.toList | public static <T> List<T> toList(final Collection<T> collection) {
if (isEmpty(collection)) {
return new ArrayList<T>(0);
} else {
return new ArrayList<T>(collection);
}
} | java | public static <T> List<T> toList(final Collection<T> collection) {
if (isEmpty(collection)) {
return new ArrayList<T>(0);
} else {
return new ArrayList<T>(collection);
}
} | [
"public",
"static",
"<",
"T",
">",
"List",
"<",
"T",
">",
"toList",
"(",
"final",
"Collection",
"<",
"T",
">",
"collection",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"collection",
")",
")",
"{",
"return",
"new",
"ArrayList",
"<",
"T",
">",
"(",
"0",
... | Convert given collection to a list.
@param collection
source collection.
@return a list has full given collection element and order by collection
index. | [
"Convert",
"given",
"collection",
"to",
"a",
"list",
"."
] | d906f5d217b783c7ae3e53442cd6fb87b20ecc0a | https://github.com/defei/codelogger-utils/blob/d906f5d217b783c7ae3e53442cd6fb87b20ecc0a/src/main/java/org/codelogger/utils/CollectionUtils.java#L110-L117 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.