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 |
|---|---|---|---|---|---|---|---|---|---|---|
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/Dater.java | Dater.of | public static Dater of(Date date, DateStyle dateStyle) {
"""
Returns a new Dater instance with the given date and date style
@param date
@return
"""
return of(date).with(dateStyle);
} | java | public static Dater of(Date date, DateStyle dateStyle) {
return of(date).with(dateStyle);
} | [
"public",
"static",
"Dater",
"of",
"(",
"Date",
"date",
",",
"DateStyle",
"dateStyle",
")",
"{",
"return",
"of",
"(",
"date",
")",
".",
"with",
"(",
"dateStyle",
")",
";",
"}"
] | Returns a new Dater instance with the given date and date style
@param date
@return | [
"Returns",
"a",
"new",
"Dater",
"instance",
"with",
"the",
"given",
"date",
"and",
"date",
"style"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/Dater.java#L224-L226 |
ralscha/wampspring | src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java | UserEventMessenger.sendToUserDirect | public void sendToUserDirect(String topicURI, Object event, String user) {
"""
Send an EventMessage directly to the client specified with the user parameter. If
there is no entry in the {@link SimpUserRegistry} for this user nothing happens.
<p>
In contrast to {@link #sendToUser(String, Object, String)} this me... | java | public void sendToUserDirect(String topicURI, Object event, String user) {
sendToUsersDirect(topicURI, event, Collections.singleton(user));
} | [
"public",
"void",
"sendToUserDirect",
"(",
"String",
"topicURI",
",",
"Object",
"event",
",",
"String",
"user",
")",
"{",
"sendToUsersDirect",
"(",
"topicURI",
",",
"event",
",",
"Collections",
".",
"singleton",
"(",
"user",
")",
")",
";",
"}"
] | Send an EventMessage directly to the client specified with the user parameter. If
there is no entry in the {@link SimpUserRegistry} for this user nothing happens.
<p>
In contrast to {@link #sendToUser(String, Object, String)} this method does not
check if the receiver is subscribed to the destination. The
{@link Simple... | [
"Send",
"an",
"EventMessage",
"directly",
"to",
"the",
"client",
"specified",
"with",
"the",
"user",
"parameter",
".",
"If",
"there",
"is",
"no",
"entry",
"in",
"the",
"{",
"@link",
"SimpUserRegistry",
"}",
"for",
"this",
"user",
"nothing",
"happens",
".",
... | train | https://github.com/ralscha/wampspring/blob/7571bb6773b848c580b29890587eb35397bfe5b5/src/main/java/ch/rasc/wampspring/user/UserEventMessenger.java#L217-L219 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.escapeUriPathSegment | public static void escapeUriPathSegment(final Reader reader, final Writer writer)
throws IOException {
"""
<p>
Perform am URI path segment <strong>escape</strong> operation
on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following ar... | java | public static void escapeUriPathSegment(final Reader reader, final Writer writer)
throws IOException {
escapeUriPathSegment(reader, writer, DEFAULT_ENCODING);
} | [
"public",
"static",
"void",
"escapeUriPathSegment",
"(",
"final",
"Reader",
"reader",
",",
"final",
"Writer",
"writer",
")",
"throws",
"IOException",
"{",
"escapeUriPathSegment",
"(",
"reader",
",",
"writer",
",",
"DEFAULT_ENCODING",
")",
";",
"}"
] | <p>
Perform am URI path segment <strong>escape</strong> operation
on a <tt>Reader</tt> input using <tt>UTF-8</tt> as encoding,
writing results to a <tt>Writer</tt>.
</p>
<p>
The following are the only allowed chars in an URI path segment (will not be escaped):
</p>
<ul>
<li><tt>A-Z a-z 0-9</tt></li>
<li><tt>- . _ ~</tt... | [
"<p",
">",
"Perform",
"am",
"URI",
"path",
"segment",
"<strong",
">",
"escape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"Reader<",
"/",
"tt",
">",
"input",
"using",
"<tt",
">",
"UTF",
"-",
"8<",
"/",
"tt",
">",
"as",
"encoding",
"w... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L883-L886 |
tractionsoftware/gwt-traction | src/main/java/com/tractionsoftware/gwt/user/server/UTCDateTimeUtils.java | UTCDateTimeUtils.getDateBoxValue | public static final Long getDateBoxValue(TimeZone zone, Date date) {
"""
Returns the value for the UTCDateBox for a specified
{@link TimeZone} and {@link Date}.
@param zone
The {@link TimeZone} in which the Date will be
rendered.
@param date
The Date which should be displayed in the UTCTimeBox
@return... | java | public static final Long getDateBoxValue(TimeZone zone, Date date) {
if (date == null) return null;
// use a Calendar in the specified timezone to figure out the
// date and then convert to GMT
Calendar cal = GregorianCalendar.getInstance(zone);
cal.setTime(date);
Cale... | [
"public",
"static",
"final",
"Long",
"getDateBoxValue",
"(",
"TimeZone",
"zone",
",",
"Date",
"date",
")",
"{",
"if",
"(",
"date",
"==",
"null",
")",
"return",
"null",
";",
"// use a Calendar in the specified timezone to figure out the",
"// date and then convert to GMT... | Returns the value for the UTCDateBox for a specified
{@link TimeZone} and {@link Date}.
@param zone
The {@link TimeZone} in which the Date will be
rendered.
@param date
The Date which should be displayed in the UTCTimeBox
@return the value for the UTCDateBox or null if the supplied date is null | [
"Returns",
"the",
"value",
"for",
"the",
"UTCDateBox",
"for",
"a",
"specified",
"{",
"@link",
"TimeZone",
"}",
"and",
"{",
"@link",
"Date",
"}",
"."
] | train | https://github.com/tractionsoftware/gwt-traction/blob/efc1423c619439763fb064b777b7235e9ce414a3/src/main/java/com/tractionsoftware/gwt/user/server/UTCDateTimeUtils.java#L80-L102 |
MariaDB/mariadb-connector-j | src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java | CallableProcedureStatement.registerOutParameter | @Override
public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException {
"""
<p>Registers the parameter in ordinal position
<code>parameterIndex</code> to be of JDBC type
<code>sqlType</code>. All OUT parameters must be registered
before a stored procedure is executed.</p>
... | java | @Override
public void registerOutParameter(int parameterIndex, int sqlType, int scale) throws SQLException {
CallParameter callParameter = getParameter(parameterIndex);
callParameter.setOutput(true);
callParameter.setOutputSqlType(sqlType);
callParameter.setScale(scale);
} | [
"@",
"Override",
"public",
"void",
"registerOutParameter",
"(",
"int",
"parameterIndex",
",",
"int",
"sqlType",
",",
"int",
"scale",
")",
"throws",
"SQLException",
"{",
"CallParameter",
"callParameter",
"=",
"getParameter",
"(",
"parameterIndex",
")",
";",
"callPa... | <p>Registers the parameter in ordinal position
<code>parameterIndex</code> to be of JDBC type
<code>sqlType</code>. All OUT parameters must be registered
before a stored procedure is executed.</p>
<p>The JDBC type specified by <code>sqlType</code> for an OUT
parameter determines the Java type that must be used in the <... | [
"<p",
">",
"Registers",
"the",
"parameter",
"in",
"ordinal",
"position",
"<code",
">",
"parameterIndex<",
"/",
"code",
">",
"to",
"be",
"of",
"JDBC",
"type",
"<code",
">",
"sqlType<",
"/",
"code",
">",
".",
"All",
"OUT",
"parameters",
"must",
"be",
"regi... | train | https://github.com/MariaDB/mariadb-connector-j/blob/d148c7cd347c4680617be65d9e511b289d38a30b/src/main/java/org/mariadb/jdbc/CallableProcedureStatement.java#L605-L611 |
jenkinsci/jenkins | core/src/main/java/hudson/model/Descriptor.java | Descriptor.newInstance | public T newInstance(@Nullable StaplerRequest req, @Nonnull JSONObject formData) throws FormException {
"""
Creates a configured instance from the submitted form.
<p>
Hudson only invokes this method when the user wants an instance of {@code T}.
So there's no need to check that in the implementation.
<p>
S... | java | public T newInstance(@Nullable StaplerRequest req, @Nonnull JSONObject formData) throws FormException {
try {
Method m = getClass().getMethod("newInstance", StaplerRequest.class);
if(!Modifier.isAbstract(m.getDeclaringClass().getModifiers())) {
// this class overrides ne... | [
"public",
"T",
"newInstance",
"(",
"@",
"Nullable",
"StaplerRequest",
"req",
",",
"@",
"Nonnull",
"JSONObject",
"formData",
")",
"throws",
"FormException",
"{",
"try",
"{",
"Method",
"m",
"=",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"newInstance\"",
"... | Creates a configured instance from the submitted form.
<p>
Hudson only invokes this method when the user wants an instance of {@code T}.
So there's no need to check that in the implementation.
<p>
Starting 1.206, the default implementation of this method does the following:
<pre>
req.bindJSON(clazz,formData);
</pre>
... | [
"Creates",
"a",
"configured",
"instance",
"from",
"the",
"submitted",
"form",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/Descriptor.java#L571-L606 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java | DestinationManager.destinationExists | public boolean destinationExists(String destinationName, String busName) throws SIMPNullParameterException {
"""
Method destinationExists
@param destinationName
@param busName
@return boolean
@throws SIMPNullParameterException
<p>This method returns true if the named destination is known in the
destination... | java | public boolean destinationExists(String destinationName, String busName) throws SIMPNullParameterException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(tc, "destinationExists", new Object[] { destinationName, busName });
// Check that the destination na... | [
"public",
"boolean",
"destinationExists",
"(",
"String",
"destinationName",
",",
"String",
"busName",
")",
"throws",
"SIMPNullParameterException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
... | Method destinationExists
@param destinationName
@param busName
@return boolean
@throws SIMPNullParameterException
<p>This method returns true if the named destination is known in the
destination manager, otherwise it returns false.</p> | [
"Method",
"destinationExists"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/impl/DestinationManager.java#L1919-L1949 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/filecache/DistributedCache.java | DistributedCache.setCacheArchives | public static void setCacheArchives(URI[] archives, Configuration conf) {
"""
Set the configuration with the given set of archives
@param archives The list of archives that need to be localized
@param conf Configuration which will be changed
"""
String sarchives = StringUtils.uriToString(archives);
c... | java | public static void setCacheArchives(URI[] archives, Configuration conf) {
String sarchives = StringUtils.uriToString(archives);
conf.set("mapred.cache.archives", sarchives);
} | [
"public",
"static",
"void",
"setCacheArchives",
"(",
"URI",
"[",
"]",
"archives",
",",
"Configuration",
"conf",
")",
"{",
"String",
"sarchives",
"=",
"StringUtils",
".",
"uriToString",
"(",
"archives",
")",
";",
"conf",
".",
"set",
"(",
"\"mapred.cache.archive... | Set the configuration with the given set of archives
@param archives The list of archives that need to be localized
@param conf Configuration which will be changed | [
"Set",
"the",
"configuration",
"with",
"the",
"given",
"set",
"of",
"archives"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/filecache/DistributedCache.java#L716-L719 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/AppendableExpression.java | AppendableExpression.appendString | AppendableExpression appendString(Expression exp) {
"""
Returns a similar {@link AppendableExpression} but with the given (string valued) expression
appended to it.
"""
return withNewDelegate(delegate.invoke(APPEND, exp), true);
} | java | AppendableExpression appendString(Expression exp) {
return withNewDelegate(delegate.invoke(APPEND, exp), true);
} | [
"AppendableExpression",
"appendString",
"(",
"Expression",
"exp",
")",
"{",
"return",
"withNewDelegate",
"(",
"delegate",
".",
"invoke",
"(",
"APPEND",
",",
"exp",
")",
",",
"true",
")",
";",
"}"
] | Returns a similar {@link AppendableExpression} but with the given (string valued) expression
appended to it. | [
"Returns",
"a",
"similar",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/AppendableExpression.java#L141-L143 |
zaproxy/zaproxy | src/org/parosproxy/paros/model/Session.java | Session.createContext | private Context createContext(String name) {
"""
Creates a new context with the given name.
@param name the name of the context
@return the new {@code Context}.
@see #getNewContext(String)
"""
Context context = new Context(this, this.nextContextIndex++);
context.setName(name);
return context;
} | java | private Context createContext(String name) {
Context context = new Context(this, this.nextContextIndex++);
context.setName(name);
return context;
} | [
"private",
"Context",
"createContext",
"(",
"String",
"name",
")",
"{",
"Context",
"context",
"=",
"new",
"Context",
"(",
"this",
",",
"this",
".",
"nextContextIndex",
"++",
")",
";",
"context",
".",
"setName",
"(",
"name",
")",
";",
"return",
"context",
... | Creates a new context with the given name.
@param name the name of the context
@return the new {@code Context}.
@see #getNewContext(String) | [
"Creates",
"a",
"new",
"context",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/model/Session.java#L1216-L1220 |
hector-client/hector | object-mapper/src/main/java/me/prettyprint/hom/CFMappingDef.java | CFMappingDef.setDefaults | @SuppressWarnings("unchecked")
public void setDefaults(Class<T> realClass) {
"""
Setup mapping with defaults for the given class. Does not parse all
annotations.
@param realClass
"""
this.realClass = realClass;
this.keyDef = new KeyDefinition();
// find the "effective" class - skipping up th... | java | @SuppressWarnings("unchecked")
public void setDefaults(Class<T> realClass) {
this.realClass = realClass;
this.keyDef = new KeyDefinition();
// find the "effective" class - skipping up the hierarchy over inner classes
effectiveClass = realClass;
boolean entityFound;
while (!(entityFound = (nul... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"void",
"setDefaults",
"(",
"Class",
"<",
"T",
">",
"realClass",
")",
"{",
"this",
".",
"realClass",
"=",
"realClass",
";",
"this",
".",
"keyDef",
"=",
"new",
"KeyDefinition",
"(",
")",
";",
"... | Setup mapping with defaults for the given class. Does not parse all
annotations.
@param realClass | [
"Setup",
"mapping",
"with",
"defaults",
"for",
"the",
"given",
"class",
".",
"Does",
"not",
"parse",
"all",
"annotations",
"."
] | train | https://github.com/hector-client/hector/blob/a302e68ca8d91b45d332e8c9afd7d98030b54de1/object-mapper/src/main/java/me/prettyprint/hom/CFMappingDef.java#L67-L89 |
graphhopper/graphhopper | reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java | OSMReader.addBarrierEdge | Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
"""
Add a zero length edge with reduced routing options to the graph.
"""
IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
// clear blocked directions from flags
... | java | Collection<EdgeIteratorState> addBarrierEdge(long fromId, long toId, IntsRef inEdgeFlags, long nodeFlags, long wayOsmId) {
IntsRef edgeFlags = IntsRef.deepCopyOf(inEdgeFlags);
// clear blocked directions from flags
for (BooleanEncodedValue accessEnc : encodingManager.getAccessEncFromNodeFlags(no... | [
"Collection",
"<",
"EdgeIteratorState",
">",
"addBarrierEdge",
"(",
"long",
"fromId",
",",
"long",
"toId",
",",
"IntsRef",
"inEdgeFlags",
",",
"long",
"nodeFlags",
",",
"long",
"wayOsmId",
")",
"{",
"IntsRef",
"edgeFlags",
"=",
"IntsRef",
".",
"deepCopyOf",
"(... | Add a zero length edge with reduced routing options to the graph. | [
"Add",
"a",
"zero",
"length",
"edge",
"with",
"reduced",
"routing",
"options",
"to",
"the",
"graph",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/reader-osm/src/main/java/com/graphhopper/reader/osm/OSMReader.java#L843-L855 |
gosu-lang/gosu-lang | gosu-core-api/src/main/java/gw/fs/watcher/DirectoryWatcher.java | DirectoryWatcher.stopWatching | public void stopWatching() {
"""
Close the watch service. Releases resources. After calling, this instance becomes invalid and can't be used any more.
"""
try {
_watchService.close();
_watchService = null;
_watchedDirectories = null;
} catch (IOException e) {
throw new RuntimeEx... | java | public void stopWatching() {
try {
_watchService.close();
_watchService = null;
_watchedDirectories = null;
} catch (IOException e) {
throw new RuntimeException("Could not stop watching directories!", e);
}
} | [
"public",
"void",
"stopWatching",
"(",
")",
"{",
"try",
"{",
"_watchService",
".",
"close",
"(",
")",
";",
"_watchService",
"=",
"null",
";",
"_watchedDirectories",
"=",
"null",
";",
"}",
"catch",
"(",
"IOException",
"e",
")",
"{",
"throw",
"new",
"Runti... | Close the watch service. Releases resources. After calling, this instance becomes invalid and can't be used any more. | [
"Close",
"the",
"watch",
"service",
".",
"Releases",
"resources",
".",
"After",
"calling",
"this",
"instance",
"becomes",
"invalid",
"and",
"can",
"t",
"be",
"used",
"any",
"more",
"."
] | train | https://github.com/gosu-lang/gosu-lang/blob/d6e9261b137ce66fef3726cabe7826d4a1f946b7/gosu-core-api/src/main/java/gw/fs/watcher/DirectoryWatcher.java#L45-L53 |
byoutline/MockServer | src/main/java/com/byoutline/mockserver/HttpMockServer.java | HttpMockServer.startMockApiServer | public static HttpMockServer startMockApiServer(@Nonnull ConfigReader configReader,
@Nonnull NetworkType simulatedNetworkType) {
"""
Starts mock server and keeps reference to it.
@param configReader wrapper for platform specific bits
@param simulatedNetworkType delay time before response is sent.
... | java | public static HttpMockServer startMockApiServer(@Nonnull ConfigReader configReader,
@Nonnull NetworkType simulatedNetworkType) {
try {
String configJson = new String(readInitialData(configReader.getMainConfigFile()));
JSONObject jsonObj = configJson.isEmpty() ? new JSONObject... | [
"public",
"static",
"HttpMockServer",
"startMockApiServer",
"(",
"@",
"Nonnull",
"ConfigReader",
"configReader",
",",
"@",
"Nonnull",
"NetworkType",
"simulatedNetworkType",
")",
"{",
"try",
"{",
"String",
"configJson",
"=",
"new",
"String",
"(",
"readInitialData",
"... | Starts mock server and keeps reference to it.
@param configReader wrapper for platform specific bits
@param simulatedNetworkType delay time before response is sent. | [
"Starts",
"mock",
"server",
"and",
"keeps",
"reference",
"to",
"it",
"."
] | train | https://github.com/byoutline/MockServer/blob/90ab245e2eebffc88d04c2893ddbd193e67dc66e/src/main/java/com/byoutline/mockserver/HttpMockServer.java#L55-L68 |
graknlabs/grakn | server/src/server/ServerFactory.java | ServerFactory.createServer | public static Server createServer(boolean benchmark) {
"""
Create a Server configured for Grakn Core.
@return a Server instance configured for Grakn Core
"""
// Grakn Server configuration
ServerID serverID = ServerID.me();
Config config = Config.create();
JanusGraphFactory j... | java | public static Server createServer(boolean benchmark) {
// Grakn Server configuration
ServerID serverID = ServerID.me();
Config config = Config.create();
JanusGraphFactory janusGraphFactory = new JanusGraphFactory(config);
// locks
LockManager lockManager = new ServerLoc... | [
"public",
"static",
"Server",
"createServer",
"(",
"boolean",
"benchmark",
")",
"{",
"// Grakn Server configuration",
"ServerID",
"serverID",
"=",
"ServerID",
".",
"me",
"(",
")",
";",
"Config",
"config",
"=",
"Config",
".",
"create",
"(",
")",
";",
"JanusGrap... | Create a Server configured for Grakn Core.
@return a Server instance configured for Grakn Core | [
"Create",
"a",
"Server",
"configured",
"for",
"Grakn",
"Core",
"."
] | train | https://github.com/graknlabs/grakn/blob/6aaee75ea846202474d591f8809d62028262fac5/server/src/server/ServerFactory.java#L46-L73 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java | EmbeddedGobblin.loadCoreGobblinJarsToDistributedJars | private void loadCoreGobblinJarsToDistributedJars() {
"""
This returns the set of jars required by a basic Gobblin ingestion job. In general, these need to be distributed
to workers in a distributed environment.
"""
// Gobblin-api
distributeJarByClassWithPriority(State.class, 0);
// Gobblin-core
... | java | private void loadCoreGobblinJarsToDistributedJars() {
// Gobblin-api
distributeJarByClassWithPriority(State.class, 0);
// Gobblin-core
distributeJarByClassWithPriority(ConstructState.class, 0);
// Gobblin-core-base
distributeJarByClassWithPriority(InstrumentedExtractorBase.class, 0);
// Gobb... | [
"private",
"void",
"loadCoreGobblinJarsToDistributedJars",
"(",
")",
"{",
"// Gobblin-api",
"distributeJarByClassWithPriority",
"(",
"State",
".",
"class",
",",
"0",
")",
";",
"// Gobblin-core",
"distributeJarByClassWithPriority",
"(",
"ConstructState",
".",
"class",
",",... | This returns the set of jars required by a basic Gobblin ingestion job. In general, these need to be distributed
to workers in a distributed environment. | [
"This",
"returns",
"the",
"set",
"of",
"jars",
"required",
"by",
"a",
"basic",
"Gobblin",
"ingestion",
"job",
".",
"In",
"general",
"these",
"need",
"to",
"be",
"distributed",
"to",
"workers",
"in",
"a",
"distributed",
"environment",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/embedded/EmbeddedGobblin.java#L545-L582 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/json/JSONUtils.java | JSONUtils.fieldIsSerializable | static boolean fieldIsSerializable(final Field field, final boolean onlySerializePublicFields) {
"""
Check if a field is serializable. Don't serialize transient, final, synthetic, or inaccessible fields.
<p>
N.B. Tries to set field to accessible, which will require an "opens" declarations from modules that wan... | java | static boolean fieldIsSerializable(final Field field, final boolean onlySerializePublicFields) {
final int modifiers = field.getModifiers();
if ((!onlySerializePublicFields || Modifier.isPublic(modifiers)) && !Modifier.isTransient(modifiers)
&& !Modifier.isFinal(modifiers) && ((modifiers... | [
"static",
"boolean",
"fieldIsSerializable",
"(",
"final",
"Field",
"field",
",",
"final",
"boolean",
"onlySerializePublicFields",
")",
"{",
"final",
"int",
"modifiers",
"=",
"field",
".",
"getModifiers",
"(",
")",
";",
"if",
"(",
"(",
"!",
"onlySerializePublicFi... | Check if a field is serializable. Don't serialize transient, final, synthetic, or inaccessible fields.
<p>
N.B. Tries to set field to accessible, which will require an "opens" declarations from modules that want to
allow this introspection.
@param field
the field
@param onlySerializePublicFields
if true, only seriali... | [
"Check",
"if",
"a",
"field",
"is",
"serializable",
".",
"Don",
"t",
"serialize",
"transient",
"final",
"synthetic",
"or",
"inaccessible",
"fields",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/json/JSONUtils.java#L353-L360 |
pwall567/jsonutil | src/main/java/net/pwall/json/JSONObject.java | JSONObject.putValue | public JSONObject putValue(String key, boolean value) {
"""
Add a {@link JSONBoolean} representing the supplied {@code boolean} to the
{@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPoint... | java | public JSONObject putValue(String key, boolean value) {
put(key, JSONBoolean.valueOf(value));
return this;
} | [
"public",
"JSONObject",
"putValue",
"(",
"String",
"key",
",",
"boolean",
"value",
")",
"{",
"put",
"(",
"key",
",",
"JSONBoolean",
".",
"valueOf",
"(",
"value",
")",
")",
";",
"return",
"this",
";",
"}"
] | Add a {@link JSONBoolean} representing the supplied {@code boolean} to the
{@code JSONObject}.
@param key the key to use when storing the value
@param value the value
@return {@code this} (for chaining)
@throws NullPointerException if key is {@code null} | [
"Add",
"a",
"{",
"@link",
"JSONBoolean",
"}",
"representing",
"the",
"supplied",
"{",
"@code",
"boolean",
"}",
"to",
"the",
"{",
"@code",
"JSONObject",
"}",
"."
] | train | https://github.com/pwall567/jsonutil/blob/dd5960b9b0bcc9acfe6c52b884fffd9ee5f422fe/src/main/java/net/pwall/json/JSONObject.java#L172-L175 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java | GVRPreference.getBooleanProperty | public Boolean getBooleanProperty(String key, Boolean defaultValue) {
"""
Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value.
"""
String val = getProperty(key, defaultValue.toString());
Boolean bo... | java | public Boolean getBooleanProperty(String key, Boolean defaultValue) {
String val = getProperty(key, defaultValue.toString());
Boolean booleanVal = Boolean.parseBoolean(val);
return booleanVal;
} | [
"public",
"Boolean",
"getBooleanProperty",
"(",
"String",
"key",
",",
"Boolean",
"defaultValue",
")",
"{",
"String",
"val",
"=",
"getProperty",
"(",
"key",
",",
"defaultValue",
".",
"toString",
"(",
")",
")",
";",
"Boolean",
"booleanVal",
"=",
"Boolean",
"."... | Gets a boolean property with a boolean value.
@param key The key string.
@param defaultValue The default value.
@return The boolean property value. | [
"Gets",
"a",
"boolean",
"property",
"with",
"a",
"boolean",
"value",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRPreference.java#L105-L109 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java | FastaAFPChainConverter.fastaToAfpChain | public static AFPChain fastaToAfpChain(Map<String, ProteinSequence> sequences, Structure structure1,
Structure structure2) throws StructureException {
"""
Uses two sequences each with a corresponding structure to create an AFPChain corresponding to the alignment. Provided only for convenience since FastaReaders... | java | public static AFPChain fastaToAfpChain(Map<String, ProteinSequence> sequences, Structure structure1,
Structure structure2) throws StructureException {
if (sequences.size() != 2) {
throw new IllegalArgumentException("There must be exactly 2 sequences, but there were " + sequences.size());
}
if (structure1 ... | [
"public",
"static",
"AFPChain",
"fastaToAfpChain",
"(",
"Map",
"<",
"String",
",",
"ProteinSequence",
">",
"sequences",
",",
"Structure",
"structure1",
",",
"Structure",
"structure2",
")",
"throws",
"StructureException",
"{",
"if",
"(",
"sequences",
".",
"size",
... | Uses two sequences each with a corresponding structure to create an AFPChain corresponding to the alignment. Provided only for convenience since FastaReaders return such maps.
@param sequences
A Map containing exactly two entries from sequence names as Strings to gapped ProteinSequences; the name is ignored
@see #fast... | [
"Uses",
"two",
"sequences",
"each",
"with",
"a",
"corresponding",
"structure",
"to",
"create",
"an",
"AFPChain",
"corresponding",
"to",
"the",
"alignment",
".",
"Provided",
"only",
"for",
"convenience",
"since",
"FastaReaders",
"return",
"such",
"maps",
"."
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/io/FastaAFPChainConverter.java#L228-L247 |
opendigitaleducation/web-utils | src/main/java/org/vertx/java/core/http/RouteMatcher.java | RouteMatcher.getWithRegEx | public RouteMatcher getWithRegEx(String regex, Handler<HttpServerRequest> handler) {
"""
Specify a handler that will be called for a matching HTTP GET
@param regex A regular expression
@param handler The handler to call
"""
addRegEx(regex, handler, getBindings);
return this;
} | java | public RouteMatcher getWithRegEx(String regex, Handler<HttpServerRequest> handler) {
addRegEx(regex, handler, getBindings);
return this;
} | [
"public",
"RouteMatcher",
"getWithRegEx",
"(",
"String",
"regex",
",",
"Handler",
"<",
"HttpServerRequest",
">",
"handler",
")",
"{",
"addRegEx",
"(",
"regex",
",",
"handler",
",",
"getBindings",
")",
";",
"return",
"this",
";",
"}"
] | Specify a handler that will be called for a matching HTTP GET
@param regex A regular expression
@param handler The handler to call | [
"Specify",
"a",
"handler",
"that",
"will",
"be",
"called",
"for",
"a",
"matching",
"HTTP",
"GET"
] | train | https://github.com/opendigitaleducation/web-utils/blob/5c12f7e8781a9a0fbbe7b8d9fb741627aa97a1e3/src/main/java/org/vertx/java/core/http/RouteMatcher.java#L209-L212 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/notification/NotificationManager.java | NotificationManager.addNotification | @SuppressWarnings("unchecked")
public static void addNotification(Event e, String interaction) {
"""
Whenever a new event triggers it will use this method to add the corresponding notification
to the notification lists.
@param e
the event that for the notification.
@param interaction
"""
Not... | java | @SuppressWarnings("unchecked")
public static void addNotification(Event e, String interaction) {
NotificationManager.notifications.add(new InteractionNotification(getNotificationID(),
NotificationManager.sim.getSchedule().getSteps(), e.getLauncher(),
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"void",
"addNotification",
"(",
"Event",
"e",
",",
"String",
"interaction",
")",
"{",
"NotificationManager",
".",
"notifications",
".",
"add",
"(",
"new",
"InteractionNotification",
"(",
"getN... | Whenever a new event triggers it will use this method to add the corresponding notification
to the notification lists.
@param e
the event that for the notification.
@param interaction | [
"Whenever",
"a",
"new",
"event",
"triggers",
"it",
"will",
"use",
"this",
"method",
"to",
"add",
"the",
"corresponding",
"notification",
"to",
"the",
"notification",
"lists",
"."
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/notification/NotificationManager.java#L128-L136 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java | Datamodel.makeLexemeIdValue | public static LexemeIdValue makeLexemeIdValue(String id, String siteIri) {
"""
Creates an {@link LexemeIdValue}.
@param id
a string of the form Ln... where n... is the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI of the... | java | public static LexemeIdValue makeLexemeIdValue(String id, String siteIri) {
return factory.getLexemeIdValue(id, siteIri);
} | [
"public",
"static",
"LexemeIdValue",
"makeLexemeIdValue",
"(",
"String",
"id",
",",
"String",
"siteIri",
")",
"{",
"return",
"factory",
".",
"getLexemeIdValue",
"(",
"id",
",",
"siteIri",
")",
";",
"}"
] | Creates an {@link LexemeIdValue}.
@param id
a string of the form Ln... where n... is the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"
@return an {@link LexemeIdVa... | [
"Creates",
"an",
"{",
"@link",
"LexemeIdValue",
"}",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java#L114-L116 |
Jasig/uPortal | uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java | AuthorizationImpl.newPrincipal | @Override
public IAuthorizationPrincipal newPrincipal(String key, Class type) {
"""
Factory method for IAuthorizationPrincipal. First check the principal cache, and if not
present, create the principal and cache it.
@return org.apereo.portal.security.IAuthorizationPrincipal
@param key java.lang.String
@p... | java | @Override
public IAuthorizationPrincipal newPrincipal(String key, Class type) {
final Tuple<String, Class> principalKey = new Tuple<>(key, type);
final Element element = this.principalCache.get(principalKey);
// principalCache is self populating, it can never return a null entry
retu... | [
"@",
"Override",
"public",
"IAuthorizationPrincipal",
"newPrincipal",
"(",
"String",
"key",
",",
"Class",
"type",
")",
"{",
"final",
"Tuple",
"<",
"String",
",",
"Class",
">",
"principalKey",
"=",
"new",
"Tuple",
"<>",
"(",
"key",
",",
"type",
")",
";",
... | Factory method for IAuthorizationPrincipal. First check the principal cache, and if not
present, create the principal and cache it.
@return org.apereo.portal.security.IAuthorizationPrincipal
@param key java.lang.String
@param type java.lang.Class | [
"Factory",
"method",
"for",
"IAuthorizationPrincipal",
".",
"First",
"check",
"the",
"principal",
"cache",
"and",
"if",
"not",
"present",
"create",
"the",
"principal",
"and",
"cache",
"it",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-security/uPortal-security-permissions/src/main/java/org/apereo/portal/security/provider/AuthorizationImpl.java#L928-L934 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchCache.java | MatchCache.put | public Object put(Object key, Object value) {
"""
Maps the specified <code>key</code> to the specified
<code>value</code> in this hashtable. Neither the key nor the
value can be <code>null</code>.
<p>
The value can be retrieved by calling the <code>get</code> method
with a key that is equal to the original ke... | java | public Object put(Object key, Object value) {
// Make sure the value is not null
if (value == null) {
throw new NullPointerException();
}
// Makes sure the key is not already in the hashtable.
FastHashtableEntry tab[] = table;
int hash = key.hashCode();
int index = (hash & 0x7FFFFFFF)... | [
"public",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"// Make sure the value is not null",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"// Makes sure the key is not already i... | Maps the specified <code>key</code> to the specified
<code>value</code> in this hashtable. Neither the key nor the
value can be <code>null</code>.
<p>
The value can be retrieved by calling the <code>get</code> method
with a key that is equal to the original key.
@param key the hashtable key.
@param value... | [
"Maps",
"the",
"specified",
"<code",
">",
"key<",
"/",
"code",
">",
"to",
"the",
"specified",
"<code",
">",
"value<",
"/",
"code",
">",
"in",
"this",
"hashtable",
".",
"Neither",
"the",
"key",
"nor",
"the",
"value",
"can",
"be",
"<code",
">",
"null<",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/matchspace/impl/MatchCache.java#L410-L443 |
Netflix/conductor | mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/Query.java | Query.executeAndFetchFirst | public <V> V executeAndFetchFirst(Class<V> returnType) {
"""
Execute the statement and return only the first record from the result set.
@param returnType The Class to return.
@param <V> The type parameter.
@return An instance of {@literal <V>} from the result set.
"""
Object o = executeScalar();
... | java | public <V> V executeAndFetchFirst(Class<V> returnType) {
Object o = executeScalar();
if (null == o) {
return null;
}
return convert(o, returnType);
} | [
"public",
"<",
"V",
">",
"V",
"executeAndFetchFirst",
"(",
"Class",
"<",
"V",
">",
"returnType",
")",
"{",
"Object",
"o",
"=",
"executeScalar",
"(",
")",
";",
"if",
"(",
"null",
"==",
"o",
")",
"{",
"return",
"null",
";",
"}",
"return",
"convert",
... | Execute the statement and return only the first record from the result set.
@param returnType The Class to return.
@param <V> The type parameter.
@return An instance of {@literal <V>} from the result set. | [
"Execute",
"the",
"statement",
"and",
"return",
"only",
"the",
"first",
"record",
"from",
"the",
"result",
"set",
"."
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/mysql-persistence/src/main/java/com/netflix/conductor/dao/mysql/Query.java#L381-L387 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RecoverableDatabasesInner.java | RecoverableDatabasesInner.getAsync | public Observable<RecoverableDatabaseInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
"""
Gets a recoverable database, which is a resource representing a database's geo backup.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain t... | java | public Observable<RecoverableDatabaseInner> getAsync(String resourceGroupName, String serverName, String databaseName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName).map(new Func1<ServiceResponse<RecoverableDatabaseInner>, RecoverableDatabaseInner>() {
@Override
... | [
"public",
"Observable",
"<",
"RecoverableDatabaseInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",... | Gets a recoverable database, which is a resource representing a database's geo backup.
@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 databaseName The name ... | [
"Gets",
"a",
"recoverable",
"database",
"which",
"is",
"a",
"resource",
"representing",
"a",
"database",
"s",
"geo",
"backup",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/RecoverableDatabasesInner.java#L103-L110 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPP9Reader.java | MPP9Reader.processAssignmentData | private void processAssignmentData() throws IOException {
"""
This method extracts and collates resource assignment data.
@throws IOException
"""
FieldMap fieldMap = new FieldMap9(m_file.getProjectProperties(), m_file.getCustomFields());
fieldMap.createAssignmentFieldMap(m_projectProps);
... | java | private void processAssignmentData() throws IOException
{
FieldMap fieldMap = new FieldMap9(m_file.getProjectProperties(), m_file.getCustomFields());
fieldMap.createAssignmentFieldMap(m_projectProps);
DirectoryEntry assnDir = (DirectoryEntry) m_projectDir.getEntry("TBkndAssn");
VarMeta assnV... | [
"private",
"void",
"processAssignmentData",
"(",
")",
"throws",
"IOException",
"{",
"FieldMap",
"fieldMap",
"=",
"new",
"FieldMap9",
"(",
"m_file",
".",
"getProjectProperties",
"(",
")",
",",
"m_file",
".",
"getCustomFields",
"(",
")",
")",
";",
"fieldMap",
".... | This method extracts and collates resource assignment data.
@throws IOException | [
"This",
"method",
"extracts",
"and",
"collates",
"resource",
"assignment",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPP9Reader.java#L1878-L1896 |
code4everything/util | src/main/java/com/zhazhapan/util/FileExecutor.java | FileExecutor.mergeFiles | public static void mergeFiles(String[] filePath, String destinationFilePath, String[] filterRegex) throws IOException {
"""
合并文件
@param filePath 文件路径数组
@param destinationFilePath 目标文件路径
@param filterRegex 过滤规则数组(正则表达式,与文件数组一一对应,即第个文件使用一个过滤规则,为空时不过滤)
@throws IOException 异常
"""
mergeFiles(getFile... | java | public static void mergeFiles(String[] filePath, String destinationFilePath, String[] filterRegex) throws IOException {
mergeFiles(getFiles(filePath), new File(destinationFilePath), filterRegex);
} | [
"public",
"static",
"void",
"mergeFiles",
"(",
"String",
"[",
"]",
"filePath",
",",
"String",
"destinationFilePath",
",",
"String",
"[",
"]",
"filterRegex",
")",
"throws",
"IOException",
"{",
"mergeFiles",
"(",
"getFiles",
"(",
"filePath",
")",
",",
"new",
"... | 合并文件
@param filePath 文件路径数组
@param destinationFilePath 目标文件路径
@param filterRegex 过滤规则数组(正则表达式,与文件数组一一对应,即第个文件使用一个过滤规则,为空时不过滤)
@throws IOException 异常 | [
"合并文件"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/FileExecutor.java#L706-L708 |
wisdom-framework/wisdom | core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java | ConfigurationImpl.getIntegerWithDefault | @Override
public Integer getIntegerWithDefault(final String key, Integer defaultValue) {
"""
Get a Integer property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value... | java | @Override
public Integer getIntegerWithDefault(final String key, Integer defaultValue) {
return retrieve(new Callable<Integer>() {
@Override
public Integer call() throws Exception {
return configuration.getInt(key);
}
}, defaultValue);
} | [
"@",
"Override",
"public",
"Integer",
"getIntegerWithDefault",
"(",
"final",
"String",
"key",
",",
"Integer",
"defaultValue",
")",
"{",
"return",
"retrieve",
"(",
"new",
"Callable",
"<",
"Integer",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"Integer",
"c... | Get a Integer property or a default value when property cannot be found
in any configuration file.
@param key the key used in the configuration file.
@param defaultValue Default value returned, when value cannot be found in
configuration.
@return the value of the key or the default value. | [
"Get",
"a",
"Integer",
"property",
"or",
"a",
"default",
"value",
"when",
"property",
"cannot",
"be",
"found",
"in",
"any",
"configuration",
"file",
"."
] | train | https://github.com/wisdom-framework/wisdom/blob/a35b6431200fec56b178c0ff60837ed73fd7874d/core/application-configuration/src/main/java/org/wisdom/configuration/ConfigurationImpl.java#L157-L166 |
h2oai/h2o-3 | h2o-algos/src/main/java/hex/deepwater/DeepWaterTask2.java | DeepWaterTask2.setupLocal | @Override
public void setupLocal() {
"""
Do the local computation: Perform one DeepWaterTask (with run_local=true) iteration.
Pass over all the data (will be replicated in dfork() here), and use _sync_fraction random rows.
This calls DeepWaterTask's reduce() between worker threads that update the same local mo... | java | @Override
public void setupLocal() {
super.setupLocal();
_res = new DeepWaterTask(_sharedmodel, _sync_fraction, (Job)_jobKey.get());
addToPendingCount(1);
_res.dfork(null, _fr, true /*run_local*/);
} | [
"@",
"Override",
"public",
"void",
"setupLocal",
"(",
")",
"{",
"super",
".",
"setupLocal",
"(",
")",
";",
"_res",
"=",
"new",
"DeepWaterTask",
"(",
"_sharedmodel",
",",
"_sync_fraction",
",",
"(",
"Job",
")",
"_jobKey",
".",
"get",
"(",
")",
")",
";",... | Do the local computation: Perform one DeepWaterTask (with run_local=true) iteration.
Pass over all the data (will be replicated in dfork() here), and use _sync_fraction random rows.
This calls DeepWaterTask's reduce() between worker threads that update the same local model_info via Hogwild!
Once the computation is done... | [
"Do",
"the",
"local",
"computation",
":",
"Perform",
"one",
"DeepWaterTask",
"(",
"with",
"run_local",
"=",
"true",
")",
"iteration",
".",
"Pass",
"over",
"all",
"the",
"data",
"(",
"will",
"be",
"replicated",
"in",
"dfork",
"()",
"here",
")",
"and",
"us... | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-algos/src/main/java/hex/deepwater/DeepWaterTask2.java#L46-L52 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java | ByteArrayReader.readString | public String readString(String charset) throws IOException {
"""
Read a String from the array converting using the given character set.
@param charset
@return
@throws IOException
"""
long len = readInt();
if (len > available())
throw new IOException("Cannot read string of length " + len
+ " ... | java | public String readString(String charset) throws IOException {
long len = readInt();
if (len > available())
throw new IOException("Cannot read string of length " + len
+ " bytes when only " + available()
+ " bytes are available");
byte[] raw = new byte[(int) len];
readFully(raw);
if (encode) {
... | [
"public",
"String",
"readString",
"(",
"String",
"charset",
")",
"throws",
"IOException",
"{",
"long",
"len",
"=",
"readInt",
"(",
")",
";",
"if",
"(",
"len",
">",
"available",
"(",
")",
")",
"throw",
"new",
"IOException",
"(",
"\"Cannot read string of lengt... | Read a String from the array converting using the given character set.
@param charset
@return
@throws IOException | [
"Read",
"a",
"String",
"from",
"the",
"array",
"converting",
"using",
"the",
"given",
"character",
"set",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/util/ByteArrayReader.java#L249-L264 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java | VirtualNetworkGatewaysInner.beginCreateOrUpdate | public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
"""
Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNet... | java | public VirtualNetworkGatewayInner beginCreateOrUpdate(String resourceGroupName, String virtualNetworkGatewayName, VirtualNetworkGatewayInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualNetworkGatewayName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualNetworkGatewayInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualNetworkGatewayName",
",",
"VirtualNetworkGatewayInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName... | Creates or updates a virtual network gateway in the specified resource group.
@param resourceGroupName The name of the resource group.
@param virtualNetworkGatewayName The name of the virtual network gateway.
@param parameters Parameters supplied to create or update virtual network gateway operation.
@throws IllegalAr... | [
"Creates",
"or",
"updates",
"a",
"virtual",
"network",
"gateway",
"in",
"the",
"specified",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VirtualNetworkGatewaysInner.java#L284-L286 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listMultiRolePoolsAsync | public Observable<Page<WorkerPoolResourceInner>> listMultiRolePoolsAsync(final String resourceGroupName, final String name) {
"""
Get all multi-role pools.
Get all multi-role pools.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environme... | java | public Observable<Page<WorkerPoolResourceInner>> listMultiRolePoolsAsync(final String resourceGroupName, final String name) {
return listMultiRolePoolsWithServiceResponseAsync(resourceGroupName, name)
.map(new Func1<ServiceResponse<Page<WorkerPoolResourceInner>>, Page<WorkerPoolResourceInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"WorkerPoolResourceInner",
">",
">",
"listMultiRolePoolsAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
")",
"{",
"return",
"listMultiRolePoolsWithServiceResponseAsync",
"(",
"resourceGroupName... | Get all multi-role pools.
Get all multi-role pools.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the PagedList<WorkerPoolResource... | [
"Get",
"all",
"multi",
"-",
"role",
"pools",
".",
"Get",
"all",
"multi",
"-",
"role",
"pools",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L2095-L2103 |
filestack/filestack-android | samples/form/app/src/main/java/com/filestack/android/samples/form/FormFragment.java | FormFragment.getAdaptiveUrl | private String getAdaptiveUrl(FileLink fileLink, int dimen) {
"""
Creates a URL to an image sized appropriately for the form ImageView
"""
ResizeTask resizeTask = new ResizeTask.Builder()
.fit("crop")
.align("center")
.width(dimen)
.height... | java | private String getAdaptiveUrl(FileLink fileLink, int dimen) {
ResizeTask resizeTask = new ResizeTask.Builder()
.fit("crop")
.align("center")
.width(dimen)
.height(dimen)
.build();
return fileLink.imageTransform().addTask(re... | [
"private",
"String",
"getAdaptiveUrl",
"(",
"FileLink",
"fileLink",
",",
"int",
"dimen",
")",
"{",
"ResizeTask",
"resizeTask",
"=",
"new",
"ResizeTask",
".",
"Builder",
"(",
")",
".",
"fit",
"(",
"\"crop\"",
")",
".",
"align",
"(",
"\"center\"",
")",
".",
... | Creates a URL to an image sized appropriately for the form ImageView | [
"Creates",
"a",
"URL",
"to",
"an",
"image",
"sized",
"appropriately",
"for",
"the",
"form",
"ImageView"
] | train | https://github.com/filestack/filestack-android/blob/8dafa1cb5c77542c351d631be0742717b5a9d45d/samples/form/app/src/main/java/com/filestack/android/samples/form/FormFragment.java#L70-L79 |
fuinorg/units4j | src/main/java/org/fuin/units4j/Units4JUtils.java | Units4JUtils.classInfo | public static ClassInfo classInfo(final ClassLoader cl, final String className) {
"""
Loads a class by it's name and creates a Jandex class information for it.
@param cl
Class loader to use.
@param className
Full qualified name of the class.
@return Jandex class information.
"""
final Index in... | java | public static ClassInfo classInfo(final ClassLoader cl, final String className) {
final Index index = index(cl, className);
return index.getClassByName(DotName.createSimple(className));
} | [
"public",
"static",
"ClassInfo",
"classInfo",
"(",
"final",
"ClassLoader",
"cl",
",",
"final",
"String",
"className",
")",
"{",
"final",
"Index",
"index",
"=",
"index",
"(",
"cl",
",",
"className",
")",
";",
"return",
"index",
".",
"getClassByName",
"(",
"... | Loads a class by it's name and creates a Jandex class information for it.
@param cl
Class loader to use.
@param className
Full qualified name of the class.
@return Jandex class information. | [
"Loads",
"a",
"class",
"by",
"it",
"s",
"name",
"and",
"creates",
"a",
"Jandex",
"class",
"information",
"for",
"it",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/Units4JUtils.java#L449-L452 |
j256/simplejmx | src/main/java/com/j256/simplejmx/client/JmxClient.java | JmxClient.closeThrow | public void closeThrow() throws JMException {
"""
Close the client connection to the mbean server. If you want a method that does not throw then use
{@link #close()}.
"""
try {
if (jmxConnector != null) {
jmxConnector.close();
jmxConnector = null;
}
// NOTE: doesn't seem to be close method ... | java | public void closeThrow() throws JMException {
try {
if (jmxConnector != null) {
jmxConnector.close();
jmxConnector = null;
}
// NOTE: doesn't seem to be close method on MBeanServerConnection
mbeanConn = null;
} catch (IOException e) {
throw createJmException("Could not close the jmx connector... | [
"public",
"void",
"closeThrow",
"(",
")",
"throws",
"JMException",
"{",
"try",
"{",
"if",
"(",
"jmxConnector",
"!=",
"null",
")",
"{",
"jmxConnector",
".",
"close",
"(",
")",
";",
"jmxConnector",
"=",
"null",
";",
"}",
"// NOTE: doesn't seem to be close method... | Close the client connection to the mbean server. If you want a method that does not throw then use
{@link #close()}. | [
"Close",
"the",
"client",
"connection",
"to",
"the",
"mbean",
"server",
".",
"If",
"you",
"want",
"a",
"method",
"that",
"does",
"not",
"throw",
"then",
"use",
"{"
] | train | https://github.com/j256/simplejmx/blob/1a04f52512dfa0a711ba0cc7023c604dbc82a352/src/main/java/com/j256/simplejmx/client/JmxClient.java#L188-L199 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/BondTools.java | BondTools.giveAngleFromMiddle | public static double giveAngleFromMiddle(IAtom from, IAtom to1, IAtom to2) {
"""
Calls giveAngleBothMethods with bool = false.
@param from the atom to view from
@param to1 first direction to look in
@param to2 second direction to look in
@return The angle in rad from -PI to PI
"""
r... | java | public static double giveAngleFromMiddle(IAtom from, IAtom to1, IAtom to2) {
return (giveAngleBothMethods(from, to1, to2, false));
} | [
"public",
"static",
"double",
"giveAngleFromMiddle",
"(",
"IAtom",
"from",
",",
"IAtom",
"to1",
",",
"IAtom",
"to2",
")",
"{",
"return",
"(",
"giveAngleBothMethods",
"(",
"from",
",",
"to1",
",",
"to2",
",",
"false",
")",
")",
";",
"}"
] | Calls giveAngleBothMethods with bool = false.
@param from the atom to view from
@param to1 first direction to look in
@param to2 second direction to look in
@return The angle in rad from -PI to PI | [
"Calls",
"giveAngleBothMethods",
"with",
"bool",
"=",
"false",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/BondTools.java#L543-L545 |
jenkinsci/github-plugin | src/main/java/com/cloudbees/jenkins/GitHubRepositoryNameContributor.java | GitHubRepositoryNameContributor.parseAssociatedNames | @Deprecated
public /*abstract*/ void parseAssociatedNames(Job<?, ?> job, Collection<GitHubRepositoryName> result) {
"""
Looks at the definition of {@link Job} and list up the related github repositories,
then puts them into the collection.
@deprecated Use {@link #parseAssociatedNames(Item, Collection)}
"... | java | @Deprecated
public /*abstract*/ void parseAssociatedNames(Job<?, ?> job, Collection<GitHubRepositoryName> result) {
parseAssociatedNames((Item) job, result);
} | [
"@",
"Deprecated",
"public",
"/*abstract*/",
"void",
"parseAssociatedNames",
"(",
"Job",
"<",
"?",
",",
"?",
">",
"job",
",",
"Collection",
"<",
"GitHubRepositoryName",
">",
"result",
")",
"{",
"parseAssociatedNames",
"(",
"(",
"Item",
")",
"job",
",",
"resu... | Looks at the definition of {@link Job} and list up the related github repositories,
then puts them into the collection.
@deprecated Use {@link #parseAssociatedNames(Item, Collection)} | [
"Looks",
"at",
"the",
"definition",
"of",
"{"
] | train | https://github.com/jenkinsci/github-plugin/blob/4e05b9aeb488af5342c78f78aa3c55114e8d462a/src/main/java/com/cloudbees/jenkins/GitHubRepositoryNameContributor.java#L52-L55 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java | MemberSummaryBuilder.buildNestedClassesSummary | public void buildNestedClassesSummary(XMLNode node, Content memberSummaryTree) {
"""
Build the summary for the nested classes.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added
"""
MemberSummary... | java | public void buildNestedClassesSummary(XMLNode node, Content memberSummaryTree) {
MemberSummaryWriter writer =
memberSummaryWriters.get(VisibleMemberMap.Kind.INNER_CLASSES);
VisibleMemberMap visibleMemberMap =
getVisibleMemberMap(VisibleMemberMap.Kind.INNER_CLASSES);
... | [
"public",
"void",
"buildNestedClassesSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"memberSummaryTree",
")",
"{",
"MemberSummaryWriter",
"writer",
"=",
"memberSummaryWriters",
".",
"get",
"(",
"VisibleMemberMap",
".",
"Kind",
".",
"INNER_CLASSES",
")",
";",
"Vis... | Build the summary for the nested classes.
@param node the XML element that specifies which components to document
@param memberSummaryTree the content tree to which the documentation will be added | [
"Build",
"the",
"summary",
"for",
"the",
"nested",
"classes",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java#L290-L296 |
lessthanoptimal/BoofCV | integration/boofcv-android/src/main/java/boofcv/android/camera2/VisualizeCamera2Activity.java | VisualizeCamera2Activity.selectResolution | @Override
protected int selectResolution( int widthTexture, int heightTexture, Size[] resolutions ) {
"""
Selects a resolution which has the number of pixels closest to the requested value
"""
// just wanted to make sure this has been cleaned up
timeOfLastUpdated = 0;
// select the resolution here
i... | java | @Override
protected int selectResolution( int widthTexture, int heightTexture, Size[] resolutions ) {
// just wanted to make sure this has been cleaned up
timeOfLastUpdated = 0;
// select the resolution here
int bestIndex = -1;
double bestAspect = Double.MAX_VALUE;
double bestArea = 0;
for( int i = 0;... | [
"@",
"Override",
"protected",
"int",
"selectResolution",
"(",
"int",
"widthTexture",
",",
"int",
"heightTexture",
",",
"Size",
"[",
"]",
"resolutions",
")",
"{",
"// just wanted to make sure this has been cleaned up",
"timeOfLastUpdated",
"=",
"0",
";",
"// select the r... | Selects a resolution which has the number of pixels closest to the requested value | [
"Selects",
"a",
"resolution",
"which",
"has",
"the",
"number",
"of",
"pixels",
"closest",
"to",
"the",
"requested",
"value"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/integration/boofcv-android/src/main/java/boofcv/android/camera2/VisualizeCamera2Activity.java#L209-L240 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java | TileBoundingBoxUtils.tileGridZoomDecrease | public static TileGrid tileGridZoomDecrease(TileGrid tileGrid,
int zoomLevels) {
"""
Get the tile grid starting from the tile grid and zooming out /
decreasing the number of levels
@param tileGrid
current tile grid
@param zoomLevels
number of zoom levels to decrease by
@return tile grid at new zoom leve... | java | public static TileGrid tileGridZoomDecrease(TileGrid tileGrid,
int zoomLevels) {
long minX = tileGridMinZoomDecrease(tileGrid.getMinX(), zoomLevels);
long maxX = tileGridMaxZoomDecrease(tileGrid.getMaxX(), zoomLevels);
long minY = tileGridMinZoomDecrease(tileGrid.getMinY(), zoomLevels);
long maxY = tileGridM... | [
"public",
"static",
"TileGrid",
"tileGridZoomDecrease",
"(",
"TileGrid",
"tileGrid",
",",
"int",
"zoomLevels",
")",
"{",
"long",
"minX",
"=",
"tileGridMinZoomDecrease",
"(",
"tileGrid",
".",
"getMinX",
"(",
")",
",",
"zoomLevels",
")",
";",
"long",
"maxX",
"="... | Get the tile grid starting from the tile grid and zooming out /
decreasing the number of levels
@param tileGrid
current tile grid
@param zoomLevels
number of zoom levels to decrease by
@return tile grid at new zoom level
@since 2.0.1 | [
"Get",
"the",
"tile",
"grid",
"starting",
"from",
"the",
"tile",
"grid",
"and",
"zooming",
"out",
"/",
"decreasing",
"the",
"number",
"of",
"levels"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/tiles/TileBoundingBoxUtils.java#L1316-L1324 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java | IntegrationAccountsInner.createOrUpdateAsync | public Observable<IntegrationAccountInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, IntegrationAccountInner integrationAccount) {
"""
Creates or updates an integration account.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration ac... | java | public Observable<IntegrationAccountInner> createOrUpdateAsync(String resourceGroupName, String integrationAccountName, IntegrationAccountInner integrationAccount) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, integrationAccountName, integrationAccount).map(new Func1<ServiceResponse<Integra... | [
"public",
"Observable",
"<",
"IntegrationAccountInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"IntegrationAccountInner",
"integrationAccount",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"... | Creates or updates an integration account.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param integrationAccount The integration account.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the Integration... | [
"Creates",
"or",
"updates",
"an",
"integration",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/IntegrationAccountsInner.java#L690-L697 |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/sat/CleaneLingSolver.java | CleaneLingSolver.addOcc | private void addOcc(final int lit, final CLClause c) {
"""
Adds a clause to a literal's occurrence list.
@param lit the literal
@param c the clause
"""
assert this.dense;
occs(lit).add(c);
touch(lit);
} | java | private void addOcc(final int lit, final CLClause c) {
assert this.dense;
occs(lit).add(c);
touch(lit);
} | [
"private",
"void",
"addOcc",
"(",
"final",
"int",
"lit",
",",
"final",
"CLClause",
"c",
")",
"{",
"assert",
"this",
".",
"dense",
";",
"occs",
"(",
"lit",
")",
".",
"add",
"(",
"c",
")",
";",
"touch",
"(",
"lit",
")",
";",
"}"
] | Adds a clause to a literal's occurrence list.
@param lit the literal
@param c the clause | [
"Adds",
"a",
"clause",
"to",
"a",
"literal",
"s",
"occurrence",
"list",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/sat/CleaneLingSolver.java#L601-L605 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java | ModelsEngine.meanDoublematrixColumn | public static double meanDoublematrixColumn( double[][] matrix, int column ) {
"""
Return the mean of a column of a matrix.
@param matrix matrix of the value to calculate.
@param column index of the column to calculate the variance.
@return mean.
"""
double mean;
mean = 0;
int l... | java | public static double meanDoublematrixColumn( double[][] matrix, int column ) {
double mean;
mean = 0;
int length = matrix.length;
for( int i = 0; i < length; i++ ) {
mean += matrix[i][column];
}
return mean / length;
} | [
"public",
"static",
"double",
"meanDoublematrixColumn",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"int",
"column",
")",
"{",
"double",
"mean",
";",
"mean",
"=",
"0",
";",
"int",
"length",
"=",
"matrix",
".",
"length",
";",
"for",
"(",
"int",
... | Return the mean of a column of a matrix.
@param matrix matrix of the value to calculate.
@param column index of the column to calculate the variance.
@return mean. | [
"Return",
"the",
"mean",
"of",
"a",
"column",
"of",
"a",
"matrix",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/libs/modules/ModelsEngine.java#L1396-L1409 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java | IDNA.convertToUnicode | @Deprecated
public static StringBuffer convertToUnicode(UCharacterIterator src, int options)
throws StringPrepParseException {
"""
IDNA2003: Function that implements the ToUnicode operation as defined in the IDNA RFC.
This operation is done on <b>single labels</b> before sending it to something tha... | java | @Deprecated
public static StringBuffer convertToUnicode(UCharacterIterator src, int options)
throws StringPrepParseException{
return IDNA2003.convertToUnicode(src, options);
} | [
"@",
"Deprecated",
"public",
"static",
"StringBuffer",
"convertToUnicode",
"(",
"UCharacterIterator",
"src",
",",
"int",
"options",
")",
"throws",
"StringPrepParseException",
"{",
"return",
"IDNA2003",
".",
"convertToUnicode",
"(",
"src",
",",
"options",
")",
";",
... | IDNA2003: Function that implements the ToUnicode operation as defined in the IDNA RFC.
This operation is done on <b>single labels</b> before sending it to something that expects
Unicode names. A label is an individual part of a domain name. Labels are usually
separated by dots; for e.g." "www.example.com" is composed o... | [
"IDNA2003",
":",
"Function",
"that",
"implements",
"the",
"ToUnicode",
"operation",
"as",
"defined",
"in",
"the",
"IDNA",
"RFC",
".",
"This",
"operation",
"is",
"done",
"on",
"<b",
">",
"single",
"labels<",
"/",
"b",
">",
"before",
"sending",
"it",
"to",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java#L747-L751 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java | RunbookDraftsInner.beginReplaceContentAsync | public Observable<String> beginReplaceContentAsync(String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) {
"""
Replaces the runbook draft content.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation accou... | java | public Observable<String> beginReplaceContentAsync(String resourceGroupName, String automationAccountName, String runbookName, String runbookContent) {
return beginReplaceContentWithServiceResponseAsync(resourceGroupName, automationAccountName, runbookName, runbookContent).map(new Func1<ServiceResponseWithHeade... | [
"public",
"Observable",
"<",
"String",
">",
"beginReplaceContentAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"runbookName",
",",
"String",
"runbookContent",
")",
"{",
"return",
"beginReplaceContentWithServiceResponseAsyn... | Replaces the runbook draft content.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param runbookName The runbook name.
@param runbookContent The runbook draft content.
@throws IllegalArgumentException thrown if parameters fail the validation
... | [
"Replaces",
"the",
"runbook",
"draft",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/RunbookDraftsInner.java#L304-L311 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java | CFG.getPredecessorWithEdgeType | public BasicBlock getPredecessorWithEdgeType(BasicBlock target, @Type int edgeType) {
"""
Get the first predecessor reachable from given edge type.
@param target
the target block
@param edgeType
the edge type leading from the predecessor
@return the predecessor, or null if there is no incoming edge with the... | java | public BasicBlock getPredecessorWithEdgeType(BasicBlock target, @Type int edgeType) {
Edge edge = getIncomingEdgeWithType(target, edgeType);
return edge != null ? edge.getSource() : null;
} | [
"public",
"BasicBlock",
"getPredecessorWithEdgeType",
"(",
"BasicBlock",
"target",
",",
"@",
"Type",
"int",
"edgeType",
")",
"{",
"Edge",
"edge",
"=",
"getIncomingEdgeWithType",
"(",
"target",
",",
"edgeType",
")",
";",
"return",
"edge",
"!=",
"null",
"?",
"ed... | Get the first predecessor reachable from given edge type.
@param target
the target block
@param edgeType
the edge type leading from the predecessor
@return the predecessor, or null if there is no incoming edge with the
specified edge type | [
"Get",
"the",
"first",
"predecessor",
"reachable",
"from",
"given",
"edge",
"type",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/CFG.java#L412-L415 |
gsi-upm/Shanks | shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java | ScenarioPortrayal.updateDataSerieOnScatterPlot | public void updateDataSerieOnScatterPlot(String scatterID, int index, double[][] dataSerie) {
"""
Updates the data in the scatterPlot
@param scatterID
@param index the data serie to modify
@param dataSerie the series data
"""
if (this.scatterPlots.containsKey(scatterID)){
if (this.sc... | java | public void updateDataSerieOnScatterPlot(String scatterID, int index, double[][] dataSerie){
if (this.scatterPlots.containsKey(scatterID)){
if (this.scatterPlotsData.containsKey(scatterID)) {
double[][] current = this.scatterPlotsData.get(scatterID);
this.scatterP... | [
"public",
"void",
"updateDataSerieOnScatterPlot",
"(",
"String",
"scatterID",
",",
"int",
"index",
",",
"double",
"[",
"]",
"[",
"]",
"dataSerie",
")",
"{",
"if",
"(",
"this",
".",
"scatterPlots",
".",
"containsKey",
"(",
"scatterID",
")",
")",
"{",
"if",
... | Updates the data in the scatterPlot
@param scatterID
@param index the data serie to modify
@param dataSerie the series data | [
"Updates",
"the",
"data",
"in",
"the",
"scatterPlot"
] | train | https://github.com/gsi-upm/Shanks/blob/35d87a81c22731f4f83bbd0571c9c6d466bd16be/shanks-core/src/main/java/es/upm/dit/gsi/shanks/model/scenario/portrayal/ScenarioPortrayal.java#L322-L335 |
grpc/grpc-java | core/src/main/java/io/grpc/internal/MessageFramer.java | MessageFramer.writeBufferChain | private void writeBufferChain(BufferChainOutputStream bufferChain, boolean compressed) {
"""
Write a message that has been serialized to a sequence of buffers.
"""
ByteBuffer header = ByteBuffer.wrap(headerScratch);
header.put(compressed ? COMPRESSED : UNCOMPRESSED);
int messageLength = bufferChain... | java | private void writeBufferChain(BufferChainOutputStream bufferChain, boolean compressed) {
ByteBuffer header = ByteBuffer.wrap(headerScratch);
header.put(compressed ? COMPRESSED : UNCOMPRESSED);
int messageLength = bufferChain.readableBytes();
header.putInt(messageLength);
WritableBuffer writeableHead... | [
"private",
"void",
"writeBufferChain",
"(",
"BufferChainOutputStream",
"bufferChain",
",",
"boolean",
"compressed",
")",
"{",
"ByteBuffer",
"header",
"=",
"ByteBuffer",
".",
"wrap",
"(",
"headerScratch",
")",
";",
"header",
".",
"put",
"(",
"compressed",
"?",
"C... | Write a message that has been serialized to a sequence of buffers. | [
"Write",
"a",
"message",
"that",
"has",
"been",
"serialized",
"to",
"a",
"sequence",
"of",
"buffers",
"."
] | train | https://github.com/grpc/grpc-java/blob/973885457f9609de232d2553b82c67f6c3ff57bf/core/src/main/java/io/grpc/internal/MessageFramer.java#L235-L263 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationBoard.java | NotificationBoard.setFooterMargin | public void setFooterMargin(int l, int t, int r, int b) {
"""
Set the margin of the footer.
@param l
@param t
@param r
@param b
"""
mFooter.setMargin(l, t, r, b);
} | java | public void setFooterMargin(int l, int t, int r, int b) {
mFooter.setMargin(l, t, r, b);
} | [
"public",
"void",
"setFooterMargin",
"(",
"int",
"l",
",",
"int",
"t",
",",
"int",
"r",
",",
"int",
"b",
")",
"{",
"mFooter",
".",
"setMargin",
"(",
"l",
",",
"t",
",",
"r",
",",
"b",
")",
";",
"}"
] | Set the margin of the footer.
@param l
@param t
@param r
@param b | [
"Set",
"the",
"margin",
"of",
"the",
"footer",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationBoard.java#L568-L570 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/creational/builder/mapped/MappedKeyDirector.java | MappedKeyDirector.constructDocument | public void constructDocument(String id, MappedKeyEngineer<K,V> engineer) {
"""
Director method to construct a document
@param id the for construction
@param engineer the strategy creation
"""
try
{
//construct map
Map<K,V> textableMap = this.constructMapToText(id);
engineer.construc... | java | public void constructDocument(String id, MappedKeyEngineer<K,V> engineer)
{
try
{
//construct map
Map<K,V> textableMap = this.constructMapToText(id);
engineer.construct(id,textableMap);
}
catch (NoDataFoundException e)
{
throw new SystemException("No textable found for id="+id+" ... | [
"public",
"void",
"constructDocument",
"(",
"String",
"id",
",",
"MappedKeyEngineer",
"<",
"K",
",",
"V",
">",
"engineer",
")",
"{",
"try",
"{",
"//construct map\r",
"Map",
"<",
"K",
",",
"V",
">",
"textableMap",
"=",
"this",
".",
"constructMapToText",
"("... | Director method to construct a document
@param id the for construction
@param engineer the strategy creation | [
"Director",
"method",
"to",
"construct",
"a",
"document"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/patterns/creational/builder/mapped/MappedKeyDirector.java#L32-L45 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java | ManagementEnforcer.getFilteredGroupingPolicy | public List<List<String>> getFilteredGroupingPolicy(int fieldIndex, String... fieldValues) {
"""
getFilteredGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
@param fieldIndex the policy rule's start index to be matched.
@param fieldValues the field values to be ... | java | public List<List<String>> getFilteredGroupingPolicy(int fieldIndex, String... fieldValues) {
return getFilteredNamedGroupingPolicy("g", fieldIndex, fieldValues);
} | [
"public",
"List",
"<",
"List",
"<",
"String",
">",
">",
"getFilteredGroupingPolicy",
"(",
"int",
"fieldIndex",
",",
"String",
"...",
"fieldValues",
")",
"{",
"return",
"getFilteredNamedGroupingPolicy",
"(",
"\"g\"",
",",
"fieldIndex",
",",
"fieldValues",
")",
";... | getFilteredGroupingPolicy gets all the role inheritance rules in the policy, field filters can be specified.
@param fieldIndex the policy rule's start index to be matched.
@param fieldValues the field values to be matched, value ""
means not to match this field.
@return the filtered "g" policy rules. | [
"getFilteredGroupingPolicy",
"gets",
"all",
"the",
"role",
"inheritance",
"rules",
"in",
"the",
"policy",
"field",
"filters",
"can",
"be",
"specified",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/main/ManagementEnforcer.java#L187-L189 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/Tesseract1.java | Tesseract1.setTessVariable | @Override
public void setTessVariable(String key, String value) {
"""
Set the value of Tesseract's internal parameter.
@param key variable name, e.g., <code>tessedit_create_hocr</code>,
<code>tessedit_char_whitelist</code>, etc.
@param value value for corresponding variable, e.g., "1", "0",
"0123456789",... | java | @Override
public void setTessVariable(String key, String value) {
prop.setProperty(key, value);
} | [
"@",
"Override",
"public",
"void",
"setTessVariable",
"(",
"String",
"key",
",",
"String",
"value",
")",
"{",
"prop",
".",
"setProperty",
"(",
"key",
",",
"value",
")",
";",
"}"
] | Set the value of Tesseract's internal parameter.
@param key variable name, e.g., <code>tessedit_create_hocr</code>,
<code>tessedit_char_whitelist</code>, etc.
@param value value for corresponding variable, e.g., "1", "0",
"0123456789", etc. | [
"Set",
"the",
"value",
"of",
"Tesseract",
"s",
"internal",
"parameter",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/Tesseract1.java#L148-L151 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/util/log/LoggerUtil.java | LoggerUtil.initializeLogging | public static String initializeLogging() throws IOException {
"""
For Spring Boot with slf4j SimpleLogger, an opportunity to initialize logging before Spring starts logging.
Otherwise for slf4j, properties have already been defaulted before we have a chance to set them.
See mdw-spring-boot AutoConfig for initi... | java | public static String initializeLogging() throws IOException {
System.setProperty("org.slf4j.simpleLogger.logFile", "System.out");
System.setProperty("org.slf4j.simpleLogger.showDateTime", "true");
System.setProperty("org.slf4j.simpleLogger.dateTimeFormat", "yyyyMMdd.HH:mm:ss.SSS");
// Pe... | [
"public",
"static",
"String",
"initializeLogging",
"(",
")",
"throws",
"IOException",
"{",
"System",
".",
"setProperty",
"(",
"\"org.slf4j.simpleLogger.logFile\"",
",",
"\"System.out\"",
")",
";",
"System",
".",
"setProperty",
"(",
"\"org.slf4j.simpleLogger.showDateTime\"... | For Spring Boot with slf4j SimpleLogger, an opportunity to initialize logging before Spring starts logging.
Otherwise for slf4j, properties have already been defaulted before we have a chance to set them.
See mdw-spring-boot AutoConfig for initialization of logback for pure Spring Boot apps. | [
"For",
"Spring",
"Boot",
"with",
"slf4j",
"SimpleLogger",
"an",
"opportunity",
"to",
"initialize",
"logging",
"before",
"Spring",
"starts",
"logging",
".",
"Otherwise",
"for",
"slf4j",
"properties",
"have",
"already",
"been",
"defaulted",
"before",
"we",
"have",
... | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/util/log/LoggerUtil.java#L51-L69 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/CloseableThreadContext.java | CloseableThreadContext.putAll | public static CloseableThreadContext.Instance putAll(final Map<String, String> values) {
"""
Populates the Thread Context Map with the supplied key/value pairs. Any existing keys in the
{@link ThreadContext} will be replaced with the supplied values, and restored back to their original value when
the instance is... | java | public static CloseableThreadContext.Instance putAll(final Map<String, String> values) {
return new CloseableThreadContext.Instance().putAll(values);
} | [
"public",
"static",
"CloseableThreadContext",
".",
"Instance",
"putAll",
"(",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"values",
")",
"{",
"return",
"new",
"CloseableThreadContext",
".",
"Instance",
"(",
")",
".",
"putAll",
"(",
"values",
")",
";",... | Populates the Thread Context Map with the supplied key/value pairs. Any existing keys in the
{@link ThreadContext} will be replaced with the supplied values, and restored back to their original value when
the instance is closed.
@param values The map of key/value pairs to be added
@return a new instance that will back... | [
"Populates",
"the",
"Thread",
"Context",
"Map",
"with",
"the",
"supplied",
"key",
"/",
"value",
"pairs",
".",
"Any",
"existing",
"keys",
"in",
"the",
"{",
"@link",
"ThreadContext",
"}",
"will",
"be",
"replaced",
"with",
"the",
"supplied",
"values",
"and",
... | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/CloseableThreadContext.java#L99-L101 |
Netflix/karyon | karyon2-governator/src/main/java/netflix/karyon/Karyon.java | Karyon.forRequestHandler | public static KaryonServer forRequestHandler(int port, final RequestHandler<ByteBuf, ByteBuf> handler,
Module... modules) {
"""
Creates a new {@link KaryonServer} that has a single HTTP server instance which delegates all request
handling to {@link RequestHandler}.... | java | public static KaryonServer forRequestHandler(int port, final RequestHandler<ByteBuf, ByteBuf> handler,
Module... modules) {
return forRequestHandler(port, handler, toBootstrapModule(modules));
} | [
"public",
"static",
"KaryonServer",
"forRequestHandler",
"(",
"int",
"port",
",",
"final",
"RequestHandler",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"handler",
",",
"Module",
"...",
"modules",
")",
"{",
"return",
"forRequestHandler",
"(",
"port",
",",
"handler",
... | Creates a new {@link KaryonServer} that has a single HTTP server instance which delegates all request
handling to {@link RequestHandler}.
The {@link HttpServer} is created using {@link KaryonTransport#newHttpServer(int, HttpRequestHandler)}
@param port Port for the server.
@param handler Request Handler
@param modules... | [
"Creates",
"a",
"new",
"{",
"@link",
"KaryonServer",
"}",
"that",
"has",
"a",
"single",
"HTTP",
"server",
"instance",
"which",
"delegates",
"all",
"request",
"handling",
"to",
"{",
"@link",
"RequestHandler",
"}",
".",
"The",
"{",
"@link",
"HttpServer",
"}",
... | train | https://github.com/Netflix/karyon/blob/d50bc0ff37693ef3fbda373e90a109d1f92e0b9a/karyon2-governator/src/main/java/netflix/karyon/Karyon.java#L47-L50 |
alkacon/opencms-core | src/org/opencms/file/CmsObject.java | CmsObject.importRelation | public void importRelation(String resourceName, String targetPath, String relationType) throws CmsException {
"""
Imports a new relation to the given resource.<p>
@param resourceName the name of the source resource
@param targetPath the path of the target resource
@param relationType the type of the relation
... | java | public void importRelation(String resourceName, String targetPath, String relationType) throws CmsException {
createRelation(resourceName, targetPath, relationType, true);
} | [
"public",
"void",
"importRelation",
"(",
"String",
"resourceName",
",",
"String",
"targetPath",
",",
"String",
"relationType",
")",
"throws",
"CmsException",
"{",
"createRelation",
"(",
"resourceName",
",",
"targetPath",
",",
"relationType",
",",
"true",
")",
";",... | Imports a new relation to the given resource.<p>
@param resourceName the name of the source resource
@param targetPath the path of the target resource
@param relationType the type of the relation
@throws CmsException if something goes wrong | [
"Imports",
"a",
"new",
"relation",
"to",
"the",
"given",
"resource",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/CmsObject.java#L1979-L1982 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java | XSLTElementDef.equalsMayBeNull | private static boolean equalsMayBeNull(Object obj1, Object obj2) {
"""
Tell if two objects are equal, when either one may be null.
If both are null, they are considered equal.
@param obj1 A reference to the first object, or null.
@param obj2 A reference to the second object, or null.
@return true if the to... | java | private static boolean equalsMayBeNull(Object obj1, Object obj2)
{
return (obj2 == obj1)
|| ((null != obj1) && (null != obj2) && obj2.equals(obj1));
} | [
"private",
"static",
"boolean",
"equalsMayBeNull",
"(",
"Object",
"obj1",
",",
"Object",
"obj2",
")",
"{",
"return",
"(",
"obj2",
"==",
"obj1",
")",
"||",
"(",
"(",
"null",
"!=",
"obj1",
")",
"&&",
"(",
"null",
"!=",
"obj2",
")",
"&&",
"obj2",
".",
... | Tell if two objects are equal, when either one may be null.
If both are null, they are considered equal.
@param obj1 A reference to the first object, or null.
@param obj2 A reference to the second object, or null.
@return true if the to objects are equal by both being null or
because obj2.equals(obj1) returns true. | [
"Tell",
"if",
"two",
"objects",
"are",
"equal",
"when",
"either",
"one",
"may",
"be",
"null",
".",
"If",
"both",
"are",
"null",
"they",
"are",
"considered",
"equal",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/XSLTElementDef.java#L305-L309 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/converter/json/ListExtractor.java | ListExtractor.setObjectValue | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
"""
Set a value within a list
@param pConverter the global converter in order to be able do dispatch for
serializing inner data t... | java | public Object setObjectValue(StringToObjectConverter pConverter, Object pInner, String pIndex, Object pValue)
throws IllegalAccessException, InvocationTargetException {
List list = (List) pInner;
int idx;
try {
idx = Integer.parseInt(pIndex);
} catch (NumberForma... | [
"public",
"Object",
"setObjectValue",
"(",
"StringToObjectConverter",
"pConverter",
",",
"Object",
"pInner",
",",
"String",
"pIndex",
",",
"Object",
"pValue",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
"{",
"List",
"list",
"=",
"(",
"... | Set a value within a list
@param pConverter the global converter in order to be able do dispatch for
serializing inner data types
@param pInner object on which to set the value (which must be a {@link List})
@param pIndex index (as string) where to set the value within the list
@param pValue the new value to set
@ret... | [
"Set",
"a",
"value",
"within",
"a",
"list"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/converter/json/ListExtractor.java#L82-L102 |
duracloud/duracloud | stitch/src/main/java/org/duracloud/stitch/FileStitcherDriver.java | FileStitcherDriver.stitch | public void stitch(String spaceId, String manifestId, File toDir)
throws Exception {
"""
This method retrieves the chunks manifest specified by the arg space-id
and manifest-id (content-id), then reconstitues the chunks defined in
the manifest into the original file at the arg to-directory.
@param spa... | java | public void stitch(String spaceId, String manifestId, File toDir)
throws Exception {
verifyDir(toDir);
Content content = stitcher.getContentFromManifest(spaceId, manifestId);
writeContentToDir(content, toDir);
} | [
"public",
"void",
"stitch",
"(",
"String",
"spaceId",
",",
"String",
"manifestId",
",",
"File",
"toDir",
")",
"throws",
"Exception",
"{",
"verifyDir",
"(",
"toDir",
")",
";",
"Content",
"content",
"=",
"stitcher",
".",
"getContentFromManifest",
"(",
"spaceId",... | This method retrieves the chunks manifest specified by the arg space-id
and manifest-id (content-id), then reconstitues the chunks defined in
the manifest into the original file at the arg to-directory.
@param spaceId containing chunks manifest
@param manifestId of the manifest (content-id)
@param toDir destin... | [
"This",
"method",
"retrieves",
"the",
"chunks",
"manifest",
"specified",
"by",
"the",
"arg",
"space",
"-",
"id",
"and",
"manifest",
"-",
"id",
"(",
"content",
"-",
"id",
")",
"then",
"reconstitues",
"the",
"chunks",
"defined",
"in",
"the",
"manifest",
"int... | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/stitch/src/main/java/org/duracloud/stitch/FileStitcherDriver.java#L65-L71 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/config/DefaultSqlConfig.java | DefaultSqlConfig.getConfig | public static SqlConfig getConfig(final String dataSourceName, final boolean autoCommit, final boolean readOnly,
final int transactionIsolation) {
"""
データソース名を指定してSqlConfigを取得する
@param dataSourceName データソース名
@param autoCommit 自動コミットの指定
@param readOnly 読み取り専用モードの指定
@param transactionIsolation トランザクション隔離レベル... | java | public static SqlConfig getConfig(final String dataSourceName, final boolean autoCommit, final boolean readOnly,
final int transactionIsolation) {
DataSourceConnectionSupplierImpl connectionSupplier = new DataSourceConnectionSupplierImpl(dataSourceName);
connectionSupplier.setDefaultAutoCommit(autoCommit);
con... | [
"public",
"static",
"SqlConfig",
"getConfig",
"(",
"final",
"String",
"dataSourceName",
",",
"final",
"boolean",
"autoCommit",
",",
"final",
"boolean",
"readOnly",
",",
"final",
"int",
"transactionIsolation",
")",
"{",
"DataSourceConnectionSupplierImpl",
"connectionSupp... | データソース名を指定してSqlConfigを取得する
@param dataSourceName データソース名
@param autoCommit 自動コミットの指定
@param readOnly 読み取り専用モードの指定
@param transactionIsolation トランザクション隔離レベルの指定
@return SqlConfigオブジェクト | [
"データソース名を指定してSqlConfigを取得する"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/config/DefaultSqlConfig.java#L225-L232 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/TraceComponent.java | TraceComponent.setTraceSpec | @Deprecated
protected void setTraceSpec(String s) {
"""
Update the active trace settings for this component based on the provided string.
Protected: Not an SPI method.
@param ts TraceSpecification
"""
if (s != null) {
TraceSpecification ts = new TraceSpecification(s, null, false);
... | java | @Deprecated
protected void setTraceSpec(String s) {
if (s != null) {
TraceSpecification ts = new TraceSpecification(s, null, false);
setTraceSpec(ts);
}
} | [
"@",
"Deprecated",
"protected",
"void",
"setTraceSpec",
"(",
"String",
"s",
")",
"{",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"TraceSpecification",
"ts",
"=",
"new",
"TraceSpecification",
"(",
"s",
",",
"null",
",",
"false",
")",
";",
"setTraceSpec",
"("... | Update the active trace settings for this component based on the provided string.
Protected: Not an SPI method.
@param ts TraceSpecification | [
"Update",
"the",
"active",
"trace",
"settings",
"for",
"this",
"component",
"based",
"on",
"the",
"provided",
"string",
".",
"Protected",
":",
"Not",
"an",
"SPI",
"method",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/TraceComponent.java#L236-L242 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_email_obfuscated_refresh_POST | public void serviceName_email_obfuscated_refresh_POST(String serviceName, OvhDomainContactTypeEnum[] contactType) throws IOException {
"""
Regenerate the obfuscated email address
REST: POST /domain/{serviceName}/email/obfuscated/refresh
@param contactType [required] Contact type
@param serviceName [required] ... | java | public void serviceName_email_obfuscated_refresh_POST(String serviceName, OvhDomainContactTypeEnum[] contactType) throws IOException {
String qPath = "/domain/{serviceName}/email/obfuscated/refresh";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o... | [
"public",
"void",
"serviceName_email_obfuscated_refresh_POST",
"(",
"String",
"serviceName",
",",
"OvhDomainContactTypeEnum",
"[",
"]",
"contactType",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/email/obfuscated/refresh\"",
";",
"String... | Regenerate the obfuscated email address
REST: POST /domain/{serviceName}/email/obfuscated/refresh
@param contactType [required] Contact type
@param serviceName [required] The internal name of your domain
@deprecated | [
"Regenerate",
"the",
"obfuscated",
"email",
"address"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1532-L1538 |
jdereg/java-util | src/main/java/com/cedarsoftware/util/DeepEquals.java | DeepEquals.compareSortedMap | private static boolean compareSortedMap(SortedMap map1, SortedMap map2, Deque stack, Set visited) {
"""
Deeply compare two SortedMap instances. This method walks the Maps in order,
taking advantage of the fact that the Maps are SortedMaps.
@param map1 SortedMap one
@param map2 SortedMap two
@param stack add i... | java | private static boolean compareSortedMap(SortedMap map1, SortedMap map2, Deque stack, Set visited)
{
// Same instance check already performed...
if (map1.size() != map2.size())
{
return false;
}
Iterator i1 = map1.entrySet().iterator();
Iterator i2 = map2... | [
"private",
"static",
"boolean",
"compareSortedMap",
"(",
"SortedMap",
"map1",
",",
"SortedMap",
"map2",
",",
"Deque",
"stack",
",",
"Set",
"visited",
")",
"{",
"// Same instance check already performed...",
"if",
"(",
"map1",
".",
"size",
"(",
")",
"!=",
"map2",... | Deeply compare two SortedMap instances. This method walks the Maps in order,
taking advantage of the fact that the Maps are SortedMaps.
@param map1 SortedMap one
@param map2 SortedMap two
@param stack add items to compare to the Stack (Stack versus recursion)
@param visited Set containing items that have already been ... | [
"Deeply",
"compare",
"two",
"SortedMap",
"instances",
".",
"This",
"method",
"walks",
"the",
"Maps",
"in",
"order",
"taking",
"advantage",
"of",
"the",
"fact",
"that",
"the",
"Maps",
"are",
"SortedMaps",
"."
] | train | https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/DeepEquals.java#L510-L541 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java | InsertAllRequest.newBuilder | public static Builder newBuilder(TableId table, RowToInsert... rows) {
"""
Returns a builder for an {@code InsertAllRequest} object given the destination table and the
rows to insert.
"""
return newBuilder(table, ImmutableList.copyOf(rows));
} | java | public static Builder newBuilder(TableId table, RowToInsert... rows) {
return newBuilder(table, ImmutableList.copyOf(rows));
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"table",
",",
"RowToInsert",
"...",
"rows",
")",
"{",
"return",
"newBuilder",
"(",
"table",
",",
"ImmutableList",
".",
"copyOf",
"(",
"rows",
")",
")",
";",
"}"
] | Returns a builder for an {@code InsertAllRequest} object given the destination table and the
rows to insert. | [
"Returns",
"a",
"builder",
"for",
"an",
"{"
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/InsertAllRequest.java#L351-L353 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRSkeleton.java | GVRSkeleton.setBindPose | public void setBindPose(float[] rotations, float[] positions) {
"""
Set the bind pose of the skeleton to describe the initial position and
orientation of the bones when the skinned meshes are not modified.
<p>
The <i>bind pose</i> of the skeleton defines the position and orientation of the bones before any
ani... | java | public void setBindPose(float[] rotations, float[] positions)
{
mBindPose.setWorldRotations(rotations);
mBindPose.setWorldPositions(positions);
if (mInverseBindPose == null)
{
mInverseBindPose = new GVRPose(this);
}
mInverseBindPose.inverse(mBindPose);
... | [
"public",
"void",
"setBindPose",
"(",
"float",
"[",
"]",
"rotations",
",",
"float",
"[",
"]",
"positions",
")",
"{",
"mBindPose",
".",
"setWorldRotations",
"(",
"rotations",
")",
";",
"mBindPose",
".",
"setWorldPositions",
"(",
"positions",
")",
";",
"if",
... | Set the bind pose of the skeleton to describe the initial position and
orientation of the bones when the skinned meshes are not modified.
<p>
The <i>bind pose</i> of the skeleton defines the position and orientation of the bones before any
animations are applied. Usually it represents the pose that matches
the source v... | [
"Set",
"the",
"bind",
"pose",
"of",
"the",
"skeleton",
"to",
"describe",
"the",
"initial",
"position",
"and",
"orientation",
"of",
"the",
"bones",
"when",
"the",
"skinned",
"meshes",
"are",
"not",
"modified",
".",
"<p",
">",
"The",
"<i",
">",
"bind",
"po... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/animation/GVRSkeleton.java#L402-L413 |
jOOQ/jOOL | jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java | Agg.minAllBy | public static <T, U> Collector<T, ?, Seq<T>> minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
"""
Get a {@link Collector} that calculates the <code>MIN()</code> function, producing multiple results.
"""
return maxAllBy(function, comparator.reversed());
} | java | public static <T, U> Collector<T, ?, Seq<T>> minAllBy(Function<? super T, ? extends U> function, Comparator<? super U> comparator) {
return maxAllBy(function, comparator.reversed());
} | [
"public",
"static",
"<",
"T",
",",
"U",
">",
"Collector",
"<",
"T",
",",
"?",
",",
"Seq",
"<",
"T",
">",
">",
"minAllBy",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"U",
">",
"function",
",",
"Comparator",
"<",
"?",
"super",
... | Get a {@link Collector} that calculates the <code>MIN()</code> function, producing multiple results. | [
"Get",
"a",
"{"
] | train | https://github.com/jOOQ/jOOL/blob/889d87c85ca57bafd4eddd78e0f7ae2804d2ee86/jOOL-java-8/src/main/java/org/jooq/lambda/Agg.java#L256-L258 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/SemanticAPI.java | SemanticAPI.addvoicetorecofortext | public static BaseResult addvoicetorecofortext(String accessToken, String voiceId, InputStream inputStream) {
"""
提交语音
@param accessToken 接口调用凭证
@param voiceId 语音唯一标识
@param inputStream 文件格式 只支持mp3,16k,单声道,最大1M
@return BaseResult
@since 2.8.22
"""
return addvoicetorecofortext(accessToken, v... | java | public static BaseResult addvoicetorecofortext(String accessToken, String voiceId, InputStream inputStream) {
return addvoicetorecofortext(accessToken, voiceId, null, inputStream);
} | [
"public",
"static",
"BaseResult",
"addvoicetorecofortext",
"(",
"String",
"accessToken",
",",
"String",
"voiceId",
",",
"InputStream",
"inputStream",
")",
"{",
"return",
"addvoicetorecofortext",
"(",
"accessToken",
",",
"voiceId",
",",
"null",
",",
"inputStream",
")... | 提交语音
@param accessToken 接口调用凭证
@param voiceId 语音唯一标识
@param inputStream 文件格式 只支持mp3,16k,单声道,最大1M
@return BaseResult
@since 2.8.22 | [
"提交语音"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/SemanticAPI.java#L97-L99 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.markResourceAsVisitedBy | public void markResourceAsVisitedBy(CmsDbContext dbc, String poolName, CmsResource resource, CmsUser user)
throws CmsException {
"""
Mark the given resource as visited by the user.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param resource the resource to mark ... | java | public void markResourceAsVisitedBy(CmsDbContext dbc, String poolName, CmsResource resource, CmsUser user)
throws CmsException {
getSubscriptionDriver().markResourceAsVisitedBy(dbc, poolName, resource, user);
} | [
"public",
"void",
"markResourceAsVisitedBy",
"(",
"CmsDbContext",
"dbc",
",",
"String",
"poolName",
",",
"CmsResource",
"resource",
",",
"CmsUser",
"user",
")",
"throws",
"CmsException",
"{",
"getSubscriptionDriver",
"(",
")",
".",
"markResourceAsVisitedBy",
"(",
"d... | Mark the given resource as visited by the user.<p>
@param dbc the database context
@param poolName the name of the database pool to use
@param resource the resource to mark as visited
@param user the user that visited the resource
@throws CmsException if something goes wrong | [
"Mark",
"the",
"given",
"resource",
"as",
"visited",
"by",
"the",
"user",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5704-L5708 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.enableCheckpointing | public StreamExecutionEnvironment enableCheckpointing(long interval, CheckpointingMode mode) {
"""
Enables checkpointing for the streaming job. The distributed state of the streaming
dataflow will be periodically snapshotted. In case of a failure, the streaming
dataflow will be restarted from the latest complete... | java | public StreamExecutionEnvironment enableCheckpointing(long interval, CheckpointingMode mode) {
checkpointCfg.setCheckpointingMode(mode);
checkpointCfg.setCheckpointInterval(interval);
return this;
} | [
"public",
"StreamExecutionEnvironment",
"enableCheckpointing",
"(",
"long",
"interval",
",",
"CheckpointingMode",
"mode",
")",
"{",
"checkpointCfg",
".",
"setCheckpointingMode",
"(",
"mode",
")",
";",
"checkpointCfg",
".",
"setCheckpointInterval",
"(",
"interval",
")",
... | Enables checkpointing for the streaming job. The distributed state of the streaming
dataflow will be periodically snapshotted. In case of a failure, the streaming
dataflow will be restarted from the latest completed checkpoint.
<p>The job draws checkpoints periodically, in the given interval. The system uses the
given... | [
"Enables",
"checkpointing",
"for",
"the",
"streaming",
"job",
".",
"The",
"distributed",
"state",
"of",
"the",
"streaming",
"dataflow",
"will",
"be",
"periodically",
"snapshotted",
".",
"In",
"case",
"of",
"a",
"failure",
"the",
"streaming",
"dataflow",
"will",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L338-L342 |
xvik/dropwizard-guicey | src/main/java/ru/vyarus/dropwizard/guice/module/context/ConfigurationInfo.java | ConfigurationInfo.getItems | public <T, K extends ItemInfo> List<Class<T>> getItems(final ConfigItem type, final Predicate<K> filter) {
"""
Used to query items of one configuration type (e.g. only installers or bundles). Some common filters are
predefined in {@link Filters}. Use {@link Predicate#and(Predicate)}, {@link Predicate#or(Predicate... | java | public <T, K extends ItemInfo> List<Class<T>> getItems(final ConfigItem type, final Predicate<K> filter) {
final List<Class<T>> items = getItems(type);
return filter(items, filter);
} | [
"public",
"<",
"T",
",",
"K",
"extends",
"ItemInfo",
">",
"List",
"<",
"Class",
"<",
"T",
">",
">",
"getItems",
"(",
"final",
"ConfigItem",
"type",
",",
"final",
"Predicate",
"<",
"K",
">",
"filter",
")",
"{",
"final",
"List",
"<",
"Class",
"<",
"T... | Used to query items of one configuration type (e.g. only installers or bundles). Some common filters are
predefined in {@link Filters}. Use {@link Predicate#and(Predicate)}, {@link Predicate#or(Predicate)}
and {@link Predicate#negate()} to reuse default filters.
<p>
Pay attention that disabled (or disabled and never re... | [
"Used",
"to",
"query",
"items",
"of",
"one",
"configuration",
"type",
"(",
"e",
".",
"g",
".",
"only",
"installers",
"or",
"bundles",
")",
".",
"Some",
"common",
"filters",
"are",
"predefined",
"in",
"{",
"@link",
"Filters",
"}",
".",
"Use",
"{",
"@lin... | train | https://github.com/xvik/dropwizard-guicey/blob/dd39ad77283555be21f606d5ebf0f11207a733d4/src/main/java/ru/vyarus/dropwizard/guice/module/context/ConfigurationInfo.java#L77-L80 |
ziccardi/jnrpe | jnrpe-plugins/src/main/java/it/jnrpe/plugin/CCheckOracle.java | CCheckOracle.checkCache | private List<Metric> checkCache(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
"""
Checks cache hit rates.
@param c
The connection to the database
@param cl
The command line as received from JNRPE
@return The result of the plugin
@throws BadThresholdException
-
... | java | private List<Metric> checkCache(final Connection c, final ICommandLine cl) throws BadThresholdException, SQLException {
List<Metric> metricList = new ArrayList<Metric>();
// Metrics cache_buf, cache_lib
String sQry1 = "select (1-(pr.value/(dbg.value+cg.value)))*100" + " from v$sysstat pr, v$sy... | [
"private",
"List",
"<",
"Metric",
">",
"checkCache",
"(",
"final",
"Connection",
"c",
",",
"final",
"ICommandLine",
"cl",
")",
"throws",
"BadThresholdException",
",",
"SQLException",
"{",
"List",
"<",
"Metric",
">",
"metricList",
"=",
"new",
"ArrayList",
"<",
... | Checks cache hit rates.
@param c
The connection to the database
@param cl
The command line as received from JNRPE
@return The result of the plugin
@throws BadThresholdException
- | [
"Checks",
"cache",
"hit",
"rates",
"."
] | train | https://github.com/ziccardi/jnrpe/blob/ac9046355851136994388442b01ba4063305f9c4/jnrpe-plugins/src/main/java/it/jnrpe/plugin/CCheckOracle.java#L190-L228 |
eclipse/hawkbit | hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaDistributionSetTypeManagement.java | JpaDistributionSetTypeManagement.assertSoftwareModuleTypeQuota | private void assertSoftwareModuleTypeQuota(final long id, final int requested) {
"""
Enforces the quota specifiying the maximum number of
{@link SoftwareModuleType}s per {@link DistributionSetType}.
@param id
of the distribution set type
@param requested
number of software module types to check
@throws Q... | java | private void assertSoftwareModuleTypeQuota(final long id, final int requested) {
QuotaHelper.assertAssignmentQuota(id, requested,
quotaManagement.getMaxSoftwareModuleTypesPerDistributionSetType(), SoftwareModuleType.class,
DistributionSetType.class, distributionSetTypeRepository:... | [
"private",
"void",
"assertSoftwareModuleTypeQuota",
"(",
"final",
"long",
"id",
",",
"final",
"int",
"requested",
")",
"{",
"QuotaHelper",
".",
"assertAssignmentQuota",
"(",
"id",
",",
"requested",
",",
"quotaManagement",
".",
"getMaxSoftwareModuleTypesPerDistributionSe... | Enforces the quota specifiying the maximum number of
{@link SoftwareModuleType}s per {@link DistributionSetType}.
@param id
of the distribution set type
@param requested
number of software module types to check
@throws QuotaExceededException
if the software module type quota is exceeded | [
"Enforces",
"the",
"quota",
"specifiying",
"the",
"maximum",
"number",
"of",
"{",
"@link",
"SoftwareModuleType",
"}",
"s",
"per",
"{",
"@link",
"DistributionSetType",
"}",
"."
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-repository/hawkbit-repository-jpa/src/main/java/org/eclipse/hawkbit/repository/jpa/JpaDistributionSetTypeManagement.java#L169-L173 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setStorageAccountAsync | public Observable<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map<String, String> tags) {
"""
Creates or updates a new storage ... | java | public Observable<StorageBundle> setStorageAccountAsync(String vaultBaseUrl, String storageAccountName, String resourceId, String activeKeyName, boolean autoRegenerateKey, String regenerationPeriod, StorageAccountAttributes storageAccountAttributes, Map<String, String> tags) {
return setStorageAccountWithServic... | [
"public",
"Observable",
"<",
"StorageBundle",
">",
"setStorageAccountAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"resourceId",
",",
"String",
"activeKeyName",
",",
"boolean",
"autoRegenerateKey",
",",
"String",
"regeneratio... | Creates or updates a new storage account. This operation requires the storage/set permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param resourceId Storage account resource id.
@param activeKeyName Current active st... | [
"Creates",
"or",
"updates",
"a",
"new",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"set",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L10013-L10020 |
drewwills/cernunnos | cernunnos-core/src/main/java/org/danann/cernunnos/xml/ReadDocumentPhrase.java | ReadDocumentPhrase.loadDocument | protected Element loadDocument(String ctx_str, String loc_str, EntityResolver resolver) {
"""
Loads a DOM4J document from the specified contact and location and returns the root Element
"""
try {
final URL ctx = new URL(ctx_str);
final URL doc = new URL(ctx, loc_str);
... | java | protected Element loadDocument(String ctx_str, String loc_str, EntityResolver resolver) {
try {
final URL ctx = new URL(ctx_str);
final URL doc = new URL(ctx, loc_str);
// Use an EntityResolver if provided...
final SAXReader rdr = new SAXReader();
... | [
"protected",
"Element",
"loadDocument",
"(",
"String",
"ctx_str",
",",
"String",
"loc_str",
",",
"EntityResolver",
"resolver",
")",
"{",
"try",
"{",
"final",
"URL",
"ctx",
"=",
"new",
"URL",
"(",
"ctx_str",
")",
";",
"final",
"URL",
"doc",
"=",
"new",
"U... | Loads a DOM4J document from the specified contact and location and returns the root Element | [
"Loads",
"a",
"DOM4J",
"document",
"from",
"the",
"specified",
"contact",
"and",
"location",
"and",
"returns",
"the",
"root",
"Element"
] | train | https://github.com/drewwills/cernunnos/blob/dc6848e0253775e22b6c869fd06506d4ddb6d728/cernunnos-core/src/main/java/org/danann/cernunnos/xml/ReadDocumentPhrase.java#L98-L120 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/utils/SmapStratum.java | SmapStratum.addFile | public synchronized void addFile(String filename, String filePath) {
"""
Adds record of a new file, by filename and path. The path
may be relative to a source compilation path.
@param fileName the filename to add, unqualified by path
@param filePath the path for the filename, potentially relative
to a sourc... | java | public synchronized void addFile(String filename, String filePath) {
// fix this to check if duplicate name exists.
int fileIndex = fileNameList.indexOf(filename);
if (fileIndex == -1) {
fileNameList.add(filename);
filePathList.add(filePath);
}
} | [
"public",
"synchronized",
"void",
"addFile",
"(",
"String",
"filename",
",",
"String",
"filePath",
")",
"{",
"// fix this to check if duplicate name exists.",
"int",
"fileIndex",
"=",
"fileNameList",
".",
"indexOf",
"(",
"filename",
")",
";",
"if",
"(",
"fileIndex",... | Adds record of a new file, by filename and path. The path
may be relative to a source compilation path.
@param fileName the filename to add, unqualified by path
@param filePath the path for the filename, potentially relative
to a source compilation path | [
"Adds",
"record",
"of",
"a",
"new",
"file",
"by",
"filename",
"and",
"path",
".",
"The",
"path",
"may",
"be",
"relative",
"to",
"a",
"source",
"compilation",
"path",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsp/src/com/ibm/ws/jsp/translator/utils/SmapStratum.java#L153-L160 |
keenlabs/KeenClient-Java | core/src/main/java/io/keen/client/java/FileEventStore.java | FileEventStore.getNextFileForEvent | private File getNextFileForEvent(File dir, Calendar timestamp, int counter) {
"""
Gets the file to use for a new event in the given collection with the given timestamp,
using the provided counter.
@param dir The directory in which the file should be created.
@param timestamp The timestamp to use as the ... | java | private File getNextFileForEvent(File dir, Calendar timestamp, int counter) {
long timestampInMillis = timestamp.getTimeInMillis();
String name = Long.toString(timestampInMillis);
return new File(dir, name + "." + counter);
} | [
"private",
"File",
"getNextFileForEvent",
"(",
"File",
"dir",
",",
"Calendar",
"timestamp",
",",
"int",
"counter",
")",
"{",
"long",
"timestampInMillis",
"=",
"timestamp",
".",
"getTimeInMillis",
"(",
")",
";",
"String",
"name",
"=",
"Long",
".",
"toString",
... | Gets the file to use for a new event in the given collection with the given timestamp,
using the provided counter.
@param dir The directory in which the file should be created.
@param timestamp The timestamp to use as the base file name.
@param counter The counter to append to the file name.
@return The file t... | [
"Gets",
"the",
"file",
"to",
"use",
"for",
"a",
"new",
"event",
"in",
"the",
"given",
"collection",
"with",
"the",
"given",
"timestamp",
"using",
"the",
"provided",
"counter",
"."
] | train | https://github.com/keenlabs/KeenClient-Java/blob/2ea021547b5338257c951a2596bd49749038d018/core/src/main/java/io/keen/client/java/FileEventStore.java#L337-L341 |
mozilla/rhino | toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java | SwingGui.setResizeWeight | static void setResizeWeight(JSplitPane pane, double weight) {
"""
Calls {@link JSplitPane#setResizeWeight} via reflection.
For compatibility, since JDK < 1.3 does not have this method.
"""
try {
Method m = JSplitPane.class.getMethod("setResizeWeight",
... | java | static void setResizeWeight(JSplitPane pane, double weight) {
try {
Method m = JSplitPane.class.getMethod("setResizeWeight",
new Class[]{double.class});
m.invoke(pane, new Object[]{new Double(weight)});
} catch (NoSuchMethodExcept... | [
"static",
"void",
"setResizeWeight",
"(",
"JSplitPane",
"pane",
",",
"double",
"weight",
")",
"{",
"try",
"{",
"Method",
"m",
"=",
"JSplitPane",
".",
"class",
".",
"getMethod",
"(",
"\"setResizeWeight\"",
",",
"new",
"Class",
"[",
"]",
"{",
"double",
".",
... | Calls {@link JSplitPane#setResizeWeight} via reflection.
For compatibility, since JDK < 1.3 does not have this method. | [
"Calls",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/debugger/SwingGui.java#L786-L795 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.optPoint | public static <P extends Enum<P>> Point optPoint(final JSONObject json, P e, Point fallback) {
"""
Return the value mapped by enum if it exists and is a {@link JSONObject} by mapping "x" and
"y" members into a {@link Point}. The values in {@code fallback} are used if either field is
missing; if {@code fallback} ... | java | public static <P extends Enum<P>> Point optPoint(final JSONObject json, P e, Point fallback) {
JSONObject value = optJSONObject(json, e);
Log.d(Log.SUBSYSTEM.JSON, TAG, "optPoint(): raw: %s", value);
Point p = asPoint(value, fallback);
return p;
} | [
"public",
"static",
"<",
"P",
"extends",
"Enum",
"<",
"P",
">",
">",
"Point",
"optPoint",
"(",
"final",
"JSONObject",
"json",
",",
"P",
"e",
",",
"Point",
"fallback",
")",
"{",
"JSONObject",
"value",
"=",
"optJSONObject",
"(",
"json",
",",
"e",
")",
... | Return the value mapped by enum if it exists and is a {@link JSONObject} by mapping "x" and
"y" members into a {@link Point}. The values in {@code fallback} are used if either field is
missing; if {@code fallback} is {@code null}, 0 (zero) is used.
@param json {@code JSONObject} to get data from
@param e {@... | [
"Return",
"the",
"value",
"mapped",
"by",
"enum",
"if",
"it",
"exists",
"and",
"is",
"a",
"{",
"@link",
"JSONObject",
"}",
"by",
"mapping",
"x",
"and",
"y",
"members",
"into",
"a",
"{",
"@link",
"Point",
"}",
".",
"The",
"values",
"in",
"{",
"@code",... | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L505-L511 |
javalite/activeweb | activeweb/src/main/java/org/javalite/activeweb/AppContext.java | AppContext.get | public <T> T get(String name, Class<T> type) {
"""
Retrieves object by name. Convenience generic method.
@param name name of object
@param type type requested.
@return object by name
"""
Object o = context.get(name);
return o == null? null : (T) o;
} | java | public <T> T get(String name, Class<T> type){
Object o = context.get(name);
return o == null? null : (T) o;
} | [
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"Object",
"o",
"=",
"context",
".",
"get",
"(",
"name",
")",
";",
"return",
"o",
"==",
"null",
"?",
"null",
":",
"(",
"T",
")",
"o",
... | Retrieves object by name. Convenience generic method.
@param name name of object
@param type type requested.
@return object by name | [
"Retrieves",
"object",
"by",
"name",
".",
"Convenience",
"generic",
"method",
"."
] | train | https://github.com/javalite/activeweb/blob/f25f589da94852b6f5625182360732e0861794a6/activeweb/src/main/java/org/javalite/activeweb/AppContext.java#L49-L52 |
teatrove/teatrove | teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java | TeaToolsUtils.createMethodDescriptions | public MethodDescription[] createMethodDescriptions(
MethodDescriptor[] mds) {
"""
Returns an array of MethodDescriptions to wrap and describe the
specified MethodDescriptors.
"""
if (mds == null) {
return null;
}
Method... | java | public MethodDescription[] createMethodDescriptions(
MethodDescriptor[] mds) {
if (mds == null) {
return null;
}
MethodDescription[] descriptions =
new MethodDescription[mds.length];
for (int i = 0; i < mds.l... | [
"public",
"MethodDescription",
"[",
"]",
"createMethodDescriptions",
"(",
"MethodDescriptor",
"[",
"]",
"mds",
")",
"{",
"if",
"(",
"mds",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"MethodDescription",
"[",
"]",
"descriptions",
"=",
"new",
"MethodD... | Returns an array of MethodDescriptions to wrap and describe the
specified MethodDescriptors. | [
"Returns",
"an",
"array",
"of",
"MethodDescriptions",
"to",
"wrap",
"and",
"describe",
"the",
"specified",
"MethodDescriptors",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/teaservlet/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L126-L140 |
mgormley/prim | src/main/java/edu/jhu/prim/arrays/DoubleArrays.java | DoubleArrays.lastIndexOf | public static int lastIndexOf(double[] array, double val) {
"""
Gets the last index of a given value in an array or -1 if not present.
"""
for (int i=array.length-1; i >= 0; i--) {
if (array[i] == val) {
return i;
}
}
return -1;
} | java | public static int lastIndexOf(double[] array, double val) {
for (int i=array.length-1; i >= 0; i--) {
if (array[i] == val) {
return i;
}
}
return -1;
} | [
"public",
"static",
"int",
"lastIndexOf",
"(",
"double",
"[",
"]",
"array",
",",
"double",
"val",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"array",
".",
"length",
"-",
"1",
";",
"i",
">=",
"0",
";",
"i",
"--",
")",
"{",
"if",
"(",
"array",
"[",
... | Gets the last index of a given value in an array or -1 if not present. | [
"Gets",
"the",
"last",
"index",
"of",
"a",
"given",
"value",
"in",
"an",
"array",
"or",
"-",
"1",
"if",
"not",
"present",
"."
] | train | https://github.com/mgormley/prim/blob/5dce5e1ae94a9ae558a6262fc246e1a24f56686c/src/main/java/edu/jhu/prim/arrays/DoubleArrays.java#L524-L531 |
mojohaus/jaxb2-maven-plugin | src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java | FileSystemUtilities.listFiles | @SuppressWarnings("all")
public static List<File> listFiles(final File fileOrDir,
final List<Filter<File>> fileFilters,
final Log log) {
"""
If the supplied fileOrDir is a File, it is added to the returned List if any of the filters ... | java | @SuppressWarnings("all")
public static List<File> listFiles(final File fileOrDir,
final List<Filter<File>> fileFilters,
final Log log) {
return listFiles(fileOrDir, fileFilters, false, log);
} | [
"@",
"SuppressWarnings",
"(",
"\"all\"",
")",
"public",
"static",
"List",
"<",
"File",
">",
"listFiles",
"(",
"final",
"File",
"fileOrDir",
",",
"final",
"List",
"<",
"Filter",
"<",
"File",
">",
">",
"fileFilters",
",",
"final",
"Log",
"log",
")",
"{",
... | If the supplied fileOrDir is a File, it is added to the returned List if any of the filters Match.
If the supplied fileOrDir is a Directory, it is listed and any of the files immediately within the fileOrDir
directory are returned within the resulting List provided that they match any of the supplied filters.
@param f... | [
"If",
"the",
"supplied",
"fileOrDir",
"is",
"a",
"File",
"it",
"is",
"added",
"to",
"the",
"returned",
"List",
"if",
"any",
"of",
"the",
"filters",
"Match",
".",
"If",
"the",
"supplied",
"fileOrDir",
"is",
"a",
"Directory",
"it",
"is",
"listed",
"and",
... | train | https://github.com/mojohaus/jaxb2-maven-plugin/blob/e3c4e47943b15282e5a6e850bbfb1588d8452a0a/src/main/java/org/codehaus/mojo/jaxb2/shared/FileSystemUtilities.java#L564-L569 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.license_windows_serviceName_upgrade_duration_GET | public OvhOrder license_windows_serviceName_upgrade_duration_GET(String serviceName, String duration, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException {
"""
Get prices and contracts information
REST: GET /order/license/windows/{serviceName}/upgrade/{duration}
@param vers... | java | public OvhOrder license_windows_serviceName_upgrade_duration_GET(String serviceName, String duration, OvhWindowsSqlVersionEnum sqlVersion, OvhWindowsOsVersionEnum version) throws IOException {
String qPath = "/order/license/windows/{serviceName}/upgrade/{duration}";
StringBuilder sb = path(qPath, serviceName, durat... | [
"public",
"OvhOrder",
"license_windows_serviceName_upgrade_duration_GET",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhWindowsSqlVersionEnum",
"sqlVersion",
",",
"OvhWindowsOsVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
... | Get prices and contracts information
REST: GET /order/license/windows/{serviceName}/upgrade/{duration}
@param version [required] The windows version you want to enable on your windows license
@param sqlVersion [required] The SQL Server version to enable on this license Windows license
@param serviceName [required] The... | [
"Get",
"prices",
"and",
"contracts",
"information"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L1192-L1199 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.callSetter | public static void callSetter(Object obj, String prop, Object value) throws PageException {
"""
to invoke a setter Method of a Object
@param obj Object to invoke method from
@param prop Name of the Method without get
@param value Value to set to the Method
@throws PageException
"""
try {
getSetter(... | java | public static void callSetter(Object obj, String prop, Object value) throws PageException {
try {
getSetter(obj, prop, value).invoke(obj);
}
catch (InvocationTargetException e) {
Throwable target = e.getTargetException();
if (target instanceof PageException) throw (PageException) target;
throw Ca... | [
"public",
"static",
"void",
"callSetter",
"(",
"Object",
"obj",
",",
"String",
"prop",
",",
"Object",
"value",
")",
"throws",
"PageException",
"{",
"try",
"{",
"getSetter",
"(",
"obj",
",",
"prop",
",",
"value",
")",
".",
"invoke",
"(",
"obj",
")",
";"... | to invoke a setter Method of a Object
@param obj Object to invoke method from
@param prop Name of the Method without get
@param value Value to set to the Method
@throws PageException | [
"to",
"invoke",
"a",
"setter",
"Method",
"of",
"a",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L1074-L1086 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/Node.java | Node.checkHealth | protected void checkHealth(long threshold, NodeHealthChecker healthChecker) {
"""
Check the health of the node and try to ping it if necessary.
@param threshold the threshold after which the node should be removed
@param healthChecker the node health checker
"""
final int state = this.state;
... | java | protected void checkHealth(long threshold, NodeHealthChecker healthChecker) {
final int state = this.state;
if (anyAreSet(state, REMOVED | ACTIVE_PING)) {
return;
}
healthCheckPing(threshold, healthChecker);
} | [
"protected",
"void",
"checkHealth",
"(",
"long",
"threshold",
",",
"NodeHealthChecker",
"healthChecker",
")",
"{",
"final",
"int",
"state",
"=",
"this",
".",
"state",
";",
"if",
"(",
"anyAreSet",
"(",
"state",
",",
"REMOVED",
"|",
"ACTIVE_PING",
")",
")",
... | Check the health of the node and try to ping it if necessary.
@param threshold the threshold after which the node should be removed
@param healthChecker the node health checker | [
"Check",
"the",
"health",
"of",
"the",
"node",
"and",
"try",
"to",
"ping",
"it",
"if",
"necessary",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/Node.java#L189-L195 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobExecutionEventSubmitter.java | JobExecutionEventSubmitter.submitTaskStateEvent | private void submitTaskStateEvent(TaskState taskState, Map<String, String> jobMetadata) {
"""
Submits an event for a given {@link TaskState}. It will include all metadata specified in the jobMetadata parameter.
"""
ImmutableMap.Builder<String, String> taskMetadataBuilder = new ImmutableMap.Builder<>();
... | java | private void submitTaskStateEvent(TaskState taskState, Map<String, String> jobMetadata) {
ImmutableMap.Builder<String, String> taskMetadataBuilder = new ImmutableMap.Builder<>();
taskMetadataBuilder.putAll(jobMetadata);
taskMetadataBuilder.put(METADATA_TASK_ID, taskState.getTaskId());
taskMetadataBuild... | [
"private",
"void",
"submitTaskStateEvent",
"(",
"TaskState",
"taskState",
",",
"Map",
"<",
"String",
",",
"String",
">",
"jobMetadata",
")",
"{",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"String",
">",
"taskMetadataBuilder",
"=",
"new",
"ImmutableMap"... | Submits an event for a given {@link TaskState}. It will include all metadata specified in the jobMetadata parameter. | [
"Submits",
"an",
"event",
"for",
"a",
"given",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/JobExecutionEventSubmitter.java#L105-L117 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/StringExpression.java | StringExpression.notLike | public BooleanExpression notLike(Expression<String> str, char escape) {
"""
Create a {@code this not like str} expression
@param str string
@return this not like str
"""
return like(str, escape).not();
} | java | public BooleanExpression notLike(Expression<String> str, char escape) {
return like(str, escape).not();
} | [
"public",
"BooleanExpression",
"notLike",
"(",
"Expression",
"<",
"String",
">",
"str",
",",
"char",
"escape",
")",
"{",
"return",
"like",
"(",
"str",
",",
"escape",
")",
".",
"not",
"(",
")",
";",
"}"
] | Create a {@code this not like str} expression
@param str string
@return this not like str | [
"Create",
"a",
"{",
"@code",
"this",
"not",
"like",
"str",
"}",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/StringExpression.java#L638-L640 |
osmdroid/osmdroid | osmdroid-android/src/main/java/org/osmdroid/views/Projection.java | Projection.adjustOffsets | public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) {
"""
Adjust the offsets so that this geo point projects into that pixel
@since 6.0.0
"""
if (pPixel == null) {
return;
}
final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null);
final P... | java | public void adjustOffsets(final IGeoPoint pGeoPoint, final PointF pPixel) {
if (pPixel == null) {
return;
}
final Point unRotatedExpectedPixel = unrotateAndScalePoint((int)pPixel.x, (int)pPixel.y, null);
final Point unRotatedActualPixel = toPixels(pGeoPoint, null);
final long deltaX = unRotatedExpectedPixe... | [
"public",
"void",
"adjustOffsets",
"(",
"final",
"IGeoPoint",
"pGeoPoint",
",",
"final",
"PointF",
"pPixel",
")",
"{",
"if",
"(",
"pPixel",
"==",
"null",
")",
"{",
"return",
";",
"}",
"final",
"Point",
"unRotatedExpectedPixel",
"=",
"unrotateAndScalePoint",
"(... | Adjust the offsets so that this geo point projects into that pixel
@since 6.0.0 | [
"Adjust",
"the",
"offsets",
"so",
"that",
"this",
"geo",
"point",
"projects",
"into",
"that",
"pixel"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-android/src/main/java/org/osmdroid/views/Projection.java#L687-L696 |
windup/windup | graph/api/src/main/java/org/jboss/windup/graph/service/LinkService.java | LinkService.getOrCreate | public LinkModel getOrCreate(String description, String href) {
"""
Tries to find a link with the specified description and href. If it cannot, then it will return a new one.
"""
Iterable<Vertex> results = (List<Vertex>)getQuery().traverse(g -> g.has(LinkModel.PROPERTY_DESCRIPTION, description).has(Lin... | java | public LinkModel getOrCreate(String description, String href)
{
Iterable<Vertex> results = (List<Vertex>)getQuery().traverse(g -> g.has(LinkModel.PROPERTY_DESCRIPTION, description).has(LinkModel.PROPERTY_LINK, href)).getRawTraversal().toList();
if (!results.iterator().hasNext())
{
... | [
"public",
"LinkModel",
"getOrCreate",
"(",
"String",
"description",
",",
"String",
"href",
")",
"{",
"Iterable",
"<",
"Vertex",
">",
"results",
"=",
"(",
"List",
"<",
"Vertex",
">",
")",
"getQuery",
"(",
")",
".",
"traverse",
"(",
"g",
"->",
"g",
".",
... | Tries to find a link with the specified description and href. If it cannot, then it will return a new one. | [
"Tries",
"to",
"find",
"a",
"link",
"with",
"the",
"specified",
"description",
"and",
"href",
".",
"If",
"it",
"cannot",
"then",
"it",
"will",
"return",
"a",
"new",
"one",
"."
] | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/graph/api/src/main/java/org/jboss/windup/graph/service/LinkService.java#L28-L39 |
thinkaurelius/titan | titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/embedded/CassandraEmbeddedKeyColumnValueStore.java | CassandraEmbeddedKeyColumnValueStore.getKeySlice | private List<Row> getKeySlice(Token start,
Token end,
@Nullable SliceQuery sliceQuery,
int pageSize,
long nowMillis) throws BackendException {
"""
Create a RangeSliceCommand and r... | java | private List<Row> getKeySlice(Token start,
Token end,
@Nullable SliceQuery sliceQuery,
int pageSize,
long nowMillis) throws BackendException {
IPartitioner partitioner = Storag... | [
"private",
"List",
"<",
"Row",
">",
"getKeySlice",
"(",
"Token",
"start",
",",
"Token",
"end",
",",
"@",
"Nullable",
"SliceQuery",
"sliceQuery",
",",
"int",
"pageSize",
",",
"long",
"nowMillis",
")",
"throws",
"BackendException",
"{",
"IPartitioner",
"partitio... | Create a RangeSliceCommand and run it against the StorageProxy.
<p>
To match the behavior of the standard Cassandra thrift API endpoint, the
{@code nowMillis} argument should be the number of milliseconds since the
UNIX Epoch (e.g. System.currentTimeMillis() or equivalent obtained
through a {@link TimestampProvider}). ... | [
"Create",
"a",
"RangeSliceCommand",
"and",
"run",
"it",
"against",
"the",
"StorageProxy",
".",
"<p",
">",
"To",
"match",
"the",
"behavior",
"of",
"the",
"standard",
"Cassandra",
"thrift",
"API",
"endpoint",
"the",
"{"
] | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/embedded/CassandraEmbeddedKeyColumnValueStore.java#L104-L141 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.patchAsync | public <T> CompletableFuture<T> patchAsync(final Class<T> type, final Consumer<HttpConfig> configuration) {
"""
Executes asynchronous PATCH request on the configured URI (alias for the `patch(Class, Consumer)` method), with additional configuration provided by
the configuration function. The result will be cast t... | java | public <T> CompletableFuture<T> patchAsync(final Class<T> type, final Consumer<HttpConfig> configuration) {
return CompletableFuture.supplyAsync(() -> patch(type, configuration), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"patchAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"Consumer",
"<",
"HttpConfig",
">",
"configuration",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(... | Executes asynchronous PATCH request on the configured URI (alias for the `patch(Class, Consumer)` method), with additional configuration provided by
the configuration function. The result will be cast to the specified `type`.
This method is generally meant for use with standard Java.
[source,groovy]
----
HttpBuilder ... | [
"Executes",
"asynchronous",
"PATCH",
"request",
"on",
"the",
"configured",
"URI",
"(",
"alias",
"for",
"the",
"patch",
"(",
"Class",
"Consumer",
")",
"method",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"function",
".",... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1740-L1742 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java | ULocale.setKeywordValue | public static String setKeywordValue(String localeID, String keyword, String value) {
"""
Given a locale id, a keyword, and a value, return a new locale id with an updated
keyword and value. If the keyword is null, this removes all keywords from the locale id.
Otherwise, if the value is null, this removes the v... | java | public static String setKeywordValue(String localeID, String keyword, String value) {
LocaleIDParser parser = new LocaleIDParser(localeID);
parser.setKeywordValue(keyword, value);
return parser.getName();
} | [
"public",
"static",
"String",
"setKeywordValue",
"(",
"String",
"localeID",
",",
"String",
"keyword",
",",
"String",
"value",
")",
"{",
"LocaleIDParser",
"parser",
"=",
"new",
"LocaleIDParser",
"(",
"localeID",
")",
";",
"parser",
".",
"setKeywordValue",
"(",
... | Given a locale id, a keyword, and a value, return a new locale id with an updated
keyword and value. If the keyword is null, this removes all keywords from the locale id.
Otherwise, if the value is null, this removes the value for this keyword from the
locale id. Otherwise, this adds/replaces the value for this keywo... | [
"Given",
"a",
"locale",
"id",
"a",
"keyword",
"and",
"a",
"value",
"return",
"a",
"new",
"locale",
"id",
"with",
"an",
"updated",
"keyword",
"and",
"value",
".",
"If",
"the",
"keyword",
"is",
"null",
"this",
"removes",
"all",
"keywords",
"from",
"the",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/ULocale.java#L1249-L1253 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java | BlobContainersInner.setLegalHoldAsync | public Observable<LegalHoldInner> setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List<String> tags) {
"""
Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are no... | java | public Observable<LegalHoldInner> setLegalHoldAsync(String resourceGroupName, String accountName, String containerName, List<String> tags) {
return setLegalHoldWithServiceResponseAsync(resourceGroupName, accountName, containerName, tags).map(new Func1<ServiceResponse<LegalHoldInner>, LegalHoldInner>() {
... | [
"public",
"Observable",
"<",
"LegalHoldInner",
">",
"setLegalHoldAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"containerName",
",",
"List",
"<",
"String",
">",
"tags",
")",
"{",
"return",
"setLegalHoldWithServiceResponseAsyn... | Sets legal hold tags. Setting the same tag results in an idempotent operation. SetLegalHold follows an append pattern and does not clear out the existing tags that are not specified in the request.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@pa... | [
"Sets",
"legal",
"hold",
"tags",
".",
"Setting",
"the",
"same",
"tag",
"results",
"in",
"an",
"idempotent",
"operation",
".",
"SetLegalHold",
"follows",
"an",
"append",
"pattern",
"and",
"does",
"not",
"clear",
"out",
"the",
"existing",
"tags",
"that",
"are"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/storage/v2018_03_01_preview/implementation/BlobContainersInner.java#L824-L831 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.toAsyncThrowing | public static <R> Func0<Observable<R>> toAsyncThrowing(Callable<? extends R> func) {
"""
Convert a synchronous callable call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <R> the ... | java | public static <R> Func0<Observable<R>> toAsyncThrowing(Callable<? extends R> func) {
return toAsyncThrowing(func, Schedulers.computation());
} | [
"public",
"static",
"<",
"R",
">",
"Func0",
"<",
"Observable",
"<",
"R",
">",
">",
"toAsyncThrowing",
"(",
"Callable",
"<",
"?",
"extends",
"R",
">",
"func",
")",
"{",
"return",
"toAsyncThrowing",
"(",
"func",
",",
"Schedulers",
".",
"computation",
"(",
... | Convert a synchronous callable call into an asynchronous function call through an Observable.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/toAsync.png" alt="">
@param <R> the result value type
@param func the callable to convert
@return a function that returns an Observabl... | [
"Convert",
"a",
"synchronous",
"callable",
"call",
"into",
"an",
"asynchronous",
"function",
"call",
"through",
"an",
"Observable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L176-L178 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/Citrus.java | Citrus.afterSuite | public void afterSuite(String suiteName, String ... testGroups) {
"""
Performs after suite test actions.
@param suiteName
@param testGroups
"""
testSuiteListener.onFinish();
if (!CollectionUtils.isEmpty(afterSuite)) {
for (SequenceAfterSuite sequenceAfterSuite : afterSuite) {
... | java | public void afterSuite(String suiteName, String ... testGroups) {
testSuiteListener.onFinish();
if (!CollectionUtils.isEmpty(afterSuite)) {
for (SequenceAfterSuite sequenceAfterSuite : afterSuite) {
try {
if (sequenceAfterSuite.shouldExecute(suiteName, te... | [
"public",
"void",
"afterSuite",
"(",
"String",
"suiteName",
",",
"String",
"...",
"testGroups",
")",
"{",
"testSuiteListener",
".",
"onFinish",
"(",
")",
";",
"if",
"(",
"!",
"CollectionUtils",
".",
"isEmpty",
"(",
"afterSuite",
")",
")",
"{",
"for",
"(",
... | Performs after suite test actions.
@param suiteName
@param testGroups | [
"Performs",
"after",
"suite",
"test",
"actions",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/Citrus.java#L353-L372 |
aeshell/aesh | aesh/src/main/java/org/aesh/io/scanner/AnnotationDetector.java | AnnotationDetector.readConstantPoolEntry | private boolean readConstantPoolEntry(final DataInput di, final int index)
throws IOException {
"""
Return {@code true} if a double slot is read (in case of Double or Long constant).
"""
final int tag = di.readUnsignedByte();
switch (tag) {
case CP_METHOD_TYPE:
... | java | private boolean readConstantPoolEntry(final DataInput di, final int index)
throws IOException {
final int tag = di.readUnsignedByte();
switch (tag) {
case CP_METHOD_TYPE:
di.skipBytes(2); // readUnsignedShort()
return false;
case CP_M... | [
"private",
"boolean",
"readConstantPoolEntry",
"(",
"final",
"DataInput",
"di",
",",
"final",
"int",
"index",
")",
"throws",
"IOException",
"{",
"final",
"int",
"tag",
"=",
"di",
".",
"readUnsignedByte",
"(",
")",
";",
"switch",
"(",
"tag",
")",
"{",
"case... | Return {@code true} if a double slot is read (in case of Double or Long constant). | [
"Return",
"{"
] | train | https://github.com/aeshell/aesh/blob/fd7d38d333c5dbf116a9778523a4d1df61f027a3/aesh/src/main/java/org/aesh/io/scanner/AnnotationDetector.java#L422-L458 |
JCTools/JCTools | jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicLinkedQueueGenerator.java | JavaParsingAtomicLinkedQueueGenerator.processSpecialNodeTypes | void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
"""
Given a variable declaration of some sort, check it's name and type and
if it looks like any of the key type changes between unsafe and atomic
queues, perform the conversion to change it's type.
@param node
@param name
"""
... | java | void processSpecialNodeTypes(NodeWithType<?, Type> node, String name) {
Type type = node.getType();
if (node instanceof MethodDeclaration && ("newBufferAndOffset".equals(name) || "nextArrayOffset".equals(name))) {
node.setType(PrimitiveType.intType());
} else if (PrimitiveType.longTy... | [
"void",
"processSpecialNodeTypes",
"(",
"NodeWithType",
"<",
"?",
",",
"Type",
">",
"node",
",",
"String",
"name",
")",
"{",
"Type",
"type",
"=",
"node",
".",
"getType",
"(",
")",
";",
"if",
"(",
"node",
"instanceof",
"MethodDeclaration",
"&&",
"(",
"\"n... | Given a variable declaration of some sort, check it's name and type and
if it looks like any of the key type changes between unsafe and atomic
queues, perform the conversion to change it's type.
@param node
@param name | [
"Given",
"a",
"variable",
"declaration",
"of",
"some",
"sort",
"check",
"it",
"s",
"name",
"and",
"type",
"and",
"if",
"it",
"looks",
"like",
"any",
"of",
"the",
"key",
"type",
"changes",
"between",
"unsafe",
"and",
"atomic",
"queues",
"perform",
"the",
... | train | https://github.com/JCTools/JCTools/blob/9250fe316ec84209cbba0a41682f341256df781e/jctools-build/src/main/java/org/jctools/queues/atomic/JavaParsingAtomicLinkedQueueGenerator.java#L186-L203 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/Revision.java | Revision.getAttachment | @InterfaceAudience.Public
public Attachment getAttachment(String name) {
"""
Looks up the attachment with the given name (without fetching its contents yet).
"""
Map<String, Object> attachmentsMetadata = getAttachmentMetadata();
if (attachmentsMetadata == null) {
return null;
... | java | @InterfaceAudience.Public
public Attachment getAttachment(String name) {
Map<String, Object> attachmentsMetadata = getAttachmentMetadata();
if (attachmentsMetadata == null) {
return null;
}
return toAttachment(name, attachmentsMetadata.get(name));
} | [
"@",
"InterfaceAudience",
".",
"Public",
"public",
"Attachment",
"getAttachment",
"(",
"String",
"name",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"attachmentsMetadata",
"=",
"getAttachmentMetadata",
"(",
")",
";",
"if",
"(",
"attachmentsMetadata",
"==... | Looks up the attachment with the given name (without fetching its contents yet). | [
"Looks",
"up",
"the",
"attachment",
"with",
"the",
"given",
"name",
"(",
"without",
"fetching",
"its",
"contents",
"yet",
")",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/Revision.java#L172-L179 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.