repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
lucee/Lucee | core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java | VariableInterpreter.setVariable | public static Object setVariable(PageContext pc, String var, Object value) throws PageException {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable name declaration [" + var + "]");
if (list.size() == 1) {
return pc.undefinedScope().se... | java | public static Object setVariable(PageContext pc, String var, Object value) throws PageException {
StringList list = parse(pc, new ParserString(var), false);
if (list == null) throw new InterpreterException("invalid variable name declaration [" + var + "]");
if (list.size() == 1) {
return pc.undefinedScope().se... | [
"public",
"static",
"Object",
"setVariable",
"(",
"PageContext",
"pc",
",",
"String",
"var",
",",
"Object",
"value",
")",
"throws",
"PageException",
"{",
"StringList",
"list",
"=",
"parse",
"(",
"pc",
",",
"new",
"ParserString",
"(",
"var",
")",
",",
"fals... | sets a variable to page Context
@param pc pagecontext of the new variable
@param var String of variable definition
@param value value to set to variable
@return value setted
@throws PageException | [
"sets",
"a",
"variable",
"to",
"page",
"Context"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/interpreter/VariableInterpreter.java#L361-L384 |
aws/aws-sdk-java | aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/InventoryResultItem.java | InventoryResultItem.withContent | public InventoryResultItem withContent(java.util.Collection<java.util.Map<String, String>> content) {
setContent(content);
return this;
} | java | public InventoryResultItem withContent(java.util.Collection<java.util.Map<String, String>> content) {
setContent(content);
return this;
} | [
"public",
"InventoryResultItem",
"withContent",
"(",
"java",
".",
"util",
".",
"Collection",
"<",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
">",
"content",
")",
"{",
"setContent",
"(",
"content",
")",
";",
"return",
"this",
";",... | <p>
Contains all the inventory data of the item type. Results include attribute names and values.
</p>
@param content
Contains all the inventory data of the item type. Results include attribute names and values.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Contains",
"all",
"the",
"inventory",
"data",
"of",
"the",
"item",
"type",
".",
"Results",
"include",
"attribute",
"names",
"and",
"values",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ssm/src/main/java/com/amazonaws/services/simplesystemsmanagement/model/InventoryResultItem.java#L304-L307 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newSystemException | public static SystemException newSystemException(Throwable cause, String message, Object... args) {
return new SystemException(format(message, args), cause);
} | java | public static SystemException newSystemException(Throwable cause, String message, Object... args) {
return new SystemException(format(message, args), cause);
} | [
"public",
"static",
"SystemException",
"newSystemException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"SystemException",
"(",
"format",
"(",
"message",
",",
"args",
")",
",",
"cause",
")",
... | Constructs and initializes a new {@link SystemException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link SystemException} was thrown.
@param message {@link String} describing the {... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"SystemException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L915-L917 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.fileDump | public static final void fileDump(String fileName, byte[] data)
{
System.out.println("FILE DUMP");
try
{
FileOutputStream os = new FileOutputStream(fileName);
os.write(data);
os.close();
}
catch (IOException ex)
{
ex.printStackTrace();
}
... | java | public static final void fileDump(String fileName, byte[] data)
{
System.out.println("FILE DUMP");
try
{
FileOutputStream os = new FileOutputStream(fileName);
os.write(data);
os.close();
}
catch (IOException ex)
{
ex.printStackTrace();
}
... | [
"public",
"static",
"final",
"void",
"fileDump",
"(",
"String",
"fileName",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"FILE DUMP\"",
")",
";",
"try",
"{",
"FileOutputStream",
"os",
"=",
"new",
"FileOutputStream",... | Writes a large byte array to a file.
@param fileName output file name
@param data target data | [
"Writes",
"a",
"large",
"byte",
"array",
"to",
"a",
"file",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L1000-L1014 |
SUSE/salt-netapi-client | src/main/java/com/suse/salt/netapi/event/WebSocketEventStream.java | WebSocketEventStream.initializeStream | private void initializeStream(URI uri, Token token, long sessionIdleTimeout, long idleTimeout)
throws SaltException {
try {
URI adjustedURI = new URI(uri.getScheme() == "https" ? "wss" : "ws",
uri.getSchemeSpecificPart(), uri.getFragment())
.resolv... | java | private void initializeStream(URI uri, Token token, long sessionIdleTimeout, long idleTimeout)
throws SaltException {
try {
URI adjustedURI = new URI(uri.getScheme() == "https" ? "wss" : "ws",
uri.getSchemeSpecificPart(), uri.getFragment())
.resolv... | [
"private",
"void",
"initializeStream",
"(",
"URI",
"uri",
",",
"Token",
"token",
",",
"long",
"sessionIdleTimeout",
",",
"long",
"idleTimeout",
")",
"throws",
"SaltException",
"{",
"try",
"{",
"URI",
"adjustedURI",
"=",
"new",
"URI",
"(",
"uri",
".",
"getSch... | Connect the WebSocket to the server pointing to /ws/{token} to receive events.
@throws SaltException in case of an error during stream initialization | [
"Connect",
"the",
"WebSocket",
"to",
"the",
"server",
"pointing",
"to",
"/",
"ws",
"/",
"{",
"token",
"}",
"to",
"receive",
"events",
"."
] | train | https://github.com/SUSE/salt-netapi-client/blob/a0bdf643c8e34fa4def4b915366594c1491fdad5/src/main/java/com/suse/salt/netapi/event/WebSocketEventStream.java#L88-L104 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/raid/GaloisField.java | GaloisField.solveVandermondeSystem | public void solveVandermondeSystem(int[] x, int[] y, int len) {
assert(x.length <= len && y.length <= len);
for (int i = 0; i < len - 1; i++) {
for (int j = len - 1; j > i; j--) {
y[j] = y[j] ^ mulTable[x[i]][y[j - 1]];
}
}
for (int i = len - 1; i >= 0; i--) {
for (int j = i + ... | java | public void solveVandermondeSystem(int[] x, int[] y, int len) {
assert(x.length <= len && y.length <= len);
for (int i = 0; i < len - 1; i++) {
for (int j = len - 1; j > i; j--) {
y[j] = y[j] ^ mulTable[x[i]][y[j - 1]];
}
}
for (int i = len - 1; i >= 0; i--) {
for (int j = i + ... | [
"public",
"void",
"solveVandermondeSystem",
"(",
"int",
"[",
"]",
"x",
",",
"int",
"[",
"]",
"y",
",",
"int",
"len",
")",
"{",
"assert",
"(",
"x",
".",
"length",
"<=",
"len",
"&&",
"y",
".",
"length",
"<=",
"len",
")",
";",
"for",
"(",
"int",
"... | Given a Vandermonde matrix V[i][j]=x[j]^i and vector y, solve for z such
that Vz=y. The output z will be placed in y.
@param x the vector which describe the Vandermonde matrix
@param y right-hand side of the Vandermonde system equation.
will be replaced the output in this vector
@param len consider x and y only from 0.... | [
"Given",
"a",
"Vandermonde",
"matrix",
"V",
"[",
"i",
"]",
"[",
"j",
"]",
"=",
"x",
"[",
"j",
"]",
"^i",
"and",
"vector",
"y",
"solve",
"for",
"z",
"such",
"that",
"Vz",
"=",
"y",
".",
"The",
"output",
"z",
"will",
"be",
"placed",
"in",
"y",
... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/raid/GaloisField.java#L207-L222 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/s3/S3Client.java | S3Client.createPutRequest | public S3ClientRequest createPutRequest(final String aBucket, final String aKey,
final Handler<HttpClientResponse> aHandler) {
final HttpClientRequest httpRequest = myHTTPClient.put(PATH_SEP + aBucket + PATH_SEP + aKey, aHandler);
return new S3ClientRequest("PUT", aBucket, aKey, httpRequest,... | java | public S3ClientRequest createPutRequest(final String aBucket, final String aKey,
final Handler<HttpClientResponse> aHandler) {
final HttpClientRequest httpRequest = myHTTPClient.put(PATH_SEP + aBucket + PATH_SEP + aKey, aHandler);
return new S3ClientRequest("PUT", aBucket, aKey, httpRequest,... | [
"public",
"S3ClientRequest",
"createPutRequest",
"(",
"final",
"String",
"aBucket",
",",
"final",
"String",
"aKey",
",",
"final",
"Handler",
"<",
"HttpClientResponse",
">",
"aHandler",
")",
"{",
"final",
"HttpClientRequest",
"httpRequest",
"=",
"myHTTPClient",
".",
... | Creates an S3 PUT request.
<p>
<code>create PUT -> requestObject</code>
</p>
@param aBucket An S3 bucket
@param aKey An S3 key
@param aHandler A response handler
@return An S3 PUT request | [
"Creates",
"an",
"S3",
"PUT",
"request",
".",
"<p",
">",
"<code",
">",
"create",
"PUT",
"-",
">",
";",
"requestObject<",
"/",
"code",
">",
"<",
"/",
"p",
">"
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/s3/S3Client.java#L251-L255 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java | RTMPHandshake.getBlowfishSignature | public final static void getBlowfishSignature(byte[] array, int offset, int keyid) {
BlowfishEngine bf = new BlowfishEngine();
// need to use little endian
bf.init(true, new KeyParameter(BLOWFISH_KEYS[keyid]));
byte[] output = new byte[8];
bf.processBlock(array, offset, outp... | java | public final static void getBlowfishSignature(byte[] array, int offset, int keyid) {
BlowfishEngine bf = new BlowfishEngine();
// need to use little endian
bf.init(true, new KeyParameter(BLOWFISH_KEYS[keyid]));
byte[] output = new byte[8];
bf.processBlock(array, offset, outp... | [
"public",
"final",
"static",
"void",
"getBlowfishSignature",
"(",
"byte",
"[",
"]",
"array",
",",
"int",
"offset",
",",
"int",
"keyid",
")",
"{",
"BlowfishEngine",
"bf",
"=",
"new",
"BlowfishEngine",
"(",
")",
";",
"// need to use little endian\r",
"bf",
".",
... | RTMPE type 9 uses Blowfish on the regular signature http://en.wikipedia.org/wiki/Blowfish_(cipher)
@param array array to get signature
@param offset offset to start from
@param keyid ID of XTEA key | [
"RTMPE",
"type",
"9",
"uses",
"Blowfish",
"on",
"the",
"regular",
"signature",
"http",
":",
"//",
"en",
".",
"wikipedia",
".",
"org",
"/",
"wiki",
"/",
"Blowfish_",
"(",
"cipher",
")"
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L582-L589 |
apereo/person-directory | person-directory-impl/src/main/java/org/apereo/services/persondir/support/jdbc/MultiRowJdbcPersonAttributeDao.java | MultiRowJdbcPersonAttributeDao.setNameValueColumnMappings | public void setNameValueColumnMappings(final Map<String, ?> nameValueColumnMap) {
if (nameValueColumnMap == null) {
this.nameValueColumnMappings = null;
} else {
final Map<String, Set<String>> mappings = MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(nameValueCo... | java | public void setNameValueColumnMappings(final Map<String, ?> nameValueColumnMap) {
if (nameValueColumnMap == null) {
this.nameValueColumnMappings = null;
} else {
final Map<String, Set<String>> mappings = MultivaluedPersonAttributeUtils.parseAttributeToAttributeMapping(nameValueCo... | [
"public",
"void",
"setNameValueColumnMappings",
"(",
"final",
"Map",
"<",
"String",
",",
"?",
">",
"nameValueColumnMap",
")",
"{",
"if",
"(",
"nameValueColumnMap",
"==",
"null",
")",
"{",
"this",
".",
"nameValueColumnMappings",
"=",
"null",
";",
"}",
"else",
... | The {@link Map} of columns from a name column to value columns. Keys are Strings,
Values are Strings or {@link java.util.List} of Strings.
@param nameValueColumnMap The Map of name column to value column(s). | [
"The",
"{",
"@link",
"Map",
"}",
"of",
"columns",
"from",
"a",
"name",
"column",
"to",
"value",
"columns",
".",
"Keys",
"are",
"Strings",
"Values",
"are",
"Strings",
"or",
"{",
"@link",
"java",
".",
"util",
".",
"List",
"}",
"of",
"Strings",
"."
] | train | https://github.com/apereo/person-directory/blob/331200c0878aec202b8aff12a732402d6ba7681f/person-directory-impl/src/main/java/org/apereo/services/persondir/support/jdbc/MultiRowJdbcPersonAttributeDao.java#L140-L152 |
alkacon/opencms-core | src/org/opencms/main/CmsShellCommands.java | CmsShellCommands.importResourcesWithTempProject | public void importResourcesWithTempProject(String importFile) throws Exception {
CmsProject project = m_cms.createProject(
"SystemUpdate",
getMessages().key(Messages.GUI_SHELL_IMPORT_TEMP_PROJECT_NAME_0),
OpenCms.getDefaultUsers().getGroupAdministrators(),
OpenCm... | java | public void importResourcesWithTempProject(String importFile) throws Exception {
CmsProject project = m_cms.createProject(
"SystemUpdate",
getMessages().key(Messages.GUI_SHELL_IMPORT_TEMP_PROJECT_NAME_0),
OpenCms.getDefaultUsers().getGroupAdministrators(),
OpenCm... | [
"public",
"void",
"importResourcesWithTempProject",
"(",
"String",
"importFile",
")",
"throws",
"Exception",
"{",
"CmsProject",
"project",
"=",
"m_cms",
".",
"createProject",
"(",
"\"SystemUpdate\"",
",",
"getMessages",
"(",
")",
".",
"key",
"(",
"Messages",
".",
... | Imports a folder or a ZIP file to the root folder of the
current site, creating a temporary project for this.<p>
@param importFile the absolute path of the import resource
@throws Exception if something goes wrong | [
"Imports",
"a",
"folder",
"or",
"a",
"ZIP",
"file",
"to",
"the",
"root",
"folder",
"of",
"the",
"current",
"site",
"creating",
"a",
"temporary",
"project",
"for",
"this",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/CmsShellCommands.java#L954-L976 |
pippo-java/pippo | pippo-core/src/main/java/ro/pippo/core/PippoSettings.java | PippoSettings.getLong | public long getLong(String name, long defaultValue) {
try {
String value = getString(name, null);
if (!StringUtils.isNullOrEmpty(value)) {
return Long.parseLong(value.trim());
}
} catch (NumberFormatException e) {
log.warn("Failed to parse ... | java | public long getLong(String name, long defaultValue) {
try {
String value = getString(name, null);
if (!StringUtils.isNullOrEmpty(value)) {
return Long.parseLong(value.trim());
}
} catch (NumberFormatException e) {
log.warn("Failed to parse ... | [
"public",
"long",
"getLong",
"(",
"String",
"name",
",",
"long",
"defaultValue",
")",
"{",
"try",
"{",
"String",
"value",
"=",
"getString",
"(",
"name",
",",
"null",
")",
";",
"if",
"(",
"!",
"StringUtils",
".",
"isNullOrEmpty",
"(",
"value",
")",
")",... | Returns the long value for the specified name. If the name does not
exist or the value for the name can not be interpreted as an long, the
defaultValue is returned.
@param name
@param defaultValue
@return name value or defaultValue | [
"Returns",
"the",
"long",
"value",
"for",
"the",
"specified",
"name",
".",
"If",
"the",
"name",
"does",
"not",
"exist",
"or",
"the",
"value",
"for",
"the",
"name",
"can",
"not",
"be",
"interpreted",
"as",
"an",
"long",
"the",
"defaultValue",
"is",
"retur... | train | https://github.com/pippo-java/pippo/blob/cb5ccb453bffcc3cf386adc660674812d10b9726/pippo-core/src/main/java/ro/pippo/core/PippoSettings.java#L518-L530 |
linkedin/PalDB | paldb/src/main/java/com/linkedin/paldb/utils/LongPacker.java | LongPacker.packLong | static public int packLong(DataOutput os, long value)
throws IOException {
if (value < 0) {
throw new IllegalArgumentException("negative value: v=" + value);
}
int i = 1;
while ((value & ~0x7FL) != 0) {
os.write((((int) value & 0x7F) | 0x80));
value >>>= 7;
i++;
}
... | java | static public int packLong(DataOutput os, long value)
throws IOException {
if (value < 0) {
throw new IllegalArgumentException("negative value: v=" + value);
}
int i = 1;
while ((value & ~0x7FL) != 0) {
os.write((((int) value & 0x7F) | 0x80));
value >>>= 7;
i++;
}
... | [
"static",
"public",
"int",
"packLong",
"(",
"DataOutput",
"os",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"if",
"(",
"value",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"negative value: v=\"",
"+",
"value",
")",
";"... | Pack non-negative long into output stream. It will occupy 1-10 bytes
depending on value (lower values occupy smaller space)
@param os the data output
@param value the long value
@return the number of bytes written
@throws IOException if an error occurs with the stream | [
"Pack",
"non",
"-",
"negative",
"long",
"into",
"output",
"stream",
".",
"It",
"will",
"occupy",
"1",
"-",
"10",
"bytes",
"depending",
"on",
"value",
"(",
"lower",
"values",
"occupy",
"smaller",
"space",
")"
] | train | https://github.com/linkedin/PalDB/blob/d05ccdd3f67855eb2675dbd82599f19aa7a9f650/paldb/src/main/java/com/linkedin/paldb/utils/LongPacker.java#L45-L60 |
powermock/powermock | powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java | WhiteboxImpl.getField | @SuppressWarnings({"unchecked", "rawtypes"})
public static Field getField(Class<?> type, String fieldName) {
LinkedList<Class<?>> examine = new LinkedList<Class<?>>();
examine.add(type);
Set<Class<?>> done = new HashSet<Class<?>>();
while (!examine.isEmpty()) {
Class<?> t... | java | @SuppressWarnings({"unchecked", "rawtypes"})
public static Field getField(Class<?> type, String fieldName) {
LinkedList<Class<?>> examine = new LinkedList<Class<?>>();
examine.add(type);
Set<Class<?>> done = new HashSet<Class<?>>();
while (!examine.isEmpty()) {
Class<?> t... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"unchecked\"",
",",
"\"rawtypes\"",
"}",
")",
"public",
"static",
"Field",
"getField",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"fieldName",
")",
"{",
"LinkedList",
"<",
"Class",
"<",
"?",
">",
">",
"examin... | Convenience method to get a field from a class type.
The method will first try to look for a declared field in the same class.
If the method is not declared in this class it will look for the field in
the super class. This will continue throughout the whole class hierarchy.
If the field is not found an {@link IllegalA... | [
"Convenience",
"method",
"to",
"get",
"a",
"field",
"from",
"a",
"class",
"type",
"."
] | train | https://github.com/powermock/powermock/blob/e8cd68026c284c6a7efe66959809eeebd8d1f9ad/powermock-reflect/src/main/java/org/powermock/reflect/internal/WhiteboxImpl.java#L198-L225 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Maps.java | Maps.getOrDefault | public static <K, V> V getOrDefault(final Map<K, V> map, final Object key, final V defaultValue) {
if (N.isNullOrEmpty(map)) {
return defaultValue;
}
final V val = map.get(key);
if (val != null || map.containsKey(key)) {
return val;
} else {
... | java | public static <K, V> V getOrDefault(final Map<K, V> map, final Object key, final V defaultValue) {
if (N.isNullOrEmpty(map)) {
return defaultValue;
}
final V val = map.get(key);
if (val != null || map.containsKey(key)) {
return val;
} else {
... | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"V",
"getOrDefault",
"(",
"final",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"final",
"Object",
"key",
",",
"final",
"V",
"defaultValue",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"map",
"... | Returns the value to which the specified key is mapped, or
{@code defaultValue} if this map contains no mapping for the key.
@param map
@param key
@param defaultValue
@return | [
"Returns",
"the",
"value",
"to",
"which",
"the",
"specified",
"key",
"is",
"mapped",
"or",
"{",
"@code",
"defaultValue",
"}",
"if",
"this",
"map",
"contains",
"no",
"mapping",
"for",
"the",
"key",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Maps.java#L234-L246 |
Azure/azure-sdk-for-java | features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeaturesInner.java | FeaturesInner.registerAsync | public Observable<FeatureResultInner> registerAsync(String resourceProviderNamespace, String featureName) {
return registerWithServiceResponseAsync(resourceProviderNamespace, featureName).map(new Func1<ServiceResponse<FeatureResultInner>, FeatureResultInner>() {
@Override
public FeatureR... | java | public Observable<FeatureResultInner> registerAsync(String resourceProviderNamespace, String featureName) {
return registerWithServiceResponseAsync(resourceProviderNamespace, featureName).map(new Func1<ServiceResponse<FeatureResultInner>, FeatureResultInner>() {
@Override
public FeatureR... | [
"public",
"Observable",
"<",
"FeatureResultInner",
">",
"registerAsync",
"(",
"String",
"resourceProviderNamespace",
",",
"String",
"featureName",
")",
"{",
"return",
"registerWithServiceResponseAsync",
"(",
"resourceProviderNamespace",
",",
"featureName",
")",
".",
"map"... | Registers the preview feature for the subscription.
@param resourceProviderNamespace The namespace of the resource provider.
@param featureName The name of the feature to register.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the FeatureResultInner object | [
"Registers",
"the",
"preview",
"feature",
"for",
"the",
"subscription",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/features/resource-manager/v2015_12_01/src/main/java/com/microsoft/azure/management/features/v2015_12_01/implementation/FeaturesInner.java#L430-L437 |
samskivert/pythagoras | src/main/java/pythagoras/d/Quaternion.java | Quaternion.fromAxes | public Quaternion fromAxes (IVector3 nx, IVector3 ny, IVector3 nz) {
double nxx = nx.x(), nyy = ny.y(), nzz = nz.z();
double x2 = (1f + nxx - nyy - nzz)/4f;
double y2 = (1f - nxx + nyy - nzz)/4f;
double z2 = (1f - nxx - nyy + nzz)/4f;
double w2 = (1f - x2 - y2 - z2);
retu... | java | public Quaternion fromAxes (IVector3 nx, IVector3 ny, IVector3 nz) {
double nxx = nx.x(), nyy = ny.y(), nzz = nz.z();
double x2 = (1f + nxx - nyy - nzz)/4f;
double y2 = (1f - nxx + nyy - nzz)/4f;
double z2 = (1f - nxx - nyy + nzz)/4f;
double w2 = (1f - x2 - y2 - z2);
retu... | [
"public",
"Quaternion",
"fromAxes",
"(",
"IVector3",
"nx",
",",
"IVector3",
"ny",
",",
"IVector3",
"nz",
")",
"{",
"double",
"nxx",
"=",
"nx",
".",
"x",
"(",
")",
",",
"nyy",
"=",
"ny",
".",
"y",
"(",
")",
",",
"nzz",
"=",
"nz",
".",
"z",
"(",
... | Sets this quaternion to one that rotates onto the given unit axes.
@return a reference to this quaternion, for chaining. | [
"Sets",
"this",
"quaternion",
"to",
"one",
"that",
"rotates",
"onto",
"the",
"given",
"unit",
"axes",
"."
] | train | https://github.com/samskivert/pythagoras/blob/b8fea743ee8a7d742ad9c06ee4f11f50571fbd32/src/main/java/pythagoras/d/Quaternion.java#L137-L147 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildClassConstantSummary | public void buildClassConstantSummary(XMLNode node, Content summariesTree) {
ClassDoc[] classes = currentPackage.name().length() > 0 ?
currentPackage.allClasses() :
configuration.classDocCatalog.allClasses(
DocletConstants.DEFAULT_PACKAGE_NAME);
Arrays.sort(classe... | java | public void buildClassConstantSummary(XMLNode node, Content summariesTree) {
ClassDoc[] classes = currentPackage.name().length() > 0 ?
currentPackage.allClasses() :
configuration.classDocCatalog.allClasses(
DocletConstants.DEFAULT_PACKAGE_NAME);
Arrays.sort(classe... | [
"public",
"void",
"buildClassConstantSummary",
"(",
"XMLNode",
"node",
",",
"Content",
"summariesTree",
")",
"{",
"ClassDoc",
"[",
"]",
"classes",
"=",
"currentPackage",
".",
"name",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
"?",
"currentPackage",
".",
... | Build the summary for the current class.
@param node the XML element that specifies which components to document
@param summariesTree the tree to which the class constant summary will be added | [
"Build",
"the",
"summary",
"for",
"the",
"current",
"class",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java#L207-L224 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.resolveSelfContaining | Symbol resolveSelfContaining(DiagnosticPosition pos,
Env<AttrContext> env,
Symbol member,
boolean isSuperCall) {
Symbol sym = resolveSelfContainingInternal(env, member, isSuperCall);
if (sym == null) {
... | java | Symbol resolveSelfContaining(DiagnosticPosition pos,
Env<AttrContext> env,
Symbol member,
boolean isSuperCall) {
Symbol sym = resolveSelfContainingInternal(env, member, isSuperCall);
if (sym == null) {
... | [
"Symbol",
"resolveSelfContaining",
"(",
"DiagnosticPosition",
"pos",
",",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Symbol",
"member",
",",
"boolean",
"isSuperCall",
")",
"{",
"Symbol",
"sym",
"=",
"resolveSelfContainingInternal",
"(",
"env",
",",
"member",
"... | Resolve `c.this' for an enclosing class c that contains the
named member.
@param pos The position to use for error reporting.
@param env The environment current at the expression.
@param member The member that must be contained in the result. | [
"Resolve",
"c",
".",
"this",
"for",
"an",
"enclosing",
"class",
"c",
"that",
"contains",
"the",
"named",
"member",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java#L3577-L3588 |
jledit/jledit | core/src/main/java/org/jledit/utils/Strings.java | Strings.tryToTrimToSize | public static String tryToTrimToSize(String s, int length, boolean trimSuffix) {
if (s == null || s.isEmpty()) {
return s;
} else if (s.length() <= length) {
return s;
} else if (s.contains(File.separator)) {
String before = s.substring(0, s.lastIndexOf(File.s... | java | public static String tryToTrimToSize(String s, int length, boolean trimSuffix) {
if (s == null || s.isEmpty()) {
return s;
} else if (s.length() <= length) {
return s;
} else if (s.contains(File.separator)) {
String before = s.substring(0, s.lastIndexOf(File.s... | [
"public",
"static",
"String",
"tryToTrimToSize",
"(",
"String",
"s",
",",
"int",
"length",
",",
"boolean",
"trimSuffix",
")",
"{",
"if",
"(",
"s",
"==",
"null",
"||",
"s",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
"s",
";",
"}",
"else",
"if",
"... | Try to trim a String to the given size.
@param s The String to trim.
@param length The trim length.
@param trimSuffix Flag the specifies if trimming should be applied to the suffix of the String.
@return | [
"Try",
"to",
"trim",
"a",
"String",
"to",
"the",
"given",
"size",
"."
] | train | https://github.com/jledit/jledit/blob/ced2c4b44330664adb65f8be4c8fff780ccaa6fd/core/src/main/java/org/jledit/utils/Strings.java#L44-L60 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/lock/LockTable.java | LockTable.addLock | public synchronized SessionInfo addLock(Object bookmark, SessionInfo sessionInfo)
{
Utility.getLogger().info("Lock: " + bookmark + ", Session: " + sessionInfo.m_iSessionID + " success: " + !this.containsKey(bookmark));
if (this.containsKey(bookmark))
return (SessionInfo)this.get(bookmark... | java | public synchronized SessionInfo addLock(Object bookmark, SessionInfo sessionInfo)
{
Utility.getLogger().info("Lock: " + bookmark + ", Session: " + sessionInfo.m_iSessionID + " success: " + !this.containsKey(bookmark));
if (this.containsKey(bookmark))
return (SessionInfo)this.get(bookmark... | [
"public",
"synchronized",
"SessionInfo",
"addLock",
"(",
"Object",
"bookmark",
",",
"SessionInfo",
"sessionInfo",
")",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"Lock: \"",
"+",
"bookmark",
"+",
"\", Session: \"",
"+",
"sessionInfo",
".",
... | Add this lock to the table.
@param bookmark The bookmark to lock.
@param session The session to lock.
@return null if successful, the session of the locking user if not successful. | [
"Add",
"this",
"lock",
"to",
"the",
"table",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/lock/LockTable.java#L34-L40 |
sockeqwe/AdapterDelegates | library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java | AdapterDelegatesManager.onCreateViewHolder | @NonNull
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
AdapterDelegate<T> delegate = getDelegateForViewType(viewType);
if (delegate == null) {
throw new NullPointerException("No AdapterDelegate added for ViewType " + viewType);
}
... | java | @NonNull
public RecyclerView.ViewHolder onCreateViewHolder(@NonNull ViewGroup parent, int viewType) {
AdapterDelegate<T> delegate = getDelegateForViewType(viewType);
if (delegate == null) {
throw new NullPointerException("No AdapterDelegate added for ViewType " + viewType);
}
... | [
"@",
"NonNull",
"public",
"RecyclerView",
".",
"ViewHolder",
"onCreateViewHolder",
"(",
"@",
"NonNull",
"ViewGroup",
"parent",
",",
"int",
"viewType",
")",
"{",
"AdapterDelegate",
"<",
"T",
">",
"delegate",
"=",
"getDelegateForViewType",
"(",
"viewType",
")",
";... | This method must be called in {@link RecyclerView.Adapter#onCreateViewHolder(ViewGroup, int)}
@param parent the parent
@param viewType the view type
@return The new created ViewHolder
@throws NullPointerException if no AdapterDelegate has been registered for ViewHolders
viewType | [
"This",
"method",
"must",
"be",
"called",
"in",
"{",
"@link",
"RecyclerView",
".",
"Adapter#onCreateViewHolder",
"(",
"ViewGroup",
"int",
")",
"}"
] | train | https://github.com/sockeqwe/AdapterDelegates/blob/d18dc609415e5d17a3354bddf4bae62440e017af/library/src/main/java/com/hannesdorfmann/adapterdelegates4/AdapterDelegatesManager.java#L245-L261 |
apache/flink | flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java | MemorySegment.putLongBigEndian | public final void putLongBigEndian(int index, long value) {
if (LITTLE_ENDIAN) {
putLong(index, Long.reverseBytes(value));
} else {
putLong(index, value);
}
} | java | public final void putLongBigEndian(int index, long value) {
if (LITTLE_ENDIAN) {
putLong(index, Long.reverseBytes(value));
} else {
putLong(index, value);
}
} | [
"public",
"final",
"void",
"putLongBigEndian",
"(",
"int",
"index",
",",
"long",
"value",
")",
"{",
"if",
"(",
"LITTLE_ENDIAN",
")",
"{",
"putLong",
"(",
"index",
",",
"Long",
".",
"reverseBytes",
"(",
"value",
")",
")",
";",
"}",
"else",
"{",
"putLong... | Writes the given long value (64bit, 8 bytes) to the given position in big endian
byte order. This method's speed depends on the system's native byte order, and it
is possibly slower than {@link #putLong(int, long)}. For most cases (such as
transient storage in memory or serialization for I/O and network),
it suffices t... | [
"Writes",
"the",
"given",
"long",
"value",
"(",
"64bit",
"8",
"bytes",
")",
"to",
"the",
"given",
"position",
"in",
"big",
"endian",
"byte",
"order",
".",
"This",
"method",
"s",
"speed",
"depends",
"on",
"the",
"system",
"s",
"native",
"byte",
"order",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/core/memory/MemorySegment.java#L956-L962 |
dkpro/dkpro-jwpl | de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java | WikipediaTemplateInfo.getPagesContainingTemplateFragments | public Iterable<Page> getPagesContainingTemplateFragments(List<String> templateFragments) throws WikiApiException{
return getFragmentFilteredPages(templateFragments, true);
} | java | public Iterable<Page> getPagesContainingTemplateFragments(List<String> templateFragments) throws WikiApiException{
return getFragmentFilteredPages(templateFragments, true);
} | [
"public",
"Iterable",
"<",
"Page",
">",
"getPagesContainingTemplateFragments",
"(",
"List",
"<",
"String",
">",
"templateFragments",
")",
"throws",
"WikiApiException",
"{",
"return",
"getFragmentFilteredPages",
"(",
"templateFragments",
",",
"true",
")",
";",
"}"
] | Return an iterable containing all pages that contain a template the name
of which starts with any of the given Strings.
@param templateFragments
the beginning of the templates that have to be matched
@return An iterable with the page objects that contain templates
beginning with any String in templateFragments
@throws... | [
"Return",
"an",
"iterable",
"containing",
"all",
"pages",
"that",
"contain",
"a",
"template",
"the",
"name",
"of",
"which",
"starts",
"with",
"any",
"of",
"the",
"given",
"Strings",
"."
] | train | https://github.com/dkpro/dkpro-jwpl/blob/0a0304b6a0aa13acc18838957994e06dd4613a58/de.tudarmstadt.ukp.wikipedia.util/src/main/java/de/tudarmstadt/ukp/wikipedia/util/templates/WikipediaTemplateInfo.java#L407-L409 |
Red5/red5-server-common | src/main/java/org/red5/server/so/SharedObject.java | SharedObject.getAttribute | @Override
public Object getAttribute(String name, Object value) {
log.debug("getAttribute - name: {} value: {}", name, value);
Object result = null;
if (name != null) {
result = attributes.putIfAbsent(name, value);
if (result == null) {
// no pr... | java | @Override
public Object getAttribute(String name, Object value) {
log.debug("getAttribute - name: {} value: {}", name, value);
Object result = null;
if (name != null) {
result = attributes.putIfAbsent(name, value);
if (result == null) {
// no pr... | [
"@",
"Override",
"public",
"Object",
"getAttribute",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"{",
"log",
".",
"debug",
"(",
"\"getAttribute - name: {} value: {}\"",
",",
"name",
",",
"value",
")",
";",
"Object",
"result",
"=",
"null",
";",
"if",
... | Return attribute by name and set if it doesn't exist yet.
@param name
Attribute name
@param value
Value to set if attribute doesn't exist
@return Attribute value | [
"Return",
"attribute",
"by",
"name",
"and",
"set",
"if",
"it",
"doesn",
"t",
"exist",
"yet",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L408-L426 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/JobLauncherUtils.java | JobLauncherUtils.newMultiTaskId | public static String newMultiTaskId(String jobId, int sequence) {
return Id.MultiTask.create(Id.parse(jobId).get(Id.Parts.INSTANCE_NAME), sequence).toString();
} | java | public static String newMultiTaskId(String jobId, int sequence) {
return Id.MultiTask.create(Id.parse(jobId).get(Id.Parts.INSTANCE_NAME), sequence).toString();
} | [
"public",
"static",
"String",
"newMultiTaskId",
"(",
"String",
"jobId",
",",
"int",
"sequence",
")",
"{",
"return",
"Id",
".",
"MultiTask",
".",
"create",
"(",
"Id",
".",
"parse",
"(",
"jobId",
")",
".",
"get",
"(",
"Id",
".",
"Parts",
".",
"INSTANCE_N... | Create an ID for a new multi-task (corresponding to a {@link org.apache.gobblin.source.workunit.MultiWorkUnit})
for the job with the given job ID.
@param jobId job ID
@param sequence multi-task sequence number
@return new multi-task ID | [
"Create",
"an",
"ID",
"for",
"a",
"new",
"multi",
"-",
"task",
"(",
"corresponding",
"to",
"a",
"{",
"@link",
"org",
".",
"apache",
".",
"gobblin",
".",
"source",
".",
"workunit",
".",
"MultiWorkUnit",
"}",
")",
"for",
"the",
"job",
"with",
"the",
"g... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/JobLauncherUtils.java#L90-L92 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.getPendingCertificateSigningRequest | public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName) {
return getPendingCertificateSigningRequestWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking()
.single().body();
} | java | public String getPendingCertificateSigningRequest(String vaultBaseUrl, String certificateName) {
return getPendingCertificateSigningRequestWithServiceResponseAsync(vaultBaseUrl, certificateName).toBlocking()
.single().body();
} | [
"public",
"String",
"getPendingCertificateSigningRequest",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"certificateName",
")",
"{",
"return",
"getPendingCertificateSigningRequestWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"certificateName",
")",
".",
"toBlocking",
... | Gets the pending certificate signing request response.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param certificateName
The name of the certificate
@return the String if successful. | [
"Gets",
"the",
"pending",
"certificate",
"signing",
"request",
"response",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L1800-L1803 |
ksclarke/vertx-pairtree | src/main/java/info/freelibrary/pairtree/s3/S3ClientRequest.java | S3ClientRequest.b64SignHmacSha1 | private static String b64SignHmacSha1(final String aAwsSecretKey, final String aCanonicalString)
throws NoSuchAlgorithmException, InvalidKeyException {
final SecretKeySpec signingKey = new SecretKeySpec(aAwsSecretKey.getBytes(), HASH_CODE);
final Mac mac = Mac.getInstance(HASH_CODE);
... | java | private static String b64SignHmacSha1(final String aAwsSecretKey, final String aCanonicalString)
throws NoSuchAlgorithmException, InvalidKeyException {
final SecretKeySpec signingKey = new SecretKeySpec(aAwsSecretKey.getBytes(), HASH_CODE);
final Mac mac = Mac.getInstance(HASH_CODE);
... | [
"private",
"static",
"String",
"b64SignHmacSha1",
"(",
"final",
"String",
"aAwsSecretKey",
",",
"final",
"String",
"aCanonicalString",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeyException",
"{",
"final",
"SecretKeySpec",
"signingKey",
"=",
"new",
"Secret... | Returns a Base64 HmacSha1 signature.
@param aAwsSecretKey An AWS secret key
@param aCanonicalString A canonical string to encode
@return A Base64 HmacSha1 signature
@throws NoSuchAlgorithmException If the system doesn't support the encoding algorithm
@throws InvalidKeyException If the supplied AWS secret key is invali... | [
"Returns",
"a",
"Base64",
"HmacSha1",
"signature",
"."
] | train | https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/s3/S3ClientRequest.java#L434-L442 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java | WebSocketService.setChannels | public void setChannels(String uri, Set<WebSocketChannel> channels) {
Objects.requireNonNull(uri, Required.URI.toString());
Objects.requireNonNull(channels, Required.URI_CONNECTIONS.toString());
this.cache.put(Default.WSS_CACHE_PREFIX.toString() + uri, channels);
} | java | public void setChannels(String uri, Set<WebSocketChannel> channels) {
Objects.requireNonNull(uri, Required.URI.toString());
Objects.requireNonNull(channels, Required.URI_CONNECTIONS.toString());
this.cache.put(Default.WSS_CACHE_PREFIX.toString() + uri, channels);
} | [
"public",
"void",
"setChannels",
"(",
"String",
"uri",
",",
"Set",
"<",
"WebSocketChannel",
">",
"channels",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"uri",
",",
"Required",
".",
"URI",
".",
"toString",
"(",
")",
")",
";",
"Objects",
".",
"requir... | Sets the URI resources for a given URL
@param uri The URI resource for the connection
@param channels The channels for the URI resource | [
"Sets",
"the",
"URI",
"resources",
"for",
"a",
"given",
"URL"
] | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/services/WebSocketService.java#L60-L65 |
jenkinsci/jenkins | core/src/main/java/hudson/scm/SCM.java | SCM.buildEnvironment | public void buildEnvironment(@Nonnull Run<?,?> build, @Nonnull Map<String,String> env) {
if (build instanceof AbstractBuild) {
buildEnvVars((AbstractBuild)build, env);
}
} | java | public void buildEnvironment(@Nonnull Run<?,?> build, @Nonnull Map<String,String> env) {
if (build instanceof AbstractBuild) {
buildEnvVars((AbstractBuild)build, env);
}
} | [
"public",
"void",
"buildEnvironment",
"(",
"@",
"Nonnull",
"Run",
"<",
"?",
",",
"?",
">",
"build",
",",
"@",
"Nonnull",
"Map",
"<",
"String",
",",
"String",
">",
"env",
")",
"{",
"if",
"(",
"build",
"instanceof",
"AbstractBuild",
")",
"{",
"buildEnvVa... | Adds environmental variables for the builds to the given map.
<p>
This can be used to propagate information from SCM to builds
(for example, SVN revision number.)
<p>
This method is invoked whenever someone does {@link AbstractBuild#getEnvironment(TaskListener)}, via
{@link #buildEnvVars(AbstractBuild, Map)}, which c... | [
"Adds",
"environmental",
"variables",
"for",
"the",
"builds",
"to",
"the",
"given",
"map",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/scm/SCM.java#L541-L545 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/TypeUtil.java | TypeUtil.defaultIfNotInteger | public static int defaultIfNotInteger(String _possibleInt, int _default) {
if (isInteger(_possibleInt)) {
return Integer.parseInt(_possibleInt);
}
return _default;
} | java | public static int defaultIfNotInteger(String _possibleInt, int _default) {
if (isInteger(_possibleInt)) {
return Integer.parseInt(_possibleInt);
}
return _default;
} | [
"public",
"static",
"int",
"defaultIfNotInteger",
"(",
"String",
"_possibleInt",
",",
"int",
"_default",
")",
"{",
"if",
"(",
"isInteger",
"(",
"_possibleInt",
")",
")",
"{",
"return",
"Integer",
".",
"parseInt",
"(",
"_possibleInt",
")",
";",
"}",
"return",... | Returns integer converted from string or default if string could not be converted to int.
@param _possibleInt string to convert
@param _default default to use if string cannot be converted
@return int | [
"Returns",
"integer",
"converted",
"from",
"string",
"or",
"default",
"if",
"string",
"could",
"not",
"be",
"converted",
"to",
"int",
"."
] | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/TypeUtil.java#L367-L372 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.injectBeanMethod | @Internal
@SuppressWarnings("WeakerAccess")
protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean) {
MethodInjectionPoint methodInjectionPoint = methodInjectionPoints.get(methodIndex);
Argument[] methodArgumentTypes = me... | java | @Internal
@SuppressWarnings("WeakerAccess")
protected void injectBeanMethod(BeanResolutionContext resolutionContext, DefaultBeanContext context, int methodIndex, Object bean) {
MethodInjectionPoint methodInjectionPoint = methodInjectionPoints.get(methodIndex);
Argument[] methodArgumentTypes = me... | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"protected",
"void",
"injectBeanMethod",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"DefaultBeanContext",
"context",
",",
"int",
"methodIndex",
",",
"Object",
"bean",
")",
"{",
"Metho... | Inject a bean method that requires reflection.
@param resolutionContext The resolution context
@param context The bean context
@param methodIndex The method index
@param bean The bean | [
"Inject",
"a",
"bean",
"method",
"that",
"requires",
"reflection",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L682-L696 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/DefaultReentrantTypeResolver.java | DefaultReentrantTypeResolver.getInvalidWritableVariableAccessMessage | protected String getInvalidWritableVariableAccessMessage(XVariableDeclaration variable, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes) {
// TODO this should be part of a separate validation service
XClosure containingClosure = EcoreUtil2.getContainerOfType(featureCall, XClosure.class);
if (contai... | java | protected String getInvalidWritableVariableAccessMessage(XVariableDeclaration variable, XAbstractFeatureCall featureCall, IResolvedTypes resolvedTypes) {
// TODO this should be part of a separate validation service
XClosure containingClosure = EcoreUtil2.getContainerOfType(featureCall, XClosure.class);
if (contai... | [
"protected",
"String",
"getInvalidWritableVariableAccessMessage",
"(",
"XVariableDeclaration",
"variable",
",",
"XAbstractFeatureCall",
"featureCall",
",",
"IResolvedTypes",
"resolvedTypes",
")",
"{",
"// TODO this should be part of a separate validation service",
"XClosure",
"contai... | Provide the error message for mutable variables that may not be captured in lambdas.
@param variable the writable variable declaration
@param featureCall the reference to the variable
@param resolvedTypes type information | [
"Provide",
"the",
"error",
"message",
"for",
"mutable",
"variables",
"that",
"may",
"not",
"be",
"captured",
"in",
"lambdas",
"."
] | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/internal/DefaultReentrantTypeResolver.java#L208-L215 |
apiman/apiman | gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java | ESRegistry.lookupClient | @SuppressWarnings("nls") // Do beans need escaping or will that be done 'automatically'. Test it. Strings do, but probably only quotes?
private Client lookupClient(String orgId, String clientId, String version) {
String query = "{" +
" \"query\": {" +
" \"bool\": {" +... | java | @SuppressWarnings("nls") // Do beans need escaping or will that be done 'automatically'. Test it. Strings do, but probably only quotes?
private Client lookupClient(String orgId, String clientId, String version) {
String query = "{" +
" \"query\": {" +
" \"bool\": {" +... | [
"@",
"SuppressWarnings",
"(",
"\"nls\"",
")",
"// Do beans need escaping or will that be done 'automatically'. Test it. Strings do, but probably only quotes?",
"private",
"Client",
"lookupClient",
"(",
"String",
"orgId",
",",
"String",
"clientId",
",",
"String",
"version",
")",
... | Searches for a client by its orgid:clientId:version and returns it.
@param orgId
@param clientId
@param version | [
"Searches",
"for",
"a",
"client",
"by",
"its",
"orgid",
":",
"clientId",
":",
"version",
"and",
"returns",
"it",
"."
] | train | https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/es/src/main/java/io/apiman/gateway/engine/es/ESRegistry.java#L207-L250 |
SonarSource/sonarqube | server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java | PermissionTemplateService.applyDefault | public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
PermissionTemplateDto template = findTemplate(dbSession, component);
checkArgument(template != null, "Cannot retrieve default permission template");
copyPermissions(dbSession, template, component,... | java | public void applyDefault(DbSession dbSession, ComponentDto component, @Nullable Integer projectCreatorUserId) {
PermissionTemplateDto template = findTemplate(dbSession, component);
checkArgument(template != null, "Cannot retrieve default permission template");
copyPermissions(dbSession, template, component,... | [
"public",
"void",
"applyDefault",
"(",
"DbSession",
"dbSession",
",",
"ComponentDto",
"component",
",",
"@",
"Nullable",
"Integer",
"projectCreatorUserId",
")",
"{",
"PermissionTemplateDto",
"template",
"=",
"findTemplate",
"(",
"dbSession",
",",
"component",
")",
"... | Apply the default permission template to project. The project can already exist (so it has permissions) or
can be provisioned (so has no permissions yet).
@param projectCreatorUserId id of the user who creates the project, only if project is provisioned. He will | [
"Apply",
"the",
"default",
"permission",
"template",
"to",
"project",
".",
"The",
"project",
"can",
"already",
"exist",
"(",
"so",
"it",
"has",
"permissions",
")",
"or",
"can",
"be",
"provisioned",
"(",
"so",
"has",
"no",
"permissions",
"yet",
")",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/permission/PermissionTemplateService.java#L108-L112 |
Stratio/stratio-cassandra | src/java/com/stratio/cassandra/util/JsonSerializer.java | JsonSerializer.fromString | public static <T> T fromString(String value, Class<T> valueType) throws IOException {
return jsonMapper.readValue(value, valueType);
} | java | public static <T> T fromString(String value, Class<T> valueType) throws IOException {
return jsonMapper.readValue(value, valueType);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromString",
"(",
"String",
"value",
",",
"Class",
"<",
"T",
">",
"valueType",
")",
"throws",
"IOException",
"{",
"return",
"jsonMapper",
".",
"readValue",
"(",
"value",
",",
"valueType",
")",
";",
"}"
] | Returns the object of the specified class represented by the specified JSON {@code String}.
@param value A JSON {@code String} to be parsed.
@param valueType The class of the object to be parsed.
@param <T> The type of the object to be parsed.
@return The object of the specified class represented by the spec... | [
"Returns",
"the",
"object",
"of",
"the",
"specified",
"class",
"represented",
"by",
"the",
"specified",
"JSON",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/com/stratio/cassandra/util/JsonSerializer.java#L69-L71 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterSkills | public void getCharacterSkills(String API, String name, Callback<CharacterSkills> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterSkills(name, API).enqueue(callback);
} | java | public void getCharacterSkills(String API, String name, Callback<CharacterSkills> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterSkills(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacterSkills",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"CharacterSkills",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
... | For more info on Character Skills API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Skills">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param API API key
@param name character... | [
"For",
"more",
"info",
"on",
"Character",
"Skills",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters#Skills",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">"... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L829-L832 |
zeromq/jeromq | src/main/java/org/zeromq/ZMsg.java | ZMsg.recvMsg | @Draft
public static void recvMsg(ZMQ.Socket socket, int flags, Consumer<ZMsg> handler)
{
handler.accept(ZMsg.recvMsg(socket, flags));
} | java | @Draft
public static void recvMsg(ZMQ.Socket socket, int flags, Consumer<ZMsg> handler)
{
handler.accept(ZMsg.recvMsg(socket, flags));
} | [
"@",
"Draft",
"public",
"static",
"void",
"recvMsg",
"(",
"ZMQ",
".",
"Socket",
"socket",
",",
"int",
"flags",
",",
"Consumer",
"<",
"ZMsg",
">",
"handler",
")",
"{",
"handler",
".",
"accept",
"(",
"ZMsg",
".",
"recvMsg",
"(",
"socket",
",",
"flags",
... | This API is in DRAFT state and is subject to change at ANY time until declared stable
handle incoming message with a handler
@param socket
@param flags see ZMQ constants
@param handler handler to handle incoming message | [
"This",
"API",
"is",
"in",
"DRAFT",
"state",
"and",
"is",
"subject",
"to",
"change",
"at",
"ANY",
"time",
"until",
"declared",
"stable",
"handle",
"incoming",
"message",
"with",
"a",
"handler"
] | train | https://github.com/zeromq/jeromq/blob/8b4a2960b468d08b7aebb0d40bfb947e08fed040/src/main/java/org/zeromq/ZMsg.java#L286-L290 |
MKLab-ITI/multimedia-indexing | src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java | PCA.sampleToEigenSpace | public double[] sampleToEigenSpace(double[] sampleData) throws Exception {
if (!isPcaInitialized) {
// initiallize PCA correctly!
throw new Exception("PCA is not correctly initiallized!");
}
if (sampleData.length != sampleSize) {
throw new IllegalArgumentException("Unexpected vector length!");
}... | java | public double[] sampleToEigenSpace(double[] sampleData) throws Exception {
if (!isPcaInitialized) {
// initiallize PCA correctly!
throw new Exception("PCA is not correctly initiallized!");
}
if (sampleData.length != sampleSize) {
throw new IllegalArgumentException("Unexpected vector length!");
}... | [
"public",
"double",
"[",
"]",
"sampleToEigenSpace",
"(",
"double",
"[",
"]",
"sampleData",
")",
"throws",
"Exception",
"{",
"if",
"(",
"!",
"isPcaInitialized",
")",
"{",
"// initiallize PCA correctly!\r",
"throw",
"new",
"Exception",
"(",
"\"PCA is not correctly ini... | Converts a vector from sample space into eigen space. If {@link #doWhitening} is true, then the vector
is also L2 normalized after projection.
@param sampleData
Sample space vector
@return Eigen space projected vector
@throws Exception | [
"Converts",
"a",
"vector",
"from",
"sample",
"space",
"into",
"eigen",
"space",
".",
"If",
"{",
"@link",
"#doWhitening",
"}",
"is",
"true",
"then",
"the",
"vector",
"is",
"also",
"L2",
"normalized",
"after",
"projection",
"."
] | train | https://github.com/MKLab-ITI/multimedia-indexing/blob/f82e8e517da706651f4b7a719805401f3102e135/src/main/java/gr/iti/mklab/visual/dimreduction/PCA.java#L188-L208 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/conf/Configuration.java | Configuration.getLocalPath | public Path getLocalPath(String dirsProp, String path)
throws IOException {
String[] dirs = getStrings(dirsProp);
int hashCode = path.hashCode();
FileSystem fs = FileSystem.getLocal(this);
for (int i = 0; i < dirs.length; i++) { // try each local dir
int index = (hashCode+i & Integer.MAX_VALU... | java | public Path getLocalPath(String dirsProp, String path)
throws IOException {
String[] dirs = getStrings(dirsProp);
int hashCode = path.hashCode();
FileSystem fs = FileSystem.getLocal(this);
for (int i = 0; i < dirs.length; i++) { // try each local dir
int index = (hashCode+i & Integer.MAX_VALU... | [
"public",
"Path",
"getLocalPath",
"(",
"String",
"dirsProp",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"dirs",
"=",
"getStrings",
"(",
"dirsProp",
")",
";",
"int",
"hashCode",
"=",
"path",
".",
"hashCode",
"(",
")",
";... | Get a local file under a directory named by <i>dirsProp</i> with
the given <i>path</i>. If <i>dirsProp</i> contains multiple directories,
then one is chosen based on <i>path</i>'s hash code. If the selected
directory does not exist, an attempt is made to create it.
@param dirsProp directory in which to locate the fi... | [
"Get",
"a",
"local",
"file",
"under",
"a",
"directory",
"named",
"by",
"<i",
">",
"dirsProp<",
"/",
"i",
">",
"with",
"the",
"given",
"<i",
">",
"path<",
"/",
"i",
">",
".",
"If",
"<i",
">",
"dirsProp<",
"/",
"i",
">",
"contains",
"multiple",
"dire... | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/conf/Configuration.java#L961-L981 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_scheduler_serviceName_PUT | public void billingAccount_scheduler_serviceName_PUT(String billingAccount, String serviceName, OvhScheduler body) throws IOException {
String qPath = "/telephony/{billingAccount}/scheduler/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void billingAccount_scheduler_serviceName_PUT(String billingAccount, String serviceName, OvhScheduler body) throws IOException {
String qPath = "/telephony/{billingAccount}/scheduler/{serviceName}";
StringBuilder sb = path(qPath, billingAccount, serviceName);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"billingAccount_scheduler_serviceName_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"OvhScheduler",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/scheduler/{serviceName}\"",
";",... | Alter this object properties
REST: PUT /telephony/{billingAccount}/scheduler/{serviceName}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L546-L550 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GradientToEdgeFeatures.java | GradientToEdgeFeatures.nonMaxSuppression4 | static public GrayF32 nonMaxSuppression4(GrayF32 intensity , GrayS8 direction , GrayF32 output )
{
InputSanityCheck.checkSameShape(intensity,direction);
output = InputSanityCheck.checkDeclare(intensity,output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEdgeNonMaxSuppression_MT.inner4(intensity, direction, o... | java | static public GrayF32 nonMaxSuppression4(GrayF32 intensity , GrayS8 direction , GrayF32 output )
{
InputSanityCheck.checkSameShape(intensity,direction);
output = InputSanityCheck.checkDeclare(intensity,output);
if( BoofConcurrency.USE_CONCURRENT ) {
ImplEdgeNonMaxSuppression_MT.inner4(intensity, direction, o... | [
"static",
"public",
"GrayF32",
"nonMaxSuppression4",
"(",
"GrayF32",
"intensity",
",",
"GrayS8",
"direction",
",",
"GrayF32",
"output",
")",
"{",
"InputSanityCheck",
".",
"checkSameShape",
"(",
"intensity",
",",
"direction",
")",
";",
"output",
"=",
"InputSanityCh... | <p>
Sets edge intensities to zero if the pixel has an intensity which is less than either of
the two adjacent pixels. Pixel adjacency is determined by the gradients discretized direction.
</p>
@param intensity Edge intensities. Not modified.
@param direction 4-Discretized direction. See {@link #discretizeDirection4(... | [
"<p",
">",
"Sets",
"edge",
"intensities",
"to",
"zero",
"if",
"the",
"pixel",
"has",
"an",
"intensity",
"which",
"is",
"less",
"than",
"either",
"of",
"the",
"two",
"adjacent",
"pixels",
".",
"Pixel",
"adjacency",
"is",
"determined",
"by",
"the",
"gradient... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/feature/detect/edge/GradientToEdgeFeatures.java#L467-L481 |
fuinorg/units4j | src/main/java/org/fuin/units4j/Units4JUtils.java | Units4JUtils.classInfo | public static ClassInfo classInfo(final ClassLoader cl, final Class<?> clasz) {
return classInfo(cl, clasz.getName());
} | java | public static ClassInfo classInfo(final ClassLoader cl, final Class<?> clasz) {
return classInfo(cl, clasz.getName());
} | [
"public",
"static",
"ClassInfo",
"classInfo",
"(",
"final",
"ClassLoader",
"cl",
",",
"final",
"Class",
"<",
"?",
">",
"clasz",
")",
"{",
"return",
"classInfo",
"(",
"cl",
",",
"clasz",
".",
"getName",
"(",
")",
")",
";",
"}"
] | Loads a class and creates a Jandex class information for it.
@param cl
Class loader to use.
@param clasz
Class to load.
@return Jandex class information. | [
"Loads",
"a",
"class",
"and",
"creates",
"a",
"Jandex",
"class",
"information",
"for",
"it",
"."
] | train | https://github.com/fuinorg/units4j/blob/29383e30b0f9c246b309e734df9cc63dc5d5499e/src/main/java/org/fuin/units4j/Units4JUtils.java#L423-L425 |
ltearno/hexa.tools | hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/HtmlTableTemplate.java | HtmlTableTemplate.getCell | public static TableCellElement getCell( Element root, int column, int row )
{
TableSectionElement tbody = getTBodyElement( root );
TableRowElement tr = tbody.getChild( row ).cast();
TableCellElement td = tr.getChild( column ).cast();
return td;
} | java | public static TableCellElement getCell( Element root, int column, int row )
{
TableSectionElement tbody = getTBodyElement( root );
TableRowElement tr = tbody.getChild( row ).cast();
TableCellElement td = tr.getChild( column ).cast();
return td;
} | [
"public",
"static",
"TableCellElement",
"getCell",
"(",
"Element",
"root",
",",
"int",
"column",
",",
"int",
"row",
")",
"{",
"TableSectionElement",
"tbody",
"=",
"getTBodyElement",
"(",
"root",
")",
";",
"TableRowElement",
"tr",
"=",
"tbody",
".",
"getChild",... | Get the TD element
@param root
@param column
@param row
@return | [
"Get",
"the",
"TD",
"element"
] | train | https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.core/src/main/java/fr/lteconsulting/hexa/client/other/HtmlTableTemplate.java#L74-L82 |
stratosphere/stratosphere | stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/memorymanager/CheckedMemorySegment.java | CheckedMemorySegment.put | public final CheckedMemorySegment put(int index, byte b) {
if (index >= 0 && index < this.size) {
this.memory[this.offset + index] = b;
return this;
} else {
throw new IndexOutOfBoundsException();
}
} | java | public final CheckedMemorySegment put(int index, byte b) {
if (index >= 0 && index < this.size) {
this.memory[this.offset + index] = b;
return this;
} else {
throw new IndexOutOfBoundsException();
}
} | [
"public",
"final",
"CheckedMemorySegment",
"put",
"(",
"int",
"index",
",",
"byte",
"b",
")",
"{",
"if",
"(",
"index",
">=",
"0",
"&&",
"index",
"<",
"this",
".",
"size",
")",
"{",
"this",
".",
"memory",
"[",
"this",
".",
"offset",
"+",
"index",
"]... | Writes the given byte into this buffer at the given position.
@param position The position at which the byte will be written.
@param b The byte value to be written.
@return This view itself.
@throws IndexOutOfBoundsException Thrown, if the index is negative, or larger or equal to the size of
the memory segment. | [
"Writes",
"the",
"given",
"byte",
"into",
"this",
"buffer",
"at",
"the",
"given",
"position",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/services/memorymanager/CheckedMemorySegment.java#L186-L193 |
bazaarvoice/jersey-hmac-auth | common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java | AbstractAuthenticator.createSignature | private String createSignature(Credentials credentials, String secretKey) {
return new SignatureGenerator().generate(
secretKey,
credentials.getMethod(),
credentials.getTimestamp(),
credentials.getPath(),
credentials.getContent());
... | java | private String createSignature(Credentials credentials, String secretKey) {
return new SignatureGenerator().generate(
secretKey,
credentials.getMethod(),
credentials.getTimestamp(),
credentials.getPath(),
credentials.getContent());
... | [
"private",
"String",
"createSignature",
"(",
"Credentials",
"credentials",
",",
"String",
"secretKey",
")",
"{",
"return",
"new",
"SignatureGenerator",
"(",
")",
".",
"generate",
"(",
"secretKey",
",",
"credentials",
".",
"getMethod",
"(",
")",
",",
"credentials... | Create a signature given the set of request credentials and a secret key.
@param credentials the credentials specified on the request
@param secretKey the secret key that will be used to generate the signature
@return the signature | [
"Create",
"a",
"signature",
"given",
"the",
"set",
"of",
"request",
"credentials",
"and",
"a",
"secret",
"key",
"."
] | train | https://github.com/bazaarvoice/jersey-hmac-auth/blob/17e2a40a4b7b783de4d77ad97f8a623af6baf688/common/src/main/java/com/bazaarvoice/auth/hmac/server/AbstractAuthenticator.java#L130-L137 |
pmwmedia/tinylog | tinylog-impl/src/main/java/org/tinylog/pattern/FormatPatternParser.java | FormatPatternParser.createThreadContextToken | private static Token createThreadContextToken(final String configuration) {
if (configuration == null) {
InternalLogger.log(Level.ERROR, "\"{context}\" requires a key");
return new PlainTextToken("");
} else {
int splitIndex = configuration.indexOf(',');
String key = splitIndex == -1 ? configuration.tri... | java | private static Token createThreadContextToken(final String configuration) {
if (configuration == null) {
InternalLogger.log(Level.ERROR, "\"{context}\" requires a key");
return new PlainTextToken("");
} else {
int splitIndex = configuration.indexOf(',');
String key = splitIndex == -1 ? configuration.tri... | [
"private",
"static",
"Token",
"createThreadContextToken",
"(",
"final",
"String",
"configuration",
")",
"{",
"if",
"(",
"configuration",
"==",
"null",
")",
"{",
"InternalLogger",
".",
"log",
"(",
"Level",
".",
"ERROR",
",",
"\"\\\"{context}\\\" requires a key\"",
... | Creates a new {@link ThreadContextToken}.
@param configuration
Key and optional placeholder for empty values
@return New instance of {@link ThreadContextToken} or {@code null} if key is missing | [
"Creates",
"a",
"new",
"{",
"@link",
"ThreadContextToken",
"}",
"."
] | train | https://github.com/pmwmedia/tinylog/blob/d03d4ef84a1310155037e08ca8822a91697d1086/tinylog-impl/src/main/java/org/tinylog/pattern/FormatPatternParser.java#L191-L206 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneIconifyButtonPainter.java | TitlePaneIconifyButtonPainter.paintRestorePressed | private void paintRestorePressed(Graphics2D g, JComponent c, int width, int height) {
restorePainter.paintPressed(g, c, width, height);
} | java | private void paintRestorePressed(Graphics2D g, JComponent c, int width, int height) {
restorePainter.paintPressed(g, c, width, height);
} | [
"private",
"void",
"paintRestorePressed",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
")",
"{",
"restorePainter",
".",
"paintPressed",
"(",
"g",
",",
"c",
",",
"width",
",",
"height",
")",
";",
"}"
] | Paint the foreground restore button pressed state.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component. | [
"Paint",
"the",
"foreground",
"restore",
"button",
"pressed",
"state",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneIconifyButtonPainter.java#L231-L233 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitDocComment | @Override
public R visitDocComment(DocCommentTree node, P p) {
return defaultAction(node, p);
} | java | @Override
public R visitDocComment(DocCommentTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitDocComment",
"(",
"DocCommentTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L153-L156 |
cdk/cdk | misc/extra/src/main/java/org/openscience/cdk/geometry/AtomTools.java | AtomTools.calculate3DCoordinates0 | public static Point3d[] calculate3DCoordinates0(Point3d aPoint, int nwanted, double length) {
Point3d[] points;
if (nwanted == 1) {
points = new Point3d[1];
points[0] = new Point3d(aPoint);
points[0].add(new Vector3d(length, 0.0, 0.0));
} else if (nwanted == 2... | java | public static Point3d[] calculate3DCoordinates0(Point3d aPoint, int nwanted, double length) {
Point3d[] points;
if (nwanted == 1) {
points = new Point3d[1];
points[0] = new Point3d(aPoint);
points[0].add(new Vector3d(length, 0.0, 0.0));
} else if (nwanted == 2... | [
"public",
"static",
"Point3d",
"[",
"]",
"calculate3DCoordinates0",
"(",
"Point3d",
"aPoint",
",",
"int",
"nwanted",
",",
"double",
"length",
")",
"{",
"Point3d",
"[",
"]",
"points",
";",
"if",
"(",
"nwanted",
"==",
"1",
")",
"{",
"points",
"=",
"new",
... | Calculates substituent points.
Calculate substituent points for
(0) zero ligands of aPoint. The resultant points are randomly oriented:
(i) 1 points required; +x,0,0
(ii) 2 points: use +x,0,0 and -x,0,0
(iii) 3 points: equilateral triangle in xy plane
(iv) 4 points x,x,x, x,-x,-x, -x,x,-x, -x,-x,x where 3x**2 = bond l... | [
"Calculates",
"substituent",
"points",
".",
"Calculate",
"substituent",
"points",
"for",
"(",
"0",
")",
"zero",
"ligands",
"of",
"aPoint",
".",
"The",
"resultant",
"points",
"are",
"randomly",
"oriented",
":",
"(",
"i",
")",
"1",
"points",
"required",
";",
... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/geometry/AtomTools.java#L244-L278 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_secondaryDnsNameDomainToken_GET | public OvhSecondaryDNSCheckField serviceName_secondaryDnsNameDomainToken_GET(String serviceName, String domain) throws IOException {
String qPath = "/dedicated/server/{serviceName}/secondaryDnsNameDomainToken";
StringBuilder sb = path(qPath, serviceName);
query(sb, "domain", domain);
String resp = exec(qPath, "... | java | public OvhSecondaryDNSCheckField serviceName_secondaryDnsNameDomainToken_GET(String serviceName, String domain) throws IOException {
String qPath = "/dedicated/server/{serviceName}/secondaryDnsNameDomainToken";
StringBuilder sb = path(qPath, serviceName);
query(sb, "domain", domain);
String resp = exec(qPath, "... | [
"public",
"OvhSecondaryDNSCheckField",
"serviceName_secondaryDnsNameDomainToken_GET",
"(",
"String",
"serviceName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/secondaryDnsNameDomainToken\"",
";",
"StringB... | DNS field to temporarily add to your zone so that we can verify you are the owner of this domain
REST: GET /dedicated/server/{serviceName}/secondaryDnsNameDomainToken
@param domain [required] The domain to check
@param serviceName [required] The internal name of your dedicated server | [
"DNS",
"field",
"to",
"temporarily",
"add",
"to",
"your",
"zone",
"so",
"that",
"we",
"can",
"verify",
"you",
"are",
"the",
"owner",
"of",
"this",
"domain"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1843-L1849 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.evaluatesToLocalValue | static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) {
switch (value.getToken()) {
case ASSIGN:
// A result that is aliased by a non-local name, is the effectively the
// same as returning a non-local name, but this doesn't matter if the
// value is immutable.
... | java | static boolean evaluatesToLocalValue(Node value, Predicate<Node> locals) {
switch (value.getToken()) {
case ASSIGN:
// A result that is aliased by a non-local name, is the effectively the
// same as returning a non-local name, but this doesn't matter if the
// value is immutable.
... | [
"static",
"boolean",
"evaluatesToLocalValue",
"(",
"Node",
"value",
",",
"Predicate",
"<",
"Node",
">",
"locals",
")",
"{",
"switch",
"(",
"value",
".",
"getToken",
"(",
")",
")",
"{",
"case",
"ASSIGN",
":",
"// A result that is aliased by a non-local name, is the... | @param locals A predicate to apply to unknown local values.
@return Whether the result of the expression node is known to be a primitive value
or an object that has not yet escaped. This guarantee is different
than that provided by isLiteralValue (where literal values are immune to side-effects
if unescaped) or isImmu... | [
"@param",
"locals",
"A",
"predicate",
"to",
"apply",
"to",
"unknown",
"local",
"values",
".",
"@return",
"Whether",
"the",
"result",
"of",
"the",
"expression",
"node",
"is",
"known",
"to",
"be",
"a",
"primitive",
"value",
"or",
"an",
"object",
"that",
"has... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L5050-L5117 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java | PoolsImpl.getAsync | public Observable<CloudPool> getAsync(String poolId, PoolGetOptions poolGetOptions) {
return getWithServiceResponseAsync(poolId, poolGetOptions).map(new Func1<ServiceResponseWithHeaders<CloudPool, PoolGetHeaders>, CloudPool>() {
@Override
public CloudPool call(ServiceResponseWithHeaders<... | java | public Observable<CloudPool> getAsync(String poolId, PoolGetOptions poolGetOptions) {
return getWithServiceResponseAsync(poolId, poolGetOptions).map(new Func1<ServiceResponseWithHeaders<CloudPool, PoolGetHeaders>, CloudPool>() {
@Override
public CloudPool call(ServiceResponseWithHeaders<... | [
"public",
"Observable",
"<",
"CloudPool",
">",
"getAsync",
"(",
"String",
"poolId",
",",
"PoolGetOptions",
"poolGetOptions",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"poolId",
",",
"poolGetOptions",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"Serv... | Gets information about the specified pool.
@param poolId The ID of the pool to get.
@param poolGetOptions Additional parameters for the operation
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the CloudPool object | [
"Gets",
"information",
"about",
"the",
"specified",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/PoolsImpl.java#L1721-L1728 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java | ImageModerationsImpl.evaluateFileInputAsync | public Observable<Evaluate> evaluateFileInputAsync(byte[] imageStream, EvaluateFileInputOptionalParameter evaluateFileInputOptionalParameter) {
return evaluateFileInputWithServiceResponseAsync(imageStream, evaluateFileInputOptionalParameter).map(new Func1<ServiceResponse<Evaluate>, Evaluate>() {
@Ov... | java | public Observable<Evaluate> evaluateFileInputAsync(byte[] imageStream, EvaluateFileInputOptionalParameter evaluateFileInputOptionalParameter) {
return evaluateFileInputWithServiceResponseAsync(imageStream, evaluateFileInputOptionalParameter).map(new Func1<ServiceResponse<Evaluate>, Evaluate>() {
@Ov... | [
"public",
"Observable",
"<",
"Evaluate",
">",
"evaluateFileInputAsync",
"(",
"byte",
"[",
"]",
"imageStream",
",",
"EvaluateFileInputOptionalParameter",
"evaluateFileInputOptionalParameter",
")",
"{",
"return",
"evaluateFileInputWithServiceResponseAsync",
"(",
"imageStream",
... | Returns probabilities of the image containing racy or adult content.
@param imageStream The image file.
@param evaluateFileInputOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation
@return the obser... | [
"Returns",
"probabilities",
"of",
"the",
"image",
"containing",
"racy",
"or",
"adult",
"content",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ImageModerationsImpl.java#L1451-L1458 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMaterial.java | GVRMaterial.setSpecularColor | public void setSpecularColor(float r, float g, float b, float a) {
setVec4("specular_color", r, g, b, a);
} | java | public void setSpecularColor(float r, float g, float b, float a) {
setVec4("specular_color", r, g, b, a);
} | [
"public",
"void",
"setSpecularColor",
"(",
"float",
"r",
",",
"float",
"g",
",",
"float",
"b",
",",
"float",
"a",
")",
"{",
"setVec4",
"(",
"\"specular_color\"",
",",
"r",
",",
"g",
",",
"b",
",",
"a",
")",
";",
"}"
] | Set the {@code specular_color} uniform for lighting.
By convention, GVRF shaders can use a {@code vec4} uniform named
{@code specular_color}. With the {@linkplain GVRShaderType.Texture
hader,} this allows you to add an overlay specular light color on
top of the texture. Values are between {@code 0.0f} and {@code 1.0f}... | [
"Set",
"the",
"{",
"@code",
"specular_color",
"}",
"uniform",
"for",
"lighting",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRMaterial.java#L483-L485 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/FsJobStatusRetriever.java | FsJobStatusRetriever.shouldFilterJobStatus | private boolean shouldFilterJobStatus(List<String> tableNames, String tableName) {
return tableNames.size() > 1 && JobStatusRetriever.NA_KEY
.equals(Splitter.on(KafkaJobStatusMonitor.STATE_STORE_KEY_SEPARATION_CHARACTER).splitToList(tableName).get(1));
} | java | private boolean shouldFilterJobStatus(List<String> tableNames, String tableName) {
return tableNames.size() > 1 && JobStatusRetriever.NA_KEY
.equals(Splitter.on(KafkaJobStatusMonitor.STATE_STORE_KEY_SEPARATION_CHARACTER).splitToList(tableName).get(1));
} | [
"private",
"boolean",
"shouldFilterJobStatus",
"(",
"List",
"<",
"String",
">",
"tableNames",
",",
"String",
"tableName",
")",
"{",
"return",
"tableNames",
".",
"size",
"(",
")",
">",
"1",
"&&",
"JobStatusRetriever",
".",
"NA_KEY",
".",
"equals",
"(",
"Split... | A helper method to determine if {@link JobStatus}es for jobs without a jobGroup/jobName should be filtered out.
Once a job has been orchestrated, {@link JobStatus}es without a jobGroup/jobName can be filtered out.
@param tableNames
@param tableName
@return | [
"A",
"helper",
"method",
"to",
"determine",
"if",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/monitoring/FsJobStatusRetriever.java#L142-L145 |
apache/incubator-druid | server/src/main/java/org/apache/druid/segment/realtime/plumber/RealtimePlumber.java | RealtimePlumber.abandonSegment | protected void abandonSegment(final long truncatedTime, final Sink sink)
{
if (sinks.containsKey(truncatedTime)) {
try {
segmentAnnouncer.unannounceSegment(sink.getSegment());
removeSegment(sink, computePersistDir(schema, sink.getInterval()));
log.info("Removing sinkKey %d for segmen... | java | protected void abandonSegment(final long truncatedTime, final Sink sink)
{
if (sinks.containsKey(truncatedTime)) {
try {
segmentAnnouncer.unannounceSegment(sink.getSegment());
removeSegment(sink, computePersistDir(schema, sink.getInterval()));
log.info("Removing sinkKey %d for segmen... | [
"protected",
"void",
"abandonSegment",
"(",
"final",
"long",
"truncatedTime",
",",
"final",
"Sink",
"sink",
")",
"{",
"if",
"(",
"sinks",
".",
"containsKey",
"(",
"truncatedTime",
")",
")",
"{",
"try",
"{",
"segmentAnnouncer",
".",
"unannounceSegment",
"(",
... | Unannounces a given sink and removes all local references to it. It is important that this is only called
from the single-threaded mergeExecutor, since otherwise chaos may ensue if merged segments are deleted while
being created.
@param truncatedTime sink key
@param sink sink to unannounce | [
"Unannounces",
"a",
"given",
"sink",
"and",
"removes",
"all",
"local",
"references",
"to",
"it",
".",
"It",
"is",
"important",
"that",
"this",
"is",
"only",
"called",
"from",
"the",
"single",
"-",
"threaded",
"mergeExecutor",
"since",
"otherwise",
"chaos",
"... | train | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/segment/realtime/plumber/RealtimePlumber.java#L872-L900 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/StreamHandler.java | StreamHandler.setOutputStream | protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
if (out == null) {
throw new NullPointerException();
}
flushAndClose();
output = out;
doneHeader = false;
String encoding = getEncoding();
if (encoding == null) {
... | java | protected synchronized void setOutputStream(OutputStream out) throws SecurityException {
if (out == null) {
throw new NullPointerException();
}
flushAndClose();
output = out;
doneHeader = false;
String encoding = getEncoding();
if (encoding == null) {
... | [
"protected",
"synchronized",
"void",
"setOutputStream",
"(",
"OutputStream",
"out",
")",
"throws",
"SecurityException",
"{",
"if",
"(",
"out",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"flushAndClose",
"(",
")",
";",
... | Change the output stream.
<P>
If there is a current output stream then the <tt>Formatter</tt>'s
tail string is written and the stream is flushed and closed.
Then the output stream is replaced with the new output stream.
@param out New output stream. May not be null.
@exception SecurityException if a security mana... | [
"Change",
"the",
"output",
"stream",
".",
"<P",
">",
"If",
"there",
"is",
"a",
"current",
"output",
"stream",
"then",
"the",
"<tt",
">",
"Formatter<",
"/",
"tt",
">",
"s",
"tail",
"string",
"is",
"written",
"and",
"the",
"stream",
"is",
"flushed",
"and... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/StreamHandler.java#L137-L156 |
Alluxio/alluxio | underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUnderFileSystem.java | S3AUnderFileSystem.getPermissionsInternal | private ObjectPermissions getPermissionsInternal() {
short bucketMode =
ModeUtils.getUMask(mUfsConf.get(PropertyKey.UNDERFS_S3A_DEFAULT_MODE)).toShort();
String accountOwner = DEFAULT_OWNER;
// if ACL enabled try to inherit bucket acl for all the objects.
if (Boolean.parseBoolean(mConf.get(Prop... | java | private ObjectPermissions getPermissionsInternal() {
short bucketMode =
ModeUtils.getUMask(mUfsConf.get(PropertyKey.UNDERFS_S3A_DEFAULT_MODE)).toShort();
String accountOwner = DEFAULT_OWNER;
// if ACL enabled try to inherit bucket acl for all the objects.
if (Boolean.parseBoolean(mConf.get(Prop... | [
"private",
"ObjectPermissions",
"getPermissionsInternal",
"(",
")",
"{",
"short",
"bucketMode",
"=",
"ModeUtils",
".",
"getUMask",
"(",
"mUfsConf",
".",
"get",
"(",
"PropertyKey",
".",
"UNDERFS_S3A_DEFAULT_MODE",
")",
")",
".",
"toShort",
"(",
")",
";",
"String"... | Since there is no group in S3 acl, the owner is reused as the group. This method calls the
S3 API and requires additional permissions aside from just read only. This method is best
effort and will continue with default permissions (no owner, no group, 0700).
@return the permissions associated with this under storage s... | [
"Since",
"there",
"is",
"no",
"group",
"in",
"S3",
"acl",
"the",
"owner",
"is",
"reused",
"as",
"the",
"group",
".",
"This",
"method",
"calls",
"the",
"S3",
"API",
"and",
"requires",
"additional",
"permissions",
"aside",
"from",
"just",
"read",
"only",
"... | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/underfs/s3a/src/main/java/alluxio/underfs/s3a/S3AUnderFileSystem.java#L564-L589 |
rhuss/jolokia | agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java | HttpRequestHandler.getErrorJSON | public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("status",pErrorCode);
jsonObject.put("error",getExceptionMessage(pExp));
jsonObject.put("error_type", pExp.getClass().getName());
addError... | java | public JSONObject getErrorJSON(int pErrorCode, Throwable pExp, JmxRequest pJmxReq) {
JSONObject jsonObject = new JSONObject();
jsonObject.put("status",pErrorCode);
jsonObject.put("error",getExceptionMessage(pExp));
jsonObject.put("error_type", pExp.getClass().getName());
addError... | [
"public",
"JSONObject",
"getErrorJSON",
"(",
"int",
"pErrorCode",
",",
"Throwable",
"pExp",
",",
"JmxRequest",
"pJmxReq",
")",
"{",
"JSONObject",
"jsonObject",
"=",
"new",
"JSONObject",
"(",
")",
";",
"jsonObject",
".",
"put",
"(",
"\"status\"",
",",
"pErrorCo... | Get the JSON representation for a an exception
@param pErrorCode the HTTP error code to return
@param pExp the exception or error occured
@param pJmxReq request from where to get processing options
@return the json representation | [
"Get",
"the",
"JSON",
"representation",
"for",
"a",
"an",
"exception"
] | train | https://github.com/rhuss/jolokia/blob/dc95e7bef859b1829776c5a84c8f7738f5d7d9c3/agent/core/src/main/java/org/jolokia/http/HttpRequestHandler.java#L258-L271 |
logic-ng/LogicNG | src/main/java/org/logicng/backbones/BackboneGeneration.java | BackboneGeneration.computePositive | public static Backbone computePositive(final Formula formula, final Collection<Variable> variables) {
return compute(formula, variables, BackboneType.ONLY_POSITIVE);
} | java | public static Backbone computePositive(final Formula formula, final Collection<Variable> variables) {
return compute(formula, variables, BackboneType.ONLY_POSITIVE);
} | [
"public",
"static",
"Backbone",
"computePositive",
"(",
"final",
"Formula",
"formula",
",",
"final",
"Collection",
"<",
"Variable",
">",
"variables",
")",
"{",
"return",
"compute",
"(",
"formula",
",",
"variables",
",",
"BackboneType",
".",
"ONLY_POSITIVE",
")",... | Computes the positive backbone allVariablesInFormulas for a given formula w.r.t. a collection of variables.
@param formula the given formula
@param variables the given collection of relevant variables for the backbone computation
@return the positive backbone or {@code null} if the formula is UNSAT | [
"Computes",
"the",
"positive",
"backbone",
"allVariablesInFormulas",
"for",
"a",
"given",
"formula",
"w",
".",
"r",
".",
"t",
".",
"a",
"collection",
"of",
"variables",
"."
] | train | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/backbones/BackboneGeneration.java#L183-L185 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLStreamHandler.java | URLStreamHandler.hostsEqual | protected boolean hostsEqual(URL u1, URL u2) {
// Android-changed: Don't compare the InetAddresses of the hosts.
if (u1.getHost() != null && u2.getHost() != null)
return u1.getHost().equalsIgnoreCase(u2.getHost());
else
return u1.getHost() == null && u2.getHost() == null... | java | protected boolean hostsEqual(URL u1, URL u2) {
// Android-changed: Don't compare the InetAddresses of the hosts.
if (u1.getHost() != null && u2.getHost() != null)
return u1.getHost().equalsIgnoreCase(u2.getHost());
else
return u1.getHost() == null && u2.getHost() == null... | [
"protected",
"boolean",
"hostsEqual",
"(",
"URL",
"u1",
",",
"URL",
"u2",
")",
"{",
"// Android-changed: Don't compare the InetAddresses of the hosts.",
"if",
"(",
"u1",
".",
"getHost",
"(",
")",
"!=",
"null",
"&&",
"u2",
".",
"getHost",
"(",
")",
"!=",
"null"... | Compares the host components of two URLs.
@param u1 the URL of the first host to compare
@param u2 the URL of the second host to compare
@return {@code true} if and only if they
are equal, {@code false} otherwise.
@since 1.3 | [
"Compares",
"the",
"host",
"components",
"of",
"two",
"URLs",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/URLStreamHandler.java#L482-L488 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/form/CmsBasicFormField.java | CmsBasicFormField.createField | public static CmsBasicFormField createField(
CmsXmlContentProperty propertyConfig,
String fieldId,
I_CmsFormWidgetMultiFactory factory,
Map<String, String> additionalParams,
boolean alwaysAllowEmpty) {
String widgetConfigStr = propertyConfig.getWidgetConfiguration();
... | java | public static CmsBasicFormField createField(
CmsXmlContentProperty propertyConfig,
String fieldId,
I_CmsFormWidgetMultiFactory factory,
Map<String, String> additionalParams,
boolean alwaysAllowEmpty) {
String widgetConfigStr = propertyConfig.getWidgetConfiguration();
... | [
"public",
"static",
"CmsBasicFormField",
"createField",
"(",
"CmsXmlContentProperty",
"propertyConfig",
",",
"String",
"fieldId",
",",
"I_CmsFormWidgetMultiFactory",
"factory",
",",
"Map",
"<",
"String",
",",
"String",
">",
"additionalParams",
",",
"boolean",
"alwaysAll... | Utility method for creating a single basic form field from an id and a property configuration.
@param propertyConfig the configuration of the property
@param fieldId the field id
@param factory a factory for creating form widgets
@param additionalParams additional field parameters
@param alwaysAllowEmpty indicates an... | [
"Utility",
"method",
"for",
"creating",
"a",
"single",
"basic",
"form",
"field",
"from",
"an",
"id",
"and",
"a",
"property",
"configuration",
"."
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/form/CmsBasicFormField.java#L148-L188 |
GCRC/nunaliit | nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/PropertiesWriter.java | PropertiesWriter.saveConvert | private String saveConvert(String theString, boolean escapeSpace) {
int len = theString.length();
int bufLen = len * 2;
if (bufLen < 0) {
bufLen = Integer.MAX_VALUE;
}
StringBuffer outBuffer = new StringBuffer(bufLen);
for (int x = 0; x < len; x++) {
char aChar = theString.charAt(x);
// Handle com... | java | private String saveConvert(String theString, boolean escapeSpace) {
int len = theString.length();
int bufLen = len * 2;
if (bufLen < 0) {
bufLen = Integer.MAX_VALUE;
}
StringBuffer outBuffer = new StringBuffer(bufLen);
for (int x = 0; x < len; x++) {
char aChar = theString.charAt(x);
// Handle com... | [
"private",
"String",
"saveConvert",
"(",
"String",
"theString",
",",
"boolean",
"escapeSpace",
")",
"{",
"int",
"len",
"=",
"theString",
".",
"length",
"(",
")",
";",
"int",
"bufLen",
"=",
"len",
"*",
"2",
";",
"if",
"(",
"bufLen",
"<",
"0",
")",
"{"... | /*
Converts unicodes to encoded \uxxxx and escapes special characters
with a preceding slash | [
"/",
"*",
"Converts",
"unicodes",
"to",
"encoded",
"\",
";",
"uxxxx",
"and",
"escapes",
"special",
"characters",
"with",
"a",
"preceding",
"slash"
] | train | https://github.com/GCRC/nunaliit/blob/0b4abfc64eef2eb8b94f852ce697de2e851d8e67/nunaliit2-utils/src/main/java/ca/carleton/gcrc/utils/PropertiesWriter.java#L66-L121 |
sahan/RoboZombie | robozombie/src/main/java/com/lonepulse/robozombie/util/Assert.java | Assert.assertValid | public static <T> T assertValid(T context, Validator<T> validator) {
assertNotNull(context);
if(validator != null) {
validator.validate(context);
}
return context;
} | java | public static <T> T assertValid(T context, Validator<T> validator) {
assertNotNull(context);
if(validator != null) {
validator.validate(context);
}
return context;
} | [
"public",
"static",
"<",
"T",
">",
"T",
"assertValid",
"(",
"T",
"context",
",",
"Validator",
"<",
"T",
">",
"validator",
")",
"{",
"assertNotNull",
"(",
"context",
")",
";",
"if",
"(",
"validator",
"!=",
"null",
")",
"{",
"validator",
".",
"validate",... | <p>Asserts that the given context is valid using the supplied {@link Validator} along with a few
other trivial validations such as a {@code null} check.</p>
@param context
the context to be validated using the given {@link Validator}
<br><br>
@param validator
the {@link Validator} to be used on the given context
<br><... | [
"<p",
">",
"Asserts",
"that",
"the",
"given",
"context",
"is",
"valid",
"using",
"the",
"supplied",
"{",
"@link",
"Validator",
"}",
"along",
"with",
"a",
"few",
"other",
"trivial",
"validations",
"such",
"as",
"a",
"{",
"@code",
"null",
"}",
"check",
"."... | train | https://github.com/sahan/RoboZombie/blob/2e02f0d41647612e9d89360c5c48811ea86b33c8/robozombie/src/main/java/com/lonepulse/robozombie/util/Assert.java#L295-L305 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/reteoo/builder/BuildUtils.java | BuildUtils.isSharingEnabledForNode | private boolean isSharingEnabledForNode(BuildContext context, BaseNode node) {
if ( NodeTypeEnums.isLeftTupleSource( node )) {
return context.getKnowledgeBase().getConfiguration().isShareBetaNodes();
} else if ( NodeTypeEnums.isObjectSource( node ) ) {
return context.getKnowledge... | java | private boolean isSharingEnabledForNode(BuildContext context, BaseNode node) {
if ( NodeTypeEnums.isLeftTupleSource( node )) {
return context.getKnowledgeBase().getConfiguration().isShareBetaNodes();
} else if ( NodeTypeEnums.isObjectSource( node ) ) {
return context.getKnowledge... | [
"private",
"boolean",
"isSharingEnabledForNode",
"(",
"BuildContext",
"context",
",",
"BaseNode",
"node",
")",
"{",
"if",
"(",
"NodeTypeEnums",
".",
"isLeftTupleSource",
"(",
"node",
")",
")",
"{",
"return",
"context",
".",
"getKnowledgeBase",
"(",
")",
".",
"... | Utility function to check if sharing is enabled for nodes of the given class | [
"Utility",
"function",
"to",
"check",
"if",
"sharing",
"is",
"enabled",
"for",
"nodes",
"of",
"the",
"given",
"class"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/reteoo/builder/BuildUtils.java#L185-L192 |
NessComputing/components-ness-jms | src/main/java/com/nesscomputing/jms/JmsRunnableFactory.java | JmsRunnableFactory.createQueueListener | public QueueConsumer createQueueListener(final String topic, final ConsumerCallback<Message> messageCallback)
{
Preconditions.checkState(connectionFactory != null, "connection factory was never injected!");
return new QueueConsumer(connectionFactory, jmsConfig, topic, messageCallback);
} | java | public QueueConsumer createQueueListener(final String topic, final ConsumerCallback<Message> messageCallback)
{
Preconditions.checkState(connectionFactory != null, "connection factory was never injected!");
return new QueueConsumer(connectionFactory, jmsConfig, topic, messageCallback);
} | [
"public",
"QueueConsumer",
"createQueueListener",
"(",
"final",
"String",
"topic",
",",
"final",
"ConsumerCallback",
"<",
"Message",
">",
"messageCallback",
")",
"{",
"Preconditions",
".",
"checkState",
"(",
"connectionFactory",
"!=",
"null",
",",
"\"connection factor... | Creates a new {@link QueueConsumer}. For every message received (or when the timeout waiting for messages is hit), the callback
is invoked with the message received. | [
"Creates",
"a",
"new",
"{"
] | train | https://github.com/NessComputing/components-ness-jms/blob/29e0d320ada3a1a375483437a9f3ff629822b714/src/main/java/com/nesscomputing/jms/JmsRunnableFactory.java#L134-L138 |
Azure/azure-sdk-for-java | iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java | AppsInner.beginCreateOrUpdateAsync | public Observable<AppInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner ca... | java | public Observable<AppInner> beginCreateOrUpdateAsync(String resourceGroupName, String resourceName, AppInner app) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, app).map(new Func1<ServiceResponse<AppInner>, AppInner>() {
@Override
public AppInner ca... | [
"public",
"Observable",
"<",
"AppInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"AppInner",
"app",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resource... | Create or update the metadata of an IoT Central application. The usual pattern to modify a property is to retrieve the IoT Central application metadata and security metadata, and then combine them with the modified values in a new body to update the IoT Central application.
@param resourceGroupName The name of the res... | [
"Create",
"or",
"update",
"the",
"metadata",
"of",
"an",
"IoT",
"Central",
"application",
".",
"The",
"usual",
"pattern",
"to",
"modify",
"a",
"property",
"is",
"to",
"retrieve",
"the",
"IoT",
"Central",
"application",
"metadata",
"and",
"security",
"metadata"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/iotcentral/resource-manager/v2017_07_01_privatepreview/src/main/java/com/microsoft/azure/management/iotcentral/v2017_07_01_privatepreview/implementation/AppsInner.java#L322-L329 |
waldheinz/fat32-lib | src/main/java/de/waldheinz/fs/fat/FatFile.java | FatFile.write | @Override
public void write(long offset, ByteBuffer srcBuf)
throws ReadOnlyException, IOException {
checkWritable();
updateTimeStamps(true);
final long lastByte = offset + srcBuf.remaining();
if (lastByte > getLength()) {
setLength(lastByte);
... | java | @Override
public void write(long offset, ByteBuffer srcBuf)
throws ReadOnlyException, IOException {
checkWritable();
updateTimeStamps(true);
final long lastByte = offset + srcBuf.remaining();
if (lastByte > getLength()) {
setLength(lastByte);
... | [
"@",
"Override",
"public",
"void",
"write",
"(",
"long",
"offset",
",",
"ByteBuffer",
"srcBuf",
")",
"throws",
"ReadOnlyException",
",",
"IOException",
"{",
"checkWritable",
"(",
")",
";",
"updateTimeStamps",
"(",
"true",
")",
";",
"final",
"long",
"lastByte",... | <p>
{@inheritDoc}
</p><p>
If the data to be written extends beyond the current
{@link #getLength() length} of this file, an attempt is made to
{@link #setLength(long) grow} the file so that the data will fit.
Additionally, this method updates the "last accessed" and "last modified"
fields on the directory entry that is... | [
"<p",
">",
"{",
"@inheritDoc",
"}",
"<",
"/",
"p",
">",
"<p",
">",
"If",
"the",
"data",
"to",
"be",
"written",
"extends",
"beyond",
"the",
"current",
"{",
"@link",
"#getLength",
"()",
"length",
"}",
"of",
"this",
"file",
"an",
"attempt",
"is",
"made"... | train | https://github.com/waldheinz/fat32-lib/blob/3d8f1a986339573576e02eb0b6ea49bfdc9cce26/src/main/java/de/waldheinz/fs/fat/FatFile.java#L145-L160 |
michael-rapp/AndroidMaterialDialog | library/src/main/java/de/mrapp/android/dialog/adapter/RecyclerViewAdapterWrapper.java | RecyclerViewAdapterWrapper.setItemChecked | public final void setItemChecked(final int position, final boolean checked) {
if (choiceMode.setItemChecked(position, checked)) {
notifyDataSetChanged();
if (checked && itemSelectedListener != null) {
itemSelectedListener.onItemSelected(position);
}
}... | java | public final void setItemChecked(final int position, final boolean checked) {
if (choiceMode.setItemChecked(position, checked)) {
notifyDataSetChanged();
if (checked && itemSelectedListener != null) {
itemSelectedListener.onItemSelected(position);
}
}... | [
"public",
"final",
"void",
"setItemChecked",
"(",
"final",
"int",
"position",
",",
"final",
"boolean",
"checked",
")",
"{",
"if",
"(",
"choiceMode",
".",
"setItemChecked",
"(",
"position",
",",
"checked",
")",
")",
"{",
"notifyDataSetChanged",
"(",
")",
";",... | Sets, whether the list item at a specific position should be selected, or not.
@param position
The position of the list item, whose selection state should be changed, as an {@link
Integer} value
@param checked
True, if the list item should be selected, false otherwise | [
"Sets",
"whether",
"the",
"list",
"item",
"at",
"a",
"specific",
"position",
"should",
"be",
"selected",
"or",
"not",
"."
] | train | https://github.com/michael-rapp/AndroidMaterialDialog/blob/8990eed72ee5f5a9720836ee708f71ac0d43053b/library/src/main/java/de/mrapp/android/dialog/adapter/RecyclerViewAdapterWrapper.java#L373-L381 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/MessagesApi.java | MessagesApi.getAggregatesHistogram | public AggregatesHistogramResponse getAggregatesHistogram(Long startDate, Long endDate, String sdid, String field, String interval) throws ApiException {
ApiResponse<AggregatesHistogramResponse> resp = getAggregatesHistogramWithHttpInfo(startDate, endDate, sdid, field, interval);
return resp.getData();
... | java | public AggregatesHistogramResponse getAggregatesHistogram(Long startDate, Long endDate, String sdid, String field, String interval) throws ApiException {
ApiResponse<AggregatesHistogramResponse> resp = getAggregatesHistogramWithHttpInfo(startDate, endDate, sdid, field, interval);
return resp.getData();
... | [
"public",
"AggregatesHistogramResponse",
"getAggregatesHistogram",
"(",
"Long",
"startDate",
",",
"Long",
"endDate",
",",
"String",
"sdid",
",",
"String",
"field",
",",
"String",
"interval",
")",
"throws",
"ApiException",
"{",
"ApiResponse",
"<",
"AggregatesHistogramR... | Get Normalized Message Histogram
Get Histogram on normalized messages.
@param startDate Timestamp of earliest message (in milliseconds since epoch). (required)
@param endDate Timestamp of latest message (in milliseconds since epoch). (required)
@param sdid Source device ID of the messages being searched. (optional)
@pa... | [
"Get",
"Normalized",
"Message",
"Histogram",
"Get",
"Histogram",
"on",
"normalized",
"messages",
"."
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/MessagesApi.java#L150-L153 |
Nexmo/nexmo-java | src/main/java/com/nexmo/client/account/AccountClient.java | AccountClient.getSecret | public SecretResponse getSecret(String apiKey, String secretId) throws IOException, NexmoClientException {
return getSecret(new SecretRequest(apiKey, secretId));
} | java | public SecretResponse getSecret(String apiKey, String secretId) throws IOException, NexmoClientException {
return getSecret(new SecretRequest(apiKey, secretId));
} | [
"public",
"SecretResponse",
"getSecret",
"(",
"String",
"apiKey",
",",
"String",
"secretId",
")",
"throws",
"IOException",
",",
"NexmoClientException",
"{",
"return",
"getSecret",
"(",
"new",
"SecretRequest",
"(",
"apiKey",
",",
"secretId",
")",
")",
";",
"}"
] | Get information for a specific secret id associated to a given API key.
@param apiKey The API key that the secret is associated to.
@param secretId The id of the secret to get information on.
@return SecretResponse object which contains the results from the API.
@throws IOException if a network error occu... | [
"Get",
"information",
"for",
"a",
"specific",
"secret",
"id",
"associated",
"to",
"a",
"given",
"API",
"key",
"."
] | train | https://github.com/Nexmo/nexmo-java/blob/7427eff6d6baa5a5bd9197fa096bcf2564191cf5/src/main/java/com/nexmo/client/account/AccountClient.java#L159-L161 |
milaboratory/milib | src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java | BandedLinearAligner.alignSemiLocalLeft | public static Alignment<NucleotideSequence> alignSemiLocalLeft(LinearGapAlignmentScoring scoring,
NucleotideSequence seq1, NucleotideSequence seq2,
int width, int stopPenalty) {
... | java | public static Alignment<NucleotideSequence> alignSemiLocalLeft(LinearGapAlignmentScoring scoring,
NucleotideSequence seq1, NucleotideSequence seq2,
int width, int stopPenalty) {
... | [
"public",
"static",
"Alignment",
"<",
"NucleotideSequence",
">",
"alignSemiLocalLeft",
"(",
"LinearGapAlignmentScoring",
"scoring",
",",
"NucleotideSequence",
"seq1",
",",
"NucleotideSequence",
"seq2",
",",
"int",
"width",
",",
"int",
"stopPenalty",
")",
"{",
"return"... | Alignment which identifies what is the highly similar part of the both sequences.
<p/>
<p>Alignment is done in the way that beginning of second sequences is aligned to beginning of first
sequence.</p>
<p/>
<p>Alignment terminates when score in banded alignment matrix reaches {@code stopPenalty} value.</p>
<p/>
<p>In ot... | [
"Alignment",
"which",
"identifies",
"what",
"is",
"the",
"highly",
"similar",
"part",
"of",
"the",
"both",
"sequences",
".",
"<p",
"/",
">",
"<p",
">",
"Alignment",
"is",
"done",
"in",
"the",
"way",
"that",
"beginning",
"of",
"second",
"sequences",
"is",
... | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/alignment/BandedLinearAligner.java#L699-L703 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/UnLockCommand.java | UnLockCommand.unLock | public Response unLock(Session session, String path, List<String> tokens)
{
try
{
try
{
Node node = (Node)session.getItem(path);
if (node.isLocked())
{
node.unlock();
session.save();
}
... | java | public Response unLock(Session session, String path, List<String> tokens)
{
try
{
try
{
Node node = (Node)session.getItem(path);
if (node.isLocked())
{
node.unlock();
session.save();
}
... | [
"public",
"Response",
"unLock",
"(",
"Session",
"session",
",",
"String",
"path",
",",
"List",
"<",
"String",
">",
"tokens",
")",
"{",
"try",
"{",
"try",
"{",
"Node",
"node",
"=",
"(",
"Node",
")",
"session",
".",
"getItem",
"(",
"path",
")",
";",
... | Webdav Unlock method implementation.
@param session current seesion
@param path resource path
@param tokens tokens
@return the instance of javax.ws.rs.core.Response | [
"Webdav",
"Unlock",
"method",
"implementation",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/UnLockCommand.java#L72-L111 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.unregisterChaincodeEventListener | public boolean unregisterChaincodeEventListener(String handle) throws InvalidArgumentException {
boolean ret;
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
checkHandle(CHAINCODE_EVENTS_TAG, handle);
synchronize... | java | public boolean unregisterChaincodeEventListener(String handle) throws InvalidArgumentException {
boolean ret;
if (shutdown) {
throw new InvalidArgumentException(format("Channel %s has been shutdown.", name));
}
checkHandle(CHAINCODE_EVENTS_TAG, handle);
synchronize... | [
"public",
"boolean",
"unregisterChaincodeEventListener",
"(",
"String",
"handle",
")",
"throws",
"InvalidArgumentException",
"{",
"boolean",
"ret",
";",
"if",
"(",
"shutdown",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"format",
"(",
"\"Channel %s has ... | Unregister an existing chaincode event listener.
@param handle Chaincode event listener handle to be unregistered.
@return True if the chaincode handler was found and removed.
@throws InvalidArgumentException | [
"Unregister",
"an",
"existing",
"chaincode",
"event",
"listener",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L5933-L5957 |
DaGeRe/KoPeMe | kopeme-core/src/main/java/de/dagere/kopeme/kieker/KiekerTraceEntry.java | KiekerTraceEntry.getCellProcessors | public static CellProcessor[] getCellProcessors(){
return new CellProcessor[] {
new ParseInt(){
@Override
public Object execute(Object value, CsvContext context) {
String content = value.toString();
String[] split = content.split("\\$");
return super.execute(split[1], context);
}
},
... | java | public static CellProcessor[] getCellProcessors(){
return new CellProcessor[] {
new ParseInt(){
@Override
public Object execute(Object value, CsvContext context) {
String content = value.toString();
String[] split = content.split("\\$");
return super.execute(split[1], context);
}
},
... | [
"public",
"static",
"CellProcessor",
"[",
"]",
"getCellProcessors",
"(",
")",
"{",
"return",
"new",
"CellProcessor",
"[",
"]",
"{",
"new",
"ParseInt",
"(",
")",
"{",
"@",
"Override",
"public",
"Object",
"execute",
"(",
"Object",
"value",
",",
"CsvContext",
... | Provide this array to parse the columns of the csv into the right type using the Super CSV framework.
@return | [
"Provide",
"this",
"array",
"to",
"parse",
"the",
"columns",
"of",
"the",
"csv",
"into",
"the",
"right",
"type",
"using",
"the",
"Super",
"CSV",
"framework",
"."
] | train | https://github.com/DaGeRe/KoPeMe/blob/a4939113cba73cb20a2c7d6dc8d34d0139a3e340/kopeme-core/src/main/java/de/dagere/kopeme/kieker/KiekerTraceEntry.java#L45-L65 |
GerdHolz/TOVAL | src/de/invation/code/toval/misc/ListUtils.java | ListUtils.insertHeader | public static <T> void insertHeader(List<T> list, T headerValue, int headerSize) {
for (int i = 0; i < headerSize; i++)
list.add(0, headerValue);
} | java | public static <T> void insertHeader(List<T> list, T headerValue, int headerSize) {
for (int i = 0; i < headerSize; i++)
list.add(0, headerValue);
} | [
"public",
"static",
"<",
"T",
">",
"void",
"insertHeader",
"(",
"List",
"<",
"T",
">",
"list",
",",
"T",
"headerValue",
",",
"int",
"headerSize",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"headerSize",
";",
"i",
"++",
")",
"list"... | Inserts a header
@param <T>
@param list
@param headerValue
@param headerSize | [
"Inserts",
"a",
"header"
] | train | https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/misc/ListUtils.java#L44-L47 |
kiegroup/droolsjbpm-integration | kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java | KieServerHttpRequest.appendQueryParameters | static String appendQueryParameters( final CharSequence url, final Object... params ) {
final String baseUrl = url.toString();
if( params == null || params.length == 0 ) {
return baseUrl;
}
if( params.length % 2 != 0 ) {
throw new IllegalArgumentException("Must s... | java | static String appendQueryParameters( final CharSequence url, final Object... params ) {
final String baseUrl = url.toString();
if( params == null || params.length == 0 ) {
return baseUrl;
}
if( params.length % 2 != 0 ) {
throw new IllegalArgumentException("Must s... | [
"static",
"String",
"appendQueryParameters",
"(",
"final",
"CharSequence",
"url",
",",
"final",
"Object",
"...",
"params",
")",
"{",
"final",
"String",
"baseUrl",
"=",
"url",
".",
"toString",
"(",
")",
";",
"if",
"(",
"params",
"==",
"null",
"||",
"params"... | Append given name/value pairs as query parameters to the base URL
<p>
The params argument is interpreted as a sequence of name/value pairs so the given number of params must be divisible by 2.
@param url
@param params
name/value pairs
@return URL with appended query params | [
"Append",
"given",
"name",
"/",
"value",
"pairs",
"as",
"query",
"parameters",
"to",
"the",
"base",
"URL",
"<p",
">",
"The",
"params",
"argument",
"is",
"interpreted",
"as",
"a",
"sequence",
"of",
"name",
"/",
"value",
"pairs",
"so",
"the",
"given",
"num... | train | https://github.com/kiegroup/droolsjbpm-integration/blob/6c26200ab03855dbb92b56ca0c6363cdec0eaf2c/kie-server-parent/kie-server-common/src/main/java/org/kie/server/common/rest/KieServerHttpRequest.java#L548-L581 |
protostuff/protostuff | protostuff-api/src/main/java/io/protostuff/UnsignedNumberUtil.java | UnsignedNumberUtil.remainder | private static long remainder(long dividend, long divisor)
{
if (divisor < 0)
{ // i.e., divisor >= 2^63:
if (compareUnsigned(dividend, divisor) < 0)
{
return dividend; // dividend < divisor
}
else
{
return d... | java | private static long remainder(long dividend, long divisor)
{
if (divisor < 0)
{ // i.e., divisor >= 2^63:
if (compareUnsigned(dividend, divisor) < 0)
{
return dividend; // dividend < divisor
}
else
{
return d... | [
"private",
"static",
"long",
"remainder",
"(",
"long",
"dividend",
",",
"long",
"divisor",
")",
"{",
"if",
"(",
"divisor",
"<",
"0",
")",
"{",
"// i.e., divisor >= 2^63:",
"if",
"(",
"compareUnsigned",
"(",
"dividend",
",",
"divisor",
")",
"<",
"0",
")",
... | Returns dividend % divisor, where the dividend and divisor are treated as unsigned 64-bit quantities.
@param dividend
the dividend (numerator)
@param divisor
the divisor (denominator)
@throws ArithmeticException
if divisor is 0
@since 11.0 | [
"Returns",
"dividend",
"%",
"divisor",
"where",
"the",
"dividend",
"and",
"divisor",
"are",
"treated",
"as",
"unsigned",
"64",
"-",
"bit",
"quantities",
"."
] | train | https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-api/src/main/java/io/protostuff/UnsignedNumberUtil.java#L227-L255 |
LevelFourAB/commons | commons-serialization/src/main/java/se/l4/commons/serialization/internal/reflection/FactoryDefinition.java | FactoryDefinition.getScore | public int getScore(Map<String, Object> data)
{
if(! hasSerializedFields)
{
return 0;
}
int score = 0;
for(Argument arg : arguments)
{
if(arg instanceof FactoryDefinition.SerializedArgument)
{
if(data.containsKey(((SerializedArgument) arg).name))
{
score++;
}
}
}
return ... | java | public int getScore(Map<String, Object> data)
{
if(! hasSerializedFields)
{
return 0;
}
int score = 0;
for(Argument arg : arguments)
{
if(arg instanceof FactoryDefinition.SerializedArgument)
{
if(data.containsKey(((SerializedArgument) arg).name))
{
score++;
}
}
}
return ... | [
"public",
"int",
"getScore",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
")",
"{",
"if",
"(",
"!",
"hasSerializedFields",
")",
"{",
"return",
"0",
";",
"}",
"int",
"score",
"=",
"0",
";",
"for",
"(",
"Argument",
"arg",
":",
"arguments",
... | Get a score for this factory based on the given data. The higher the
score the more arguments were found.
@param data
@return | [
"Get",
"a",
"score",
"for",
"this",
"factory",
"based",
"on",
"the",
"given",
"data",
".",
"The",
"higher",
"the",
"score",
"the",
"more",
"arguments",
"were",
"found",
"."
] | train | https://github.com/LevelFourAB/commons/blob/aa121b3a5504b43d0c10450a1b984694fcd2b8ee/commons-serialization/src/main/java/se/l4/commons/serialization/internal/reflection/FactoryDefinition.java#L287-L308 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/PropertyValueNavigator.java | PropertyValueNavigator.get | public static Object get(final Object obj, final String property) {
return new PropertyValueNavigator().getProperty(obj, property);
} | java | public static Object get(final Object obj, final String property) {
return new PropertyValueNavigator().getProperty(obj, property);
} | [
"public",
"static",
"Object",
"get",
"(",
"final",
"Object",
"obj",
",",
"final",
"String",
"property",
")",
"{",
"return",
"new",
"PropertyValueNavigator",
"(",
")",
".",
"getProperty",
"(",
"obj",
",",
"property",
")",
";",
"}"
] | プロパティの値を取得する。
<p>オプションはデフォルト値で処理する。</p>
@param obj 取得元となるオブジェクト。
@param property プロパティ名。
@return
@throws IllegalArgumentException peropety is null or empty.
@throws PropertyAccessException 存在しないプロパティを指定した場合など。
@throws NullPointerException アクセスしようとしたプロパティがnullの場合。
@throws IndexOutOfBoundsException リスト、配列にアクセスする際に存在しないイン... | [
"プロパティの値を取得する。",
"<p",
">",
"オプションはデフォルト値で処理する。<",
"/",
"p",
">"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/PropertyValueNavigator.java#L104-L106 |
modelmapper/modelmapper | core/src/main/java/org/modelmapper/internal/PropertyInfoRegistry.java | PropertyInfoRegistry.mutatorFor | static synchronized Mutator mutatorFor(Class<?> type, String name, InheritingConfiguration configuration) {
PropertyInfoKey key = new PropertyInfoKey(type, name, configuration);
if (!MUTATOR_CACHE.containsKey(key) || !FIELD_CACHE.containsKey(key)) {
@SuppressWarnings("unchecked")
Class<Object> u... | java | static synchronized Mutator mutatorFor(Class<?> type, String name, InheritingConfiguration configuration) {
PropertyInfoKey key = new PropertyInfoKey(type, name, configuration);
if (!MUTATOR_CACHE.containsKey(key) || !FIELD_CACHE.containsKey(key)) {
@SuppressWarnings("unchecked")
Class<Object> u... | [
"static",
"synchronized",
"Mutator",
"mutatorFor",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
",",
"InheritingConfiguration",
"configuration",
")",
"{",
"PropertyInfoKey",
"key",
"=",
"new",
"PropertyInfoKey",
"(",
"type",
",",
"name",
",",
"c... | Returns an mutator for the {@code accessorName}, else {@code null} if none exists.
Returns a Mutator instance for the given mutator method. The method must be externally
validated to ensure that it accepts one argument and returns void.class. | [
"Returns",
"an",
"mutator",
"for",
"the",
"{"
] | train | https://github.com/modelmapper/modelmapper/blob/491d165ded9dc9aba7ce8b56984249e1a1363204/core/src/main/java/org/modelmapper/internal/PropertyInfoRegistry.java#L130-L146 |
couchbase/couchbase-lite-java-core | src/main/java/com/couchbase/lite/replicator/ReplicationInternal.java | ReplicationInternal.refreshRemoteCheckpointDoc | @InterfaceAudience.Private
private void refreshRemoteCheckpointDoc() {
Log.i(Log.TAG_SYNC, "%s: Refreshing remote checkpoint to get its _rev...", this);
Future future = sendAsyncRequest("GET", "_local/" + remoteCheckpointDocID(), null, new RemoteRequestCompletion() {
@Override
... | java | @InterfaceAudience.Private
private void refreshRemoteCheckpointDoc() {
Log.i(Log.TAG_SYNC, "%s: Refreshing remote checkpoint to get its _rev...", this);
Future future = sendAsyncRequest("GET", "_local/" + remoteCheckpointDocID(), null, new RemoteRequestCompletion() {
@Override
... | [
"@",
"InterfaceAudience",
".",
"Private",
"private",
"void",
"refreshRemoteCheckpointDoc",
"(",
")",
"{",
"Log",
".",
"i",
"(",
"Log",
".",
"TAG_SYNC",
",",
"\"%s: Refreshing remote checkpoint to get its _rev...\"",
",",
"this",
")",
";",
"Future",
"future",
"=",
... | Variant of -fetchRemoveCheckpointDoc that's used while replication is running, to reload the
checkpoint to get its current revision number, if there was an error saving it. | [
"Variant",
"of",
"-",
"fetchRemoveCheckpointDoc",
"that",
"s",
"used",
"while",
"replication",
"is",
"running",
"to",
"reload",
"the",
"checkpoint",
"to",
"get",
"its",
"current",
"revision",
"number",
"if",
"there",
"was",
"an",
"error",
"saving",
"it",
"."
] | train | https://github.com/couchbase/couchbase-lite-java-core/blob/3b275642e2d2f231fd155ad9def9c5e9eff3118e/src/main/java/com/couchbase/lite/replicator/ReplicationInternal.java#L922-L943 |
ontop/ontop | mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/validation/impl/MappingOntologyComplianceValidatorImpl.java | MappingOntologyComplianceValidatorImpl.validate | @Override
public void validate(MappingWithProvenance mapping, Ontology ontology)
throws MappingOntologyMismatchException {
ImmutableMultimap<IRI, Datatype> datatypeMap = computeDataTypeMap(ontology.tbox());
for (Map.Entry<IQ, PPMappingAssertionProvenance> entry : mapping.getProvenanceM... | java | @Override
public void validate(MappingWithProvenance mapping, Ontology ontology)
throws MappingOntologyMismatchException {
ImmutableMultimap<IRI, Datatype> datatypeMap = computeDataTypeMap(ontology.tbox());
for (Map.Entry<IQ, PPMappingAssertionProvenance> entry : mapping.getProvenanceM... | [
"@",
"Override",
"public",
"void",
"validate",
"(",
"MappingWithProvenance",
"mapping",
",",
"Ontology",
"ontology",
")",
"throws",
"MappingOntologyMismatchException",
"{",
"ImmutableMultimap",
"<",
"IRI",
",",
"Datatype",
">",
"datatypeMap",
"=",
"computeDataTypeMap",
... | Requires the annotation, data and object properties to be clearly distinguished
(disjoint sets, according to the OWL semantics)
Be careful if you are using a T-box bootstrapped from the mapping
It is NOT assumed that the declared vocabulary contains information on every RDF predicate
used in the mapping. | [
"Requires",
"the",
"annotation",
"data",
"and",
"object",
"properties",
"to",
"be",
"clearly",
"distinguished",
"(",
"disjoint",
"sets",
"according",
"to",
"the",
"OWL",
"semantics",
")"
] | train | https://github.com/ontop/ontop/blob/ddf78b26981b6129ee9a1a59310016830f5352e4/mapping/core/src/main/java/it/unibz/inf/ontop/spec/mapping/validation/impl/MappingOntologyComplianceValidatorImpl.java#L67-L76 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/mps/smtp_server.java | smtp_server.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
smtp_server_responses result = (smtp_server_responses) service.get_payload_formatter().string_to_resource(smtp_server_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode =... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
smtp_server_responses result = (smtp_server_responses) service.get_payload_formatter().string_to_resource(smtp_server_responses.class, response);
if(result.errorcode != 0)
{
if (result.errorcode =... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"smtp_server_responses",
"result",
"=",
"(",
"smtp_server_responses",
")",
"service",
".",
"get_payload_format... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/mps/smtp_server.java#L431-L448 |
apereo/cas | support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/AbstractSamlProfileHandlerController.java | AbstractSamlProfileHandlerController.buildRedirectUrlByRequestedAuthnContext | protected String buildRedirectUrlByRequestedAuthnContext(final String initialUrl, final AuthnRequest authnRequest, final HttpServletRequest request) {
val authenticationContextClassMappings = samlProfileHandlerConfigurationContext.getCasProperties()
.getAuthn().getSamlIdp().getAuthenticationContextC... | java | protected String buildRedirectUrlByRequestedAuthnContext(final String initialUrl, final AuthnRequest authnRequest, final HttpServletRequest request) {
val authenticationContextClassMappings = samlProfileHandlerConfigurationContext.getCasProperties()
.getAuthn().getSamlIdp().getAuthenticationContextC... | [
"protected",
"String",
"buildRedirectUrlByRequestedAuthnContext",
"(",
"final",
"String",
"initialUrl",
",",
"final",
"AuthnRequest",
"authnRequest",
",",
"final",
"HttpServletRequest",
"request",
")",
"{",
"val",
"authenticationContextClassMappings",
"=",
"samlProfileHandler... | Build redirect url by requested authn context.
@param initialUrl the initial url
@param authnRequest the authn request
@param request the request
@return the redirect url | [
"Build",
"redirect",
"url",
"by",
"requested",
"authn",
"context",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-idp-web/src/main/java/org/apereo/cas/support/saml/web/idp/profile/AbstractSamlProfileHandlerController.java#L249-L274 |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java | TfIdf.idf | public static <TERM> Map<TERM, Double> idf(Iterable<Iterable<TERM>> documentVocabularies)
{
return idf(documentVocabularies, true, true);
} | java | public static <TERM> Map<TERM, Double> idf(Iterable<Iterable<TERM>> documentVocabularies)
{
return idf(documentVocabularies, true, true);
} | [
"public",
"static",
"<",
"TERM",
">",
"Map",
"<",
"TERM",
",",
"Double",
">",
"idf",
"(",
"Iterable",
"<",
"Iterable",
"<",
"TERM",
">",
">",
"documentVocabularies",
")",
"{",
"return",
"idf",
"(",
"documentVocabularies",
",",
"true",
",",
"true",
")",
... | 平滑处理后的一系列文档的倒排词频
@param documentVocabularies 词表
@param <TERM> 词语类型
@return 一个词语->倒排文档的Map | [
"平滑处理后的一系列文档的倒排词频"
] | train | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/mining/word/TfIdf.java#L166-L169 |
janus-project/guava.janusproject.io | guava/src/com/google/common/collect/MapMakerInternalMap.java | MapMakerInternalMap.getLiveValue | V getLiveValue(ReferenceEntry<K, V> entry) {
if (entry.getKey() == null) {
return null;
}
V value = entry.getValueReference().get();
if (value == null) {
return null;
}
if (expires() && isExpired(entry)) {
return null;
}
return value;
} | java | V getLiveValue(ReferenceEntry<K, V> entry) {
if (entry.getKey() == null) {
return null;
}
V value = entry.getValueReference().get();
if (value == null) {
return null;
}
if (expires() && isExpired(entry)) {
return null;
}
return value;
} | [
"V",
"getLiveValue",
"(",
"ReferenceEntry",
"<",
"K",
",",
"V",
">",
"entry",
")",
"{",
"if",
"(",
"entry",
".",
"getKey",
"(",
")",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"V",
"value",
"=",
"entry",
".",
"getValueReference",
"(",
")",... | Gets the value from an entry. Returns {@code null} if the entry is invalid,
partially-collected, computing, or expired. Unlike {@link Segment#getLiveValue} this method
does not attempt to clean up stale entries. | [
"Gets",
"the",
"value",
"from",
"an",
"entry",
".",
"Returns",
"{"
] | train | https://github.com/janus-project/guava.janusproject.io/blob/1c48fb672c9fdfddf276970570f703fa1115f588/guava/src/com/google/common/collect/MapMakerInternalMap.java#L1895-L1908 |
resilience4j/resilience4j | resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/RateLimiterExports.java | RateLimiterExports.ofRateLimiter | public static RateLimiterExports ofRateLimiter(String prefix, RateLimiter rateLimiter) {
return new RateLimiterExports(prefix, Array.of(rateLimiter));
} | java | public static RateLimiterExports ofRateLimiter(String prefix, RateLimiter rateLimiter) {
return new RateLimiterExports(prefix, Array.of(rateLimiter));
} | [
"public",
"static",
"RateLimiterExports",
"ofRateLimiter",
"(",
"String",
"prefix",
",",
"RateLimiter",
"rateLimiter",
")",
"{",
"return",
"new",
"RateLimiterExports",
"(",
"prefix",
",",
"Array",
".",
"of",
"(",
"rateLimiter",
")",
")",
";",
"}"
] | Creates a new instance of {@link RateLimiterExports} with default metrics names prefix and
a rate limiter as a source.
@param prefix the prefix of metrics names
@param rateLimiter the rate limiter | [
"Creates",
"a",
"new",
"instance",
"of",
"{",
"@link",
"RateLimiterExports",
"}",
"with",
"default",
"metrics",
"names",
"prefix",
"and",
"a",
"rate",
"limiter",
"as",
"a",
"source",
"."
] | train | https://github.com/resilience4j/resilience4j/blob/fa843d30f531c00f0c3dc218b65a7f2bb51af336/resilience4j-prometheus/src/main/java/io/github/resilience4j/prometheus/RateLimiterExports.java#L128-L130 |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java | VectorizedParquetRecordReader.initialize | @Override
public void initialize(String path, List<String> columns) throws IOException,
UnsupportedOperationException {
super.initialize(path, columns);
initializeInternal();
} | java | @Override
public void initialize(String path, List<String> columns) throws IOException,
UnsupportedOperationException {
super.initialize(path, columns);
initializeInternal();
} | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"String",
"path",
",",
"List",
"<",
"String",
">",
"columns",
")",
"throws",
"IOException",
",",
"UnsupportedOperationException",
"{",
"super",
".",
"initialize",
"(",
"path",
",",
"columns",
")",
";",
"i... | Utility API that will read all the data in path. This circumvents the need to create Hadoop
objects to use this class. `columns` can contain the list of columns to project. | [
"Utility",
"API",
"that",
"will",
"read",
"all",
"the",
"data",
"in",
"path",
".",
"This",
"circumvents",
"the",
"need",
"to",
"create",
"Hadoop",
"objects",
"to",
"use",
"this",
"class",
".",
"columns",
"can",
"contain",
"the",
"list",
"of",
"columns",
... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/datasources/parquet/VectorizedParquetRecordReader.java#L139-L144 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java | ST_OffSetCurve.lineStringOffSetCurve | public static void lineStringOffSetCurve(ArrayList<LineString> list, LineString lineString, double offset, BufferParameters bufferParameters) {
list.add(lineString.getFactory().createLineString(new OffsetCurveBuilder(lineString.getPrecisionModel(), bufferParameters).getOffsetCurve(lineString.getCoordinates(), o... | java | public static void lineStringOffSetCurve(ArrayList<LineString> list, LineString lineString, double offset, BufferParameters bufferParameters) {
list.add(lineString.getFactory().createLineString(new OffsetCurveBuilder(lineString.getPrecisionModel(), bufferParameters).getOffsetCurve(lineString.getCoordinates(), o... | [
"public",
"static",
"void",
"lineStringOffSetCurve",
"(",
"ArrayList",
"<",
"LineString",
">",
"list",
",",
"LineString",
"lineString",
",",
"double",
"offset",
",",
"BufferParameters",
"bufferParameters",
")",
"{",
"list",
".",
"add",
"(",
"lineString",
".",
"g... | Compute the offset curve for a linestring
@param list
@param lineString
@param offset
@param bufferParameters | [
"Compute",
"the",
"offset",
"curve",
"for",
"a",
"linestring"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/buffer/ST_OffSetCurve.java#L149-L151 |
tiesebarrell/process-assertions | process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/AssertUtils.java | AssertUtils.isEqualCollection | public static boolean isEqualCollection(Collection<String> list1, Collection<String> list2) {
Validate.notNull(list1);
Validate.notNull(list2);
boolean result = true;
if (list1.size() == list2.size()) {
for (final String currentString : list1) {
if (!list2.c... | java | public static boolean isEqualCollection(Collection<String> list1, Collection<String> list2) {
Validate.notNull(list1);
Validate.notNull(list2);
boolean result = true;
if (list1.size() == list2.size()) {
for (final String currentString : list1) {
if (!list2.c... | [
"public",
"static",
"boolean",
"isEqualCollection",
"(",
"Collection",
"<",
"String",
">",
"list1",
",",
"Collection",
"<",
"String",
">",
"list2",
")",
"{",
"Validate",
".",
"notNull",
"(",
"list1",
")",
";",
"Validate",
".",
"notNull",
"(",
"list2",
")",... | Determines whether the provided collections of strings are equal. Equality is considered:
<ul>
<li>Both lists are empty, or</li>
<li>Both lists are of the same size and contain the same elements.</li>
</ul>
@param list1
the first list, may not be {@code null}
@param list2
the second list, may not be {@code null}
@re... | [
"Determines",
"whether",
"the",
"provided",
"collections",
"of",
"strings",
"are",
"equal",
".",
"Equality",
"is",
"considered",
":"
] | train | https://github.com/tiesebarrell/process-assertions/blob/932a8443982e356cdf5a230165a35c725d9306ab/process-assertions-api/src/main/java/org/toxos/processassertions/api/internal/AssertUtils.java#L126-L144 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.parseFileItems | protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<>();
MultiValueMap<String, String> multipartParameters = new LinkedMultiValueMap<>();
Map<String, String> multipartContentTyp... | java | protected MultipartParsingResult parseFileItems(List<FileItem> fileItems, String encoding) {
MultiValueMap<String, MultipartFile> multipartFiles = new LinkedMultiValueMap<>();
MultiValueMap<String, String> multipartParameters = new LinkedMultiValueMap<>();
Map<String, String> multipartContentTyp... | [
"protected",
"MultipartParsingResult",
"parseFileItems",
"(",
"List",
"<",
"FileItem",
">",
"fileItems",
",",
"String",
"encoding",
")",
"{",
"MultiValueMap",
"<",
"String",
",",
"MultipartFile",
">",
"multipartFiles",
"=",
"new",
"LinkedMultiValueMap",
"<>",
"(",
... | Parse the given List of Commons FileItems into a MultipartParsingResult, containing MultipartFile instances and a
Map of multipart parameter.
@param fileItems the Commons FileItems to parse.
@param encoding the encoding to use for form fields.
@return the MultipartParsingResult.
@see StandardMultipartFile#StandardMu... | [
"Parse",
"the",
"given",
"List",
"of",
"Commons",
"FileItems",
"into",
"a",
"MultipartParsingResult",
"containing",
"MultipartFile",
"instances",
"and",
"a",
"Map",
"of",
"multipart",
"parameter",
"."
] | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L219-L255 |
hawkular/hawkular-agent | hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java | SecurityDomainJBossASClient.createNewSecurityDomain | public void createNewSecurityDomain(String securityDomainName, LoginModuleRequest... loginModules)
throws Exception {
//do not close the controller client here, we're using our own..
CoreJBossASClient coreClient = new CoreJBossASClient(getModelControllerClient());
String serverVersio... | java | public void createNewSecurityDomain(String securityDomainName, LoginModuleRequest... loginModules)
throws Exception {
//do not close the controller client here, we're using our own..
CoreJBossASClient coreClient = new CoreJBossASClient(getModelControllerClient());
String serverVersio... | [
"public",
"void",
"createNewSecurityDomain",
"(",
"String",
"securityDomainName",
",",
"LoginModuleRequest",
"...",
"loginModules",
")",
"throws",
"Exception",
"{",
"//do not close the controller client here, we're using our own..",
"CoreJBossASClient",
"coreClient",
"=",
"new",
... | Creates a new security domain including one or more login modules.
The security domain will be replaced if it exists.
@param securityDomainName the name of the new security domain
@param loginModules an array of login modules to place in the security domain.
They are ordered top-down in the same index order of the arr... | [
"Creates",
"a",
"new",
"security",
"domain",
"including",
"one",
"or",
"more",
"login",
"modules",
".",
"The",
"security",
"domain",
"will",
"be",
"replaced",
"if",
"it",
"exists",
"."
] | train | https://github.com/hawkular/hawkular-agent/blob/a7a88fc7e4f12302e4c4306d1c91e11f81c8b811/hawkular-dmr-client/src/main/java/org/hawkular/dmrclient/SecurityDomainJBossASClient.java#L274-L286 |
fuinorg/event-store-commons | spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java | EscSpiUtils.nodeToString | public static String nodeToString(final Node node) {
try {
final Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
final StringWriter sw = new StringWriter();
t.transform(new DOMSource(n... | java | public static String nodeToString(final Node node) {
try {
final Transformer t = TransformerFactory.newInstance().newTransformer();
t.setOutputProperty(OutputKeys.OMIT_XML_DECLARATION, "yes");
final StringWriter sw = new StringWriter();
t.transform(new DOMSource(n... | [
"public",
"static",
"String",
"nodeToString",
"(",
"final",
"Node",
"node",
")",
"{",
"try",
"{",
"final",
"Transformer",
"t",
"=",
"TransformerFactory",
".",
"newInstance",
"(",
")",
".",
"newTransformer",
"(",
")",
";",
"t",
".",
"setOutputProperty",
"(",
... | Render a node as string.
@param node
Node to render.
@return XML. | [
"Render",
"a",
"node",
"as",
"string",
"."
] | train | https://github.com/fuinorg/event-store-commons/blob/ea175582d8cda2b5a6d2fe52bbb2f1c183eee77c/spi/src/main/java/org/fuin/esc/spi/EscSpiUtils.java#L243-L253 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.consumption_usage_forecast_GET | public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_forecast_GET() throws IOException {
String qPath = "/me/consumption/usage/forecast";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t7);
} | java | public ArrayList<net.minidev.ovh.api.me.consumption.OvhTransaction> consumption_usage_forecast_GET() throws IOException {
String qPath = "/me/consumption/usage/forecast";
StringBuilder sb = path(qPath);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t7);
} | [
"public",
"ArrayList",
"<",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"me",
".",
"consumption",
".",
"OvhTransaction",
">",
"consumption_usage_forecast_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/consumption/usage/forecas... | Get forecasted consumptions for all services
REST: GET /me/consumption/usage/forecast | [
"Get",
"forecasted",
"consumptions",
"for",
"all",
"services"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L2143-L2148 |
knowm/XChart | xchart/src/main/java/org/knowm/xchart/OHLCChart.java | OHLCChart.addSeries | private OHLCSeries addSeries(
String seriesName,
double[] xData,
double[] openData,
double[] highData,
double[] lowData,
double[] closeData,
DataType dataType) {
if (seriesMap.keySet().contains(seriesName)) {
throw new IllegalArgumentException(
"Series name... | java | private OHLCSeries addSeries(
String seriesName,
double[] xData,
double[] openData,
double[] highData,
double[] lowData,
double[] closeData,
DataType dataType) {
if (seriesMap.keySet().contains(seriesName)) {
throw new IllegalArgumentException(
"Series name... | [
"private",
"OHLCSeries",
"addSeries",
"(",
"String",
"seriesName",
",",
"double",
"[",
"]",
"xData",
",",
"double",
"[",
"]",
"openData",
",",
"double",
"[",
"]",
"highData",
",",
"double",
"[",
"]",
"lowData",
",",
"double",
"[",
"]",
"closeData",
",",
... | Add a series for a OHLC type chart
@param seriesName
@param xData the x-axis data
@param openData the open data
@param highData the high data
@param lowData the low data
@param closeData the close data
@return A Series object that you can set properties on | [
"Add",
"a",
"series",
"for",
"a",
"OHLC",
"type",
"chart"
] | train | https://github.com/knowm/XChart/blob/677a105753a855edf24782fab1bf1f5aec3e642b/xchart/src/main/java/org/knowm/xchart/OHLCChart.java#L291-L326 |
checkstyle-addons/checkstyle-addons | buildSrc/src/main/java/com/thomasjensen/checkstyle/addons/build/BuildUtil.java | BuildUtil.getTask | @Nonnull
public Task getTask(@Nonnull final TaskNames pTaskName, @Nonnull final DependencyConfig pDepConfig)
{
return project.getTasks().getByName(pTaskName.getName(pDepConfig));
} | java | @Nonnull
public Task getTask(@Nonnull final TaskNames pTaskName, @Nonnull final DependencyConfig pDepConfig)
{
return project.getTasks().getByName(pTaskName.getName(pDepConfig));
} | [
"@",
"Nonnull",
"public",
"Task",
"getTask",
"(",
"@",
"Nonnull",
"final",
"TaskNames",
"pTaskName",
",",
"@",
"Nonnull",
"final",
"DependencyConfig",
"pDepConfig",
")",
"{",
"return",
"project",
".",
"getTasks",
"(",
")",
".",
"getByName",
"(",
"pTaskName",
... | Convenience method for getting a specific task directly.
@param pTaskName the task to get
@param pDepConfig the dependency configuration for which the task is intended
@return a task object | [
"Convenience",
"method",
"for",
"getting",
"a",
"specific",
"task",
"directly",
"."
] | train | https://github.com/checkstyle-addons/checkstyle-addons/blob/fae1b4d341639c8e32c3e59ec5abdc0ffc11b865/buildSrc/src/main/java/com/thomasjensen/checkstyle/addons/build/BuildUtil.java#L144-L148 |
greenjoe/sergeants | src/main/java/pl/joegreen/sergeants/framework/queue/QueueConfiguration.java | QueueConfiguration.customGame | public static QueueConfiguration customGame(boolean force, String gameId, int team) {
return new CustomGameQueueConfiguration(force, gameId, team);
} | java | public static QueueConfiguration customGame(boolean force, String gameId, int team) {
return new CustomGameQueueConfiguration(force, gameId, team);
} | [
"public",
"static",
"QueueConfiguration",
"customGame",
"(",
"boolean",
"force",
",",
"String",
"gameId",
",",
"int",
"team",
")",
"{",
"return",
"new",
"CustomGameQueueConfiguration",
"(",
"force",
",",
"gameId",
",",
"team",
")",
";",
"}"
] | Joins custom game.
@param force indicates if player should vote for "force start"
@param gameId identifier of the game to join (displayed in browser URL when starting custom game)
@param team number of team that bot will join in the custom game | [
"Joins",
"custom",
"game",
"."
] | train | https://github.com/greenjoe/sergeants/blob/db624bcea8597843210f138b82bc4a26b3ec92ca/src/main/java/pl/joegreen/sergeants/framework/queue/QueueConfiguration.java#L52-L54 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsQueueConnectionImpl.java | JmsQueueConnectionImpl.instantiateSession | JmsSessionImpl instantiateSession(boolean transacted, int acknowledgeMode, SICoreConnection coreConnection, JmsJcaSession jcaSession) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateSession", new Object[]{transacted, acknowledgeMode, coreConne... | java | JmsSessionImpl instantiateSession(boolean transacted, int acknowledgeMode, SICoreConnection coreConnection, JmsJcaSession jcaSession) throws JMSException {
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "instantiateSession", new Object[]{transacted, acknowledgeMode, coreConne... | [
"JmsSessionImpl",
"instantiateSession",
"(",
"boolean",
"transacted",
",",
"int",
"acknowledgeMode",
",",
"SICoreConnection",
"coreConnection",
",",
"JmsJcaSession",
"jcaSession",
")",
"throws",
"JMSException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",... | This method overrides a superclass method, so that the superclass's
createSession() method can be inherited, but still return an object of
this class's type. | [
"This",
"method",
"overrides",
"a",
"superclass",
"method",
"so",
"that",
"the",
"superclass",
"s",
"createSession",
"()",
"method",
"can",
"be",
"inherited",
"but",
"still",
"return",
"an",
"object",
"of",
"this",
"class",
"s",
"type",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jms/impl/JmsQueueConnectionImpl.java#L105-L110 |
ReactiveX/RxNetty | rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/server/HttpServer.java | HttpServer.newServer | public static HttpServer<ByteBuf, ByteBuf> newServer(SocketAddress socketAddress, EventLoopGroup serverGroup,
EventLoopGroup clientGroup,
Class<? extends ServerChannel> channelClass) {
return _newSe... | java | public static HttpServer<ByteBuf, ByteBuf> newServer(SocketAddress socketAddress, EventLoopGroup serverGroup,
EventLoopGroup clientGroup,
Class<? extends ServerChannel> channelClass) {
return _newSe... | [
"public",
"static",
"HttpServer",
"<",
"ByteBuf",
",",
"ByteBuf",
">",
"newServer",
"(",
"SocketAddress",
"socketAddress",
",",
"EventLoopGroup",
"serverGroup",
",",
"EventLoopGroup",
"clientGroup",
",",
"Class",
"<",
"?",
"extends",
"ServerChannel",
">",
"channelCl... | Creates a new server using the passed port.
@param socketAddress Socket address for the server.
@param serverGroup Eventloop group to be used for server sockets.
@param clientGroup Eventloop group to be used for client sockets.
@param channelClass The class to be used for server channel.
@return A new {@link HttpServ... | [
"Creates",
"a",
"new",
"server",
"using",
"the",
"passed",
"port",
"."
] | train | https://github.com/ReactiveX/RxNetty/blob/a7ca9a9c1d544a79c82f7b17036daf6958bf1cd6/rxnetty-http/src/main/java/io/reactivex/netty/protocol/http/server/HttpServer.java#L436-L440 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.