repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
baratine/baratine | framework/src/main/java/com/caucho/v5/javac/LineMap.java | LineMap.convertError | private void convertError(CharBuffer buf, int line)
{
String srcFilename = null;
int destLine = 0;
int srcLine = 0;
int srcTailLine = Integer.MAX_VALUE;
for (int i = 0; i < _lines.size(); i++) {
Line map = (Line) _lines.get(i);
if (map._dstLine <= line && line <= map.getLastDesti... | java | private void convertError(CharBuffer buf, int line)
{
String srcFilename = null;
int destLine = 0;
int srcLine = 0;
int srcTailLine = Integer.MAX_VALUE;
for (int i = 0; i < _lines.size(); i++) {
Line map = (Line) _lines.get(i);
if (map._dstLine <= line && line <= map.getLastDesti... | [
"private",
"void",
"convertError",
"(",
"CharBuffer",
"buf",
",",
"int",
"line",
")",
"{",
"String",
"srcFilename",
"=",
"null",
";",
"int",
"destLine",
"=",
"0",
";",
"int",
"srcLine",
"=",
"0",
";",
"int",
"srcTailLine",
"=",
"Integer",
".",
"MAX_VALUE... | Maps a destination line to an error location.
@param buf CharBuffer to write the error location
@param line generated source line to convert. | [
"Maps",
"a",
"destination",
"line",
"to",
"an",
"error",
"location",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/javac/LineMap.java#L384-L414 |
google/closure-compiler | src/com/google/javascript/rhino/Node.java | Node.matchesQualifiedName | private boolean matchesQualifiedName(String qname, int endIndex) {
int start = qname.lastIndexOf('.', endIndex - 1) + 1;
switch (this.getToken()) {
case NAME:
String name = getString();
return start == 0 && !name.isEmpty() && name.length() == endIndex && qname.startsWith(name);
case... | java | private boolean matchesQualifiedName(String qname, int endIndex) {
int start = qname.lastIndexOf('.', endIndex - 1) + 1;
switch (this.getToken()) {
case NAME:
String name = getString();
return start == 0 && !name.isEmpty() && name.length() == endIndex && qname.startsWith(name);
case... | [
"private",
"boolean",
"matchesQualifiedName",
"(",
"String",
"qname",
",",
"int",
"endIndex",
")",
"{",
"int",
"start",
"=",
"qname",
".",
"lastIndexOf",
"(",
"'",
"'",
",",
"endIndex",
"-",
"1",
")",
"+",
"1",
";",
"switch",
"(",
"this",
".",
"getToke... | Returns whether a node matches a simple or a qualified name, such as
<code>x</code> or <code>a.b.c</code> or <code>this.a</code>. | [
"Returns",
"whether",
"a",
"node",
"matches",
"a",
"simple",
"or",
"a",
"qualified",
"name",
"such",
"as",
"<code",
">",
"x<",
"/",
"code",
">",
"or",
"<code",
">",
"a",
".",
"b",
".",
"c<",
"/",
"code",
">",
"or",
"<code",
">",
"this",
".",
"a<"... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/rhino/Node.java#L2145-L2168 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/IOManager.java | IOManager.createBlockChannelReader | public BlockChannelReader createBlockChannelReader(Channel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue)
throws IOException
{
if (this.isClosed) {
throw new IllegalStateException("I/O-Manger is closed.");
}
return new BlockChannelReader(channelID, this.readers[channelID.getThread... | java | public BlockChannelReader createBlockChannelReader(Channel.ID channelID,
LinkedBlockingQueue<MemorySegment> returnQueue)
throws IOException
{
if (this.isClosed) {
throw new IllegalStateException("I/O-Manger is closed.");
}
return new BlockChannelReader(channelID, this.readers[channelID.getThread... | [
"public",
"BlockChannelReader",
"createBlockChannelReader",
"(",
"Channel",
".",
"ID",
"channelID",
",",
"LinkedBlockingQueue",
"<",
"MemorySegment",
">",
"returnQueue",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"isClosed",
")",
"{",
"throw",
"new... | Creates a block channel reader that reads blocks from the given channel. The reader reads asynchronously,
such that a read request is accepted, carried out at some (close) point in time, and the full segment
is pushed to the given queue.
@param channelID The descriptor for the channel to write to.
@param returnQueue T... | [
"Creates",
"a",
"block",
"channel",
"reader",
"that",
"reads",
"blocks",
"from",
"the",
"given",
"channel",
".",
"The",
"reader",
"reads",
"asynchronously",
"such",
"that",
"a",
"read",
"request",
"is",
"accepted",
"carried",
"out",
"at",
"some",
"(",
"close... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/iomanager/IOManager.java#L339-L348 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/TrConfigurator.java | TrConfigurator.setTraceSpec | synchronized static TraceSpecification setTraceSpec(String spec) {
// If logger is used & configured by logger properties,
// we're done as far as trace string processing is concerned
if (WsLogManager.isConfiguredByLoggingProperties()) {
return null;
}
// If the spe... | java | synchronized static TraceSpecification setTraceSpec(String spec) {
// If logger is used & configured by logger properties,
// we're done as far as trace string processing is concerned
if (WsLogManager.isConfiguredByLoggingProperties()) {
return null;
}
// If the spe... | [
"synchronized",
"static",
"TraceSpecification",
"setTraceSpec",
"(",
"String",
"spec",
")",
"{",
"// If logger is used & configured by logger properties, ",
"// we're done as far as trace string processing is concerned",
"if",
"(",
"WsLogManager",
".",
"isConfiguredByLoggingProperties"... | Set the trace specification of the service to the input value.
@param spec New string trace specification
@return new TraceSpecification, or null if unchanged | [
"Set",
"the",
"trace",
"specification",
"of",
"the",
"service",
"to",
"the",
"input",
"value",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.core/src/com/ibm/websphere/ras/TrConfigurator.java#L271-L305 |
timewalker74/ffmq | core/src/main/java/net/timewalker/ffmq4/local/destination/LocalQueue.java | LocalQueue.notifyConsumer | private void notifyConsumer( AbstractMessage message )
{
consumersLock.readLock().lock();
try
{
switch (localConsumers.size())
{
case 0 : return; // Nobody's listening
case 1 :
notifySingleConsumer(localConsumers.get(0),message);
break;
default : // M... | java | private void notifyConsumer( AbstractMessage message )
{
consumersLock.readLock().lock();
try
{
switch (localConsumers.size())
{
case 0 : return; // Nobody's listening
case 1 :
notifySingleConsumer(localConsumers.get(0),message);
break;
default : // M... | [
"private",
"void",
"notifyConsumer",
"(",
"AbstractMessage",
"message",
")",
"{",
"consumersLock",
".",
"readLock",
"(",
")",
".",
"lock",
"(",
")",
";",
"try",
"{",
"switch",
"(",
"localConsumers",
".",
"size",
"(",
")",
")",
"{",
"case",
"0",
":",
"r... | Notify a consumer that a message is probably available for it to retrieve | [
"Notify",
"a",
"consumer",
"that",
"a",
"message",
"is",
"probably",
"available",
"for",
"it",
"to",
"retrieve"
] | train | https://github.com/timewalker74/ffmq/blob/638773ee29a4a5f9c6119ed74ad14ac9c46382b3/core/src/main/java/net/timewalker/ffmq4/local/destination/LocalQueue.java#L706-L726 |
jmeetsma/Iglu-Util | src/main/java/org/ijsberg/iglu/util/io/FileSupport.java | FileSupport.getDirectoriesInDirectoryTree | public static ArrayList<File> getDirectoriesInDirectoryTree(String path) {
File file = new File(path);
return getContentsInDirectoryTree(file, "*", false, true);
} | java | public static ArrayList<File> getDirectoriesInDirectoryTree(String path) {
File file = new File(path);
return getContentsInDirectoryTree(file, "*", false, true);
} | [
"public",
"static",
"ArrayList",
"<",
"File",
">",
"getDirectoriesInDirectoryTree",
"(",
"String",
"path",
")",
"{",
"File",
"file",
"=",
"new",
"File",
"(",
"path",
")",
";",
"return",
"getContentsInDirectoryTree",
"(",
"file",
",",
"\"*\"",
",",
"false",
"... | Retrieves all directories from a directory and its subdirectories.
@param path path to directory
@return A list containing the found directories | [
"Retrieves",
"all",
"directories",
"from",
"a",
"directory",
"and",
"its",
"subdirectories",
"."
] | train | https://github.com/jmeetsma/Iglu-Util/blob/971eb022115247b1e34dc26dd02e7e621e29e910/src/main/java/org/ijsberg/iglu/util/io/FileSupport.java#L170-L173 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/query/Criteria.java | Criteria.startsWith | public Criteria startsWith(String s) {
assertNoBlankInWildcardedQuery(s, false, true);
predicates.add(new Predicate(OperationKey.STARTS_WITH, s));
return this;
} | java | public Criteria startsWith(String s) {
assertNoBlankInWildcardedQuery(s, false, true);
predicates.add(new Predicate(OperationKey.STARTS_WITH, s));
return this;
} | [
"public",
"Criteria",
"startsWith",
"(",
"String",
"s",
")",
"{",
"assertNoBlankInWildcardedQuery",
"(",
"s",
",",
"false",
",",
"true",
")",
";",
"predicates",
".",
"add",
"(",
"new",
"Predicate",
"(",
"OperationKey",
".",
"STARTS_WITH",
",",
"s",
")",
")... | Crates new {@link Predicate} with trailing wildcard <br/>
<strong>NOTE: </strong>Strings will not be automatically split on whitespace.
@param s
@return
@throws InvalidDataAccessApiUsageException for strings with whitespace | [
"Crates",
"new",
"{",
"@link",
"Predicate",
"}",
"with",
"trailing",
"wildcard",
"<br",
"/",
">",
"<strong",
">",
"NOTE",
":",
"<",
"/",
"strong",
">",
"Strings",
"will",
"not",
"be",
"automatically",
"split",
"on",
"whitespace",
"."
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/query/Criteria.java#L220-L225 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java | InternalUtils.setIgnoreIncludeServletPath | public static void setIgnoreIncludeServletPath( ServletRequest request, boolean ignore )
{
Integer depth = ( Integer ) request.getAttribute( IGNORE_INCLUDE_SERVLET_PATH_ATTR );
if ( ignore )
{
if ( depth == null ) depth = new Integer( 0 );
request.setAttribut... | java | public static void setIgnoreIncludeServletPath( ServletRequest request, boolean ignore )
{
Integer depth = ( Integer ) request.getAttribute( IGNORE_INCLUDE_SERVLET_PATH_ATTR );
if ( ignore )
{
if ( depth == null ) depth = new Integer( 0 );
request.setAttribut... | [
"public",
"static",
"void",
"setIgnoreIncludeServletPath",
"(",
"ServletRequest",
"request",
",",
"boolean",
"ignore",
")",
"{",
"Integer",
"depth",
"=",
"(",
"Integer",
")",
"request",
".",
"getAttribute",
"(",
"IGNORE_INCLUDE_SERVLET_PATH_ATTR",
")",
";",
"if",
... | Tell {@link #getDecodedServletPath} (and all that call it) to ignore the attribute that specifies the Servlet
Include path, which is set when a Servlet include is done through RequestDispatcher. Normally,
getDecodedServletPath tries the Servlet Include path before falling back to getServletPath() on the request.
Note ... | [
"Tell",
"{"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/internal/InternalUtils.java#L1100-L1123 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/support/DefaultIncrementalAttributesMapper.java | DefaultIncrementalAttributesMapper.lookupAttributes | public static Attributes lookupAttributes(LdapOperations ldapOperations, Name dn, String[] attributes) {
return loopForAllAttributeValues(ldapOperations, dn, attributes).getCollectedAttributes();
} | java | public static Attributes lookupAttributes(LdapOperations ldapOperations, Name dn, String[] attributes) {
return loopForAllAttributeValues(ldapOperations, dn, attributes).getCollectedAttributes();
} | [
"public",
"static",
"Attributes",
"lookupAttributes",
"(",
"LdapOperations",
"ldapOperations",
",",
"Name",
"dn",
",",
"String",
"[",
"]",
"attributes",
")",
"{",
"return",
"loopForAllAttributeValues",
"(",
"ldapOperations",
",",
"dn",
",",
"attributes",
")",
".",... | Lookup all values for the specified attributes, looping through the results incrementally if necessary.
@param ldapOperations The instance to use for performing the actual lookup.
@param dn The distinguished name of the object to find.
@param attributes names of the attributes to request.
@return an At... | [
"Lookup",
"all",
"values",
"for",
"the",
"specified",
"attributes",
"looping",
"through",
"the",
"results",
"incrementally",
"if",
"necessary",
"."
] | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/support/DefaultIncrementalAttributesMapper.java#L304-L306 |
alkacon/opencms-core | src/org/opencms/ui/components/CmsToolBar.java | CmsToolBar.openFavoriteDialog | public static void openFavoriteDialog(CmsFileExplorer explorer) {
try {
CmsExplorerFavoriteContext context = new CmsExplorerFavoriteContext(A_CmsUI.getCmsObject(), explorer);
CmsFavoriteDialog dialog = new CmsFavoriteDialog(context, new CmsFavoriteDAO(A_CmsUI.getCmsObject()));
... | java | public static void openFavoriteDialog(CmsFileExplorer explorer) {
try {
CmsExplorerFavoriteContext context = new CmsExplorerFavoriteContext(A_CmsUI.getCmsObject(), explorer);
CmsFavoriteDialog dialog = new CmsFavoriteDialog(context, new CmsFavoriteDAO(A_CmsUI.getCmsObject()));
... | [
"public",
"static",
"void",
"openFavoriteDialog",
"(",
"CmsFileExplorer",
"explorer",
")",
"{",
"try",
"{",
"CmsExplorerFavoriteContext",
"context",
"=",
"new",
"CmsExplorerFavoriteContext",
"(",
"A_CmsUI",
".",
"getCmsObject",
"(",
")",
",",
"explorer",
")",
";",
... | Opens the favorite dialog.
@param explorer the explorer instance (null if not currently in explorer) | [
"Opens",
"the",
"favorite",
"dialog",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/components/CmsToolBar.java#L294-L307 |
VoltDB/voltdb | src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java | LockFile.writeHeartbeat | private final void writeHeartbeat()
throws LockFile.FileSecurityException,
LockFile.UnexpectedEndOfFileException,
LockFile.UnexpectedFileIOException {
try {
raf.seek(MAGIC.length);
raf.writeLong(System.currentTimeMillis());
} catch (SecurityException ex... | java | private final void writeHeartbeat()
throws LockFile.FileSecurityException,
LockFile.UnexpectedEndOfFileException,
LockFile.UnexpectedFileIOException {
try {
raf.seek(MAGIC.length);
raf.writeLong(System.currentTimeMillis());
} catch (SecurityException ex... | [
"private",
"final",
"void",
"writeHeartbeat",
"(",
")",
"throws",
"LockFile",
".",
"FileSecurityException",
",",
"LockFile",
".",
"UnexpectedEndOfFileException",
",",
"LockFile",
".",
"UnexpectedFileIOException",
"{",
"try",
"{",
"raf",
".",
"seek",
"(",
"MAGIC",
... | Writes the current hearbeat timestamp value to this object's lock
file. <p>
@throws FileSecurityException possibly never (seek and write are native
methods whose JavaDoc entries do not actually specifiy throwing
<tt>SecurityException</tt>). However, it is conceivable that these
native methods may, in turn, access Jav... | [
"Writes",
"the",
"current",
"hearbeat",
"timestamp",
"value",
"to",
"this",
"object",
"s",
"lock",
"file",
".",
"<p",
">"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/LockFile.java#L1259-L1274 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java | PatternMatchingFunctions.regexpContains | public static Expression regexpContains(String expression, String pattern) {
return regexpContains(x(expression), pattern);
} | java | public static Expression regexpContains(String expression, String pattern) {
return regexpContains(x(expression), pattern);
} | [
"public",
"static",
"Expression",
"regexpContains",
"(",
"String",
"expression",
",",
"String",
"pattern",
")",
"{",
"return",
"regexpContains",
"(",
"x",
"(",
"expression",
")",
",",
"pattern",
")",
";",
"}"
] | Returned expression results in True if the string value contains the regular expression pattern. | [
"Returned",
"expression",
"results",
"in",
"True",
"if",
"the",
"string",
"value",
"contains",
"the",
"regular",
"expression",
"pattern",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/PatternMatchingFunctions.java#L49-L51 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.commercialRange_commercialRangeName_GET | public OvhCommercialRange commercialRange_commercialRangeName_GET(String commercialRangeName) throws IOException {
String qPath = "/dedicatedCloud/commercialRange/{commercialRangeName}";
StringBuilder sb = path(qPath, commercialRangeName);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo... | java | public OvhCommercialRange commercialRange_commercialRangeName_GET(String commercialRangeName) throws IOException {
String qPath = "/dedicatedCloud/commercialRange/{commercialRangeName}";
StringBuilder sb = path(qPath, commercialRangeName);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo... | [
"public",
"OvhCommercialRange",
"commercialRange_commercialRangeName_GET",
"(",
"String",
"commercialRangeName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicatedCloud/commercialRange/{commercialRangeName}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Get this object properties
REST: GET /dedicatedCloud/commercialRange/{commercialRangeName}
@param commercialRangeName [required] The name of this commercial range | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L3119-L3124 |
BlueBrain/bluima | modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java | Document.setTimex2 | public void setTimex2(int i, Timex2 v) {
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_timex2 == null)
jcasType.jcas.throwFeatMissing("timex2", "de.julielab.jules.types.ace.Document");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeat... | java | public void setTimex2(int i, Timex2 v) {
if (Document_Type.featOkTst && ((Document_Type)jcasType).casFeat_timex2 == null)
jcasType.jcas.throwFeatMissing("timex2", "de.julielab.jules.types.ace.Document");
jcasType.jcas.checkArrayBounds(jcasType.ll_cas.ll_getRefValue(addr, ((Document_Type)jcasType).casFeat... | [
"public",
"void",
"setTimex2",
"(",
"int",
"i",
",",
"Timex2",
"v",
")",
"{",
"if",
"(",
"Document_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Document_Type",
")",
"jcasType",
")",
".",
"casFeat_timex2",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"... | indexed setter for timex2 - sets an indexed value -
@generated
@param i index in the array to set
@param v value to set into the array | [
"indexed",
"setter",
"for",
"timex2",
"-",
"sets",
"an",
"indexed",
"value",
"-"
] | train | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_typesystem/src/main/java/de/julielab/jules/types/ace/Document.java#L226-L230 |
google/flogger | api/src/main/java/com/google/common/flogger/LogContext.java | LogContext.logImpl | @SuppressWarnings("ReferenceEquality")
private void logImpl(String message, Object... args) {
this.args = args;
// Evaluate any (rare) LazyArg instances early. This may throw exceptions from user code, but
// it seems reasonable to propagate them in this case (they would have been thrown if the
// arg... | java | @SuppressWarnings("ReferenceEquality")
private void logImpl(String message, Object... args) {
this.args = args;
// Evaluate any (rare) LazyArg instances early. This may throw exceptions from user code, but
// it seems reasonable to propagate them in this case (they would have been thrown if the
// arg... | [
"@",
"SuppressWarnings",
"(",
"\"ReferenceEquality\"",
")",
"private",
"void",
"logImpl",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"this",
".",
"args",
"=",
"args",
";",
"// Evaluate any (rare) LazyArg instances early. This may throw exceptions ... | Make the backend logging call. This is the point at which we have paid the price of creating a
varargs array and doing any necessary auto-boxing. | [
"Make",
"the",
"backend",
"logging",
"call",
".",
"This",
"is",
"the",
"point",
"at",
"which",
"we",
"have",
"paid",
"the",
"price",
"of",
"creating",
"a",
"varargs",
"array",
"and",
"doing",
"any",
"necessary",
"auto",
"-",
"boxing",
"."
] | train | https://github.com/google/flogger/blob/a164967a93a9f4ce92f34319fc0cc7c91a57321c/api/src/main/java/com/google/common/flogger/LogContext.java#L548-L567 |
foundation-runtime/service-directory | 2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryRegistrationService.java | DirectoryRegistrationService.setUserPermission | public void setUserPermission(String userName, Permission permission){
if(permission == null){
permission = Permission.NONE;
}
getServiceDirectoryClient().setACL(new ACL(AuthScheme.DIRECTORY, userName, permission.getId()));
} | java | public void setUserPermission(String userName, Permission permission){
if(permission == null){
permission = Permission.NONE;
}
getServiceDirectoryClient().setACL(new ACL(AuthScheme.DIRECTORY, userName, permission.getId()));
} | [
"public",
"void",
"setUserPermission",
"(",
"String",
"userName",
",",
"Permission",
"permission",
")",
"{",
"if",
"(",
"permission",
"==",
"null",
")",
"{",
"permission",
"=",
"Permission",
".",
"NONE",
";",
"}",
"getServiceDirectoryClient",
"(",
")",
".",
... | Set the user permission.
@param userName
the user name.
@param permission
the user permission. | [
"Set",
"the",
"user",
"permission",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/2.0/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/DirectoryRegistrationService.java#L265-L270 |
peholmst/vaadin4spring | addons/i18n/src/main/java/org/vaadin/spring/i18n/I18N.java | I18N.getWithLocale | @Deprecated
public String getWithLocale(String code, Locale locale, Object... arguments) {
return get(code, locale, arguments);
} | java | @Deprecated
public String getWithLocale(String code, Locale locale, Object... arguments) {
return get(code, locale, arguments);
} | [
"@",
"Deprecated",
"public",
"String",
"getWithLocale",
"(",
"String",
"code",
",",
"Locale",
"locale",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"get",
"(",
"code",
",",
"locale",
",",
"arguments",
")",
";",
"}"
] | Tries to resolve the specified message for the given locale.
@param code the code to lookup up, such as 'calculator.noRateSet', never {@code null}.
@param locale The Locale for which it is tried to look up the code. Must not be null
@param arguments Array of arguments that will be filled in for params within the messa... | [
"Tries",
"to",
"resolve",
"the",
"specified",
"message",
"for",
"the",
"given",
"locale",
"."
] | train | https://github.com/peholmst/vaadin4spring/blob/ea896012f15d6abea6e6391def9a0001113a1f7a/addons/i18n/src/main/java/org/vaadin/spring/i18n/I18N.java#L138-L141 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/NotesApi.java | NotesApi.getMergeRequestNote | public Note getMergeRequestNote(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "notes", noteId);... | java | public Note getMergeRequestNote(Object projectIdOrPath, Integer mergeRequestIid, Integer noteId) throws GitLabApiException {
Response response = get(Response.Status.OK, getDefaultPerPageParam(),
"projects", getProjectIdOrPath(projectIdOrPath), "merge_requests", mergeRequestIid, "notes", noteId);... | [
"public",
"Note",
"getMergeRequestNote",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"mergeRequestIid",
",",
"Integer",
"noteId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
"response",
"=",
"get",
"(",
"Response",
".",
"Status",
".",
"OK",
",",
... | Get the specified merge request's note.
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param mergeRequestIid the merge request IID to get the notes for
@param noteId the ID of the Note to get
@return a Note instance for the specified IDs
@throws GitLabApiException... | [
"Get",
"the",
"specified",
"merge",
"request",
"s",
"note",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/NotesApi.java#L371-L375 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java | SDValidation.validateNumerical | protected static void validateNumerical(String opName, SDVariable v1, SDVariable v2) {
if (v1.dataType() == DataType.BOOL || v1.dataType() == DataType.UTF8 || v2.dataType() == DataType.BOOL || v2.dataType() == DataType.UTF8)
throw new IllegalStateException("Cannot perform operation \"" + opName + "\... | java | protected static void validateNumerical(String opName, SDVariable v1, SDVariable v2) {
if (v1.dataType() == DataType.BOOL || v1.dataType() == DataType.UTF8 || v2.dataType() == DataType.BOOL || v2.dataType() == DataType.UTF8)
throw new IllegalStateException("Cannot perform operation \"" + opName + "\... | [
"protected",
"static",
"void",
"validateNumerical",
"(",
"String",
"opName",
",",
"SDVariable",
"v1",
",",
"SDVariable",
"v2",
")",
"{",
"if",
"(",
"v1",
".",
"dataType",
"(",
")",
"==",
"DataType",
".",
"BOOL",
"||",
"v1",
".",
"dataType",
"(",
")",
"... | Validate that the operation is being applied on numerical SDVariables (not boolean or utf8).
Some operations (such as sum, norm2, add(Number) etc don't make sense when applied to boolean/utf8 arrays
@param opName Operation name to print in the exception
@param v1 Variable to validate datatype for (input to operati... | [
"Validate",
"that",
"the",
"operation",
"is",
"being",
"applied",
"on",
"numerical",
"SDVariables",
"(",
"not",
"boolean",
"or",
"utf8",
")",
".",
"Some",
"operations",
"(",
"such",
"as",
"sum",
"norm2",
"add",
"(",
"Number",
")",
"etc",
"don",
"t",
"mak... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDValidation.java#L50-L54 |
classgraph/classgraph | src/main/java/io/github/classgraph/PackageInfo.java | PackageInfo.getChildren | public PackageInfoList getChildren() {
if (children == null) {
return PackageInfoList.EMPTY_LIST;
}
final PackageInfoList childrenSorted = new PackageInfoList(children);
// Ensure children are sorted
CollectionUtils.sortIfNotEmpty(childrenSorted, new Comparator<Packag... | java | public PackageInfoList getChildren() {
if (children == null) {
return PackageInfoList.EMPTY_LIST;
}
final PackageInfoList childrenSorted = new PackageInfoList(children);
// Ensure children are sorted
CollectionUtils.sortIfNotEmpty(childrenSorted, new Comparator<Packag... | [
"public",
"PackageInfoList",
"getChildren",
"(",
")",
"{",
"if",
"(",
"children",
"==",
"null",
")",
"{",
"return",
"PackageInfoList",
".",
"EMPTY_LIST",
";",
"}",
"final",
"PackageInfoList",
"childrenSorted",
"=",
"new",
"PackageInfoList",
"(",
"children",
")",... | The child packages of this package, or the empty list if none.
@return the child packages, or the empty list if none. | [
"The",
"child",
"packages",
"of",
"this",
"package",
"or",
"the",
"empty",
"list",
"if",
"none",
"."
] | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/io/github/classgraph/PackageInfo.java#L166-L179 |
b3log/latke | latke-core/src/main/java/org/json/JSONArray.java | JSONArray.getNumber | public Number getNumber(int index) throws JSONException {
Object object = this.get(index);
try {
if (object instanceof Number) {
return (Number)object;
}
return JSONObject.stringToNumber(object.toString());
} catch (Exception e) {
t... | java | public Number getNumber(int index) throws JSONException {
Object object = this.get(index);
try {
if (object instanceof Number) {
return (Number)object;
}
return JSONObject.stringToNumber(object.toString());
} catch (Exception e) {
t... | [
"public",
"Number",
"getNumber",
"(",
"int",
"index",
")",
"throws",
"JSONException",
"{",
"Object",
"object",
"=",
"this",
".",
"get",
"(",
"index",
")",
";",
"try",
"{",
"if",
"(",
"object",
"instanceof",
"Number",
")",
"{",
"return",
"(",
"Number",
... | Get the Number value associated with a key.
@param index
The index must be between 0 and length() - 1.
@return The numeric value.
@throws JSONException
if the key is not found or if the value is not a Number
object and cannot be converted to a number. | [
"Get",
"the",
"Number",
"value",
"associated",
"with",
"a",
"key",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/json/JSONArray.java#L293-L303 |
biojava/biojava | biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java | AtomCache.getStructureForCathDomain | public Structure getStructureForCathDomain(StructureName structureName, CathDatabase cathInstall) throws IOException, StructureException {
CathDomain cathDomain = cathInstall.getDomainByCathId(structureName.getIdentifier());
Structure s = getStructureForPdbId(cathDomain.getIdentifier());
Structure n = cathDomai... | java | public Structure getStructureForCathDomain(StructureName structureName, CathDatabase cathInstall) throws IOException, StructureException {
CathDomain cathDomain = cathInstall.getDomainByCathId(structureName.getIdentifier());
Structure s = getStructureForPdbId(cathDomain.getIdentifier());
Structure n = cathDomai... | [
"public",
"Structure",
"getStructureForCathDomain",
"(",
"StructureName",
"structureName",
",",
"CathDatabase",
"cathInstall",
")",
"throws",
"IOException",
",",
"StructureException",
"{",
"CathDomain",
"cathDomain",
"=",
"cathInstall",
".",
"getDomainByCathId",
"(",
"str... | Returns a {@link Structure} corresponding to the CATH identifier supplied in {@code structureName}, using the specified {@link CathDatabase}. | [
"Returns",
"a",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-structure/src/main/java/org/biojava/nbio/structure/align/util/AtomCache.java#L824-L846 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setCertificateIssuerAsync | public ServiceFuture<IssuerBundle> setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback<IssuerBundle> serviceCallback) {
return ServiceFuture.fromResponse(setC... | java | public ServiceFuture<IssuerBundle> setCertificateIssuerAsync(String vaultBaseUrl, String issuerName, String provider, IssuerCredentials credentials, OrganizationDetails organizationDetails, IssuerAttributes attributes, final ServiceCallback<IssuerBundle> serviceCallback) {
return ServiceFuture.fromResponse(setC... | [
"public",
"ServiceFuture",
"<",
"IssuerBundle",
">",
"setCertificateIssuerAsync",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"issuerName",
",",
"String",
"provider",
",",
"IssuerCredentials",
"credentials",
",",
"OrganizationDetails",
"organizationDetails",
",",
"Issue... | Sets the specified certificate issuer.
The SetCertificateIssuer operation adds or updates the specified certificate issuer. This operation requires the certificates/setissuers permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param issuerName The name of the issuer.
@param p... | [
"Sets",
"the",
"specified",
"certificate",
"issuer",
".",
"The",
"SetCertificateIssuer",
"operation",
"adds",
"or",
"updates",
"the",
"specified",
"certificate",
"issuer",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"setissuers",
"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#L6017-L6019 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/inventory/message/UpdateInventorySlotsMessage.java | UpdateInventorySlotsMessage.updatePickedItemStack | public static void updatePickedItemStack(ItemStack itemStack, EntityPlayerMP player, int windowId)
{
Packet packet = new Packet(PICKEDITEM, windowId);
packet.draggedItemStack(itemStack);
MalisisCore.network.sendTo(packet, player);
} | java | public static void updatePickedItemStack(ItemStack itemStack, EntityPlayerMP player, int windowId)
{
Packet packet = new Packet(PICKEDITEM, windowId);
packet.draggedItemStack(itemStack);
MalisisCore.network.sendTo(packet, player);
} | [
"public",
"static",
"void",
"updatePickedItemStack",
"(",
"ItemStack",
"itemStack",
",",
"EntityPlayerMP",
"player",
",",
"int",
"windowId",
")",
"{",
"Packet",
"packet",
"=",
"new",
"Packet",
"(",
"PICKEDITEM",
",",
"windowId",
")",
";",
"packet",
".",
"dragg... | Sends a {@link Packet} to player to update the picked {@link ItemStack}.
@param itemStack the item stack
@param player the player
@param windowId the window id | [
"Sends",
"a",
"{",
"@link",
"Packet",
"}",
"to",
"player",
"to",
"update",
"the",
"picked",
"{",
"@link",
"ItemStack",
"}",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/inventory/message/UpdateInventorySlotsMessage.java#L106-L111 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/alg/color/ColorLab.java | ColorLab.srgbToLab | public static void srgbToLab( float r , float g , float b , float lab[] ) {
ColorXyz.srgbToXyz(r,g,b,lab);
float X = lab[0];
float Y = lab[1];
float Z = lab[2];
float xr = X/Xr_f;
float yr = Y/Yr_f;
float zr = Z/Zr_f;
float fx, fy, fz;
if(xr > epsilon_f) fx = (float)Math.pow(xr, 1.0f/3.0f);
else ... | java | public static void srgbToLab( float r , float g , float b , float lab[] ) {
ColorXyz.srgbToXyz(r,g,b,lab);
float X = lab[0];
float Y = lab[1];
float Z = lab[2];
float xr = X/Xr_f;
float yr = Y/Yr_f;
float zr = Z/Zr_f;
float fx, fy, fz;
if(xr > epsilon_f) fx = (float)Math.pow(xr, 1.0f/3.0f);
else ... | [
"public",
"static",
"void",
"srgbToLab",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
",",
"float",
"lab",
"[",
"]",
")",
"{",
"ColorXyz",
".",
"srgbToXyz",
"(",
"r",
",",
"g",
",",
"b",
",",
"lab",
")",
";",
"float",
"X",
"=",
"lab... | Conversion from normalized RGB into LAB. Normalized RGB values have a range of 0:1 | [
"Conversion",
"from",
"normalized",
"RGB",
"into",
"LAB",
".",
"Normalized",
"RGB",
"values",
"have",
"a",
"range",
"of",
"0",
":",
"1"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/alg/color/ColorLab.java#L93-L115 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newAgent | public Agent newAgent(QualifiedName id, Collection<Attribute> attributes) {
Agent res = newAgent(id);
setAttributes(res, attributes);
return res;
} | java | public Agent newAgent(QualifiedName id, Collection<Attribute> attributes) {
Agent res = newAgent(id);
setAttributes(res, attributes);
return res;
} | [
"public",
"Agent",
"newAgent",
"(",
"QualifiedName",
"id",
",",
"Collection",
"<",
"Attribute",
">",
"attributes",
")",
"{",
"Agent",
"res",
"=",
"newAgent",
"(",
"id",
")",
";",
"setAttributes",
"(",
"res",
",",
"attributes",
")",
";",
"return",
"res",
... | Creates a new {@link Agent} with provided identifier and attributes
@param id a {@link QualifiedName} for the agent
@param attributes a collection of {@link Attribute} for the agent
@return an object of type {@link Agent} | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L447-L451 |
jenkinsci/jenkins | core/src/main/java/hudson/util/FormValidation.java | FormValidation.validateIntegerInRange | public static FormValidation validateIntegerInRange(String value, int lower, int upper) {
try {
int intValue = Integer.parseInt(value);
if (intValue < lower) {
return error(hudson.model.Messages.Hudson_MustBeAtLeast(lower));
}
if (intValue > upper)... | java | public static FormValidation validateIntegerInRange(String value, int lower, int upper) {
try {
int intValue = Integer.parseInt(value);
if (intValue < lower) {
return error(hudson.model.Messages.Hudson_MustBeAtLeast(lower));
}
if (intValue > upper)... | [
"public",
"static",
"FormValidation",
"validateIntegerInRange",
"(",
"String",
"value",
",",
"int",
"lower",
",",
"int",
"upper",
")",
"{",
"try",
"{",
"int",
"intValue",
"=",
"Integer",
".",
"parseInt",
"(",
"value",
")",
";",
"if",
"(",
"intValue",
"<",
... | Make sure that the given string is an integer in the range specified by the lower and upper bounds (both inclusive)
@param value the value to check
@param lower the lower bound (inclusive)
@param upper the upper bound (inclusive)
@since 2.104 | [
"Make",
"sure",
"that",
"the",
"given",
"string",
"is",
"an",
"integer",
"in",
"the",
"range",
"specified",
"by",
"the",
"lower",
"and",
"upper",
"bounds",
"(",
"both",
"inclusive",
")"
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/util/FormValidation.java#L407-L420 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java | DBInitializerHelper.useSequenceForOrderNumber | public static boolean useSequenceForOrderNumber(WorkspaceEntry wsConfig, String dbDialect) throws RepositoryConfigurationException
{
try
{
if (wsConfig.getContainer().getParameterValue(JDBCWorkspaceDataContainer.USE_SEQUENCE_FOR_ORDER_NUMBER, JDBCWorkspaceDataContainer.USE_SEQUENCE_AUTO).equalsI... | java | public static boolean useSequenceForOrderNumber(WorkspaceEntry wsConfig, String dbDialect) throws RepositoryConfigurationException
{
try
{
if (wsConfig.getContainer().getParameterValue(JDBCWorkspaceDataContainer.USE_SEQUENCE_FOR_ORDER_NUMBER, JDBCWorkspaceDataContainer.USE_SEQUENCE_AUTO).equalsI... | [
"public",
"static",
"boolean",
"useSequenceForOrderNumber",
"(",
"WorkspaceEntry",
"wsConfig",
",",
"String",
"dbDialect",
")",
"throws",
"RepositoryConfigurationException",
"{",
"try",
"{",
"if",
"(",
"wsConfig",
".",
"getContainer",
"(",
")",
".",
"getParameterValue... | Use sequence for order number.
@param wsConfig The workspace configuration.
@return true if the sequence are enable. False otherwise. | [
"Use",
"sequence",
"for",
"order",
"number",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/util/jdbc/DBInitializerHelper.java#L395-L412 |
groupon/monsoon | history/src/main/java/com/groupon/lex/metrics/history/v1/xdr/ToXdr.java | ToXdr.string_index_ | private int string_index_(dictionary_delta dict_delta, MetricValue str) {
assert(str.getStrValue() != null);
final BiMap<MetricValue, Integer> dict = from_.getStrvalDict().inverse();
final Integer resolved = dict.get(str);
if (resolved != null) return resolved;
final int allocat... | java | private int string_index_(dictionary_delta dict_delta, MetricValue str) {
assert(str.getStrValue() != null);
final BiMap<MetricValue, Integer> dict = from_.getStrvalDict().inverse();
final Integer resolved = dict.get(str);
if (resolved != null) return resolved;
final int allocat... | [
"private",
"int",
"string_index_",
"(",
"dictionary_delta",
"dict_delta",
",",
"MetricValue",
"str",
")",
"{",
"assert",
"(",
"str",
".",
"getStrValue",
"(",
")",
"!=",
"null",
")",
";",
"final",
"BiMap",
"<",
"MetricValue",
",",
"Integer",
">",
"dict",
"=... | Lookup the index for the argument, or if it isn't present, create one. | [
"Lookup",
"the",
"index",
"for",
"the",
"argument",
"or",
"if",
"it",
"isn",
"t",
"present",
"create",
"one",
"."
] | train | https://github.com/groupon/monsoon/blob/eb68d72ba4c01fe018dc981097dbee033908f5c7/history/src/main/java/com/groupon/lex/metrics/history/v1/xdr/ToXdr.java#L185-L204 |
knowm/XChange | xchange-quadrigacx/src/main/java/org/knowm/xchange/quadrigacx/service/QuadrigaCxAccountService.java | QuadrigaCxAccountService.requestDepositAddress | @Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
if (currency.equals(Currency.BTC))
return getQuadrigaCxBitcoinDepositAddress().getDepositAddress();
else if (currency.equals(Currency.ETH))
return getQuadrigaCxEtherDepositAddress().getDeposi... | java | @Override
public String requestDepositAddress(Currency currency, String... arguments) throws IOException {
if (currency.equals(Currency.BTC))
return getQuadrigaCxBitcoinDepositAddress().getDepositAddress();
else if (currency.equals(Currency.ETH))
return getQuadrigaCxEtherDepositAddress().getDeposi... | [
"@",
"Override",
"public",
"String",
"requestDepositAddress",
"(",
"Currency",
"currency",
",",
"String",
"...",
"arguments",
")",
"throws",
"IOException",
"{",
"if",
"(",
"currency",
".",
"equals",
"(",
"Currency",
".",
"BTC",
")",
")",
"return",
"getQuadriga... | This returns the currently set deposit address. It will not generate a new address (ie.
repeated calls will return the same address). | [
"This",
"returns",
"the",
"currently",
"set",
"deposit",
"address",
".",
"It",
"will",
"not",
"generate",
"a",
"new",
"address",
"(",
"ie",
".",
"repeated",
"calls",
"will",
"return",
"the",
"same",
"address",
")",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-quadrigacx/src/main/java/org/knowm/xchange/quadrigacx/service/QuadrigaCxAccountService.java#L60-L73 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java | AbstractLogger.enter | protected EntryMessage enter(final String fqcn, final String format, final Supplier<?>... paramSuppliers) {
EntryMessage entryMsg = null;
if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, paramSuppli... | java | protected EntryMessage enter(final String fqcn, final String format, final Supplier<?>... paramSuppliers) {
EntryMessage entryMsg = null;
if (isEnabled(Level.TRACE, ENTRY_MARKER, (Object) null, null)) {
logMessageSafely(fqcn, Level.TRACE, ENTRY_MARKER, entryMsg = entryMsg(format, paramSuppli... | [
"protected",
"EntryMessage",
"enter",
"(",
"final",
"String",
"fqcn",
",",
"final",
"String",
"format",
",",
"final",
"Supplier",
"<",
"?",
">",
"...",
"paramSuppliers",
")",
"{",
"EntryMessage",
"entryMsg",
"=",
"null",
";",
"if",
"(",
"isEnabled",
"(",
"... | Logs entry to a method with location information.
@param fqcn The fully qualified class name of the <b>caller</b>.
@param format Format String for the parameters.
@param paramSuppliers The Suppliers of the parameters. | [
"Logs",
"entry",
"to",
"a",
"method",
"with",
"location",
"information",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/AbstractLogger.java#L507-L513 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java | DefaultBeanDescriptor.extractPropertyDescriptor | protected void extractPropertyDescriptor(java.beans.PropertyDescriptor propertyDescriptor, Object defaultInstance)
{
DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor();
Method writeMethod = propertyDescriptor.getWriteMethod();
if (writeMethod != null) {
Method rea... | java | protected void extractPropertyDescriptor(java.beans.PropertyDescriptor propertyDescriptor, Object defaultInstance)
{
DefaultPropertyDescriptor desc = new DefaultPropertyDescriptor();
Method writeMethod = propertyDescriptor.getWriteMethod();
if (writeMethod != null) {
Method rea... | [
"protected",
"void",
"extractPropertyDescriptor",
"(",
"java",
".",
"beans",
".",
"PropertyDescriptor",
"propertyDescriptor",
",",
"Object",
"defaultInstance",
")",
"{",
"DefaultPropertyDescriptor",
"desc",
"=",
"new",
"DefaultPropertyDescriptor",
"(",
")",
";",
"Method... | Extract provided properties information and insert it in {@link #parameterDescriptorMap}.
@param propertyDescriptor the JAVA bean property descriptor.
@param defaultInstance the default instance of bean class. | [
"Extract",
"provided",
"properties",
"information",
"and",
"insert",
"it",
"in",
"{",
"@link",
"#parameterDescriptorMap",
"}",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-properties/src/main/java/org/xwiki/properties/internal/DefaultBeanDescriptor.java#L140-L204 |
JodaOrg/joda-money | src/main/java/org/joda/money/Money.java | Money.plus | public Money plus(BigDecimal amountToAdd, RoundingMode roundingMode) {
return with(money.plusRetainScale(amountToAdd, roundingMode));
} | java | public Money plus(BigDecimal amountToAdd, RoundingMode roundingMode) {
return with(money.plusRetainScale(amountToAdd, roundingMode));
} | [
"public",
"Money",
"plus",
"(",
"BigDecimal",
"amountToAdd",
",",
"RoundingMode",
"roundingMode",
")",
"{",
"return",
"with",
"(",
"money",
".",
"plusRetainScale",
"(",
"amountToAdd",
",",
"roundingMode",
")",
")",
";",
"}"
] | Returns a copy of this monetary value with the amount added.
<p>
This adds the specified amount to this monetary amount, returning a new object.
If the amount to add exceeds the scale of the currency, then the
rounding mode will be used to adjust the result.
<p>
This instance is immutable and unaffected by this method.... | [
"Returns",
"a",
"copy",
"of",
"this",
"monetary",
"value",
"with",
"the",
"amount",
"added",
".",
"<p",
">",
"This",
"adds",
"the",
"specified",
"amount",
"to",
"this",
"monetary",
"amount",
"returning",
"a",
"new",
"object",
".",
"If",
"the",
"amount",
... | train | https://github.com/JodaOrg/joda-money/blob/e1f2de75aa36610a695358696c8a88a18ca66cde/src/main/java/org/joda/money/Money.java#L777-L779 |
OpenBEL/openbel-framework | org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/beldata/namespace/NamespaceHeaderParser.java | NamespaceHeaderParser.parseNamespace | public NamespaceHeader parseNamespace(String resourceLocation,
File namespaceFile) throws IOException,
BELDataMissingPropertyException,
BELDataConversionException {
if (namespaceFile == null) {
throw new InvalidArgument("namespaceFile", namespaceFile);
}
... | java | public NamespaceHeader parseNamespace(String resourceLocation,
File namespaceFile) throws IOException,
BELDataMissingPropertyException,
BELDataConversionException {
if (namespaceFile == null) {
throw new InvalidArgument("namespaceFile", namespaceFile);
}
... | [
"public",
"NamespaceHeader",
"parseNamespace",
"(",
"String",
"resourceLocation",
",",
"File",
"namespaceFile",
")",
"throws",
"IOException",
",",
"BELDataMissingPropertyException",
",",
"BELDataConversionException",
"{",
"if",
"(",
"namespaceFile",
"==",
"null",
")",
"... | Parses the namespace {@link File} into a {@link NamespaceHeader} object.
@param namespaceFile {@link File}, the namespace file, which cannot be
null, must exist, and must be readable
@return {@link NamespaceHeader}, the parsed namespace header
@throws IOException Thrown if an IO error occurred reading the
<tt>namespac... | [
"Parses",
"the",
"namespace",
"{",
"@link",
"File",
"}",
"into",
"a",
"{",
"@link",
"NamespaceHeader",
"}",
"object",
"."
] | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.core/src/main/java/org/openbel/framework/core/df/beldata/namespace/NamespaceHeaderParser.java#L72-L105 |
alkacon/opencms-core | src-gwt/org/opencms/acacia/client/CmsEditorBase.java | CmsEditorBase.renderEntityForm | public void renderEntityForm(String entityId, List<CmsTabInfo> tabInfos, Panel context, Element scrollParent) {
CmsEntity entity = m_entityBackend.getEntity(entityId);
if (entity != null) {
boolean initUndo = (m_entity == null) || !entity.getId().equals(m_entity.getId());
m... | java | public void renderEntityForm(String entityId, List<CmsTabInfo> tabInfos, Panel context, Element scrollParent) {
CmsEntity entity = m_entityBackend.getEntity(entityId);
if (entity != null) {
boolean initUndo = (m_entity == null) || !entity.getId().equals(m_entity.getId());
m... | [
"public",
"void",
"renderEntityForm",
"(",
"String",
"entityId",
",",
"List",
"<",
"CmsTabInfo",
">",
"tabInfos",
",",
"Panel",
"context",
",",
"Element",
"scrollParent",
")",
"{",
"CmsEntity",
"entity",
"=",
"m_entityBackend",
".",
"getEntity",
"(",
"entityId",... | Renders the entity form within the given context.<p>
@param entityId the entity id
@param tabInfos the tab informations
@param context the context element
@param scrollParent the scroll element to be used for automatic scrolling during drag and drop | [
"Renders",
"the",
"entity",
"form",
"within",
"the",
"given",
"context",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/acacia/client/CmsEditorBase.java#L384-L412 |
Azure/autorest-clientruntime-for-java | azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourcesCachedImpl.java | ExternalChildResourcesCachedImpl.prepareInlineRemove | protected final void prepareInlineRemove(String name, String key) {
FluentModelTImpl childResource = find(key);
if (childResource == null
|| childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeCreated) {
throw new IllegalArgumentException("A chi... | java | protected final void prepareInlineRemove(String name, String key) {
FluentModelTImpl childResource = find(key);
if (childResource == null
|| childResource.pendingOperation() == ExternalChildResourceImpl.PendingOperation.ToBeCreated) {
throw new IllegalArgumentException("A chi... | [
"protected",
"final",
"void",
"prepareInlineRemove",
"(",
"String",
"name",
",",
"String",
"key",
")",
"{",
"FluentModelTImpl",
"childResource",
"=",
"find",
"(",
"key",
")",
";",
"if",
"(",
"childResource",
"==",
"null",
"||",
"childResource",
".",
"pendingOp... | Prepare for inline removal of an external child resource (along with the update of parent resource).
@param name the name of the external child resource
@param key the key | [
"Prepare",
"for",
"inline",
"removal",
"of",
"an",
"external",
"child",
"resource",
"(",
"along",
"with",
"the",
"update",
"of",
"parent",
"resource",
")",
"."
] | train | https://github.com/Azure/autorest-clientruntime-for-java/blob/04621e07dbb0456dd5459dd641f06a9fd4f3abad/azure-arm-client-runtime/src/main/java/com/microsoft/azure/arm/resources/collection/implementation/ExternalChildResourcesCachedImpl.java#L146-L154 |
sockeqwe/mosby | sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java | DimensUtils.pxToDp | public static int pxToDp(Context context, int px) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((px / displayMetrics.density) + 0.5);
} | java | public static int pxToDp(Context context, int px) {
DisplayMetrics displayMetrics = context.getResources().getDisplayMetrics();
return (int) ((px / displayMetrics.density) + 0.5);
} | [
"public",
"static",
"int",
"pxToDp",
"(",
"Context",
"context",
",",
"int",
"px",
")",
"{",
"DisplayMetrics",
"displayMetrics",
"=",
"context",
".",
"getResources",
"(",
")",
".",
"getDisplayMetrics",
"(",
")",
";",
"return",
"(",
"int",
")",
"(",
"(",
"... | Converts pixel in dp
@param context The context
@param px the pixel value
@return value in dp | [
"Converts",
"pixel",
"in",
"dp"
] | train | https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mail/src/main/java/com/hannesdorfmann/mosby3/sample/mail/utils/DimensUtils.java#L33-L36 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationResult.java | CreateIntegrationResult.withRequestParameters | public CreateIntegrationResult withRequestParameters(java.util.Map<String, String> requestParameters) {
setRequestParameters(requestParameters);
return this;
} | java | public CreateIntegrationResult withRequestParameters(java.util.Map<String, String> requestParameters) {
setRequestParameters(requestParameters);
return this;
} | [
"public",
"CreateIntegrationResult",
"withRequestParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"requestParameters",
")",
"{",
"setRequestParameters",
"(",
"requestParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying request parameters that are passed from the method request to the backend. The key is
an integration request parameter name and the associated value is a method request parameter value or static
value that must be enclosed within single quotes and pre-encoded as required by the backend. T... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"request",
"parameters",
"that",
"are",
"passed",
"from",
"the",
"method",
"request",
"to",
"the",
"backend",
".",
"The",
"key",
"is",
"an",
"integration",
"request",
"parameter",
"name",
"and",
"th... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateIntegrationResult.java#L1146-L1149 |
beangle/beangle3 | struts/s2/src/main/java/org/beangle/struts2/view/template/FreemarkerTemplateEngine.java | FreemarkerTemplateEngine.setFreemarkerManager | @Inject
public void setFreemarkerManager(FreemarkerManager mgr) {
this.freemarkerManager = mgr;
if (null != freemarkerManager) {
Configuration old = freemarkerManager.getConfig();
if (null != old) {
config = (Configuration) freemarkerManager.getConfig().clone();
config.setTemplateL... | java | @Inject
public void setFreemarkerManager(FreemarkerManager mgr) {
this.freemarkerManager = mgr;
if (null != freemarkerManager) {
Configuration old = freemarkerManager.getConfig();
if (null != old) {
config = (Configuration) freemarkerManager.getConfig().clone();
config.setTemplateL... | [
"@",
"Inject",
"public",
"void",
"setFreemarkerManager",
"(",
"FreemarkerManager",
"mgr",
")",
"{",
"this",
".",
"freemarkerManager",
"=",
"mgr",
";",
"if",
"(",
"null",
"!=",
"freemarkerManager",
")",
"{",
"Configuration",
"old",
"=",
"freemarkerManager",
".",
... | Clone configuration from FreemarkerManager,but custmize in
<ul>
<li>Disable freemarker localized lookup
<li>Cache two hour(7200s) and Strong cache
<li>Disable auto imports and includes
</ul> | [
"Clone",
"configuration",
"from",
"FreemarkerManager",
"but",
"custmize",
"in",
"<ul",
">",
"<li",
">",
"Disable",
"freemarker",
"localized",
"lookup",
"<li",
">",
"Cache",
"two",
"hour",
"(",
"7200s",
")",
"and",
"Strong",
"cache",
"<li",
">",
"Disable",
"a... | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/struts/s2/src/main/java/org/beangle/struts2/view/template/FreemarkerTemplateEngine.java#L80-L105 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/BaseScriptPlugin.java | BaseScriptPlugin.createScriptArgsList | protected ExecArgList createScriptArgsList(final Map<String, Map<String, String>> dataContext) {
final ScriptPluginProvider plugin = getProvider();
final File scriptfile = plugin.getScriptFile();
final String scriptargs = null != plugin.getScriptArgs() ?
DataCo... | java | protected ExecArgList createScriptArgsList(final Map<String, Map<String, String>> dataContext) {
final ScriptPluginProvider plugin = getProvider();
final File scriptfile = plugin.getScriptFile();
final String scriptargs = null != plugin.getScriptArgs() ?
DataCo... | [
"protected",
"ExecArgList",
"createScriptArgsList",
"(",
"final",
"Map",
"<",
"String",
",",
"Map",
"<",
"String",
",",
"String",
">",
">",
"dataContext",
")",
"{",
"final",
"ScriptPluginProvider",
"plugin",
"=",
"getProvider",
"(",
")",
";",
"final",
"File",
... | Create the command array for the data context.
@param dataContext data
@return arglist | [
"Create",
"the",
"command",
"array",
"for",
"the",
"data",
"context",
"."
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/BaseScriptPlugin.java#L198-L214 |
Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AInputStream.java | S3AInputStream.openStream | private void openStream() throws IOException {
if (mIn != null) { // stream is already open
return;
}
GetObjectRequest getReq = new GetObjectRequest(mBucketName, mKey);
// If the position is 0, setting range is redundant and causes an error if the file is 0 length
if (mPos > 0) {
getReq.... | java | private void openStream() throws IOException {
if (mIn != null) { // stream is already open
return;
}
GetObjectRequest getReq = new GetObjectRequest(mBucketName, mKey);
// If the position is 0, setting range is redundant and causes an error if the file is 0 length
if (mPos > 0) {
getReq.... | [
"private",
"void",
"openStream",
"(",
")",
"throws",
"IOException",
"{",
"if",
"(",
"mIn",
"!=",
"null",
")",
"{",
"// stream is already open",
"return",
";",
"}",
"GetObjectRequest",
"getReq",
"=",
"new",
"GetObjectRequest",
"(",
"mBucketName",
",",
"mKey",
"... | Opens a new stream at mPos if the wrapped stream mIn is null. | [
"Opens",
"a",
"new",
"stream",
"at",
"mPos",
"if",
"the",
"wrapped",
"stream",
"mIn",
"is",
"null",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AInputStream.java#L136-L162 |
AltBeacon/android-beacon-library | lib/src/main/java/org/altbeacon/beacon/Identifier.java | Identifier.fromBytes | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static Identifier fromBytes(byte[] bytes, int start, int end, boolean littleEndian) {
if (bytes == null) {
throw new NullPointerException("Identifiers cannot be constructed from null pointers but \"bytes\" is null.");
}
if (start... | java | @TargetApi(Build.VERSION_CODES.GINGERBREAD)
public static Identifier fromBytes(byte[] bytes, int start, int end, boolean littleEndian) {
if (bytes == null) {
throw new NullPointerException("Identifiers cannot be constructed from null pointers but \"bytes\" is null.");
}
if (start... | [
"@",
"TargetApi",
"(",
"Build",
".",
"VERSION_CODES",
".",
"GINGERBREAD",
")",
"public",
"static",
"Identifier",
"fromBytes",
"(",
"byte",
"[",
"]",
"bytes",
",",
"int",
"start",
",",
"int",
"end",
",",
"boolean",
"littleEndian",
")",
"{",
"if",
"(",
"by... | Creates an Identifier from the specified byte array.
@param bytes array to copy from
@param start the start index, inclusive
@param end the end index, exclusive
@param littleEndian whether the bytes are ordered in little endian
@return a new Identifier
@throws java.lang.NullPointerException <code>bytes</code> must not ... | [
"Creates",
"an",
"Identifier",
"from",
"the",
"specified",
"byte",
"array",
"."
] | train | https://github.com/AltBeacon/android-beacon-library/blob/f7f3a323ea7415d53e7bd695ff6a01f1501d5dc3/lib/src/main/java/org/altbeacon/beacon/Identifier.java#L171-L191 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/DSUtil.java | DSUtil.iterableSizeEq | public static <E> boolean iterableSizeEq(Iterable<E> itrbl, int k) {
// 1) try to iterate k times over itrbl;
Iterator<E> it = itrbl.iterator();
for(int i = 0; i < k; i++) {
if(!it.hasNext()) return false;
it.next();
}
// 2) next check that there are no more elements in itrbl
return !it.hasNext();
} | java | public static <E> boolean iterableSizeEq(Iterable<E> itrbl, int k) {
// 1) try to iterate k times over itrbl;
Iterator<E> it = itrbl.iterator();
for(int i = 0; i < k; i++) {
if(!it.hasNext()) return false;
it.next();
}
// 2) next check that there are no more elements in itrbl
return !it.hasNext();
} | [
"public",
"static",
"<",
"E",
">",
"boolean",
"iterableSizeEq",
"(",
"Iterable",
"<",
"E",
">",
"itrbl",
",",
"int",
"k",
")",
"{",
"// 1) try to iterate k times over itrbl;",
"Iterator",
"<",
"E",
">",
"it",
"=",
"itrbl",
".",
"iterator",
"(",
")",
";",
... | Checks whether the iterable <code>itrbl</code> has exactly
<code>k</code> elements. Instead of computing the length of
<code>itrbl</code> (complexity: linear in the length) and
comparing it with <code>k</code>, we try to iterate exactly
<code>k</code> times and next check that <code>itrbl</code> is
exhausted.
Complex... | [
"Checks",
"whether",
"the",
"iterable",
"<code",
">",
"itrbl<",
"/",
"code",
">",
"has",
"exactly",
"<code",
">",
"k<",
"/",
"code",
">",
"elements",
".",
"Instead",
"of",
"computing",
"the",
"length",
"of",
"<code",
">",
"itrbl<",
"/",
"code",
">",
"(... | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/DSUtil.java#L97-L106 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java | Types.closureCollector | public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
ClosureHolder::add,
ClosureHolder::merge,
ClosureHolder::closure);
... | java | public Collector<Type, ClosureHolder, List<Type>> closureCollector(boolean minClosure, BiPredicate<Type, Type> shouldSkip) {
return Collector.of(() -> new ClosureHolder(minClosure, shouldSkip),
ClosureHolder::add,
ClosureHolder::merge,
ClosureHolder::closure);
... | [
"public",
"Collector",
"<",
"Type",
",",
"ClosureHolder",
",",
"List",
"<",
"Type",
">",
">",
"closureCollector",
"(",
"boolean",
"minClosure",
",",
"BiPredicate",
"<",
"Type",
",",
"Type",
">",
"shouldSkip",
")",
"{",
"return",
"Collector",
".",
"of",
"("... | Collect types into a new closure (using a @code{ClosureHolder}) | [
"Collect",
"types",
"into",
"a",
"new",
"closure",
"(",
"using",
"a"
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L3436-L3441 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TaiwanCalendar.java | TaiwanCalendar.handleGetLimit | protected int handleGetLimit(int field, int limitType) {
if (field == ERA) {
if (limitType == MINIMUM || limitType == GREATEST_MINIMUM) {
return BEFORE_MINGUO;
} else {
return MINGUO;
}
}
return super.handleGetLimit(field, limit... | java | protected int handleGetLimit(int field, int limitType) {
if (field == ERA) {
if (limitType == MINIMUM || limitType == GREATEST_MINIMUM) {
return BEFORE_MINGUO;
} else {
return MINGUO;
}
}
return super.handleGetLimit(field, limit... | [
"protected",
"int",
"handleGetLimit",
"(",
"int",
"field",
",",
"int",
"limitType",
")",
"{",
"if",
"(",
"field",
"==",
"ERA",
")",
"{",
"if",
"(",
"limitType",
"==",
"MINIMUM",
"||",
"limitType",
"==",
"GREATEST_MINIMUM",
")",
"{",
"return",
"BEFORE_MINGU... | Override GregorianCalendar. There is only one Taiwan ERA. We
should really handle YEAR, YEAR_WOY, and EXTENDED_YEAR here too to
implement the 1..5000000 range, but it's not critical. | [
"Override",
"GregorianCalendar",
".",
"There",
"is",
"only",
"one",
"Taiwan",
"ERA",
".",
"We",
"should",
"really",
"handle",
"YEAR",
"YEAR_WOY",
"and",
"EXTENDED_YEAR",
"here",
"too",
"to",
"implement",
"the",
"1",
"..",
"5000000",
"range",
"but",
"it",
"s"... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/TaiwanCalendar.java#L221-L230 |
neoremind/fluent-validator | fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/util/ReflectionUtil.java | ReflectionUtil.invokeMethod | public static <T> T invokeMethod(Method method, Object target, Object... args) {
if (method == null) {
return null;
}
method.setAccessible(true);
try {
@SuppressWarnings("unchecked")
T result = (T) method.invoke(target, args);
return resul... | java | public static <T> T invokeMethod(Method method, Object target, Object... args) {
if (method == null) {
return null;
}
method.setAccessible(true);
try {
@SuppressWarnings("unchecked")
T result = (T) method.invoke(target, args);
return resul... | [
"public",
"static",
"<",
"T",
">",
"T",
"invokeMethod",
"(",
"Method",
"method",
",",
"Object",
"target",
",",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"method",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"method",
".",
"setAccessible",
... | 方法调用,如果<code>clazz</code>为<code>null</code>,返回<code>null</code>;
<p/>
如果<code>method</code>为<code>null</code>,返回<code>null</code>
<p/>
如果<code>target</code>为<code>null</code>,则为静态方法
@param method 调用的方法
@param target 目标对象
@param args 方法的参数值
@return 调用结果 | [
"方法调用,如果<code",
">",
"clazz<",
"/",
"code",
">",
"为<code",
">",
"null<",
"/",
"code",
">",
",返回<code",
">",
"null<",
"/",
"code",
">",
";",
"<p",
"/",
">",
"如果<code",
">",
"method<",
"/",
"code",
">",
"为<code",
">",
"null<",
"/",
"code",
">",
",返回<... | train | https://github.com/neoremind/fluent-validator/blob/b516970591aa9468b44ba63938b98ec341fd6ead/fluent-validator/src/main/java/com/baidu/unbiz/fluentvalidator/util/ReflectionUtil.java#L174-L187 |
brettwooldridge/HikariCP | src/main/java/com/zaxxer/hikari/util/UtilityElf.java | UtilityElf.createInstance | public static <T> T createInstance(final String className, final Class<T> clazz, final Object... args)
{
if (className == null) {
return null;
}
try {
Class<?> loaded = UtilityElf.class.getClassLoader().loadClass(className);
if (args.length == 0) {
return cla... | java | public static <T> T createInstance(final String className, final Class<T> clazz, final Object... args)
{
if (className == null) {
return null;
}
try {
Class<?> loaded = UtilityElf.class.getClassLoader().loadClass(className);
if (args.length == 0) {
return cla... | [
"public",
"static",
"<",
"T",
">",
"T",
"createInstance",
"(",
"final",
"String",
"className",
",",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"...",
"args",
")",
"{",
"if",
"(",
"className",
"==",
"null",
")",
"{",
"return",
"... | Create and instance of the specified class using the constructor matching the specified
arguments.
@param <T> the class type
@param className the name of the class to instantiate
@param clazz a class to cast the result as
@param args arguments to a constructor
@return an instance of the specified class | [
"Create",
"and",
"instance",
"of",
"the",
"specified",
"class",
"using",
"the",
"constructor",
"matching",
"the",
"specified",
"arguments",
"."
] | train | https://github.com/brettwooldridge/HikariCP/blob/c509ec1a3f1e19769ee69323972f339cf098ff4b/src/main/java/com/zaxxer/hikari/util/UtilityElf.java#L92-L114 |
jbundle/jbundle | base/message/core/src/main/java/org/jbundle/base/message/core/tree/TreeMessageFilterList.java | TreeMessageFilterList.removeMessageFilter | public boolean removeMessageFilter(Integer intFilterID, boolean bFreeFilter)
{
BaseMessageFilter messageFilter = this.getMessageFilter(intFilterID);
if (messageFilter == null)
return false; // It is possible for a client to try to remove it's remote filter that was removed as a duplica... | java | public boolean removeMessageFilter(Integer intFilterID, boolean bFreeFilter)
{
BaseMessageFilter messageFilter = this.getMessageFilter(intFilterID);
if (messageFilter == null)
return false; // It is possible for a client to try to remove it's remote filter that was removed as a duplica... | [
"public",
"boolean",
"removeMessageFilter",
"(",
"Integer",
"intFilterID",
",",
"boolean",
"bFreeFilter",
")",
"{",
"BaseMessageFilter",
"messageFilter",
"=",
"this",
".",
"getMessageFilter",
"(",
"intFilterID",
")",
";",
"if",
"(",
"messageFilter",
"==",
"null",
... | Remove this message filter from this queue.
Note: This will remove a filter that equals this filter, accounting for a copy
passed from a remote client.
@param messageFilter The message filter to remove.
@param bFreeFilter If true, free this filter.
@return True if successful. | [
"Remove",
"this",
"message",
"filter",
"from",
"this",
"queue",
".",
"Note",
":",
"This",
"will",
"remove",
"a",
"filter",
"that",
"equals",
"this",
"filter",
"accounting",
"for",
"a",
"copy",
"passed",
"from",
"a",
"remote",
"client",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/core/src/main/java/org/jbundle/base/message/core/tree/TreeMessageFilterList.java#L74-L84 |
citrusframework/citrus | modules/citrus-ws/src/main/java/com/consol/citrus/ws/config/xml/SendSoapFaultActionParser.java | SendSoapFaultActionParser.parseFault | private void parseFault(BeanDefinitionBuilder builder, Element faultElement) {
if (faultElement != null) {
Element faultCodeElement = DomUtils.getChildElementByTagName(faultElement, "fault-code");
if (faultCodeElement != null) {
builder.addPropertyValue("faultCode", DomUt... | java | private void parseFault(BeanDefinitionBuilder builder, Element faultElement) {
if (faultElement != null) {
Element faultCodeElement = DomUtils.getChildElementByTagName(faultElement, "fault-code");
if (faultCodeElement != null) {
builder.addPropertyValue("faultCode", DomUt... | [
"private",
"void",
"parseFault",
"(",
"BeanDefinitionBuilder",
"builder",
",",
"Element",
"faultElement",
")",
"{",
"if",
"(",
"faultElement",
"!=",
"null",
")",
"{",
"Element",
"faultCodeElement",
"=",
"DomUtils",
".",
"getChildElementByTagName",
"(",
"faultElement... | Parses the SOAP fault information.
@param builder
@param faultElement | [
"Parses",
"the",
"SOAP",
"fault",
"information",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-ws/src/main/java/com/consol/citrus/ws/config/xml/SendSoapFaultActionParser.java#L52-L71 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java | ApiOvhEmaildomain.domain_responder_account_DELETE | public OvhTaskSpecialAccount domain_responder_account_DELETE(String domain, String account) throws IOException {
String qPath = "/email/domain/{domain}/responder/{account}";
StringBuilder sb = path(qPath, domain, account);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convertTo(resp, OvhTaskS... | java | public OvhTaskSpecialAccount domain_responder_account_DELETE(String domain, String account) throws IOException {
String qPath = "/email/domain/{domain}/responder/{account}";
StringBuilder sb = path(qPath, domain, account);
String resp = exec(qPath, "DELETE", sb.toString(), null);
return convertTo(resp, OvhTaskS... | [
"public",
"OvhTaskSpecialAccount",
"domain_responder_account_DELETE",
"(",
"String",
"domain",
",",
"String",
"account",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/domain/{domain}/responder/{account}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"... | Delete an existing responder in server
REST: DELETE /email/domain/{domain}/responder/{account}
@param domain [required] Name of your domain name
@param account [required] Name of account | [
"Delete",
"an",
"existing",
"responder",
"in",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emaildomain/src/main/java/net/minidev/ovh/api/ApiOvhEmaildomain.java#L978-L983 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Scanner.java | Scanner.nextBigInteger | public BigInteger nextBigInteger(int radix) {
// Check cached result
if ((typeCache != null) && (typeCache instanceof BigInteger)
&& this.radix == radix) {
BigInteger val = (BigInteger)typeCache;
useTypeCache();
return val;
}
setRadix(radix... | java | public BigInteger nextBigInteger(int radix) {
// Check cached result
if ((typeCache != null) && (typeCache instanceof BigInteger)
&& this.radix == radix) {
BigInteger val = (BigInteger)typeCache;
useTypeCache();
return val;
}
setRadix(radix... | [
"public",
"BigInteger",
"nextBigInteger",
"(",
"int",
"radix",
")",
"{",
"// Check cached result",
"if",
"(",
"(",
"typeCache",
"!=",
"null",
")",
"&&",
"(",
"typeCache",
"instanceof",
"BigInteger",
")",
"&&",
"this",
".",
"radix",
"==",
"radix",
")",
"{",
... | Scans the next token of the input as a {@link java.math.BigInteger
BigInteger}.
<p> If the next token matches the <a
href="#Integer-regex"><i>Integer</i></a> regular expression defined
above then the token is converted into a <tt>BigInteger</tt> value as if
by removing all group separators, mapping non-ASCII digits in... | [
"Scans",
"the",
"next",
"token",
"of",
"the",
"input",
"as",
"a",
"{",
"@link",
"java",
".",
"math",
".",
"BigInteger",
"BigInteger",
"}",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Scanner.java#L2479-L2499 |
albfernandez/itext2 | src/main/java/com/lowagie/text/pdf/PdfStamper.java | PdfStamper.setEncryption | public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, int encryptionType) throws DocumentException {
if (stamper.isAppend())
throw new DocumentException("Append mode does not support changing the encryption status.");
if (stamper.isContentWritten())
... | java | public void setEncryption(byte userPassword[], byte ownerPassword[], int permissions, int encryptionType) throws DocumentException {
if (stamper.isAppend())
throw new DocumentException("Append mode does not support changing the encryption status.");
if (stamper.isContentWritten())
... | [
"public",
"void",
"setEncryption",
"(",
"byte",
"userPassword",
"[",
"]",
",",
"byte",
"ownerPassword",
"[",
"]",
",",
"int",
"permissions",
",",
"int",
"encryptionType",
")",
"throws",
"DocumentException",
"{",
"if",
"(",
"stamper",
".",
"isAppend",
"(",
")... | Sets the encryption options for this document. The userPassword and the
ownerPassword can be null or have zero length. In this case the ownerPassword
is replaced by a random string. The open permissions for the document can be
AllowPrinting, AllowModifyContents, AllowCopy, AllowModifyAnnotations,
AllowFillIn, AllowScre... | [
"Sets",
"the",
"encryption",
"options",
"for",
"this",
"document",
".",
"The",
"userPassword",
"and",
"the",
"ownerPassword",
"can",
"be",
"null",
"or",
"have",
"zero",
"length",
".",
"In",
"this",
"case",
"the",
"ownerPassword",
"is",
"replaced",
"by",
"a",... | train | https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfStamper.java#L290-L296 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java | Download.toTempFile | public static void toTempFile(final HttpConfig config, final String contentType) {
try {
toFile(config, contentType, File.createTempFile("tmp", ".tmp"));
}
catch(IOException ioe) {
throw new TransportingException(ioe);
}
} | java | public static void toTempFile(final HttpConfig config, final String contentType) {
try {
toFile(config, contentType, File.createTempFile("tmp", ".tmp"));
}
catch(IOException ioe) {
throw new TransportingException(ioe);
}
} | [
"public",
"static",
"void",
"toTempFile",
"(",
"final",
"HttpConfig",
"config",
",",
"final",
"String",
"contentType",
")",
"{",
"try",
"{",
"toFile",
"(",
"config",
",",
"contentType",
",",
"File",
".",
"createTempFile",
"(",
"\"tmp\"",
",",
"\".tmp\"",
")"... | Downloads the content to a temporary file (*.tmp in the system temp directory) with the specified content type.
@param config the `HttpConfig` instance
@param contentType the content type | [
"Downloads",
"the",
"content",
"to",
"a",
"temporary",
"file",
"(",
"*",
".",
"tmp",
"in",
"the",
"system",
"temp",
"directory",
")",
"with",
"the",
"specified",
"content",
"type",
"."
] | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/optional/Download.java#L66-L73 |
apigee/usergrid-java-sdk | src/main/java/org/usergrid/java/client/Client.java | Client.createGroup | public ApiResponse createGroup(String groupPath, String groupTitle, String groupName){
Map<String, Object> data = new HashMap<String, Object>();
data.put("type", "group");
data.put("path", groupPath);
if (groupTitle != null) {
data.put("title", groupTitle);
}... | java | public ApiResponse createGroup(String groupPath, String groupTitle, String groupName){
Map<String, Object> data = new HashMap<String, Object>();
data.put("type", "group");
data.put("path", groupPath);
if (groupTitle != null) {
data.put("title", groupTitle);
}... | [
"public",
"ApiResponse",
"createGroup",
"(",
"String",
"groupPath",
",",
"String",
"groupTitle",
",",
"String",
"groupName",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
"... | Create a group with a path, title and name
@param groupPath
@param groupTitle
@param groupName
@return | [
"Create",
"a",
"group",
"with",
"a",
"path",
"title",
"and",
"name"
] | train | https://github.com/apigee/usergrid-java-sdk/blob/6202745f184754defff13962dfc3d830bc7d8c63/src/main/java/org/usergrid/java/client/Client.java#L912-L926 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Completable.java | Completable.concatWith | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable concatWith(CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return concatArray(this, other);
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Completable concatWith(CompletableSource other) {
ObjectHelper.requireNonNull(other, "other is null");
return concatArray(this, other);
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Completable",
"concatWith",
"(",
"CompletableSource",
"other",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"other",
",",
"\"other is null\"",
"... | Concatenates this Completable with another Completable.
<p>
<img width="640" height="317" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Completable.concatWith.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code concatWith} does not operate by default on a particular {@link Scheduler}.</dd>
<... | [
"Concatenates",
"this",
"Completable",
"with",
"another",
"Completable",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"317",
"src",
"=",
"https",
":",
"//",
"raw",
".",
"github",
".",
"com",
"/",
"wiki",
"/",
"ReactiveX",
"/",
"RxJava",
... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Completable.java#L1320-L1325 |
Azure/azure-sdk-for-java | logic/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/logic/v2016_06_01/implementation/PartnersInner.java | PartnersInner.listContentCallbackUrlAsync | public Observable<WorkflowTriggerCallbackUrlInner> listContentCallbackUrlAsync(String resourceGroupName, String integrationAccountName, String partnerName, GetCallbackUrlParameters listContentCallbackUrl) {
return listContentCallbackUrlWithServiceResponseAsync(resourceGroupName, integrationAccountName, partnerN... | java | public Observable<WorkflowTriggerCallbackUrlInner> listContentCallbackUrlAsync(String resourceGroupName, String integrationAccountName, String partnerName, GetCallbackUrlParameters listContentCallbackUrl) {
return listContentCallbackUrlWithServiceResponseAsync(resourceGroupName, integrationAccountName, partnerN... | [
"public",
"Observable",
"<",
"WorkflowTriggerCallbackUrlInner",
">",
"listContentCallbackUrlAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"integrationAccountName",
",",
"String",
"partnerName",
",",
"GetCallbackUrlParameters",
"listContentCallbackUrl",
")",
"{",
... | Get the content callback url.
@param resourceGroupName The resource group name.
@param integrationAccountName The integration account name.
@param partnerName The integration account partner name.
@param listContentCallbackUrl the GetCallbackUrlParameters value
@throws IllegalArgumentException thrown if parameters fai... | [
"Get",
"the",
"content",
"callback",
"url",
"."
] | 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/PartnersInner.java#L672-L679 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsSecure.java | CmsSecure.getPropertyInheritanceInfo | public String getPropertyInheritanceInfo(String propName) throws CmsException {
String folderName = CmsResource.getParentFolder(getParamResource());
String folderPropVal = null;
while (CmsStringUtil.isNotEmpty(folderName)) {
CmsProperty prop = getCms().readPropertyObject(folderName,... | java | public String getPropertyInheritanceInfo(String propName) throws CmsException {
String folderName = CmsResource.getParentFolder(getParamResource());
String folderPropVal = null;
while (CmsStringUtil.isNotEmpty(folderName)) {
CmsProperty prop = getCms().readPropertyObject(folderName,... | [
"public",
"String",
"getPropertyInheritanceInfo",
"(",
"String",
"propName",
")",
"throws",
"CmsException",
"{",
"String",
"folderName",
"=",
"CmsResource",
".",
"getParentFolder",
"(",
"getParamResource",
"(",
")",
")",
";",
"String",
"folderPropVal",
"=",
"null",
... | Returns the information from which the property is inherited.<p>
@param propName the name of the property
@return a String containing the information from which the property is inherited and inherited value
@throws CmsException if the reading of the Property fails | [
"Returns",
"the",
"information",
"from",
"which",
"the",
"property",
"is",
"inherited",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsSecure.java#L217-L235 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.waitForFragmentByTag | public boolean waitForFragmentByTag(String tag, int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForFragmentByTag(\""+tag+"\", "+timeout+")");
}
return waiter.waitForFragment(tag, 0, timeout);
} | java | public boolean waitForFragmentByTag(String tag, int timeout){
if(config.commandLogging){
Log.d(config.commandLoggingTag, "waitForFragmentByTag(\""+tag+"\", "+timeout+")");
}
return waiter.waitForFragment(tag, 0, timeout);
} | [
"public",
"boolean",
"waitForFragmentByTag",
"(",
"String",
"tag",
",",
"int",
"timeout",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag",
",",
"\"waitForFragmentByTag(\\\"\"",
"+",
"tag"... | Waits for a Fragment matching the specified tag.
@param tag the name of the tag
@param timeout the amount of time in milliseconds to wait
@return {@code true} if fragment appears and {@code false} if it does not appear before the timeout | [
"Waits",
"for",
"a",
"Fragment",
"matching",
"the",
"specified",
"tag",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L3678-L3684 |
apereo/cas | support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java | LdapUtils.executeSearchOperation | public static Response<SearchResult> executeSearchOperation(final ConnectionFactory connectionFactory,
final String baseDn,
final SearchFilter filter) throws LdapException {
return exe... | java | public static Response<SearchResult> executeSearchOperation(final ConnectionFactory connectionFactory,
final String baseDn,
final SearchFilter filter) throws LdapException {
return exe... | [
"public",
"static",
"Response",
"<",
"SearchResult",
">",
"executeSearchOperation",
"(",
"final",
"ConnectionFactory",
"connectionFactory",
",",
"final",
"String",
"baseDn",
",",
"final",
"SearchFilter",
"filter",
")",
"throws",
"LdapException",
"{",
"return",
"execut... | Execute search operation response.
@param connectionFactory the connection factory
@param baseDn the base dn
@param filter the filter
@return the response
@throws LdapException the ldap exception | [
"Execute",
"search",
"operation",
"response",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-ldap-core/src/main/java/org/apereo/cas/util/LdapUtils.java#L268-L272 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/AsciiArtUtils.java | AsciiArtUtils.printAsciiArtWarning | @SneakyThrows
public static void printAsciiArtWarning(final Logger out, final String asciiArt, final String additional) {
out.warn(ANSI_CYAN);
out.warn("\n\n".concat(FigletFont.convertOneLine(asciiArt)).concat(additional));
out.warn(ANSI_RESET);
} | java | @SneakyThrows
public static void printAsciiArtWarning(final Logger out, final String asciiArt, final String additional) {
out.warn(ANSI_CYAN);
out.warn("\n\n".concat(FigletFont.convertOneLine(asciiArt)).concat(additional));
out.warn(ANSI_RESET);
} | [
"@",
"SneakyThrows",
"public",
"static",
"void",
"printAsciiArtWarning",
"(",
"final",
"Logger",
"out",
",",
"final",
"String",
"asciiArt",
",",
"final",
"String",
"additional",
")",
"{",
"out",
".",
"warn",
"(",
"ANSI_CYAN",
")",
";",
"out",
".",
"warn",
... | Print ascii art.
@param out the out
@param asciiArt the ascii art
@param additional the additional | [
"Print",
"ascii",
"art",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/AsciiArtUtils.java#L58-L63 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Byte.java | Byte.valueOf | public static Byte valueOf(String s, int radix)
throws NumberFormatException {
return valueOf(parseByte(s, radix));
} | java | public static Byte valueOf(String s, int radix)
throws NumberFormatException {
return valueOf(parseByte(s, radix));
} | [
"public",
"static",
"Byte",
"valueOf",
"(",
"String",
"s",
",",
"int",
"radix",
")",
"throws",
"NumberFormatException",
"{",
"return",
"valueOf",
"(",
"parseByte",
"(",
"s",
",",
"radix",
")",
")",
";",
"}"
] | Returns a {@code Byte} object holding the value
extracted from the specified {@code String} when parsed
with the radix given by the second argument. The first argument
is interpreted as representing a signed {@code byte} in
the radix specified by the second argument, exactly as if the
argument were given to the {@link ... | [
"Returns",
"a",
"{",
"@code",
"Byte",
"}",
"object",
"holding",
"the",
"value",
"extracted",
"from",
"the",
"specified",
"{",
"@code",
"String",
"}",
"when",
"parsed",
"with",
"the",
"radix",
"given",
"by",
"the",
"second",
"argument",
".",
"The",
"first",... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/lang/Byte.java#L215-L218 |
JodaOrg/joda-beans | src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java | MsgPackOutput.writePositiveExtensionInt | void writePositiveExtensionInt(int extensionType, int reference) throws IOException {
if (reference < 0) {
throw new IllegalArgumentException("Can only serialize positive references: " + reference);
}
if (reference < 0xFF) {
output.write(FIX_EXT_1);
output.wri... | java | void writePositiveExtensionInt(int extensionType, int reference) throws IOException {
if (reference < 0) {
throw new IllegalArgumentException("Can only serialize positive references: " + reference);
}
if (reference < 0xFF) {
output.write(FIX_EXT_1);
output.wri... | [
"void",
"writePositiveExtensionInt",
"(",
"int",
"extensionType",
",",
"int",
"reference",
")",
"throws",
"IOException",
"{",
"if",
"(",
"reference",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Can only serialize positive references: \"",
"... | Writes an extension reference of a positive integer using FIX_EXT data types.
@param extensionType the type
@param reference the positive integer reference to write as the data
@throws IOException if an error occurs | [
"Writes",
"an",
"extension",
"reference",
"of",
"a",
"positive",
"integer",
"using",
"FIX_EXT",
"data",
"types",
"."
] | train | https://github.com/JodaOrg/joda-beans/blob/f07dbe42947150b23a173f35984c6ab33c5529bf/src/main/java/org/joda/beans/ser/bin/MsgPackOutput.java#L310-L327 |
jenkinsci/jenkins | core/src/main/java/hudson/EnvVars.java | EnvVars.getRemote | public static EnvVars getRemote(VirtualChannel channel) throws IOException, InterruptedException {
if(channel==null)
return new EnvVars("N/A","N/A");
return channel.call(new GetEnvVars());
} | java | public static EnvVars getRemote(VirtualChannel channel) throws IOException, InterruptedException {
if(channel==null)
return new EnvVars("N/A","N/A");
return channel.call(new GetEnvVars());
} | [
"public",
"static",
"EnvVars",
"getRemote",
"(",
"VirtualChannel",
"channel",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"return",
"new",
"EnvVars",
"(",
"\"N/A\"",
",",
"\"N/A\"",
")",
";",
"return... | Obtains the environment variables of a remote peer.
@param channel
Can be null, in which case the map indicating "N/A" will be returned.
@return
A fresh copy that can be owned and modified by the caller. | [
"Obtains",
"the",
"environment",
"variables",
"of",
"a",
"remote",
"peer",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/EnvVars.java#L424-L428 |
lessthanoptimal/ejml | main/ejml-zdense/src/org/ejml/dense/row/MatrixFeatures_ZDRM.java | MatrixFeatures_ZDRM.isUpperTriangle | public static boolean isUpperTriangle(ZMatrixRMaj A , int hessenberg , double tol ) {
tol *= tol;
for( int i = hessenberg+1; i < A.numRows; i++ ) {
int maxCol = Math.min(i-hessenberg, A.numCols);
for( int j = 0; j < maxCol; j++ ) {
int index = (i*A.numCols+j)*2;
... | java | public static boolean isUpperTriangle(ZMatrixRMaj A , int hessenberg , double tol ) {
tol *= tol;
for( int i = hessenberg+1; i < A.numRows; i++ ) {
int maxCol = Math.min(i-hessenberg, A.numCols);
for( int j = 0; j < maxCol; j++ ) {
int index = (i*A.numCols+j)*2;
... | [
"public",
"static",
"boolean",
"isUpperTriangle",
"(",
"ZMatrixRMaj",
"A",
",",
"int",
"hessenberg",
",",
"double",
"tol",
")",
"{",
"tol",
"*=",
"tol",
";",
"for",
"(",
"int",
"i",
"=",
"hessenberg",
"+",
"1",
";",
"i",
"<",
"A",
".",
"numRows",
";"... | <p>
Checks to see if a matrix is upper triangular or Hessenberg. A Hessenberg matrix of degree N
has the following property:<br>
<br>
a<sub>ij</sub> ≤ 0 for all i < j+N<br>
<br>
A triangular matrix is a Hessenberg matrix of degree 0.
</p>
@param A Matrix being tested. Not modified.
@param hessenberg The degree o... | [
"<p",
">",
"Checks",
"to",
"see",
"if",
"a",
"matrix",
"is",
"upper",
"triangular",
"or",
"Hessenberg",
".",
"A",
"Hessenberg",
"matrix",
"of",
"degree",
"N",
"has",
"the",
"following",
"property",
":",
"<br",
">",
"<br",
">",
"a<sub",
">",
"ij<",
"/",... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-zdense/src/org/ejml/dense/row/MatrixFeatures_ZDRM.java#L366-L383 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java | Ftp.upload | public boolean upload(String path, String fileName, File file) {
try (InputStream in = FileUtil.getInputStream(file)) {
return upload(path, fileName, in);
} catch (IOException e) {
throw new FtpException(e);
}
} | java | public boolean upload(String path, String fileName, File file) {
try (InputStream in = FileUtil.getInputStream(file)) {
return upload(path, fileName, in);
} catch (IOException e) {
throw new FtpException(e);
}
} | [
"public",
"boolean",
"upload",
"(",
"String",
"path",
",",
"String",
"fileName",
",",
"File",
"file",
")",
"{",
"try",
"(",
"InputStream",
"in",
"=",
"FileUtil",
".",
"getInputStream",
"(",
"file",
")",
")",
"{",
"return",
"upload",
"(",
"path",
",",
"... | 上传文件到指定目录,可选:
<pre>
1. path为null或""上传到当前路径
2. path为相对路径则相对于当前路径的子路径
3. path为绝对路径则上传到此路径
</pre>
@param file 文件
@param path 服务端路径,可以为{@code null} 或者相对路径或绝对路径
@param fileName 自定义在服务端保存的文件名
@return 是否上传成功 | [
"上传文件到指定目录,可选:"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/ftp/Ftp.java#L382-L388 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.setPerspectiveRect | public Matrix4d setPerspectiveRect(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
this.zero();
this._m00((zNear + zNear) / width);
this._m11((zNear + zNear) / height);
boolean farInf = zFar > 0 && Double.isInfinite(zFar);
boolean nearInf = zNear > 0... | java | public Matrix4d setPerspectiveRect(double width, double height, double zNear, double zFar, boolean zZeroToOne) {
this.zero();
this._m00((zNear + zNear) / width);
this._m11((zNear + zNear) / height);
boolean farInf = zFar > 0 && Double.isInfinite(zFar);
boolean nearInf = zNear > 0... | [
"public",
"Matrix4d",
"setPerspectiveRect",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"boolean",
"zZeroToOne",
")",
"{",
"this",
".",
"zero",
"(",
")",
";",
"this",
".",
"_m00",
"(",
"(",
"zNear"... | Set this matrix to be a symmetric perspective projection frustum transformation for a right-handed coordinate system
using the given NDC z range.
<p>
In order to apply the perspective projection transformation to an existing transformation,
use {@link #perspectiveRect(double, double, double, double, boolean) perspectiv... | [
"Set",
"this",
"matrix",
"to",
"be",
"a",
"symmetric",
"perspective",
"projection",
"frustum",
"transformation",
"for",
"a",
"right",
"-",
"handed",
"coordinate",
"system",
"using",
"the",
"given",
"NDC",
"z",
"range",
".",
"<p",
">",
"In",
"order",
"to",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L12656-L12678 |
epam/parso | src/main/java/com/epam/parso/impl/AbstractCSVWriter.java | AbstractCSVWriter.checkSurroundByQuotesAndWrite | static void checkSurroundByQuotesAndWrite(Writer writer, String delimiter, String trimmedText) throws IOException {
writer.write(checkSurroundByQuotes(delimiter, trimmedText));
} | java | static void checkSurroundByQuotesAndWrite(Writer writer, String delimiter, String trimmedText) throws IOException {
writer.write(checkSurroundByQuotes(delimiter, trimmedText));
} | [
"static",
"void",
"checkSurroundByQuotesAndWrite",
"(",
"Writer",
"writer",
",",
"String",
"delimiter",
",",
"String",
"trimmedText",
")",
"throws",
"IOException",
"{",
"writer",
".",
"write",
"(",
"checkSurroundByQuotes",
"(",
"delimiter",
",",
"trimmedText",
")",
... | The method to write a text represented by an array of bytes using writer.
If the text contains the delimiter, line breaks, tabulation characters, and double quotes, the text is stropped.
@param writer the variable to output data.
@param delimiter if trimmedText contains this delimiter it will be stropped.
@para... | [
"The",
"method",
"to",
"write",
"a",
"text",
"represented",
"by",
"an",
"array",
"of",
"bytes",
"using",
"writer",
".",
"If",
"the",
"text",
"contains",
"the",
"delimiter",
"line",
"breaks",
"tabulation",
"characters",
"and",
"double",
"quotes",
"the",
"text... | train | https://github.com/epam/parso/blob/fb132cf943ba099a35b2f5a1490c0a59641e09dc/src/main/java/com/epam/parso/impl/AbstractCSVWriter.java#L120-L122 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/ling/WordLemmaTagFactory.java | WordLemmaTagFactory.newLabelFromString | public Label newLabelFromString(String labelStr) {
int first = labelStr.indexOf(divider);
int second = labelStr.lastIndexOf(divider);
if (first == second) {
return new WordLemmaTag(labelStr.substring(0, first), Morphology.stemStatic(labelStr.substring(0, first), labelStr.substring(first + 1)).word... | java | public Label newLabelFromString(String labelStr) {
int first = labelStr.indexOf(divider);
int second = labelStr.lastIndexOf(divider);
if (first == second) {
return new WordLemmaTag(labelStr.substring(0, first), Morphology.stemStatic(labelStr.substring(0, first), labelStr.substring(first + 1)).word... | [
"public",
"Label",
"newLabelFromString",
"(",
"String",
"labelStr",
")",
"{",
"int",
"first",
"=",
"labelStr",
".",
"indexOf",
"(",
"divider",
")",
";",
"int",
"second",
"=",
"labelStr",
".",
"lastIndexOf",
"(",
"divider",
")",
";",
"if",
"(",
"first",
"... | Create a new word, where the label is formed from
the <code>String</code> passed in. The String is divided according
to the divider character. We assume that we can always just
divide on the rightmost divider character, rather than trying to
parse up escape sequences. If the divider character isn't found
in the word... | [
"Create",
"a",
"new",
"word",
"where",
"the",
"label",
"is",
"formed",
"from",
"the",
"<code",
">",
"String<",
"/",
"code",
">",
"passed",
"in",
".",
"The",
"String",
"is",
"divided",
"according",
"to",
"the",
"divider",
"character",
".",
"We",
"assume",... | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/ling/WordLemmaTagFactory.java#L87-L97 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java | GridDialects.getDialectFacetOrNull | static <T extends GridDialect> T getDialectFacetOrNull(GridDialect gridDialect, Class<T> facetType) {
if ( hasFacet( gridDialect, facetType ) ) {
@SuppressWarnings("unchecked")
T asFacet = (T) gridDialect;
return asFacet;
}
return null;
} | java | static <T extends GridDialect> T getDialectFacetOrNull(GridDialect gridDialect, Class<T> facetType) {
if ( hasFacet( gridDialect, facetType ) ) {
@SuppressWarnings("unchecked")
T asFacet = (T) gridDialect;
return asFacet;
}
return null;
} | [
"static",
"<",
"T",
"extends",
"GridDialect",
">",
"T",
"getDialectFacetOrNull",
"(",
"GridDialect",
"gridDialect",
",",
"Class",
"<",
"T",
">",
"facetType",
")",
"{",
"if",
"(",
"hasFacet",
"(",
"gridDialect",
",",
"facetType",
")",
")",
"{",
"@",
"Suppre... | Returns the given dialect, narrowed down to the given dialect facet in case it is implemented by the dialect.
@param gridDialect the dialect of interest
@param facetType the dialect facet type of interest
@return the given dialect, narrowed down to the given dialect facet or {@code null} in case the given dialect
does... | [
"Returns",
"the",
"given",
"dialect",
"narrowed",
"down",
"to",
"the",
"given",
"dialect",
"facet",
"in",
"case",
"it",
"is",
"implemented",
"by",
"the",
"dialect",
"."
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java#L37-L45 |
groovy/groovy-core | src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java | IOGroovyMethods.leftShift | public static OutputStream leftShift(OutputStream self, InputStream in) throws IOException {
byte[] buf = new byte[1024];
while (true) {
int count = in.read(buf, 0, buf.length);
if (count == -1) break;
if (count == 0) {
Thread.yield();
... | java | public static OutputStream leftShift(OutputStream self, InputStream in) throws IOException {
byte[] buf = new byte[1024];
while (true) {
int count = in.read(buf, 0, buf.length);
if (count == -1) break;
if (count == 0) {
Thread.yield();
... | [
"public",
"static",
"OutputStream",
"leftShift",
"(",
"OutputStream",
"self",
",",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buf",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"while",
"(",
"true",
")",
"{",
"int",
"count",... | Pipe an InputStream into an OutputStream for efficient stream copying.
@param self stream on which to write
@param in stream to read from
@return the outputstream itself
@throws IOException if an I/O error occurs.
@since 1.0 | [
"Pipe",
"an",
"InputStream",
"into",
"an",
"OutputStream",
"for",
"efficient",
"stream",
"copying",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/org/codehaus/groovy/runtime/IOGroovyMethods.java#L231-L244 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/engine/Codecs.java | Codecs.ofSubSet | public static <T> Codec<ISeq<T>, BitGene> ofSubSet(
final ISeq<? extends T> basicSet
) {
requireNonNull(basicSet);
require.positive(basicSet.length());
return Codec.of(
Genotype.of(BitChromosome.of(basicSet.length())),
gt -> gt.getChromosome()
.as(BitChromosome.class).ones()
.<T>mapToObj(basicSe... | java | public static <T> Codec<ISeq<T>, BitGene> ofSubSet(
final ISeq<? extends T> basicSet
) {
requireNonNull(basicSet);
require.positive(basicSet.length());
return Codec.of(
Genotype.of(BitChromosome.of(basicSet.length())),
gt -> gt.getChromosome()
.as(BitChromosome.class).ones()
.<T>mapToObj(basicSe... | [
"public",
"static",
"<",
"T",
">",
"Codec",
"<",
"ISeq",
"<",
"T",
">",
",",
"BitGene",
">",
"ofSubSet",
"(",
"final",
"ISeq",
"<",
"?",
"extends",
"T",
">",
"basicSet",
")",
"{",
"requireNonNull",
"(",
"basicSet",
")",
";",
"require",
".",
"positive... | The subset {@code Codec} can be used for problems where it is required to
find the best <b>variable-sized</b> subset from given basic set. A typical
usage example of the returned {@code Codec} is the Knapsack problem.
<p>
The following code snippet shows a simplified variation of the Knapsack
problem.
<pre>{@code
publi... | [
"The",
"subset",
"{",
"@code",
"Codec",
"}",
"can",
"be",
"used",
"for",
"problems",
"where",
"it",
"is",
"required",
"to",
"find",
"the",
"best",
"<b",
">",
"variable",
"-",
"sized<",
"/",
"b",
">",
"subset",
"from",
"given",
"basic",
"set",
".",
"A... | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/engine/Codecs.java#L770-L783 |
netheosgithub/pcs_api | java/src/main/java/net/netheos/pcsapi/models/CUploadRequest.java | CUploadRequest.getByteSource | public ByteSource getByteSource()
{
ByteSource bs = byteSource;
if ( progressListener != null ) {
bs = new ProgressByteSource( bs, progressListener );
}
return bs;
} | java | public ByteSource getByteSource()
{
ByteSource bs = byteSource;
if ( progressListener != null ) {
bs = new ProgressByteSource( bs, progressListener );
}
return bs;
} | [
"public",
"ByteSource",
"getByteSource",
"(",
")",
"{",
"ByteSource",
"bs",
"=",
"byteSource",
";",
"if",
"(",
"progressListener",
"!=",
"null",
")",
"{",
"bs",
"=",
"new",
"ProgressByteSource",
"(",
"bs",
",",
"progressListener",
")",
";",
"}",
"return",
... | If no progress listener has been set, return the byte source set in constructor, otherwise decorate it for
progress.
@return the byte source to be used for upload operation. | [
"If",
"no",
"progress",
"listener",
"has",
"been",
"set",
"return",
"the",
"byte",
"source",
"set",
"in",
"constructor",
"otherwise",
"decorate",
"it",
"for",
"progress",
"."
] | train | https://github.com/netheosgithub/pcs_api/blob/20691e52e144014f99ca75cb7dedc7ba0c18586c/java/src/main/java/net/netheos/pcsapi/models/CUploadRequest.java#L114-L121 |
jenkinsci/jenkins | core/src/main/java/hudson/tools/ToolLocationNodeProperty.java | ToolLocationNodeProperty.getToolHome | @Deprecated
public static String getToolHome(Node node, ToolInstallation installation, TaskListener log) throws IOException, InterruptedException {
String result = null;
// node-specific configuration takes precedence
ToolLocationNodeProperty property = node.getNodeProperties().get(ToolLoca... | java | @Deprecated
public static String getToolHome(Node node, ToolInstallation installation, TaskListener log) throws IOException, InterruptedException {
String result = null;
// node-specific configuration takes precedence
ToolLocationNodeProperty property = node.getNodeProperties().get(ToolLoca... | [
"@",
"Deprecated",
"public",
"static",
"String",
"getToolHome",
"(",
"Node",
"node",
",",
"ToolInstallation",
"installation",
",",
"TaskListener",
"log",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"String",
"result",
"=",
"null",
";",
"// node... | Checks if the location of the tool is overridden for the given node, and if so,
return the node-specific home directory. Otherwise return {@code installation.getHome()}
<p>
This is the core logic behind {@link NodeSpecific#forNode(Node, TaskListener)} for {@link ToolInstallation}.
@return
never null.
@deprecated sinc... | [
"Checks",
"if",
"the",
"location",
"of",
"the",
"tool",
"is",
"overridden",
"for",
"the",
"given",
"node",
"and",
"if",
"so",
"return",
"the",
"node",
"-",
"specific",
"home",
"directory",
".",
"Otherwise",
"return",
"{",
"@code",
"installation",
".",
"get... | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/tools/ToolLocationNodeProperty.java#L94-L117 |
JOML-CI/JOML | src/org/joml/Matrix4f.java | Matrix4f.rotationZYX | public Matrix4f rotationZYX(float angleZ, float angleY, float angleX) {
float sinX = (float) Math.sin(angleX);
float cosX = (float) Math.cosFromSin(sinX, angleX);
float sinY = (float) Math.sin(angleY);
float cosY = (float) Math.cosFromSin(sinY, angleY);
float sinZ = (float) Math.... | java | public Matrix4f rotationZYX(float angleZ, float angleY, float angleX) {
float sinX = (float) Math.sin(angleX);
float cosX = (float) Math.cosFromSin(sinX, angleX);
float sinY = (float) Math.sin(angleY);
float cosY = (float) Math.cosFromSin(sinY, angleY);
float sinZ = (float) Math.... | [
"public",
"Matrix4f",
"rotationZYX",
"(",
"float",
"angleZ",
",",
"float",
"angleY",
",",
"float",
"angleX",
")",
"{",
"float",
"sinX",
"=",
"(",
"float",
")",
"Math",
".",
"sin",
"(",
"angleX",
")",
";",
"float",
"cosX",
"=",
"(",
"float",
")",
"Mat... | Set this matrix to a rotation of <code>angleZ</code> radians about the Z axis, followed by a rotation
of <code>angleY</code> radians about the Y axis and followed by a rotation of <code>angleX</code> radians about the X axis.
<p>
When used with a right-handed coordinate system, the produced rotation will rotate a vecto... | [
"Set",
"this",
"matrix",
"to",
"a",
"rotation",
"of",
"<code",
">",
"angleZ<",
"/",
"code",
">",
"radians",
"about",
"the",
"Z",
"axis",
"followed",
"by",
"a",
"rotation",
"of",
"<code",
">",
"angleY<",
"/",
"code",
">",
"radians",
"about",
"the",
"Y",... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4f.java#L3664-L3704 |
xm-online/xm-commons | xm-commons-tenant/src/main/java/com/icthh/xm/commons/tenant/TenantContextUtils.java | TenantContextUtils.setTenant | public static void setTenant(TenantContextHolder holder, String tenantKeyValue) {
holder.getPrivilegedContext().setTenant(buildTenant(tenantKeyValue));
} | java | public static void setTenant(TenantContextHolder holder, String tenantKeyValue) {
holder.getPrivilegedContext().setTenant(buildTenant(tenantKeyValue));
} | [
"public",
"static",
"void",
"setTenant",
"(",
"TenantContextHolder",
"holder",
",",
"String",
"tenantKeyValue",
")",
"{",
"holder",
".",
"getPrivilegedContext",
"(",
")",
".",
"setTenant",
"(",
"buildTenant",
"(",
"tenantKeyValue",
")",
")",
";",
"}"
] | Sets current thread tenant.
@param holder tenant contexts holder
@param tenantKeyValue tenant key value | [
"Sets",
"current",
"thread",
"tenant",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-tenant/src/main/java/com/icthh/xm/commons/tenant/TenantContextUtils.java#L67-L69 |
Netflix/ribbon | ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java | ClientFactory.getNamedLoadBalancer | public static synchronized ILoadBalancer getNamedLoadBalancer(String name, Class<? extends IClientConfig> configClass) {
ILoadBalancer lb = namedLBMap.get(name);
if (lb != null) {
return lb;
} else {
try {
lb = registerNamedLoadBalancerFromProperties(name,... | java | public static synchronized ILoadBalancer getNamedLoadBalancer(String name, Class<? extends IClientConfig> configClass) {
ILoadBalancer lb = namedLBMap.get(name);
if (lb != null) {
return lb;
} else {
try {
lb = registerNamedLoadBalancerFromProperties(name,... | [
"public",
"static",
"synchronized",
"ILoadBalancer",
"getNamedLoadBalancer",
"(",
"String",
"name",
",",
"Class",
"<",
"?",
"extends",
"IClientConfig",
">",
"configClass",
")",
"{",
"ILoadBalancer",
"lb",
"=",
"namedLBMap",
".",
"get",
"(",
"name",
")",
";",
"... | Get the load balancer associated with the name, or create one with an instance of configClass if does not exist
@throws RuntimeException if any error occurs
@see #registerNamedLoadBalancerFromProperties(String, Class) | [
"Get",
"the",
"load",
"balancer",
"associated",
"with",
"the",
"name",
"or",
"create",
"one",
"with",
"an",
"instance",
"of",
"configClass",
"if",
"does",
"not",
"exist"
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-loadbalancer/src/main/java/com/netflix/client/ClientFactory.java#L158-L170 |
liferay/com-liferay-commerce | commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPSpecificationOptionWrapper.java | CPSpecificationOptionWrapper.getDescription | @Override
public String getDescription(String languageId, boolean useDefault) {
return _cpSpecificationOption.getDescription(languageId, useDefault);
} | java | @Override
public String getDescription(String languageId, boolean useDefault) {
return _cpSpecificationOption.getDescription(languageId, useDefault);
} | [
"@",
"Override",
"public",
"String",
"getDescription",
"(",
"String",
"languageId",
",",
"boolean",
"useDefault",
")",
"{",
"return",
"_cpSpecificationOption",
".",
"getDescription",
"(",
"languageId",
",",
"useDefault",
")",
";",
"}"
] | Returns the localized description of this cp specification option in the language, optionally using the default language if no localization exists for the requested language.
@param languageId the ID of the language
@param useDefault whether to use the default language if no localization exists for the requested langu... | [
"Returns",
"the",
"localized",
"description",
"of",
"this",
"cp",
"specification",
"option",
"in",
"the",
"language",
"optionally",
"using",
"the",
"default",
"language",
"if",
"no",
"localization",
"exists",
"for",
"the",
"requested",
"language",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/model/CPSpecificationOptionWrapper.java#L287-L290 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_network_private_networkId_DELETE | public void project_serviceName_network_private_networkId_DELETE(String serviceName, String networkId) throws IOException {
String qPath = "/cloud/project/{serviceName}/network/private/{networkId}";
StringBuilder sb = path(qPath, serviceName, networkId);
exec(qPath, "DELETE", sb.toString(), null);
} | java | public void project_serviceName_network_private_networkId_DELETE(String serviceName, String networkId) throws IOException {
String qPath = "/cloud/project/{serviceName}/network/private/{networkId}";
StringBuilder sb = path(qPath, serviceName, networkId);
exec(qPath, "DELETE", sb.toString(), null);
} | [
"public",
"void",
"project_serviceName_network_private_networkId_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"networkId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/network/private/{networkId}\"",
";",
"StringBuilder",
"... | Delete private network
REST: DELETE /cloud/project/{serviceName}/network/private/{networkId}
@param networkId [required] Network id
@param serviceName [required] Project name | [
"Delete",
"private",
"network"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L768-L772 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.redeployAsync | public Observable<OperationStatusResponseInner> redeployAsync(String resourceGroupName, String vmScaleSetName) {
return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
... | java | public Observable<OperationStatusResponseInner> redeployAsync(String resourceGroupName, String vmScaleSetName) {
return redeployWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"redeployAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"redeployWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"map"... | Redeploy one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Redeploy",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachineScaleSetsInner.java#L2889-L2896 |
TheHortonMachine/hortonmachine | gears/src/main/java/oms3/util/Stats.java | Stats.nashsut | public static double nashsut(double[] prediction, double[] validation, double pow) {
int pre_size = prediction.length;
int val_size = validation.length;
int steps = 0;
double sum_td = 0;
double sum_vd = 0;
/** checking if both data arrays have the same number of elemen... | java | public static double nashsut(double[] prediction, double[] validation, double pow) {
int pre_size = prediction.length;
int val_size = validation.length;
int steps = 0;
double sum_td = 0;
double sum_vd = 0;
/** checking if both data arrays have the same number of elemen... | [
"public",
"static",
"double",
"nashsut",
"(",
"double",
"[",
"]",
"prediction",
",",
"double",
"[",
"]",
"validation",
",",
"double",
"pow",
")",
"{",
"int",
"pre_size",
"=",
"prediction",
".",
"length",
";",
"int",
"val_size",
"=",
"validation",
".",
"l... | Calculates the efficiency between a test data set and a verification data set
after Nash & Sutcliffe (1970). The efficiency is described as the proportion of
the cumulated cubic deviation between both data sets and the cumulated cubic
deviation between the verification data set and its mean value.
@param prediction the... | [
"Calculates",
"the",
"efficiency",
"between",
"a",
"test",
"data",
"set",
"and",
"a",
"verification",
"data",
"set",
"after",
"Nash",
"&",
"Sutcliffe",
"(",
"1970",
")",
".",
"The",
"efficiency",
"is",
"described",
"as",
"the",
"proportion",
"of",
"the",
"... | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/util/Stats.java#L186-L223 |
actframework/actframework | src/main/java/act/data/ApacheMultipartParser.java | ApacheMultipartParser.parseHeaderLine | private void parseHeaderLine(Map<String, String> headers, String header) {
final int colonOffset = header.indexOf(':');
if (colonOffset == -1) {
// This header line is malformed, skip it.
return;
}
String headerName = header.substring(0, colonOffset).trim().toLowe... | java | private void parseHeaderLine(Map<String, String> headers, String header) {
final int colonOffset = header.indexOf(':');
if (colonOffset == -1) {
// This header line is malformed, skip it.
return;
}
String headerName = header.substring(0, colonOffset).trim().toLowe... | [
"private",
"void",
"parseHeaderLine",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"String",
"header",
")",
"{",
"final",
"int",
"colonOffset",
"=",
"header",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"if",
"(",
"colonOffset",
"==",
"-... | Reads the next header line.
@param headers String with all headers.
@param header Map where to store the current header. | [
"Reads",
"the",
"next",
"header",
"line",
"."
] | train | https://github.com/actframework/actframework/blob/55a8f8b45e71159a79ec6e157c02f71700f8cd54/src/main/java/act/data/ApacheMultipartParser.java#L296-L311 |
haraldk/TwelveMonkeys | common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java | CollectionUtil.mergeArrays | @SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object mergeArrays(Object pArray1, int pOffset1, int pLength1, Object pArray2, int pOffset2, int pLength2) {
Class class1 = pArray1.getClass();
Class type = class1.getComponentType();
// Create new array of the new length
... | java | @SuppressWarnings({"SuspiciousSystemArraycopy"})
public static Object mergeArrays(Object pArray1, int pOffset1, int pLength1, Object pArray2, int pOffset2, int pLength2) {
Class class1 = pArray1.getClass();
Class type = class1.getComponentType();
// Create new array of the new length
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"SuspiciousSystemArraycopy\"",
"}",
")",
"public",
"static",
"Object",
"mergeArrays",
"(",
"Object",
"pArray1",
",",
"int",
"pOffset1",
",",
"int",
"pLength1",
",",
"Object",
"pArray2",
",",
"int",
"pOffset2",
",",
"int",
"... | Merges two arrays into a new array. Elements from pArray1 and pArray2 will
be copied into a new array, that has pLength1 + pLength2 elements.
@param pArray1 First array
@param pOffset1 the offset into the first array
@param pLength1 the number of elements to copy from the first array
@param pArray2 Second array, mus... | [
"Merges",
"two",
"arrays",
"into",
"a",
"new",
"array",
".",
"Elements",
"from",
"pArray1",
"and",
"pArray2",
"will",
"be",
"copied",
"into",
"a",
"new",
"array",
"that",
"has",
"pLength1",
"+",
"pLength2",
"elements",
"."
] | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/common/common-lang/src/main/java/com/twelvemonkeys/util/CollectionUtil.java#L246-L257 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java | AbstractJavaCCMojo.findSourceFile | private File findSourceFile (final String filename)
{
final Collection <File> sourceRoots = this.nonGeneratedSourceRoots;
for (final File sourceRoot : sourceRoots)
{
final File sourceFile = new File (sourceRoot, filename);
if (sourceFile.exists ())
{
return sourceFile;
}
... | java | private File findSourceFile (final String filename)
{
final Collection <File> sourceRoots = this.nonGeneratedSourceRoots;
for (final File sourceRoot : sourceRoots)
{
final File sourceFile = new File (sourceRoot, filename);
if (sourceFile.exists ())
{
return sourceFile;
}
... | [
"private",
"File",
"findSourceFile",
"(",
"final",
"String",
"filename",
")",
"{",
"final",
"Collection",
"<",
"File",
">",
"sourceRoots",
"=",
"this",
".",
"nonGeneratedSourceRoots",
";",
"for",
"(",
"final",
"File",
"sourceRoot",
":",
"sourceRoots",
")",
"{"... | Determines whether the specified source file is already present in any of the
compile source roots registered with the current Maven project.
@param filename
The source filename to check, relative to a source root, must not be
<code>null</code>.
@return The (absolute) path to the existing source file if any,
<code>nul... | [
"Determines",
"whether",
"the",
"specified",
"source",
"file",
"is",
"already",
"present",
"in",
"any",
"of",
"the",
"compile",
"source",
"roots",
"registered",
"with",
"the",
"current",
"Maven",
"project",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/AbstractJavaCCMojo.java#L693-L705 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java | PropertiesConfigHelper.getCustomBundleBooleanProperty | public boolean getCustomBundleBooleanProperty(String bundleName, String key) {
return Boolean.parseBoolean(props.getProperty(
prefix + PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_PROPERTY + bundleName + key, "false"));
} | java | public boolean getCustomBundleBooleanProperty(String bundleName, String key) {
return Boolean.parseBoolean(props.getProperty(
prefix + PropertiesBundleConstant.BUNDLE_FACTORY_CUSTOM_PROPERTY + bundleName + key, "false"));
} | [
"public",
"boolean",
"getCustomBundleBooleanProperty",
"(",
"String",
"bundleName",
",",
"String",
"key",
")",
"{",
"return",
"Boolean",
".",
"parseBoolean",
"(",
"props",
".",
"getProperty",
"(",
"prefix",
"+",
"PropertiesBundleConstant",
".",
"BUNDLE_FACTORY_CUSTOM_... | Returns the value of the custom bundle boolean property, or <b>false</b>
if no value is defined
@param bundleName
the bundle name
@param key
the key of the property
@return the value of the custom bundle property | [
"Returns",
"the",
"value",
"of",
"the",
"custom",
"bundle",
"boolean",
"property",
"or",
"<b",
">",
"false<",
"/",
"b",
">",
"if",
"no",
"value",
"is",
"defined"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/util/PropertiesConfigHelper.java#L167-L170 |
alkacon/opencms-core | src/org/opencms/workplace/editors/CmsXmlContentEditor.java | CmsXmlContentEditor.actionCopyElementLocale | public void actionCopyElementLocale() throws JspException {
try {
setEditorValues(getElementLocale());
if (!hasValidationErrors()) {
// save content of the editor only to the temporary file
writeContent();
CmsObject cloneCms = getCloneCms(... | java | public void actionCopyElementLocale() throws JspException {
try {
setEditorValues(getElementLocale());
if (!hasValidationErrors()) {
// save content of the editor only to the temporary file
writeContent();
CmsObject cloneCms = getCloneCms(... | [
"public",
"void",
"actionCopyElementLocale",
"(",
")",
"throws",
"JspException",
"{",
"try",
"{",
"setEditorValues",
"(",
"getElementLocale",
"(",
")",
")",
";",
"if",
"(",
"!",
"hasValidationErrors",
"(",
")",
")",
"{",
"// save content of the editor only to the te... | Performs the copy locale action.<p>
@throws JspException if something goes wrong | [
"Performs",
"the",
"copy",
"locale",
"action",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/editors/CmsXmlContentEditor.java#L334-L352 |
javamelody/javamelody | javamelody-core/src/main/java/net/bull/javamelody/internal/web/html/HtmlAbstractReport.java | HtmlAbstractReport.getFormattedString | static String getFormattedString(String key, Object... arguments) {
return I18N.getFormattedString(key, arguments);
} | java | static String getFormattedString(String key, Object... arguments) {
return I18N.getFormattedString(key, arguments);
} | [
"static",
"String",
"getFormattedString",
"(",
"String",
"key",
",",
"Object",
"...",
"arguments",
")",
"{",
"return",
"I18N",
".",
"getFormattedString",
"(",
"key",
",",
"arguments",
")",
";",
"}"
] | Retourne une traduction dans la locale courante et insère les arguments aux positions {i}.
@param key clé d'un libellé dans les fichiers de traduction
@param arguments Valeur à inclure dans le résultat
@return String | [
"Retourne",
"une",
"traduction",
"dans",
"la",
"locale",
"courante",
"et",
"insère",
"les",
"arguments",
"aux",
"positions",
"{",
"i",
"}",
"."
] | train | https://github.com/javamelody/javamelody/blob/18ad583ddeb5dcadd797dfda295409c6983ffd71/javamelody-core/src/main/java/net/bull/javamelody/internal/web/html/HtmlAbstractReport.java#L159-L161 |
alkacon/opencms-core | src/org/opencms/xml/CmsXmlContentDefinition.java | CmsXmlContentDefinition.createDocument | public Document createDocument(CmsObject cms, I_CmsXmlDocument document, Locale locale) {
Document doc = DocumentHelper.createDocument();
Element root = doc.addElement(getOuterName());
root.add(I_CmsXmlSchemaType.XSI_NAMESPACE);
root.addAttribute(I_CmsXmlSchemaType.XSI_NAMESPACE_ATTRI... | java | public Document createDocument(CmsObject cms, I_CmsXmlDocument document, Locale locale) {
Document doc = DocumentHelper.createDocument();
Element root = doc.addElement(getOuterName());
root.add(I_CmsXmlSchemaType.XSI_NAMESPACE);
root.addAttribute(I_CmsXmlSchemaType.XSI_NAMESPACE_ATTRI... | [
"public",
"Document",
"createDocument",
"(",
"CmsObject",
"cms",
",",
"I_CmsXmlDocument",
"document",
",",
"Locale",
"locale",
")",
"{",
"Document",
"doc",
"=",
"DocumentHelper",
".",
"createDocument",
"(",
")",
";",
"Element",
"root",
"=",
"doc",
".",
"addEle... | Generates a valid XML document according to the XML schema of this content definition.<p>
@param cms the current users OpenCms context
@param document the OpenCms XML document the XML is created for
@param locale the locale to create the default element in the document with
@return a valid XML document according to t... | [
"Generates",
"a",
"valid",
"XML",
"document",
"according",
"to",
"the",
"XML",
"schema",
"of",
"this",
"content",
"definition",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/CmsXmlContentDefinition.java#L1215-L1226 |
xcesco/kripton | kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java | DynamicByteBufferHelper._idx | public static void _idx(final byte[] array, int startIndex, byte[] input) {
try {
System.arraycopy(input, 0, array, startIndex, input.length);
} catch (Exception ex) {
throw new KriptonRuntimeException(String.format("array size %d, startIndex %d, input length %d", array.length, startIndex, input.length), ex)... | java | public static void _idx(final byte[] array, int startIndex, byte[] input) {
try {
System.arraycopy(input, 0, array, startIndex, input.length);
} catch (Exception ex) {
throw new KriptonRuntimeException(String.format("array size %d, startIndex %d, input length %d", array.length, startIndex, input.length), ex)... | [
"public",
"static",
"void",
"_idx",
"(",
"final",
"byte",
"[",
"]",
"array",
",",
"int",
"startIndex",
",",
"byte",
"[",
"]",
"input",
")",
"{",
"try",
"{",
"System",
".",
"arraycopy",
"(",
"input",
",",
"0",
",",
"array",
",",
"startIndex",
",",
"... | Idx.
@param array the array
@param startIndex the start index
@param input the input | [
"Idx",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-core/src/main/java/com/abubusoft/kripton/common/DynamicByteBufferHelper.java#L1061-L1068 |
landawn/AbacusUtil | src/com/landawn/abacus/util/StringUtil.java | StringUtil.ordinalIndexOf | public static int ordinalIndexOf(final String str, final String substr, final int ordinal) {
return ordinalIndexOf(str, substr, ordinal, false);
} | java | public static int ordinalIndexOf(final String str, final String substr, final int ordinal) {
return ordinalIndexOf(str, substr, ordinal, false);
} | [
"public",
"static",
"int",
"ordinalIndexOf",
"(",
"final",
"String",
"str",
",",
"final",
"String",
"substr",
",",
"final",
"int",
"ordinal",
")",
"{",
"return",
"ordinalIndexOf",
"(",
"str",
",",
"substr",
",",
"ordinal",
",",
"false",
")",
";",
"}"
] | <p>
Finds the n-th index within a String, handling {@code null}.
</p>
@param str
@param substr
@param ordinal
the n-th {@code searchStr} to find
@return the n-th index of the search String, {@code -1} (
{@code N.INDEX_NOT_FOUND}) if no match or {@code null} or empty
string input | [
"<p",
">",
"Finds",
"the",
"n",
"-",
"th",
"index",
"within",
"a",
"String",
"handling",
"{",
"@code",
"null",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/StringUtil.java#L3609-L3611 |
Pixplicity/EasyPrefs | library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java | Prefs.putOrderedStringSet | @SuppressWarnings("WeakerAccess")
public static void putOrderedStringSet(String key, Set<String> value) {
final Editor editor = getPreferences().edit();
int stringSetLength = 0;
if (mPrefs.contains(key + LENGTH)) {
// First read what the value was
stringSetLength = mP... | java | @SuppressWarnings("WeakerAccess")
public static void putOrderedStringSet(String key, Set<String> value) {
final Editor editor = getPreferences().edit();
int stringSetLength = 0;
if (mPrefs.contains(key + LENGTH)) {
// First read what the value was
stringSetLength = mP... | [
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"public",
"static",
"void",
"putOrderedStringSet",
"(",
"String",
"key",
",",
"Set",
"<",
"String",
">",
"value",
")",
"{",
"final",
"Editor",
"editor",
"=",
"getPreferences",
"(",
")",
".",
"edit",
"(",... | Stores a Set of Strings, preserving the order.
Note that this method is heavier that the native implementation {@link #putStringSet(String,
Set)} (which does not reliably preserve the order of the Set). To preserve the order of the
items in the Set, the Set implementation must be one that as an iterator with predictabl... | [
"Stores",
"a",
"Set",
"of",
"Strings",
"preserving",
"the",
"order",
".",
"Note",
"that",
"this",
"method",
"is",
"heavier",
"that",
"the",
"native",
"implementation",
"{",
"@link",
"#putStringSet",
"(",
"String",
"Set",
")",
"}",
"(",
"which",
"does",
"no... | train | https://github.com/Pixplicity/EasyPrefs/blob/0ca13a403bf099019a13d68b38edcf55fca5a653/library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java#L385-L404 |
apereo/cas | support/cas-server-support-gauth-couchdb/src/main/java/org/apereo/cas/couchdb/gauth/token/GoogleAuthenticatorTokenCouchDbRepository.java | GoogleAuthenticatorTokenCouchDbRepository.findOneByUidForOtp | @View(name = "by_uid_otp", map = "function(doc) { if(doc.token && doc.userId) { emit([doc.userId, doc.token], doc) } }")
public CouchDbGoogleAuthenticatorToken findOneByUidForOtp(final String uid, final Integer otp) {
val view = createQuery("by_uid_otp").key(ComplexKey.of(uid, otp)).limit(1);
return... | java | @View(name = "by_uid_otp", map = "function(doc) { if(doc.token && doc.userId) { emit([doc.userId, doc.token], doc) } }")
public CouchDbGoogleAuthenticatorToken findOneByUidForOtp(final String uid, final Integer otp) {
val view = createQuery("by_uid_otp").key(ComplexKey.of(uid, otp)).limit(1);
return... | [
"@",
"View",
"(",
"name",
"=",
"\"by_uid_otp\"",
",",
"map",
"=",
"\"function(doc) { if(doc.token && doc.userId) { emit([doc.userId, doc.token], doc) } }\"",
")",
"public",
"CouchDbGoogleAuthenticatorToken",
"findOneByUidForOtp",
"(",
"final",
"String",
"uid",
",",
"final",
"... | Find first by uid, otp pair.
@param uid uid to search
@param otp otp to search
@return token for uid, otp pair | [
"Find",
"first",
"by",
"uid",
"otp",
"pair",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-gauth-couchdb/src/main/java/org/apereo/cas/couchdb/gauth/token/GoogleAuthenticatorTokenCouchDbRepository.java#L33-L37 |
renepickhardt/metalcon | graphityServer/src/main/java/de/metalcon/server/tomcat/NSSP/create/CreateRequest.java | CreateRequest.checkRequest | public static CreateRequest checkRequest(final HttpServletRequest request,
final DiskFileItemFactory factory,
final CreateResponse createResponse) throws FileUploadException {
final FormItemList formItemList = FormItemList.extractFormItems(
request, factory);
return checkRequest(formItemList, createRespon... | java | public static CreateRequest checkRequest(final HttpServletRequest request,
final DiskFileItemFactory factory,
final CreateResponse createResponse) throws FileUploadException {
final FormItemList formItemList = FormItemList.extractFormItems(
request, factory);
return checkRequest(formItemList, createRespon... | [
"public",
"static",
"CreateRequest",
"checkRequest",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"DiskFileItemFactory",
"factory",
",",
"final",
"CreateResponse",
"createResponse",
")",
"throws",
"FileUploadException",
"{",
"final",
"FormItemList",
"formI... | check a create request for validity concerning NSSP
@param request
Tomcat servlet request
@param factory
disk file item factory
@param createResponse
create response object
@return create request object<br>
<b>null</b> if the create request is invalid
@throws FileUploadException
if errors encountered while processing ... | [
"check",
"a",
"create",
"request",
"for",
"validity",
"concerning",
"NSSP"
] | train | https://github.com/renepickhardt/metalcon/blob/26a7bd89d2225fe2172dc958d10f64a1bd9cf52f/graphityServer/src/main/java/de/metalcon/server/tomcat/NSSP/create/CreateRequest.java#L56-L62 |
lessthanoptimal/BoofCV | main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java | UtilImageIO.loadImage | public static <T extends ImageGray<T>> T loadImage(String fileName, Class<T> imageType ) {
BufferedImage img = loadImage(fileName);
if( img == null )
return null;
return ConvertBufferedImage.convertFromSingle(img, (T) null, imageType);
} | java | public static <T extends ImageGray<T>> T loadImage(String fileName, Class<T> imageType ) {
BufferedImage img = loadImage(fileName);
if( img == null )
return null;
return ConvertBufferedImage.convertFromSingle(img, (T) null, imageType);
} | [
"public",
"static",
"<",
"T",
"extends",
"ImageGray",
"<",
"T",
">",
">",
"T",
"loadImage",
"(",
"String",
"fileName",
",",
"Class",
"<",
"T",
">",
"imageType",
")",
"{",
"BufferedImage",
"img",
"=",
"loadImage",
"(",
"fileName",
")",
";",
"if",
"(",
... | Loads the image and converts into the specified image type.
@param fileName Path to image file.
@param imageType Type of image that should be returned.
@return The image or null if the image could not be loaded. | [
"Loads",
"the",
"image",
"and",
"converts",
"into",
"the",
"specified",
"image",
"type",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-io/src/main/java/boofcv/io/image/UtilImageIO.java#L121-L127 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java | ApiOvhEmailexchange.organizationName_service_exchangeService_domain_domainName_PUT | public void organizationName_service_exchangeService_domain_domainName_PUT(String organizationName, String exchangeService, String domainName, OvhDomain body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}";
StringBuilder sb = path(qPath, organi... | java | public void organizationName_service_exchangeService_domain_domainName_PUT(String organizationName, String exchangeService, String domainName, OvhDomain body) throws IOException {
String qPath = "/email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}";
StringBuilder sb = path(qPath, organi... | [
"public",
"void",
"organizationName_service_exchangeService_domain_domainName_PUT",
"(",
"String",
"organizationName",
",",
"String",
"exchangeService",
",",
"String",
"domainName",
",",
"OvhDomain",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/e... | Alter this object properties
REST: PUT /email/exchange/{organizationName}/service/{exchangeService}/domain/{domainName}
@param body [required] New object properties
@param organizationName [required] The internal name of your exchange organization
@param exchangeService [required] The internal name of your exchange se... | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailexchange/src/main/java/net/minidev/ovh/api/ApiOvhEmailexchange.java#L500-L504 |
cloudant/sync-android | cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/HierarchicalUriComponents.java | HierarchicalUriComponents.encodeUriComponent | static String encodeUriComponent(String source, String encoding, Type type)
throws UnsupportedEncodingException {
if (source == null) {
return null;
}
Misc.checkNotNull(encoding, "Encoding");
Misc.checkArgument(!encoding.isEmpty(), "Encoding must not be empty");
... | java | static String encodeUriComponent(String source, String encoding, Type type)
throws UnsupportedEncodingException {
if (source == null) {
return null;
}
Misc.checkNotNull(encoding, "Encoding");
Misc.checkArgument(!encoding.isEmpty(), "Encoding must not be empty");
... | [
"static",
"String",
"encodeUriComponent",
"(",
"String",
"source",
",",
"String",
"encoding",
",",
"Type",
"type",
")",
"throws",
"UnsupportedEncodingException",
"{",
"if",
"(",
"source",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"Misc",
".",
"chec... | Encode the given source into an encoded String using the rules specified
by the given component and with the given options.
@param source the source string
@param encoding the encoding of the source string
@param type the URI component for the source
@return the encoded URI
@throws IllegalArgumentException when the giv... | [
"Encode",
"the",
"given",
"source",
"into",
"an",
"encoded",
"String",
"using",
"the",
"rules",
"specified",
"by",
"the",
"given",
"component",
"and",
"with",
"the",
"given",
"options",
"."
] | train | https://github.com/cloudant/sync-android/blob/5f1416ed1bd9ab05d7a4b8736480c8ae68bd7383/cloudant-sync-datastore-core/src/main/java/com/cloudant/sync/internal/mazha/HierarchicalUriComponents.java#L42-L52 |
b3dgs/lionengine | lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ScreenFullAwt.java | ScreenFullAwt.initFullscreen | private void initFullscreen(Resolution output, int depth)
{
final java.awt.Window window = new java.awt.Window(frame, conf);
window.setBackground(Color.BLACK);
window.setIgnoreRepaint(true);
window.setPreferredSize(new Dimension(output.getWidth(), output.getHeight()));
dev.se... | java | private void initFullscreen(Resolution output, int depth)
{
final java.awt.Window window = new java.awt.Window(frame, conf);
window.setBackground(Color.BLACK);
window.setIgnoreRepaint(true);
window.setPreferredSize(new Dimension(output.getWidth(), output.getHeight()));
dev.se... | [
"private",
"void",
"initFullscreen",
"(",
"Resolution",
"output",
",",
"int",
"depth",
")",
"{",
"final",
"java",
".",
"awt",
".",
"Window",
"window",
"=",
"new",
"java",
".",
"awt",
".",
"Window",
"(",
"frame",
",",
"conf",
")",
";",
"window",
".",
... | Prepare fullscreen mode.
@param output The output resolution
@param depth The bit depth color.
@throws LionEngineException If unsupported resolution. | [
"Prepare",
"fullscreen",
"mode",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core-awt/src/main/java/com/b3dgs/lionengine/awt/graphic/ScreenFullAwt.java#L88-L121 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Element.java | Element.appendElement | public Element appendElement(String tagName) {
Element child = new Element(Tag.valueOf(tagName, NodeUtils.parser(this).settings()), baseUri());
appendChild(child);
return child;
} | java | public Element appendElement(String tagName) {
Element child = new Element(Tag.valueOf(tagName, NodeUtils.parser(this).settings()), baseUri());
appendChild(child);
return child;
} | [
"public",
"Element",
"appendElement",
"(",
"String",
"tagName",
")",
"{",
"Element",
"child",
"=",
"new",
"Element",
"(",
"Tag",
".",
"valueOf",
"(",
"tagName",
",",
"NodeUtils",
".",
"parser",
"(",
"this",
")",
".",
"settings",
"(",
")",
")",
",",
"ba... | Create a new element by tag name, and add it as the last child.
@param tagName the name of the tag (e.g. {@code div}).
@return the new element, to allow you to add content to it, e.g.:
{@code parent.appendElement("h1").attr("id", "header").text("Welcome");} | [
"Create",
"a",
"new",
"element",
"by",
"tag",
"name",
"and",
"add",
"it",
"as",
"the",
"last",
"child",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Element.java#L494-L498 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java | NodeIndexer.addBooleanValue | protected void addBooleanValue(Document doc, String fieldName, Object internalValue)
{
doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.BOOLEAN));
} | java | protected void addBooleanValue(Document doc, String fieldName, Object internalValue)
{
doc.add(createFieldWithoutNorms(fieldName, internalValue.toString(), PropertyType.BOOLEAN));
} | [
"protected",
"void",
"addBooleanValue",
"(",
"Document",
"doc",
",",
"String",
"fieldName",
",",
"Object",
"internalValue",
")",
"{",
"doc",
".",
"add",
"(",
"createFieldWithoutNorms",
"(",
"fieldName",
",",
"internalValue",
".",
"toString",
"(",
")",
",",
"Pr... | Adds the string representation of the boolean value to the document as
the named field.
@param doc The document to which to add the field
@param fieldName The name of the field to add
@param internalValue The value for the field to add to the document. | [
"Adds",
"the",
"string",
"representation",
"of",
"the",
"boolean",
"value",
"to",
"the",
"document",
"as",
"the",
"named",
"field",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/query/lucene/NodeIndexer.java#L695-L698 |
beanshell/beanshell | src/main/java/bsh/engine/BshScriptEngine.java | BshScriptEngine.getInterface | @Override
public <T> T getInterface(Object thiz, Class<T> clasz) {
if (!(thiz instanceof bsh.This)) {
throw new IllegalArgumentException("Illegal object type: " + (null == thiz ? "null" : thiz.getClass()));
}
bsh.This bshThis = (bsh.This) thiz;
return clasz.cast(bshThis.... | java | @Override
public <T> T getInterface(Object thiz, Class<T> clasz) {
if (!(thiz instanceof bsh.This)) {
throw new IllegalArgumentException("Illegal object type: " + (null == thiz ? "null" : thiz.getClass()));
}
bsh.This bshThis = (bsh.This) thiz;
return clasz.cast(bshThis.... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"getInterface",
"(",
"Object",
"thiz",
",",
"Class",
"<",
"T",
">",
"clasz",
")",
"{",
"if",
"(",
"!",
"(",
"thiz",
"instanceof",
"bsh",
".",
"This",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentExcept... | Returns an implementation of an interface using member functions of a
scripting object compiled in the interpreter. The methods of the interface
may be implemented using invoke(Object, String, Object...) method.
@param thiz The scripting object whose member functions are used to
implement the methods of the interface... | [
"Returns",
"an",
"implementation",
"of",
"an",
"interface",
"using",
"member",
"functions",
"of",
"a",
"scripting",
"object",
"compiled",
"in",
"the",
"interpreter",
".",
"The",
"methods",
"of",
"the",
"interface",
"may",
"be",
"implemented",
"using",
"invoke",
... | train | https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/engine/BshScriptEngine.java#L343-L351 |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/coordinator/helper/SegmentCompactorUtil.java | SegmentCompactorUtil.removeIntervalFromEnd | static Interval removeIntervalFromEnd(Interval largeInterval, Interval smallInterval)
{
Preconditions.checkArgument(
largeInterval.getEnd().equals(smallInterval.getEnd()),
"end should be same. largeInterval[%s] smallInterval[%s]",
largeInterval,
smallInterval
);
return new ... | java | static Interval removeIntervalFromEnd(Interval largeInterval, Interval smallInterval)
{
Preconditions.checkArgument(
largeInterval.getEnd().equals(smallInterval.getEnd()),
"end should be same. largeInterval[%s] smallInterval[%s]",
largeInterval,
smallInterval
);
return new ... | [
"static",
"Interval",
"removeIntervalFromEnd",
"(",
"Interval",
"largeInterval",
",",
"Interval",
"smallInterval",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"largeInterval",
".",
"getEnd",
"(",
")",
".",
"equals",
"(",
"smallInterval",
".",
"getEnd",
"... | Removes {@code smallInterval} from {@code largeInterval}. The end of both intervals should be same.
@return an interval of {@code largeInterval} - {@code smallInterval}. | [
"Removes",
"{",
"@code",
"smallInterval",
"}",
"from",
"{",
"@code",
"largeInterval",
"}",
".",
"The",
"end",
"of",
"both",
"intervals",
"should",
"be",
"same",
"."
] | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/coordinator/helper/SegmentCompactorUtil.java#L45-L54 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.