repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/ConstructorRef.java | ConstructorRef.create | public static ConstructorRef create(TypeInfo type, Iterable<Type> argTypes) {
"""
Returns a new {@link ConstructorRef} that refers to a constructor on the given type with the
given parameter types.
"""
return create(
type, new Method("<init>", Type.VOID_TYPE, Iterables.toArray(argTypes, Type.class... | java | public static ConstructorRef create(TypeInfo type, Iterable<Type> argTypes) {
return create(
type, new Method("<init>", Type.VOID_TYPE, Iterables.toArray(argTypes, Type.class)));
} | [
"public",
"static",
"ConstructorRef",
"create",
"(",
"TypeInfo",
"type",
",",
"Iterable",
"<",
"Type",
">",
"argTypes",
")",
"{",
"return",
"create",
"(",
"type",
",",
"new",
"Method",
"(",
"\"<init>\"",
",",
"Type",
".",
"VOID_TYPE",
",",
"Iterables",
"."... | Returns a new {@link ConstructorRef} that refers to a constructor on the given type with the
given parameter types. | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/ConstructorRef.java#L57-L60 |
zk1931/jzab | src/main/java/com/github/zk1931/jzab/MessageBuilder.java | MessageBuilder.fromProposal | public static Transaction fromProposal(Proposal prop) {
"""
Converts protobuf Proposal object to Transaction object.
@param prop the protobuf Proposal object.
@return the Transaction object.
"""
Zxid zxid = fromProtoZxid(prop.getZxid());
ByteBuffer buffer = prop.getBody().asReadOnlyByteBuffer();
... | java | public static Transaction fromProposal(Proposal prop) {
Zxid zxid = fromProtoZxid(prop.getZxid());
ByteBuffer buffer = prop.getBody().asReadOnlyByteBuffer();
return new Transaction(zxid, prop.getType().getNumber(), buffer);
} | [
"public",
"static",
"Transaction",
"fromProposal",
"(",
"Proposal",
"prop",
")",
"{",
"Zxid",
"zxid",
"=",
"fromProtoZxid",
"(",
"prop",
".",
"getZxid",
"(",
")",
")",
";",
"ByteBuffer",
"buffer",
"=",
"prop",
".",
"getBody",
"(",
")",
".",
"asReadOnlyByte... | Converts protobuf Proposal object to Transaction object.
@param prop the protobuf Proposal object.
@return the Transaction object. | [
"Converts",
"protobuf",
"Proposal",
"object",
"to",
"Transaction",
"object",
"."
] | train | https://github.com/zk1931/jzab/blob/2a8893bcc1a125f3aebdaddee80ad49c9761bba1/src/main/java/com/github/zk1931/jzab/MessageBuilder.java#L83-L87 |
hal/core | gui/src/main/java/org/jboss/as/console/client/shared/flow/TimeoutOperation.java | TimeoutOperation.start | public final void start(final Command command, final Callback callback) {
"""
Executes {@code command} until {@link #setConditionSatisfied(boolean)} was called with {@code true} or
the timeout is reached.
@param command the command which should be executed
@param callback the final callback
"""
t... | java | public final void start(final Command command, final Callback callback) {
this.start = System.currentTimeMillis();
this.conditionSatisfied = false;
command.execute();
new Async().whilst(new KeepGoing(), new Finish(callback), checker(), 500);
} | [
"public",
"final",
"void",
"start",
"(",
"final",
"Command",
"command",
",",
"final",
"Callback",
"callback",
")",
"{",
"this",
".",
"start",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"this",
".",
"conditionSatisfied",
"=",
"false",
";",
"com... | Executes {@code command} until {@link #setConditionSatisfied(boolean)} was called with {@code true} or
the timeout is reached.
@param command the command which should be executed
@param callback the final callback | [
"Executes",
"{",
"@code",
"command",
"}",
"until",
"{",
"@link",
"#setConditionSatisfied",
"(",
"boolean",
")",
"}",
"was",
"called",
"with",
"{",
"@code",
"true",
"}",
"or",
"the",
"timeout",
"is",
"reached",
"."
] | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/shared/flow/TimeoutOperation.java#L81-L86 |
roboconf/roboconf-platform | core/roboconf-plugin-script/src/main/java/net/roboconf/plugin/script/internal/templating/InstanceTemplateHelper.java | InstanceTemplateHelper.injectInstanceImports | public static void injectInstanceImports(Instance instance, File templateFile, File out)
throws IOException {
"""
Reads the import values of the instances and injects them into the template file.
<p>
See test resources to see the associated way to write templates
</p>
@param instance the instance whose impo... | java | public static void injectInstanceImports(Instance instance, File templateFile, File out)
throws IOException {
injectInstanceImports( instance, templateFile.getAbsolutePath(), out );
} | [
"public",
"static",
"void",
"injectInstanceImports",
"(",
"Instance",
"instance",
",",
"File",
"templateFile",
",",
"File",
"out",
")",
"throws",
"IOException",
"{",
"injectInstanceImports",
"(",
"instance",
",",
"templateFile",
".",
"getAbsolutePath",
"(",
")",
"... | Reads the import values of the instances and injects them into the template file.
<p>
See test resources to see the associated way to write templates
</p>
@param instance the instance whose imports must be injected
@param templateFile the template file
@param out the file to write into
@throws IOException if something... | [
"Reads",
"the",
"import",
"values",
"of",
"the",
"instances",
"and",
"injects",
"them",
"into",
"the",
"template",
"file",
".",
"<p",
">",
"See",
"test",
"resources",
"to",
"see",
"the",
"associated",
"way",
"to",
"write",
"templates",
"<",
"/",
"p",
">"... | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-plugin-script/src/main/java/net/roboconf/plugin/script/internal/templating/InstanceTemplateHelper.java#L131-L134 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java | Configurer.getNode | private Xml getNode(String... path) {
"""
Get the node at the following path.
@param path The node path.
@return The node found.
@throws LionEngineException If node not found.
"""
Xml node = root;
for (final String element : path)
{
try
{
nod... | java | private Xml getNode(String... path)
{
Xml node = root;
for (final String element : path)
{
try
{
node = node.getChild(element);
}
catch (final LionEngineException exception)
{
throw new LionEngineExce... | [
"private",
"Xml",
"getNode",
"(",
"String",
"...",
"path",
")",
"{",
"Xml",
"node",
"=",
"root",
";",
"for",
"(",
"final",
"String",
"element",
":",
"path",
")",
"{",
"try",
"{",
"node",
"=",
"node",
".",
"getChild",
"(",
"element",
")",
";",
"}",
... | Get the node at the following path.
@param path The node path.
@return The node found.
@throws LionEngineException If node not found. | [
"Get",
"the",
"node",
"at",
"the",
"following",
"path",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/Configurer.java#L447-L462 |
alkacon/opencms-core | src/org/opencms/i18n/CmsResourceBundleLoader.java | CmsResourceBundleLoader.flushBundleCache | public static void flushBundleCache(String baseName, boolean flushPermanent) {
"""
Flushes all variations for the provided bundle from the cache.<p>
@param baseName the bundle base name to flush the variations for
@param flushPermanent if true, the cache for additional message bundles will be flushed, too
... | java | public static void flushBundleCache(String baseName, boolean flushPermanent) {
if (baseName != null) {
synchronized (m_bundleCache) {
// first check and clear the bundle cache
Map<BundleKey, ResourceBundle> bundleCacheNew = new ConcurrentHashMap<BundleKey, ResourceB... | [
"public",
"static",
"void",
"flushBundleCache",
"(",
"String",
"baseName",
",",
"boolean",
"flushPermanent",
")",
"{",
"if",
"(",
"baseName",
"!=",
"null",
")",
"{",
"synchronized",
"(",
"m_bundleCache",
")",
"{",
"// first check and clear the bundle cache",
"Map",
... | Flushes all variations for the provided bundle from the cache.<p>
@param baseName the bundle base name to flush the variations for
@param flushPermanent if true, the cache for additional message bundles will be flushed, too | [
"Flushes",
"all",
"variations",
"for",
"the",
"provided",
"bundle",
"from",
"the",
"cache",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/i18n/CmsResourceBundleLoader.java#L223-L246 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/jboss/logging/Logger.java | Logger.tracev | public void tracev(String format, Object... params) {
"""
Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param params the parameters
"""
doLog(Level.TRACE, FQCN, format, params, null);
} | java | public void tracev(String format, Object... params) {
doLog(Level.TRACE, FQCN, format, params, null);
} | [
"public",
"void",
"tracev",
"(",
"String",
"format",
",",
"Object",
"...",
"params",
")",
"{",
"doLog",
"(",
"Level",
".",
"TRACE",
",",
"FQCN",
",",
"format",
",",
"params",
",",
"null",
")",
";",
"}"
] | Issue a log message with a level of TRACE using {@link java.text.MessageFormat}-style formatting.
@param format the message format string
@param params the parameters | [
"Issue",
"a",
"log",
"message",
"with",
"a",
"level",
"of",
"TRACE",
"using",
"{",
"@link",
"java",
".",
"text",
".",
"MessageFormat",
"}",
"-",
"style",
"formatting",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/jboss/logging/Logger.java#L174-L176 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java | VarOptItemsSketch.growCandidateSet | private void growCandidateSet(double wtCands, int numCands) {
"""
/* When entering here we should be in a well-characterized state where the
new item has been placed in either h or m and we have a valid but not necessarily
maximal sampling plan figured out. The array is completely full at this point.
Everyone i... | java | private void growCandidateSet(double wtCands, int numCands) {
assert (h_ + m_ + r_) == (k_ + 1);
assert numCands >= 2; // essential
assert numCands == (m_ + r_); // essential
assert (m_ == 0) || (m_ == 1);
while (h_ > 0) {
final double nextWt = peekMin();
final double nextTotWt = ... | [
"private",
"void",
"growCandidateSet",
"(",
"double",
"wtCands",
",",
"int",
"numCands",
")",
"{",
"assert",
"(",
"h_",
"+",
"m_",
"+",
"r_",
")",
"==",
"(",
"k_",
"+",
"1",
")",
";",
"assert",
"numCands",
">=",
"2",
";",
"// essential",
"assert",
"n... | /* When entering here we should be in a well-characterized state where the
new item has been placed in either h or m and we have a valid but not necessarily
maximal sampling plan figured out. The array is completely full at this point.
Everyone in h and m has an explicit weight. The candidates are right-justified
and a... | [
"/",
"*",
"When",
"entering",
"here",
"we",
"should",
"be",
"in",
"a",
"well",
"-",
"characterized",
"state",
"where",
"the",
"new",
"item",
"has",
"been",
"placed",
"in",
"either",
"h",
"or",
"m",
"and",
"we",
"have",
"a",
"valid",
"but",
"not",
"ne... | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/VarOptItemsSketch.java#L1111-L1134 |
dropwizard/dropwizard | dropwizard-auth/src/main/java/io/dropwizard/auth/CachingAuthorizer.java | CachingAuthorizer.invalidate | public void invalidate(P principal, String role) {
"""
Discards any cached role associations for the given principal and role.
@param principal
@param role
"""
cache.invalidate(ImmutablePair.of(principal, role));
} | java | public void invalidate(P principal, String role) {
cache.invalidate(ImmutablePair.of(principal, role));
} | [
"public",
"void",
"invalidate",
"(",
"P",
"principal",
",",
"String",
"role",
")",
"{",
"cache",
".",
"invalidate",
"(",
"ImmutablePair",
".",
"of",
"(",
"principal",
",",
"role",
")",
")",
";",
"}"
] | Discards any cached role associations for the given principal and role.
@param principal
@param role | [
"Discards",
"any",
"cached",
"role",
"associations",
"for",
"the",
"given",
"principal",
"and",
"role",
"."
] | train | https://github.com/dropwizard/dropwizard/blob/7ee09a410476b9681e8072ab684788bb440877bd/dropwizard-auth/src/main/java/io/dropwizard/auth/CachingAuthorizer.java#L108-L110 |
playframework/netty-reactive-streams | netty-reactive-streams-http/src/main/java/com/typesafe/netty/http/HttpStreamsHandler.java | HttpStreamsHandler.removeHandlerIfActive | private void removeHandlerIfActive(ChannelHandlerContext ctx, String name) {
"""
Most operations we want to do even if the channel is not active, because if it's not, then we want to encounter
the error that occurs when that operation happens and so that it can be passed up to the user. However, removing
handler... | java | private void removeHandlerIfActive(ChannelHandlerContext ctx, String name) {
if (ctx.channel().isActive()) {
ctx.pipeline().remove(name);
}
} | [
"private",
"void",
"removeHandlerIfActive",
"(",
"ChannelHandlerContext",
"ctx",
",",
"String",
"name",
")",
"{",
"if",
"(",
"ctx",
".",
"channel",
"(",
")",
".",
"isActive",
"(",
")",
")",
"{",
"ctx",
".",
"pipeline",
"(",
")",
".",
"remove",
"(",
"na... | Most operations we want to do even if the channel is not active, because if it's not, then we want to encounter
the error that occurs when that operation happens and so that it can be passed up to the user. However, removing
handlers should only be done if the channel is active, because the error that is encountered wh... | [
"Most",
"operations",
"we",
"want",
"to",
"do",
"even",
"if",
"the",
"channel",
"is",
"not",
"active",
"because",
"if",
"it",
"s",
"not",
"then",
"we",
"want",
"to",
"encounter",
"the",
"error",
"that",
"occurs",
"when",
"that",
"operation",
"happens",
"... | train | https://github.com/playframework/netty-reactive-streams/blob/860052d5d95164bf02af017eb97e59eaef61de14/netty-reactive-streams-http/src/main/java/com/typesafe/netty/http/HttpStreamsHandler.java#L326-L330 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UScriptRun.java | UScriptRun.sameScript | private static boolean sameScript(int scriptOne, int scriptTwo) {
"""
Compare two script codes to see if they are in the same script. If one script is
a strong script, and the other is INHERITED or COMMON, it will compare equal.
@param scriptOne one of the script codes.
@param scriptTwo the other script code.... | java | private static boolean sameScript(int scriptOne, int scriptTwo)
{
return scriptOne <= UScript.INHERITED || scriptTwo <= UScript.INHERITED || scriptOne == scriptTwo;
} | [
"private",
"static",
"boolean",
"sameScript",
"(",
"int",
"scriptOne",
",",
"int",
"scriptTwo",
")",
"{",
"return",
"scriptOne",
"<=",
"UScript",
".",
"INHERITED",
"||",
"scriptTwo",
"<=",
"UScript",
".",
"INHERITED",
"||",
"scriptOne",
"==",
"scriptTwo",
";",... | Compare two script codes to see if they are in the same script. If one script is
a strong script, and the other is INHERITED or COMMON, it will compare equal.
@param scriptOne one of the script codes.
@param scriptTwo the other script code.
@return <code>true</code> if the two scripts are the same.
@see android.icu.la... | [
"Compare",
"two",
"script",
"codes",
"to",
"see",
"if",
"they",
"are",
"in",
"the",
"same",
"script",
".",
"If",
"one",
"script",
"is",
"a",
"strong",
"script",
"and",
"the",
"other",
"is",
"INHERITED",
"or",
"COMMON",
"it",
"will",
"compare",
"equal",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/lang/UScriptRun.java#L418-L421 |
atomix/catalyst | concurrent/src/main/java/io/atomix/catalyst/concurrent/Runnables.java | Runnables.logFailure | static Runnable logFailure(final Runnable runnable, Logger logger) {
"""
Returns a wrapped runnable that logs and rethrows uncaught exceptions.
"""
return () -> {
try {
runnable.run();
} catch (Throwable t) {
if (!(t instanceof RejectedExecutionException)) {
logger.err... | java | static Runnable logFailure(final Runnable runnable, Logger logger) {
return () -> {
try {
runnable.run();
} catch (Throwable t) {
if (!(t instanceof RejectedExecutionException)) {
logger.error("An uncaught exception occurred", t);
}
throw t;
}
};
} | [
"static",
"Runnable",
"logFailure",
"(",
"final",
"Runnable",
"runnable",
",",
"Logger",
"logger",
")",
"{",
"return",
"(",
")",
"->",
"{",
"try",
"{",
"runnable",
".",
"run",
"(",
")",
";",
"}",
"catch",
"(",
"Throwable",
"t",
")",
"{",
"if",
"(",
... | Returns a wrapped runnable that logs and rethrows uncaught exceptions. | [
"Returns",
"a",
"wrapped",
"runnable",
"that",
"logs",
"and",
"rethrows",
"uncaught",
"exceptions",
"."
] | train | https://github.com/atomix/catalyst/blob/140e762cb975cd8ee1fd85119043c5b8bf917c5c/concurrent/src/main/java/io/atomix/catalyst/concurrent/Runnables.java#L17-L28 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java | AbstractOutputWriter.getLongSetting | protected long getLongSetting(String name, long defaultValue) throws IllegalArgumentException {
"""
Convert value of this setting to a Java <b>long</b>.
If the property is not found, the <code>defaultValue</code> is returned. If the property is not a long, an exception is thrown.
@param name name of ... | java | protected long getLongSetting(String name, long defaultValue) throws IllegalArgumentException {
if (settings.containsKey(name)) {
String value = settings.get(name).toString();
try {
return Long.parseLong(value);
} catch (Exception e) {
throw n... | [
"protected",
"long",
"getLongSetting",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"settings",
".",
"containsKey",
"(",
"name",
")",
")",
"{",
"String",
"value",
"=",
"settings",
".",
"get",
... | Convert value of this setting to a Java <b>long</b>.
If the property is not found, the <code>defaultValue</code> is returned. If the property is not a long, an exception is thrown.
@param name name of the property
@param defaultValue default value if the property is not defined.
@return int value of the prope... | [
"Convert",
"value",
"of",
"this",
"setting",
"to",
"a",
"Java",
"<b",
">",
"long<",
"/",
"b",
">",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/AbstractOutputWriter.java#L131-L143 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/util/MathUtils.java | MathUtils.rootMeansSquaredError | public static double rootMeansSquaredError(double[] real, double[] predicted) {
"""
This returns the root mean squared error of two data sets
@param real the real values
@param predicted the predicted values
@return the root means squared error for two data sets
"""
double ret = 0.0;
for (in... | java | public static double rootMeansSquaredError(double[] real, double[] predicted) {
double ret = 0.0;
for (int i = 0; i < real.length; i++) {
ret += Math.pow((real[i] - predicted[i]), 2);
}
return Math.sqrt(ret / real.length);
} | [
"public",
"static",
"double",
"rootMeansSquaredError",
"(",
"double",
"[",
"]",
"real",
",",
"double",
"[",
"]",
"predicted",
")",
"{",
"double",
"ret",
"=",
"0.0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"real",
".",
"length",
";",
"... | This returns the root mean squared error of two data sets
@param real the real values
@param predicted the predicted values
@return the root means squared error for two data sets | [
"This",
"returns",
"the",
"root",
"mean",
"squared",
"error",
"of",
"two",
"data",
"sets"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nearestneighbors-parent/nearestneighbor-core/src/main/java/org/deeplearning4j/clustering/util/MathUtils.java#L728-L734 |
UrielCh/ovh-java-sdk | ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java | ApiOvhSms.serviceName_receivers_slotId_PUT | public void serviceName_receivers_slotId_PUT(String serviceName, Long slotId, OvhReceiver body) throws IOException {
"""
Alter this object properties
REST: PUT /sms/{serviceName}/receivers/{slotId}
@param body [required] New object properties
@param serviceName [required] The internal name of your SMS offer
... | java | public void serviceName_receivers_slotId_PUT(String serviceName, Long slotId, OvhReceiver body) throws IOException {
String qPath = "/sms/{serviceName}/receivers/{slotId}";
StringBuilder sb = path(qPath, serviceName, slotId);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_receivers_slotId_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"slotId",
",",
"OvhReceiver",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/sms/{serviceName}/receivers/{slotId}\"",
";",
"StringBuilder",
"sb",
"="... | Alter this object properties
REST: PUT /sms/{serviceName}/receivers/{slotId}
@param body [required] New object properties
@param serviceName [required] The internal name of your SMS offer
@param slotId [required] Slot number id | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-sms/src/main/java/net/minidev/ovh/api/ApiOvhSms.java#L560-L564 |
ow2-chameleon/fuchsia | importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java | ZWaveController.handleSerialApiGetInitDataResponse | private void handleSerialApiGetInitDataResponse(
SerialMessage incomingMessage) {
"""
Handles the response of the SerialApiGetInitData request.
@param incomingMlivessage the response message to process.
"""
logger.debug(String.format("Got MessageSerialApiGetInitData response."));
this.isConnected = tru... | java | private void handleSerialApiGetInitDataResponse(
SerialMessage incomingMessage) {
logger.debug(String.format("Got MessageSerialApiGetInitData response."));
this.isConnected = true;
int nodeBytes = incomingMessage.getMessagePayloadByte(2);
if (nodeBytes != NODE_BYTES) {
logger.error("Invalid number of n... | [
"private",
"void",
"handleSerialApiGetInitDataResponse",
"(",
"SerialMessage",
"incomingMessage",
")",
"{",
"logger",
".",
"debug",
"(",
"String",
".",
"format",
"(",
"\"Got MessageSerialApiGetInitData response.\"",
")",
")",
";",
"this",
".",
"isConnected",
"=",
"tru... | Handles the response of the SerialApiGetInitData request.
@param incomingMlivessage the response message to process. | [
"Handles",
"the",
"response",
"of",
"the",
"SerialApiGetInitData",
"request",
"."
] | train | https://github.com/ow2-chameleon/fuchsia/blob/4e9318eadbdeb945e529789f573b45386e619bed/importers/zwave/src/main/java/org/ow2/chameleon/fuchsia/importer/zwave/internal/protocol/ZWaveController.java#L490-L525 |
rometools/rome | rome-propono/src/main/java/com/rometools/propono/atom/server/AtomServlet.java | AtomServlet.doPut | @Override
protected void doPut(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
"""
Handles an Atom PUT by calling handler to identify URI, reading/parsing data, calling handler
and writing results to response.
"""
LOG.debug("Entering");
f... | java | @Override
protected void doPut(final HttpServletRequest req, final HttpServletResponse res) throws ServletException, IOException {
LOG.debug("Entering");
final AtomHandler handler = createAtomRequestHandler(req, res);
final String userName = handler.getAuthenticatedUsername();
if (us... | [
"@",
"Override",
"protected",
"void",
"doPut",
"(",
"final",
"HttpServletRequest",
"req",
",",
"final",
"HttpServletResponse",
"res",
")",
"throws",
"ServletException",
",",
"IOException",
"{",
"LOG",
".",
"debug",
"(",
"\"Entering\"",
")",
";",
"final",
"AtomHa... | Handles an Atom PUT by calling handler to identify URI, reading/parsing data, calling handler
and writing results to response. | [
"Handles",
"an",
"Atom",
"PUT",
"by",
"calling",
"handler",
"to",
"identify",
"URI",
"reading",
"/",
"parsing",
"data",
"calling",
"handler",
"and",
"writing",
"results",
"to",
"response",
"."
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome-propono/src/main/java/com/rometools/propono/atom/server/AtomServlet.java#L279-L322 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/AbstractView.java | AbstractView.addHandler | private void addHandler(final Animation animation, final Annotation annotation) throws CoreException {
"""
Add an event handler on the given animation according to annotation OnFinished.
@param animation the animation, must be not null
@param annotation the OnXxxx annotation (only OnFinished is supported)
@... | java | private void addHandler(final Animation animation, final Annotation annotation) throws CoreException {
// Build the auto event handler for this annotation
final AnnotationEventHandler<ActionEvent> aeh = new AnnotationEventHandler<>(this.callbackObject, annotation);
// Only on event type
... | [
"private",
"void",
"addHandler",
"(",
"final",
"Animation",
"animation",
",",
"final",
"Annotation",
"annotation",
")",
"throws",
"CoreException",
"{",
"// Build the auto event handler for this annotation",
"final",
"AnnotationEventHandler",
"<",
"ActionEvent",
">",
"aeh",
... | Add an event handler on the given animation according to annotation OnFinished.
@param animation the animation, must be not null
@param annotation the OnXxxx annotation (only OnFinished is supported)
@throws CoreException if an error occurred while linking the event handler | [
"Add",
"an",
"event",
"handler",
"on",
"the",
"given",
"animation",
"according",
"to",
"annotation",
"OnFinished",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/ui/AbstractView.java#L353-L360 |
lotaris/jee-validation | src/main/java/com/lotaris/jee/validation/preprocessing/ModifiersPreprocessor.java | ModifiersPreprocessor.fillCache | private synchronized static void fillCache(Class objectClass, Map<Class<? extends Annotation>, IModifier> processors) {
"""
Fills the annotation cache for the specified class. This scans all fields of the class and
checks if they have modifier annotations. This information is saved in a synchronized static
cache... | java | private synchronized static void fillCache(Class objectClass, Map<Class<? extends Annotation>, IModifier> processors) {
if (cache.containsKey(objectClass)) {
return;
}
final Map<Field, Set<Class<? extends Annotation>>> classCache = new HashMap<>();
cache.put(objectClass, classCache);
// for each field..... | [
"private",
"synchronized",
"static",
"void",
"fillCache",
"(",
"Class",
"objectClass",
",",
"Map",
"<",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
",",
"IModifier",
">",
"processors",
")",
"{",
"if",
"(",
"cache",
".",
"containsKey",
"(",
"objectClass"... | Fills the annotation cache for the specified class. This scans all fields of the class and
checks if they have modifier annotations. This information is saved in a synchronized static
cache.
@param objectClass the class to scan for preprocessing annotations
@param processors the map of registered preprocessors (the ma... | [
"Fills",
"the",
"annotation",
"cache",
"for",
"the",
"specified",
"class",
".",
"This",
"scans",
"all",
"fields",
"of",
"the",
"class",
"and",
"checks",
"if",
"they",
"have",
"modifier",
"annotations",
".",
"This",
"information",
"is",
"saved",
"in",
"a",
... | train | https://github.com/lotaris/jee-validation/blob/feefff820b5a67c7471a13e08fdaf2d60bb3ad16/src/main/java/com/lotaris/jee/validation/preprocessing/ModifiersPreprocessor.java#L42-L70 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java | XClassUtils.getXMethod | @Nullable
public static XMethod getXMethod(String slashedClassName, String methodName, String methodSig) {
"""
Looks for the method up the class hierarchy.
@param slashedClassName
the class slashed name where to look for the method
@param methodName
the name of the method to look for
@param methodSig
t... | java | @Nullable
public static XMethod getXMethod(String slashedClassName, String methodName, String methodSig) {
final XClass xClass = getXClass(slashedClassName);
return getXMethod(xClass, methodName, methodSig);
} | [
"@",
"Nullable",
"public",
"static",
"XMethod",
"getXMethod",
"(",
"String",
"slashedClassName",
",",
"String",
"methodName",
",",
"String",
"methodSig",
")",
"{",
"final",
"XClass",
"xClass",
"=",
"getXClass",
"(",
"slashedClassName",
")",
";",
"return",
"getXM... | Looks for the method up the class hierarchy.
@param slashedClassName
the class slashed name where to look for the method
@param methodName
the name of the method to look for
@param methodSig
the signature of the method to look for
@return the method | [
"Looks",
"for",
"the",
"method",
"up",
"the",
"class",
"hierarchy",
"."
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/XClassUtils.java#L112-L116 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsCore.java | OpenCmsCore.initCmsObjectFromSession | protected CmsObject initCmsObjectFromSession(HttpServletRequest req) throws CmsException {
"""
Initializes a new cms object from the session data of the request.<p>
If no session data is found, <code>null</code> is returned.<p>
@param req the request
@return the new initialized cms object
@throws CmsEx... | java | protected CmsObject initCmsObjectFromSession(HttpServletRequest req) throws CmsException {
String url = req.getRequestURL().toString();
String p = "[ " + url + " ] ";
if (LOG.isDebugEnabled()) {
LOG.debug(p + "Trying to init cms object from session for request \"" + req.toString() +... | [
"protected",
"CmsObject",
"initCmsObjectFromSession",
"(",
"HttpServletRequest",
"req",
")",
"throws",
"CmsException",
"{",
"String",
"url",
"=",
"req",
".",
"getRequestURL",
"(",
")",
".",
"toString",
"(",
")",
";",
"String",
"p",
"=",
"\"[ \"",
"+",
"url",
... | Initializes a new cms object from the session data of the request.<p>
If no session data is found, <code>null</code> is returned.<p>
@param req the request
@return the new initialized cms object
@throws CmsException if something goes wrong | [
"Initializes",
"a",
"new",
"cms",
"object",
"from",
"the",
"session",
"data",
"of",
"the",
"request",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsCore.java#L1217-L1255 |
atomix/atomix | utils/src/main/java/io/atomix/utils/concurrent/Retries.java | Retries.randomDelay | public static void randomDelay(int ms) {
"""
Suspends the current thread for a random number of millis between 0 and
the indicated limit.
@param ms max number of millis
"""
try {
Thread.sleep(ThreadLocalRandom.current().nextInt(ms));
} catch (InterruptedException e) {
throw new RuntimeE... | java | public static void randomDelay(int ms) {
try {
Thread.sleep(ThreadLocalRandom.current().nextInt(ms));
} catch (InterruptedException e) {
throw new RuntimeException("Interrupted", e);
}
} | [
"public",
"static",
"void",
"randomDelay",
"(",
"int",
"ms",
")",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"ThreadLocalRandom",
".",
"current",
"(",
")",
".",
"nextInt",
"(",
"ms",
")",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")"... | Suspends the current thread for a random number of millis between 0 and
the indicated limit.
@param ms max number of millis | [
"Suspends",
"the",
"current",
"thread",
"for",
"a",
"random",
"number",
"of",
"millis",
"between",
"0",
"and",
"the",
"indicated",
"limit",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/utils/src/main/java/io/atomix/utils/concurrent/Retries.java#L71-L77 |
h2oai/h2o-2 | src/main/java/hex/deeplearning/DeepLearningTask2.java | DeepLearningTask2.lcompute | @Override
public void lcompute() {
"""
Do the local computation: Perform one DeepLearningTask (with run_local=true) iteration.
Pass over all the data (will be replicated in dfork() here), and use _sync_fraction random rows.
This calls DeepLearningTask's reduce() between worker threads that update the same loca... | java | @Override
public void lcompute() {
_res = new DeepLearningTask(_model_info, _sync_fraction);
_res.setCompleter(this);
_res.asyncExec(0, _fr, true /*run_local*/);
} | [
"@",
"Override",
"public",
"void",
"lcompute",
"(",
")",
"{",
"_res",
"=",
"new",
"DeepLearningTask",
"(",
"_model_info",
",",
"_sync_fraction",
")",
";",
"_res",
".",
"setCompleter",
"(",
"this",
")",
";",
"_res",
".",
"asyncExec",
"(",
"0",
",",
"_fr",... | Do the local computation: Perform one DeepLearningTask (with run_local=true) iteration.
Pass over all the data (will be replicated in dfork() here), and use _sync_fraction random rows.
This calls DeepLearningTask's reduce() between worker threads that update the same local model_info via Hogwild!
Once the computation i... | [
"Do",
"the",
"local",
"computation",
":",
"Perform",
"one",
"DeepLearningTask",
"(",
"with",
"run_local",
"=",
"true",
")",
"iteration",
".",
"Pass",
"over",
"all",
"the",
"data",
"(",
"will",
"be",
"replicated",
"in",
"dfork",
"()",
"here",
")",
"and",
... | train | https://github.com/h2oai/h2o-2/blob/be350f3f2c2fb6f135cc07c41f83fd0e4f521ac1/src/main/java/hex/deeplearning/DeepLearningTask2.java#L43-L48 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_updateFlagsOnAllAccounts_POST | public void organizationName_service_exchangeService_updateFlagsOnAllAccounts_POST(String organizationName, String exchangeService) throws IOException {
"""
Update spam and virus flags on all active accounts
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/updateFlagsOnAllAccounts
@param... | java | public void organizationName_service_exchangeService_updateFlagsOnAllAccounts_POST(String organizationName, String exchangeService) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/updateFlagsOnAllAccounts";
StringBuilder sb = path(qPath, organizationName, exchangeSe... | [
"public",
"void",
"organizationName_service_exchangeService_updateFlagsOnAllAccounts_POST",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/exchange/{organizationName}/service/{exchangeService}/... | Update spam and virus flags on all active accounts
REST: POST /email/exchange/{organizationName}/service/{exchangeService}/updateFlagsOnAllAccounts
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange service | [
"Update",
"spam",
"and",
"virus",
"flags",
"on",
"all",
"active",
"accounts"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L294-L298 |
CubeEngine/Dirigent | src/main/java/org/cubeengine/dirigent/AbstractDirigent.java | AbstractDirigent.applyPostProcessors | private Component applyPostProcessors(Component in, Context context, Arguments args) {
"""
Executes all attached {@link PostProcessor}s to process the specified {@link Component}.
@param in The component to process.
@param context The compose context.
@param args The macro arguments.
@return The processed ... | java | private Component applyPostProcessors(Component in, Context context, Arguments args)
{
Component out = in;
for (final PostProcessor postProcessor : postProcessors)
{
out = postProcessor.process(out, context, args);
}
return out;
} | [
"private",
"Component",
"applyPostProcessors",
"(",
"Component",
"in",
",",
"Context",
"context",
",",
"Arguments",
"args",
")",
"{",
"Component",
"out",
"=",
"in",
";",
"for",
"(",
"final",
"PostProcessor",
"postProcessor",
":",
"postProcessors",
")",
"{",
"o... | Executes all attached {@link PostProcessor}s to process the specified {@link Component}.
@param in The component to process.
@param context The compose context.
@param args The macro arguments.
@return The processed component. | [
"Executes",
"all",
"attached",
"{",
"@link",
"PostProcessor",
"}",
"s",
"to",
"process",
"the",
"specified",
"{",
"@link",
"Component",
"}",
"."
] | train | https://github.com/CubeEngine/Dirigent/blob/68587a8202754a6a6b629cc15e14c516806badaa/src/main/java/org/cubeengine/dirigent/AbstractDirigent.java#L254-L264 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsDiagnosticModule.java | CommsDiagnosticModule.ffdcDumpDefault | public void ffdcDumpDefault(Throwable t, IncidentStream is, Object callerThis, Object[] objs, String sourceId) {
"""
Called when an FFDC is generated and the stack matches one of our packages.
@see com.ibm.ws.sib.utils.ffdc.SibDiagnosticModule#ffdcDumpDefault(java.lang.Throwable, com.ibm.ws.ffdc.IncidentStream,... | java | public void ffdcDumpDefault(Throwable t, IncidentStream is, Object callerThis, Object[] objs, String sourceId)
{
if (tc.isEntryEnabled()) SibTr.entry(this, tc, "ffdcDumpDefault",
new Object[]{t, is, callerThis, objs, sourceId});
// Dump the SIB informat... | [
"public",
"void",
"ffdcDumpDefault",
"(",
"Throwable",
"t",
",",
"IncidentStream",
"is",
",",
"Object",
"callerThis",
",",
"Object",
"[",
"]",
"objs",
",",
"String",
"sourceId",
")",
"{",
"if",
"(",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".... | Called when an FFDC is generated and the stack matches one of our packages.
@see com.ibm.ws.sib.utils.ffdc.SibDiagnosticModule#ffdcDumpDefault(java.lang.Throwable, com.ibm.ws.ffdc.IncidentStream, java.lang.Object, java.lang.Object[], java.lang.String) | [
"Called",
"when",
"an",
"FFDC",
"is",
"generated",
"and",
"the",
"stack",
"matches",
"one",
"of",
"our",
"packages",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsDiagnosticModule.java#L111-L126 |
apache/groovy | src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java | GenericsUtils.parameterizeSAM | public static Tuple2<ClassNode[], ClassNode> parameterizeSAM(ClassNode sam) {
"""
Get the parameter and return types of the abstract method of SAM
If the abstract method is not parameterized, we will get generics placeholders, e.g. T, U
For example, the abstract method of {@link java.util.function.Function} is... | java | public static Tuple2<ClassNode[], ClassNode> parameterizeSAM(ClassNode sam) {
MethodNode methodNode = ClassHelper.findSAM(sam);
final Map<GenericsType, GenericsType> map = makeDeclaringAndActualGenericsTypeMapOfExactType(methodNode.getDeclaringClass(), sam);
ClassNode[] parameterTypes =
... | [
"public",
"static",
"Tuple2",
"<",
"ClassNode",
"[",
"]",
",",
"ClassNode",
">",
"parameterizeSAM",
"(",
"ClassNode",
"sam",
")",
"{",
"MethodNode",
"methodNode",
"=",
"ClassHelper",
".",
"findSAM",
"(",
"sam",
")",
";",
"final",
"Map",
"<",
"GenericsType",
... | Get the parameter and return types of the abstract method of SAM
If the abstract method is not parameterized, we will get generics placeholders, e.g. T, U
For example, the abstract method of {@link java.util.function.Function} is
<pre>
R apply(T t);
</pre>
We parameterize the above interface as {@code Function<String... | [
"Get",
"the",
"parameter",
"and",
"return",
"types",
"of",
"the",
"abstract",
"method",
"of",
"SAM"
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/ast/tools/GenericsUtils.java#L961-L982 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java | CommerceRegionPersistenceImpl.removeByUUID_G | @Override
public CommerceRegion removeByUUID_G(String uuid, long groupId)
throws NoSuchRegionException {
"""
Removes the commerce region where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the commerce region that was removed
"""
Commerce... | java | @Override
public CommerceRegion removeByUUID_G(String uuid, long groupId)
throws NoSuchRegionException {
CommerceRegion commerceRegion = findByUUID_G(uuid, groupId);
return remove(commerceRegion);
} | [
"@",
"Override",
"public",
"CommerceRegion",
"removeByUUID_G",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"NoSuchRegionException",
"{",
"CommerceRegion",
"commerceRegion",
"=",
"findByUUID_G",
"(",
"uuid",
",",
"groupId",
")",
";",
"return",
"re... | Removes the commerce region where uuid = ? and groupId = ? from the database.
@param uuid the uuid
@param groupId the group ID
@return the commerce region that was removed | [
"Removes",
"the",
"commerce",
"region",
"where",
"uuid",
"=",
"?",
";",
"and",
"groupId",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceRegionPersistenceImpl.java#L811-L817 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.getOneDomainPlayCount | public GetOneDomainPlayCountResponse getOneDomainPlayCount(GetOneDomainStatisticsRequest request) {
"""
get one domain's play count statistics in the live stream service.
@param request The request object containing all options for getting one domain's play count statistics
@return the response
"""
... | java | public GetOneDomainPlayCountResponse getOneDomainPlayCount(GetOneDomainStatisticsRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkNotNull(request.getDomain(), "The domain parameter can not be null");
checkStringNotEmpty(request.getTimeInterval(), "time... | [
"public",
"GetOneDomainPlayCountResponse",
"getOneDomainPlayCount",
"(",
"GetOneDomainStatisticsRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkNotNull",
"(",
"request",
".",
"getDomain",
"("... | get one domain's play count statistics in the live stream service.
@param request The request object containing all options for getting one domain's play count statistics
@return the response | [
"get",
"one",
"domain",
"s",
"play",
"count",
"statistics",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1875-L1891 |
Azure/azure-sdk-for-java | resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ResourceGroupsInner.java | ResourceGroupsInner.createOrUpdateAsync | public Observable<ResourceGroupInner> createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) {
"""
Creates a resource group.
@param resourceGroupName The name of the resource group to create or update.
@param parameters Parameters supplied to the create or update a resource group.
@throw... | java | public Observable<ResourceGroupInner> createOrUpdateAsync(String resourceGroupName, ResourceGroupInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, parameters).map(new Func1<ServiceResponse<ResourceGroupInner>, ResourceGroupInner>() {
@Override
public Re... | [
"public",
"Observable",
"<",
"ResourceGroupInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"ResourceGroupInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"parameters",
")",
".",
... | Creates a resource group.
@param resourceGroupName The name of the resource group to create or update.
@param parameters Parameters supplied to the create or update a resource group.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ResourceGroupInner object | [
"Creates",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/resources/v2016_09_01/implementation/ResourceGroupsInner.java#L470-L477 |
brianwhu/xillium | base/src/main/java/org/xillium/base/beans/Strings.java | Strings.substringAfter | public static String substringAfter(String text, char match) {
"""
Returns the substring following a given character, or the original if the character is not found.
@param text - a text string
@param match - a match character
@return the substring
"""
return text.substring(text.indexOf(match)+1);
... | java | public static String substringAfter(String text, char match) {
return text.substring(text.indexOf(match)+1);
} | [
"public",
"static",
"String",
"substringAfter",
"(",
"String",
"text",
",",
"char",
"match",
")",
"{",
"return",
"text",
".",
"substring",
"(",
"text",
".",
"indexOf",
"(",
"match",
")",
"+",
"1",
")",
";",
"}"
] | Returns the substring following a given character, or the original if the character is not found.
@param text - a text string
@param match - a match character
@return the substring | [
"Returns",
"the",
"substring",
"following",
"a",
"given",
"character",
"or",
"the",
"original",
"if",
"the",
"character",
"is",
"not",
"found",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/base/src/main/java/org/xillium/base/beans/Strings.java#L205-L207 |
marklogic/marklogic-sesame | marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java | MarkLogicClient.sendTupleQuery | public TupleQueryResult sendTupleQuery(String queryString,SPARQLQueryBindingSet bindings, long start, long pageLength, boolean includeInferred, String baseURI) throws RepositoryException, MalformedQueryException,
QueryInterruptedException {
"""
TupleQuery
@param queryString
@param bindings
@param start
@p... | java | public TupleQueryResult sendTupleQuery(String queryString,SPARQLQueryBindingSet bindings, long start, long pageLength, boolean includeInferred, String baseURI) throws RepositoryException, MalformedQueryException,
QueryInterruptedException {
InputStream stream = null;
try {
stream = getClient().performSPARQLQu... | [
"public",
"TupleQueryResult",
"sendTupleQuery",
"(",
"String",
"queryString",
",",
"SPARQLQueryBindingSet",
"bindings",
",",
"long",
"start",
",",
"long",
"pageLength",
",",
"boolean",
"includeInferred",
",",
"String",
"baseURI",
")",
"throws",
"RepositoryException",
... | TupleQuery
@param queryString
@param bindings
@param start
@param pageLength
@param includeInferred
@param baseURI
@return
@throws RepositoryException
@throws MalformedQueryException
@throws UnauthorizedException
@throws QueryInterruptedException | [
"TupleQuery"
] | train | https://github.com/marklogic/marklogic-sesame/blob/d5b668ed2b3d5e90c9f1d5096012813c272062a2/marklogic-sesame/src/main/java/com/marklogic/semantics/sesame/client/MarkLogicClient.java#L211-L224 |
Azure/azure-sdk-for-java | sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java | JobStepsInner.listByVersionAsync | public Observable<Page<JobStepInner>> listByVersionAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final int jobVersion) {
"""
Gets all job steps in the specified job version.
@param resourceGroupName The name of the resource group that contains th... | java | public Observable<Page<JobStepInner>> listByVersionAsync(final String resourceGroupName, final String serverName, final String jobAgentName, final String jobName, final int jobVersion) {
return listByVersionWithServiceResponseAsync(resourceGroupName, serverName, jobAgentName, jobName, jobVersion)
.m... | [
"public",
"Observable",
"<",
"Page",
"<",
"JobStepInner",
">",
">",
"listByVersionAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"serverName",
",",
"final",
"String",
"jobAgentName",
",",
"final",
"String",
"jobName",
",",
"final",
... | Gets all job steps in the specified job version.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param jobAgentName The name of the job agent.
@param jobName The n... | [
"Gets",
"all",
"job",
"steps",
"in",
"the",
"specified",
"job",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2017_03_01_preview/src/main/java/com/microsoft/azure/management/sql/v2017_03_01_preview/implementation/JobStepsInner.java#L156-L164 |
Sonoport/freesound-java | src/main/java/com/sonoport/freesound/FreesoundClient.java | FreesoundClient.buildAuthorisationCredential | private String buildAuthorisationCredential(final Query<?, ?> query) {
"""
Build the credential that will be passed in the 'Authorization' HTTP header as part of the API call. The nature
of the credential will depend on the query being made.
@param query The query being made
@return The string to pass in the ... | java | private String buildAuthorisationCredential(final Query<?, ?> query) {
String credential = null;
if (query instanceof OAuthQuery) {
final String oauthToken = ((OAuthQuery) query).getOauthToken();
credential = String.format("Bearer %s", oauthToken);
} else if (query instanceof AccessTokenQuery) {
// Don't... | [
"private",
"String",
"buildAuthorisationCredential",
"(",
"final",
"Query",
"<",
"?",
",",
"?",
">",
"query",
")",
"{",
"String",
"credential",
"=",
"null",
";",
"if",
"(",
"query",
"instanceof",
"OAuthQuery",
")",
"{",
"final",
"String",
"oauthToken",
"=",
... | Build the credential that will be passed in the 'Authorization' HTTP header as part of the API call. The nature
of the credential will depend on the query being made.
@param query The query being made
@return The string to pass in the Authorization header (or null if none) | [
"Build",
"the",
"credential",
"that",
"will",
"be",
"passed",
"in",
"the",
"Authorization",
"HTTP",
"header",
"as",
"part",
"of",
"the",
"API",
"call",
".",
"The",
"nature",
"of",
"the",
"credential",
"will",
"depend",
"on",
"the",
"query",
"being",
"made"... | train | https://github.com/Sonoport/freesound-java/blob/ab029e25de068c6f8cc028bc7f916938fd97c036/src/main/java/com/sonoport/freesound/FreesoundClient.java#L189-L201 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicStampedReference.java | AtomicStampedReference.attemptStamp | public boolean attemptStamp(V expectedReference, int newStamp) {
"""
Atomically sets the value of the stamp to the given update value
if the current reference is {@code ==} to the expected
reference. Any given invocation of this operation may fail
(return {@code false}) spuriously, but repeated invocation
whe... | java | public boolean attemptStamp(V expectedReference, int newStamp) {
Pair<V> current = pair;
return
expectedReference == current.reference &&
(newStamp == current.stamp ||
casPair(current, Pair.of(expectedReference, newStamp)));
} | [
"public",
"boolean",
"attemptStamp",
"(",
"V",
"expectedReference",
",",
"int",
"newStamp",
")",
"{",
"Pair",
"<",
"V",
">",
"current",
"=",
"pair",
";",
"return",
"expectedReference",
"==",
"current",
".",
"reference",
"&&",
"(",
"newStamp",
"==",
"current"... | Atomically sets the value of the stamp to the given update value
if the current reference is {@code ==} to the expected
reference. Any given invocation of this operation may fail
(return {@code false}) spuriously, but repeated invocation
when the current value holds the expected value and no other
thread is also attem... | [
"Atomically",
"sets",
"the",
"value",
"of",
"the",
"stamp",
"to",
"the",
"given",
"update",
"value",
"if",
"the",
"current",
"reference",
"is",
"{",
"@code",
"==",
"}",
"to",
"the",
"expected",
"reference",
".",
"Any",
"given",
"invocation",
"of",
"this",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/atomic/AtomicStampedReference.java#L183-L189 |
Quickhull3d/quickhull3d | src/main/java/com/github/quickhull3d/Face.java | Face.findEdge | public HalfEdge findEdge(Vertex vt, Vertex vh) {
"""
Finds the half-edge within this face which has tail <code>vt</code> and
head <code>vh</code>.
@param vt
tail point
@param vh
head point
@return the half-edge, or null if none is found.
"""
HalfEdge he = he0;
do {
if (he.he... | java | public HalfEdge findEdge(Vertex vt, Vertex vh) {
HalfEdge he = he0;
do {
if (he.head() == vh && he.tail() == vt) {
return he;
}
he = he.next;
} while (he != he0);
return null;
} | [
"public",
"HalfEdge",
"findEdge",
"(",
"Vertex",
"vt",
",",
"Vertex",
"vh",
")",
"{",
"HalfEdge",
"he",
"=",
"he0",
";",
"do",
"{",
"if",
"(",
"he",
".",
"head",
"(",
")",
"==",
"vh",
"&&",
"he",
".",
"tail",
"(",
")",
"==",
"vt",
")",
"{",
"... | Finds the half-edge within this face which has tail <code>vt</code> and
head <code>vh</code>.
@param vt
tail point
@param vh
head point
@return the half-edge, or null if none is found. | [
"Finds",
"the",
"half",
"-",
"edge",
"within",
"this",
"face",
"which",
"has",
"tail",
"<code",
">",
"vt<",
"/",
"code",
">",
"and",
"head",
"<code",
">",
"vh<",
"/",
"code",
">",
"."
] | train | https://github.com/Quickhull3d/quickhull3d/blob/3f80953b86c46385e84730e5d2a1745cbfa12703/src/main/java/com/github/quickhull3d/Face.java#L230-L239 |
gallandarakhneorg/afc | advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java | BusHub.addBusStop | boolean addBusStop(BusStop busStop, boolean fireEvents) {
"""
Add a bus stop inside the bus hub.
@param busStop is the bus stop to insert.
@param fireEvents indicates if the events should be fired and the validity checked.
@return <code>true</code> if the bus stop was added, otherwise <code>false</code>
"... | java | boolean addBusStop(BusStop busStop, boolean fireEvents) {
if (busStop == null) {
return false;
}
if (this.busStops.indexOf(busStop) != -1) {
return false;
}
if (!this.busStops.add(busStop)) {
return false;
}
busStop.addBusHub(this);
resetBoundingBox();
if (fireEvents) {
firePrimitiveChange... | [
"boolean",
"addBusStop",
"(",
"BusStop",
"busStop",
",",
"boolean",
"fireEvents",
")",
"{",
"if",
"(",
"busStop",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"busStops",
".",
"indexOf",
"(",
"busStop",
")",
"!=",
"-",
... | Add a bus stop inside the bus hub.
@param busStop is the bus stop to insert.
@param fireEvents indicates if the events should be fired and the validity checked.
@return <code>true</code> if the bus stop was added, otherwise <code>false</code> | [
"Add",
"a",
"bus",
"stop",
"inside",
"the",
"bus",
"hub",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisbus/src/main/java/org/arakhne/afc/gis/bus/network/BusHub.java#L377-L400 |
Ellzord/JALSE | src/main/java/jalse/entities/functions/Functions.java | Functions.returnTypeIs | public static boolean returnTypeIs(final Method m, final Class<?> clazz) {
"""
Whether the method return type matches the supplied type.
@param m
Method to check.
@param clazz
Possible return type to check.
@return Whether the actual return type matches the check type.
"""
return clazz.equals(toClass(m... | java | public static boolean returnTypeIs(final Method m, final Class<?> clazz) {
return clazz.equals(toClass(m.getGenericReturnType()));
} | [
"public",
"static",
"boolean",
"returnTypeIs",
"(",
"final",
"Method",
"m",
",",
"final",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"return",
"clazz",
".",
"equals",
"(",
"toClass",
"(",
"m",
".",
"getGenericReturnType",
"(",
")",
")",
")",
";",
"}"
] | Whether the method return type matches the supplied type.
@param m
Method to check.
@param clazz
Possible return type to check.
@return Whether the actual return type matches the check type. | [
"Whether",
"the",
"method",
"return",
"type",
"matches",
"the",
"supplied",
"type",
"."
] | train | https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/functions/Functions.java#L254-L256 |
vdmeer/asciitable | src/main/java/de/vandermeer/asciitable/AT_Context.java | AT_Context.setFrameLeftRightMargin | public AT_Context setFrameLeftRightMargin(int frameLeft, int frameRight) {
"""
Sets the left and right frame margin.
@param frameLeft margin
@param frameRight margin
@return this to allow chaining
"""
if(frameRight>-1 && frameLeft>-1){
this.frameLeftMargin = frameLeft;
this.frameRightMargin = fra... | java | public AT_Context setFrameLeftRightMargin(int frameLeft, int frameRight){
if(frameRight>-1 && frameLeft>-1){
this.frameLeftMargin = frameLeft;
this.frameRightMargin = frameRight;
}
return this;
} | [
"public",
"AT_Context",
"setFrameLeftRightMargin",
"(",
"int",
"frameLeft",
",",
"int",
"frameRight",
")",
"{",
"if",
"(",
"frameRight",
">",
"-",
"1",
"&&",
"frameLeft",
">",
"-",
"1",
")",
"{",
"this",
".",
"frameLeftMargin",
"=",
"frameLeft",
";",
"this... | Sets the left and right frame margin.
@param frameLeft margin
@param frameRight margin
@return this to allow chaining | [
"Sets",
"the",
"left",
"and",
"right",
"frame",
"margin",
"."
] | train | https://github.com/vdmeer/asciitable/blob/b6a73710271c89f9c749603be856ba84a969ed5f/src/main/java/de/vandermeer/asciitable/AT_Context.java#L243-L249 |
couchbase/couchbase-lite-java | src/main/java/com/couchbase/lite/Join.java | Join.innerJoin | @NonNull
public static On innerJoin(@NonNull DataSource datasource) {
"""
Create an INNER JOIN component with the given data source.
Use the returned On component to specify join conditions.
@param datasource The DataSource object of the JOIN clause.
@return The On object used for specifying join conditio... | java | @NonNull
public static On innerJoin(@NonNull DataSource datasource) {
if (datasource == null) {
throw new IllegalArgumentException("datasource cannot be null.");
}
return new On(Type.INNER, datasource);
} | [
"@",
"NonNull",
"public",
"static",
"On",
"innerJoin",
"(",
"@",
"NonNull",
"DataSource",
"datasource",
")",
"{",
"if",
"(",
"datasource",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"datasource cannot be null.\"",
")",
";",
"}",
... | Create an INNER JOIN component with the given data source.
Use the returned On component to specify join conditions.
@param datasource The DataSource object of the JOIN clause.
@return The On object used for specifying join conditions. | [
"Create",
"an",
"INNER",
"JOIN",
"component",
"with",
"the",
"given",
"data",
"source",
".",
"Use",
"the",
"returned",
"On",
"component",
"to",
"specify",
"join",
"conditions",
"."
] | train | https://github.com/couchbase/couchbase-lite-java/blob/cb72c44186456e6191a9ad0a7feb310011d0b081/src/main/java/com/couchbase/lite/Join.java#L112-L118 |
OpenLiberty/open-liberty | dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java | CDI12ContainerConfig.updateConfiguration | protected void updateConfiguration(Map<String, Object> properties) {
"""
Updates the current configuration properties
@param properties the updated configuration properties
"""
if (properties != null) {
this.properties.clear();
this.properties.putAll(properties);
}
... | java | protected void updateConfiguration(Map<String, Object> properties) {
if (properties != null) {
this.properties.clear();
this.properties.putAll(properties);
}
if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
Tr.debug(tc, "Current Properties: "... | [
"protected",
"void",
"updateConfiguration",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"properties",
"!=",
"null",
")",
"{",
"this",
".",
"properties",
".",
"clear",
"(",
")",
";",
"this",
".",
"properties",
".",
... | Updates the current configuration properties
@param properties the updated configuration properties | [
"Updates",
"the",
"current",
"configuration",
"properties"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.cdi.weld/src/com/ibm/ws/cdi/config/liberty/CDI12ContainerConfig.java#L126-L134 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java | BlockMetadataManager.getTempBlockMeta | public TempBlockMeta getTempBlockMeta(long blockId) throws BlockDoesNotExistException {
"""
Gets the metadata of a temp block.
@param blockId the id of the temp block
@return metadata of the block
@throws BlockDoesNotExistException when block id can not be found
"""
TempBlockMeta blockMeta = getTempBl... | java | public TempBlockMeta getTempBlockMeta(long blockId) throws BlockDoesNotExistException {
TempBlockMeta blockMeta = getTempBlockMetaOrNull(blockId);
if (blockMeta == null) {
throw new BlockDoesNotExistException(ExceptionMessage.TEMP_BLOCK_META_NOT_FOUND, blockId);
}
return blockMeta;
} | [
"public",
"TempBlockMeta",
"getTempBlockMeta",
"(",
"long",
"blockId",
")",
"throws",
"BlockDoesNotExistException",
"{",
"TempBlockMeta",
"blockMeta",
"=",
"getTempBlockMetaOrNull",
"(",
"blockId",
")",
";",
"if",
"(",
"blockMeta",
"==",
"null",
")",
"{",
"throw",
... | Gets the metadata of a temp block.
@param blockId the id of the temp block
@return metadata of the block
@throws BlockDoesNotExistException when block id can not be found | [
"Gets",
"the",
"metadata",
"of",
"a",
"temp",
"block",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/BlockMetadataManager.java#L252-L258 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/validate/ObjectComparator.java | ObjectComparator.areEqual | public static boolean areEqual(Object value1, Object value2) {
"""
Checks if two values are equal. The operation can be performed over values of
any type.
@param value1 the first value to compare
@param value2 the second value to compare
@return true if values are equal and false otherwise
"""
if (valu... | java | public static boolean areEqual(Object value1, Object value2) {
if (value1 == null && value2 == null)
return true;
if (value1 == null || value2 == null)
return false;
return value1.equals(value2);
} | [
"public",
"static",
"boolean",
"areEqual",
"(",
"Object",
"value1",
",",
"Object",
"value2",
")",
"{",
"if",
"(",
"value1",
"==",
"null",
"&&",
"value2",
"==",
"null",
")",
"return",
"true",
";",
"if",
"(",
"value1",
"==",
"null",
"||",
"value2",
"==",... | Checks if two values are equal. The operation can be performed over values of
any type.
@param value1 the first value to compare
@param value2 the second value to compare
@return true if values are equal and false otherwise | [
"Checks",
"if",
"two",
"values",
"are",
"equal",
".",
"The",
"operation",
"can",
"be",
"performed",
"over",
"values",
"of",
"any",
"type",
"."
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/validate/ObjectComparator.java#L59-L65 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.read | public static String read(InputStream is, int off, int len) throws IOException {
"""
读取输入流,需手动关闭流
@param is 输入流
@param off 偏移
@param len 长度
@return 内容
@throws IOException 异常
"""
byte[] bs = new byte[len];
is.read(bs, off, len);
return new String(bs);
} | java | public static String read(InputStream is, int off, int len) throws IOException {
byte[] bs = new byte[len];
is.read(bs, off, len);
return new String(bs);
} | [
"public",
"static",
"String",
"read",
"(",
"InputStream",
"is",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"bs",
"=",
"new",
"byte",
"[",
"len",
"]",
";",
"is",
".",
"read",
"(",
"bs",
",",
"off",
"... | 读取输入流,需手动关闭流
@param is 输入流
@param off 偏移
@param len 长度
@return 内容
@throws IOException 异常 | [
"读取输入流,需手动关闭流"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L355-L359 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java | FieldUtils.getField | public static Field getField(final Class<?> cls, final String fieldName) {
"""
Gets an accessible {@link Field} by name respecting scope. Superclasses/interfaces will be considered.
@param cls
the {@link Class} to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@return the Field ... | java | public static Field getField(final Class<?> cls, final String fieldName) {
final Field field = getField(cls, fieldName, false);
MemberUtils.setAccessibleWorkaround(field);
return field;
} | [
"public",
"static",
"Field",
"getField",
"(",
"final",
"Class",
"<",
"?",
">",
"cls",
",",
"final",
"String",
"fieldName",
")",
"{",
"final",
"Field",
"field",
"=",
"getField",
"(",
"cls",
",",
"fieldName",
",",
"false",
")",
";",
"MemberUtils",
".",
"... | Gets an accessible {@link Field} by name respecting scope. Superclasses/interfaces will be considered.
@param cls
the {@link Class} to reflect, must not be {@code null}
@param fieldName
the field name to obtain
@return the Field object
@throws IllegalArgumentException
if the class is {@code null}, or the field name is... | [
"Gets",
"an",
"accessible",
"{",
"@link",
"Field",
"}",
"by",
"name",
"respecting",
"scope",
".",
"Superclasses",
"/",
"interfaces",
"will",
"be",
"considered",
"."
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/reflect/FieldUtils.java#L65-L69 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java | AssertKripton.assertTrueOrUnknownParamInJQLException | public static void assertTrueOrUnknownParamInJQLException(boolean expression, SQLiteModelMethod method,
String paramName) {
"""
Assert true or unknown param in JQL exception.
@param expression
the expression
@param method
the method
@param paramName
the param name
"""
if (!expression) {
throw (... | java | public static void assertTrueOrUnknownParamInJQLException(boolean expression, SQLiteModelMethod method,
String paramName) {
if (!expression) {
throw (new UnknownParamUsedInJQLException(method, paramName));
}
} | [
"public",
"static",
"void",
"assertTrueOrUnknownParamInJQLException",
"(",
"boolean",
"expression",
",",
"SQLiteModelMethod",
"method",
",",
"String",
"paramName",
")",
"{",
"if",
"(",
"!",
"expression",
")",
"{",
"throw",
"(",
"new",
"UnknownParamUsedInJQLException",... | Assert true or unknown param in JQL exception.
@param expression
the expression
@param method
the method
@param paramName
the param name | [
"Assert",
"true",
"or",
"unknown",
"param",
"in",
"JQL",
"exception",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/AssertKripton.java#L292-L297 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java | SSOCookieHelperImpl.createLogoutCookies | @Override
public void createLogoutCookies(HttpServletRequest req, HttpServletResponse res, boolean deleteJwtCookies) {
"""
/*
1) If we have the custom cookie name, then delete just the custom cookie name
2) If we have the custom cookie name but no cookie found, then will delete the default cookie name LTPATo... | java | @Override
public void createLogoutCookies(HttpServletRequest req, HttpServletResponse res, boolean deleteJwtCookies) {
Cookie[] cookies = req.getCookies();
java.util.ArrayList<Cookie> logoutCookieList = new java.util.ArrayList<Cookie>();
if (cookies != null) {
String ssoCookieNam... | [
"@",
"Override",
"public",
"void",
"createLogoutCookies",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"boolean",
"deleteJwtCookies",
")",
"{",
"Cookie",
"[",
"]",
"cookies",
"=",
"req",
".",
"getCookies",
"(",
")",
";",
"java",
".... | /*
1) If we have the custom cookie name, then delete just the custom cookie name
2) If we have the custom cookie name but no cookie found, then will delete the default cookie name LTPAToken2
3) If jwtsso is active, clean up those cookies too. | [
"/",
"*",
"1",
")",
"If",
"we",
"have",
"the",
"custom",
"cookie",
"name",
"then",
"delete",
"just",
"the",
"custom",
"cookie",
"name",
"2",
")",
"If",
"we",
"have",
"the",
"custom",
"cookie",
"name",
"but",
"no",
"cookie",
"found",
"then",
"will",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer.security/src/com/ibm/ws/webcontainer/security/SSOCookieHelperImpl.java#L275-L295 |
kiegroup/jbpm | jbpm-human-task/jbpm-human-task-audit/src/main/java/org/jbpm/services/task/lifecycle/listeners/BAMTaskEventListener.java | BAMTaskEventListener.updateTask | protected BAMTaskSummaryImpl updateTask(TaskEvent event, BAMTaskWorker worker) {
"""
Creates or updates a bam task summary instance.
@param ti The source task
@param worker Perform additional operations to the bam task summary instance.
@return The created or updated bam task summary instance.
"""
... | java | protected BAMTaskSummaryImpl updateTask(TaskEvent event, BAMTaskWorker worker) {
return updateTask(event, null, worker);
} | [
"protected",
"BAMTaskSummaryImpl",
"updateTask",
"(",
"TaskEvent",
"event",
",",
"BAMTaskWorker",
"worker",
")",
"{",
"return",
"updateTask",
"(",
"event",
",",
"null",
",",
"worker",
")",
";",
"}"
] | Creates or updates a bam task summary instance.
@param ti The source task
@param worker Perform additional operations to the bam task summary instance.
@return The created or updated bam task summary instance. | [
"Creates",
"or",
"updates",
"a",
"bam",
"task",
"summary",
"instance",
"."
] | train | https://github.com/kiegroup/jbpm/blob/c3473c728aa382ebbea01e380c5e754a96647b82/jbpm-human-task/jbpm-human-task-audit/src/main/java/org/jbpm/services/task/lifecycle/listeners/BAMTaskEventListener.java#L184-L186 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.newWriter | public static BufferedWriter newWriter(File file, String charset, boolean append, boolean writeBom) throws IOException {
"""
Helper method to create a buffered writer for a file. If the given
charset is "UTF-16BE" or "UTF-16LE" (or an equivalent alias), the
requisite byte order mark is written to the stream bef... | java | public static BufferedWriter newWriter(File file, String charset, boolean append, boolean writeBom) throws IOException {
boolean shouldWriteBom = writeBom && !file.exists();
if (append) {
FileOutputStream stream = new FileOutputStream(file, append);
if (shouldWriteBom) {
... | [
"public",
"static",
"BufferedWriter",
"newWriter",
"(",
"File",
"file",
",",
"String",
"charset",
",",
"boolean",
"append",
",",
"boolean",
"writeBom",
")",
"throws",
"IOException",
"{",
"boolean",
"shouldWriteBom",
"=",
"writeBom",
"&&",
"!",
"file",
".",
"ex... | Helper method to create a buffered writer for a file. If the given
charset is "UTF-16BE" or "UTF-16LE" (or an equivalent alias), the
requisite byte order mark is written to the stream before the writer
is returned.
@param file a File
@param charset the name of the encoding used to write in this file
@param appen... | [
"Helper",
"method",
"to",
"create",
"a",
"buffered",
"writer",
"for",
"a",
"file",
".",
"If",
"the",
"given",
"charset",
"is",
"UTF",
"-",
"16BE",
"or",
"UTF",
"-",
"16LE",
"(",
"or",
"an",
"equivalent",
"alias",
")",
"the",
"requisite",
"byte",
"order... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1945-L1960 |
pac4j/pac4j | pac4j-http/src/main/java/org/pac4j/http/credentials/authenticator/RestAuthenticator.java | RestAuthenticator.callRestApi | protected String callRestApi(final String username, final String password) {
"""
Return the body from the REST API, passing the username/pasword auth.
To be overridden using another HTTP client if necessary.
@param username the username
@param password the password
@return the response body
"""
... | java | protected String callRestApi(final String username, final String password) {
final String basicAuth = Base64.getEncoder().encodeToString((username + ":" + password).getBytes(StandardCharsets.UTF_8));
final Map<String, String> headers = new HashMap<>();
headers.put(HttpConstants.AUTHORIZATION_HE... | [
"protected",
"String",
"callRestApi",
"(",
"final",
"String",
"username",
",",
"final",
"String",
"password",
")",
"{",
"final",
"String",
"basicAuth",
"=",
"Base64",
".",
"getEncoder",
"(",
")",
".",
"encodeToString",
"(",
"(",
"username",
"+",
"\":\"",
"+"... | Return the body from the REST API, passing the username/pasword auth.
To be overridden using another HTTP client if necessary.
@param username the username
@param password the password
@return the response body | [
"Return",
"the",
"body",
"from",
"the",
"REST",
"API",
"passing",
"the",
"username",
"/",
"pasword",
"auth",
".",
"To",
"be",
"overridden",
"using",
"another",
"HTTP",
"client",
"if",
"necessary",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-http/src/main/java/org/pac4j/http/credentials/authenticator/RestAuthenticator.java#L98-L123 |
Stratio/cassandra-lucene-index | plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/DateRangeMapper.java | DateRangeMapper.makeShape | public NRShape makeShape(Date from, Date to) {
"""
Makes an spatial shape representing the time range defined by the two specified dates.
@param from the start {@link Date}
@param to the end {@link Date}
@return a shape
"""
UnitNRShape fromShape = tree.toUnitShape(from);
UnitNRShape toShap... | java | public NRShape makeShape(Date from, Date to) {
UnitNRShape fromShape = tree.toUnitShape(from);
UnitNRShape toShape = tree.toUnitShape(to);
return tree.toRangeShape(fromShape, toShape);
} | [
"public",
"NRShape",
"makeShape",
"(",
"Date",
"from",
",",
"Date",
"to",
")",
"{",
"UnitNRShape",
"fromShape",
"=",
"tree",
".",
"toUnitShape",
"(",
"from",
")",
";",
"UnitNRShape",
"toShape",
"=",
"tree",
".",
"toUnitShape",
"(",
"to",
")",
";",
"retur... | Makes an spatial shape representing the time range defined by the two specified dates.
@param from the start {@link Date}
@param to the end {@link Date}
@return a shape | [
"Makes",
"an",
"spatial",
"shape",
"representing",
"the",
"time",
"range",
"defined",
"by",
"the",
"two",
"specified",
"dates",
"."
] | train | https://github.com/Stratio/cassandra-lucene-index/blob/a94a4d9af6c25d40e1108729974c35c27c54441c/plugin/src/main/java/com/stratio/cassandra/lucene/schema/mapping/DateRangeMapper.java#L123-L127 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java | OSMTablesFactory.dropOSMTables | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
"""
Drop the existing OSM tables used to store the imported OSM data
@param connection
@param isH2
@param tablePrefix
@throws SQLException
"""
TableLocation requestedTable = TableLocati... | java | public static void dropOSMTables(Connection connection, boolean isH2, String tablePrefix) throws SQLException {
TableLocation requestedTable = TableLocation.parse(tablePrefix, isH2);
String osmTableName = requestedTable.getTable();
String[] omsTables = new String[]{TAG, NODE, NODE_TAG, W... | [
"public",
"static",
"void",
"dropOSMTables",
"(",
"Connection",
"connection",
",",
"boolean",
"isH2",
",",
"String",
"tablePrefix",
")",
"throws",
"SQLException",
"{",
"TableLocation",
"requestedTable",
"=",
"TableLocation",
".",
"parse",
"(",
"tablePrefix",
",",
... | Drop the existing OSM tables used to store the imported OSM data
@param connection
@param isH2
@param tablePrefix
@throws SQLException | [
"Drop",
"the",
"existing",
"OSM",
"tables",
"used",
"to",
"store",
"the",
"imported",
"OSM",
"data"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/osm/OSMTablesFactory.java#L327-L343 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/translate/OcniExtractor.java | OcniExtractor.extractNativeCode | private OcniBlock extractNativeCode(TreeNode node) {
"""
Returns text from within a source code range, where that text is
surrounded by OCNI-like tokens ("/*-[" and "]-*/"), warning
if JSNI delimiters are found instead.
@param node The node in which to extract the native code.
@return the extracted t... | java | private OcniBlock extractNativeCode(TreeNode node) {
int offset = node.getStartPosition();
String text = unit.getSource().substring(offset, offset + node.getLength());
Matcher m = OCNI_PATTERN.matcher(text);
if (m.find()) {
String typeStr = m.group(1);
try {
OcniType type = OcniType.... | [
"private",
"OcniBlock",
"extractNativeCode",
"(",
"TreeNode",
"node",
")",
"{",
"int",
"offset",
"=",
"node",
".",
"getStartPosition",
"(",
")",
";",
"String",
"text",
"=",
"unit",
".",
"getSource",
"(",
")",
".",
"substring",
"(",
"offset",
",",
"offset",... | Returns text from within a source code range, where that text is
surrounded by OCNI-like tokens ("/*-[" and "]-*/"), warning
if JSNI delimiters are found instead.
@param node The node in which to extract the native code.
@return the extracted text between the OCNI delimiters, or null if
a pair of JSNI delimite... | [
"Returns",
"text",
"from",
"within",
"a",
"source",
"code",
"range",
"where",
"that",
"text",
"is",
"surrounded",
"by",
"OCNI",
"-",
"like",
"tokens",
"(",
"/",
"*",
";",
"-",
"[",
"and",
"]",
"-",
"*",
";",
"/",
")",
"warning",
"if",
"JSNI",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/translate/OcniExtractor.java#L292-L310 |
alibaba/Tangram-Android | tangram/src/main/java/com/tmall/wireless/tangram/support/TimerSupport.java | TimerSupport.register | public void register(int interval, @NonNull OnTickListener onTickListener, boolean intermediate) {
"""
onTickListener will store as weak reference, don't use anonymous class here
@param interval how many seconds of interval that the listener will be called in
@param onTickListener listener
@param interm... | java | public void register(int interval, @NonNull OnTickListener onTickListener, boolean intermediate) {
mDefaultTimer.register(interval, onTickListener, intermediate);
} | [
"public",
"void",
"register",
"(",
"int",
"interval",
",",
"@",
"NonNull",
"OnTickListener",
"onTickListener",
",",
"boolean",
"intermediate",
")",
"{",
"mDefaultTimer",
".",
"register",
"(",
"interval",
",",
"onTickListener",
",",
"intermediate",
")",
";",
"}"
... | onTickListener will store as weak reference, don't use anonymous class here
@param interval how many seconds of interval that the listener will be called in
@param onTickListener listener
@param intermediate whether execute onTick intermediately | [
"onTickListener",
"will",
"store",
"as",
"weak",
"reference",
"don",
"t",
"use",
"anonymous",
"class",
"here"
] | train | https://github.com/alibaba/Tangram-Android/blob/caa57f54e009c8dacd34a2322d5761956ebed321/tangram/src/main/java/com/tmall/wireless/tangram/support/TimerSupport.java#L66-L68 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SFStatement.java | SFStatement.getMoreResults | public boolean getMoreResults(int current) throws SQLException {
"""
Sets the result set to the next one, if available.
@param current What to do with the current result.
One of Statement.CLOSE_CURRENT_RESULT,
Statement.CLOSE_ALL_RESULTS, or
Statement.KEEP_CURRENT_RESULT
@return true if there is a next resu... | java | public boolean getMoreResults(int current) throws SQLException
{
// clean up current result, if exists
if (resultSet != null &&
(current == Statement.CLOSE_CURRENT_RESULT ||
current == Statement.CLOSE_ALL_RESULTS))
{
resultSet.close();
}
resultSet = null;
// verify if m... | [
"public",
"boolean",
"getMoreResults",
"(",
"int",
"current",
")",
"throws",
"SQLException",
"{",
"// clean up current result, if exists",
"if",
"(",
"resultSet",
"!=",
"null",
"&&",
"(",
"current",
"==",
"Statement",
".",
"CLOSE_CURRENT_RESULT",
"||",
"current",
"=... | Sets the result set to the next one, if available.
@param current What to do with the current result.
One of Statement.CLOSE_CURRENT_RESULT,
Statement.CLOSE_ALL_RESULTS, or
Statement.KEEP_CURRENT_RESULT
@return true if there is a next result and it's a result set
false if there are no more results, or there is a next ... | [
"Sets",
"the",
"result",
"set",
"to",
"the",
"next",
"one",
"if",
"available",
"."
] | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SFStatement.java#L877-L913 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java | CommsUtils.isRecoverable | public static boolean isRecoverable(final SIBusMessage mess, final Reliability maxUnrecoverableReliability) {
"""
Determines whether a message is recoverable compared to the supplied maxUnrecoverableReliability.
@param mess the message to check.
@para maxUnrecoverableReliability the most reliable reliability... | java | public static boolean isRecoverable(final SIBusMessage mess, final Reliability maxUnrecoverableReliability)
{
if(TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "isRecoverable", new Object[] {mess, maxUnrecoverableReliability});
final Reliability messageReliability = mess.ge... | [
"public",
"static",
"boolean",
"isRecoverable",
"(",
"final",
"SIBusMessage",
"mess",
",",
"final",
"Reliability",
"maxUnrecoverableReliability",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
"... | Determines whether a message is recoverable compared to the supplied maxUnrecoverableReliability.
@param mess the message to check.
@para maxUnrecoverableReliability the most reliable reliability that is considered unrecoverable in the context in which this method is executed.
@return true for any message which is m... | [
"Determines",
"whether",
"a",
"message",
"is",
"recoverable",
"compared",
"to",
"the",
"supplied",
"maxUnrecoverableReliability",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsUtils.java#L220-L232 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java | CommerceWarehouseItemPersistenceImpl.findAll | @Override
public List<CommerceWarehouseItem> findAll() {
"""
Returns all the commerce warehouse items.
@return the commerce warehouse items
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceWarehouseItem> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceWarehouseItem",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the commerce warehouse items.
@return the commerce warehouse items | [
"Returns",
"all",
"the",
"commerce",
"warehouse",
"items",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceWarehouseItemPersistenceImpl.java#L2062-L2065 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.fax_offers_GET | public ArrayList<OvhLineOffer> fax_offers_GET(OvhNumberCountryEnum country) throws IOException {
"""
Get all available fax offer compatible
REST: GET /telephony/fax/offers
@param country [required] The country
"""
String qPath = "/telephony/fax/offers";
StringBuilder sb = path(qPath);
query(sb, "coun... | java | public ArrayList<OvhLineOffer> fax_offers_GET(OvhNumberCountryEnum country) throws IOException {
String qPath = "/telephony/fax/offers";
StringBuilder sb = path(qPath);
query(sb, "country", country);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t15);
} | [
"public",
"ArrayList",
"<",
"OvhLineOffer",
">",
"fax_offers_GET",
"(",
"OvhNumberCountryEnum",
"country",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/fax/offers\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"que... | Get all available fax offer compatible
REST: GET /telephony/fax/offers
@param country [required] The country | [
"Get",
"all",
"available",
"fax",
"offer",
"compatible"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L8984-L8990 |
realtime-framework/RealtimeMessaging-Java | library/src/main/java/ibt/ortc/api/Authentication.java | Authentication.saveAuthentication | protected static boolean saveAuthentication(URL url, String authenticationToken, boolean authenticationTokenIsPrivate,
String applicationKey, int timeToLive, String privateKey, Map<String, LinkedList<ChannelPermissions>> permissions, Proxy proxy)
throws IOException {
"""
CAUSE: Prefer throwing/catching... | java | protected static boolean saveAuthentication(URL url, String authenticationToken, boolean authenticationTokenIsPrivate,
String applicationKey, int timeToLive, String privateKey, Map<String, LinkedList<ChannelPermissions>> permissions, Proxy proxy)
throws IOException {
String postBody = String.format("AT=... | [
"protected",
"static",
"boolean",
"saveAuthentication",
"(",
"URL",
"url",
",",
"String",
"authenticationToken",
",",
"boolean",
"authenticationTokenIsPrivate",
",",
"String",
"applicationKey",
",",
"int",
"timeToLive",
",",
"String",
"privateKey",
",",
"Map",
"<",
... | CAUSE: Prefer throwing/catching meaningful exceptions instead of Exception | [
"CAUSE",
":",
"Prefer",
"throwing",
"/",
"catching",
"meaningful",
"exceptions",
"instead",
"of",
"Exception"
] | train | https://github.com/realtime-framework/RealtimeMessaging-Java/blob/cae0dfd01567a2d9e55a0849c0c9b09ad4b2cc08/library/src/main/java/ibt/ortc/api/Authentication.java#L26-L47 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java | DateUtil.ceiling | public static Calendar ceiling(Calendar calendar, DateField dateField) {
"""
修改日期为某个时间字段结束时间
@param calendar {@link Calendar}
@param dateField 时间字段
@return 原{@link Calendar}
@since 4.5.7
"""
return DateModifier.modify(calendar, dateField.getValue(), ModifyType.CEILING);
} | java | public static Calendar ceiling(Calendar calendar, DateField dateField) {
return DateModifier.modify(calendar, dateField.getValue(), ModifyType.CEILING);
} | [
"public",
"static",
"Calendar",
"ceiling",
"(",
"Calendar",
"calendar",
",",
"DateField",
"dateField",
")",
"{",
"return",
"DateModifier",
".",
"modify",
"(",
"calendar",
",",
"dateField",
".",
"getValue",
"(",
")",
",",
"ModifyType",
".",
"CEILING",
")",
";... | 修改日期为某个时间字段结束时间
@param calendar {@link Calendar}
@param dateField 时间字段
@return 原{@link Calendar}
@since 4.5.7 | [
"修改日期为某个时间字段结束时间"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/DateUtil.java#L815-L817 |
watson-developer-cloud/java-sdk | discovery/src/main/java/com/ibm/watson/discovery/v1/query/AggregationDeserializer.java | AggregationDeserializer.parseNext | private void parseNext(JsonReader in, HashMap<String, Object> objMap) throws IOException {
"""
Checks the next {@link JsonToken} to decide the next appropriate parsing method.
@param in {@link JsonReader} object used for parsing
@param objMap Map used to build the structure for the resulting {@link QueryAggreg... | java | private void parseNext(JsonReader in, HashMap<String, Object> objMap) throws IOException {
JsonToken token = in.peek();
String lastName = "";
if (token == JsonToken.NAME) {
lastName = in.nextName();
token = in.peek();
}
switch (token) {
case BEGIN_ARRAY:
parseArray(in, ob... | [
"private",
"void",
"parseNext",
"(",
"JsonReader",
"in",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"objMap",
")",
"throws",
"IOException",
"{",
"JsonToken",
"token",
"=",
"in",
".",
"peek",
"(",
")",
";",
"String",
"lastName",
"=",
"\"\"",
";",
... | Checks the next {@link JsonToken} to decide the next appropriate parsing method.
@param in {@link JsonReader} object used for parsing
@param objMap Map used to build the structure for the resulting {@link QueryAggregation} object
@throws IOException signals that there has been an IO exception | [
"Checks",
"the",
"next",
"{",
"@link",
"JsonToken",
"}",
"to",
"decide",
"the",
"next",
"appropriate",
"parsing",
"method",
"."
] | train | https://github.com/watson-developer-cloud/java-sdk/blob/c926117afd20e2002b69942537720ab733a914f3/discovery/src/main/java/com/ibm/watson/discovery/v1/query/AggregationDeserializer.java#L117-L147 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java | SSLUtils.createRestSSLContext | @Nullable
private static SSLContext createRestSSLContext(Configuration config, RestSSLContextConfigMode configMode) throws Exception {
"""
Creates an SSL context for the external REST SSL.
If mutual authentication is configured the client and the server side configuration are identical.
"""
checkNotNull(co... | java | @Nullable
private static SSLContext createRestSSLContext(Configuration config, RestSSLContextConfigMode configMode) throws Exception {
checkNotNull(config, "config");
if (!isRestSSLEnabled(config)) {
return null;
}
KeyManager[] keyManagers = null;
if (configMode == RestSSLContextConfigMode.SERVER || con... | [
"@",
"Nullable",
"private",
"static",
"SSLContext",
"createRestSSLContext",
"(",
"Configuration",
"config",
",",
"RestSSLContextConfigMode",
"configMode",
")",
"throws",
"Exception",
"{",
"checkNotNull",
"(",
"config",
",",
"\"config\"",
")",
";",
"if",
"(",
"!",
... | Creates an SSL context for the external REST SSL.
If mutual authentication is configured the client and the server side configuration are identical. | [
"Creates",
"an",
"SSL",
"context",
"for",
"the",
"external",
"REST",
"SSL",
".",
"If",
"mutual",
"authentication",
"is",
"configured",
"the",
"client",
"and",
"the",
"server",
"side",
"configuration",
"are",
"identical",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/net/SSLUtils.java#L269-L323 |
dashbuilder/dashbuilder | dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/DisplayerLocator.java | DisplayerLocator.lookupDisplayer | public Displayer lookupDisplayer(DisplayerSettings target) {
"""
Get the displayer component for the specified data displayer (with no data set attached).
"""
RendererLibrary renderer = rendererManager.getRendererForDisplayer(target);
Displayer displayer = renderer.lookupDisplayer(target);
... | java | public Displayer lookupDisplayer(DisplayerSettings target) {
RendererLibrary renderer = rendererManager.getRendererForDisplayer(target);
Displayer displayer = renderer.lookupDisplayer(target);
if (displayer == null) {
String rendererUuid = target.getRenderer();
if (String... | [
"public",
"Displayer",
"lookupDisplayer",
"(",
"DisplayerSettings",
"target",
")",
"{",
"RendererLibrary",
"renderer",
"=",
"rendererManager",
".",
"getRendererForDisplayer",
"(",
"target",
")",
";",
"Displayer",
"displayer",
"=",
"renderer",
".",
"lookupDisplayer",
"... | Get the displayer component for the specified data displayer (with no data set attached). | [
"Get",
"the",
"displayer",
"component",
"for",
"the",
"specified",
"data",
"displayer",
"(",
"with",
"no",
"data",
"set",
"attached",
")",
"."
] | train | https://github.com/dashbuilder/dashbuilder/blob/50ef88210726b4f2f33f1a82eaf0f542e38dedd9/dashbuilder-client/dashbuilder-displayer-client/src/main/java/org/dashbuilder/displayer/client/DisplayerLocator.java#L61-L83 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configuresyslog.java | br_configuresyslog.configuresyslog | public static br_configuresyslog configuresyslog(nitro_service client, br_configuresyslog resource) throws Exception {
"""
<pre>
Use this operation to configure Syslog Server settings on Repeater Instances.
</pre>
"""
return ((br_configuresyslog[]) resource.perform_operation(client, "configuresyslog"))[0]... | java | public static br_configuresyslog configuresyslog(nitro_service client, br_configuresyslog resource) throws Exception
{
return ((br_configuresyslog[]) resource.perform_operation(client, "configuresyslog"))[0];
} | [
"public",
"static",
"br_configuresyslog",
"configuresyslog",
"(",
"nitro_service",
"client",
",",
"br_configuresyslog",
"resource",
")",
"throws",
"Exception",
"{",
"return",
"(",
"(",
"br_configuresyslog",
"[",
"]",
")",
"resource",
".",
"perform_operation",
"(",
"... | <pre>
Use this operation to configure Syslog Server settings on Repeater Instances.
</pre> | [
"<pre",
">",
"Use",
"this",
"operation",
"to",
"configure",
"Syslog",
"Server",
"settings",
"on",
"Repeater",
"Instances",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/br/br_configuresyslog.java#L126-L129 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.beginUpdateTags | public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map<String, String> tags) {
"""
Updates VirtualHub tags.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param tags Resource tags.
@throws IllegalArgu... | java | public VirtualHubInner beginUpdateTags(String resourceGroupName, String virtualHubName, Map<String, String> tags) {
return beginUpdateTagsWithServiceResponseAsync(resourceGroupName, virtualHubName, tags).toBlocking().single().body();
} | [
"public",
"VirtualHubInner",
"beginUpdateTags",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
",",
"Map",
"<",
"String",
",",
"String",
">",
"tags",
")",
"{",
"return",
"beginUpdateTagsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"v... | Updates VirtualHub tags.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param tags Resource tags.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorException thrown if the request is rejected by server
@throws ... | [
"Updates",
"VirtualHub",
"tags",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L602-L604 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java | CommonOps_DDF4.addEquals | public static void addEquals( DMatrix4 a , DMatrix4 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified.
"""
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 +... | java | public static void addEquals( DMatrix4 a , DMatrix4 b ) {
a.a1 += b.a1;
a.a2 += b.a2;
a.a3 += b.a3;
a.a4 += b.a4;
} | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix4",
"a",
",",
"DMatrix4",
"b",
")",
"{",
"a",
".",
"a1",
"+=",
"b",
".",
"a1",
";",
"a",
".",
"a2",
"+=",
"b",
".",
"a2",
";",
"a",
".",
"a3",
"+=",
"b",
".",
"a3",
";",
"a",
".",
"a4",
... | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>i</sub> = a<sub>i</sub> + b<sub>i</sub> <br>
</p>
@param a A Vector. Modified.
@param b A Vector. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"i<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"i<",
"/",
"sub",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF4.java#L127-L132 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java | ReflectionUtils.getRequiredInternalMethod | @Internal
public static Method getRequiredInternalMethod(Class type, String name, Class... argumentTypes) {
"""
Finds an internal method defined by the Micronaut API and throws a {@link NoSuchMethodError} if it doesn't exist.
@param type The type
@param name The name
@param argumentTypes... | java | @Internal
public static Method getRequiredInternalMethod(Class type, String name, Class... argumentTypes) {
try {
return type.getDeclaredMethod(name, argumentTypes);
} catch (NoSuchMethodException e) {
return findMethod(type, name, argumentTypes)
.orElseThrow(... | [
"@",
"Internal",
"public",
"static",
"Method",
"getRequiredInternalMethod",
"(",
"Class",
"type",
",",
"String",
"name",
",",
"Class",
"...",
"argumentTypes",
")",
"{",
"try",
"{",
"return",
"type",
".",
"getDeclaredMethod",
"(",
"name",
",",
"argumentTypes",
... | Finds an internal method defined by the Micronaut API and throws a {@link NoSuchMethodError} if it doesn't exist.
@param type The type
@param name The name
@param argumentTypes The argument types
@return An {@link Optional} contains the method or empty
@throws NoSuchMethodError If the method doesn't ... | [
"Finds",
"an",
"internal",
"method",
"defined",
"by",
"the",
"Micronaut",
"API",
"and",
"throws",
"a",
"{",
"@link",
"NoSuchMethodError",
"}",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java#L254-L262 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.updateServerGroupName | public ServerGroup updateServerGroupName(int serverGroupId, String name) {
"""
Update the server group's name
@param serverGroupId ID of server group
@param name new name of server group
@return updated ServerGroup
"""
ServerGroup serverGroup = null;
BasicNameValuePair[] params = {
... | java | public ServerGroup updateServerGroupName(int serverGroupId, String name) {
ServerGroup serverGroup = null;
BasicNameValuePair[] params = {
new BasicNameValuePair("name", name),
new BasicNameValuePair("profileIdentifier", this._profileName)
};
try {
JSO... | [
"public",
"ServerGroup",
"updateServerGroupName",
"(",
"int",
"serverGroupId",
",",
"String",
"name",
")",
"{",
"ServerGroup",
"serverGroup",
"=",
"null",
";",
"BasicNameValuePair",
"[",
"]",
"params",
"=",
"{",
"new",
"BasicNameValuePair",
"(",
"\"name\"",
",",
... | Update the server group's name
@param serverGroupId ID of server group
@param name new name of server group
@return updated ServerGroup | [
"Update",
"the",
"server",
"group",
"s",
"name"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1274-L1288 |
kite-sdk/kite | kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/AvroUtils.java | AvroUtils.inputStreamToString | public static String inputStreamToString(InputStream in) {
"""
Convert an InputStream to a string encoded as UTF-8.
@param in
The InputStream to read the schema from.
@return The string.
"""
final int BUFFER_SIZE = 1024;
BufferedReader bufferedReader;
try {
bufferedReader = new BufferedR... | java | public static String inputStreamToString(InputStream in) {
final int BUFFER_SIZE = 1024;
BufferedReader bufferedReader;
try {
bufferedReader = new BufferedReader(new InputStreamReader(in, "UTF-8"));
} catch (UnsupportedEncodingException e) {
throw new DatasetException(
"Platform do... | [
"public",
"static",
"String",
"inputStreamToString",
"(",
"InputStream",
"in",
")",
"{",
"final",
"int",
"BUFFER_SIZE",
"=",
"1024",
";",
"BufferedReader",
"bufferedReader",
";",
"try",
"{",
"bufferedReader",
"=",
"new",
"BufferedReader",
"(",
"new",
"InputStreamR... | Convert an InputStream to a string encoded as UTF-8.
@param in
The InputStream to read the schema from.
@return The string. | [
"Convert",
"an",
"InputStream",
"to",
"a",
"string",
"encoded",
"as",
"UTF",
"-",
"8",
"."
] | train | https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/avro/AvroUtils.java#L144-L164 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/distance/Distance.java | Distance.Hamming | public static int Hamming(String first, String second) {
"""
Gets the Hamming distance between two strings.
@param first First string.
@param second Second string.
@return The Hamming distance between p and q.
"""
if (first.length() != second.length())
throw new IllegalArgumentExcept... | java | public static int Hamming(String first, String second) {
if (first.length() != second.length())
throw new IllegalArgumentException("The size of string must be the same.");
int diff = 0;
for (int i = 0; i < first.length(); i++)
if (first.charAt(i) != second.charAt(i))
... | [
"public",
"static",
"int",
"Hamming",
"(",
"String",
"first",
",",
"String",
"second",
")",
"{",
"if",
"(",
"first",
".",
"length",
"(",
")",
"!=",
"second",
".",
"length",
"(",
")",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The size of stri... | Gets the Hamming distance between two strings.
@param first First string.
@param second Second string.
@return The Hamming distance between p and q. | [
"Gets",
"the",
"Hamming",
"distance",
"between",
"two",
"strings",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/distance/Distance.java#L412-L422 |
QSFT/Doradus | doradus-common/src/main/java/com/dell/doradus/common/Utils.java | Utils.indexOf | public static int indexOf(byte[] buffer, char ch) {
"""
Return the first index where the given character occurs in the given buffer or -1
if is not found. This is like String.indexOf() but it works on byte[] arrays. If
the given buffer is null or empty, -1 is returned.
@param buffer byte[] to search.
@par... | java | public static int indexOf(byte[] buffer, char ch) {
if (buffer == null) {
return -1;
}
for (int index = 0; index < buffer.length; index++) {
if (buffer[index] == ch) {
return index;
}
}
return -1;
} | [
"public",
"static",
"int",
"indexOf",
"(",
"byte",
"[",
"]",
"buffer",
",",
"char",
"ch",
")",
"{",
"if",
"(",
"buffer",
"==",
"null",
")",
"{",
"return",
"-",
"1",
";",
"}",
"for",
"(",
"int",
"index",
"=",
"0",
";",
"index",
"<",
"buffer",
".... | Return the first index where the given character occurs in the given buffer or -1
if is not found. This is like String.indexOf() but it works on byte[] arrays. If
the given buffer is null or empty, -1 is returned.
@param buffer byte[] to search.
@param ch Character to find.
@return Zero-relative ind... | [
"Return",
"the",
"first",
"index",
"where",
"the",
"given",
"character",
"occurs",
"in",
"the",
"given",
"buffer",
"or",
"-",
"1",
"if",
"is",
"not",
"found",
".",
"This",
"is",
"like",
"String",
".",
"indexOf",
"()",
"but",
"it",
"works",
"on",
"byte"... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1072-L1082 |
rholder/fauxflake | fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/twitter/SnowflakeEncodingProvider.java | SnowflakeEncodingProvider.encodeAsString | @Override
public String encodeAsString(long time, int sequence) {
"""
Return the 16 character left padded hex version of the given id. These
can be lexicographically sorted.
"""
return leftPad(toHexString(encodeAsLong(time, sequence)), 16, '0');
} | java | @Override
public String encodeAsString(long time, int sequence) {
return leftPad(toHexString(encodeAsLong(time, sequence)), 16, '0');
} | [
"@",
"Override",
"public",
"String",
"encodeAsString",
"(",
"long",
"time",
",",
"int",
"sequence",
")",
"{",
"return",
"leftPad",
"(",
"toHexString",
"(",
"encodeAsLong",
"(",
"time",
",",
"sequence",
")",
")",
",",
"16",
",",
"'",
"'",
")",
";",
"}"
... | Return the 16 character left padded hex version of the given id. These
can be lexicographically sorted. | [
"Return",
"the",
"16",
"character",
"left",
"padded",
"hex",
"version",
"of",
"the",
"given",
"id",
".",
"These",
"can",
"be",
"lexicographically",
"sorted",
"."
] | train | https://github.com/rholder/fauxflake/blob/54631faefdaf6b0b4d27b365f18c085771575cb3/fauxflake-core/src/main/java/com/github/rholder/fauxflake/provider/twitter/SnowflakeEncodingProvider.java#L97-L100 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java | PathBuilder.get | @SuppressWarnings("unchecked")
public <A> SimplePath<A> get(Path<A> path) {
"""
Create a new Simple path
@param <A>
@param path existing path
@return property path
"""
SimplePath<A> newPath = getSimple(toString(path), (Class<A>) path.getType());
return addMetadataOf(newPath, path);
... | java | @SuppressWarnings("unchecked")
public <A> SimplePath<A> get(Path<A> path) {
SimplePath<A> newPath = getSimple(toString(path), (Class<A>) path.getType());
return addMetadataOf(newPath, path);
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
">",
"SimplePath",
"<",
"A",
">",
"get",
"(",
"Path",
"<",
"A",
">",
"path",
")",
"{",
"SimplePath",
"<",
"A",
">",
"newPath",
"=",
"getSimple",
"(",
"toString",
"(",
"path",
")"... | Create a new Simple path
@param <A>
@param path existing path
@return property path | [
"Create",
"a",
"new",
"Simple",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/PathBuilder.java#L452-L456 |
VoltDB/voltdb | src/frontend/org/voltcore/messaging/HostMessenger.java | HostMessenger.generateMailboxId | public long generateMailboxId(Long mailboxId) {
"""
/*
Generate a slot for the mailbox and put a noop box there. Can also
supply a value
"""
final long hsId = mailboxId == null ? getHSIdForLocalSite(m_nextSiteId.getAndIncrement()) : mailboxId;
addMailbox(hsId, new Mailbox() {
@Ove... | java | public long generateMailboxId(Long mailboxId) {
final long hsId = mailboxId == null ? getHSIdForLocalSite(m_nextSiteId.getAndIncrement()) : mailboxId;
addMailbox(hsId, new Mailbox() {
@Override
public void send(long hsId, VoltMessage message) {
}
@Overrid... | [
"public",
"long",
"generateMailboxId",
"(",
"Long",
"mailboxId",
")",
"{",
"final",
"long",
"hsId",
"=",
"mailboxId",
"==",
"null",
"?",
"getHSIdForLocalSite",
"(",
"m_nextSiteId",
".",
"getAndIncrement",
"(",
")",
")",
":",
"mailboxId",
";",
"addMailbox",
"("... | /*
Generate a slot for the mailbox and put a noop box there. Can also
supply a value | [
"/",
"*",
"Generate",
"a",
"slot",
"for",
"the",
"mailbox",
"and",
"put",
"a",
"noop",
"box",
"there",
".",
"Can",
"also",
"supply",
"a",
"value"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/messaging/HostMessenger.java#L1494-L1555 |
icode/ameba | src/main/java/ameba/db/ebean/internal/ModelInterceptor.java | ModelInterceptor.applyFilter | public static <T> void applyFilter(MultivaluedMap<String, String> queryParams,
SpiQuery<T> query,
InjectionManager manager) {
"""
/path?filter=p.in(1,2)c.eq('ddd')d.startWith('a')or(f.eq('a')g.startWith(2))
@param queryParams uri quer... | java | public static <T> void applyFilter(MultivaluedMap<String, String> queryParams,
SpiQuery<T> query,
InjectionManager manager) {
List<String> wheres = queryParams.get(FILTER_PARAM_NAME);
if (wheres != null && wheres.size() > 0) {... | [
"public",
"static",
"<",
"T",
">",
"void",
"applyFilter",
"(",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"queryParams",
",",
"SpiQuery",
"<",
"T",
">",
"query",
",",
"InjectionManager",
"manager",
")",
"{",
"List",
"<",
"String",
">",
"wheres",
... | /path?filter=p.in(1,2)c.eq('ddd')d.startWith('a')or(f.eq('a')g.startWith(2))
@param queryParams uri query params
@param query query
@param manager a {@link InjectionManager} object.
@param <T> a T object. | [
"/",
"path?filter",
"=",
"p",
".",
"in",
"(",
"1",
"2",
")",
"c",
".",
"eq",
"(",
"ddd",
")",
"d",
".",
"startWith",
"(",
"a",
")",
"or",
"(",
"f",
".",
"eq",
"(",
"a",
")",
"g",
".",
"startWith",
"(",
"2",
"))"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L319-L334 |
mikepenz/FastAdapter | library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java | FastAdapter.onCreateViewHolder | @Override
@SuppressWarnings("unchecked")
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
"""
Creates the ViewHolder by the viewType
@param parent the parent view (the RecyclerView)
@param viewType the current viewType which is bound
@return the ViewHolder with the... | java | @Override
@SuppressWarnings("unchecked")
public RecyclerView.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
if (mVerbose) Log.v(TAG, "onCreateViewHolder: " + viewType);
final RecyclerView.ViewHolder holder = mOnCreateViewHolderListener.onPreCreateViewHolder(this, parent, viewTy... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"RecyclerView",
".",
"ViewHolder",
"onCreateViewHolder",
"(",
"ViewGroup",
"parent",
",",
"int",
"viewType",
")",
"{",
"if",
"(",
"mVerbose",
")",
"Log",
".",
"v",
"(",
"TAG",
","... | Creates the ViewHolder by the viewType
@param parent the parent view (the RecyclerView)
@param viewType the current viewType which is bound
@return the ViewHolder with the bound data | [
"Creates",
"the",
"ViewHolder",
"by",
"the",
"viewType"
] | train | https://github.com/mikepenz/FastAdapter/blob/3b2412abe001ba58422e0125846b704d4dba4ae9/library-core/src/main/java/com/mikepenz/fastadapter/FastAdapter.java#L680-L702 |
google/closure-templates | java/src/com/google/template/soy/SoyFileSet.java | SoyFileSet.compileToJar | void compileToJar(ByteSink jarTarget, Optional<ByteSink> srcJarTarget) throws IOException {
"""
Compiles this Soy file set into a set of java classes implementing the {@link CompiledTemplate}
interface and writes them out to the given ByteSink as a JAR file.
@throws SoyCompilationException If compilation fails... | java | void compileToJar(ByteSink jarTarget, Optional<ByteSink> srcJarTarget) throws IOException {
resetErrorReporter();
disallowExternalCalls();
ServerCompilationPrimitives primitives = compileForServerRendering();
BytecodeCompiler.compileToJar(
primitives.registry, primitives.soyTree, errorReporter, ... | [
"void",
"compileToJar",
"(",
"ByteSink",
"jarTarget",
",",
"Optional",
"<",
"ByteSink",
">",
"srcJarTarget",
")",
"throws",
"IOException",
"{",
"resetErrorReporter",
"(",
")",
";",
"disallowExternalCalls",
"(",
")",
";",
"ServerCompilationPrimitives",
"primitives",
... | Compiles this Soy file set into a set of java classes implementing the {@link CompiledTemplate}
interface and writes them out to the given ByteSink as a JAR file.
@throws SoyCompilationException If compilation fails. | [
"Compiles",
"this",
"Soy",
"file",
"set",
"into",
"a",
"set",
"of",
"java",
"classes",
"implementing",
"the",
"{",
"@link",
"CompiledTemplate",
"}",
"interface",
"and",
"writes",
"them",
"out",
"to",
"the",
"given",
"ByteSink",
"as",
"a",
"JAR",
"file",
".... | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/SoyFileSet.java#L806-L817 |
real-logic/agrona | agrona/src/main/java/org/agrona/PrintBufferUtil.java | PrintBufferUtil.prettyHexDump | public static String prettyHexDump(final DirectBuffer buffer, final int offset, final int length) {
"""
Returns a hexadecimal dump of the specified {@link DirectBuffer} that is easy to read by humans,
starting at the given {@code offset} using the given {@code length}.
@param buffer dumped buffer
@param offse... | java | public static String prettyHexDump(final DirectBuffer buffer, final int offset, final int length)
{
return HexUtil.prettyHexDump(buffer, offset, length);
} | [
"public",
"static",
"String",
"prettyHexDump",
"(",
"final",
"DirectBuffer",
"buffer",
",",
"final",
"int",
"offset",
",",
"final",
"int",
"length",
")",
"{",
"return",
"HexUtil",
".",
"prettyHexDump",
"(",
"buffer",
",",
"offset",
",",
"length",
")",
";",
... | Returns a hexadecimal dump of the specified {@link DirectBuffer} that is easy to read by humans,
starting at the given {@code offset} using the given {@code length}.
@param buffer dumped buffer
@param offset where should we start to print
@param length how much should we print
@return pretty hex dump in a string repre... | [
"Returns",
"a",
"hexadecimal",
"dump",
"of",
"the",
"specified",
"{",
"@link",
"DirectBuffer",
"}",
"that",
"is",
"easy",
"to",
"read",
"by",
"humans",
"starting",
"at",
"the",
"given",
"{",
"@code",
"offset",
"}",
"using",
"the",
"given",
"{",
"@code",
... | train | https://github.com/real-logic/agrona/blob/d1ea76e6e3598cd6a0d34879687652ef123f639b/agrona/src/main/java/org/agrona/PrintBufferUtil.java#L123-L126 |
mirage-sql/mirage | src/main/java/com/miragesql/miragesql/bean/BeanDescFactory.java | BeanDescFactory.getBeanDesc | @SuppressWarnings("unchecked")
public BeanDesc getBeanDesc(Object obj) {
"""
Constructs a bean descriptor out of an Object instance.
@param obj the object to create the descriptor from (the object can also be a Map)
@return a descriptor
"""
if(obj instanceof Map){
return new MapB... | java | @SuppressWarnings("unchecked")
public BeanDesc getBeanDesc(Object obj){
if(obj instanceof Map){
return new MapBeanDescImpl((Map<String, Object>) obj);
} else {
return getBeanDesc(obj.getClass());
}
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"BeanDesc",
"getBeanDesc",
"(",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"Map",
")",
"{",
"return",
"new",
"MapBeanDescImpl",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">"... | Constructs a bean descriptor out of an Object instance.
@param obj the object to create the descriptor from (the object can also be a Map)
@return a descriptor | [
"Constructs",
"a",
"bean",
"descriptor",
"out",
"of",
"an",
"Object",
"instance",
"."
] | train | https://github.com/mirage-sql/mirage/blob/29a44b7ad267b5a48bc250cd0ef7d74813d46889/src/main/java/com/miragesql/miragesql/bean/BeanDescFactory.java#L35-L42 |
clanie/clanie-core | src/main/java/dk/clanie/collections/NumberMap.java | NumberMap.newShortMap | public static <K> NumberMap<K, Short> newShortMap() {
"""
Creates a NumberMap for Shorts.
@param <K>
@return NumberMap<K>
"""
return new NumberMap<K, Short>() {
@Override
public void add(K key, Short addend) {
put(key, containsKey(key) ? (short) (get(key) + addend) : addend);
}
@Override
... | java | public static <K> NumberMap<K, Short> newShortMap() {
return new NumberMap<K, Short>() {
@Override
public void add(K key, Short addend) {
put(key, containsKey(key) ? (short) (get(key) + addend) : addend);
}
@Override
public void sub(K key, Short subtrahend) {
put(key, (short)((containsKey(key) ... | [
"public",
"static",
"<",
"K",
">",
"NumberMap",
"<",
"K",
",",
"Short",
">",
"newShortMap",
"(",
")",
"{",
"return",
"new",
"NumberMap",
"<",
"K",
",",
"Short",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"add",
"(",
"K",
"key",
",",
"... | Creates a NumberMap for Shorts.
@param <K>
@return NumberMap<K> | [
"Creates",
"a",
"NumberMap",
"for",
"Shorts",
"."
] | train | https://github.com/clanie/clanie-core/blob/ac8a655b93127f0e281b741c4d53f429be2816ad/src/main/java/dk/clanie/collections/NumberMap.java#L212-L223 |
zandero/http | src/main/java/com/zandero/http/logging/LoggingUtils.java | LoggingUtils.prepareForLogging | public static void prepareForLogging(String path, String query) {
"""
Common purpose logging
@param path of request
@param query optional query of request
"""
MDC.put("request_id", UUID.randomUUID().toString()); // generate unique request id ...
try {
URI uri = new URI(path);
MDC.put("host", uri.... | java | public static void prepareForLogging(String path, String query) {
MDC.put("request_id", UUID.randomUUID().toString()); // generate unique request id ...
try {
URI uri = new URI(path);
MDC.put("host", uri.getHost());
MDC.put("scheme", uri.getScheme());
MDC.put("domain", UrlUtils.resolveDomain(uri.getPa... | [
"public",
"static",
"void",
"prepareForLogging",
"(",
"String",
"path",
",",
"String",
"query",
")",
"{",
"MDC",
".",
"put",
"(",
"\"request_id\"",
",",
"UUID",
".",
"randomUUID",
"(",
")",
".",
"toString",
"(",
")",
")",
";",
"// generate unique request id ... | Common purpose logging
@param path of request
@param query optional query of request | [
"Common",
"purpose",
"logging"
] | train | https://github.com/zandero/http/blob/909eb879f1193adf24545360c3b76bd813865f65/src/main/java/com/zandero/http/logging/LoggingUtils.java#L60-L83 |
jbundle/jbundle | main/msg/src/main/java/org/jbundle/main/msg/db/MessageStatusField.java | MessageStatusField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param t... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
ScreenComponent screenField = null;
this.makeReferenceRecord(); // Get/make the record that describes the referenced class.
... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"ScreenComp... | Set up the default screen control for this field.
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the screenfield to.
@param iDisplayFieldDesc Display the labe... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/msg/src/main/java/org/jbundle/main/msg/db/MessageStatusField.java#L72-L84 |
kiswanij/jk-util | src/main/java/com/jk/util/JKObjectUtil.java | JKObjectUtil.isMethodDirectlyExists | public static boolean isMethodDirectlyExists(Object object, String methodName, Class<?>... params) {
"""
Checks if is method directly exists.
@param object the object
@param methodName the method name
@param params the params
@return true, if is method directly exists
"""
try {
Method meth... | java | public static boolean isMethodDirectlyExists(Object object, String methodName, Class<?>... params) {
try {
Method method = object.getClass().getDeclaredMethod(methodName, params);
return true;
} catch (NoSuchMethodException e) {
return false;
} catch (SecurityException e) {
throw new RuntimeExc... | [
"public",
"static",
"boolean",
"isMethodDirectlyExists",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"params",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"object",
".",
"getClass",
"(",
")",
".",
"getDeclar... | Checks if is method directly exists.
@param object the object
@param methodName the method name
@param params the params
@return true, if is method directly exists | [
"Checks",
"if",
"is",
"method",
"directly",
"exists",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKObjectUtil.java#L367-L376 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java | RandomProjectedNeighborsAndDensities.splitRandomly | public int splitRandomly(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
"""
Split the data set randomly.
@param ind Object index
@param begin Interval begin
@param end Interval end
@param tpro Projection
@param rand Random generator
@return Splitting point
"""
fi... | java | public int splitRandomly(ArrayModifiableDBIDs ind, int begin, int end, DoubleDataStore tpro, Random rand) {
final int nele = end - begin;
DBIDArrayIter it = ind.iter();
// pick random splitting element based on position
double rs = tpro.doubleValue(it.seek(begin + rand.nextInt(nele)));
int minInd = ... | [
"public",
"int",
"splitRandomly",
"(",
"ArrayModifiableDBIDs",
"ind",
",",
"int",
"begin",
",",
"int",
"end",
",",
"DoubleDataStore",
"tpro",
",",
"Random",
"rand",
")",
"{",
"final",
"int",
"nele",
"=",
"end",
"-",
"begin",
";",
"DBIDArrayIter",
"it",
"="... | Split the data set randomly.
@param ind Object index
@param begin Interval begin
@param end Interval end
@param tpro Projection
@param rand Random generator
@return Splitting point | [
"Split",
"the",
"data",
"set",
"randomly",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/index/preprocessed/fastoptics/RandomProjectedNeighborsAndDensities.java#L288-L315 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java | NotificationHubsInner.createOrUpdateAsync | public Observable<NotificationHubResourceInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) {
"""
Creates/Update a NotificationHub in a namespace.
@param resourceGroupName The name of the resource group.
@pa... | java | public Observable<NotificationHubResourceInner> createOrUpdateAsync(String resourceGroupName, String namespaceName, String notificationHubName, NotificationHubCreateOrUpdateParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, namespaceName, notificationHubName, parameters).m... | [
"public",
"Observable",
"<",
"NotificationHubResourceInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
",",
"String",
"notificationHubName",
",",
"NotificationHubCreateOrUpdateParameters",
"parameters",
")",
"{",
"return",... | Creates/Update a NotificationHub in a namespace.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@param notificationHubName The notification hub name.
@param parameters Parameters supplied to the create/update a NotificationHub Resource.
@throws IllegalArgumentExceptio... | [
"Creates",
"/",
"Update",
"a",
"NotificationHub",
"in",
"a",
"namespace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2017_04_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2017_04_01/implementation/NotificationHubsInner.java#L273-L280 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java | ThinTableModel.selectionChanged | public boolean selectionChanged(Object source, int iStartRow, int iEndRow, int iSelectType) {
"""
User selected a new row.
From the ListSelectionListener interface.
@param source The source.
@param iStartRow The starting row.
@param iEndRow The ending row..
@param iSelectType The type of selection.
@return b... | java | public boolean selectionChanged(Object source, int iStartRow, int iEndRow, int iSelectType)
{
int iOldSelection = m_iSelectedRow;
if (m_iSelectedRow == iEndRow)
m_iSelectedRow = iStartRow;
else
m_iSelectedRow = iEndRow;
if (source instanceof JTable)
... | [
"public",
"boolean",
"selectionChanged",
"(",
"Object",
"source",
",",
"int",
"iStartRow",
",",
"int",
"iEndRow",
",",
"int",
"iSelectType",
")",
"{",
"int",
"iOldSelection",
"=",
"m_iSelectedRow",
";",
"if",
"(",
"m_iSelectedRow",
"==",
"iEndRow",
")",
"m_iSe... | User selected a new row.
From the ListSelectionListener interface.
@param source The source.
@param iStartRow The starting row.
@param iEndRow The ending row..
@param iSelectType The type of selection.
@return boolean If the selection changed, return true | [
"User",
"selected",
"a",
"new",
"row",
".",
"From",
"the",
"ListSelectionListener",
"interface",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/ThinTableModel.java#L797-L817 |
ManfredTremmel/gwt-bean-validators | mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/BicValidator.java | BicValidator.isValid | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
"""
{@inheritDoc} check if given string is a valid BIC.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext)
"""
final String valueAsStr... | java | @Override
public final boolean isValid(final Object pvalue, final ConstraintValidatorContext pcontext) {
final String valueAsString;
if (ignoreWhitspaces) {
valueAsString =
Objects.toString(pvalue, StringUtils.EMPTY).replaceAll("\\s+", StringUtils.EMPTY);
} else {
valueAsString = Obj... | [
"@",
"Override",
"public",
"final",
"boolean",
"isValid",
"(",
"final",
"Object",
"pvalue",
",",
"final",
"ConstraintValidatorContext",
"pcontext",
")",
"{",
"final",
"String",
"valueAsString",
";",
"if",
"(",
"ignoreWhitspaces",
")",
"{",
"valueAsString",
"=",
... | {@inheritDoc} check if given string is a valid BIC.
@see javax.validation.ConstraintValidator#isValid(java.lang.Object,
javax.validation.ConstraintValidatorContext) | [
"{",
"@inheritDoc",
"}",
"check",
"if",
"given",
"string",
"is",
"a",
"valid",
"BIC",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/mt-bean-validators/src/main/java/de/knightsoftnet/validators/shared/impl/BicValidator.java#L78-L103 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java | ThreadUtil.interupt | public static void interupt(Thread thread, boolean isJoin) {
"""
结束线程,调用此方法后,线程将抛出 {@link InterruptedException}异常
@param thread 线程
@param isJoin 是否等待结束
"""
if (null != thread && false == thread.isInterrupted()) {
thread.interrupt();
if (isJoin) {
waitForDie(thread);
}
}
} | java | public static void interupt(Thread thread, boolean isJoin) {
if (null != thread && false == thread.isInterrupted()) {
thread.interrupt();
if (isJoin) {
waitForDie(thread);
}
}
} | [
"public",
"static",
"void",
"interupt",
"(",
"Thread",
"thread",
",",
"boolean",
"isJoin",
")",
"{",
"if",
"(",
"null",
"!=",
"thread",
"&&",
"false",
"==",
"thread",
".",
"isInterrupted",
"(",
")",
")",
"{",
"thread",
".",
"interrupt",
"(",
")",
";",
... | 结束线程,调用此方法后,线程将抛出 {@link InterruptedException}异常
@param thread 线程
@param isJoin 是否等待结束 | [
"结束线程,调用此方法后,线程将抛出",
"{",
"@link",
"InterruptedException",
"}",
"异常"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/thread/ThreadUtil.java#L311-L318 |
apereo/cas | core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java | WebUtils.putAvailableAuthenticationHandleNames | public static void putAvailableAuthenticationHandleNames(final RequestContext context, final Collection<String> availableHandlers) {
"""
Put available authentication handle names.
@param context the context
@param availableHandlers the available handlers
"""
context.getFlowScope().put("av... | java | public static void putAvailableAuthenticationHandleNames(final RequestContext context, final Collection<String> availableHandlers) {
context.getFlowScope().put("availableAuthenticationHandlerNames", availableHandlers);
} | [
"public",
"static",
"void",
"putAvailableAuthenticationHandleNames",
"(",
"final",
"RequestContext",
"context",
",",
"final",
"Collection",
"<",
"String",
">",
"availableHandlers",
")",
"{",
"context",
".",
"getFlowScope",
"(",
")",
".",
"put",
"(",
"\"availableAuth... | Put available authentication handle names.
@param context the context
@param availableHandlers the available handlers | [
"Put",
"available",
"authentication",
"handle",
"names",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-web-api/src/main/java/org/apereo/cas/web/support/WebUtils.java#L990-L992 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.callGetter | public static Object callGetter(Object obj, String prop) throws PageException {
"""
to invoke a getter Method of a Object
@param obj Object to invoke method from
@param prop Name of the Method without get
@return return Value of the getter Method
@throws PageException
"""
try {
return getGetter(obj... | java | public static Object callGetter(Object obj, String prop) throws PageException {
try {
return getGetter(obj.getClass(), prop).invoke(obj);
}
catch (InvocationTargetException e) {
Throwable target = e.getTargetException();
if (target instanceof PageException) throw (PageException) target;
throw Cas... | [
"public",
"static",
"Object",
"callGetter",
"(",
"Object",
"obj",
",",
"String",
"prop",
")",
"throws",
"PageException",
"{",
"try",
"{",
"return",
"getGetter",
"(",
"obj",
".",
"getClass",
"(",
")",
",",
"prop",
")",
".",
"invoke",
"(",
"obj",
")",
";... | to invoke a getter Method of a Object
@param obj Object to invoke method from
@param prop Name of the Method without get
@return return Value of the getter Method
@throws PageException | [
"to",
"invoke",
"a",
"getter",
"Method",
"of",
"a",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L992-L1004 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeLockManager.java | InodeLockManager.lockEdge | public LockResource lockEdge(Edge edge, LockMode mode) {
"""
Acquires an edge lock.
@param edge the edge to lock
@param mode the mode to lock in
@return a lock resource which must be closed to release the lock
"""
return mEdgeLocks.get(edge, mode);
} | java | public LockResource lockEdge(Edge edge, LockMode mode) {
return mEdgeLocks.get(edge, mode);
} | [
"public",
"LockResource",
"lockEdge",
"(",
"Edge",
"edge",
",",
"LockMode",
"mode",
")",
"{",
"return",
"mEdgeLocks",
".",
"get",
"(",
"edge",
",",
"mode",
")",
";",
"}"
] | Acquires an edge lock.
@param edge the edge to lock
@param mode the mode to lock in
@return a lock resource which must be closed to release the lock | [
"Acquires",
"an",
"edge",
"lock",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeLockManager.java#L143-L145 |
JOML-CI/JOML | src/org/joml/Quaterniond.java | Quaterniond.setAngleAxis | public Quaterniond setAngleAxis(double angle, double x, double y, double z) {
"""
Set this quaternion to a rotation equivalent to the supplied axis and
angle (in radians).
<p>
This method assumes that the given rotation axis <code>(x, y, z)</code> is already normalized
@param angle
the angle in radians
@pa... | java | public Quaterniond setAngleAxis(double angle, double x, double y, double z) {
double s = Math.sin(angle * 0.5);
this.x = x * s;
this.y = y * s;
this.z = z * s;
this.w = Math.cosFromSin(s, angle * 0.5);
return this;
} | [
"public",
"Quaterniond",
"setAngleAxis",
"(",
"double",
"angle",
",",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"double",
"s",
"=",
"Math",
".",
"sin",
"(",
"angle",
"*",
"0.5",
")",
";",
"this",
".",
"x",
"=",
"x",
"*",
"s... | Set this quaternion to a rotation equivalent to the supplied axis and
angle (in radians).
<p>
This method assumes that the given rotation axis <code>(x, y, z)</code> is already normalized
@param angle
the angle in radians
@param x
the x-component of the normalized rotation axis
@param y
the y-component of the normaliz... | [
"Set",
"this",
"quaternion",
"to",
"a",
"rotation",
"equivalent",
"to",
"the",
"supplied",
"axis",
"and",
"angle",
"(",
"in",
"radians",
")",
".",
"<p",
">",
"This",
"method",
"assumes",
"that",
"the",
"given",
"rotation",
"axis",
"<code",
">",
"(",
"x",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L399-L406 |
GoogleCloudPlatform/appengine-plugins-core | src/main/java/com/google/cloud/tools/io/FileUtil.java | FileUtil.copyDirectory | public static void copyDirectory(final Path source, final Path destination, List<Path> excludes)
throws IOException {
"""
Implementation of recursive directory copy, does NOT overwrite.
@param source an existing source directory to copy from
@param destination an existing destination directory to copy to... | java | public static void copyDirectory(final Path source, final Path destination, List<Path> excludes)
throws IOException {
Preconditions.checkNotNull(source);
Preconditions.checkNotNull(destination);
Preconditions.checkArgument(Files.isDirectory(source), "Source is not a directory");
Preconditions.chec... | [
"public",
"static",
"void",
"copyDirectory",
"(",
"final",
"Path",
"source",
",",
"final",
"Path",
"destination",
",",
"List",
"<",
"Path",
">",
"excludes",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"source",
")",
";",
"Pr... | Implementation of recursive directory copy, does NOT overwrite.
@param source an existing source directory to copy from
@param destination an existing destination directory to copy to
@param excludes a list of paths in "source" to exclude
@throws IllegalArgumentException if source directory is same destination directo... | [
"Implementation",
"of",
"recursive",
"directory",
"copy",
"does",
"NOT",
"overwrite",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/io/FileUtil.java#L57-L102 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java | CommonOps_DDF2.elementDiv | public static void elementDiv( DMatrix2x2 a , DMatrix2x2 b) {
"""
<p>Performs an element by element division operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> / b<sub>ij</sub> <br>
</p>
@param a The left matrix in the division operation. Modified.
@param b The right matrix in the division operation. Not mod... | java | public static void elementDiv( DMatrix2x2 a , DMatrix2x2 b) {
a.a11 /= b.a11; a.a12 /= b.a12;
a.a21 /= b.a21; a.a22 /= b.a22;
} | [
"public",
"static",
"void",
"elementDiv",
"(",
"DMatrix2x2",
"a",
",",
"DMatrix2x2",
"b",
")",
"{",
"a",
".",
"a11",
"/=",
"b",
".",
"a11",
";",
"a",
".",
"a12",
"/=",
"b",
".",
"a12",
";",
"a",
".",
"a21",
"/=",
"b",
".",
"a21",
";",
"a",
".... | <p>Performs an element by element division operation:<br>
<br>
a<sub>ij</sub> = a<sub>ij</sub> / b<sub>ij</sub> <br>
</p>
@param a The left matrix in the division operation. Modified.
@param b The right matrix in the division operation. Not modified. | [
"<p",
">",
"Performs",
"an",
"element",
"by",
"element",
"division",
"operation",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"/",
"b<sub",
">",
"ij<",
"/",
"sub",
">",
"<br",
">",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF2.java#L920-L923 |
kaazing/gateway | service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java | HttpDirectoryService.toFile | private File toFile(File rootDir, String location) {
"""
Converts a location in the gateway configuration file into a file relative to a specified root directory.
@param rootDir
the root directory
@param location
the location (either a file:// URI or a location relative the root directory
@return the file c... | java | private File toFile(File rootDir, String location) {
File locationFile = rootDir;
if (location != null) {
URI locationURI = URI.create(location);
locationFile = new File(locationURI.getPath());
if (locationURI.getScheme() == null) {
locationFile = new ... | [
"private",
"File",
"toFile",
"(",
"File",
"rootDir",
",",
"String",
"location",
")",
"{",
"File",
"locationFile",
"=",
"rootDir",
";",
"if",
"(",
"location",
"!=",
"null",
")",
"{",
"URI",
"locationURI",
"=",
"URI",
".",
"create",
"(",
"location",
")",
... | Converts a location in the gateway configuration file into a file relative to a specified root directory.
@param rootDir
the root directory
@param location
the location (either a file:// URI or a location relative the root directory
@return the file corresponding to the location | [
"Converts",
"a",
"location",
"in",
"the",
"gateway",
"configuration",
"file",
"into",
"a",
"file",
"relative",
"to",
"a",
"specified",
"root",
"directory",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/service/http.directory/src/main/java/org/kaazing/gateway/service/http/directory/HttpDirectoryService.java#L207-L219 |
cloudfoundry/uaa | server/src/main/java/org/cloudfoundry/identity/uaa/scim/bootstrap/ScimGroupBootstrap.java | ScimGroupBootstrap.setGroups | public void setGroups(Map<String,String> groups) {
"""
Specify the list of groups to create as a comma-separated list of
group-names
@param groups
"""
if(groups==null) { groups = Collections.EMPTY_MAP; }
groups.entrySet().forEach(e -> {
if(!StringUtils.hasText(e.getValue())) { e... | java | public void setGroups(Map<String,String> groups) {
if(groups==null) { groups = Collections.EMPTY_MAP; }
groups.entrySet().forEach(e -> {
if(!StringUtils.hasText(e.getValue())) { e.setValue((String) getMessageSource().getProperty(String.format(messagePropertyNameTemplate, e.getKey()))); }
... | [
"public",
"void",
"setGroups",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"groups",
")",
"{",
"if",
"(",
"groups",
"==",
"null",
")",
"{",
"groups",
"=",
"Collections",
".",
"EMPTY_MAP",
";",
"}",
"groups",
".",
"entrySet",
"(",
")",
".",
"forEac... | Specify the list of groups to create as a comma-separated list of
group-names
@param groups | [
"Specify",
"the",
"list",
"of",
"groups",
"to",
"create",
"as",
"a",
"comma",
"-",
"separated",
"list",
"of",
"group",
"-",
"names"
] | train | https://github.com/cloudfoundry/uaa/blob/e8df3d7060580c92d33461106399f9e4f36e3cd2/server/src/main/java/org/cloudfoundry/identity/uaa/scim/bootstrap/ScimGroupBootstrap.java#L114-L121 |
Netflix/eureka | eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java | DeserializerStringCache.apply | public String apply(final JsonParser jp, CacheScope cacheScope, Supplier<String> source) throws IOException {
"""
returns a String read from the JsonParser argument's current position.
The returned value may be interned at the given cacheScope to reduce heap
consumption
@param jp
@param cacheScope
@return a... | java | public String apply(final JsonParser jp, CacheScope cacheScope, Supplier<String> source) throws IOException {
return apply(CharBuffer.wrap(jp, source), cacheScope);
} | [
"public",
"String",
"apply",
"(",
"final",
"JsonParser",
"jp",
",",
"CacheScope",
"cacheScope",
",",
"Supplier",
"<",
"String",
">",
"source",
")",
"throws",
"IOException",
"{",
"return",
"apply",
"(",
"CharBuffer",
".",
"wrap",
"(",
"jp",
",",
"source",
"... | returns a String read from the JsonParser argument's current position.
The returned value may be interned at the given cacheScope to reduce heap
consumption
@param jp
@param cacheScope
@return a possibly interned String
@throws IOException | [
"returns",
"a",
"String",
"read",
"from",
"the",
"JsonParser",
"argument",
"s",
"current",
"position",
".",
"The",
"returned",
"value",
"may",
"be",
"interned",
"at",
"the",
"given",
"cacheScope",
"to",
"reduce",
"heap",
"consumption"
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-client/src/main/java/com/netflix/discovery/util/DeserializerStringCache.java#L209-L211 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.filterFindByGroupId | @Override
public List<CommerceDiscount> filterFindByGroupId(long groupId, int start,
int end) {
"""
Returns a range of all the commerce discounts that the user has permission to view where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>sta... | java | @Override
public List<CommerceDiscount> filterFindByGroupId(long groupId, int start,
int end) {
return filterFindByGroupId(groupId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceDiscount",
">",
"filterFindByGroupId",
"(",
"long",
"groupId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"filterFindByGroupId",
"(",
"groupId",
",",
"start",
",",
"end",
",",
"null",
")",
"... | Returns a range of all the commerce discounts that the user has permission to view where groupId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> r... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"discounts",
"that",
"the",
"user",
"has",
"permission",
"to",
"view",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L1955-L1959 |
Alluxio/alluxio | core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java | InodeTreePersistentState.applyAndJournal | public void applyAndJournal(Supplier<JournalContext> context, MutableInode<?> inode) {
"""
Adds an inode to the inode tree.
@param context journal context supplier
@param inode an inode to add and create a journal entry for
"""
try {
applyCreateInode(inode);
context.get().append(inode.toJou... | java | public void applyAndJournal(Supplier<JournalContext> context, MutableInode<?> inode) {
try {
applyCreateInode(inode);
context.get().append(inode.toJournalEntry());
} catch (Throwable t) {
ProcessUtils.fatalError(LOG, t, "Failed to apply %s", inode);
throw t; // fatalError will usually sy... | [
"public",
"void",
"applyAndJournal",
"(",
"Supplier",
"<",
"JournalContext",
">",
"context",
",",
"MutableInode",
"<",
"?",
">",
"inode",
")",
"{",
"try",
"{",
"applyCreateInode",
"(",
"inode",
")",
";",
"context",
".",
"get",
"(",
")",
".",
"append",
"(... | Adds an inode to the inode tree.
@param context journal context supplier
@param inode an inode to add and create a journal entry for | [
"Adds",
"an",
"inode",
"to",
"the",
"inode",
"tree",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/master/src/main/java/alluxio/master/file/meta/InodeTreePersistentState.java#L282-L290 |
apache/incubator-heron | heron/api/src/java/org/apache/heron/api/topology/TopologyBuilder.java | TopologyBuilder.setSpout | public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelismHint) {
"""
Define a new spout in this topology with the specified parallelism. If the spout declares
itself as non-distributed, the parallelismHint will be ignored and only one task
will be allocated to this component.
@param id the... | java | public SpoutDeclarer setSpout(String id, IRichSpout spout, Number parallelismHint) {
validateComponentName(id);
SpoutDeclarer s = new SpoutDeclarer(id, spout, parallelismHint);
spouts.put(id, s);
return s;
} | [
"public",
"SpoutDeclarer",
"setSpout",
"(",
"String",
"id",
",",
"IRichSpout",
"spout",
",",
"Number",
"parallelismHint",
")",
"{",
"validateComponentName",
"(",
"id",
")",
";",
"SpoutDeclarer",
"s",
"=",
"new",
"SpoutDeclarer",
"(",
"id",
",",
"spout",
",",
... | Define a new spout in this topology with the specified parallelism. If the spout declares
itself as non-distributed, the parallelismHint will be ignored and only one task
will be allocated to this component.
@param id the id of this component. This id is referenced by other components that want to consume this spout's... | [
"Define",
"a",
"new",
"spout",
"in",
"this",
"topology",
"with",
"the",
"specified",
"parallelism",
".",
"If",
"the",
"spout",
"declares",
"itself",
"as",
"non",
"-",
"distributed",
"the",
"parallelismHint",
"will",
"be",
"ignored",
"and",
"only",
"one",
"ta... | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/api/src/java/org/apache/heron/api/topology/TopologyBuilder.java#L259-L264 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.