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 |
|---|---|---|---|---|---|---|---|---|---|---|
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java | HiveSource.shouldCreateWorkunit | protected boolean shouldCreateWorkunit(long createTime, long updateTime, LongWatermark lowWatermark) {
"""
Check if workunit needs to be created. Returns <code>true</code> If the
<code>updateTime</code> is greater than the <code>lowWatermark</code> and <code>maxLookBackTime</code>
<code>createTime</code> is not ... | java | protected boolean shouldCreateWorkunit(long createTime, long updateTime, LongWatermark lowWatermark) {
if (new DateTime(updateTime).isBefore(this.maxLookBackTime)) {
return false;
}
return new DateTime(updateTime).isAfter(lowWatermark.getValue());
} | [
"protected",
"boolean",
"shouldCreateWorkunit",
"(",
"long",
"createTime",
",",
"long",
"updateTime",
",",
"LongWatermark",
"lowWatermark",
")",
"{",
"if",
"(",
"new",
"DateTime",
"(",
"updateTime",
")",
".",
"isBefore",
"(",
"this",
".",
"maxLookBackTime",
")",... | Check if workunit needs to be created. Returns <code>true</code> If the
<code>updateTime</code> is greater than the <code>lowWatermark</code> and <code>maxLookBackTime</code>
<code>createTime</code> is not used. It exists for backward compatibility | [
"Check",
"if",
"workunit",
"needs",
"to",
"be",
"created",
".",
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"If",
"the",
"<code",
">",
"updateTime<",
"/",
"code",
">",
"is",
"greater",
"than",
"the",
"<code",
">",
"lowWatermark<",
"/",
"code",
... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/source/HiveSource.java#L399-L404 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java | BoxTransactionalAPIConnection.getTransactionConnection | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope, String resource) {
"""
Request a scoped transactional token for a particular resource.
@param accessToken application access token.
@param scope scope of transactional token.
@param resource resource transactional token ha... | java | public static BoxAPIConnection getTransactionConnection(String accessToken, String scope, String resource) {
BoxAPIConnection apiConnection = new BoxAPIConnection(accessToken);
URL url;
try {
url = new URL(apiConnection.getTokenURL());
} catch (MalformedURLException e) {
... | [
"public",
"static",
"BoxAPIConnection",
"getTransactionConnection",
"(",
"String",
"accessToken",
",",
"String",
"scope",
",",
"String",
"resource",
")",
"{",
"BoxAPIConnection",
"apiConnection",
"=",
"new",
"BoxAPIConnection",
"(",
"accessToken",
")",
";",
"URL",
"... | Request a scoped transactional token for a particular resource.
@param accessToken application access token.
@param scope scope of transactional token.
@param resource resource transactional token has access to.
@return a BoxAPIConnection which can be used to perform transactional requests. | [
"Request",
"a",
"scoped",
"transactional",
"token",
"for",
"a",
"particular",
"resource",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxTransactionalAPIConnection.java#L46-L83 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java | BaseFileManager.handleOptions | public boolean handleOptions(Map<Option, String> map) {
"""
Call handleOption for collection of options and corresponding values.
@param map a collection of options and corresponding values
@return true if all the calls are successful
"""
boolean ok = true;
for (Map.Entry<Option, String> e: m... | java | public boolean handleOptions(Map<Option, String> map) {
boolean ok = true;
for (Map.Entry<Option, String> e: map.entrySet()) {
try {
ok = ok & handleOption(e.getKey(), e.getValue());
} catch (IllegalArgumentException ex) {
log.error(Errors.IllegalA... | [
"public",
"boolean",
"handleOptions",
"(",
"Map",
"<",
"Option",
",",
"String",
">",
"map",
")",
"{",
"boolean",
"ok",
"=",
"true",
";",
"for",
"(",
"Map",
".",
"Entry",
"<",
"Option",
",",
"String",
">",
"e",
":",
"map",
".",
"entrySet",
"(",
")",... | Call handleOption for collection of options and corresponding values.
@param map a collection of options and corresponding values
@return true if all the calls are successful | [
"Call",
"handleOption",
"for",
"collection",
"of",
"options",
"and",
"corresponding",
"values",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/file/BaseFileManager.java#L278-L289 |
OpenLiberty/open-liberty | dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/BatchKernelImpl.java | BatchKernelImpl.createJobInstance | @Override
public WSJobInstance createJobInstance(String appName, String jobXMLName, String submitter, String jsl, String correlationId) {
"""
@return a new JobInstance for the given appName and JSL file.
Note: Inline JSL takes precedence over JSL within .war
"""
JobInstanceEntity retMe = null;
... | java | @Override
public WSJobInstance createJobInstance(String appName, String jobXMLName, String submitter, String jsl, String correlationId) {
JobInstanceEntity retMe = null;
retMe = getPersistenceManagerService().createJobInstance(appName,
... | [
"@",
"Override",
"public",
"WSJobInstance",
"createJobInstance",
"(",
"String",
"appName",
",",
"String",
"jobXMLName",
",",
"String",
"submitter",
",",
"String",
"jsl",
",",
"String",
"correlationId",
")",
"{",
"JobInstanceEntity",
"retMe",
"=",
"null",
";",
"r... | @return a new JobInstance for the given appName and JSL file.
Note: Inline JSL takes precedence over JSL within .war | [
"@return",
"a",
"new",
"JobInstance",
"for",
"the",
"given",
"appName",
"and",
"JSL",
"file",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/impl/BatchKernelImpl.java#L272-L286 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java | CommonOps_DDF6.addEquals | public static void addEquals( DMatrix6x6 a , DMatrix6x6 b ) {
"""
<p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>ij</sub> = a<sub>ij</sub> + b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified.
"""
a.a11 += b.a11;
a.a12 += b.a12;
... | java | public static void addEquals( DMatrix6x6 a , DMatrix6x6 b ) {
a.a11 += b.a11;
a.a12 += b.a12;
a.a13 += b.a13;
a.a14 += b.a14;
a.a15 += b.a15;
a.a16 += b.a16;
a.a21 += b.a21;
a.a22 += b.a22;
a.a23 += b.a23;
a.a24 += b.a24;
a.a25 += b... | [
"public",
"static",
"void",
"addEquals",
"(",
"DMatrix6x6",
"a",
",",
"DMatrix6x6",
"b",
")",
"{",
"a",
".",
"a11",
"+=",
"b",
".",
"a11",
";",
"a",
".",
"a12",
"+=",
"b",
".",
"a12",
";",
"a",
".",
"a13",
"+=",
"b",
".",
"a13",
";",
"a",
"."... | <p>Performs the following operation:<br>
<br>
a = a + b <br>
a<sub>ij</sub> = a<sub>ij</sub> + b<sub>ij</sub> <br>
</p>
@param a A Matrix. Modified.
@param b A Matrix. Not modified. | [
"<p",
">",
"Performs",
"the",
"following",
"operation",
":",
"<br",
">",
"<br",
">",
"a",
"=",
"a",
"+",
"b",
"<br",
">",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"=",
"a<sub",
">",
"ij<",
"/",
"sub",
">",
"+",
"b<sub",
">",
"ij<",
"/",
"sub",
"... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/fixed/CommonOps_DDF6.java#L120-L157 |
hibernate/hibernate-ogm | mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/dialect/impl/MongoDBTupleSnapshot.java | MongoDBTupleSnapshot.getValue | private Object getValue(Document dbObject, String column) {
"""
The internal structure of a {@link Document} is like a tree. Each embedded object is a new {@code Document}
itself. We traverse the tree until we've arrived at a leaf and retrieve the value from it.
"""
Object valueOrNull = MongoHelpers.getValu... | java | private Object getValue(Document dbObject, String column) {
Object valueOrNull = MongoHelpers.getValueOrNull( dbObject, column );
return valueOrNull;
} | [
"private",
"Object",
"getValue",
"(",
"Document",
"dbObject",
",",
"String",
"column",
")",
"{",
"Object",
"valueOrNull",
"=",
"MongoHelpers",
".",
"getValueOrNull",
"(",
"dbObject",
",",
"column",
")",
";",
"return",
"valueOrNull",
";",
"}"
] | The internal structure of a {@link Document} is like a tree. Each embedded object is a new {@code Document}
itself. We traverse the tree until we've arrived at a leaf and retrieve the value from it. | [
"The",
"internal",
"structure",
"of",
"a",
"{"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/mongodb/src/main/java/org/hibernate/ogm/datastore/mongodb/dialect/impl/MongoDBTupleSnapshot.java#L83-L86 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.findAll | public static <T> Collection<T> findAll(T[] self, @ClosureParams(FirstParam.Component.class) Closure condition) {
"""
Finds all elements of the array matching the given Closure condition.
<pre class="groovyTestCase">
def items = [1,2,3,4] as Integer[]
assert [2,4] == items.findAll { it % 2 == 0 }
</pre>
@pa... | java | public static <T> Collection<T> findAll(T[] self, @ClosureParams(FirstParam.Component.class) Closure condition) {
Collection<T> answer = new ArrayList<T>();
return findAll(condition, answer, new ArrayIterator<T>(self));
} | [
"public",
"static",
"<",
"T",
">",
"Collection",
"<",
"T",
">",
"findAll",
"(",
"T",
"[",
"]",
"self",
",",
"@",
"ClosureParams",
"(",
"FirstParam",
".",
"Component",
".",
"class",
")",
"Closure",
"condition",
")",
"{",
"Collection",
"<",
"T",
">",
"... | Finds all elements of the array matching the given Closure condition.
<pre class="groovyTestCase">
def items = [1,2,3,4] as Integer[]
assert [2,4] == items.findAll { it % 2 == 0 }
</pre>
@param self an array
@param condition a closure condition
@return a list of matching values
@since 2.0 | [
"Finds",
"all",
"elements",
"of",
"the",
"array",
"matching",
"the",
"given",
"Closure",
"condition",
".",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"def",
"items",
"=",
"[",
"1",
"2",
"3",
"4",
"]",
"as",
"Integer",
"[]",
"assert",
"[",
"2",
"4",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L4792-L4795 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/util/Preconditions.java | Preconditions.checkState | public static void checkState(boolean expression, Object errorMessage) {
"""
Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
@param expression a boolean expression
@param errorMessage the exception message to use if the ch... | java | public static void checkState(boolean expression, Object errorMessage) {
com.google.common.base.Preconditions.checkState(expression, errorMessage);
} | [
"public",
"static",
"void",
"checkState",
"(",
"boolean",
"expression",
",",
"Object",
"errorMessage",
")",
"{",
"com",
".",
"google",
".",
"common",
".",
"base",
".",
"Preconditions",
".",
"checkState",
"(",
"expression",
",",
"errorMessage",
")",
";",
"}"
... | Ensures the truth of an expression involving the state of the calling instance, but not
involving any parameters to the calling method.
@param expression a boolean expression
@param errorMessage the exception message to use if the check fails; will be converted to a
string using {@link String#valueOf(Object)}
@throws ... | [
"Ensures",
"the",
"truth",
"of",
"an",
"expression",
"involving",
"the",
"state",
"of",
"the",
"calling",
"instance",
"but",
"not",
"involving",
"any",
"parameters",
"to",
"the",
"calling",
"method",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/util/Preconditions.java#L91-L93 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java | RestartStrategies.failureRateRestart | public static FailureRateRestartStrategyConfiguration failureRateRestart(
int failureRate, Time failureInterval, Time delayInterval) {
"""
Generates a FailureRateRestartStrategyConfiguration.
@param failureRate Maximum number of restarts in given interval {@code failureInterval} before failing a job
@param ... | java | public static FailureRateRestartStrategyConfiguration failureRateRestart(
int failureRate, Time failureInterval, Time delayInterval) {
return new FailureRateRestartStrategyConfiguration(failureRate, failureInterval, delayInterval);
} | [
"public",
"static",
"FailureRateRestartStrategyConfiguration",
"failureRateRestart",
"(",
"int",
"failureRate",
",",
"Time",
"failureInterval",
",",
"Time",
"delayInterval",
")",
"{",
"return",
"new",
"FailureRateRestartStrategyConfiguration",
"(",
"failureRate",
",",
"fail... | Generates a FailureRateRestartStrategyConfiguration.
@param failureRate Maximum number of restarts in given interval {@code failureInterval} before failing a job
@param failureInterval Time interval for failures
@param delayInterval Delay in-between restart attempts | [
"Generates",
"a",
"FailureRateRestartStrategyConfiguration",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/restartstrategy/RestartStrategies.java#L79-L82 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.indexOf | public static int indexOf(ByteBuf buffer, int fromIndex, int toIndex, byte value) {
"""
The default implementation of {@link ByteBuf#indexOf(int, int, byte)}.
This method is useful when implementing a new buffer type.
"""
if (fromIndex <= toIndex) {
return firstIndexOf(buffer, fromIndex, t... | java | public static int indexOf(ByteBuf buffer, int fromIndex, int toIndex, byte value) {
if (fromIndex <= toIndex) {
return firstIndexOf(buffer, fromIndex, toIndex, value);
} else {
return lastIndexOf(buffer, fromIndex, toIndex, value);
}
} | [
"public",
"static",
"int",
"indexOf",
"(",
"ByteBuf",
"buffer",
",",
"int",
"fromIndex",
",",
"int",
"toIndex",
",",
"byte",
"value",
")",
"{",
"if",
"(",
"fromIndex",
"<=",
"toIndex",
")",
"{",
"return",
"firstIndexOf",
"(",
"buffer",
",",
"fromIndex",
... | The default implementation of {@link ByteBuf#indexOf(int, int, byte)}.
This method is useful when implementing a new buffer type. | [
"The",
"default",
"implementation",
"of",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L375-L381 |
diirt/util | src/main/java/org/epics/util/array/ListMath.java | ListMath.inverseRescale | public static ListDouble inverseRescale(final ListNumber data, final double numerator, final double offset) {
"""
Performs a linear transformation on inverse value of each number in a list.
@param data The list of numbers to divide the numerator by
@param numerator The numerator for each division
@param offs... | java | public static ListDouble inverseRescale(final ListNumber data, final double numerator, final double offset) {
return new ListDouble() {
@Override
public double getDouble(int index) {
return numerator / data.getDouble(index) + offset;
}
@O... | [
"public",
"static",
"ListDouble",
"inverseRescale",
"(",
"final",
"ListNumber",
"data",
",",
"final",
"double",
"numerator",
",",
"final",
"double",
"offset",
")",
"{",
"return",
"new",
"ListDouble",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"getDoub... | Performs a linear transformation on inverse value of each number in a list.
@param data The list of numbers to divide the numerator by
@param numerator The numerator for each division
@param offset The additive constant
@return result[x] = numerator / data[x] + offset | [
"Performs",
"a",
"linear",
"transformation",
"on",
"inverse",
"value",
"of",
"each",
"number",
"in",
"a",
"list",
"."
] | train | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/array/ListMath.java#L125-L138 |
Netflix/conductor | client/src/main/java/com/netflix/conductor/client/http/TaskClient.java | TaskClient.removeTaskFromQueue | public void removeTaskFromQueue(String taskType, String taskId) {
"""
Removes a task from a taskType queue
@param taskType the taskType to identify the queue
@param taskId the id of the task to be removed
"""
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank... | java | public void removeTaskFromQueue(String taskType, String taskId) {
Preconditions.checkArgument(StringUtils.isNotBlank(taskType), "Task type cannot be blank");
Preconditions.checkArgument(StringUtils.isNotBlank(taskId), "Task id cannot be blank");
delete("tasks/queue/{taskType}/{taskId}", taskTyp... | [
"public",
"void",
"removeTaskFromQueue",
"(",
"String",
"taskType",
",",
"String",
"taskId",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"StringUtils",
".",
"isNotBlank",
"(",
"taskType",
")",
",",
"\"Task type cannot be blank\"",
")",
";",
"Preconditions"... | Removes a task from a taskType queue
@param taskType the taskType to identify the queue
@param taskId the id of the task to be removed | [
"Removes",
"a",
"task",
"from",
"a",
"taskType",
"queue"
] | train | https://github.com/Netflix/conductor/blob/78fae0ed9ddea22891f9eebb96a2ec0b2783dca0/client/src/main/java/com/netflix/conductor/client/http/TaskClient.java#L320-L325 |
jbundle/jbundle | thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java | JAltGridScreen.addDetailComponent | public Component addDetailComponent(TableModel model, Object aValue, int iRowIndex, int iColumnIndex, GridBagConstraints c) {
"""
Create the appropriate component and add it to the grid detail at this location.
@param model The table model to read through.
@param iRowIndex The row to add this item.
@param iColu... | java | public Component addDetailComponent(TableModel model, Object aValue, int iRowIndex, int iColumnIndex, GridBagConstraints c)
{
JComponent component = null;
String string = "";
if (aValue instanceof ImageIcon)
{
component = new JLabel((ImageIcon)aValue);
}
i... | [
"public",
"Component",
"addDetailComponent",
"(",
"TableModel",
"model",
",",
"Object",
"aValue",
",",
"int",
"iRowIndex",
",",
"int",
"iColumnIndex",
",",
"GridBagConstraints",
"c",
")",
"{",
"JComponent",
"component",
"=",
"null",
";",
"String",
"string",
"=",... | Create the appropriate component and add it to the grid detail at this location.
@param model The table model to read through.
@param iRowIndex The row to add this item.
@param iColumnIndex The column index of this component.
@param c The constraint to use. | [
"Create",
"the",
"appropriate",
"component",
"and",
"add",
"it",
"to",
"the",
"grid",
"detail",
"at",
"this",
"location",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/grid/src/main/java/org/jbundle/thin/base/screen/grid/opt/JAltGridScreen.java#L255-L281 |
enasequence/sequencetools | src/main/java/uk/ac/ebi/embl/api/entry/sequence/Sequence.java | Sequence.getSequence | @Deprecated
@Override
public String getSequence(Long beginPosition, Long endPosition) {
"""
Overridden so we can create appropriate sized buffer before making
string.
@see uk.ac.ebi.embl.api.entry.sequence.AbstractSequence#getSequence(java.lang.Long,
java.lang.Long)
"""
if (beginPosition == null || e... | java | @Deprecated
@Override
public String getSequence(Long beginPosition, Long endPosition) {
if (beginPosition == null || endPosition == null
|| (beginPosition > endPosition) || beginPosition < 1
|| endPosition >getLength()) {
return null;
}
int length = (int) (endPosition.longValue() - beginPosi... | [
"@",
"Deprecated",
"@",
"Override",
"public",
"String",
"getSequence",
"(",
"Long",
"beginPosition",
",",
"Long",
"endPosition",
")",
"{",
"if",
"(",
"beginPosition",
"==",
"null",
"||",
"endPosition",
"==",
"null",
"||",
"(",
"beginPosition",
">",
"endPositio... | Overridden so we can create appropriate sized buffer before making
string.
@see uk.ac.ebi.embl.api.entry.sequence.AbstractSequence#getSequence(java.lang.Long,
java.lang.Long) | [
"Overridden",
"so",
"we",
"can",
"create",
"appropriate",
"sized",
"buffer",
"before",
"making",
"string",
"."
] | train | https://github.com/enasequence/sequencetools/blob/4127f5e1a17540239f5810136153fbd6737fa262/src/main/java/uk/ac/ebi/embl/api/entry/sequence/Sequence.java#L137-L173 |
CleverTap/clevertap-android-sdk | clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java | CleverTapAPI.changeCredentials | @SuppressWarnings("unused")
public static void changeCredentials(String accountID, String token) {
"""
This method is used to change the credentials of CleverTap account Id and token programmatically
@param accountID CleverTap Account Id
@param token CleverTap Account Token
"""
changeCredentials(... | java | @SuppressWarnings("unused")
public static void changeCredentials(String accountID, String token) {
changeCredentials(accountID, token, null);
} | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"static",
"void",
"changeCredentials",
"(",
"String",
"accountID",
",",
"String",
"token",
")",
"{",
"changeCredentials",
"(",
"accountID",
",",
"token",
",",
"null",
")",
";",
"}"
] | This method is used to change the credentials of CleverTap account Id and token programmatically
@param accountID CleverTap Account Id
@param token CleverTap Account Token | [
"This",
"method",
"is",
"used",
"to",
"change",
"the",
"credentials",
"of",
"CleverTap",
"account",
"Id",
"and",
"token",
"programmatically"
] | train | https://github.com/CleverTap/clevertap-android-sdk/blob/be134c06a4f07494c398335ad9ff4976633743e1/clevertap-android-sdk/src/main/java/com/clevertap/android/sdk/CleverTapAPI.java#L5972-L5975 |
Carbonado/Carbonado | src/main/java/com/amazon/carbonado/raw/DataDecoder.java | DataDecoder.decodeByte | public static byte decodeByte(byte[] src, int srcOffset)
throws CorruptEncodingException {
"""
Decodes a signed byte from exactly 1 byte.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed byte value
"""
try {
return (byte)(src[srcOff... | java | public static byte decodeByte(byte[] src, int srcOffset)
throws CorruptEncodingException
{
try {
return (byte)(src[srcOffset] ^ 0x80);
} catch (IndexOutOfBoundsException e) {
throw new CorruptEncodingException(null, e);
}
} | [
"public",
"static",
"byte",
"decodeByte",
"(",
"byte",
"[",
"]",
"src",
",",
"int",
"srcOffset",
")",
"throws",
"CorruptEncodingException",
"{",
"try",
"{",
"return",
"(",
"byte",
")",
"(",
"src",
"[",
"srcOffset",
"]",
"^",
"0x80",
")",
";",
"}",
"cat... | Decodes a signed byte from exactly 1 byte.
@param src source of encoded bytes
@param srcOffset offset into source array
@return signed byte value | [
"Decodes",
"a",
"signed",
"byte",
"from",
"exactly",
"1",
"byte",
"."
] | train | https://github.com/Carbonado/Carbonado/blob/eee29b365a61c8f03e1a1dc6bed0692e6b04b1db/src/main/java/com/amazon/carbonado/raw/DataDecoder.java#L135-L143 |
astrapi69/mystic-crypt | crypt-core/src/main/java/de/alpharogroup/crypto/core/AbstractFileEncryptor.java | AbstractFileEncryptor.newCipher | @Override
protected Cipher newCipher(final String privateKey, final String algorithm, final byte[] salt,
final int iterationCount, final int operationMode)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException, UnsupportedEncodin... | java | @Override
protected Cipher newCipher(final String privateKey, final String algorithm, final byte[] salt,
final int iterationCount, final int operationMode)
throws NoSuchAlgorithmException, InvalidKeySpecException, NoSuchPaddingException,
InvalidKeyException, InvalidAlgorithmParameterException, UnsupportedEncodin... | [
"@",
"Override",
"protected",
"Cipher",
"newCipher",
"(",
"final",
"String",
"privateKey",
",",
"final",
"String",
"algorithm",
",",
"final",
"byte",
"[",
"]",
"salt",
",",
"final",
"int",
"iterationCount",
",",
"final",
"int",
"operationMode",
")",
"throws",
... | Factory method for creating a new {@link Cipher} from the given parameters. This method is
invoked in the constructor from the derived classes and can be overridden so users can
provide their own version of a new {@link Cipher} from the given parameters.
@param privateKey
the private key
@param algorithm
the algorithm... | [
"Factory",
"method",
"for",
"creating",
"a",
"new",
"{",
"@link",
"Cipher",
"}",
"from",
"the",
"given",
"parameters",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
... | train | https://github.com/astrapi69/mystic-crypt/blob/7f51ef5e4457e24de7ff391f10bfc5609e6f1a34/crypt-core/src/main/java/de/alpharogroup/crypto/core/AbstractFileEncryptor.java#L177-L188 |
joniles/mpxj | src/main/java/net/sf/mpxj/primavera/p3/P3PRXFileReader.java | P3PRXFileReader.extractFile | private void extractFile(InputStream stream, File dir) throws IOException {
"""
Extracts the data for a single file from the input stream and writes
it to a target directory.
@param stream input stream
@param dir target directory
"""
byte[] header = new byte[8];
byte[] fileName = new byte[13];... | java | private void extractFile(InputStream stream, File dir) throws IOException
{
byte[] header = new byte[8];
byte[] fileName = new byte[13];
byte[] dataSize = new byte[4];
stream.read(header);
stream.read(fileName);
stream.read(dataSize);
int dataSizeValue = getInt(dataSize, 0... | [
"private",
"void",
"extractFile",
"(",
"InputStream",
"stream",
",",
"File",
"dir",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"header",
"=",
"new",
"byte",
"[",
"8",
"]",
";",
"byte",
"[",
"]",
"fileName",
"=",
"new",
"byte",
"[",
"13",
"]... | Extracts the data for a single file from the input stream and writes
it to a target directory.
@param stream input stream
@param dir target directory | [
"Extracts",
"the",
"data",
"for",
"a",
"single",
"file",
"from",
"the",
"input",
"stream",
"and",
"writes",
"it",
"to",
"a",
"target",
"directory",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/primavera/p3/P3PRXFileReader.java#L105-L131 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java | Mathlib.lineIntersects | public static boolean lineIntersects(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
"""
Calculates whether or not 2 line-segments intersect.
@param c1
First coordinate of the first line-segment.
@param c2
Second coordinate of the first line-segment.
@param c3
First coordinate of the second l... | java | public static boolean lineIntersects(Coordinate c1, Coordinate c2, Coordinate c3, Coordinate c4) {
LineSegment ls1 = new LineSegment(c1, c2);
LineSegment ls2 = new LineSegment(c3, c4);
return ls1.intersects(ls2);
} | [
"public",
"static",
"boolean",
"lineIntersects",
"(",
"Coordinate",
"c1",
",",
"Coordinate",
"c2",
",",
"Coordinate",
"c3",
",",
"Coordinate",
"c4",
")",
"{",
"LineSegment",
"ls1",
"=",
"new",
"LineSegment",
"(",
"c1",
",",
"c2",
")",
";",
"LineSegment",
"... | Calculates whether or not 2 line-segments intersect.
@param c1
First coordinate of the first line-segment.
@param c2
Second coordinate of the first line-segment.
@param c3
First coordinate of the second line-segment.
@param c4
Second coordinate of the second line-segment.
@return Returns true or false. | [
"Calculates",
"whether",
"or",
"not",
"2",
"line",
"-",
"segments",
"intersect",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/spatial/Mathlib.java#L45-L49 |
Azure/azure-sdk-for-java | notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java | NamespacesInner.getByResourceGroupAsync | public Observable<NamespaceResourceInner> getByResourceGroupAsync(String resourceGroupName, String namespaceName) {
"""
Returns the description for the specified namespace.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@throws IllegalArgumentException thrown... | java | public Observable<NamespaceResourceInner> getByResourceGroupAsync(String resourceGroupName, String namespaceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, namespaceName).map(new Func1<ServiceResponse<NamespaceResourceInner>, NamespaceResourceInner>() {
@Override
... | [
"public",
"Observable",
"<",
"NamespaceResourceInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"namespaceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"namespaceName",
")",
... | Returns the description for the specified namespace.
@param resourceGroupName The name of the resource group.
@param namespaceName The namespace name.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the NamespaceResourceInner object | [
"Returns",
"the",
"description",
"for",
"the",
"specified",
"namespace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/notificationhubs/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/notificationhubs/v2016_03_01/implementation/NamespacesInner.java#L603-L610 |
phax/ph-commons | ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java | MicroWriter.writeToFile | @Nonnull
public static ESuccess writeToFile (@Nonnull final IMicroNode aNode, @Nonnull final Path aPath) {
"""
Write a Micro Node to a file using the default settings.
@param aNode
The node to be serialized. May be any kind of node (incl.
documents). May not be <code>null</code>.
@param aPath
The file to ... | java | @Nonnull
public static ESuccess writeToFile (@Nonnull final IMicroNode aNode, @Nonnull final Path aPath)
{
return writeToFile (aNode, aPath, XMLWriterSettings.DEFAULT_XML_SETTINGS);
} | [
"@",
"Nonnull",
"public",
"static",
"ESuccess",
"writeToFile",
"(",
"@",
"Nonnull",
"final",
"IMicroNode",
"aNode",
",",
"@",
"Nonnull",
"final",
"Path",
"aPath",
")",
"{",
"return",
"writeToFile",
"(",
"aNode",
",",
"aPath",
",",
"XMLWriterSettings",
".",
"... | Write a Micro Node to a file using the default settings.
@param aNode
The node to be serialized. May be any kind of node (incl.
documents). May not be <code>null</code>.
@param aPath
The file to write to. May not be <code>null</code>.
@return {@link ESuccess} | [
"Write",
"a",
"Micro",
"Node",
"to",
"a",
"file",
"using",
"the",
"default",
"settings",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-xml/src/main/java/com/helger/xml/microdom/serialize/MicroWriter.java#L115-L119 |
motown-io/motown | operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java | ChargingStationEventListener.updateChargingStationOpeningTimes | private boolean updateChargingStationOpeningTimes(ChargingStationOpeningTimesChangedEvent event, boolean clear) {
"""
Updates the opening times of the charging station.
@param event The event which contains the opening times.
@param clear Whether to clear the opening times or not.
@return {@code true} if the ... | java | private boolean updateChargingStationOpeningTimes(ChargingStationOpeningTimesChangedEvent event, boolean clear) {
ChargingStation chargingStation = repository.findOne(event.getChargingStationId().getId());
if (chargingStation != null) {
if (!event.getOpeningTimes().isEmpty()) {
... | [
"private",
"boolean",
"updateChargingStationOpeningTimes",
"(",
"ChargingStationOpeningTimesChangedEvent",
"event",
",",
"boolean",
"clear",
")",
"{",
"ChargingStation",
"chargingStation",
"=",
"repository",
".",
"findOne",
"(",
"event",
".",
"getChargingStationId",
"(",
... | Updates the opening times of the charging station.
@param event The event which contains the opening times.
@param clear Whether to clear the opening times or not.
@return {@code true} if the update has been performed, {@code false} if the charging station can't be found. | [
"Updates",
"the",
"opening",
"times",
"of",
"the",
"charging",
"station",
"."
] | train | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/operator-api/view-model/src/main/java/io/motown/operatorapi/viewmodel/ChargingStationEventListener.java#L408-L434 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java | SerializationUtils.writeObject | public static void writeObject(Serializable toSave, OutputStream writeTo) {
"""
Writes the object to the output stream
THIS DOES NOT FLUSH THE STREAM
@param toSave the object to save
@param writeTo the output stream to write to
"""
try {
ObjectOutputStream os = new ObjectOutputStream(wri... | java | public static void writeObject(Serializable toSave, OutputStream writeTo) {
try {
ObjectOutputStream os = new ObjectOutputStream(writeTo);
os.writeObject(toSave);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"writeObject",
"(",
"Serializable",
"toSave",
",",
"OutputStream",
"writeTo",
")",
"{",
"try",
"{",
"ObjectOutputStream",
"os",
"=",
"new",
"ObjectOutputStream",
"(",
"writeTo",
")",
";",
"os",
".",
"writeObject",
"(",
"toSave",
")"... | Writes the object to the output stream
THIS DOES NOT FLUSH THE STREAM
@param toSave the object to save
@param writeTo the output stream to write to | [
"Writes",
"the",
"object",
"to",
"the",
"output",
"stream",
"THIS",
"DOES",
"NOT",
"FLUSH",
"THE",
"STREAM"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/SerializationUtils.java#L119-L126 |
find-sec-bugs/find-sec-bugs | findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/cookie/CookieFlagsDetector.java | CookieFlagsDetector.getCookieInstructionLocation | private Location getCookieInstructionLocation(ConstantPoolGen cpg, Location startLocation, int objectStackLocation, String invokeInstruction) {
"""
This method is used to track calls made on a specific object. For instance, this could be used to track if "setHttpOnly(true)"
was executed on a specific cookie objec... | java | private Location getCookieInstructionLocation(ConstantPoolGen cpg, Location startLocation, int objectStackLocation, String invokeInstruction) {
Location location = startLocation;
InstructionHandle handle = location.getHandle();
int loadedStackValue = 0;
// Loop until we find the setSec... | [
"private",
"Location",
"getCookieInstructionLocation",
"(",
"ConstantPoolGen",
"cpg",
",",
"Location",
"startLocation",
",",
"int",
"objectStackLocation",
",",
"String",
"invokeInstruction",
")",
"{",
"Location",
"location",
"=",
"startLocation",
";",
"InstructionHandle",... | This method is used to track calls made on a specific object. For instance, this could be used to track if "setHttpOnly(true)"
was executed on a specific cookie object.
This allows the detector to find interchanged calls like this
Cookie cookie1 = new Cookie("f", "foo"); <- This cookie is unsafe
Cookie cookie2 = ... | [
"This",
"method",
"is",
"used",
"to",
"track",
"calls",
"made",
"on",
"a",
"specific",
"object",
".",
"For",
"instance",
"this",
"could",
"be",
"used",
"to",
"track",
"if",
"setHttpOnly",
"(",
"true",
")",
"was",
"executed",
"on",
"a",
"specific",
"cooki... | train | https://github.com/find-sec-bugs/find-sec-bugs/blob/362da013cef4925e6a1506dd3511fe5bdcc5fba3/findsecbugs-plugin/src/main/java/com/h3xstream/findsecbugs/cookie/CookieFlagsDetector.java#L135-L170 |
alkacon/opencms-core | src/org/opencms/ade/containerpage/CmsElementUtil.java | CmsElementUtil.hasSettings | private boolean hasSettings(CmsObject cms, CmsResource resource) throws CmsException {
"""
Helper method for checking whether there are properties defined for a given content element.<p>
@param cms the CmsObject to use for VFS operations
@param resource the resource for which it should be checked whether it ha... | java | private boolean hasSettings(CmsObject cms, CmsResource resource) throws CmsException {
if (!CmsResourceTypeXmlContent.isXmlContent(resource)) {
return false;
}
CmsFormatterConfiguration formatters = getConfigData().getFormatters(m_cms, resource);
boolean result = (formatter... | [
"private",
"boolean",
"hasSettings",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"if",
"(",
"!",
"CmsResourceTypeXmlContent",
".",
"isXmlContent",
"(",
"resource",
")",
")",
"{",
"return",
"false",
";",
"}",
"Cm... | Helper method for checking whether there are properties defined for a given content element.<p>
@param cms the CmsObject to use for VFS operations
@param resource the resource for which it should be checked whether it has properties
@return true if the resource has properties defined
@throws CmsException if somethin... | [
"Helper",
"method",
"for",
"checking",
"whether",
"there",
"are",
"properties",
"defined",
"for",
"a",
"given",
"content",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ade/containerpage/CmsElementUtil.java#L1092-L1106 |
pravega/pravega | segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/tables/TableKey.java | TableKey.versioned | public static TableKey versioned(@NonNull ArrayView key, long version) {
"""
Creates a new instance of the TableKey class with a specified version.
@param key The Key.
@param version The desired version.
@return new TableKey with specified version
"""
Preconditions.checkArgument(version >= 0... | java | public static TableKey versioned(@NonNull ArrayView key, long version) {
Preconditions.checkArgument(version >= 0 || version == NOT_EXISTS || version == NO_VERSION, "Version must be a non-negative number.");
return new TableKey(key, version);
} | [
"public",
"static",
"TableKey",
"versioned",
"(",
"@",
"NonNull",
"ArrayView",
"key",
",",
"long",
"version",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"version",
">=",
"0",
"||",
"version",
"==",
"NOT_EXISTS",
"||",
"version",
"==",
"NO_VERSION",
... | Creates a new instance of the TableKey class with a specified version.
@param key The Key.
@param version The desired version.
@return new TableKey with specified version | [
"Creates",
"a",
"new",
"instance",
"of",
"the",
"TableKey",
"class",
"with",
"a",
"specified",
"version",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/contracts/src/main/java/io/pravega/segmentstore/contracts/tables/TableKey.java#L77-L80 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.updateObjects | @Override
public <T> long updateObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
"""
Updates a collection of Objects in the datasource. The assumption is that the objects contained in the c... | java | @Override
public <T> long updateObjects(String name, Collection<T> coll, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException {
return processUpdateGroup(coll, CpoAdapter.UPDATE_GROUP, name, wheres, orderBy, nativeExpressions);
} | [
"@",
"Override",
"public",
"<",
"T",
">",
"long",
"updateObjects",
"(",
"String",
"name",
",",
"Collection",
"<",
"T",
">",
"coll",
",",
"Collection",
"<",
"CpoWhere",
">",
"wheres",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
",",
"Collection",
... | Updates a collection of Objects in the datasource. The assumption is that the objects contained in the collection
exist in the datasource. This method stores the object in the datasource. The objects in the collection will be
treated as one transaction, meaning that if one of the objects fail being updated in the datas... | [
"Updates",
"a",
"collection",
"of",
"Objects",
"in",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"objects",
"contained",
"in",
"the",
"collection",
"exist",
"in",
"the",
"datasource",
".",
"This",
"method",
"stores",
"the",
"object",
... | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1907-L1910 |
restfb/restfb | src/main/java/com/restfb/DefaultFacebookClient.java | DefaultFacebookClient.verifySignedRequest | protected boolean verifySignedRequest(String appSecret, String algorithm, String encodedPayload, byte[] signature) {
"""
Verifies that the signed request is really from Facebook.
@param appSecret
The secret for the app that can verify this signed request.
@param algorithm
Signature algorithm specified by FB ... | java | protected boolean verifySignedRequest(String appSecret, String algorithm, String encodedPayload, byte[] signature) {
verifyParameterPresence("appSecret", appSecret);
verifyParameterPresence("algorithm", algorithm);
verifyParameterPresence("encodedPayload", encodedPayload);
verifyParameterPresence("signa... | [
"protected",
"boolean",
"verifySignedRequest",
"(",
"String",
"appSecret",
",",
"String",
"algorithm",
",",
"String",
"encodedPayload",
",",
"byte",
"[",
"]",
"signature",
")",
"{",
"verifyParameterPresence",
"(",
"\"appSecret\"",
",",
"appSecret",
")",
";",
"veri... | Verifies that the signed request is really from Facebook.
@param appSecret
The secret for the app that can verify this signed request.
@param algorithm
Signature algorithm specified by FB in the decoded payload.
@param encodedPayload
The encoded payload used to generate a signature for comparison against the provided ... | [
"Verifies",
"that",
"the",
"signed",
"request",
"is",
"really",
"from",
"Facebook",
"."
] | train | https://github.com/restfb/restfb/blob/fb77ba5486d1339e7deb81b9830670fa209b1047/src/main/java/com/restfb/DefaultFacebookClient.java#L657-L676 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/storage/ShortcutUnpacker.java | ShortcutUnpacker.visitOriginalEdges | public void visitOriginalEdges(int edgeId, int adjNode, boolean reverseOrder) {
"""
Finds an edge/shortcut with the given id and adjNode and calls the visitor for each original edge that is
packed inside this shortcut (or if an original edge is given simply calls the visitor on it).
@param reverseOrder if true... | java | public void visitOriginalEdges(int edgeId, int adjNode, boolean reverseOrder) {
this.reverseOrder = reverseOrder;
CHEdgeIteratorState edge = getEdge(edgeId, adjNode);
if (edge == null) {
throw new IllegalArgumentException("Edge with id: " + edgeId + " does not exist or does not touch... | [
"public",
"void",
"visitOriginalEdges",
"(",
"int",
"edgeId",
",",
"int",
"adjNode",
",",
"boolean",
"reverseOrder",
")",
"{",
"this",
".",
"reverseOrder",
"=",
"reverseOrder",
";",
"CHEdgeIteratorState",
"edge",
"=",
"getEdge",
"(",
"edgeId",
",",
"adjNode",
... | Finds an edge/shortcut with the given id and adjNode and calls the visitor for each original edge that is
packed inside this shortcut (or if an original edge is given simply calls the visitor on it).
@param reverseOrder if true the original edges will be traversed in reverse order | [
"Finds",
"an",
"edge",
"/",
"shortcut",
"with",
"the",
"given",
"id",
"and",
"adjNode",
"and",
"calls",
"the",
"visitor",
"for",
"each",
"original",
"edge",
"that",
"is",
"packed",
"inside",
"this",
"shortcut",
"(",
"or",
"if",
"an",
"original",
"edge",
... | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/storage/ShortcutUnpacker.java#L34-L41 |
PureSolTechnologies/commons | misc/src/main/java/com/puresoltechnologies/commons/misc/io/FileUtilities.java | FileUtilities.isUpdateRequired | public static boolean isUpdateRequired(File sourceFile, File targetFile) {
"""
This method checks for the requirement for an update.
If a the target file exists and the modification time is greater than the
modification time of the source file, we do not need to analyze something.
@param sourceFile
is the ... | java | public static boolean isUpdateRequired(File sourceFile, File targetFile) {
if (targetFile.exists()) {
if (targetFile.lastModified() > sourceFile.lastModified()) {
return false;
}
}
return true;
} | [
"public",
"static",
"boolean",
"isUpdateRequired",
"(",
"File",
"sourceFile",
",",
"File",
"targetFile",
")",
"{",
"if",
"(",
"targetFile",
".",
"exists",
"(",
")",
")",
"{",
"if",
"(",
"targetFile",
".",
"lastModified",
"(",
")",
">",
"sourceFile",
".",
... | This method checks for the requirement for an update.
If a the target file exists and the modification time is greater than the
modification time of the source file, we do not need to analyze something.
@param sourceFile
is the source file where it is intended to be copied from.
@param targetFile
is the file to which... | [
"This",
"method",
"checks",
"for",
"the",
"requirement",
"for",
"an",
"update",
"."
] | train | https://github.com/PureSolTechnologies/commons/blob/f98c23d8841a1ff61632ff17fe7d24f99dbc1d44/misc/src/main/java/com/puresoltechnologies/commons/misc/io/FileUtilities.java#L80-L87 |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java | JavaParser.primitiveType | public final void primitiveType() throws RecognitionException {
"""
src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:536:1: primitiveType : ( 'boolean' | 'char' | 'byte' | 'short' | 'int' | 'long' | 'float' | 'double' );
"""
int primitiveType_StartIndex = input.index();
try {
if ( st... | java | public final void primitiveType() throws RecognitionException {
int primitiveType_StartIndex = input.index();
try {
if ( state.backtracking>0 && alreadyParsedRule(input, 51) ) { return; }
// src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:537:5: ( 'boolean' | 'char' | 'byte' | 'short' | ... | [
"public",
"final",
"void",
"primitiveType",
"(",
")",
"throws",
"RecognitionException",
"{",
"int",
"primitiveType_StartIndex",
"=",
"input",
".",
"index",
"(",
")",
";",
"try",
"{",
"if",
"(",
"state",
".",
"backtracking",
">",
"0",
"&&",
"alreadyParsedRule",... | src/main/resources/org/drools/compiler/semantics/java/parser/Java.g:536:1: primitiveType : ( 'boolean' | 'char' | 'byte' | 'short' | 'int' | 'long' | 'float' | 'double' ); | [
"src",
"/",
"main",
"/",
"resources",
"/",
"org",
"/",
"drools",
"/",
"compiler",
"/",
"semantics",
"/",
"java",
"/",
"parser",
"/",
"Java",
".",
"g",
":",
"536",
":",
"1",
":",
"primitiveType",
":",
"(",
"boolean",
"|",
"char",
"|",
"byte",
"|",
... | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/rule/builder/dialect/java/parser/JavaParser.java#L4413-L4444 |
spring-projects/spring-loaded | springloaded/src/main/java/org/springsource/loaded/Utils.java | Utils.addCorrectReturnInstruction | public static void addCorrectReturnInstruction(MethodVisitor mv, ReturnType returnType, boolean createCast) {
"""
Depending on the signature of the return type, add the appropriate instructions to the method visitor.
@param mv where to visit to append the instructions
@param returnType return type descriptor
... | java | public static void addCorrectReturnInstruction(MethodVisitor mv, ReturnType returnType, boolean createCast) {
if (returnType.isPrimitive()) {
char ch = returnType.descriptor.charAt(0);
switch (ch) {
case 'V': // void is treated as a special primitive
mv.visitInsn(RETURN);
break;
case 'I':
... | [
"public",
"static",
"void",
"addCorrectReturnInstruction",
"(",
"MethodVisitor",
"mv",
",",
"ReturnType",
"returnType",
",",
"boolean",
"createCast",
")",
"{",
"if",
"(",
"returnType",
".",
"isPrimitive",
"(",
")",
")",
"{",
"char",
"ch",
"=",
"returnType",
".... | Depending on the signature of the return type, add the appropriate instructions to the method visitor.
@param mv where to visit to append the instructions
@param returnType return type descriptor
@param createCast whether to include CHECKCAST instructions for return type values | [
"Depending",
"on",
"the",
"signature",
"of",
"the",
"return",
"type",
"add",
"the",
"appropriate",
"instructions",
"to",
"the",
"method",
"visitor",
"."
] | train | https://github.com/spring-projects/spring-loaded/blob/59b32f957a05c6d9f149148158053605e2a6205a/springloaded/src/main/java/org/springsource/loaded/Utils.java#L113-L153 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/operators/OperatorForEachFuture.java | OperatorForEachFuture.forEachFuture | public static <T> FutureTask<Void> forEachFuture(
Observable<? extends T> source,
Action1<? super T> onNext) {
"""
Subscribes to the given source and calls the callback for each emitted item,
and surfaces the completion or error through a Future.
@param <T> the element type of the Observ... | java | public static <T> FutureTask<Void> forEachFuture(
Observable<? extends T> source,
Action1<? super T> onNext) {
return forEachFuture(source, onNext, Functionals.emptyThrowable(), Functionals.empty());
} | [
"public",
"static",
"<",
"T",
">",
"FutureTask",
"<",
"Void",
">",
"forEachFuture",
"(",
"Observable",
"<",
"?",
"extends",
"T",
">",
"source",
",",
"Action1",
"<",
"?",
"super",
"T",
">",
"onNext",
")",
"{",
"return",
"forEachFuture",
"(",
"source",
"... | Subscribes to the given source and calls the callback for each emitted item,
and surfaces the completion or error through a Future.
@param <T> the element type of the Observable
@param source the source Observable
@param onNext the action to call with each emitted element
@return the Future representing the entire for-... | [
"Subscribes",
"to",
"the",
"given",
"source",
"and",
"calls",
"the",
"callback",
"for",
"each",
"emitted",
"item",
"and",
"surfaces",
"the",
"completion",
"or",
"error",
"through",
"a",
"Future",
"."
] | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/operators/OperatorForEachFuture.java#L44-L48 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.getByResourceGroupAsync | public Observable<SignalRResourceInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
"""
Get the SignalR service and its properties.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or th... | java | public Observable<SignalRResourceInner> getByResourceGroupAsync(String resourceGroupName, String resourceName) {
return getByResourceGroupWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResourceInner>() {
@Override
pub... | [
"public",
"Observable",
"<",
"SignalRResourceInner",
">",
"getByResourceGroupAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",... | Get the SignalR service and its properties.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param resourceName The name of the SignalR resource.
@throws IllegalArgumentException thrown if parameters fail t... | [
"Get",
"the",
"SignalR",
"service",
"and",
"its",
"properties",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L935-L942 |
Cornutum/tcases | tcases-lib/src/main/java/org/cornutum/tcases/generator/GeneratorSet.java | GeneratorSet.addGenerator | public void addGenerator( String functionName, ITestCaseGenerator generator) {
"""
Adds a new test case generator for the given system function.
"""
String functionKey = getFunctionKey( functionName);
if( generators_.containsKey( functionKey))
{
throw new IllegalArgumentException( "Generato... | java | public void addGenerator( String functionName, ITestCaseGenerator generator)
{
String functionKey = getFunctionKey( functionName);
if( generators_.containsKey( functionKey))
{
throw new IllegalArgumentException( "Generator already defined for function=" + functionName);
}
if( generato... | [
"public",
"void",
"addGenerator",
"(",
"String",
"functionName",
",",
"ITestCaseGenerator",
"generator",
")",
"{",
"String",
"functionKey",
"=",
"getFunctionKey",
"(",
"functionName",
")",
";",
"if",
"(",
"generators_",
".",
"containsKey",
"(",
"functionKey",
")",... | Adds a new test case generator for the given system function. | [
"Adds",
"a",
"new",
"test",
"case",
"generator",
"for",
"the",
"given",
"system",
"function",
"."
] | train | https://github.com/Cornutum/tcases/blob/21e15cf107fa149620c40f4bda1829c1224fcfb1/tcases-lib/src/main/java/org/cornutum/tcases/generator/GeneratorSet.java#L57-L69 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java | OdsElements.writeContent | public void writeContent(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException {
"""
Write the content element to a writer.
@param xmlUtil the xml util
@param writer the writer
@throws IOException if write fails
"""
this.logger.log(Level.FINER, "Writing odselement: contentElement... | java | public void writeContent(final XMLUtil xmlUtil, final ZipUTF8Writer writer) throws IOException {
this.logger.log(Level.FINER, "Writing odselement: contentElement to zip file");
this.contentElement.write(xmlUtil, writer);
} | [
"public",
"void",
"writeContent",
"(",
"final",
"XMLUtil",
"xmlUtil",
",",
"final",
"ZipUTF8Writer",
"writer",
")",
"throws",
"IOException",
"{",
"this",
".",
"logger",
".",
"log",
"(",
"Level",
".",
"FINER",
",",
"\"Writing odselement: contentElement to zip file\""... | Write the content element to a writer.
@param xmlUtil the xml util
@param writer the writer
@throws IOException if write fails | [
"Write",
"the",
"content",
"element",
"to",
"a",
"writer",
"."
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/OdsElements.java#L373-L376 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/api/API.java | API.responseToXml | static String responseToXml(String endpointName, ApiResponse response) throws ApiException {
"""
Gets the XML representation of the given API {@code response}.
<p>
An XML element named with name of the endpoint and with child elements as given by
{@link ApiResponse#toXML(Document, Element)}.
@param endpointN... | java | static String responseToXml(String endpointName, ApiResponse response) throws ApiException {
try {
DocumentBuilderFactory docFactory = DocumentBuilderFactory.newInstance();
DocumentBuilder docBuilder = docFactory.newDocumentBuilder();
Document doc = docBuilder.newDocument();
Element rootElement = doc.cr... | [
"static",
"String",
"responseToXml",
"(",
"String",
"endpointName",
",",
"ApiResponse",
"response",
")",
"throws",
"ApiException",
"{",
"try",
"{",
"DocumentBuilderFactory",
"docFactory",
"=",
"DocumentBuilderFactory",
".",
"newInstance",
"(",
")",
";",
"DocumentBuild... | Gets the XML representation of the given API {@code response}.
<p>
An XML element named with name of the endpoint and with child elements as given by
{@link ApiResponse#toXML(Document, Element)}.
@param endpointName the name of the API endpoint, must not be {@code null}.
@param response the API response, must not be {... | [
"Gets",
"the",
"XML",
"representation",
"of",
"the",
"given",
"API",
"{",
"@code",
"response",
"}",
".",
"<p",
">",
"An",
"XML",
"element",
"named",
"with",
"name",
"of",
"the",
"endpoint",
"and",
"with",
"child",
"elements",
"as",
"given",
"by",
"{",
... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/api/API.java#L703-L727 |
mygreen/excel-cellformatter | src/main/java/com/github/mygreen/cellformatter/ConditionFormatterFactory.java | ConditionFormatterFactory.setupConditionColor | protected MSColor setupConditionColor(final ConditionFormatter formatter, final Token.Condition token) {
"""
{@literal '[Red]'}などの色の条件の組み立てる。
@param formatter 現在の組み立て中のフォーマッタのインスタンス。
@param token 条件式のトークン。
@return 色の条件式。
@throws IllegalArgumentException 処理対象の条件として一致しない場合
"""
// 名前指定の場合
... | java | protected MSColor setupConditionColor(final ConditionFormatter formatter, final Token.Condition token) {
// 名前指定の場合
MSColor color = MSColor.valueOfKnownColor(token.getCondition());
if(color != null) {
formatter.setColor(color);
return color;
}
/... | [
"protected",
"MSColor",
"setupConditionColor",
"(",
"final",
"ConditionFormatter",
"formatter",
",",
"final",
"Token",
".",
"Condition",
"token",
")",
"{",
"// 名前指定の場合\r",
"MSColor",
"color",
"=",
"MSColor",
".",
"valueOfKnownColor",
"(",
"token",
".",
"getCondition... | {@literal '[Red]'}などの色の条件の組み立てる。
@param formatter 現在の組み立て中のフォーマッタのインスタンス。
@param token 条件式のトークン。
@return 色の条件式。
@throws IllegalArgumentException 処理対象の条件として一致しない場合 | [
"{"
] | train | https://github.com/mygreen/excel-cellformatter/blob/e802af273d49889500591e03799c9262cbf29185/src/main/java/com/github/mygreen/cellformatter/ConditionFormatterFactory.java#L266-L289 |
tvesalainen/lpg | src/main/java/org/vesalainen/grammar/Grammar.java | Grammar.getParserGenerator | public LALRKParserGenerator getParserGenerator(ParseMethod parseMethod) {
"""
Return a parser generator from grammar. The same grammar can produce different
parsers depending for example on start rhs.
@return
"""
Grammar g = new Grammar(parseMethod.start(), this, parseMethod.eof(), parseMethod.white... | java | public LALRKParserGenerator getParserGenerator(ParseMethod parseMethod)
{
Grammar g = new Grammar(parseMethod.start(), this, parseMethod.eof(), parseMethod.whiteSpace());
try
{
return g.createParserGenerator(parseMethod.start(), ParserFeature.get(parseMethod));
}
... | [
"public",
"LALRKParserGenerator",
"getParserGenerator",
"(",
"ParseMethod",
"parseMethod",
")",
"{",
"Grammar",
"g",
"=",
"new",
"Grammar",
"(",
"parseMethod",
".",
"start",
"(",
")",
",",
"this",
",",
"parseMethod",
".",
"eof",
"(",
")",
",",
"parseMethod",
... | Return a parser generator from grammar. The same grammar can produce different
parsers depending for example on start rhs.
@return | [
"Return",
"a",
"parser",
"generator",
"from",
"grammar",
".",
"The",
"same",
"grammar",
"can",
"produce",
"different",
"parsers",
"depending",
"for",
"example",
"on",
"start",
"rhs",
"."
] | train | https://github.com/tvesalainen/lpg/blob/0917b8d295e9772b9f8a0affc258a08530cd567a/src/main/java/org/vesalainen/grammar/Grammar.java#L394-L405 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/sch/util/dist/TruncatedNormal.java | TruncatedNormal.meanTruncLower | public static double meanTruncLower(double mu, double sigma, double lowerBound) {
"""
Returns the mean of the normal distribution truncated to 0 for values of x < lowerBound
"""
double alpha = (lowerBound - mu) / sigma;
double phiAlpha = densityNonTrunc(alpha, 0, 1.0);
double cPhiAlpha ... | java | public static double meanTruncLower(double mu, double sigma, double lowerBound) {
double alpha = (lowerBound - mu) / sigma;
double phiAlpha = densityNonTrunc(alpha, 0, 1.0);
double cPhiAlpha = cumulativeNonTrunc(alpha, 0, 1.0);
return mu + sigma * phiAlpha / (1.0 - cPhiAlpha);
} | [
"public",
"static",
"double",
"meanTruncLower",
"(",
"double",
"mu",
",",
"double",
"sigma",
",",
"double",
"lowerBound",
")",
"{",
"double",
"alpha",
"=",
"(",
"lowerBound",
"-",
"mu",
")",
"/",
"sigma",
";",
"double",
"phiAlpha",
"=",
"densityNonTrunc",
... | Returns the mean of the normal distribution truncated to 0 for values of x < lowerBound | [
"Returns",
"the",
"mean",
"of",
"the",
"normal",
"distribution",
"truncated",
"to",
"0",
"for",
"values",
"of",
"x",
"<",
"lowerBound"
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/sch/util/dist/TruncatedNormal.java#L189-L194 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.getInstance | public static CassandraCpoAdapter getInstance(CassandraCpoMetaDescriptor metaDescriptor, DataSourceInfo<ClusterDataSource> cdsiWrite, DataSourceInfo<ClusterDataSource> cdsiRead) throws CpoException {
"""
Creates a CassandraCpoAdapter.
@param metaDescriptor This datasource that identifies the cpo metadata dataso... | java | public static CassandraCpoAdapter getInstance(CassandraCpoMetaDescriptor metaDescriptor, DataSourceInfo<ClusterDataSource> cdsiWrite, DataSourceInfo<ClusterDataSource> cdsiRead) throws CpoException {
String adapterKey = metaDescriptor + ":" + cdsiWrite.getDataSourceName() + ":" + cdsiRead.getDataSourceName();
C... | [
"public",
"static",
"CassandraCpoAdapter",
"getInstance",
"(",
"CassandraCpoMetaDescriptor",
"metaDescriptor",
",",
"DataSourceInfo",
"<",
"ClusterDataSource",
">",
"cdsiWrite",
",",
"DataSourceInfo",
"<",
"ClusterDataSource",
">",
"cdsiRead",
")",
"throws",
"CpoException",... | Creates a CassandraCpoAdapter.
@param metaDescriptor This datasource that identifies the cpo metadata datasource
@param cdsiWrite The datasource that identifies the transaction database for write transactions.
@param cdsiRead The datasource that identifies the transaction database for read-only transactions... | [
"Creates",
"a",
"CassandraCpoAdapter",
"."
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L112-L120 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java | InstallKernelMap.populateFeatureNameFromManifest | private static void populateFeatureNameFromManifest(File esa, Map<String, String> shortNameMap) throws IOException {
"""
Populate the feature name (short name if available, otherwise symbolic name) from the ESA's manifest into the shortNameMap.
@param esa ESA file
@param shortNameMap Map to populate with keys ... | java | private static void populateFeatureNameFromManifest(File esa, Map<String, String> shortNameMap) throws IOException {
String esaLocation = esa.getCanonicalPath();
ZipFile zip = null;
try {
zip = new ZipFile(esaLocation);
Enumeration<? extends ZipEntry> zipEntries = zip.ent... | [
"private",
"static",
"void",
"populateFeatureNameFromManifest",
"(",
"File",
"esa",
",",
"Map",
"<",
"String",
",",
"String",
">",
"shortNameMap",
")",
"throws",
"IOException",
"{",
"String",
"esaLocation",
"=",
"esa",
".",
"getCanonicalPath",
"(",
")",
";",
"... | Populate the feature name (short name if available, otherwise symbolic name) from the ESA's manifest into the shortNameMap.
@param esa ESA file
@param shortNameMap Map to populate with keys being ESA canonical paths and values being feature names (short name or symbolic name)
@throws IOException If the ESA's canonical... | [
"Populate",
"the",
"feature",
"name",
"(",
"short",
"name",
"if",
"available",
"otherwise",
"symbolic",
"name",
")",
"from",
"the",
"ESA",
"s",
"manifest",
"into",
"the",
"shortNameMap",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/InstallKernelMap.java#L804-L833 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/collection/MultiDimensionalSet.java | MultiDimensionalSet.addAll | @Override
public boolean addAll(Collection<? extends Pair<K, V>> c) {
"""
Adds all of the elements in the specified collection to this applyTransformToDestination if
they're not already present (optional operation). If the specified
collection is also a applyTransformToDestination, the <tt>addAll</tt> opera... | java | @Override
public boolean addAll(Collection<? extends Pair<K, V>> c) {
return backedSet.addAll(c);
} | [
"@",
"Override",
"public",
"boolean",
"addAll",
"(",
"Collection",
"<",
"?",
"extends",
"Pair",
"<",
"K",
",",
"V",
">",
">",
"c",
")",
"{",
"return",
"backedSet",
".",
"addAll",
"(",
"c",
")",
";",
"}"
] | Adds all of the elements in the specified collection to this applyTransformToDestination if
they're not already present (optional operation). If the specified
collection is also a applyTransformToDestination, the <tt>addAll</tt> operation effectively
modifies this applyTransformToDestination so that its value is the <... | [
"Adds",
"all",
"of",
"the",
"elements",
"in",
"the",
"specified",
"collection",
"to",
"this",
"applyTransformToDestination",
"if",
"they",
"re",
"not",
"already",
"present",
"(",
"optional",
"operation",
")",
".",
"If",
"the",
"specified",
"collection",
"is",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/collection/MultiDimensionalSet.java#L279-L282 |
knowm/Sundial | src/main/java/org/quartz/core/RAMJobStore.java | RAMJobStore.storeTrigger | @Override
public void storeTrigger(OperableTrigger newTrigger, boolean replaceExisting)
throws JobPersistenceException {
"""
Store the given <code>{@link org.quartz.triggers.Trigger}</code>.
@param newTrigger The <code>Trigger</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>... | java | @Override
public void storeTrigger(OperableTrigger newTrigger, boolean replaceExisting)
throws JobPersistenceException {
TriggerWrapper tw = new TriggerWrapper((OperableTrigger) newTrigger.clone());
synchronized (lock) {
if (wrappedTriggersByKey.get(tw.key) != null) {
if (!replaceExistin... | [
"@",
"Override",
"public",
"void",
"storeTrigger",
"(",
"OperableTrigger",
"newTrigger",
",",
"boolean",
"replaceExisting",
")",
"throws",
"JobPersistenceException",
"{",
"TriggerWrapper",
"tw",
"=",
"new",
"TriggerWrapper",
"(",
"(",
"OperableTrigger",
")",
"newTrigg... | Store the given <code>{@link org.quartz.triggers.Trigger}</code>.
@param newTrigger The <code>Trigger</code> to be stored.
@param replaceExisting If <code>true</code>, any <code>Trigger</code> existing in the <code>
JobStore</code> with the same name & group should be over-written.
@throws ObjectAlreadyExistsException... | [
"Store",
"the",
"given",
"<code",
">",
"{",
"@link",
"org",
".",
"quartz",
".",
"triggers",
".",
"Trigger",
"}",
"<",
"/",
"code",
">",
"."
] | train | https://github.com/knowm/Sundial/blob/0d61549fdfb8d6f884a1f2eed7e32ad39e2f4c62/src/main/java/org/quartz/core/RAMJobStore.java#L205-L237 |
gallandarakhneorg/afc | core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java | XMLUtil.toColor | @Pure
public static String toColor(int red, int green, int blue, int alpha) {
"""
Replies an XML/HTML color.
@param red the red component.
@param green the green component.
@param blue the blue component.
@param alpha the alpha component.
@return the XML color encoding.
@see #parseColor(String)
"""
... | java | @Pure
public static String toColor(int red, int green, int blue, int alpha) {
return toColor(encodeRgbaColor(red, green, blue, alpha));
} | [
"@",
"Pure",
"public",
"static",
"String",
"toColor",
"(",
"int",
"red",
",",
"int",
"green",
",",
"int",
"blue",
",",
"int",
"alpha",
")",
"{",
"return",
"toColor",
"(",
"encodeRgbaColor",
"(",
"red",
",",
"green",
",",
"blue",
",",
"alpha",
")",
")... | Replies an XML/HTML color.
@param red the red component.
@param green the green component.
@param blue the blue component.
@param alpha the alpha component.
@return the XML color encoding.
@see #parseColor(String) | [
"Replies",
"an",
"XML",
"/",
"HTML",
"color",
"."
] | train | https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/core/inputoutput/src/main/java/org/arakhne/afc/inputoutput/xml/XMLUtil.java#L2239-L2242 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java | Drawable.setDpi | public static void setDpi(Resolution baseline, Config config) {
"""
Set the DPI to use. Computed automatically depending of the baseline resolution and the current configuration.
<p>
Resources has to be suffixed with "_DPI" before the extension.
For example, baseline resources is "image.png", support for other ... | java | public static void setDpi(Resolution baseline, Config config)
{
Check.notNull(baseline);
Check.notNull(config);
setDpi(DpiType.from(baseline, config.getOutput()));
} | [
"public",
"static",
"void",
"setDpi",
"(",
"Resolution",
"baseline",
",",
"Config",
"config",
")",
"{",
"Check",
".",
"notNull",
"(",
"baseline",
")",
";",
"Check",
".",
"notNull",
"(",
"config",
")",
";",
"setDpi",
"(",
"DpiType",
".",
"from",
"(",
"b... | Set the DPI to use. Computed automatically depending of the baseline resolution and the current configuration.
<p>
Resources has to be suffixed with "_DPI" before the extension.
For example, baseline resources is "image.png", support for other DPI will need:
</p>
<ul>
<li>image_ldpi.png - support for low resolution</li... | [
"Set",
"the",
"DPI",
"to",
"use",
".",
"Computed",
"automatically",
"depending",
"of",
"the",
"baseline",
"resolution",
"and",
"the",
"current",
"configuration",
".",
"<p",
">",
"Resources",
"has",
"to",
"be",
"suffixed",
"with",
"_DPI",
"before",
"the",
"ex... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java#L73-L79 |
lessthanoptimal/BoofCV | main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java | SimulatePlanarWorld.addSurface | public void addSurface(Se3_F64 rectToWorld , double widthWorld , GrayF32 texture ) {
"""
<p>Adds a surface to the simulation. The center of the surface's coordinate system will be the image
center. Width is the length along the image's width. the world length along the image height is
width*texture.height/textur... | java | public void addSurface(Se3_F64 rectToWorld , double widthWorld , GrayF32 texture ) {
SurfaceRect s = new SurfaceRect();
s.texture = texture.clone();
s.width3D = widthWorld;
s.rectToWorld = rectToWorld;
ImageMiscOps.flipHorizontal(s.texture);
scene.add(s);
} | [
"public",
"void",
"addSurface",
"(",
"Se3_F64",
"rectToWorld",
",",
"double",
"widthWorld",
",",
"GrayF32",
"texture",
")",
"{",
"SurfaceRect",
"s",
"=",
"new",
"SurfaceRect",
"(",
")",
";",
"s",
".",
"texture",
"=",
"texture",
".",
"clone",
"(",
")",
";... | <p>Adds a surface to the simulation. The center of the surface's coordinate system will be the image
center. Width is the length along the image's width. the world length along the image height is
width*texture.height/texture.width.</p>
<p>NOTE: The image is flipped horizontally internally so that when it is rendered ... | [
"<p",
">",
"Adds",
"a",
"surface",
"to",
"the",
"simulation",
".",
"The",
"center",
"of",
"the",
"surface",
"s",
"coordinate",
"system",
"will",
"be",
"the",
"image",
"center",
".",
"Width",
"is",
"the",
"length",
"along",
"the",
"image",
"s",
"width",
... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-simulation/src/main/java/boofcv/simulation/SimulatePlanarWorld.java#L156-L165 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/convert/ToggleConverter.java | ToggleConverter.setString | public int setString(String string, boolean bDisplayOption, int moveMode) {
"""
Convert and move string to this field.
Toggle the field value.
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 th... | java | public int setString(String string, boolean bDisplayOption, int moveMode)
{
boolean bNewState = !this.getNextConverter().getState();
return this.getNextConverter().setState(bNewState, bDisplayOption, moveMode); // Toggle the state
} | [
"public",
"int",
"setString",
"(",
"String",
"string",
",",
"boolean",
"bDisplayOption",
",",
"int",
"moveMode",
")",
"{",
"boolean",
"bNewState",
"=",
"!",
"this",
".",
"getNextConverter",
"(",
")",
".",
"getState",
"(",
")",
";",
"return",
"this",
".",
... | Convert and move string to this field.
Toggle the field value.
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 cod... | [
"Convert",
"and",
"move",
"string",
"to",
"this",
"field",
".",
"Toggle",
"the",
"field",
"value",
".",
"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/ToggleConverter.java#L49-L53 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/query/HiveAvroORCQueryGenerator.java | HiveAvroORCQueryGenerator.serializePublishCommands | public static void serializePublishCommands(State state, QueryBasedHivePublishEntity queryBasedHivePublishEntity) {
"""
*
Serialize a {@link QueryBasedHivePublishEntity} into a {@link State} at {@link #SERIALIZED_PUBLISH_TABLE_COMMANDS}.
@param state {@link State} to serialize entity into.
@param queryBasedHive... | java | public static void serializePublishCommands(State state, QueryBasedHivePublishEntity queryBasedHivePublishEntity) {
state.setProp(HiveAvroORCQueryGenerator.SERIALIZED_PUBLISH_TABLE_COMMANDS,
GSON.toJson(queryBasedHivePublishEntity));
} | [
"public",
"static",
"void",
"serializePublishCommands",
"(",
"State",
"state",
",",
"QueryBasedHivePublishEntity",
"queryBasedHivePublishEntity",
")",
"{",
"state",
".",
"setProp",
"(",
"HiveAvroORCQueryGenerator",
".",
"SERIALIZED_PUBLISH_TABLE_COMMANDS",
",",
"GSON",
".",... | *
Serialize a {@link QueryBasedHivePublishEntity} into a {@link State} at {@link #SERIALIZED_PUBLISH_TABLE_COMMANDS}.
@param state {@link State} to serialize entity into.
@param queryBasedHivePublishEntity to carry to publisher. | [
"*",
"Serialize",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/conversion/hive/query/HiveAvroORCQueryGenerator.java#L1058-L1061 |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsReport.java | CmsReport.dialogButtonsOkCancelDetails | public String dialogButtonsOkCancelDetails(String okAttrs, String cancelAttrs, String detailsAttrs) {
"""
Builds a button row with an "Ok", a "Cancel" and a "Details" button.<p>
This row is used when a single report is running or after the first report has finished.<p>
@param okAttrs optional attributes for ... | java | public String dialogButtonsOkCancelDetails(String okAttrs, String cancelAttrs, String detailsAttrs) {
if (CmsStringUtil.isEmptyOrWhitespaceOnly(detailsAttrs)) {
detailsAttrs = "";
} else {
detailsAttrs += " ";
}
if (Boolean.valueOf(getParamThreadHasNext()).boole... | [
"public",
"String",
"dialogButtonsOkCancelDetails",
"(",
"String",
"okAttrs",
",",
"String",
"cancelAttrs",
",",
"String",
"detailsAttrs",
")",
"{",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"detailsAttrs",
")",
")",
"{",
"detailsAttrs",
"=",
... | Builds a button row with an "Ok", a "Cancel" and a "Details" button.<p>
This row is used when a single report is running or after the first report has finished.<p>
@param okAttrs optional attributes for the ok button
@param cancelAttrs optional attributes for the cancel button
@param detailsAttrs optional attributes ... | [
"Builds",
"a",
"button",
"row",
"with",
"an",
"Ok",
"a",
"Cancel",
"and",
"a",
"Details",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsReport.java#L284-L301 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java | AbstractBeanDefinition.getBeanForMethodArgument | @Internal
@SuppressWarnings("WeakerAccess")
@UsedByGeneratedCode
protected final Object getBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
"""
Obtains a bean definition for the method at the given index and the argument at the given i... | java | @Internal
@SuppressWarnings("WeakerAccess")
@UsedByGeneratedCode
protected final Object getBeanForMethodArgument(BeanResolutionContext resolutionContext, BeanContext context, int methodIndex, int argIndex) {
MethodInjectionPoint injectionPoint = methodInjectionPoints.get(methodIndex);
Argume... | [
"@",
"Internal",
"@",
"SuppressWarnings",
"(",
"\"WeakerAccess\"",
")",
"@",
"UsedByGeneratedCode",
"protected",
"final",
"Object",
"getBeanForMethodArgument",
"(",
"BeanResolutionContext",
"resolutionContext",
",",
"BeanContext",
"context",
",",
"int",
"methodIndex",
","... | Obtains a bean definition for the method at the given index and the argument at the given index
<p>
Warning: this method is used by internal generated code and should not be called by user code.
@param resolutionContext The resolution context
@param context The context
@param methodIndex The method ind... | [
"Obtains",
"a",
"bean",
"definition",
"for",
"the",
"method",
"at",
"the",
"given",
"index",
"and",
"the",
"argument",
"at",
"the",
"given",
"index",
"<p",
">",
"Warning",
":",
"this",
"method",
"is",
"used",
"by",
"internal",
"generated",
"code",
"and",
... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/AbstractBeanDefinition.java#L839-L850 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/AttachmentManager.java | AttachmentManager.uploadAttachment | public Attachment uploadAttachment(String fileName, String contentType,
byte[] content) throws RedmineException, IOException {
"""
Uploads an attachment.
@param fileName
file name of the attachment.
@param contentType
content type of the attachment.
@param content
att... | java | public Attachment uploadAttachment(String fileName, String contentType,
byte[] content) throws RedmineException, IOException {
final InputStream is = new ByteArrayInputStream(content);
try {
return uploadAttachment(fileName, contentType, is, content.len... | [
"public",
"Attachment",
"uploadAttachment",
"(",
"String",
"fileName",
",",
"String",
"contentType",
",",
"byte",
"[",
"]",
"content",
")",
"throws",
"RedmineException",
",",
"IOException",
"{",
"final",
"InputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"("... | Uploads an attachment.
@param fileName
file name of the attachment.
@param contentType
content type of the attachment.
@param content
attachment content stream.
@return attachment content.
@throws RedmineException
if something goes wrong.
@throws java.io.IOException
if input cannot be read. | [
"Uploads",
"an",
"attachment",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/AttachmentManager.java#L75-L87 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java | MongoDBClient.handleUpdateFunctions | public int handleUpdateFunctions(BasicDBObject query, BasicDBObject update, String collName) {
"""
Handle update functions.
@param query
the query
@param update
the update
@param collName
the coll name
@return the int
"""
DBCollection collection = mongoDb.getCollection(collName);
Kunde... | java | public int handleUpdateFunctions(BasicDBObject query, BasicDBObject update, String collName)
{
DBCollection collection = mongoDb.getCollection(collName);
KunderaCoreUtils.printQuery("Update collection:" + query, showQuery);
WriteResult result = null;
try
{
result ... | [
"public",
"int",
"handleUpdateFunctions",
"(",
"BasicDBObject",
"query",
",",
"BasicDBObject",
"update",
",",
"String",
"collName",
")",
"{",
"DBCollection",
"collection",
"=",
"mongoDb",
".",
"getCollection",
"(",
"collName",
")",
";",
"KunderaCoreUtils",
".",
"p... | Handle update functions.
@param query
the query
@param update
the update
@param collName
the coll name
@return the int | [
"Handle",
"update",
"functions",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/MongoDBClient.java#L1932-L1948 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java | DevicesInner.uploadCertificate | public UploadCertificateResponseInner uploadCertificate(String deviceName, String resourceGroupName, UploadCertificateRequest parameters) {
"""
Uploads registration certificate for the device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param parameters The upload cer... | java | public UploadCertificateResponseInner uploadCertificate(String deviceName, String resourceGroupName, UploadCertificateRequest parameters) {
return uploadCertificateWithServiceResponseAsync(deviceName, resourceGroupName, parameters).toBlocking().single().body();
} | [
"public",
"UploadCertificateResponseInner",
"uploadCertificate",
"(",
"String",
"deviceName",
",",
"String",
"resourceGroupName",
",",
"UploadCertificateRequest",
"parameters",
")",
"{",
"return",
"uploadCertificateWithServiceResponseAsync",
"(",
"deviceName",
",",
"resourceGro... | Uploads registration certificate for the device.
@param deviceName The device name.
@param resourceGroupName The resource group name.
@param parameters The upload certificate request.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudException thrown if the request is rejected by s... | [
"Uploads",
"registration",
"certificate",
"for",
"the",
"device",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/DevicesInner.java#L2098-L2100 |
Azure/azure-sdk-for-java | streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamingJobsInner.java | StreamingJobsInner.beginCreateOrReplace | public StreamingJobInner beginCreateOrReplace(String resourceGroupName, String jobName, StreamingJobInner streamingJob) {
"""
Creates a streaming job or replaces an already existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from ... | java | public StreamingJobInner beginCreateOrReplace(String resourceGroupName, String jobName, StreamingJobInner streamingJob) {
return beginCreateOrReplaceWithServiceResponseAsync(resourceGroupName, jobName, streamingJob).toBlocking().single().body();
} | [
"public",
"StreamingJobInner",
"beginCreateOrReplace",
"(",
"String",
"resourceGroupName",
",",
"String",
"jobName",
",",
"StreamingJobInner",
"streamingJob",
")",
"{",
"return",
"beginCreateOrReplaceWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"jobName",
",",
... | Creates a streaming job or replaces an already existing streaming job.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param jobName The name of the streaming job.
@param streamingJob The definition of the... | [
"Creates",
"a",
"streaming",
"job",
"or",
"replaces",
"an",
"already",
"existing",
"streaming",
"job",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/streamanalytics/resource-manager/v2016_03_01/src/main/java/com/microsoft/azure/management/streamanalytics/v2016_03_01/implementation/StreamingJobsInner.java#L306-L308 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/ReferenceEntityLockService.java | ReferenceEntityLockService.renew | @Override
public void renew(IEntityLock lock, int duration) throws LockingException {
"""
Extends the expiration time of the lock by some service-defined increment.
@param lock IEntityLock
@exception LockingException
"""
if (isValid(lock)) {
Date newExpiration = getNewExpiration(dur... | java | @Override
public void renew(IEntityLock lock, int duration) throws LockingException {
if (isValid(lock)) {
Date newExpiration = getNewExpiration(duration);
getLockStore().update(lock, newExpiration);
((EntityLockImpl) lock).setExpirationTime(newExpiration);
} else... | [
"@",
"Override",
"public",
"void",
"renew",
"(",
"IEntityLock",
"lock",
",",
"int",
"duration",
")",
"throws",
"LockingException",
"{",
"if",
"(",
"isValid",
"(",
"lock",
")",
")",
"{",
"Date",
"newExpiration",
"=",
"getNewExpiration",
"(",
"duration",
")",
... | Extends the expiration time of the lock by some service-defined increment.
@param lock IEntityLock
@exception LockingException | [
"Extends",
"the",
"expiration",
"time",
"of",
"the",
"lock",
"by",
"some",
"service",
"-",
"defined",
"increment",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/concurrency/locking/ReferenceEntityLockService.java#L370-L379 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.handleMessage | protected <T, A> void handleMessage(final Channel channel, final DataInput message, final ManagementRequestHeader header, ManagementRequestHandler<T, A> handler) throws IOException {
"""
Handle a message.
@param channel the channel
@param message the message
@param header the protocol header
@param handler t... | java | protected <T, A> void handleMessage(final Channel channel, final DataInput message, final ManagementRequestHeader header, ManagementRequestHandler<T, A> handler) throws IOException {
final ActiveOperation<T, A> support = getActiveOperation(header);
if(support == null) {
throw ProtocolLogger.... | [
"protected",
"<",
"T",
",",
"A",
">",
"void",
"handleMessage",
"(",
"final",
"Channel",
"channel",
",",
"final",
"DataInput",
"message",
",",
"final",
"ManagementRequestHeader",
"header",
",",
"ManagementRequestHandler",
"<",
"T",
",",
"A",
">",
"handler",
")"... | Handle a message.
@param channel the channel
@param message the message
@param header the protocol header
@param handler the request handler
@throws IOException | [
"Handle",
"a",
"message",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L298-L304 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java | CacheEventDispatcherImpl.removeWrapperFromList | private synchronized boolean removeWrapperFromList(EventListenerWrapper<K, V> wrapper, List<EventListenerWrapper<K, V>> listenersList) {
"""
Synchronized to make sure listener removal is atomic
@param wrapper the listener wrapper to unregister
@param listenersList the listener list to remove from
"""
i... | java | private synchronized boolean removeWrapperFromList(EventListenerWrapper<K, V> wrapper, List<EventListenerWrapper<K, V>> listenersList) {
int index = listenersList.indexOf(wrapper);
if (index != -1) {
EventListenerWrapper<K, V> containedWrapper = listenersList.remove(index);
if(containedWrapper.isOrd... | [
"private",
"synchronized",
"boolean",
"removeWrapperFromList",
"(",
"EventListenerWrapper",
"<",
"K",
",",
"V",
">",
"wrapper",
",",
"List",
"<",
"EventListenerWrapper",
"<",
"K",
",",
"V",
">",
">",
"listenersList",
")",
"{",
"int",
"index",
"=",
"listenersLi... | Synchronized to make sure listener removal is atomic
@param wrapper the listener wrapper to unregister
@param listenersList the listener list to remove from | [
"Synchronized",
"to",
"make",
"sure",
"listener",
"removal",
"is",
"atomic"
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/events/CacheEventDispatcherImpl.java#L141-L154 |
VoltDB/voltdb | src/frontend/org/voltdb/largequery/LargeBlockTask.java | LargeBlockTask.getStoreTask | public static LargeBlockTask getStoreTask(BlockId blockId, ByteBuffer block) {
"""
Get a new "store" task
@param blockId The block id of the block to store
@param block A ByteBuffer containing the block data
@return An instance of LargeBlockTask that will store a block
"""
return new LargeBlo... | java | public static LargeBlockTask getStoreTask(BlockId blockId, ByteBuffer block) {
return new LargeBlockTask() {
@Override
public LargeBlockResponse call() throws Exception {
Exception theException = null;
try {
LargeBlockManager.getInstanc... | [
"public",
"static",
"LargeBlockTask",
"getStoreTask",
"(",
"BlockId",
"blockId",
",",
"ByteBuffer",
"block",
")",
"{",
"return",
"new",
"LargeBlockTask",
"(",
")",
"{",
"@",
"Override",
"public",
"LargeBlockResponse",
"call",
"(",
")",
"throws",
"Exception",
"{"... | Get a new "store" task
@param blockId The block id of the block to store
@param block A ByteBuffer containing the block data
@return An instance of LargeBlockTask that will store a block | [
"Get",
"a",
"new",
"store",
"task"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/largequery/LargeBlockTask.java#L38-L53 |
sarxos/webcam-capture | webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java | Webcam.getDefault | public static Webcam getDefault(long timeout, TimeUnit tunit) throws TimeoutException, WebcamException {
"""
Will discover and return first webcam available in the system.
@param timeout the webcam discovery timeout (1 minute by default)
@param tunit the time unit
@return Default webcam (first from the list)
... | java | public static Webcam getDefault(long timeout, TimeUnit tunit) throws TimeoutException, WebcamException {
if (timeout < 0) {
throw new IllegalArgumentException(String.format("Timeout cannot be negative (%d)", timeout));
}
if (tunit == null) {
throw new IllegalArgumentException("Time unit cannot be nul... | [
"public",
"static",
"Webcam",
"getDefault",
"(",
"long",
"timeout",
",",
"TimeUnit",
"tunit",
")",
"throws",
"TimeoutException",
",",
"WebcamException",
"{",
"if",
"(",
"timeout",
"<",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
"... | Will discover and return first webcam available in the system.
@param timeout the webcam discovery timeout (1 minute by default)
@param tunit the time unit
@return Default webcam (first from the list)
@throws TimeoutException when discovery timeout has been exceeded
@throws WebcamException if something is really wrong... | [
"Will",
"discover",
"and",
"return",
"first",
"webcam",
"available",
"in",
"the",
"system",
"."
] | train | https://github.com/sarxos/webcam-capture/blob/efbdae04f9ba48db9ec621e94a9bcd6f031882c8/webcam-capture/src/main/java/com/github/sarxos/webcam/Webcam.java#L947-L967 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java | ApiOvhDbaaslogs.serviceName_output_graylog_dashboard_POST | public OvhOperation serviceName_output_graylog_dashboard_POST(String serviceName, Boolean autoSelectOption, String description, String optionId, String title) throws IOException {
"""
Register a new graylog dashboard
REST: POST /dbaas/logs/{serviceName}/output/graylog/dashboard
@param serviceName [required] Se... | java | public OvhOperation serviceName_output_graylog_dashboard_POST(String serviceName, Boolean autoSelectOption, String description, String optionId, String title) throws IOException {
String qPath = "/dbaas/logs/{serviceName}/output/graylog/dashboard";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Obje... | [
"public",
"OvhOperation",
"serviceName_output_graylog_dashboard_POST",
"(",
"String",
"serviceName",
",",
"Boolean",
"autoSelectOption",
",",
"String",
"description",
",",
"String",
"optionId",
",",
"String",
"title",
")",
"throws",
"IOException",
"{",
"String",
"qPath"... | Register a new graylog dashboard
REST: POST /dbaas/logs/{serviceName}/output/graylog/dashboard
@param serviceName [required] Service name
@param optionId [required] Option ID
@param title [required] Title
@param description [required] Description
@param autoSelectOption [required] If set, automatically selects a compa... | [
"Register",
"a",
"new",
"graylog",
"dashboard"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dbaaslogs/src/main/java/net/minidev/ovh/api/ApiOvhDbaaslogs.java#L1116-L1126 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/CmsTabbedPanel.java | CmsTabbedPanel.addNamed | public void addNamed(E tabContent, String tabName, String tabId) {
"""
Adds a tab with a user-defined id.<p>
@param tabContent the tab content
@param tabName the tab name
@param tabId the tab id
"""
add(tabContent, tabName);
m_tabsById.put(tabId, tabContent);
} | java | public void addNamed(E tabContent, String tabName, String tabId) {
add(tabContent, tabName);
m_tabsById.put(tabId, tabContent);
} | [
"public",
"void",
"addNamed",
"(",
"E",
"tabContent",
",",
"String",
"tabName",
",",
"String",
"tabId",
")",
"{",
"add",
"(",
"tabContent",
",",
"tabName",
")",
";",
"m_tabsById",
".",
"put",
"(",
"tabId",
",",
"tabContent",
")",
";",
"}"
] | Adds a tab with a user-defined id.<p>
@param tabContent the tab content
@param tabName the tab name
@param tabId the tab id | [
"Adds",
"a",
"tab",
"with",
"a",
"user",
"-",
"defined",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/CmsTabbedPanel.java#L327-L331 |
BBN-E/bue-common-open | common-core-open/src/main/java/com/bbn/bue/common/primitives/DoubleUtils.java | DoubleUtils.shiftTowardsZeroWithClippingRecklessly | public static double shiftTowardsZeroWithClippingRecklessly(double val, double shift) {
"""
Shifts the provided {@code val} towards but not past zero. If the absolute value of {@code
val} is less than or equal to shift, zero will be returned. Otherwise, negative {@code val}s
will have {@code shift} added and po... | java | public static double shiftTowardsZeroWithClippingRecklessly(double val, double shift) {
if (val > shift) {
return val - shift;
} else if (val < -shift) {
return val + shift;
} else {
return 0.0;
}
} | [
"public",
"static",
"double",
"shiftTowardsZeroWithClippingRecklessly",
"(",
"double",
"val",
",",
"double",
"shift",
")",
"{",
"if",
"(",
"val",
">",
"shift",
")",
"{",
"return",
"val",
"-",
"shift",
";",
"}",
"else",
"if",
"(",
"val",
"<",
"-",
"shift"... | Shifts the provided {@code val} towards but not past zero. If the absolute value of {@code
val} is less than or equal to shift, zero will be returned. Otherwise, negative {@code val}s
will have {@code shift} added and positive vals will have {@code shift} subtracted.
If {@code shift} is negative, the result is undefi... | [
"Shifts",
"the",
"provided",
"{",
"@code",
"val",
"}",
"towards",
"but",
"not",
"past",
"zero",
".",
"If",
"the",
"absolute",
"value",
"of",
"{",
"@code",
"val",
"}",
"is",
"less",
"than",
"or",
"equal",
"to",
"shift",
"zero",
"will",
"be",
"returned",... | train | https://github.com/BBN-E/bue-common-open/blob/d618652674d647867306e2e4b987a21b7c29c015/common-core-open/src/main/java/com/bbn/bue/common/primitives/DoubleUtils.java#L268-L276 |
navnorth/LRJavaLib | src/com/navnorth/learningregistry/LRActivity.java | LRActivity.addRelatedObject | public boolean addRelatedObject(String objectType, String id, String content) {
"""
Add a related object to this activity
@param objectType The type of the object (required)
@param id Id of the ojbect
@param content String describing the content of the object
@return True if added, false if not (due to missi... | java | public boolean addRelatedObject(String objectType, String id, String content)
{
Map<String, Object> container = new HashMap<String, Object>();
if (objectType != null)
{
container.put("objectType", objectType);
}
else
{
return false;
... | [
"public",
"boolean",
"addRelatedObject",
"(",
"String",
"objectType",
",",
"String",
"id",
",",
"String",
"content",
")",
"{",
"Map",
"<",
"String",
",",
"Object",
">",
"container",
"=",
"new",
"HashMap",
"<",
"String",
",",
"Object",
">",
"(",
")",
";",... | Add a related object to this activity
@param objectType The type of the object (required)
@param id Id of the ojbect
@param content String describing the content of the object
@return True if added, false if not (due to missing required fields) | [
"Add",
"a",
"related",
"object",
"to",
"this",
"activity"
] | train | https://github.com/navnorth/LRJavaLib/blob/27af28b9f80d772273592414e7d0dccffaac09e1/src/com/navnorth/learningregistry/LRActivity.java#L403-L426 |
korpling/ANNIS | annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java | RSTImpl.setSentenceSpan | private void setSentenceSpan(JSONObject cNode, JSONObject parent) {
"""
Sets the sentence_left and sentence_right properties of the data object of
parent to the min/max of the currNode.
"""
try {
JSONObject data = cNode.getJSONObject("data");
int leftPosC = data.getInt(SENTENCE_LEFT);
i... | java | private void setSentenceSpan(JSONObject cNode, JSONObject parent) {
try {
JSONObject data = cNode.getJSONObject("data");
int leftPosC = data.getInt(SENTENCE_LEFT);
int rightPosC = data.getInt(SENTENCE_RIGHT);
data = parent.getJSONObject("data");
if (data.has(SENTENCE_LEFT)) {
... | [
"private",
"void",
"setSentenceSpan",
"(",
"JSONObject",
"cNode",
",",
"JSONObject",
"parent",
")",
"{",
"try",
"{",
"JSONObject",
"data",
"=",
"cNode",
".",
"getJSONObject",
"(",
"\"data\"",
")",
";",
"int",
"leftPosC",
"=",
"data",
".",
"getInt",
"(",
"S... | Sets the sentence_left and sentence_right properties of the data object of
parent to the min/max of the currNode. | [
"Sets",
"the",
"sentence_left",
"and",
"sentence_right",
"properties",
"of",
"the",
"data",
"object",
"of",
"parent",
"to",
"the",
"min",
"/",
"max",
"of",
"the",
"currNode",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-visualizers/src/main/java/annis/visualizers/component/rst/RSTImpl.java#L642-L666 |
openwms/org.openwms | org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java | AbstractWebController.translate | protected String translate(String key, Object... objects) {
"""
Get the messageSource.
@param key The error code to search message text for
@param objects Any arguments that are passed into the message text
@return the messageSource.
"""
return messageSource.getMessage(key, objects, null);
} | java | protected String translate(String key, Object... objects) {
return messageSource.getMessage(key, objects, null);
} | [
"protected",
"String",
"translate",
"(",
"String",
"key",
",",
"Object",
"...",
"objects",
")",
"{",
"return",
"messageSource",
".",
"getMessage",
"(",
"key",
",",
"objects",
",",
"null",
")",
";",
"}"
] | Get the messageSource.
@param key The error code to search message text for
@param objects Any arguments that are passed into the message text
@return the messageSource. | [
"Get",
"the",
"messageSource",
"."
] | train | https://github.com/openwms/org.openwms/blob/b24a95c5d09a7ec3c723d7e107d1cb0039d06a7e/org.openwms.core.util/src/main/java/org/openwms/core/http/AbstractWebController.java#L131-L133 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/raster/RasterImage.java | RasterImage.loadRasters | public void loadRasters(int imageHeight, boolean save, String prefix) {
"""
Load rasters.
@param imageHeight The local image height.
@param save <code>true</code> to save generated (if) rasters, <code>false</code> else.
@param prefix The folder prefix, if save is <code>true</code> (must not be <code>null</cod... | java | public void loadRasters(int imageHeight, boolean save, String prefix)
{
Check.notNull(prefix);
final Raster raster = Raster.load(rasterFile);
final int max = UtilConversion.boolToInt(rasterSmooth) + 1;
for (int m = 0; m < max; m++)
{
for (int i = 0; i <... | [
"public",
"void",
"loadRasters",
"(",
"int",
"imageHeight",
",",
"boolean",
"save",
",",
"String",
"prefix",
")",
"{",
"Check",
".",
"notNull",
"(",
"prefix",
")",
";",
"final",
"Raster",
"raster",
"=",
"Raster",
".",
"load",
"(",
"rasterFile",
")",
";",... | Load rasters.
@param imageHeight The local image height.
@param save <code>true</code> to save generated (if) rasters, <code>false</code> else.
@param prefix The folder prefix, if save is <code>true</code> (must not be <code>null</code>).
@throws LionEngineException If the raster data from the media are invalid. | [
"Load",
"rasters",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/raster/RasterImage.java#L138-L157 |
SonarSource/sonarqube | sonar-plugin-api/src/main/java/org/sonar/api/issue/NoSonarFilter.java | NoSonarFilter.noSonarInFile | public NoSonarFilter noSonarInFile(InputFile inputFile, Set<Integer> noSonarLines) {
"""
Register lines in a file that contains the NOSONAR flag.
@param inputFile
@param noSonarLines Line number starts at 1 in a file
@since 5.0
@since 7.6 the method can be called multiple times by different sensors, and NOSO... | java | public NoSonarFilter noSonarInFile(InputFile inputFile, Set<Integer> noSonarLines) {
((DefaultInputFile) inputFile).noSonarAt(noSonarLines);
return this;
} | [
"public",
"NoSonarFilter",
"noSonarInFile",
"(",
"InputFile",
"inputFile",
",",
"Set",
"<",
"Integer",
">",
"noSonarLines",
")",
"{",
"(",
"(",
"DefaultInputFile",
")",
"inputFile",
")",
".",
"noSonarAt",
"(",
"noSonarLines",
")",
";",
"return",
"this",
";",
... | Register lines in a file that contains the NOSONAR flag.
@param inputFile
@param noSonarLines Line number starts at 1 in a file
@since 5.0
@since 7.6 the method can be called multiple times by different sensors, and NOSONAR lines are merged | [
"Register",
"lines",
"in",
"a",
"file",
"that",
"contains",
"the",
"NOSONAR",
"flag",
"."
] | train | https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-plugin-api/src/main/java/org/sonar/api/issue/NoSonarFilter.java#L47-L50 |
ModeShape/modeshape | modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java | JcrSystemViewExporter.emitProperty | private void emitProperty( Name propertyName,
int propertyType,
Object value,
ContentHandler contentHandler,
boolean skipBinary ) throws RepositoryException, SAXException {
"""
Fires the appr... | java | private void emitProperty( Name propertyName,
int propertyType,
Object value,
ContentHandler contentHandler,
boolean skipBinary ) throws RepositoryException, SAXException {
ValueFactory<St... | [
"private",
"void",
"emitProperty",
"(",
"Name",
"propertyName",
",",
"int",
"propertyType",
",",
"Object",
"value",
",",
"ContentHandler",
"contentHandler",
",",
"boolean",
"skipBinary",
")",
"throws",
"RepositoryException",
",",
"SAXException",
"{",
"ValueFactory",
... | Fires the appropriate SAX events on the content handler to build the XML elements for the property.
@param propertyName the name of the property to be exported
@param propertyType the type of the property to be exported
@param value the value of the single-valued property to be exported
@param contentHandler the SAX c... | [
"Fires",
"the",
"appropriate",
"SAX",
"events",
"on",
"the",
"content",
"handler",
"to",
"build",
"the",
"XML",
"elements",
"for",
"the",
"property",
"."
] | train | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/JcrSystemViewExporter.java#L352-L382 |
jfinal/jfinal | src/main/java/com/jfinal/validate/Validator.java | Validator.validateEqualField | protected void validateEqualField(String field_1, String field_2, String errorKey, String errorMessage) {
"""
Validate equal field. Usually validate password and password again
"""
String value_1 = controller.getPara(field_1);
String value_2 = controller.getPara(field_2);
if (value_1 == null || value_... | java | protected void validateEqualField(String field_1, String field_2, String errorKey, String errorMessage) {
String value_1 = controller.getPara(field_1);
String value_2 = controller.getPara(field_2);
if (value_1 == null || value_2 == null || (! value_1.equals(value_2))) {
addError(errorKey, errorMessage);
... | [
"protected",
"void",
"validateEqualField",
"(",
"String",
"field_1",
",",
"String",
"field_2",
",",
"String",
"errorKey",
",",
"String",
"errorMessage",
")",
"{",
"String",
"value_1",
"=",
"controller",
".",
"getPara",
"(",
"field_1",
")",
";",
"String",
"valu... | Validate equal field. Usually validate password and password again | [
"Validate",
"equal",
"field",
".",
"Usually",
"validate",
"password",
"and",
"password",
"again"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/validate/Validator.java#L419-L425 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Checker.java | Checker.isButtonChecked | public <T extends CompoundButton> boolean isButtonChecked(Class<T> expectedClass, String text) {
"""
Checks if a {@link CompoundButton} with a given text is checked.
@param expectedClass the expected class, e.g. {@code CheckBox.class} or {@code RadioButton.class}
@param text the text that is expected to be che... | java | public <T extends CompoundButton> boolean isButtonChecked(Class<T> expectedClass, String text)
{
T button = waiter.waitForText(expectedClass, text, 0, Timeout.getSmallTimeout(), true);
if(button != null && button.isChecked()){
return true;
}
return false;
} | [
"public",
"<",
"T",
"extends",
"CompoundButton",
">",
"boolean",
"isButtonChecked",
"(",
"Class",
"<",
"T",
">",
"expectedClass",
",",
"String",
"text",
")",
"{",
"T",
"button",
"=",
"waiter",
".",
"waitForText",
"(",
"expectedClass",
",",
"text",
",",
"0"... | Checks if a {@link CompoundButton} with a given text is checked.
@param expectedClass the expected class, e.g. {@code CheckBox.class} or {@code RadioButton.class}
@param text the text that is expected to be checked
@return {@code true} if {@code CompoundButton} is checked and {@code false} if it is not checked | [
"Checks",
"if",
"a",
"{",
"@link",
"CompoundButton",
"}",
"with",
"a",
"given",
"text",
"is",
"checked",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Checker.java#L57-L65 |
google/closure-compiler | src/com/google/javascript/jscomp/AmbiguateProperties.java | AmbiguateProperties.addRelatedInstance | private void addRelatedInstance(FunctionType constructor, JSTypeBitSet related) {
"""
Adds the instance of the given constructor, its implicit prototype and all
its related types to the given bit set.
"""
checkArgument(constructor.hasInstanceType(),
"Constructor %s without instance type.", constru... | java | private void addRelatedInstance(FunctionType constructor, JSTypeBitSet related) {
checkArgument(constructor.hasInstanceType(),
"Constructor %s without instance type.", constructor);
ObjectType instanceType = constructor.getInstanceType();
addRelatedType(instanceType, related);
} | [
"private",
"void",
"addRelatedInstance",
"(",
"FunctionType",
"constructor",
",",
"JSTypeBitSet",
"related",
")",
"{",
"checkArgument",
"(",
"constructor",
".",
"hasInstanceType",
"(",
")",
",",
"\"Constructor %s without instance type.\"",
",",
"constructor",
")",
";",
... | Adds the instance of the given constructor, its implicit prototype and all
its related types to the given bit set. | [
"Adds",
"the",
"instance",
"of",
"the",
"given",
"constructor",
"its",
"implicit",
"prototype",
"and",
"all",
"its",
"related",
"types",
"to",
"the",
"given",
"bit",
"set",
"."
] | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/AmbiguateProperties.java#L334-L339 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java | AppServiceEnvironmentsInner.listWebWorkerUsagesWithServiceResponseAsync | public Observable<ServiceResponse<Page<UsageInner>>> listWebWorkerUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) {
"""
Get usage metrics for a worker pool of an App Service Environment.
Get usage metrics for a worker pool of an App Service Environmen... | java | public Observable<ServiceResponse<Page<UsageInner>>> listWebWorkerUsagesWithServiceResponseAsync(final String resourceGroupName, final String name, final String workerPoolName) {
return listWebWorkerUsagesSinglePageAsync(resourceGroupName, name, workerPoolName)
.concatMap(new Func1<ServiceResponse<P... | [
"public",
"Observable",
"<",
"ServiceResponse",
"<",
"Page",
"<",
"UsageInner",
">",
">",
">",
"listWebWorkerUsagesWithServiceResponseAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"name",
",",
"final",
"String",
"workerPoolName",
")",
... | Get usage metrics for a worker pool of an App Service Environment.
Get usage metrics for a worker pool of an App Service Environment.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param name Name of the App Service Environment.
@param workerPoolName Name of the worker pool.
@throw... | [
"Get",
"usage",
"metrics",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
".",
"Get",
"usage",
"metrics",
"for",
"a",
"worker",
"pool",
"of",
"an",
"App",
"Service",
"Environment",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/appservice/v2016_09_01/implementation/AppServiceEnvironmentsInner.java#L6544-L6556 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java | CalendarParserImpl.assertToken | private int assertToken(final StreamTokenizer tokeniser, Reader in, final String token)
throws IOException, ParserException {
"""
Asserts that the next token in the stream matches the specified token. This method is case-sensitive.
@param tokeniser
@param token
@return int value of the ttype field... | java | private int assertToken(final StreamTokenizer tokeniser, Reader in, final String token)
throws IOException, ParserException {
return assertToken(tokeniser, in, token, false, false);
} | [
"private",
"int",
"assertToken",
"(",
"final",
"StreamTokenizer",
"tokeniser",
",",
"Reader",
"in",
",",
"final",
"String",
"token",
")",
"throws",
"IOException",
",",
"ParserException",
"{",
"return",
"assertToken",
"(",
"tokeniser",
",",
"in",
",",
"token",
... | Asserts that the next token in the stream matches the specified token. This method is case-sensitive.
@param tokeniser
@param token
@return int value of the ttype field of the tokeniser
@throws IOException
@throws ParserException | [
"Asserts",
"that",
"the",
"next",
"token",
"in",
"the",
"stream",
"matches",
"the",
"specified",
"token",
".",
"This",
"method",
"is",
"case",
"-",
"sensitive",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/data/CalendarParserImpl.java#L485-L488 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsCore.java | OpenCmsCore.initCmsContextForUI | protected void initCmsContextForUI(HttpServletRequest req, HttpServletResponse res, CmsUIServlet servlet)
throws IOException, CmsException {
"""
Initializes the OpenCms context for Vaadin UI servlet.<p>
@param req the request
@param res the response
@param servlet the UI servlet
@throws IOException if ... | java | protected void initCmsContextForUI(HttpServletRequest req, HttpServletResponse res, CmsUIServlet servlet)
throws IOException, CmsException {
// instantiate CMS context
String originalEncoding = req.getCharacterEncoding();
String referrer = req.getHeader("referer");
boolean allowPriv... | [
"protected",
"void",
"initCmsContextForUI",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
",",
"CmsUIServlet",
"servlet",
")",
"throws",
"IOException",
",",
"CmsException",
"{",
"// instantiate CMS context",
"String",
"originalEncoding",
"=",
"req",... | Initializes the OpenCms context for Vaadin UI servlet.<p>
@param req the request
@param res the response
@param servlet the UI servlet
@throws IOException if user authentication fails
@throws CmsException if something goes wrong | [
"Initializes",
"the",
"OpenCms",
"context",
"for",
"Vaadin",
"UI",
"servlet",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsCore.java#L981-L995 |
alkacon/opencms-core | src/org/opencms/staticexport/CmsLinkManager.java | CmsLinkManager.getPermalinkForCurrentPage | public String getPermalinkForCurrentPage(CmsObject cms) {
"""
Returns the perma link for the current page based on the URI and detail content id stored in the CmsObject passed as a parameter.<p<
@param cms the CMS context to use to generate the permalink
@return the permalink
"""
return getPerma... | java | public String getPermalinkForCurrentPage(CmsObject cms) {
return getPermalink(cms, cms.getRequestContext().getUri(), cms.getRequestContext().getDetailContentId());
} | [
"public",
"String",
"getPermalinkForCurrentPage",
"(",
"CmsObject",
"cms",
")",
"{",
"return",
"getPermalink",
"(",
"cms",
",",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getUri",
"(",
")",
",",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getDetai... | Returns the perma link for the current page based on the URI and detail content id stored in the CmsObject passed as a parameter.<p<
@param cms the CMS context to use to generate the permalink
@return the permalink | [
"Returns",
"the",
"perma",
"link",
"for",
"the",
"current",
"page",
"based",
"on",
"the",
"URI",
"and",
"detail",
"content",
"id",
"stored",
"in",
"the",
"CmsObject",
"passed",
"as",
"a",
"parameter",
".",
"<p<"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/staticexport/CmsLinkManager.java#L470-L473 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/preprocessing/MinMaxScaler.java | MinMaxScaler.scale | private Double scale(Double value, Double min, Double max) {
"""
Performs the actual rescaling handling corner cases.
@param value
@param min
@param max
@return
"""
if(min.equals(max)) {
if(value>max) {
return 1.0;
}
else if(value==max && value!... | java | private Double scale(Double value, Double min, Double max) {
if(min.equals(max)) {
if(value>max) {
return 1.0;
}
else if(value==max && value!=0.0) {
return 1.0;
}
else {
return 0.0;
}
... | [
"private",
"Double",
"scale",
"(",
"Double",
"value",
",",
"Double",
"min",
",",
"Double",
"max",
")",
"{",
"if",
"(",
"min",
".",
"equals",
"(",
"max",
")",
")",
"{",
"if",
"(",
"value",
">",
"max",
")",
"{",
"return",
"1.0",
";",
"}",
"else",
... | Performs the actual rescaling handling corner cases.
@param value
@param min
@param max
@return | [
"Performs",
"the",
"actual",
"rescaling",
"handling",
"corner",
"cases",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/machinelearning/preprocessing/MinMaxScaler.java#L208-L223 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java | BaseMessagingEngineImpl.addLocalizationPoint | final boolean addLocalizationPoint(LWMConfig lp, DestinationDefinition dd) {
"""
Pass the request to add a new localization point onto the localizer object.
@param lp localization point definition
@return boolean success Whether the LP was successfully added
"""
String thisMethodName = "addLocaliz... | java | final boolean addLocalizationPoint(LWMConfig lp, DestinationDefinition dd) {
String thisMethodName = "addLocalizationPoint";
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
SibTr.entry(tc, thisMethodName, lp);
}
boolean success = _localizer.addLocalizati... | [
"final",
"boolean",
"addLocalizationPoint",
"(",
"LWMConfig",
"lp",
",",
"DestinationDefinition",
"dd",
")",
"{",
"String",
"thisMethodName",
"=",
"\"addLocalizationPoint\"",
";",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
... | Pass the request to add a new localization point onto the localizer object.
@param lp localization point definition
@return boolean success Whether the LP was successfully added | [
"Pass",
"the",
"request",
"to",
"add",
"a",
"new",
"localization",
"point",
"onto",
"the",
"localizer",
"object",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/admin/internal/BaseMessagingEngineImpl.java#L1473-L1487 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/CustomerNoteUrl.java | CustomerNoteUrl.updateAccountNoteUrl | public static MozuUrl updateAccountNoteUrl(Integer accountId, Integer noteId, String responseFields) {
"""
Get Resource Url for UpdateAccountNote
@param accountId Unique identifier of the customer account.
@param noteId Unique identifier of a particular note to retrieve.
@param responseFields Filtering syntax a... | java | public static MozuUrl updateAccountNoteUrl(Integer accountId, Integer noteId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/customer/accounts/{accountId}/notes/{noteId}?responseFields={responseFields}");
formatter.formatUrl("accountId", accountId);
formatter.formatUrl("not... | [
"public",
"static",
"MozuUrl",
"updateAccountNoteUrl",
"(",
"Integer",
"accountId",
",",
"Integer",
"noteId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/customer/accounts/{accountId}/notes/{noteI... | Get Resource Url for UpdateAccountNote
@param accountId Unique identifier of the customer account.
@param noteId Unique identifier of a particular note to retrieve.
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter sho... | [
"Get",
"Resource",
"Url",
"for",
"UpdateAccountNote"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/customer/accounts/CustomerNoteUrl.java#L75-L82 |
threerings/narya | tools/src/main/java/com/threerings/presents/tools/GenUtil.java | GenUtil.boxASArgument | public static String boxASArgument (Class<?> clazz, String name) {
"""
"Boxes" the supplied argument, ie. turning an <code>int</code> into an <code>Integer</code>
object.
"""
return boxASArgumentAndGatherImports(clazz, name, new ImportSet());
} | java | public static String boxASArgument (Class<?> clazz, String name)
{
return boxASArgumentAndGatherImports(clazz, name, new ImportSet());
} | [
"public",
"static",
"String",
"boxASArgument",
"(",
"Class",
"<",
"?",
">",
"clazz",
",",
"String",
"name",
")",
"{",
"return",
"boxASArgumentAndGatherImports",
"(",
"clazz",
",",
"name",
",",
"new",
"ImportSet",
"(",
")",
")",
";",
"}"
] | "Boxes" the supplied argument, ie. turning an <code>int</code> into an <code>Integer</code>
object. | [
"Boxes",
"the",
"supplied",
"argument",
"ie",
".",
"turning",
"an",
"<code",
">",
"int<",
"/",
"code",
">",
"into",
"an",
"<code",
">",
"Integer<",
"/",
"code",
">",
"object",
"."
] | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/tools/src/main/java/com/threerings/presents/tools/GenUtil.java#L147-L150 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java | FileUtilities.getFilesListByExtention | public static File[] getFilesListByExtention( String folderPath, final String ext ) {
"""
Get the list of files in a folder by its extension.
@param folderPath the folder path.
@param ext the extension without the dot.
@return the list of files patching.
"""
File[] files = new File(folder... | java | public static File[] getFilesListByExtention( String folderPath, final String ext ) {
File[] files = new File(folderPath).listFiles(new FilenameFilter(){
public boolean accept( File dir, String name ) {
return name.endsWith(ext);
}
});
return files;
} | [
"public",
"static",
"File",
"[",
"]",
"getFilesListByExtention",
"(",
"String",
"folderPath",
",",
"final",
"String",
"ext",
")",
"{",
"File",
"[",
"]",
"files",
"=",
"new",
"File",
"(",
"folderPath",
")",
".",
"listFiles",
"(",
"new",
"FilenameFilter",
"(... | Get the list of files in a folder by its extension.
@param folderPath the folder path.
@param ext the extension without the dot.
@return the list of files patching. | [
"Get",
"the",
"list",
"of",
"files",
"in",
"a",
"folder",
"by",
"its",
"extension",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/files/FileUtilities.java#L447-L454 |
classgraph/classgraph | src/main/java/nonapi/io/github/classgraph/concurrency/SingletonMap.java | SingletonMap.get | public V get(final K key, final LogNode log) throws E, InterruptedException, NullSingletonException {
"""
Check if the given key is in the map, and if so, return the value of {@link #newInstance(Object, LogNode)}
for that key, or block on the result of {@link #newInstance(Object, LogNode)} if another thread is cu... | java | public V get(final K key, final LogNode log) throws E, InterruptedException, NullSingletonException {
final SingletonHolder<V> singletonHolder = map.get(key);
V instance = null;
if (singletonHolder != null) {
// There is already a SingletonHolder in the map for this key -- get the va... | [
"public",
"V",
"get",
"(",
"final",
"K",
"key",
",",
"final",
"LogNode",
"log",
")",
"throws",
"E",
",",
"InterruptedException",
",",
"NullSingletonException",
"{",
"final",
"SingletonHolder",
"<",
"V",
">",
"singletonHolder",
"=",
"map",
".",
"get",
"(",
... | Check if the given key is in the map, and if so, return the value of {@link #newInstance(Object, LogNode)}
for that key, or block on the result of {@link #newInstance(Object, LogNode)} if another thread is currently
creating the new instance.
If the given key is not currently in the map, store a placeholder in the map... | [
"Check",
"if",
"the",
"given",
"key",
"is",
"in",
"the",
"map",
"and",
"if",
"so",
"return",
"the",
"value",
"of",
"{",
"@link",
"#newInstance",
"(",
"Object",
"LogNode",
")",
"}",
"for",
"that",
"key",
"or",
"block",
"on",
"the",
"result",
"of",
"{"... | train | https://github.com/classgraph/classgraph/blob/c8c8b2ca1eb76339f69193fdac33d735c864215c/src/main/java/nonapi/io/github/classgraph/concurrency/SingletonMap.java#L168-L202 |
OpenLiberty/open-liberty | dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/http/HttpInputStream.java | HttpInputStream.setContentLength | public void setContentLength(long len) {
"""
Sets the content length for this input stream. This should be called
once the headers have been read from the input stream.
@param len the content length
"""
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
... | java | public void setContentLength(long len)
{
if (TraceComponent.isAnyTracingEnabled()&&logger.isLoggable (Level.FINE)) { //306998.15
logger.logp(Level.FINE, CLASS_NAME,"setContentLength", "setContentLength --> "+len);
}
if ( len < 0 )
{
logger.logp(Level.SEVERE,... | [
"public",
"void",
"setContentLength",
"(",
"long",
"len",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"logger",
".",
"isLoggable",
"(",
"Level",
".",
"FINE",
")",
")",
"{",
"//306998.15",
"logger",
".",
"logp",
"(",
... | Sets the content length for this input stream. This should be called
once the headers have been read from the input stream.
@param len the content length | [
"Sets",
"the",
"content",
"length",
"for",
"this",
"input",
"stream",
".",
"This",
"should",
"be",
"called",
"once",
"the",
"headers",
"have",
"been",
"read",
"from",
"the",
"input",
"stream",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/srt/http/HttpInputStream.java#L190-L205 |
matomo-org/piwik-java-tracker | src/main/java/org/piwik/java/tracking/PiwikTracker.java | PiwikTracker.getHttpClient | protected HttpClient getHttpClient() {
"""
Get a HTTP client. With proxy if a proxy is provided in the constructor.
@return a HTTP client
"""
HttpClientBuilder builder = HttpClientBuilder.create();
if(proxyHost != null && proxyPort != 0) {
HttpHost proxy = new HttpHost(proxyHost,... | java | protected HttpClient getHttpClient(){
HttpClientBuilder builder = HttpClientBuilder.create();
if(proxyHost != null && proxyPort != 0) {
HttpHost proxy = new HttpHost(proxyHost, proxyPort);
DefaultProxyRoutePlanner routePlanner = new DefaultProxyRoutePlanner(proxy);
... | [
"protected",
"HttpClient",
"getHttpClient",
"(",
")",
"{",
"HttpClientBuilder",
"builder",
"=",
"HttpClientBuilder",
".",
"create",
"(",
")",
";",
"if",
"(",
"proxyHost",
"!=",
"null",
"&&",
"proxyPort",
"!=",
"0",
")",
"{",
"HttpHost",
"proxy",
"=",
"new",
... | Get a HTTP client. With proxy if a proxy is provided in the constructor.
@return a HTTP client | [
"Get",
"a",
"HTTP",
"client",
".",
"With",
"proxy",
"if",
"a",
"proxy",
"is",
"provided",
"in",
"the",
"constructor",
"."
] | train | https://github.com/matomo-org/piwik-java-tracker/blob/23df71d27a89e89dc7a539b2eda88c90a206458b/src/main/java/org/piwik/java/tracking/PiwikTracker.java#L153-L171 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java | ClassDescriptor.getFieldDescriptorForPath | public FieldDescriptor getFieldDescriptorForPath(String aPath, Map pathHints) {
"""
return the FieldDescriptor for the Attribute referenced in the path<br>
the path may contain simple attribut names, functions and path expressions
using relationships <br>
ie: name, avg(price), adress.street
@param aPath the pa... | java | public FieldDescriptor getFieldDescriptorForPath(String aPath, Map pathHints)
{
ArrayList desc = getAttributeDescriptorsForPath(aPath, pathHints);
FieldDescriptor fld = null;
Object temp;
if (!desc.isEmpty())
{
temp = desc.get(desc.size() - 1);
... | [
"public",
"FieldDescriptor",
"getFieldDescriptorForPath",
"(",
"String",
"aPath",
",",
"Map",
"pathHints",
")",
"{",
"ArrayList",
"desc",
"=",
"getAttributeDescriptorsForPath",
"(",
"aPath",
",",
"pathHints",
")",
";",
"FieldDescriptor",
"fld",
"=",
"null",
";",
"... | return the FieldDescriptor for the Attribute referenced in the path<br>
the path may contain simple attribut names, functions and path expressions
using relationships <br>
ie: name, avg(price), adress.street
@param aPath the path to the attribute
@param pathHints a Map containing the class to be used for a segment or <... | [
"return",
"the",
"FieldDescriptor",
"for",
"the",
"Attribute",
"referenced",
"in",
"the",
"path<br",
">",
"the",
"path",
"may",
"contain",
"simple",
"attribut",
"names",
"functions",
"and",
"path",
"expressions",
"using",
"relationships",
"<br",
">",
"ie",
":",
... | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/metadata/ClassDescriptor.java#L839-L854 |
VoltDB/voltdb | third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java | ZooKeeper.getData | public byte[] getData(final String path, Watcher watcher, Stat stat)
throws KeeperException, InterruptedException {
"""
Return the data and the stat of the node of the given path.
<p>
If the watch is non-null and the call is successful (no exception is
thrown), a watch will be left on the node with ... | java | public byte[] getData(final String path, Watcher watcher, Stat stat)
throws KeeperException, InterruptedException {
verbotenThreadCheck();
final String clientPath = path;
PathUtils.validatePath(clientPath);
// the watch contains the un-chroot path
WatchRegistration w... | [
"public",
"byte",
"[",
"]",
"getData",
"(",
"final",
"String",
"path",
",",
"Watcher",
"watcher",
",",
"Stat",
"stat",
")",
"throws",
"KeeperException",
",",
"InterruptedException",
"{",
"verbotenThreadCheck",
"(",
")",
";",
"final",
"String",
"clientPath",
"=... | Return the data and the stat of the node of the given path.
<p>
If the watch is non-null and the call is successful (no exception is
thrown), a watch will be left on the node with the given path. The watch
will be triggered by a successful operation that sets data on the node,
or deletes the node.
<p>
A KeeperException... | [
"Return",
"the",
"data",
"and",
"the",
"stat",
"of",
"the",
"node",
"of",
"the",
"given",
"path",
".",
"<p",
">",
"If",
"the",
"watch",
"is",
"non",
"-",
"null",
"and",
"the",
"call",
"is",
"successful",
"(",
"no",
"exception",
"is",
"thrown",
")",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/org/apache/zookeeper_voltpatches/ZooKeeper.java#L943-L972 |
mikepenz/Materialize | library/src/main/java/com/mikepenz/materialize/holder/ImageHolder.java | ImageHolder.decideIcon | public Drawable decideIcon(Context ctx, int iconColor, boolean tint) {
"""
this only handles Drawables
@param ctx
@param iconColor
@param tint
@return
"""
Drawable icon = mIcon;
if (mIconRes != -1) {
icon = ContextCompat.getDrawable(ctx, mIconRes);
} else if (mUri != ... | java | public Drawable decideIcon(Context ctx, int iconColor, boolean tint) {
Drawable icon = mIcon;
if (mIconRes != -1) {
icon = ContextCompat.getDrawable(ctx, mIconRes);
} else if (mUri != null) {
try {
InputStream inputStream = ctx.getContentResolver().openIn... | [
"public",
"Drawable",
"decideIcon",
"(",
"Context",
"ctx",
",",
"int",
"iconColor",
",",
"boolean",
"tint",
")",
"{",
"Drawable",
"icon",
"=",
"mIcon",
";",
"if",
"(",
"mIconRes",
"!=",
"-",
"1",
")",
"{",
"icon",
"=",
"ContextCompat",
".",
"getDrawable"... | this only handles Drawables
@param ctx
@param iconColor
@param tint
@return | [
"this",
"only",
"handles",
"Drawables"
] | train | https://github.com/mikepenz/Materialize/blob/2612c10c7570191a78d57f23620e945d61370e3d/library/src/main/java/com/mikepenz/materialize/holder/ImageHolder.java#L128-L149 |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/util/Preconditions.java | Preconditions.checkHasText | public static String checkHasText(String argument, String errorMessage) {
"""
Tests if a string contains text.
@param argument the string tested to see if it contains text.
@param errorMessage the errorMessage
@return the string argument that was tested.
@throws java.lang.IllegalArgumentException if the ... | java | public static String checkHasText(String argument, String errorMessage) {
if (argument == null || argument.isEmpty()) {
throw new IllegalArgumentException(errorMessage);
}
return argument;
} | [
"public",
"static",
"String",
"checkHasText",
"(",
"String",
"argument",
",",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"argument",
"==",
"null",
"||",
"argument",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"err... | Tests if a string contains text.
@param argument the string tested to see if it contains text.
@param errorMessage the errorMessage
@return the string argument that was tested.
@throws java.lang.IllegalArgumentException if the string is empty | [
"Tests",
"if",
"a",
"string",
"contains",
"text",
"."
] | train | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/util/Preconditions.java#L41-L47 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.publishProject | public CmsUUID publishProject(CmsObject cms, I_CmsReport report) throws CmsException {
"""
Publishes the current project.<p>
@param cms the cms request context
@param report an instance of <code>{@link I_CmsReport}</code> to print messages
@return the publish history id of the published project
@throws C... | java | public CmsUUID publishProject(CmsObject cms, I_CmsReport report) throws CmsException {
return publishProject(cms, report, getPublishList(cms));
} | [
"public",
"CmsUUID",
"publishProject",
"(",
"CmsObject",
"cms",
",",
"I_CmsReport",
"report",
")",
"throws",
"CmsException",
"{",
"return",
"publishProject",
"(",
"cms",
",",
"report",
",",
"getPublishList",
"(",
"cms",
")",
")",
";",
"}"
] | Publishes the current project.<p>
@param cms the cms request context
@param report an instance of <code>{@link I_CmsReport}</code> to print messages
@return the publish history id of the published project
@throws CmsException if something goes wrong | [
"Publishes",
"the",
"current",
"project",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L540-L543 |
strator-dev/greenpepper | greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Repository.java | Repository.addSpecification | public void addSpecification(Specification specification) throws GreenPepperServerException {
"""
<p>addSpecification.</p>
@param specification a {@link com.greenpepper.server.domain.Specification} object.
@throws com.greenpepper.server.GreenPepperServerException if any.
"""
if(specifications.conta... | java | public void addSpecification(Specification specification) throws GreenPepperServerException
{
if(specifications.contains(specification) || specificationNameExists(specification.getName()))
throw new GreenPepperServerException( GreenPepperServerErrorKey.SPECIFICATION_ALREADY_EXISTS, "Specificatio... | [
"public",
"void",
"addSpecification",
"(",
"Specification",
"specification",
")",
"throws",
"GreenPepperServerException",
"{",
"if",
"(",
"specifications",
".",
"contains",
"(",
"specification",
")",
"||",
"specificationNameExists",
"(",
"specification",
".",
"getName",... | <p>addSpecification.</p>
@param specification a {@link com.greenpepper.server.domain.Specification} object.
@throws com.greenpepper.server.GreenPepperServerException if any. | [
"<p",
">",
"addSpecification",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper/greenpepper-client/src/main/java/com/greenpepper/server/domain/Repository.java#L378-L385 |
apache/flink | flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java | StreamExecutionEnvironment.generateSequence | public DataStreamSource<Long> generateSequence(long from, long to) {
"""
Creates a new data stream that contains a sequence of numbers. This is a parallel source,
if you manually set the parallelism to {@code 1}
(using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int... | java | public DataStreamSource<Long> generateSequence(long from, long to) {
if (from > to) {
throw new IllegalArgumentException("Start of sequence must not be greater than the end");
}
return addSource(new StatefulSequenceSource(from, to), "Sequence Source");
} | [
"public",
"DataStreamSource",
"<",
"Long",
">",
"generateSequence",
"(",
"long",
"from",
",",
"long",
"to",
")",
"{",
"if",
"(",
"from",
">",
"to",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Start of sequence must not be greater than the end\"",
... | Creates a new data stream that contains a sequence of numbers. This is a parallel source,
if you manually set the parallelism to {@code 1}
(using {@link org.apache.flink.streaming.api.datastream.SingleOutputStreamOperator#setParallelism(int)})
the generated sequence of elements is in order.
@param from
The number to s... | [
"Creates",
"a",
"new",
"data",
"stream",
"that",
"contains",
"a",
"sequence",
"of",
"numbers",
".",
"This",
"is",
"a",
"parallel",
"source",
"if",
"you",
"manually",
"set",
"the",
"parallelism",
"to",
"{",
"@code",
"1",
"}",
"(",
"using",
"{",
"@link",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/environment/StreamExecutionEnvironment.java#L675-L680 |
looly/hutool | hutool-setting/src/main/java/cn/hutool/setting/GroupedMap.java | GroupedMap.put | public String put(String group, String key, String value) {
"""
将键值对加入到对应分组中
@param group 分组
@param key 键
@param value 值
@return 此key之前存在的值,如果没有返回null
"""
group = StrUtil.nullToEmpty(group).trim();
writeLock.lock();
try {
LinkedHashMap<String, String> valueMap = this.get(group);
if (null... | java | public String put(String group, String key, String value) {
group = StrUtil.nullToEmpty(group).trim();
writeLock.lock();
try {
LinkedHashMap<String, String> valueMap = this.get(group);
if (null == valueMap) {
valueMap = new LinkedHashMap<>();
this.put(group, valueMap);
}
this.size = -... | [
"public",
"String",
"put",
"(",
"String",
"group",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"group",
"=",
"StrUtil",
".",
"nullToEmpty",
"(",
"group",
")",
".",
"trim",
"(",
")",
";",
"writeLock",
".",
"lock",
"(",
")",
";",
"try",
"... | 将键值对加入到对应分组中
@param group 分组
@param key 键
@param value 值
@return 此key之前存在的值,如果没有返回null | [
"将键值对加入到对应分组中"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-setting/src/main/java/cn/hutool/setting/GroupedMap.java#L89-L103 |
landawn/AbacusUtil | src/com/landawn/abacus/util/Primitives.java | Primitives.box | @SafeVarargs
public static Byte[] box(final byte... a) {
"""
<p>
Converts an array of primitive bytes to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code byte} array
@return a {@code Byte} array, {@code null} if null array input
"""
... | java | @SafeVarargs
public static Byte[] box(final byte... a) {
if (a == null) {
return null;
}
return box(a, 0, a.length);
} | [
"@",
"SafeVarargs",
"public",
"static",
"Byte",
"[",
"]",
"box",
"(",
"final",
"byte",
"...",
"a",
")",
"{",
"if",
"(",
"a",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"box",
"(",
"a",
",",
"0",
",",
"a",
".",
"length",
")",
... | <p>
Converts an array of primitive bytes to objects.
</p>
<p>
This method returns {@code null} for a {@code null} input array.
</p>
@param a
a {@code byte} array
@return a {@code Byte} array, {@code null} if null array input | [
"<p",
">",
"Converts",
"an",
"array",
"of",
"primitive",
"bytes",
"to",
"objects",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/Primitives.java#L199-L206 |
CenturyLinkCloud/mdw | mdw-common/src/com/centurylink/mdw/provider/ProviderRegistry.java | ProviderRegistry.getDynamicVariableTranslator | public VariableTranslator getDynamicVariableTranslator(String className, ClassLoader parentLoader) {
"""
To get dynamic java variable translator
@param translatorClass
@param classLoader
@return
"""
try {
Class<?> clazz = CompiledJavaCache.getClassFromAssetName(parentLoader, className);
... | java | public VariableTranslator getDynamicVariableTranslator(String className, ClassLoader parentLoader) {
try {
Class<?> clazz = CompiledJavaCache.getClassFromAssetName(parentLoader, className);
if (clazz != null)
return (VariableTranslator) (clazz).newInstance();
}
... | [
"public",
"VariableTranslator",
"getDynamicVariableTranslator",
"(",
"String",
"className",
",",
"ClassLoader",
"parentLoader",
")",
"{",
"try",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"CompiledJavaCache",
".",
"getClassFromAssetName",
"(",
"parentLoader",
",",
"... | To get dynamic java variable translator
@param translatorClass
@param classLoader
@return | [
"To",
"get",
"dynamic",
"java",
"variable",
"translator"
] | train | https://github.com/CenturyLinkCloud/mdw/blob/91167fe65a25a5d7022cdcf8b0fae8506f5b87ce/mdw-common/src/com/centurylink/mdw/provider/ProviderRegistry.java#L92-L102 |
Bedework/bw-util | bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java | XmlEmit.property | public void property(final QName tag, final Reader val) throws IOException {
"""
Create the sequence<br>
<tag>val</tag> where val is represented by a Reader
@param tag
@param val
@throws IOException
"""
blanks();
openTagSameLine(tag);
writeContent(val, wtr);
closeTagSameLine(tag);
new... | java | public void property(final QName tag, final Reader val) throws IOException {
blanks();
openTagSameLine(tag);
writeContent(val, wtr);
closeTagSameLine(tag);
newline();
} | [
"public",
"void",
"property",
"(",
"final",
"QName",
"tag",
",",
"final",
"Reader",
"val",
")",
"throws",
"IOException",
"{",
"blanks",
"(",
")",
";",
"openTagSameLine",
"(",
"tag",
")",
";",
"writeContent",
"(",
"val",
",",
"wtr",
")",
";",
"closeTagSam... | Create the sequence<br>
<tag>val</tag> where val is represented by a Reader
@param tag
@param val
@throws IOException | [
"Create",
"the",
"sequence<br",
">",
"<tag",
">",
"val<",
"/",
"tag",
">",
"where",
"val",
"is",
"represented",
"by",
"a",
"Reader"
] | train | https://github.com/Bedework/bw-util/blob/f51de4af3d7eb88fe63a0e22be8898a16c6cc3ad/bw-util-xml/src/main/java/org/bedework/util/xml/XmlEmit.java#L467-L473 |
kiswanij/jk-util | src/main/java/com/jk/util/JKObjectUtil.java | JKObjectUtil.getFieldNameByType | public static String getFieldNameByType(Class<?> classType, Class<?> fieldType) {
"""
Gets the field name by type.
@param classType the class type
@param fieldType the field type
@return the field name by type
"""
Field[] declaredFields = classType.getDeclaredFields();
for (Field field : declaredFie... | java | public static String getFieldNameByType(Class<?> classType, Class<?> fieldType) {
Field[] declaredFields = classType.getDeclaredFields();
for (Field field : declaredFields) {
if (field.getType().isAssignableFrom(fieldType)) {
return field.getName();
}
}
if (classType.getSuperclass() != null) {
... | [
"public",
"static",
"String",
"getFieldNameByType",
"(",
"Class",
"<",
"?",
">",
"classType",
",",
"Class",
"<",
"?",
">",
"fieldType",
")",
"{",
"Field",
"[",
"]",
"declaredFields",
"=",
"classType",
".",
"getDeclaredFields",
"(",
")",
";",
"for",
"(",
... | Gets the field name by type.
@param classType the class type
@param fieldType the field type
@return the field name by type | [
"Gets",
"the",
"field",
"name",
"by",
"type",
"."
] | train | https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/JKObjectUtil.java#L786-L797 |
kazocsaba/matrix | src/main/java/hu/kazocsaba/math/matrix/MatrixFactory.java | MatrixFactory.createVector | public static Vector2 createVector(double x, double y) {
"""
Creates and initializes a new 2D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@return the new vector
"""
Vector2 v=new Vector2Impl();
v.setX(x);
v.setY(y);
return v;
} | java | public static Vector2 createVector(double x, double y) {
Vector2 v=new Vector2Impl();
v.setX(x);
v.setY(y);
return v;
} | [
"public",
"static",
"Vector2",
"createVector",
"(",
"double",
"x",
",",
"double",
"y",
")",
"{",
"Vector2",
"v",
"=",
"new",
"Vector2Impl",
"(",
")",
";",
"v",
".",
"setX",
"(",
"x",
")",
";",
"v",
".",
"setY",
"(",
"y",
")",
";",
"return",
"v",
... | Creates and initializes a new 2D column vector.
@param x the x coordinate of the new vector
@param y the y coordinate of the new vector
@return the new vector | [
"Creates",
"and",
"initializes",
"a",
"new",
"2D",
"column",
"vector",
"."
] | train | https://github.com/kazocsaba/matrix/blob/018570db945fe616b25606fe605fa6e0c180ab5b/src/main/java/hu/kazocsaba/math/matrix/MatrixFactory.java#L20-L25 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java | JDBC4PreparedStatement.setSQLXML | @Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException {
"""
Sets the designated parameter to the given java.sql.SQLXML object.
"""
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | java | @Override
public void setSQLXML(int parameterIndex, SQLXML xmlObject) throws SQLException
{
checkParameterBounds(parameterIndex);
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setSQLXML",
"(",
"int",
"parameterIndex",
",",
"SQLXML",
"xmlObject",
")",
"throws",
"SQLException",
"{",
"checkParameterBounds",
"(",
"parameterIndex",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.sql.SQLXML object. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"sql",
".",
"SQLXML",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4PreparedStatement.java#L542-L547 |
apache/incubator-shardingsphere | sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/ShardingErrorSpan.java | ShardingErrorSpan.setError | public static void setError(final Span span, final Exception cause) {
"""
Set error.
@param span span to be set
@param cause failure cause of span
"""
span.setTag(Tags.ERROR.getKey(), true).log(System.currentTimeMillis(), getReason(cause));
} | java | public static void setError(final Span span, final Exception cause) {
span.setTag(Tags.ERROR.getKey(), true).log(System.currentTimeMillis(), getReason(cause));
} | [
"public",
"static",
"void",
"setError",
"(",
"final",
"Span",
"span",
",",
"final",
"Exception",
"cause",
")",
"{",
"span",
".",
"setTag",
"(",
"Tags",
".",
"ERROR",
".",
"getKey",
"(",
")",
",",
"true",
")",
".",
"log",
"(",
"System",
".",
"currentT... | Set error.
@param span span to be set
@param cause failure cause of span | [
"Set",
"error",
"."
] | train | https://github.com/apache/incubator-shardingsphere/blob/f88fd29fc345dfb31fdce12e9e96cbfa0fd2402d/sharding-opentracing/src/main/java/org/apache/shardingsphere/opentracing/hook/ShardingErrorSpan.java#L43-L45 |
voldemort/voldemort | src/java/voldemort/tools/admin/AdminParserUtils.java | AdminParserUtils.checkOptional | public static void checkOptional(OptionSet options, List<String> opts)
throws VoldemortException {
"""
Checks if there's at most one option that exists among all opts.
@param parser OptionParser to checked
@param opts List of options to be checked
@throws VoldemortException
"""
List<St... | java | public static void checkOptional(OptionSet options, List<String> opts)
throws VoldemortException {
List<String> optCopy = Lists.newArrayList();
for(String opt: opts) {
if(options.has(opt)) {
optCopy.add(opt);
}
}
if(optCopy.size() > 1) ... | [
"public",
"static",
"void",
"checkOptional",
"(",
"OptionSet",
"options",
",",
"List",
"<",
"String",
">",
"opts",
")",
"throws",
"VoldemortException",
"{",
"List",
"<",
"String",
">",
"optCopy",
"=",
"Lists",
".",
"newArrayList",
"(",
")",
";",
"for",
"("... | Checks if there's at most one option that exists among all opts.
@param parser OptionParser to checked
@param opts List of options to be checked
@throws VoldemortException | [
"Checks",
"if",
"there",
"s",
"at",
"most",
"one",
"option",
"that",
"exists",
"among",
"all",
"opts",
"."
] | train | https://github.com/voldemort/voldemort/blob/a7dbdea58032021361680faacf2782cf981c5332/src/java/voldemort/tools/admin/AdminParserUtils.java#L422-L437 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.