repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.getSitePath | @Deprecated
public static String getSitePath(CmsObject cms, String basePath, String targetUri) {
"""
Returns the resource root path for the given target URI in the OpenCms VFS, or <code>null</code> in
case the target URI points to an external site.<p>
@param cms the current users OpenCms context
@param ba... | java | @Deprecated
public static String getSitePath(CmsObject cms, String basePath, String targetUri) {
return OpenCms.getLinkManager().getRootPath(cms, targetUri, basePath);
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"getSitePath",
"(",
"CmsObject",
"cms",
",",
"String",
"basePath",
",",
"String",
"targetUri",
")",
"{",
"return",
"OpenCms",
".",
"getLinkManager",
"(",
")",
".",
"getRootPath",
"(",
"cms",
",",
"targetUri",
... | Returns the resource root path for the given target URI in the OpenCms VFS, or <code>null</code> in
case the target URI points to an external site.<p>
@param cms the current users OpenCms context
@param basePath path to use as base site for the target URI (can be <code>null</code>)
@param targetUri the target URI
@re... | [
"Returns",
"the",
"resource",
"root",
"path",
"for",
"the",
"given",
"target",
"URI",
"in",
"the",
"OpenCms",
"VFS",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"in",
"case",
"the",
"target",
"URI",
"points",
"to",
"an",
"external",
"site",
".",
"<p... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L192-L196 |
landawn/AbacusUtil | src/com/landawn/abacus/util/FileSystemUtil.java | FileSystemUtil.freeSpaceKb | public static long freeSpaceKb(final String path, final long timeout) throws IOException {
"""
Returns the free space on a drive or volume in kilobytes by invoking
the command line.
<pre>
FileSystemUtils.freeSpaceKb("C:"); // Windows
FileSystemUtils.freeSpaceKb("/volume"); // *nix
</pre>
The free spac... | java | public static long freeSpaceKb(final String path, final long timeout) throws IOException {
return INSTANCE.freeSpaceOS(path, OS, true, timeout);
} | [
"public",
"static",
"long",
"freeSpaceKb",
"(",
"final",
"String",
"path",
",",
"final",
"long",
"timeout",
")",
"throws",
"IOException",
"{",
"return",
"INSTANCE",
".",
"freeSpaceOS",
"(",
"path",
",",
"OS",
",",
"true",
",",
"timeout",
")",
";",
"}"
] | Returns the free space on a drive or volume in kilobytes by invoking
the command line.
<pre>
FileSystemUtils.freeSpaceKb("C:"); // Windows
FileSystemUtils.freeSpaceKb("/volume"); // *nix
</pre>
The free space is calculated via the command line.
It uses 'dir /-c' on Windows, 'df -kP' on AIX/HP-UX and 'df -k' on o... | [
"Returns",
"the",
"free",
"space",
"on",
"a",
"drive",
"or",
"volume",
"in",
"kilobytes",
"by",
"invoking",
"the",
"command",
"line",
".",
"<pre",
">",
"FileSystemUtils",
".",
"freeSpaceKb",
"(",
"C",
":",
")",
";",
"//",
"Windows",
"FileSystemUtils",
".",... | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/FileSystemUtil.java#L161-L163 |
asterisk-java/asterisk-java | src/main/java/org/asteriskjava/util/AstState.java | AstState.str2state | public static Integer str2state(String str) {
"""
This is the inverse to <code>ast_state2str</code> in <code>channel.c</code>.
@param str state as a descriptive text.
@return numeric state.
"""
Integer state;
if (str == null)
{
return null;
}
state = in... | java | public static Integer str2state(String str)
{
Integer state;
if (str == null)
{
return null;
}
state = inverseStateMap.get(str);
if (state == null)
{
Matcher matcher = UNKNOWN_STATE_PATTERN.matcher(str);
if (matcher.match... | [
"public",
"static",
"Integer",
"str2state",
"(",
"String",
"str",
")",
"{",
"Integer",
"state",
";",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"state",
"=",
"inverseStateMap",
".",
"get",
"(",
"str",
")",
";",
"if",
"(",
... | This is the inverse to <code>ast_state2str</code> in <code>channel.c</code>.
@param str state as a descriptive text.
@return numeric state. | [
"This",
"is",
"the",
"inverse",
"to",
"<code",
">",
"ast_state2str<",
"/",
"code",
">",
"in",
"<code",
">",
"channel",
".",
"c<",
"/",
"code",
">",
"."
] | train | https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/util/AstState.java#L101-L130 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/KeyDecoder.java | KeyDecoder.decodeSingleNullableDesc | public static byte[] decodeSingleNullableDesc(byte[] src, int prefixPadding, int suffixPadding)
throws CorruptEncodingException {
"""
Decodes the given byte array which was encoded by {@link
KeyEncoder#encodeSingleNullableDesc}. Always returns a new byte array
instance.
@param prefixPadding amount of... | java | public static byte[] decodeSingleNullableDesc(byte[] src, int prefixPadding, int suffixPadding)
throws CorruptEncodingException
{
try {
byte b = src[prefixPadding];
if (b == NULL_BYTE_HIGH || b == NULL_BYTE_LOW) {
return null;
}
... | [
"public",
"static",
"byte",
"[",
"]",
"decodeSingleNullableDesc",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"prefixPadding",
",",
"int",
"suffixPadding",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"byte",
"b",
"=",
"src",
"[",
"prefixPadding",... | Decodes the given byte array which was encoded by {@link
KeyEncoder#encodeSingleNullableDesc}. Always returns a new byte array
instance.
@param prefixPadding amount of extra bytes to skip from start of encoded byte array
@param suffixPadding amount of extra bytes to skip at end of encoded byte array | [
"Decodes",
"the",
"given",
"byte",
"array",
"which",
"was",
"encoded",
"by",
"{",
"@link",
"KeyEncoder#encodeSingleNullableDesc",
"}",
".",
"Always",
"returns",
"a",
"new",
"byte",
"array",
"instance",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/KeyDecoder.java#L881-L901 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java | NDArrayMessage.numChunksForMessage | public static int numChunksForMessage(NDArrayMessage message, int chunkSize) {
"""
Determine the number of chunks
@param message
@param chunkSize
@return
"""
int sizeOfMessage = NDArrayMessage.byteBufferSizeForMessage(message);
int numMessages = sizeOfMessage / chunkSize;
//increase ... | java | public static int numChunksForMessage(NDArrayMessage message, int chunkSize) {
int sizeOfMessage = NDArrayMessage.byteBufferSizeForMessage(message);
int numMessages = sizeOfMessage / chunkSize;
//increase by 1 for padding
if (numMessages * chunkSize < sizeOfMessage)
numMessag... | [
"public",
"static",
"int",
"numChunksForMessage",
"(",
"NDArrayMessage",
"message",
",",
"int",
"chunkSize",
")",
"{",
"int",
"sizeOfMessage",
"=",
"NDArrayMessage",
".",
"byteBufferSizeForMessage",
"(",
"message",
")",
";",
"int",
"numMessages",
"=",
"sizeOfMessage... | Determine the number of chunks
@param message
@param chunkSize
@return | [
"Determine",
"the",
"number",
"of",
"chunks"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-aeron/src/main/java/org/nd4j/aeron/ipc/NDArrayMessage.java#L85-L92 |
cternes/openkeepass | src/main/java/de/slackspace/openkeepass/KeePassDatabase.java | KeePassDatabase.openDatabase | public KeePassFile openDatabase(String password, InputStream keyFileStream) {
"""
Opens a KeePass database with the given password and keyfile stream and
returns the KeePassFile for further processing.
<p>
If the database cannot be decrypted with the provided password and
keyfile stream an exception will be th... | java | public KeePassFile openDatabase(String password, InputStream keyFileStream) {
if (password == null) {
throw new IllegalArgumentException(MSG_EMPTY_MASTER_KEY);
}
if (keyFileStream == null) {
throw new IllegalArgumentException("You must provide a non-empty KeePass key... | [
"public",
"KeePassFile",
"openDatabase",
"(",
"String",
"password",
",",
"InputStream",
"keyFileStream",
")",
"{",
"if",
"(",
"password",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"MSG_EMPTY_MASTER_KEY",
")",
";",
"}",
"if",
"(",
... | Opens a KeePass database with the given password and keyfile stream and
returns the KeePassFile for further processing.
<p>
If the database cannot be decrypted with the provided password and
keyfile stream an exception will be thrown.
@param password
the password to open the database
@param keyFileStream
the keyfile t... | [
"Opens",
"a",
"KeePass",
"database",
"with",
"the",
"given",
"password",
"and",
"keyfile",
"stream",
"and",
"returns",
"the",
"KeePassFile",
"for",
"further",
"processing",
".",
"<p",
">",
"If",
"the",
"database",
"cannot",
"be",
"decrypted",
"with",
"the",
... | train | https://github.com/cternes/openkeepass/blob/4a354aecaea38af3c0dce5eb81b533f297e8d94f/src/main/java/de/slackspace/openkeepass/KeePassDatabase.java#L225-L242 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.setTermMeta | public void setTermMeta(final long termId, final List<Meta> termMeta) throws SQLException {
"""
Sets metadata for a term.
<p>
Clears existing metadata.
</p>
@param termId The term id.
@param termMeta The metadata.
@throws SQLException on database error.
"""
clearTermMeta(termId);
if(termMet... | java | public void setTermMeta(final long termId, final List<Meta> termMeta) throws SQLException {
clearTermMeta(termId);
if(termMeta == null || termMeta.size() == 0) {
return;
}
Connection conn = null;
PreparedStatement stmt = null;
Timer.Context ctx = metrics.setTermMetaTimer.t... | [
"public",
"void",
"setTermMeta",
"(",
"final",
"long",
"termId",
",",
"final",
"List",
"<",
"Meta",
">",
"termMeta",
")",
"throws",
"SQLException",
"{",
"clearTermMeta",
"(",
"termId",
")",
";",
"if",
"(",
"termMeta",
"==",
"null",
"||",
"termMeta",
".",
... | Sets metadata for a term.
<p>
Clears existing metadata.
</p>
@param termId The term id.
@param termMeta The metadata.
@throws SQLException on database error. | [
"Sets",
"metadata",
"for",
"a",
"term",
".",
"<p",
">",
"Clears",
"existing",
"metadata",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L2085-L2108 |
palatable/lambda | src/main/java/com/jnape/palatable/lambda/optics/lenses/ListLens.java | ListLens.asCopy | public static <X> Lens.Simple<List<X>, List<X>> asCopy() {
"""
Convenience static factory method for creating a lens over a copy of a list. Useful for composition to avoid
mutating a list reference.
@param <X> the list element type
@return a lens that focuses on copies of lists
"""
return simpleLe... | java | public static <X> Lens.Simple<List<X>, List<X>> asCopy() {
return simpleLens(ArrayList::new, (xs, ys) -> ys);
} | [
"public",
"static",
"<",
"X",
">",
"Lens",
".",
"Simple",
"<",
"List",
"<",
"X",
">",
",",
"List",
"<",
"X",
">",
">",
"asCopy",
"(",
")",
"{",
"return",
"simpleLens",
"(",
"ArrayList",
"::",
"new",
",",
"(",
"xs",
",",
"ys",
")",
"->",
"ys",
... | Convenience static factory method for creating a lens over a copy of a list. Useful for composition to avoid
mutating a list reference.
@param <X> the list element type
@return a lens that focuses on copies of lists | [
"Convenience",
"static",
"factory",
"method",
"for",
"creating",
"a",
"lens",
"over",
"a",
"copy",
"of",
"a",
"list",
".",
"Useful",
"for",
"composition",
"to",
"avoid",
"mutating",
"a",
"list",
"reference",
"."
] | train | https://github.com/palatable/lambda/blob/b643ba836c5916d1d8193822e5efb4e7b40c489a/src/main/java/com/jnape/palatable/lambda/optics/lenses/ListLens.java#L32-L34 |
dbracewell/hermes | hermes-core/src/main/java/com/davidbracewell/hermes/HString.java | HString.rightContext | public HString rightContext(@NonNull AnnotationType type, int windowSize) {
"""
Right context h string.
@param type the type
@param windowSize the window size
@return the h string
"""
windowSize = Math.abs(windowSize);
Preconditions.checkArgument(windowSize >= 0);
int sentenceEnd =... | java | public HString rightContext(@NonNull AnnotationType type, int windowSize) {
windowSize = Math.abs(windowSize);
Preconditions.checkArgument(windowSize >= 0);
int sentenceEnd = sentence().end();
if (windowSize == 0 || end() >= sentenceEnd) {
return Fragments.detachedEmptyHString();
... | [
"public",
"HString",
"rightContext",
"(",
"@",
"NonNull",
"AnnotationType",
"type",
",",
"int",
"windowSize",
")",
"{",
"windowSize",
"=",
"Math",
".",
"abs",
"(",
"windowSize",
")",
";",
"Preconditions",
".",
"checkArgument",
"(",
"windowSize",
">=",
"0",
"... | Right context h string.
@param type the type
@param windowSize the window size
@return the h string | [
"Right",
"context",
"h",
"string",
"."
] | train | https://github.com/dbracewell/hermes/blob/9ebefe7ad5dea1b731ae6931a30771eb75325ea3/hermes-core/src/main/java/com/davidbracewell/hermes/HString.java#L879-L897 |
Pi4J/pi4j | pi4j-core/src/main/java/com/pi4j/wiringpi/Lcd.java | Lcd.lcdPuts | public static void lcdPuts(int handle, String data, String... args) {
"""
<p>Write formatted string of data to the LCD display.</p>
<p>(ATTENTION: the 'data' argument can only be a maximum of 512 characters.)</p>
@see <a
href="http://wiringpi.com/dev-lib/lcd-library/">http://wiringpi.com/dev-lib/lcd-library... | java | public static void lcdPuts(int handle, String data, String... args) {
lcdPuts(handle, String.format(data, (Object[]) args));
} | [
"public",
"static",
"void",
"lcdPuts",
"(",
"int",
"handle",
",",
"String",
"data",
",",
"String",
"...",
"args",
")",
"{",
"lcdPuts",
"(",
"handle",
",",
"String",
".",
"format",
"(",
"data",
",",
"(",
"Object",
"[",
"]",
")",
"args",
")",
")",
";... | <p>Write formatted string of data to the LCD display.</p>
<p>(ATTENTION: the 'data' argument can only be a maximum of 512 characters.)</p>
@see <a
href="http://wiringpi.com/dev-lib/lcd-library/">http://wiringpi.com/dev-lib/lcd-library/</a>
@param handle file handle
@param data format string to write
@param args strin... | [
"<p",
">",
"Write",
"formatted",
"string",
"of",
"data",
"to",
"the",
"LCD",
"display",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/wiringpi/Lcd.java#L269-L271 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/renderer/font/MalisisFont.java | MalisisFont.getMaxStringWidth | public float getMaxStringWidth(List<String> strings, FontOptions options) {
"""
Gets max rendering width of an array of string.
@param strings the strings
@param options the options
@return the max string width
"""
float width = 0;
for (String str : strings)
width = Math.max(width, getStringWidth(s... | java | public float getMaxStringWidth(List<String> strings, FontOptions options)
{
float width = 0;
for (String str : strings)
width = Math.max(width, getStringWidth(str, options));
return width;
}
/**
* Gets the rendering width of a character.
*
* @param c the c
* @param options the options
* @return t... | [
"public",
"float",
"getMaxStringWidth",
"(",
"List",
"<",
"String",
">",
"strings",
",",
"FontOptions",
"options",
")",
"{",
"float",
"width",
"=",
"0",
";",
"for",
"(",
"String",
"str",
":",
"strings",
")",
"width",
"=",
"Math",
".",
"max",
"(",
"widt... | Gets max rendering width of an array of string.
@param strings the strings
@param options the options
@return the max string width | [
"Gets",
"max",
"rendering",
"width",
"of",
"an",
"array",
"of",
"string",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/renderer/font/MalisisFont.java#L508-L531 |
watson-developer-cloud/java-sdk | discovery/src/main/java/com/ibm/watson/discovery/v1/query/AggregationDeserializer.java | AggregationDeserializer.parseArray | private void parseArray(JsonReader in, HashMap<String, Object> objMap, String name) throws IOException {
"""
Parses a JSON array and adds it to the main object map.
@param in {@link JsonReader} object used for parsing
@param objMap Map used to build the structure for the resulting {@link QueryAggregation} obje... | java | private void parseArray(JsonReader in, HashMap<String, Object> objMap, String name) throws IOException {
List<HashMap<String, Object>> array = new ArrayList<>();
in.beginArray();
while (in.peek() != JsonToken.END_ARRAY) {
HashMap<String, Object> arrayItem = new HashMap<>();
parseNext(in, arrayI... | [
"private",
"void",
"parseArray",
"(",
"JsonReader",
"in",
",",
"HashMap",
"<",
"String",
",",
"Object",
">",
"objMap",
",",
"String",
"name",
")",
"throws",
"IOException",
"{",
"List",
"<",
"HashMap",
"<",
"String",
",",
"Object",
">",
">",
"array",
"=",... | Parses a JSON array and adds it to the main object map.
@param in {@link JsonReader} object used for parsing
@param objMap Map used to build the structure for the resulting {@link QueryAggregation} object
@param name key value to go with the resulting value of this method pass
@throws IOException signals that there ha... | [
"Parses",
"a",
"JSON",
"array",
"and",
"adds",
"it",
"to",
"the",
"main",
"object",
"map",
"."
] | train | https://github.com/watson-developer-cloud/java-sdk/blob/c926117afd20e2002b69942537720ab733a914f3/discovery/src/main/java/com/ibm/watson/discovery/v1/query/AggregationDeserializer.java#L157-L169 |
padrig64/ValidationFramework | validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableMapProperty.java | AbstractReadableMapProperty.doNotifyListenersOfChangedValues | protected void doNotifyListenersOfChangedValues(Map<K, R> oldValues, Map<K, R> newValues) {
"""
Notifies the change listeners that values have been replaced.
<p>
Note that the specified maps of values will be wrapped in unmodifiable maps before being passed to the listeners.
@param oldValues Previous values.
... | java | protected void doNotifyListenersOfChangedValues(Map<K, R> oldValues, Map<K, R> newValues) {
List<MapValueChangeListener<K, R>> listenersCopy = new ArrayList<MapValueChangeListener<K, R>>(listeners);
Map<K, R> oldUnmodifiable = Collections.unmodifiableMap(oldValues);
Map<K, R> newUnmodifiable = C... | [
"protected",
"void",
"doNotifyListenersOfChangedValues",
"(",
"Map",
"<",
"K",
",",
"R",
">",
"oldValues",
",",
"Map",
"<",
"K",
",",
"R",
">",
"newValues",
")",
"{",
"List",
"<",
"MapValueChangeListener",
"<",
"K",
",",
"R",
">",
">",
"listenersCopy",
"... | Notifies the change listeners that values have been replaced.
<p>
Note that the specified maps of values will be wrapped in unmodifiable maps before being passed to the listeners.
@param oldValues Previous values.
@param newValues New values. | [
"Notifies",
"the",
"change",
"listeners",
"that",
"values",
"have",
"been",
"replaced",
".",
"<p",
">",
"Note",
"that",
"the",
"specified",
"maps",
"of",
"values",
"will",
"be",
"wrapped",
"in",
"unmodifiable",
"maps",
"before",
"being",
"passed",
"to",
"the... | train | https://github.com/padrig64/ValidationFramework/blob/2dd3c7b3403993db366d24a927645f467ccd1dda/validationframework-core/src/main/java/com/google/code/validationframework/base/property/AbstractReadableMapProperty.java#L108-L115 |
igniterealtime/Smack | smack-core/src/main/java/org/jivesoftware/smack/StanzaCollector.java | StanzaCollector.nextResultOrThrow | public <P extends Stanza> P nextResultOrThrow(long timeout) throws NoResponseException,
XMPPErrorException, InterruptedException, NotConnectedException {
"""
Returns the next available stanza. The method call will block until a stanza is
available or the <tt>timeout</tt> has elapsed. This meth... | java | public <P extends Stanza> P nextResultOrThrow(long timeout) throws NoResponseException,
XMPPErrorException, InterruptedException, NotConnectedException {
P result;
try {
result = nextResult(timeout);
} finally {
cancel();
}
if (result =... | [
"public",
"<",
"P",
"extends",
"Stanza",
">",
"P",
"nextResultOrThrow",
"(",
"long",
"timeout",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"InterruptedException",
",",
"NotConnectedException",
"{",
"P",
"result",
";",
"try",
"{",
"result... | Returns the next available stanza. The method call will block until a stanza is
available or the <tt>timeout</tt> has elapsed. This method does also cancel the
collector in every case.
<p>
Three things can happen when waiting for an response:
</p>
<ol>
<li>A result response arrives.</li>
<li>An error response arrives.<... | [
"Returns",
"the",
"next",
"available",
"stanza",
".",
"The",
"method",
"call",
"will",
"block",
"until",
"a",
"stanza",
"is",
"available",
"or",
"the",
"<tt",
">",
"timeout<",
"/",
"tt",
">",
"has",
"elapsed",
".",
"This",
"method",
"does",
"also",
"canc... | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-core/src/main/java/org/jivesoftware/smack/StanzaCollector.java#L278-L299 |
EdwardRaff/JSAT | JSAT/src/jsat/distributions/kernels/RBFKernel.java | RBFKernel.setSigma | public void setSigma(double sigma) {
"""
Sets the sigma parameter, which must be a positive value
@param sigma the sigma value
"""
if(sigma <= 0)
throw new IllegalArgumentException("Sigma must be a positive constant, not " + sigma);
this.sigma = sigma;
this.sigmaSqrd2Inv = ... | java | public void setSigma(double sigma)
{
if(sigma <= 0)
throw new IllegalArgumentException("Sigma must be a positive constant, not " + sigma);
this.sigma = sigma;
this.sigmaSqrd2Inv = 0.5/(sigma*sigma);
} | [
"public",
"void",
"setSigma",
"(",
"double",
"sigma",
")",
"{",
"if",
"(",
"sigma",
"<=",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Sigma must be a positive constant, not \"",
"+",
"sigma",
")",
";",
"this",
".",
"sigma",
"=",
"sigma",
";",... | Sets the sigma parameter, which must be a positive value
@param sigma the sigma value | [
"Sets",
"the",
"sigma",
"parameter",
"which",
"must",
"be",
"a",
"positive",
"value"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/distributions/kernels/RBFKernel.java#L79-L85 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_item_itemId_GET | public OvhItem cart_cartId_item_itemId_GET(String cartId, Long itemId) throws IOException {
"""
Retrieve information about a specific item of a cart
REST: GET /order/cart/{cartId}/item/{itemId}
@param cartId [required] Cart identifier
@param itemId [required] Product item identifier
"""
String qPath = "... | java | public OvhItem cart_cartId_item_itemId_GET(String cartId, Long itemId) throws IOException {
String qPath = "/order/cart/{cartId}/item/{itemId}";
StringBuilder sb = path(qPath, cartId, itemId);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhItem.class);
} | [
"public",
"OvhItem",
"cart_cartId_item_itemId_GET",
"(",
"String",
"cartId",
",",
"Long",
"itemId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}/item/{itemId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"cart... | Retrieve information about a specific item of a cart
REST: GET /order/cart/{cartId}/item/{itemId}
@param cartId [required] Cart identifier
@param itemId [required] Product item identifier | [
"Retrieve",
"information",
"about",
"a",
"specific",
"item",
"of",
"a",
"cart"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L8005-L8010 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_cron_id_PUT | public void serviceName_cron_id_PUT(String serviceName, Long id, OvhCron body) throws IOException {
"""
Alter this object properties
REST: PUT /hosting/web/{serviceName}/cron/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your hosting
@param id [required]... | java | public void serviceName_cron_id_PUT(String serviceName, Long id, OvhCron body) throws IOException {
String qPath = "/hosting/web/{serviceName}/cron/{id}";
StringBuilder sb = path(qPath, serviceName, id);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"serviceName_cron_id_PUT",
"(",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhCron",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/cron/{id}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",... | Alter this object properties
REST: PUT /hosting/web/{serviceName}/cron/{id}
@param body [required] New object properties
@param serviceName [required] The internal name of your hosting
@param id [required] Cron's id | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L2095-L2099 |
LMAX-Exchange/disruptor | src/main/java/com/lmax/disruptor/dsl/Disruptor.java | Disruptor.handleEventsWithWorkerPool | @SafeVarargs
@SuppressWarnings("varargs")
public final EventHandlerGroup<T> handleEventsWithWorkerPool(final WorkHandler<T>... workHandlers) {
"""
Set up a {@link WorkerPool} to distribute an event to one of a pool of work handler threads.
Each event will only be processed by one of the work handlers.
Th... | java | @SafeVarargs
@SuppressWarnings("varargs")
public final EventHandlerGroup<T> handleEventsWithWorkerPool(final WorkHandler<T>... workHandlers)
{
return createWorkerPool(new Sequence[0], workHandlers);
} | [
"@",
"SafeVarargs",
"@",
"SuppressWarnings",
"(",
"\"varargs\"",
")",
"public",
"final",
"EventHandlerGroup",
"<",
"T",
">",
"handleEventsWithWorkerPool",
"(",
"final",
"WorkHandler",
"<",
"T",
">",
"...",
"workHandlers",
")",
"{",
"return",
"createWorkerPool",
"(... | Set up a {@link WorkerPool} to distribute an event to one of a pool of work handler threads.
Each event will only be processed by one of the work handlers.
The Disruptor will automatically start this processors when {@link #start()} is called.
@param workHandlers the work handlers that will process events.
@return a {... | [
"Set",
"up",
"a",
"{",
"@link",
"WorkerPool",
"}",
"to",
"distribute",
"an",
"event",
"to",
"one",
"of",
"a",
"pool",
"of",
"work",
"handler",
"threads",
".",
"Each",
"event",
"will",
"only",
"be",
"processed",
"by",
"one",
"of",
"the",
"work",
"handle... | train | https://github.com/LMAX-Exchange/disruptor/blob/4266d00c5250190313446fdd7c8aa7a4edb5c818/src/main/java/com/lmax/disruptor/dsl/Disruptor.java#L233-L238 |
rundeck/rundeck | rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCombinedLdapLoginModule.java | JettyCombinedLdapLoginModule.getUserRoles | @Override
protected List getUserRoles(final DirContext dirContext, final String username)
throws LoginException, NamingException {
"""
Override to perform behavior of "ignoreRoles" option
@param dirContext context
@param username username
@return empty or supplemental roles list only if "i... | java | @Override
protected List getUserRoles(final DirContext dirContext, final String username)
throws LoginException, NamingException
{
if (_ignoreRoles) {
ArrayList<String> strings = new ArrayList<>();
addSupplementalRoles(strings);
return strings;
} e... | [
"@",
"Override",
"protected",
"List",
"getUserRoles",
"(",
"final",
"DirContext",
"dirContext",
",",
"final",
"String",
"username",
")",
"throws",
"LoginException",
",",
"NamingException",
"{",
"if",
"(",
"_ignoreRoles",
")",
"{",
"ArrayList",
"<",
"String",
">"... | Override to perform behavior of "ignoreRoles" option
@param dirContext context
@param username username
@return empty or supplemental roles list only if "ignoreRoles" is true, otherwise performs normal LDAP lookup
@throws LoginException
@throws NamingException | [
"Override",
"to",
"perform",
"behavior",
"of",
"ignoreRoles",
"option"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/rundeckapp/src/main/groovy/com/dtolabs/rundeck/jetty/jaas/JettyCombinedLdapLoginModule.java#L89-L100 |
strator-dev/greenpepper | samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java | AccountManager.isUserAssociatedToGroup | public boolean isUserAssociatedToGroup(String user, String group) {
"""
<p>isUserAssociatedToGroup.</p>
@param user a {@link java.lang.String} object.
@param group a {@link java.lang.String} object.
@return a boolean.
"""
if (!isUserExist(user))
{
throw new SystemException(String.format("User '%s' ... | java | public boolean isUserAssociatedToGroup(String user, String group)
{
if (!isUserExist(user))
{
throw new SystemException(String.format("User '%s' does not exist.", user));
}
if (!isGroupExist(group))
{
throw new SystemException(String.format("Group '%s' does not exist.", group));
}
List<String> us... | [
"public",
"boolean",
"isUserAssociatedToGroup",
"(",
"String",
"user",
",",
"String",
"group",
")",
"{",
"if",
"(",
"!",
"isUserExist",
"(",
"user",
")",
")",
"{",
"throw",
"new",
"SystemException",
"(",
"String",
".",
"format",
"(",
"\"User '%s' does not exis... | <p>isUserAssociatedToGroup.</p>
@param user a {@link java.lang.String} object.
@param group a {@link java.lang.String} object.
@return a boolean. | [
"<p",
">",
"isUserAssociatedToGroup",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/samples-application/src/main/java/com/greenpepper/samples/application/system/AccountManager.java#L211-L226 |
Azure/azure-sdk-for-java | authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java | DenyAssignmentsInner.getAsync | public Observable<DenyAssignmentInner> getAsync(String scope, String denyAssignmentId) {
"""
Get the specified deny assignment.
@param scope The scope of the deny assignment.
@param denyAssignmentId The ID of the deny assignment to get.
@throws IllegalArgumentException thrown if parameters fail the validation... | java | public Observable<DenyAssignmentInner> getAsync(String scope, String denyAssignmentId) {
return getWithServiceResponseAsync(scope, denyAssignmentId).map(new Func1<ServiceResponse<DenyAssignmentInner>, DenyAssignmentInner>() {
@Override
public DenyAssignmentInner call(ServiceResponse<Deny... | [
"public",
"Observable",
"<",
"DenyAssignmentInner",
">",
"getAsync",
"(",
"String",
"scope",
",",
"String",
"denyAssignmentId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"scope",
",",
"denyAssignmentId",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"... | Get the specified deny assignment.
@param scope The scope of the deny assignment.
@param denyAssignmentId The ID of the deny assignment to get.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the DenyAssignmentInner object | [
"Get",
"the",
"specified",
"deny",
"assignment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/authorization/resource-manager/v2018_09_01_preview/src/main/java/com/microsoft/azure/management/authorization/v2018_09_01_preview/implementation/DenyAssignmentsInner.java#L861-L868 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java | MessageSelectorBuilder.fromKeyValueMap | public static MessageSelectorBuilder fromKeyValueMap(Map<String, Object> valueMap) {
"""
Static builder method using a key value map.
@param valueMap
@return
"""
StringBuffer buf = new StringBuffer();
Iterator<Entry<String, Object>> iter = valueMap.entrySet().iterator();
if (iter.ha... | java | public static MessageSelectorBuilder fromKeyValueMap(Map<String, Object> valueMap) {
StringBuffer buf = new StringBuffer();
Iterator<Entry<String, Object>> iter = valueMap.entrySet().iterator();
if (iter.hasNext()) {
Entry<String, Object> entry = iter.next();
String key... | [
"public",
"static",
"MessageSelectorBuilder",
"fromKeyValueMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"valueMap",
")",
"{",
"StringBuffer",
"buf",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"Iterator",
"<",
"Entry",
"<",
"String",
",",
"Object",
">... | Static builder method using a key value map.
@param valueMap
@return | [
"Static",
"builder",
"method",
"using",
"a",
"key",
"value",
"map",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/message/MessageSelectorBuilder.java#L77-L99 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java | EthereumUtil.convertVarNumberToBigInteger | public static BigInteger convertVarNumberToBigInteger(byte[] rawData) {
"""
*
Converts a variable size number (e.g. byte,short,int,long) in a RLPElement to long
@param rawData byte array containing variable number
@return number as long or null if not a correct number
"""
BigInteger result=BigInteger.ZE... | java | public static BigInteger convertVarNumberToBigInteger(byte[] rawData) {
BigInteger result=BigInteger.ZERO;
if (rawData!=null) {
if (rawData.length>0) {
result = new BigInteger(1,rawData); // we know it is always positive
}
}
return result;
} | [
"public",
"static",
"BigInteger",
"convertVarNumberToBigInteger",
"(",
"byte",
"[",
"]",
"rawData",
")",
"{",
"BigInteger",
"result",
"=",
"BigInteger",
".",
"ZERO",
";",
"if",
"(",
"rawData",
"!=",
"null",
")",
"{",
"if",
"(",
"rawData",
".",
"length",
">... | *
Converts a variable size number (e.g. byte,short,int,long) in a RLPElement to long
@param rawData byte array containing variable number
@return number as long or null if not a correct number | [
"*",
"Converts",
"a",
"variable",
"size",
"number",
"(",
"e",
".",
"g",
".",
"byte",
"short",
"int",
"long",
")",
"in",
"a",
"RLPElement",
"to",
"long"
] | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/ethereum/format/common/EthereumUtil.java#L540-L548 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/util/HierarchicalTable.java | HierarchicalTable.setHandle | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException {
"""
Reposition to this record Using this bookmark.
@exception DBException File exception.
"""
Record recMain = this.getRecord();
this.setCurrentTable(this.getNextTable());
FieldList record = super.setHand... | java | public FieldList setHandle(Object bookmark, int iHandleType) throws DBException
{
Record recMain = this.getRecord();
this.setCurrentTable(this.getNextTable());
FieldList record = super.setHandle(bookmark, iHandleType);
if (record == null)
{ // Not found in the main... | [
"public",
"FieldList",
"setHandle",
"(",
"Object",
"bookmark",
",",
"int",
"iHandleType",
")",
"throws",
"DBException",
"{",
"Record",
"recMain",
"=",
"this",
".",
"getRecord",
"(",
")",
";",
"this",
".",
"setCurrentTable",
"(",
"this",
".",
"getNextTable",
... | Reposition to this record Using this bookmark.
@exception DBException File exception. | [
"Reposition",
"to",
"this",
"record",
"Using",
"this",
"bookmark",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/util/HierarchicalTable.java#L307-L333 |
molgenis/molgenis | molgenis-navigator/src/main/java/org/molgenis/navigator/copy/service/PackageCopier.java | PackageCopier.assignUniqueLabel | private void assignUniqueLabel(Package pack, Package targetPackage) {
"""
Checks if there's a Package in the target location with the same label. If so, keeps adding a
postfix until the label is unique.
"""
Set<String> existingLabels;
if (targetPackage != null) {
existingLabels = stream(targetPa... | java | private void assignUniqueLabel(Package pack, Package targetPackage) {
Set<String> existingLabels;
if (targetPackage != null) {
existingLabels = stream(targetPackage.getChildren()).map(Package::getLabel).collect(toSet());
} else {
existingLabels =
dataService
.query(PACKAG... | [
"private",
"void",
"assignUniqueLabel",
"(",
"Package",
"pack",
",",
"Package",
"targetPackage",
")",
"{",
"Set",
"<",
"String",
">",
"existingLabels",
";",
"if",
"(",
"targetPackage",
"!=",
"null",
")",
"{",
"existingLabels",
"=",
"stream",
"(",
"targetPackag... | Checks if there's a Package in the target location with the same label. If so, keeps adding a
postfix until the label is unique. | [
"Checks",
"if",
"there",
"s",
"a",
"Package",
"in",
"the",
"target",
"location",
"with",
"the",
"same",
"label",
".",
"If",
"so",
"keeps",
"adding",
"a",
"postfix",
"until",
"the",
"label",
"is",
"unique",
"."
] | train | https://github.com/molgenis/molgenis/blob/b4d0d6b27e6f6c8d7505a3863dc03b589601f987/molgenis-navigator/src/main/java/org/molgenis/navigator/copy/service/PackageCopier.java#L62-L76 |
orbisgis/h2gis | h2gis-network/src/main/java/org/h2gis/network/functions/ST_GraphAnalysis.java | ST_GraphAnalysis.doGraphAnalysis | public static boolean doGraphAnalysis(Connection connection,
String inputTable,
String orientation)
throws SQLException, NoSuchMethodException, InstantiationException,
IllegalAccessException, InvocationTargetExce... | java | public static boolean doGraphAnalysis(Connection connection,
String inputTable,
String orientation)
throws SQLException, NoSuchMethodException, InstantiationException,
IllegalAccessException, InvocationTargetExce... | [
"public",
"static",
"boolean",
"doGraphAnalysis",
"(",
"Connection",
"connection",
",",
"String",
"inputTable",
",",
"String",
"orientation",
")",
"throws",
"SQLException",
",",
"NoSuchMethodException",
",",
"InstantiationException",
",",
"IllegalAccessException",
",",
... | Calculate centrality indices on the nodes and edges of a graph
constructed from the input table.
@param connection Connection
@param inputTable Input table
@param orientation Global orientation
@return True if the calculation was successful
@throws SQLException
@throws NoSuchMethodException
@throws InstantiationExce... | [
"Calculate",
"centrality",
"indices",
"on",
"the",
"nodes",
"and",
"edges",
"of",
"a",
"graph",
"constructed",
"from",
"the",
"input",
"table",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-network/src/main/java/org/h2gis/network/functions/ST_GraphAnalysis.java#L104-L110 |
pryzach/midao | midao-jdbc-dbcp-1-4/src/main/java/org/midao/jdbc/core/pool/MjdbcPoolBinder.java | MjdbcPoolBinder.createDataSource | public static DataSource createDataSource(String driverClassName, String url, String userName, String password) throws SQLException {
"""
Returns new Pooled {@link DataSource} implementation
<p/>
In case this function won't work - use {@link #createDataSource(java.util.Properties)}
@param driverClassName Driv... | java | public static DataSource createDataSource(String driverClassName, String url, String userName, String password) throws SQLException {
return createDataSource(driverClassName, url, userName, password, 10, 100);
} | [
"public",
"static",
"DataSource",
"createDataSource",
"(",
"String",
"driverClassName",
",",
"String",
"url",
",",
"String",
"userName",
",",
"String",
"password",
")",
"throws",
"SQLException",
"{",
"return",
"createDataSource",
"(",
"driverClassName",
",",
"url",
... | Returns new Pooled {@link DataSource} implementation
<p/>
In case this function won't work - use {@link #createDataSource(java.util.Properties)}
@param driverClassName Driver Class name
@param url Database connection url
@param userName Database user name
@param password Database user passwor... | [
"Returns",
"new",
"Pooled",
"{",
"@link",
"DataSource",
"}",
"implementation",
"<p",
"/",
">",
"In",
"case",
"this",
"function",
"won",
"t",
"work",
"-",
"use",
"{",
"@link",
"#createDataSource",
"(",
"java",
".",
"util",
".",
"Properties",
")",
"}"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-dbcp-1-4/src/main/java/org/midao/jdbc/core/pool/MjdbcPoolBinder.java#L103-L105 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/map/MapModel.java | MapModel.addLayerWithoutFireEvent | private void addLayerWithoutFireEvent(ClientLayerInfo layerInfo) {
"""
Add a layer to the map, but do not fire an event for update.
@param layerInfo the client layer info
"""
switch (layerInfo.getLayerType()) {
case RASTER:
if (layerInfo instanceof ClientWmsLayerInfo) {
InternalClientWmsLayer
... | java | private void addLayerWithoutFireEvent(ClientLayerInfo layerInfo) {
switch (layerInfo.getLayerType()) {
case RASTER:
if (layerInfo instanceof ClientWmsLayerInfo) {
InternalClientWmsLayer
internalClientWmsLayer = new InternalClientWmsLayer(this, (ClientWmsLayerInfo) layerInfo);
layers.add(intern... | [
"private",
"void",
"addLayerWithoutFireEvent",
"(",
"ClientLayerInfo",
"layerInfo",
")",
"{",
"switch",
"(",
"layerInfo",
".",
"getLayerType",
"(",
")",
")",
"{",
"case",
"RASTER",
":",
"if",
"(",
"layerInfo",
"instanceof",
"ClientWmsLayerInfo",
")",
"{",
"Inter... | Add a layer to the map, but do not fire an event for update.
@param layerInfo the client layer info | [
"Add",
"a",
"layer",
"to",
"the",
"map",
"but",
"do",
"not",
"fire",
"an",
"event",
"for",
"update",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/MapModel.java#L1069-L1087 |
actorapp/droidkit-actors | actors/src/main/java/com/droidkit/actors/Actor.java | Actor.initActor | public final void initActor(UUID uuid, String path, ActorContext context, Mailbox mailbox) {
"""
<p>INTERNAL API</p>
Initialization of actor
@param uuid uuid of actor
@param path path of actor
@param context context of actor
@param mailbox mailbox of actor
"""
this.uuid = uuid;
thi... | java | public final void initActor(UUID uuid, String path, ActorContext context, Mailbox mailbox) {
this.uuid = uuid;
this.path = path;
this.context = context;
this.mailbox = mailbox;
this.askPattern = new ActorAskImpl(self());
this.typedAsk = new TypedAskExtensions(self());
... | [
"public",
"final",
"void",
"initActor",
"(",
"UUID",
"uuid",
",",
"String",
"path",
",",
"ActorContext",
"context",
",",
"Mailbox",
"mailbox",
")",
"{",
"this",
".",
"uuid",
"=",
"uuid",
";",
"this",
".",
"path",
"=",
"path",
";",
"this",
".",
"context... | <p>INTERNAL API</p>
Initialization of actor
@param uuid uuid of actor
@param path path of actor
@param context context of actor
@param mailbox mailbox of actor | [
"<p",
">",
"INTERNAL",
"API<",
"/",
"p",
">",
"Initialization",
"of",
"actor"
] | train | https://github.com/actorapp/droidkit-actors/blob/fdb72fcfdd1c5e54a970f203a33a71fa54344217/actors/src/main/java/com/droidkit/actors/Actor.java#L49-L61 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/event/CheckMoveHandler.java | CheckMoveHandler.init | public void init(BaseField field, BaseField fldDest, BaseField fldSource) {
"""
Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param fldDest The destination field.
@param fldSource The source field.
"""
super.init(field, fldDest, fldSource, fals... | java | public void init(BaseField field, BaseField fldDest, BaseField fldSource)
{
super.init(field, fldDest, fldSource, false, false, false);
} | [
"public",
"void",
"init",
"(",
"BaseField",
"field",
",",
"BaseField",
"fldDest",
",",
"BaseField",
"fldSource",
")",
"{",
"super",
".",
"init",
"(",
"field",
",",
"fldDest",
",",
"fldSource",
",",
"false",
",",
"false",
",",
"false",
")",
";",
"}"
] | Constructor.
@param field The basefield owner of this listener (usually null and set on setOwner()).
@param fldDest The destination field.
@param fldSource The source field. | [
"Constructor",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/event/CheckMoveHandler.java#L50-L53 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/SerializationUtil.java | SerializationUtil.writeNullablePartitionIdSet | public static void writeNullablePartitionIdSet(PartitionIdSet partitionIds, ObjectDataOutput out) throws IOException {
"""
Writes a nullable {@link PartitionIdSet} to the given data output.
@param partitionIds
@param out
@throws IOException
"""
if (partitionIds == null) {
out.writeInt(-1... | java | public static void writeNullablePartitionIdSet(PartitionIdSet partitionIds, ObjectDataOutput out) throws IOException {
if (partitionIds == null) {
out.writeInt(-1);
return;
}
out.writeInt(partitionIds.getPartitionCount());
out.writeInt(partitionIds.size());
... | [
"public",
"static",
"void",
"writeNullablePartitionIdSet",
"(",
"PartitionIdSet",
"partitionIds",
",",
"ObjectDataOutput",
"out",
")",
"throws",
"IOException",
"{",
"if",
"(",
"partitionIds",
"==",
"null",
")",
"{",
"out",
".",
"writeInt",
"(",
"-",
"1",
")",
... | Writes a nullable {@link PartitionIdSet} to the given data output.
@param partitionIds
@param out
@throws IOException | [
"Writes",
"a",
"nullable",
"{"
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/internal/serialization/impl/SerializationUtil.java#L275-L286 |
nguyenq/tess4j | src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java | ImageIOHelper.deskewImage | public static File deskewImage(File imageFile, double minimumDeskewThreshold) throws IOException {
"""
Deskews image.
@param imageFile input image
@param minimumDeskewThreshold minimum deskew threshold (typically, 0.05d)
@return temporary multi-page TIFF image file
@throws IOException
"""
List<Bu... | java | public static File deskewImage(File imageFile, double minimumDeskewThreshold) throws IOException {
List<BufferedImage> imageList = getImageList(imageFile);
for (int i = 0; i < imageList.size(); i++) {
BufferedImage bi = imageList.get(i);
ImageDeskew deskew = new ImageDeskew(bi);
... | [
"public",
"static",
"File",
"deskewImage",
"(",
"File",
"imageFile",
",",
"double",
"minimumDeskewThreshold",
")",
"throws",
"IOException",
"{",
"List",
"<",
"BufferedImage",
">",
"imageList",
"=",
"getImageList",
"(",
"imageFile",
")",
";",
"for",
"(",
"int",
... | Deskews image.
@param imageFile input image
@param minimumDeskewThreshold minimum deskew threshold (typically, 0.05d)
@return temporary multi-page TIFF image file
@throws IOException | [
"Deskews",
"image",
"."
] | train | https://github.com/nguyenq/tess4j/blob/cfcd4a8a44042f150b4aaf7bdf5ffc485a2236e1/src/main/java/net/sourceforge/tess4j/util/ImageIOHelper.java#L604-L621 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java | Configuration.registerTableOverride | @Deprecated
public SchemaAndTable registerTableOverride(SchemaAndTable from, SchemaAndTable to) {
"""
Register a schema specific table override
@param from schema and table to override
@param to override
@return previous override
@deprecated Use {@link #setDynamicNameMapping(NameMapping)} instead.
... | java | @Deprecated
public SchemaAndTable registerTableOverride(SchemaAndTable from, SchemaAndTable to) {
return internalNameMapping.registerTableOverride(from, to);
} | [
"@",
"Deprecated",
"public",
"SchemaAndTable",
"registerTableOverride",
"(",
"SchemaAndTable",
"from",
",",
"SchemaAndTable",
"to",
")",
"{",
"return",
"internalNameMapping",
".",
"registerTableOverride",
"(",
"from",
",",
"to",
")",
";",
"}"
] | Register a schema specific table override
@param from schema and table to override
@param to override
@return previous override
@deprecated Use {@link #setDynamicNameMapping(NameMapping)} instead. | [
"Register",
"a",
"schema",
"specific",
"table",
"override"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/Configuration.java#L382-L385 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/capability/RuntimeCapability.java | RuntimeCapability.getCapabilityServiceName | public ServiceName getCapabilityServiceName(PathAddress address, Class<?> serviceValueType) {
"""
Gets the name of service provided by this capability.
@param address the path from which dynamic portion of the capability name is calculated from. Cannot be {@code null}
@param serviceValueType the expected type ... | java | public ServiceName getCapabilityServiceName(PathAddress address, Class<?> serviceValueType) {
return fromBaseCapability(address).getCapabilityServiceName(serviceValueType);
} | [
"public",
"ServiceName",
"getCapabilityServiceName",
"(",
"PathAddress",
"address",
",",
"Class",
"<",
"?",
">",
"serviceValueType",
")",
"{",
"return",
"fromBaseCapability",
"(",
"address",
")",
".",
"getCapabilityServiceName",
"(",
"serviceValueType",
")",
";",
"}... | Gets the name of service provided by this capability.
@param address the path from which dynamic portion of the capability name is calculated from. Cannot be {@code null}
@param serviceValueType the expected type of the service's value. Only used to provide validate that
the service value type provided by the capabili... | [
"Gets",
"the",
"name",
"of",
"service",
"provided",
"by",
"this",
"capability",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/capability/RuntimeCapability.java#L215-L217 |
google/closure-compiler | src/com/google/javascript/jscomp/NodeUtil.java | NodeUtil.getDeclaringParent | public static Node getDeclaringParent(Node targetNode) {
"""
Returns the node that is effectively declaring the given target.
<p>Examples:
<pre><code>
const a = 1; // getDeclaringParent(a) returns CONST
let {[expression]: [x = 3]} = obj; // getDeclaringParent(x) returns LET
function foo({a, b}) {}; // get... | java | public static Node getDeclaringParent(Node targetNode) {
Node rootTarget = getRootTarget(targetNode);
Node parent = rootTarget.getParent();
if (parent.isRest() || parent.isDefaultValue()) {
// e.g. `function foo(targetNode1 = default, ...targetNode2) {}`
parent = parent.getParent();
checkS... | [
"public",
"static",
"Node",
"getDeclaringParent",
"(",
"Node",
"targetNode",
")",
"{",
"Node",
"rootTarget",
"=",
"getRootTarget",
"(",
"targetNode",
")",
";",
"Node",
"parent",
"=",
"rootTarget",
".",
"getParent",
"(",
")",
";",
"if",
"(",
"parent",
".",
... | Returns the node that is effectively declaring the given target.
<p>Examples:
<pre><code>
const a = 1; // getDeclaringParent(a) returns CONST
let {[expression]: [x = 3]} = obj; // getDeclaringParent(x) returns LET
function foo({a, b}) {}; // getDeclaringParent(a) returns PARAM_LIST
function foo(a = 1) {}; // getDecla... | [
"Returns",
"the",
"node",
"that",
"is",
"effectively",
"declaring",
"the",
"given",
"target",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/NodeUtil.java#L3439-L3474 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UResourceBundle.java | UResourceBundle.getBundleInstance | public static UResourceBundle getBundleInstance(String baseName, ULocale locale,
ClassLoader loader) {
"""
<strong>[icu]</strong> Creates a UResourceBundle, from which users can extract resources by using
their corresponding keys.<br><br>
Note: Please use this ... | java | public static UResourceBundle getBundleInstance(String baseName, ULocale locale,
ClassLoader loader) {
if (baseName == null) {
baseName = ICUData.ICU_BASE_NAME;
}
if (locale == null) {
locale = ULocale.getDefault();
... | [
"public",
"static",
"UResourceBundle",
"getBundleInstance",
"(",
"String",
"baseName",
",",
"ULocale",
"locale",
",",
"ClassLoader",
"loader",
")",
"{",
"if",
"(",
"baseName",
"==",
"null",
")",
"{",
"baseName",
"=",
"ICUData",
".",
"ICU_BASE_NAME",
";",
"}",
... | <strong>[icu]</strong> Creates a UResourceBundle, from which users can extract resources by using
their corresponding keys.<br><br>
Note: Please use this API for loading non-ICU resources. Java security does not
allow loading of resources across jar files. You must provide your class loader
to load the resources
@param... | [
"<strong",
">",
"[",
"icu",
"]",
"<",
"/",
"strong",
">",
"Creates",
"a",
"UResourceBundle",
"from",
"which",
"users",
"can",
"extract",
"resources",
"by",
"using",
"their",
"corresponding",
"keys",
".",
"<br",
">",
"<br",
">",
"Note",
":",
"Please",
"us... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/UResourceBundle.java#L261-L270 |
codescape/bitvunit | bitvunit-core/src/main/java/de/codescape/bitvunit/report/TextReportWriter.java | TextReportWriter.printTitle | private void printTitle(HtmlPage htmlPage, PrintWriter out) {
"""
Writes the header.
@param htmlPage {@link HtmlPage} that was inspected
@param out target where the report is written to
"""
out.println(String.format("BitvUnit %s Report - %s - %s", getBitvUnitVersion(), htmlPage.getUrl(), getFo... | java | private void printTitle(HtmlPage htmlPage, PrintWriter out) {
out.println(String.format("BitvUnit %s Report - %s - %s", getBitvUnitVersion(), htmlPage.getUrl(), getFormattedDate()));
} | [
"private",
"void",
"printTitle",
"(",
"HtmlPage",
"htmlPage",
",",
"PrintWriter",
"out",
")",
"{",
"out",
".",
"println",
"(",
"String",
".",
"format",
"(",
"\"BitvUnit %s Report - %s - %s\"",
",",
"getBitvUnitVersion",
"(",
")",
",",
"htmlPage",
".",
"getUrl",
... | Writes the header.
@param htmlPage {@link HtmlPage} that was inspected
@param out target where the report is written to | [
"Writes",
"the",
"header",
"."
] | train | https://github.com/codescape/bitvunit/blob/cef6d9af60d684e41294981c10b6d92c8f063a4e/bitvunit-core/src/main/java/de/codescape/bitvunit/report/TextReportWriter.java#L49-L51 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java | ApiOvhDedicatedCloud.serviceName_datacenter_datacenterId_host_hostId_hourlyConsumption_GET | public net.minidev.ovh.api.dedicatedcloud.host.OvhHourlyConsumption serviceName_datacenter_datacenterId_host_hostId_hourlyConsumption_GET(String serviceName, Long datacenterId, Long hostId) throws IOException {
"""
Hourly consumption associated with this host.
REST: GET /dedicatedCloud/{serviceName}/datacenter/... | java | public net.minidev.ovh.api.dedicatedcloud.host.OvhHourlyConsumption serviceName_datacenter_datacenterId_host_hostId_hourlyConsumption_GET(String serviceName, Long datacenterId, Long hostId) throws IOException {
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/host/{hostId}/hourlyConsumption";
... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"dedicatedcloud",
".",
"host",
".",
"OvhHourlyConsumption",
"serviceName_datacenter_datacenterId_host_hostId_hourlyConsumption_GET",
"(",
"String",
"serviceName",
",",
"Long",
"datacenterId",
",",
"Long",
"ho... | Hourly consumption associated with this host.
REST: GET /dedicatedCloud/{serviceName}/datacenter/{datacenterId}/host/{hostId}/hourlyConsumption
@param serviceName [required] Domain of the service
@param datacenterId [required]
@param hostId [required] Id of the host | [
"Hourly",
"consumption",
"associated",
"with",
"this",
"host",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedCloud/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedCloud.java#L1605-L1610 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckMethodAdapter.java | CheckMethodAdapter.checkSignedByte | static void checkSignedByte(final int value, final String msg) {
"""
Checks that the given value is a signed byte.
@param value
the value to be checked.
@param msg
an message to be used in case of error.
"""
if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
throw new IllegalArgu... | java | static void checkSignedByte(final int value, final String msg) {
if (value < Byte.MIN_VALUE || value > Byte.MAX_VALUE) {
throw new IllegalArgumentException(msg
+ " (must be a signed byte): " + value);
}
} | [
"static",
"void",
"checkSignedByte",
"(",
"final",
"int",
"value",
",",
"final",
"String",
"msg",
")",
"{",
"if",
"(",
"value",
"<",
"Byte",
".",
"MIN_VALUE",
"||",
"value",
">",
"Byte",
".",
"MAX_VALUE",
")",
"{",
"throw",
"new",
"IllegalArgumentException... | Checks that the given value is a signed byte.
@param value
the value to be checked.
@param msg
an message to be used in case of error. | [
"Checks",
"that",
"the",
"given",
"value",
"is",
"a",
"signed",
"byte",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckMethodAdapter.java#L1110-L1115 |
imsweb/naaccr-xml | src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java | NaaccrXmlUtils.lineToPatient | public static Patient lineToPatient(String line, NaaccrContext context) throws NaaccrIOException {
"""
Translates a single line representing a flat file line into a patient object. The resulting patient will have 0 or 1 tumor.
<br/><br/>
Unlike the methods dealing with files, this method takes a context as a par... | java | public static Patient lineToPatient(String line, NaaccrContext context) throws NaaccrIOException {
if (line == null)
throw new NaaccrIOException("Line is required");
if (context == null)
throw new NaaccrIOException("Context is required");
NaaccrFormat format = NaaccrForm... | [
"public",
"static",
"Patient",
"lineToPatient",
"(",
"String",
"line",
",",
"NaaccrContext",
"context",
")",
"throws",
"NaaccrIOException",
"{",
"if",
"(",
"line",
"==",
"null",
")",
"throw",
"new",
"NaaccrIOException",
"(",
"\"Line is required\"",
")",
";",
"if... | Translates a single line representing a flat file line into a patient object. The resulting patient will have 0 or 1 tumor.
<br/><br/>
Unlike the methods dealing with files, this method takes a context as a parameter. The reason for that difference is that this method uses a stream to convert
the line, and so the strea... | [
"Translates",
"a",
"single",
"line",
"representing",
"a",
"flat",
"file",
"line",
"into",
"a",
"patient",
"object",
".",
"The",
"resulting",
"patient",
"will",
"have",
"0",
"or",
"1",
"tumor",
".",
"<br",
"/",
">",
"<br",
"/",
">",
"Unlike",
"the",
"me... | train | https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/NaaccrXmlUtils.java#L274-L296 |
caelum/vraptor4 | vraptor-core/src/main/java/br/com/caelum/vraptor/view/DefaultLogicResult.java | DefaultLogicResult.forwardTo | @Override
public <T> T forwardTo(final Class<T> type) {
"""
This implementation don't actually use request dispatcher for the
forwarding. It runs forwarding logic, and renders its <b>default</b>
view.
"""
return proxifier.proxify(type, new MethodInvocation<T>() {
@Override
public Object intercept(T... | java | @Override
public <T> T forwardTo(final Class<T> type) {
return proxifier.proxify(type, new MethodInvocation<T>() {
@Override
public Object intercept(T proxy, Method method, Object[] args, SuperMethod superMethod) {
try {
logger.debug("Executing {}", method);
ControllerMethod old = methodInfo.get... | [
"@",
"Override",
"public",
"<",
"T",
">",
"T",
"forwardTo",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"proxifier",
".",
"proxify",
"(",
"type",
",",
"new",
"MethodInvocation",
"<",
"T",
">",
"(",
")",
"{",
"@",
"Override",
"... | This implementation don't actually use request dispatcher for the
forwarding. It runs forwarding logic, and renders its <b>default</b>
view. | [
"This",
"implementation",
"don",
"t",
"actually",
"use",
"request",
"dispatcher",
"for",
"the",
"forwarding",
".",
"It",
"runs",
"forwarding",
"logic",
"and",
"renders",
"its",
"<b",
">",
"default<",
"/",
"b",
">",
"view",
"."
] | train | https://github.com/caelum/vraptor4/blob/593ce9ad60f9d38c360881b2132417c56b8cc093/vraptor-core/src/main/java/br/com/caelum/vraptor/view/DefaultLogicResult.java#L97-L131 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/spex/SXTag.java | SXTag.addAttribute | public synchronized void addAttribute(String aName, String aValue) throws IOException {
"""
Adds an attribute to this tag node.
Will result in something like: <code><i>aName</i>=<i>aValue</i></code>
<b>WARNING:</b>
<ul>
<li>Attributes must be added immediately after creation of a tag, i.e.:</li>
<li>All attri... | java | public synchronized void addAttribute(String aName, String aValue) throws IOException {
// reject modification of already closed node
if(isOpen==false) {
throw new IOException("Attempted to add attribute '" + aName + "' to already closed tag '" + name + "'!");
}
// check for sane input
if((aName==null) || ... | [
"public",
"synchronized",
"void",
"addAttribute",
"(",
"String",
"aName",
",",
"String",
"aValue",
")",
"throws",
"IOException",
"{",
"// reject modification of already closed node",
"if",
"(",
"isOpen",
"==",
"false",
")",
"{",
"throw",
"new",
"IOException",
"(",
... | Adds an attribute to this tag node.
Will result in something like: <code><i>aName</i>=<i>aValue</i></code>
<b>WARNING:</b>
<ul>
<li>Attributes must be added immediately after creation of a tag, i.e.:</li>
<li>All attributes must have been added <b>before</b> adding the first child node.</li>
</ul>
@param aName Name, i... | [
"Adds",
"an",
"attribute",
"to",
"this",
"tag",
"node",
".",
"Will",
"result",
"in",
"something",
"like",
":",
"<code",
">",
"<i",
">",
"aName<",
"/",
"i",
">",
"=",
"<i",
">",
"aValue<",
"/",
"i",
">",
"<",
"/",
"code",
">",
"<b",
">",
"WARNING"... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/spex/SXTag.java#L111-L134 |
offbynull/coroutines | instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java | GenericGenerators.combineObjectArrays | public static InsnList combineObjectArrays(Variable destArrayVar, Variable firstArrayVar, Variable secondArrayVar) {
"""
Concatenates two object arrays together.
@param destArrayVar variable to put concatenated object array in
@param firstArrayVar variable of first object array
@param secondArrayVar variable of... | java | public static InsnList combineObjectArrays(Variable destArrayVar, Variable firstArrayVar, Variable secondArrayVar) {
Validate.notNull(destArrayVar);
Validate.notNull(firstArrayVar);
Validate.notNull(secondArrayVar);
Validate.isTrue(destArrayVar.getType().equals(Type.getType(Object[].clas... | [
"public",
"static",
"InsnList",
"combineObjectArrays",
"(",
"Variable",
"destArrayVar",
",",
"Variable",
"firstArrayVar",
",",
"Variable",
"secondArrayVar",
")",
"{",
"Validate",
".",
"notNull",
"(",
"destArrayVar",
")",
";",
"Validate",
".",
"notNull",
"(",
"firs... | Concatenates two object arrays together.
@param destArrayVar variable to put concatenated object array in
@param firstArrayVar variable of first object array
@param secondArrayVar variable of second object array
@return instructions to create a new object array where the first part of the array is the contents of {@cod... | [
"Concatenates",
"two",
"object",
"arrays",
"together",
"."
] | train | https://github.com/offbynull/coroutines/blob/b1b83c293945f53a2f63fca8f15a53e88b796bf5/instrumenter/src/main/java/com/offbynull/coroutines/instrumenter/generators/GenericGenerators.java#L850-L887 |
netty/netty | common/src/main/java/io/netty/util/concurrent/GlobalEventExecutor.java | GlobalEventExecutor.awaitInactivity | public boolean awaitInactivity(long timeout, TimeUnit unit) throws InterruptedException {
"""
Waits until the worker thread of this executor has no tasks left in its task queue and terminates itself.
Because a new worker thread will be started again when a new task is submitted, this operation is only useful
whe... | java | public boolean awaitInactivity(long timeout, TimeUnit unit) throws InterruptedException {
if (unit == null) {
throw new NullPointerException("unit");
}
final Thread thread = this.thread;
if (thread == null) {
throw new IllegalStateException("thread was not starte... | [
"public",
"boolean",
"awaitInactivity",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"throws",
"InterruptedException",
"{",
"if",
"(",
"unit",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"unit\"",
")",
";",
"}",
"final",
"... | Waits until the worker thread of this executor has no tasks left in its task queue and terminates itself.
Because a new worker thread will be started again when a new task is submitted, this operation is only useful
when you want to ensure that the worker thread is terminated <strong>after</strong> your application is ... | [
"Waits",
"until",
"the",
"worker",
"thread",
"of",
"this",
"executor",
"has",
"no",
"tasks",
"left",
"in",
"its",
"task",
"queue",
"and",
"terminates",
"itself",
".",
"Because",
"a",
"new",
"worker",
"thread",
"will",
"be",
"started",
"again",
"when",
"a",... | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/common/src/main/java/io/netty/util/concurrent/GlobalEventExecutor.java#L194-L205 |
alkacon/opencms-core | src/org/opencms/importexport/CmsImportVersion10.java | CmsImportVersion10.addRelation | public void addRelation() {
"""
Adds a relation to be imported from the current xml data.<p>
@see #addResourceRelationRules(Digester, String)
"""
try {
if (m_throwable != null) {
// relation data is corrupt, ignore relation
if (LOG.isWarnEnabled()) {
... | java | public void addRelation() {
try {
if (m_throwable != null) {
// relation data is corrupt, ignore relation
if (LOG.isWarnEnabled()) {
LOG.warn(
Messages.get().getBundle().key(
Messages.LOG_IMPORTE... | [
"public",
"void",
"addRelation",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"m_throwable",
"!=",
"null",
")",
"{",
"// relation data is corrupt, ignore relation",
"if",
"(",
"LOG",
".",
"isWarnEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"warn",
"(",
"Messages",
"... | Adds a relation to be imported from the current xml data.<p>
@see #addResourceRelationRules(Digester, String) | [
"Adds",
"a",
"relation",
"to",
"be",
"imported",
"from",
"the",
"current",
"xml",
"data",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/importexport/CmsImportVersion10.java#L824-L849 |
opsmatters/newrelic-api | src/main/java/com/opsmatters/newrelic/api/NewRelicClient.java | NewRelicClient.initialize | public NewRelicClient initialize() {
"""
Called after setting configuration properties.
@return This object
"""
Client client = provider.getClient();
String protocol = provider.useSsl() ? "https" : "http";
httpContext = new HttpContext(client, protocol, hostname, port);
htt... | java | public NewRelicClient initialize()
{
Client client = provider.getClient();
String protocol = provider.useSsl() ? "https" : "http";
httpContext = new HttpContext(client, protocol, hostname, port);
httpContext.setUriPrefix(getUriPrefix());
httpContext.setThrowExceptions(han... | [
"public",
"NewRelicClient",
"initialize",
"(",
")",
"{",
"Client",
"client",
"=",
"provider",
".",
"getClient",
"(",
")",
";",
"String",
"protocol",
"=",
"provider",
".",
"useSsl",
"(",
")",
"?",
"\"https\"",
":",
"\"http\"",
";",
"httpContext",
"=",
"new"... | Called after setting configuration properties.
@return This object | [
"Called",
"after",
"setting",
"configuration",
"properties",
"."
] | train | https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/NewRelicClient.java#L68-L78 |
wcm-io/wcm-io-wcm | commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java | CacheHeader.setExpiresDays | public static void setExpiresDays(@NotNull HttpServletResponse response, int days) {
"""
Set expires header to given amount of days in the future.
@param response Response
@param days Days to expire
"""
Date expiresDate = DateUtils.addDays(new Date(), days);
setExpires(response, expiresDate);
} | java | public static void setExpiresDays(@NotNull HttpServletResponse response, int days) {
Date expiresDate = DateUtils.addDays(new Date(), days);
setExpires(response, expiresDate);
} | [
"public",
"static",
"void",
"setExpiresDays",
"(",
"@",
"NotNull",
"HttpServletResponse",
"response",
",",
"int",
"days",
")",
"{",
"Date",
"expiresDate",
"=",
"DateUtils",
".",
"addDays",
"(",
"new",
"Date",
"(",
")",
",",
"days",
")",
";",
"setExpires",
... | Set expires header to given amount of days in the future.
@param response Response
@param days Days to expire | [
"Set",
"expires",
"header",
"to",
"given",
"amount",
"of",
"days",
"in",
"the",
"future",
"."
] | train | https://github.com/wcm-io/wcm-io-wcm/blob/8eff9434f2f4b6462fdb718f8769ad793c55b8d7/commons/src/main/java/io/wcm/wcm/commons/caching/CacheHeader.java#L252-L255 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java | HttpApiUtil.newResponse | public static HttpResponse newResponse(RequestContext ctx, HttpStatus status, String message) {
"""
Returns a newly created {@link HttpResponse} with the specified {@link HttpStatus} and {@code message}.
"""
requireNonNull(ctx, "ctx");
requireNonNull(status, "status");
requireNonNull(me... | java | public static HttpResponse newResponse(RequestContext ctx, HttpStatus status, String message) {
requireNonNull(ctx, "ctx");
requireNonNull(status, "status");
requireNonNull(message, "message");
return newResponse0(ctx, status, null, message);
} | [
"public",
"static",
"HttpResponse",
"newResponse",
"(",
"RequestContext",
"ctx",
",",
"HttpStatus",
"status",
",",
"String",
"message",
")",
"{",
"requireNonNull",
"(",
"ctx",
",",
"\"ctx\"",
")",
";",
"requireNonNull",
"(",
"status",
",",
"\"status\"",
")",
"... | Returns a newly created {@link HttpResponse} with the specified {@link HttpStatus} and {@code message}. | [
"Returns",
"a",
"newly",
"created",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/api/HttpApiUtil.java#L115-L120 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/FileUtils.java | FileUtils.crapToDisk | public static int crapToDisk(Context ctx, String filename, byte[] data) {
"""
Dump Data straight to the SDCard
@param ctx the application context
@param filename the dump filename
@param data the data to dump
@return the return
"""
int code = IO_FAIL;
... | java | public static int crapToDisk(Context ctx, String filename, byte[] data){
int code = IO_FAIL;
File dir = Environment.getExternalStorageDirectory();
File output = new File(dir, filename);
try {
FileOutputStream fos = new FileOutputStream(output);
try {
... | [
"public",
"static",
"int",
"crapToDisk",
"(",
"Context",
"ctx",
",",
"String",
"filename",
",",
"byte",
"[",
"]",
"data",
")",
"{",
"int",
"code",
"=",
"IO_FAIL",
";",
"File",
"dir",
"=",
"Environment",
".",
"getExternalStorageDirectory",
"(",
")",
";",
... | Dump Data straight to the SDCard
@param ctx the application context
@param filename the dump filename
@param data the data to dump
@return the return | [
"Dump",
"Data",
"straight",
"to",
"the",
"SDCard"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/FileUtils.java#L196-L217 |
alkacon/opencms-core | src/org/opencms/ui/sitemap/CmsSitemapTreeController.java | CmsSitemapTreeController.openPageCopyDialog | public void openPageCopyDialog(CmsSitemapTreeNode node, CmsSitemapTreeNodeData entry) {
"""
Opens the page copy dialog for a tree entry.<p>
@param node the tree node widget
@param entry the tree entry
"""
CmsObject cms = A_CmsUI.getCmsObject();
try {
CmsResource resource = cms.... | java | public void openPageCopyDialog(CmsSitemapTreeNode node, CmsSitemapTreeNodeData entry) {
CmsObject cms = A_CmsUI.getCmsObject();
try {
CmsResource resource = cms.readResource(
entry.getClientEntry().getId(),
CmsResourceFilter.IGNORE_EXPIRATION);
Di... | [
"public",
"void",
"openPageCopyDialog",
"(",
"CmsSitemapTreeNode",
"node",
",",
"CmsSitemapTreeNodeData",
"entry",
")",
"{",
"CmsObject",
"cms",
"=",
"A_CmsUI",
".",
"getCmsObject",
"(",
")",
";",
"try",
"{",
"CmsResource",
"resource",
"=",
"cms",
".",
"readReso... | Opens the page copy dialog for a tree entry.<p>
@param node the tree node widget
@param entry the tree entry | [
"Opens",
"the",
"page",
"copy",
"dialog",
"for",
"a",
"tree",
"entry",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/sitemap/CmsSitemapTreeController.java#L1130-L1145 |
javagl/CommonUI | src/main/java/de/javagl/common/ui/tree/checkbox/CheckBoxTree.java | CheckBoxTree.setSelectionState | private void setSelectionState(Object node, State state, boolean propagate) {
"""
Set the selection state of the given node
@param node The node
@param state The state
@param propagate Whether the state change should be propagated
to its children and ancestor nodes
"""
Objects.requireNonNull(sta... | java | private void setSelectionState(Object node, State state, boolean propagate)
{
Objects.requireNonNull(state, "The state may not be null");
Objects.requireNonNull(node, "The node may not be null");
State oldState = selectionStates.put(node, state);
if (!state.equals(oldState))
... | [
"private",
"void",
"setSelectionState",
"(",
"Object",
"node",
",",
"State",
"state",
",",
"boolean",
"propagate",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"state",
",",
"\"The state may not be null\"",
")",
";",
"Objects",
".",
"requireNonNull",
"(",
"n... | Set the selection state of the given node
@param node The node
@param state The state
@param propagate Whether the state change should be propagated
to its children and ancestor nodes | [
"Set",
"the",
"selection",
"state",
"of",
"the",
"given",
"node"
] | train | https://github.com/javagl/CommonUI/blob/b2c7a7637d4e288271392ba148dc17e4c9780255/src/main/java/de/javagl/common/ui/tree/checkbox/CheckBoxTree.java#L256-L270 |
xcesco/kripton | kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java | AnnotationUtility.extractAsInt | public static int extractAsInt(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
"""
Extract as int.
@param item the item
@param annotationClass the annotation class
@param attributeName the attribute name
@return the int
"""
final Elements elementUtils... | java | public static int extractAsInt(Element item, Class<? extends Annotation> annotationClass, AnnotationAttributeType attributeName) {
final Elements elementUtils=BaseProcessor.elementUtils;
final One<Integer> result = new One<Integer>();
result.value0 = 0;
extractString(elementUtils, item, annotationClass, attrib... | [
"public",
"static",
"int",
"extractAsInt",
"(",
"Element",
"item",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationClass",
",",
"AnnotationAttributeType",
"attributeName",
")",
"{",
"final",
"Elements",
"elementUtils",
"=",
"BaseProcessor",
".",
"... | Extract as int.
@param item the item
@param annotationClass the annotation class
@param attributeName the attribute name
@return the int | [
"Extract",
"as",
"int",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/core/reflect/AnnotationUtility.java#L532-L546 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/DualInputSemanticProperties.java | DualInputSemanticProperties.addForwardedField2 | public void addForwardedField2(int sourceField, FieldSet destinationFields) {
"""
Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the second input to multiple fields in
the destination record(s).
@param sourceField the position in the source record(s)
@param... | java | public void addForwardedField2(int sourceField, FieldSet destinationFields) {
FieldSet fs;
if((fs = this.forwardedFields2.get(sourceField)) != null) {
fs.addAll(destinationFields);
} else {
fs = new FieldSet(destinationFields);
this.forwardedFields2.put(sourceField, fs);
}
} | [
"public",
"void",
"addForwardedField2",
"(",
"int",
"sourceField",
",",
"FieldSet",
"destinationFields",
")",
"{",
"FieldSet",
"fs",
";",
"if",
"(",
"(",
"fs",
"=",
"this",
".",
"forwardedFields2",
".",
"get",
"(",
"sourceField",
")",
")",
"!=",
"null",
")... | Adds, to the existing information, a field that is forwarded directly
from the source record(s) in the second input to multiple fields in
the destination record(s).
@param sourceField the position in the source record(s)
@param destinationFields the position in the destination record(s) | [
"Adds",
"to",
"the",
"existing",
"information",
"a",
"field",
"that",
"is",
"forwarded",
"directly",
"from",
"the",
"source",
"record",
"(",
"s",
")",
"in",
"the",
"second",
"input",
"to",
"multiple",
"fields",
"in",
"the",
"destination",
"record",
"(",
"s... | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/api/common/operators/DualInputSemanticProperties.java#L142-L150 |
sshtools/j2ssh-maverick | j2ssh-maverick/src/main/java/com/sshtools/ssh2/Ssh2Session.java | Ssh2Session.requestX11Forwarding | boolean requestX11Forwarding(boolean singleconnection, String protocol,
String cookie, int screen) throws SshException {
"""
Send a request for X Forwarding.
@param singleconnection
@param protocol
@param cookie
@param display
@return boolean
@throws SshException
"""
ByteArrayWriter request = new ... | java | boolean requestX11Forwarding(boolean singleconnection, String protocol,
String cookie, int screen) throws SshException {
ByteArrayWriter request = new ByteArrayWriter();
try {
request.writeBoolean(singleconnection);
request.writeString(protocol);
request.writeString(cookie);
request.writeInt(screen)... | [
"boolean",
"requestX11Forwarding",
"(",
"boolean",
"singleconnection",
",",
"String",
"protocol",
",",
"String",
"cookie",
",",
"int",
"screen",
")",
"throws",
"SshException",
"{",
"ByteArrayWriter",
"request",
"=",
"new",
"ByteArrayWriter",
"(",
")",
";",
"try",
... | Send a request for X Forwarding.
@param singleconnection
@param protocol
@param cookie
@param display
@return boolean
@throws SshException | [
"Send",
"a",
"request",
"for",
"X",
"Forwarding",
"."
] | train | https://github.com/sshtools/j2ssh-maverick/blob/ce11ceaf0aa0b129b54327a6891973e1e34689f7/j2ssh-maverick/src/main/java/com/sshtools/ssh2/Ssh2Session.java#L276-L294 |
phax/ph-bdve | ph-bdve-cii/src/main/java/com/helger/bdve/cii/CIIValidation.java | CIIValidation.initCIID16B | public static void initCIID16B (@Nonnull final ValidationExecutorSetRegistry aRegistry) {
"""
Register all standard CII D16B validation execution sets to the provided
registry.
@param aRegistry
The registry to add the artefacts. May not be <code>null</code>.
"""
ValueEnforcer.notNull (aRegistry, "Regi... | java | public static void initCIID16B (@Nonnull final ValidationExecutorSetRegistry aRegistry)
{
ValueEnforcer.notNull (aRegistry, "Registry");
// For better error messages
LocationBeautifierSPI.addMappings (CIID16BNamespaceContext.getInstance ());
final boolean bNotDeprecated = false;
for (final ECIID... | [
"public",
"static",
"void",
"initCIID16B",
"(",
"@",
"Nonnull",
"final",
"ValidationExecutorSetRegistry",
"aRegistry",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aRegistry",
",",
"\"Registry\"",
")",
";",
"// For better error messages",
"LocationBeautifierSPI",
".... | Register all standard CII D16B validation execution sets to the provided
registry.
@param aRegistry
The registry to add the artefacts. May not be <code>null</code>. | [
"Register",
"all",
"standard",
"CII",
"D16B",
"validation",
"execution",
"sets",
"to",
"the",
"provided",
"registry",
"."
] | train | https://github.com/phax/ph-bdve/blob/2438f491174cd8989567fcdf129b273bd217e89f/ph-bdve-cii/src/main/java/com/helger/bdve/cii/CIIValidation.java#L58-L77 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java | GridDialects.getDelegateOrNull | public static <T extends GridDialect> T getDelegateOrNull(GridDialect gridDialect, Class<T> delegateType) {
"""
Returns that delegate of the given grid dialect of the given type. In case the given dialect itself is of the
given type, it will be returned itself. In case the given grid dialect is a {@link Forwardin... | java | public static <T extends GridDialect> T getDelegateOrNull(GridDialect gridDialect, Class<T> delegateType) {
if ( gridDialect.getClass() == delegateType ) {
return delegateType.cast( gridDialect );
}
else if ( gridDialect instanceof ForwardingGridDialect ) {
return getDelegateOrNull( ( (ForwardingGridDialect... | [
"public",
"static",
"<",
"T",
"extends",
"GridDialect",
">",
"T",
"getDelegateOrNull",
"(",
"GridDialect",
"gridDialect",
",",
"Class",
"<",
"T",
">",
"delegateType",
")",
"{",
"if",
"(",
"gridDialect",
".",
"getClass",
"(",
")",
"==",
"delegateType",
")",
... | Returns that delegate of the given grid dialect of the given type. In case the given dialect itself is of the
given type, it will be returned itself. In case the given grid dialect is a {@link ForwardingGridDialect}, its
delegates will recursively be searched, until the first delegate of the given type is found. | [
"Returns",
"that",
"delegate",
"of",
"the",
"given",
"grid",
"dialect",
"of",
"the",
"given",
"type",
".",
"In",
"case",
"the",
"given",
"dialect",
"itself",
"is",
"of",
"the",
"given",
"type",
"it",
"will",
"be",
"returned",
"itself",
".",
"In",
"case",... | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/dialect/impl/GridDialects.java#L81-L91 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/BaasDocument.java | BaasDocument.countSync | public static BaasResult<Long> countSync(String collection, BaasQuery.Criteria filter) {
"""
Synchronously retrieves the number of document readable to the user that match <code>filter</code>
in <code>collection</code>
@param collection the collection to doCount not <code>null</code>
@param filter a filte... | java | public static BaasResult<Long> countSync(String collection, BaasQuery.Criteria filter) {
BaasBox box = BaasBox.getDefaultChecked();
if (collection == null) throw new IllegalArgumentException("collection cannot be null");
filter = filter==null?BaasQuery.builder().count(true).criteria()
... | [
"public",
"static",
"BaasResult",
"<",
"Long",
">",
"countSync",
"(",
"String",
"collection",
",",
"BaasQuery",
".",
"Criteria",
"filter",
")",
"{",
"BaasBox",
"box",
"=",
"BaasBox",
".",
"getDefaultChecked",
"(",
")",
";",
"if",
"(",
"collection",
"==",
"... | Synchronously retrieves the number of document readable to the user that match <code>filter</code>
in <code>collection</code>
@param collection the collection to doCount not <code>null</code>
@param filter a filter to apply to the request
@return the result of the request | [
"Synchronously",
"retrieves",
"the",
"number",
"of",
"document",
"readable",
"to",
"the",
"user",
"that",
"match",
"<code",
">",
"filter<",
"/",
"code",
">",
"in",
"<code",
">",
"collection<",
"/",
"code",
">"
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/BaasDocument.java#L357-L364 |
mozilla/rhino | toolsrc/org/mozilla/javascript/tools/shell/ShellConsole.java | ShellConsole.getConsole | public static ShellConsole getConsole(InputStream in, PrintStream ps,
Charset cs) {
"""
Returns a new {@link ShellConsole} which uses the supplied
{@link InputStream} and {@link PrintStream} for its input/output
"""
return new SimpleShellConsole(in, ps, cs);
} | java | public static ShellConsole getConsole(InputStream in, PrintStream ps,
Charset cs) {
return new SimpleShellConsole(in, ps, cs);
} | [
"public",
"static",
"ShellConsole",
"getConsole",
"(",
"InputStream",
"in",
",",
"PrintStream",
"ps",
",",
"Charset",
"cs",
")",
"{",
"return",
"new",
"SimpleShellConsole",
"(",
"in",
",",
"ps",
",",
"cs",
")",
";",
"}"
] | Returns a new {@link ShellConsole} which uses the supplied
{@link InputStream} and {@link PrintStream} for its input/output | [
"Returns",
"a",
"new",
"{"
] | train | https://github.com/mozilla/rhino/blob/fa8a86df11d37623f5faa8d445a5876612bc47b0/toolsrc/org/mozilla/javascript/tools/shell/ShellConsole.java#L321-L324 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/MultipleFieldConverter.java | MultipleFieldConverter.setString | public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value {
"""
Convert and move string to this field.
Override this method to convert the String to the actual Physical Data Type.
@param strString the state to set the data to.
@param bDisplayOpt... | java | public int setString(String strString, boolean bDisplayOption, int iMoveMode) // init this field override for other value
{
m_bSetData = true; // Make sure getNextConverter is called correctly (if it is called).
int iErrorCode = super.setString(strString, bDisplayOption, iMoveMode);
m_bS... | [
"public",
"int",
"setString",
"(",
"String",
"strString",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"// init this field override for other value",
"{",
"m_bSetData",
"=",
"true",
";",
"// Make sure getNextConverter is called correctly (if it is called).",
... | Convert and move string to this field.
Override this method to convert the String to the actual Physical Data Type.
@param strString the state to set the data to.
@param bDisplayOption Display the data on the screen if true.
@param iMoveMode INIT, SCREEN, or READ move mode.
@return The error code (or NORMAL_RETURN). | [
"Convert",
"and",
"move",
"string",
"to",
"this",
"field",
".",
"Override",
"this",
"method",
"to",
"convert",
"the",
"String",
"to",
"the",
"actual",
"Physical",
"Data",
"Type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/MultipleFieldConverter.java#L158-L164 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java | IDNA.convertIDNToASCII | @Deprecated
public static StringBuffer convertIDNToASCII(StringBuffer src, int options)
throws StringPrepParseException {
"""
IDNA2003: Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".... | java | @Deprecated
public static StringBuffer convertIDNToASCII(StringBuffer src, int options)
throws StringPrepParseException{
return convertIDNToASCII(src.toString(), options);
} | [
"@",
"Deprecated",
"public",
"static",
"StringBuffer",
"convertIDNToASCII",
"(",
"StringBuffer",
"src",
",",
"int",
"options",
")",
"throws",
"StringPrepParseException",
"{",
"return",
"convertIDNToASCII",
"(",
"src",
".",
"toString",
"(",
")",
",",
"options",
")"... | IDNA2003: Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".
It is important to note that this operation can fail. If it fails, then the input
domain name cannot be used as an Internationalized Domain Name an... | [
"IDNA2003",
":",
"Convenience",
"function",
"that",
"implements",
"the",
"IDNToASCII",
"operation",
"as",
"defined",
"in",
"the",
"IDNA",
"RFC",
".",
"This",
"operation",
"is",
"done",
"on",
"complete",
"domain",
"names",
"e",
".",
"g",
":",
"www",
".",
"e... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java#L615-L619 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java | VirtualHubsInner.beginCreateOrUpdateAsync | public Observable<VirtualHubInner> beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) {
"""
Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@p... | java | public Observable<VirtualHubInner> beginCreateOrUpdateAsync(String resourceGroupName, String virtualHubName, VirtualHubInner virtualHubParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, virtualHubName, virtualHubParameters).map(new Func1<ServiceResponse<VirtualHubInner>, Virtual... | [
"public",
"Observable",
"<",
"VirtualHubInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"virtualHubName",
",",
"VirtualHubInner",
"virtualHubParameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resou... | Creates a VirtualHub resource if it doesn't exist else updates the existing VirtualHub.
@param resourceGroupName The resource group name of the VirtualHub.
@param virtualHubName The name of the VirtualHub.
@param virtualHubParameters Parameters supplied to create or update VirtualHub.
@throws IllegalArgumentException ... | [
"Creates",
"a",
"VirtualHub",
"resource",
"if",
"it",
"doesn",
"t",
"exist",
"else",
"updates",
"the",
"existing",
"VirtualHub",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_06_01/src/main/java/com/microsoft/azure/management/network/v2018_06_01/implementation/VirtualHubsInner.java#L313-L320 |
aws/aws-sdk-java | aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/model/DescribeSecretResult.java | DescribeSecretResult.setVersionIdsToStages | public void setVersionIdsToStages(java.util.Map<String, java.util.List<String>> versionIdsToStages) {
"""
<p>
A list of all of the currently assigned <code>VersionStage</code> staging labels and the <code>VersionId</code>
that each is attached to. Staging labels are used to keep track of the different versions d... | java | public void setVersionIdsToStages(java.util.Map<String, java.util.List<String>> versionIdsToStages) {
this.versionIdsToStages = versionIdsToStages;
} | [
"public",
"void",
"setVersionIdsToStages",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
">",
"versionIdsToStages",
")",
"{",
"this",
".",
"versionIdsToStages",
"=",
"versionIdsToStages",
";",... | <p>
A list of all of the currently assigned <code>VersionStage</code> staging labels and the <code>VersionId</code>
that each is attached to. Staging labels are used to keep track of the different versions during the rotation
process.
</p>
<note>
<p>
A version that does not have any staging labels attached is considere... | [
"<p",
">",
"A",
"list",
"of",
"all",
"of",
"the",
"currently",
"assigned",
"<code",
">",
"VersionStage<",
"/",
"code",
">",
"staging",
"labels",
"and",
"the",
"<code",
">",
"VersionId<",
"/",
"code",
">",
"that",
"each",
"is",
"attached",
"to",
".",
"S... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-secretsmanager/src/main/java/com/amazonaws/services/secretsmanager/model/DescribeSecretResult.java#L799-L801 |
alkacon/opencms-core | src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java | CmsXmlContentPropertyHelper.getMacroResolverForProperties | public static CmsMacroResolver getMacroResolverForProperties(
final CmsObject cms,
final I_CmsXmlContentHandler contentHandler,
final CmsXmlContent content,
final Function<String, String> stringtemplateSource,
final CmsResource containerPage) {
"""
Creates and configures a n... | java | public static CmsMacroResolver getMacroResolverForProperties(
final CmsObject cms,
final I_CmsXmlContentHandler contentHandler,
final CmsXmlContent content,
final Function<String, String> stringtemplateSource,
final CmsResource containerPage) {
Locale locale = OpenCms.ge... | [
"public",
"static",
"CmsMacroResolver",
"getMacroResolverForProperties",
"(",
"final",
"CmsObject",
"cms",
",",
"final",
"I_CmsXmlContentHandler",
"contentHandler",
",",
"final",
"CmsXmlContent",
"content",
",",
"final",
"Function",
"<",
"String",
",",
"String",
">",
... | Creates and configures a new macro resolver for resolving macros which occur in property definitions.<p>
@param cms the CMS context
@param contentHandler the content handler which contains the message bundle that should be available in the macro resolver
@param content the XML content object
@param stringtemplateSourc... | [
"Creates",
"and",
"configures",
"a",
"new",
"macro",
"resolver",
"for",
"resolving",
"macros",
"which",
"occur",
"in",
"property",
"definitions",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/content/CmsXmlContentPropertyHelper.java#L214-L268 |
xcesco/kripton | kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java | XMLSerializer.setFeature | public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException {
"""
Sets the feature.
@param name the name
@param state the state
@throws IllegalArgumentException the illegal argument exception
@throws IllegalStateException the illegal state exception
"""
if ... | java | public void setFeature(String name, boolean state) throws IllegalArgumentException, IllegalStateException {
if (name == null) {
throw new IllegalArgumentException("feature name can not be null");
}
if (FEATURE_NAMES_INTERNED.equals(name)) {
namesInterned = state;
} else if (FEATURE_SERIALIZER_ATTVALUE_USE... | [
"public",
"void",
"setFeature",
"(",
"String",
"name",
",",
"boolean",
"state",
")",
"throws",
"IllegalArgumentException",
",",
"IllegalStateException",
"{",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"feature nam... | Sets the feature.
@param name the name
@param state the state
@throws IllegalArgumentException the illegal argument exception
@throws IllegalStateException the illegal state exception | [
"Sets",
"the",
"feature",
"."
] | train | https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton/src/main/java/com/abubusoft/kripton/xml/XMLSerializer.java#L328-L339 |
kaazing/gateway | mina.netty/src/main/java/org/kaazing/mina/core/future/DefaultBindFuture.java | DefaultBindFuture.combineFutures | public static BindFuture combineFutures(BindFuture future1, BindFuture future2) {
"""
Combine futures in a way that minimizes cost(no object creation) for the common case where
both have already been fulfilled.
"""
if (future1 == null || future1.isBound()) {
return future2;
}
... | java | public static BindFuture combineFutures(BindFuture future1, BindFuture future2) {
if (future1 == null || future1.isBound()) {
return future2;
}
else if (future2 == null || future2.isBound()) {
return future1;
}
else {
return new CompositeBindFu... | [
"public",
"static",
"BindFuture",
"combineFutures",
"(",
"BindFuture",
"future1",
",",
"BindFuture",
"future2",
")",
"{",
"if",
"(",
"future1",
"==",
"null",
"||",
"future1",
".",
"isBound",
"(",
")",
")",
"{",
"return",
"future2",
";",
"}",
"else",
"if",
... | Combine futures in a way that minimizes cost(no object creation) for the common case where
both have already been fulfilled. | [
"Combine",
"futures",
"in",
"a",
"way",
"that",
"minimizes",
"cost",
"(",
"no",
"object",
"creation",
")",
"for",
"the",
"common",
"case",
"where",
"both",
"have",
"already",
"been",
"fulfilled",
"."
] | train | https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.netty/src/main/java/org/kaazing/mina/core/future/DefaultBindFuture.java#L44-L54 |
goldmansachs/gs-collections | collections/src/main/java/com/gs/collections/impl/utility/Iterate.java | Iterate.forEach | public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure) {
"""
The procedure is evaluated for each element of the iterable.
<p>
Example using a Java 8 lambda expression:
<pre>
Iterate.<b>forEach</b>(people, person -> LOGGER.info(person.getName());
</pre>
<p>
Example using an anon... | java | public static <T> void forEach(Iterable<T> iterable, Procedure<? super T> procedure)
{
if (iterable instanceof InternalIterable)
{
((InternalIterable<T>) iterable).forEach(procedure);
}
else if (iterable instanceof ArrayList)
{
ArrayListIterate.forEach... | [
"public",
"static",
"<",
"T",
">",
"void",
"forEach",
"(",
"Iterable",
"<",
"T",
">",
"iterable",
",",
"Procedure",
"<",
"?",
"super",
"T",
">",
"procedure",
")",
"{",
"if",
"(",
"iterable",
"instanceof",
"InternalIterable",
")",
"{",
"(",
"(",
"Intern... | The procedure is evaluated for each element of the iterable.
<p>
Example using a Java 8 lambda expression:
<pre>
Iterate.<b>forEach</b>(people, person -> LOGGER.info(person.getName());
</pre>
<p>
Example using an anonymous inner class:
<pre>
Iterate.<b>forEach</b>(people, new Procedure<Person>()
{
public void value(Per... | [
"The",
"procedure",
"is",
"evaluated",
"for",
"each",
"element",
"of",
"the",
"iterable",
".",
"<p",
">",
"Example",
"using",
"a",
"Java",
"8",
"lambda",
"expression",
":",
"<pre",
">",
"Iterate",
".",
"<b",
">",
"forEach<",
"/",
"b",
">",
"(",
"people... | train | https://github.com/goldmansachs/gs-collections/blob/fa8bf3e103689efa18bca2ab70203e71cde34b52/collections/src/main/java/com/gs/collections/impl/utility/Iterate.java#L125-L147 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/producttypes/ProductTypeOptionUrl.java | ProductTypeOptionUrl.addOptionUrl | public static MozuUrl addOptionUrl(Integer productTypeId, String responseFields) {
"""
Get Resource Url for AddOption
@param productTypeId Identifier of the product type.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This ... | java | public static MozuUrl addOptionUrl(Integer productTypeId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options?responseFields={responseFields}");
formatter.formatUrl("productTypeId", productTypeId);
formatter.... | [
"public",
"static",
"MozuUrl",
"addOptionUrl",
"(",
"Integer",
"productTypeId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/attributedefinition/producttypes/{productTypeId}/Options?respons... | Get Resource Url for AddOption
@param productTypeId Identifier of the product type.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter... | [
"Get",
"Resource",
"Url",
"for",
"AddOption"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/attributedefinition/producttypes/ProductTypeOptionUrl.java#L50-L56 |
zeroturnaround/zt-zip | src/main/java/org/zeroturnaround/zip/ZipUtil.java | ZipUtil.transformEntry | public static boolean transformEntry(InputStream is, String path, ZipEntryTransformer transformer, OutputStream os) {
"""
Copies an existing ZIP file and transforms a given entry in it.
@param is
a ZIP input stream.
@param path
new ZIP entry path.
@param transformer
transformer for the given ZIP entry.
@p... | java | public static boolean transformEntry(InputStream is, String path, ZipEntryTransformer transformer, OutputStream os) {
return transformEntry(is, new ZipEntryTransformerEntry(path, transformer), os);
} | [
"public",
"static",
"boolean",
"transformEntry",
"(",
"InputStream",
"is",
",",
"String",
"path",
",",
"ZipEntryTransformer",
"transformer",
",",
"OutputStream",
"os",
")",
"{",
"return",
"transformEntry",
"(",
"is",
",",
"new",
"ZipEntryTransformerEntry",
"(",
"p... | Copies an existing ZIP file and transforms a given entry in it.
@param is
a ZIP input stream.
@param path
new ZIP entry path.
@param transformer
transformer for the given ZIP entry.
@param os
a ZIP output stream.
@return <code>true</code> if the entry was replaced. | [
"Copies",
"an",
"existing",
"ZIP",
"file",
"and",
"transforms",
"a",
"given",
"entry",
"in",
"it",
"."
] | train | https://github.com/zeroturnaround/zt-zip/blob/abb4dc43583e4d19339c0c021035019798970a13/src/main/java/org/zeroturnaround/zip/ZipUtil.java#L2895-L2897 |
sarl/sarl | main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java | EcorePackageRenameStrategy.getDeclarationTextEdit | protected TextEdit getDeclarationTextEdit(String newName, ResourceSet resourceSet) {
"""
Replies the text update for the rename.
@param newName the new package name.
@param resourceSet the set of resources.
@return the text update.
"""
final EObject object = resourceSet.getEObject(this.uriProvider.apply... | java | protected TextEdit getDeclarationTextEdit(String newName, ResourceSet resourceSet) {
final EObject object = resourceSet.getEObject(this.uriProvider.apply(resourceSet), true);
if (object instanceof SarlScript) {
final ITextRegion region = getOriginalPackageRegion((SarlScript) object);
if (region != null) {
... | [
"protected",
"TextEdit",
"getDeclarationTextEdit",
"(",
"String",
"newName",
",",
"ResourceSet",
"resourceSet",
")",
"{",
"final",
"EObject",
"object",
"=",
"resourceSet",
".",
"getEObject",
"(",
"this",
".",
"uriProvider",
".",
"apply",
"(",
"resourceSet",
")",
... | Replies the text update for the rename.
@param newName the new package name.
@param resourceSet the set of resources.
@return the text update. | [
"Replies",
"the",
"text",
"update",
"for",
"the",
"rename",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang.ui/src/io/sarl/lang/ui/refactoring/rename/EcorePackageRenameStrategy.java#L138-L147 |
bazaarvoice/emodb | sor/src/main/java/com/bazaarvoice/emodb/sor/db/ScanRange.java | ScanRange.unwrapped | public List<ScanRange> unwrapped() {
"""
If necessary splits the scan range into two range such that "from" is less than "to" in each range.
This is necessary if the scan range wraps the token range.
"""
if (compare(_from, _to) < 0) {
return ImmutableList.of(this);
}
Immuta... | java | public List<ScanRange> unwrapped() {
if (compare(_from, _to) < 0) {
return ImmutableList.of(this);
}
ImmutableList.Builder<ScanRange> ranges = ImmutableList.builder();
if (compare(_from, MAX_VALUE) < 0) {
ranges.add(new ScanRange(_from, MAX_VALUE));
}
... | [
"public",
"List",
"<",
"ScanRange",
">",
"unwrapped",
"(",
")",
"{",
"if",
"(",
"compare",
"(",
"_from",
",",
"_to",
")",
"<",
"0",
")",
"{",
"return",
"ImmutableList",
".",
"of",
"(",
"this",
")",
";",
"}",
"ImmutableList",
".",
"Builder",
"<",
"S... | If necessary splits the scan range into two range such that "from" is less than "to" in each range.
This is necessary if the scan range wraps the token range. | [
"If",
"necessary",
"splits",
"the",
"scan",
"range",
"into",
"two",
"range",
"such",
"that",
"from",
"is",
"less",
"than",
"to",
"in",
"each",
"range",
".",
"This",
"is",
"necessary",
"if",
"the",
"scan",
"range",
"wraps",
"the",
"token",
"range",
"."
] | train | https://github.com/bazaarvoice/emodb/blob/97ec7671bc78b47fc2a1c11298c0c872bd5ec7fb/sor/src/main/java/com/bazaarvoice/emodb/sor/db/ScanRange.java#L88-L100 |
snazy/ohc | ohc-core/src/main/java/org/caffinitas/ohc/linked/FrequencySketch.java | FrequencySketch.incrementAt | private boolean incrementAt(int i, int j) {
"""
Increments the specified counter by 1 if it is not already at the maximum value (15).
@param i the table index (16 counters)
@param j the counter to increment
@return if incremented
"""
int offset = j << 2;
long mask = (0xfL << offset);
... | java | private boolean incrementAt(int i, int j)
{
int offset = j << 2;
long mask = (0xfL << offset);
long t = tableAt(i);
if ((t & mask) != mask)
{
tableAt(i, t + (1L << offset));
return true;
}
return false;
} | [
"private",
"boolean",
"incrementAt",
"(",
"int",
"i",
",",
"int",
"j",
")",
"{",
"int",
"offset",
"=",
"j",
"<<",
"2",
";",
"long",
"mask",
"=",
"(",
"0xf",
"L",
"<<",
"offset",
")",
";",
"long",
"t",
"=",
"tableAt",
"(",
"i",
")",
";",
"if",
... | Increments the specified counter by 1 if it is not already at the maximum value (15).
@param i the table index (16 counters)
@param j the counter to increment
@return if incremented | [
"Increments",
"the",
"specified",
"counter",
"by",
"1",
"if",
"it",
"is",
"not",
"already",
"at",
"the",
"maximum",
"value",
"(",
"15",
")",
"."
] | train | https://github.com/snazy/ohc/blob/af47142711993a3eaaf3b496332c27e2b43454e4/ohc-core/src/main/java/org/caffinitas/ohc/linked/FrequencySketch.java#L181-L192 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLImportsDeclarationImpl_CustomFieldSerializer.java | OWLImportsDeclarationImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLImportsDeclarationImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLImportsDeclarationImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLImportsDeclarationImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.client.rp... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{"
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLImportsDeclarationImpl_CustomFieldSerializer.java#L63-L66 |
taimos/GPSd4Java | src/main/java/de/taimos/gpsd4java/backend/GISTool.java | GISTool.getDistance | public static double getDistance(final double x1, final double x2, final double y1, final double y2) {
"""
calculates the distance between two locations, which are given as coordinates, in kilometers<br>
the method used is the great-circle-distance with hypersine formula
@param x1 - longitude of position 1
@p... | java | public static double getDistance(final double x1, final double x2, final double y1, final double y2) {
// transform to radian
final double deg2rad = Math.PI / 180;
final double x1rad = x1 * deg2rad;
final double x2rad = x2 * deg2rad;
final double y1rad = y1 * deg2rad;
final double y2rad = y2 * deg2rad;
... | [
"public",
"static",
"double",
"getDistance",
"(",
"final",
"double",
"x1",
",",
"final",
"double",
"x2",
",",
"final",
"double",
"y1",
",",
"final",
"double",
"y2",
")",
"{",
"// transform to radian",
"final",
"double",
"deg2rad",
"=",
"Math",
".",
"PI",
"... | calculates the distance between two locations, which are given as coordinates, in kilometers<br>
the method used is the great-circle-distance with hypersine formula
@param x1 - longitude of position 1
@param x2 - longitude of position 2
@param y1 - latitude of position 1
@param y2 - latitude of position 2
@return dist... | [
"calculates",
"the",
"distance",
"between",
"two",
"locations",
"which",
"are",
"given",
"as",
"coordinates",
"in",
"kilometers<br",
">",
"the",
"method",
"used",
"is",
"the",
"great",
"-",
"circle",
"-",
"distance",
"with",
"hypersine",
"formula"
] | train | https://github.com/taimos/GPSd4Java/blob/f3bdfcc5eed628417ea72bf20d108519f24d105b/src/main/java/de/taimos/gpsd4java/backend/GISTool.java#L60-L76 |
moparisthebest/beehive | beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java | ControlBean.preInvoke | protected void preInvoke(Method m, Object [] args) {
"""
The preinvoke method is called before all operations on the control. It is the basic
hook for logging, context initialization, resource management, and other common
services
"""
try
{
preInvoke(m, args, null);
}
... | java | protected void preInvoke(Method m, Object [] args)
{
try
{
preInvoke(m, args, null);
}
catch (InterceptorPivotException ipe)
{
//this will never happen because no interceptor is passed.
}
} | [
"protected",
"void",
"preInvoke",
"(",
"Method",
"m",
",",
"Object",
"[",
"]",
"args",
")",
"{",
"try",
"{",
"preInvoke",
"(",
"m",
",",
"args",
",",
"null",
")",
";",
"}",
"catch",
"(",
"InterceptorPivotException",
"ipe",
")",
"{",
"//this will never ha... | The preinvoke method is called before all operations on the control. It is the basic
hook for logging, context initialization, resource management, and other common
services | [
"The",
"preinvoke",
"method",
"is",
"called",
"before",
"all",
"operations",
"on",
"the",
"control",
".",
"It",
"is",
"the",
"basic",
"hook",
"for",
"logging",
"context",
"initialization",
"resource",
"management",
"and",
"other",
"common",
"services"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-controls/src/main/java/org/apache/beehive/controls/runtime/bean/ControlBean.java#L421-L431 |
eclipse/xtext-extras | org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java | XbaseTypeComputer.addLocalToCurrentScope | protected void addLocalToCurrentScope(XExpression expression, ITypeComputationState state) {
"""
If the expression is a variable declaration, then add it to the current scope;
DSLs introducing new containers for variable declarations should override this method
and explicitly add nested variable declarations.
@... | java | protected void addLocalToCurrentScope(XExpression expression, ITypeComputationState state) {
if (expression instanceof XVariableDeclaration) {
addLocalToCurrentScope((XVariableDeclaration)expression, state);
}
} | [
"protected",
"void",
"addLocalToCurrentScope",
"(",
"XExpression",
"expression",
",",
"ITypeComputationState",
"state",
")",
"{",
"if",
"(",
"expression",
"instanceof",
"XVariableDeclaration",
")",
"{",
"addLocalToCurrentScope",
"(",
"(",
"XVariableDeclaration",
")",
"e... | If the expression is a variable declaration, then add it to the current scope;
DSLs introducing new containers for variable declarations should override this method
and explicitly add nested variable declarations.
@since 2.9 | [
"If",
"the",
"expression",
"is",
"a",
"variable",
"declaration",
"then",
"add",
"it",
"to",
"the",
"current",
"scope",
";",
"DSLs",
"introducing",
"new",
"containers",
"for",
"variable",
"declarations",
"should",
"override",
"this",
"method",
"and",
"explicitly"... | train | https://github.com/eclipse/xtext-extras/blob/451359541295323a29f5855e633f770cec02069a/org.eclipse.xtext.xbase/src/org/eclipse/xtext/xbase/typesystem/computation/XbaseTypeComputer.java#L511-L515 |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setTimestamp | public void setTimestamp(final int parameterIndex, final Timestamp x) throws SQLException {
"""
Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. The driver converts this to an
SQL <code>TIMESTAMP</code> value when it sends it to the database.
@param parameterIndex the first par... | java | public void setTimestamp(final int parameterIndex, final Timestamp x) throws SQLException {
if(x == null) {
setNull(parameterIndex, Types.TIMESTAMP);
return;
}
setParameter(parameterIndex, new TimestampParameter(x.getTime()));
} | [
"public",
"void",
"setTimestamp",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"Timestamp",
"x",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"Types",
".",
"TIMESTAMP",
")",
";",... | Sets the designated parameter to the given <code>java.sql.Timestamp</code> value. The driver converts this to an
SQL <code>TIMESTAMP</code> value when it sends it to the database.
@param parameterIndex the first parameter is 1, the second is 2, ...
@param x the parameter value
@throws java.sql.SQLExceptio... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"<code",
">",
"java",
".",
"sql",
".",
"Timestamp<",
"/",
"code",
">",
"value",
".",
"The",
"driver",
"converts",
"this",
"to",
"an",
"SQL",
"<code",
">",
"TIMESTAMP<",
"/",
"code",
">",
"... | train | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L1174-L1182 |
highsource/jaxb2-basics | runtime/src/main/java/org/jvnet/jaxb2_commons/lang/ClassUtils.java | ClassUtils.getShortClassName | public static String getShortClassName(String className) {
"""
<p>
Gets the class name minus the package name from a String.
</p>
<p>
The string passed in is assumed to be a class name - it is not checked.
</p>
@param className
the className to get the short name for
@return the class name of the class... | java | public static String getShortClassName(String className) {
if (className == null) {
return "";
}
if (className.length() == 0) {
return "";
}
char[] chars = className.toCharArray();
int lastDot = 0;
for (int i = 0; i < chars.length; i++) {
if (chars[i] == PACKAGE_SEPARATOR_CHAR) {
l... | [
"public",
"static",
"String",
"getShortClassName",
"(",
"String",
"className",
")",
"{",
"if",
"(",
"className",
"==",
"null",
")",
"{",
"return",
"\"\"",
";",
"}",
"if",
"(",
"className",
".",
"length",
"(",
")",
"==",
"0",
")",
"{",
"return",
"\"\"",... | <p>
Gets the class name minus the package name from a String.
</p>
<p>
The string passed in is assumed to be a class name - it is not checked.
</p>
@param className
the className to get the short name for
@return the class name of the class without the package name or an empty
string | [
"<p",
">",
"Gets",
"the",
"class",
"name",
"minus",
"the",
"package",
"name",
"from",
"a",
"String",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/highsource/jaxb2-basics/blob/571cca0ce58a75d984324d33d8af453bf5862e75/runtime/src/main/java/org/jvnet/jaxb2_commons/lang/ClassUtils.java#L42-L60 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxFile.java | BoxFile.updateClassification | public String updateClassification(String classificationType) {
"""
Updates a metadata classification on the specified file.
@param classificationType the metadata classification type.
@return the new metadata classification type updated on the file.
"""
Metadata metadata = new Metadata("enterprise... | java | public String updateClassification(String classificationType) {
Metadata metadata = new Metadata("enterprise", Metadata.CLASSIFICATION_TEMPLATE_KEY);
metadata.add("/Box__Security__Classification__Key", classificationType);
Metadata classification = this.updateMetadata(metadata);
return ... | [
"public",
"String",
"updateClassification",
"(",
"String",
"classificationType",
")",
"{",
"Metadata",
"metadata",
"=",
"new",
"Metadata",
"(",
"\"enterprise\"",
",",
"Metadata",
".",
"CLASSIFICATION_TEMPLATE_KEY",
")",
";",
"metadata",
".",
"add",
"(",
"\"/Box__Sec... | Updates a metadata classification on the specified file.
@param classificationType the metadata classification type.
@return the new metadata classification type updated on the file. | [
"Updates",
"a",
"metadata",
"classification",
"on",
"the",
"specified",
"file",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxFile.java#L1099-L1105 |
james-hu/jabb-core | src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java | AbstractHibernateDao.countByHql | public long countByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes) {
"""
Get the count of all records in database
@param secondHalfOfHql parts after "from <class_name> "
@param paramValues
@param paramTypes
@return the count
"""
StringBuilder queryStr = new StringBuilder();
... | java | public long countByHql(String secondHalfOfHql, Object[] paramValues, Type[] paramTypes){
StringBuilder queryStr = new StringBuilder();
queryStr.append("select count(*) from ")
.append(this.clazz.getName())
.append(" ");
if (secondHalfOfHql != null){
queryStr.append(secondHalfOfHql);
}
... | [
"public",
"long",
"countByHql",
"(",
"String",
"secondHalfOfHql",
",",
"Object",
"[",
"]",
"paramValues",
",",
"Type",
"[",
"]",
"paramTypes",
")",
"{",
"StringBuilder",
"queryStr",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"queryStr",
".",
"append",
"(",
... | Get the count of all records in database
@param secondHalfOfHql parts after "from <class_name> "
@param paramValues
@param paramTypes
@return the count | [
"Get",
"the",
"count",
"of",
"all",
"records",
"in",
"database"
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/util/db/dao/AbstractHibernateDao.java#L331-L344 |
nextreports/nextreports-engine | src/ro/nextreports/engine/util/ParameterUtil.java | ParameterUtil.getUsedHiddenParametersMap | public static Map<String, QueryParameter> getUsedHiddenParametersMap(Report report) {
"""
Get used hidden parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will contain only the h... | java | public static Map<String, QueryParameter> getUsedHiddenParametersMap(Report report) {
return getUsedParametersMap(report, false, true);
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"QueryParameter",
">",
"getUsedHiddenParametersMap",
"(",
"Report",
"report",
")",
"{",
"return",
"getUsedParametersMap",
"(",
"report",
",",
"false",
",",
"true",
")",
";",
"}"
] | Get used hidden parameters map where the key is the parameter name and the value is the parameter
Not all the report parameters have to be used, some may only be defined for further usage.
The result will contain only the hidden parameters.
@param report next report object
@return used hidden parameters map | [
"Get",
"used",
"hidden",
"parameters",
"map",
"where",
"the",
"key",
"is",
"the",
"parameter",
"name",
"and",
"the",
"value",
"is",
"the",
"parameter",
"Not",
"all",
"the",
"report",
"parameters",
"have",
"to",
"be",
"used",
"some",
"may",
"only",
"be",
... | train | https://github.com/nextreports/nextreports-engine/blob/a847575a9298b5fce63b88961190c5b83ddccc44/src/ro/nextreports/engine/util/ParameterUtil.java#L667-L669 |
spotbugs/spotbugs | eclipsePlugin/src/de/tobject/findbugs/util/Util.java | Util.sortIMarkers | public static void sortIMarkers(IMarker[] markers) {
"""
Sorts an array of IMarkers based on their underlying resource name
@param markers
"""
Arrays.sort(markers, new Comparator<IMarker>() {
@Override
public int compare(IMarker arg0, IMarker arg1) {
IResource r... | java | public static void sortIMarkers(IMarker[] markers) {
Arrays.sort(markers, new Comparator<IMarker>() {
@Override
public int compare(IMarker arg0, IMarker arg1) {
IResource resource0 = arg0.getResource();
IResource resource1 = arg1.getResource();
... | [
"public",
"static",
"void",
"sortIMarkers",
"(",
"IMarker",
"[",
"]",
"markers",
")",
"{",
"Arrays",
".",
"sort",
"(",
"markers",
",",
"new",
"Comparator",
"<",
"IMarker",
">",
"(",
")",
"{",
"@",
"Override",
"public",
"int",
"compare",
"(",
"IMarker",
... | Sorts an array of IMarkers based on their underlying resource name
@param markers | [
"Sorts",
"an",
"array",
"of",
"IMarkers",
"based",
"on",
"their",
"underlying",
"resource",
"name"
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/de/tobject/findbugs/util/Util.java#L215-L233 |
apache/predictionio-sdk-java | client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java | EventClient.deleteUser | public String deleteUser(String uid, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
"""
Deletes a user.
@param uid ID of the user
@param eventTime timestamp of the event
@return ID of this event
"""
return createEvent(deleteUserAsFuture(uid, eventTime));
} | java | public String deleteUser(String uid, DateTime eventTime)
throws ExecutionException, InterruptedException, IOException {
return createEvent(deleteUserAsFuture(uid, eventTime));
} | [
"public",
"String",
"deleteUser",
"(",
"String",
"uid",
",",
"DateTime",
"eventTime",
")",
"throws",
"ExecutionException",
",",
"InterruptedException",
",",
"IOException",
"{",
"return",
"createEvent",
"(",
"deleteUserAsFuture",
"(",
"uid",
",",
"eventTime",
")",
... | Deletes a user.
@param uid ID of the user
@param eventTime timestamp of the event
@return ID of this event | [
"Deletes",
"a",
"user",
"."
] | train | https://github.com/apache/predictionio-sdk-java/blob/16052c96b136340c175c3f9c2692e720850df219/client/src/main/java/org/apache/predictionio/sdk/java/EventClient.java#L428-L431 |
phax/ph-oton | ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/typeahead/TypeaheadEditSelection.java | TypeaheadEditSelection.getSelectionForRequiredObject | @Nonnull
public static TypeaheadEditSelection getSelectionForRequiredObject (@Nonnull final IWebPageExecutionContext aWPEC,
@Nullable final String sEditFieldName,
@Nullable final... | java | @Nonnull
public static TypeaheadEditSelection getSelectionForRequiredObject (@Nonnull final IWebPageExecutionContext aWPEC,
@Nullable final String sEditFieldName,
@Nullable final... | [
"@",
"Nonnull",
"public",
"static",
"TypeaheadEditSelection",
"getSelectionForRequiredObject",
"(",
"@",
"Nonnull",
"final",
"IWebPageExecutionContext",
"aWPEC",
",",
"@",
"Nullable",
"final",
"String",
"sEditFieldName",
",",
"@",
"Nullable",
"final",
"String",
"sHidden... | Get the current selection in the case that it is mandatory to select an
available object.
@param aWPEC
The current web page execution context. May not be <code>null</code>
.
@param sEditFieldName
The name of the edit input field.
@param sHiddenFieldName
The name of the hidden field with the ID.
@return Never <code>nul... | [
"Get",
"the",
"current",
"selection",
"in",
"the",
"case",
"that",
"it",
"is",
"mandatory",
"to",
"select",
"an",
"available",
"object",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-uictrls/src/main/java/com/helger/photon/uictrls/typeahead/TypeaheadEditSelection.java#L93-L121 |
opendatatrentino/s-match | src/main/java/it/unitn/disi/common/utils/MiscUtils.java | MiscUtils.readObject | public static Object readObject(String fileName, boolean isInternalFile) throws DISIException {
"""
Reads Java object from a file.
@param fileName the file where the object is stored
@parm isInternalFile reads from internal data file in resources folder
@return the object
@throws DISIException DISIException
... | java | public static Object readObject(String fileName, boolean isInternalFile) throws DISIException {
Object result;
try {
InputStream fos = null;
if (isInternalFile == true) {
fos = Thread.currentThread().getContextClassLoader().getResource(fileName).openStream(... | [
"public",
"static",
"Object",
"readObject",
"(",
"String",
"fileName",
",",
"boolean",
"isInternalFile",
")",
"throws",
"DISIException",
"{",
"Object",
"result",
";",
"try",
"{",
"InputStream",
"fos",
"=",
"null",
";",
"if",
"(",
"isInternalFile",
"==",
"true"... | Reads Java object from a file.
@param fileName the file where the object is stored
@parm isInternalFile reads from internal data file in resources folder
@return the object
@throws DISIException DISIException | [
"Reads",
"Java",
"object",
"from",
"a",
"file",
"."
] | train | https://github.com/opendatatrentino/s-match/blob/ba5982ef406b7010c2f92592e43887a485935aa1/src/main/java/it/unitn/disi/common/utils/MiscUtils.java#L62-L95 |
jbehave/jbehave-core | jbehave-groovy/src/main/java/org/jbehave/core/configuration/groovy/GroovyContext.java | GroovyContext.newInstance | public Object newInstance(String resource) {
"""
Creates an object instance from the Groovy resource
@param resource the Groovy resource to parse
@return An Object instance
"""
try {
String name = resource.startsWith("/") ? resource : "/" + resource;
File file = new File(thi... | java | public Object newInstance(String resource) {
try {
String name = resource.startsWith("/") ? resource : "/" + resource;
File file = new File(this.getClass().getResource(name).toURI());
return newInstance(classLoader.parseClass(new GroovyCodeSource(file), true));
} catc... | [
"public",
"Object",
"newInstance",
"(",
"String",
"resource",
")",
"{",
"try",
"{",
"String",
"name",
"=",
"resource",
".",
"startsWith",
"(",
"\"/\"",
")",
"?",
"resource",
":",
"\"/\"",
"+",
"resource",
";",
"File",
"file",
"=",
"new",
"File",
"(",
"... | Creates an object instance from the Groovy resource
@param resource the Groovy resource to parse
@return An Object instance | [
"Creates",
"an",
"object",
"instance",
"from",
"the",
"Groovy",
"resource"
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-groovy/src/main/java/org/jbehave/core/configuration/groovy/GroovyContext.java#L59-L67 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java | BoxApiMetadata.getMetadataTemplateSchemaRequest | public BoxRequestsMetadata.GetMetadataTemplateSchema getMetadataTemplateSchemaRequest(String scope, String template) {
"""
Gets a request that retrieves a metadata template schema (scope defaults to BOX_API_SCOPE_ENTERPRISE)
@param scope currently only global and enterprise scopes are supported
@param temp... | java | public BoxRequestsMetadata.GetMetadataTemplateSchema getMetadataTemplateSchemaRequest(String scope, String template) {
BoxRequestsMetadata.GetMetadataTemplateSchema request = new BoxRequestsMetadata.GetMetadataTemplateSchema(getMetadataTemplatesUrl(scope, template), mSession);
return request;
} | [
"public",
"BoxRequestsMetadata",
".",
"GetMetadataTemplateSchema",
"getMetadataTemplateSchemaRequest",
"(",
"String",
"scope",
",",
"String",
"template",
")",
"{",
"BoxRequestsMetadata",
".",
"GetMetadataTemplateSchema",
"request",
"=",
"new",
"BoxRequestsMetadata",
".",
"G... | Gets a request that retrieves a metadata template schema (scope defaults to BOX_API_SCOPE_ENTERPRISE)
@param scope currently only global and enterprise scopes are supported
@param template metadata template to use
@return request to retrieve a metadata template schema | [
"Gets",
"a",
"request",
"that",
"retrieves",
"a",
"metadata",
"template",
"schema",
"(",
"scope",
"defaults",
"to",
"BOX_API_SCOPE_ENTERPRISE",
")"
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/BoxApiMetadata.java#L300-L303 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java | ReflectionUtils.invokeMethod | public static <R, T> R invokeMethod(T instance, Method method, Object... arguments) {
"""
Invokes a method.
@param instance The instance
@param method The method
@param arguments The arguments
@param <R> The return type
@param <T> The instance type
@return The result
"""
try {
... | java | public static <R, T> R invokeMethod(T instance, Method method, Object... arguments) {
try {
return (R) method.invoke(instance, arguments);
} catch (IllegalAccessException e) {
throw new InvocationException("Illegal access invoking method [" + method + "]: " + e.getMessage(), e);
... | [
"public",
"static",
"<",
"R",
",",
"T",
">",
"R",
"invokeMethod",
"(",
"T",
"instance",
",",
"Method",
"method",
",",
"Object",
"...",
"arguments",
")",
"{",
"try",
"{",
"return",
"(",
"R",
")",
"method",
".",
"invoke",
"(",
"instance",
",",
"argumen... | Invokes a method.
@param instance The instance
@param method The method
@param arguments The arguments
@param <R> The return type
@param <T> The instance type
@return The result | [
"Invokes",
"a",
"method",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/reflect/ReflectionUtils.java#L196-L204 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/ArgUtils.java | ArgUtils.notMax | @SuppressWarnings( {
"""
引数が {@literal 'arg' <= 'max'} の関係か検証する。
@param arg 検証対象の値
@param max 最大値
@param name 検証対象の引数の名前
@throws IllegalArgumentException {@literal arg == null || arg > max.}
""""rawtypes", "unchecked"})
public static <T extends Comparable> void notMax(final T arg, final T max, final S... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static <T extends Comparable> void notMax(final T arg, final T max, final String name) {
if(arg == null) {
throw new IllegalArgumentException(String.format("%s should not be null.", name));
}
if(arg.comp... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"<",
"T",
"extends",
"Comparable",
">",
"void",
"notMax",
"(",
"final",
"T",
"arg",
",",
"final",
"T",
"max",
",",
"final",
"String",
"name",
")",
"{",... | 引数が {@literal 'arg' <= 'max'} の関係か検証する。
@param arg 検証対象の値
@param max 最大値
@param name 検証対象の引数の名前
@throws IllegalArgumentException {@literal arg == null || arg > max.} | [
"引数が",
"{"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/ArgUtils.java#L115-L126 |
datacleaner/AnalyzerBeans | env/xml-config/src/main/java/org/eobjects/analyzer/configuration/DatastoreXmlExternalizer.java | DatastoreXmlExternalizer.toElement | public Element toElement(CsvDatastore datastore, String filename) {
"""
Externalizes a {@link CsvDatastore} to a XML element.
@param datastore
the datastore to externalize
@param filename
the filename/path to use in the XML element. Since the
appropriate path will depend on the reading application's
enviro... | java | public Element toElement(CsvDatastore datastore, String filename) {
final Element datastoreElement = getDocument().createElement("csv-datastore");
datastoreElement.setAttribute("name", datastore.getName());
final String description = datastore.getDescription();
if (!StringUtils.isNullOr... | [
"public",
"Element",
"toElement",
"(",
"CsvDatastore",
"datastore",
",",
"String",
"filename",
")",
"{",
"final",
"Element",
"datastoreElement",
"=",
"getDocument",
"(",
")",
".",
"createElement",
"(",
"\"csv-datastore\"",
")",
";",
"datastoreElement",
".",
"setAt... | Externalizes a {@link CsvDatastore} to a XML element.
@param datastore
the datastore to externalize
@param filename
the filename/path to use in the XML element. Since the
appropriate path will depend on the reading application's
environment (supported {@link Resource} types), this specific
property of the datastore is... | [
"Externalizes",
"a",
"{",
"@link",
"CsvDatastore",
"}",
"to",
"a",
"XML",
"element",
"."
] | train | https://github.com/datacleaner/AnalyzerBeans/blob/f82dae080d80d2a647b706a5fb22b3ea250613b3/env/xml-config/src/main/java/org/eobjects/analyzer/configuration/DatastoreXmlExternalizer.java#L296-L315 |
teatrove/teatrove | build-tools/teatools/src/main/java/org/teatrove/teatools/TeaToolsUtils.java | TeaToolsUtils.isDeprecated | protected boolean isDeprecated(Class<?> clazz,
String methodName, Class<?>... paramTypes) {
"""
Returns whether the given method or any super method or interface
declaration is deprecated.
@see Deprecated
"""
// check if type is annotated
if (isDeprecated(clazz)) { return ... | java | protected boolean isDeprecated(Class<?> clazz,
String methodName, Class<?>... paramTypes) {
// check if type is annotated
if (isDeprecated(clazz)) { return true; }
// check if method is annotated
try {
Method method =
clazz.getDecla... | [
"protected",
"boolean",
"isDeprecated",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"methodName",
",",
"Class",
"<",
"?",
">",
"...",
"paramTypes",
")",
"{",
"// check if type is annotated",
"if",
"(",
"isDeprecated",
"(",
"clazz",
")",
")",
"{",
... | Returns whether the given method or any super method or interface
declaration is deprecated.
@see Deprecated | [
"Returns",
"whether",
"the",
"given",
"method",
"or",
"any",
"super",
"method",
"or",
"interface",
"declaration",
"is",
"deprecated",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/build-tools/teatools/src/main/java/org/teatrove/teatools/TeaToolsUtils.java#L331-L363 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java | TableFormBuilder.addTextArea | public JComponent[] addTextArea(String fieldName, String attributes) {
"""
Adds the field to the form by using a text area component which is wrapped inside a scrollpane.
{@link #createTextArea(String)} is used to create the component for the text area field
<p>
Note: this method ensures that the the label of t... | java | public JComponent[] addTextArea(String fieldName, String attributes) {
JComponent textArea = createTextArea(fieldName);
String labelAttributes = getLabelAttributes();
if (labelAttributes == null) {
labelAttributes = VALIGN_TOP;
} else if (!labelAttributes.contains(TableLayout... | [
"public",
"JComponent",
"[",
"]",
"addTextArea",
"(",
"String",
"fieldName",
",",
"String",
"attributes",
")",
"{",
"JComponent",
"textArea",
"=",
"createTextArea",
"(",
"fieldName",
")",
";",
"String",
"labelAttributes",
"=",
"getLabelAttributes",
"(",
")",
";"... | Adds the field to the form by using a text area component which is wrapped inside a scrollpane.
{@link #createTextArea(String)} is used to create the component for the text area field
<p>
Note: this method ensures that the the label of the textarea has a top vertical alignment if <code>valign</code>
is not defined in t... | [
"Adds",
"the",
"field",
"to",
"the",
"form",
"by",
"using",
"a",
"text",
"area",
"component",
"which",
"is",
"wrapped",
"inside",
"a",
"scrollpane",
".",
"{",
"@link",
"#createTextArea",
"(",
"String",
")",
"}",
"is",
"used",
"to",
"create",
"the",
"comp... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/form/builder/TableFormBuilder.java#L245-L254 |
sockeqwe/SwipeBack | library/src/com/hannesdorfmann/swipeback/SwipeBack.java | SwipeBack.setContentView | public SwipeBack setContentView(View view) {
"""
Set the content to an explicit view.
@param view The desired content to display.
"""
setContentView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
return this;
} | java | public SwipeBack setContentView(View view) {
setContentView(view, new LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT));
return this;
} | [
"public",
"SwipeBack",
"setContentView",
"(",
"View",
"view",
")",
"{",
"setContentView",
"(",
"view",
",",
"new",
"LayoutParams",
"(",
"LayoutParams",
".",
"MATCH_PARENT",
",",
"LayoutParams",
".",
"MATCH_PARENT",
")",
")",
";",
"return",
"this",
";",
"}"
] | Set the content to an explicit view.
@param view The desired content to display. | [
"Set",
"the",
"content",
"to",
"an",
"explicit",
"view",
"."
] | train | https://github.com/sockeqwe/SwipeBack/blob/09ed11f48e930ed47fd4f07ad1c786fc9fff3c48/library/src/com/hannesdorfmann/swipeback/SwipeBack.java#L1443-L1446 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/client/gui/MalisisGui.java | MalisisGui.sendAction | public static void sendAction(ActionType action, MalisisSlot slot, int code) {
"""
Sends a GUI action to the server.
@param action the action
@param slot the slot
@param code the keyboard code
"""
if (action == null || current() == null || current().inventoryContainer == null)
return;
int inventor... | java | public static void sendAction(ActionType action, MalisisSlot slot, int code)
{
if (action == null || current() == null || current().inventoryContainer == null)
return;
int inventoryId = slot != null ? slot.getInventoryId() : 0;
int slotNumber = slot != null ? slot.getSlotIndex() : 0;
current().inventoryCo... | [
"public",
"static",
"void",
"sendAction",
"(",
"ActionType",
"action",
",",
"MalisisSlot",
"slot",
",",
"int",
"code",
")",
"{",
"if",
"(",
"action",
"==",
"null",
"||",
"current",
"(",
")",
"==",
"null",
"||",
"current",
"(",
")",
".",
"inventoryContain... | Sends a GUI action to the server.
@param action the action
@param slot the slot
@param code the keyboard code | [
"Sends",
"a",
"GUI",
"action",
"to",
"the",
"server",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/client/gui/MalisisGui.java#L773-L783 |
apache/incubator-gobblin | gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/Counters.java | Counters.initialize | public void initialize(final MetricContext metricContext, final Class<E> enumClass, final Class<?> instrumentedClass) {
"""
Creates a {@link Counter} for every value of the enumClass.
Use {@link #inc(Enum, long)} to increment the counter associated with a enum value
@param metricContext that {@link Counter}s w... | java | public void initialize(final MetricContext metricContext, final Class<E> enumClass, final Class<?> instrumentedClass) {
Builder<E, Counter> builder = ImmutableMap.builder();
for (E e : Arrays.asList(enumClass.getEnumConstants())) {
builder.put(e, metricContext.counter(MetricRegistry.name(instrumentedCla... | [
"public",
"void",
"initialize",
"(",
"final",
"MetricContext",
"metricContext",
",",
"final",
"Class",
"<",
"E",
">",
"enumClass",
",",
"final",
"Class",
"<",
"?",
">",
"instrumentedClass",
")",
"{",
"Builder",
"<",
"E",
",",
"Counter",
">",
"builder",
"="... | Creates a {@link Counter} for every value of the enumClass.
Use {@link #inc(Enum, long)} to increment the counter associated with a enum value
@param metricContext that {@link Counter}s will be registered
@param enumClass that define the names of {@link Counter}s. One counter is created per value
@param instrumentedCl... | [
"Creates",
"a",
"{",
"@link",
"Counter",
"}",
"for",
"every",
"value",
"of",
"the",
"enumClass",
".",
"Use",
"{",
"@link",
"#inc",
"(",
"Enum",
"long",
")",
"}",
"to",
"increment",
"the",
"counter",
"associated",
"with",
"a",
"enum",
"value"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-metrics-libs/gobblin-metrics-base/src/main/java/org/apache/gobblin/metrics/Counters.java#L45-L54 |
samskivert/samskivert | src/main/java/com/samskivert/swing/util/SwingUtil.java | SwingUtil.restoreAntiAliasing | public static void restoreAntiAliasing (Graphics2D gfx, Object rock) {
"""
Restores anti-aliasing in the supplied graphics context to its original setting.
@param rock the results of a previous call to {@link #activateAntiAliasing} or null, in
which case this method will NOOP. This alleviates every caller havi... | java | public static void restoreAntiAliasing (Graphics2D gfx, Object rock)
{
if (rock != null) {
gfx.setRenderingHints((RenderingHints)rock);
}
} | [
"public",
"static",
"void",
"restoreAntiAliasing",
"(",
"Graphics2D",
"gfx",
",",
"Object",
"rock",
")",
"{",
"if",
"(",
"rock",
"!=",
"null",
")",
"{",
"gfx",
".",
"setRenderingHints",
"(",
"(",
"RenderingHints",
")",
"rock",
")",
";",
"}",
"}"
] | Restores anti-aliasing in the supplied graphics context to its original setting.
@param rock the results of a previous call to {@link #activateAntiAliasing} or null, in
which case this method will NOOP. This alleviates every caller having to conditionally avoid
calling restore if they chose not to activate earlier. | [
"Restores",
"anti",
"-",
"aliasing",
"in",
"the",
"supplied",
"graphics",
"context",
"to",
"its",
"original",
"setting",
"."
] | train | https://github.com/samskivert/samskivert/blob/a64d9ef42b69819bdb2c66bddac6a64caef928b6/src/main/java/com/samskivert/swing/util/SwingUtil.java#L429-L434 |
jmapper-framework/jmapper-core | JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java | Error.badConversion | public static void badConversion(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass,String plus) {
"""
Thrown when conversions are badly written.
@param destinationField destination field
@param destinationClass destination class
@param sourceField source field
@param so... | java | public static void badConversion(Field destinationField, Class<?> destinationClass, Field sourceField, Class<?> sourceClass,String plus){
throw new UndefinedMappingException(MSG.INSTANCE.message(undefinedMappingException,destinationField.getName(),destinationClass.getSimpleName(),sourceField.getName(),sourceClass.ge... | [
"public",
"static",
"void",
"badConversion",
"(",
"Field",
"destinationField",
",",
"Class",
"<",
"?",
">",
"destinationClass",
",",
"Field",
"sourceField",
",",
"Class",
"<",
"?",
">",
"sourceClass",
",",
"String",
"plus",
")",
"{",
"throw",
"new",
"Undefin... | Thrown when conversions are badly written.
@param destinationField destination field
@param destinationClass destination class
@param sourceField source field
@param sourceClass source class
@param plus added messages of internal exceptions thrown | [
"Thrown",
"when",
"conversions",
"are",
"badly",
"written",
"."
] | train | https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/config/Error.java#L408-L410 |
guicamest/bsoneer | compiler/compiler/src/main/java/com/sleepcamel/bsoneer/processor/util/Util.java | Util.getAnnotation | public static Map<String, Object> getAnnotation(Class<?> annotationType,
Element element) {
"""
Returns the annotation on {@code element} formatted as a Map. This
returns a Map rather than an instance of the annotation interface to
work-around the fact that Class and Class[] fields won't work at code
generat... | java | public static Map<String, Object> getAnnotation(Class<?> annotationType,
Element element) {
for (AnnotationMirror annotation : element.getAnnotationMirrors()) {
if (!rawTypeToString(annotation.getAnnotationType(), '$').equals(
annotationType.getName())) {
continue;
}
return parseAnnotationMirror... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"getAnnotation",
"(",
"Class",
"<",
"?",
">",
"annotationType",
",",
"Element",
"element",
")",
"{",
"for",
"(",
"AnnotationMirror",
"annotation",
":",
"element",
".",
"getAnnotationMirrors",
"(",
... | Returns the annotation on {@code element} formatted as a Map. This
returns a Map rather than an instance of the annotation interface to
work-around the fact that Class and Class[] fields won't work at code
generation time. See
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=5089128 | [
"Returns",
"the",
"annotation",
"on",
"{"
] | train | https://github.com/guicamest/bsoneer/blob/170a4a5d99519c49ee01a38bb1562a42375f686d/compiler/compiler/src/main/java/com/sleepcamel/bsoneer/processor/util/Util.java#L137-L148 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java | ElemTemplateElement.replaceChild | public Node replaceChild(Node newChild, Node oldChild) throws DOMException {
"""
Replace the old child with a new child.
@param newChild New child to replace with
@param oldChild Old child to be replaced
@return The new child
@throws DOMException
"""
if (oldChild == null || oldChild.getParentNod... | java | public Node replaceChild(Node newChild, Node oldChild) throws DOMException
{
if (oldChild == null || oldChild.getParentNode() != this)
return null;
ElemTemplateElement newChildElem = ((ElemTemplateElement) newChild);
ElemTemplateElement oldChildElem = ((ElemTemplateElement) oldChild);
// Fix ... | [
"public",
"Node",
"replaceChild",
"(",
"Node",
"newChild",
",",
"Node",
"oldChild",
")",
"throws",
"DOMException",
"{",
"if",
"(",
"oldChild",
"==",
"null",
"||",
"oldChild",
".",
"getParentNode",
"(",
")",
"!=",
"this",
")",
"return",
"null",
";",
"ElemTe... | Replace the old child with a new child.
@param newChild New child to replace with
@param oldChild Old child to be replaced
@return The new child
@throws DOMException | [
"Replace",
"the",
"old",
"child",
"with",
"a",
"new",
"child",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/ElemTemplateElement.java#L394-L422 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/FileSystem.java | FileSystem.setDefaultUri | public static void setDefaultUri(Configuration conf, URI uri) {
"""
Set the default filesystem URI in a configuration.
@param conf the configuration to alter
@param uri the new default filesystem uri
"""
conf.set(FS_DEFAULT_NAME_KEY, uri.toString());
} | java | public static void setDefaultUri(Configuration conf, URI uri) {
conf.set(FS_DEFAULT_NAME_KEY, uri.toString());
} | [
"public",
"static",
"void",
"setDefaultUri",
"(",
"Configuration",
"conf",
",",
"URI",
"uri",
")",
"{",
"conf",
".",
"set",
"(",
"FS_DEFAULT_NAME_KEY",
",",
"uri",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Set the default filesystem URI in a configuration.
@param conf the configuration to alter
@param uri the new default filesystem uri | [
"Set",
"the",
"default",
"filesystem",
"URI",
"in",
"a",
"configuration",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileSystem.java#L124-L126 |
brianwhu/xillium | data/src/main/java/org/xillium/data/DataBinder.java | DataBinder.getNamedObject | public <T> T getNamedObject(String name, Class<T> type) {
"""
Retrieves a named object of a specific type from this binder.
"""
return type.cast(_named.get(name));
} | java | public <T> T getNamedObject(String name, Class<T> type) {
return type.cast(_named.get(name));
} | [
"public",
"<",
"T",
">",
"T",
"getNamedObject",
"(",
"String",
"name",
",",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"return",
"type",
".",
"cast",
"(",
"_named",
".",
"get",
"(",
"name",
")",
")",
";",
"}"
] | Retrieves a named object of a specific type from this binder. | [
"Retrieves",
"a",
"named",
"object",
"of",
"a",
"specific",
"type",
"from",
"this",
"binder",
"."
] | train | https://github.com/brianwhu/xillium/blob/e8dbf8cb6589fa1031a0bfcdcb58cb03d2ba7799/data/src/main/java/org/xillium/data/DataBinder.java#L120-L122 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.