repo stringclasses 199
values | path stringlengths 28 169 | func_name stringlengths 6 98 | original_string stringlengths 91 27.2k | language stringclasses 1
value | code stringlengths 91 27.2k | code_tokens listlengths 21 5.01k | docstring stringlengths 1 6.47k | docstring_tokens listlengths 1 587 | sha stringclasses 199
values | url stringlengths 117 257 | partition stringclasses 1
value | summary stringlengths 3 207 | output stringlengths 170 27.3k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/RangeOfInt.java | RangeOfInt.contains | @SuppressWarnings("deprecation")
@Override public boolean contains(Object o) {
// Only accept classes where we can convert to an integer while preventing
// overflow/underflow. If there were a way to reliably test for overflow/underflow in
// Numbers, we could accept them too, but with the ... | java | @SuppressWarnings("deprecation")
@Override public boolean contains(Object o) {
// Only accept classes where we can convert to an integer while preventing
// overflow/underflow. If there were a way to reliably test for overflow/underflow in
// Numbers, we could accept them too, but with the ... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"@",
"Override",
"public",
"boolean",
"contains",
"(",
"Object",
"o",
")",
"{",
"// Only accept classes where we can convert to an integer while preventing",
"// overflow/underflow. If there were a way to reliably test for overfl... | Though this overrides List.contains(Object o), it is effectively a convenience method for
calling contains(int i). Therefore, it only accepts Integers, Longs, BigIntegers, and
Strings that parse as signed decimal Integers. It does not accept Numbers since they can't
easily be checked for truncation and floating-point... | [
"Though",
"this",
"overrides",
"List",
".",
"contains",
"(",
"Object",
"o",
")",
"it",
"is",
"effectively",
"a",
"convenience",
"method",
"for",
"calling",
"contains",
"(",
"int",
"i",
")",
".",
"Therefore",
"it",
"only",
"accepts",
"Integers",
"Longs",
"B... | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/RangeOfInt.java#L153-L181 | test | Check if the Sequence contains the given object. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
@Override public boolean contains(Object o) {
// Only accept classes where we can convert to an integer while preventing
// overflow/underflow. If there were a way to reliably test for overflow/underflow in
... |
RestComm/jain-slee | container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/stats/EventRouterStatisticsImpl.java | EventRouterStatisticsImpl.getExecutingTime | public long getExecutingTime(int executor) {
final EventRouterExecutorStatistics executorStats = getExecutors()[executor].getStatistics();
return executorStats == null ? 0 : executorStats.getExecutingTime();
} | java | public long getExecutingTime(int executor) {
final EventRouterExecutorStatistics executorStats = getExecutors()[executor].getStatistics();
return executorStats == null ? 0 : executorStats.getExecutingTime();
} | [
"public",
"long",
"getExecutingTime",
"(",
"int",
"executor",
")",
"{",
"final",
"EventRouterExecutorStatistics",
"executorStats",
"=",
"getExecutors",
"(",
")",
"[",
"executor",
"]",
".",
"getStatistics",
"(",
")",
";",
"return",
"executorStats",
"==",
"null",
... | /* (non-Javadoc)
@see org.mobicents.slee.runtime.eventrouter.stats.EventRouterStatisticsMBean#getExecutingTime(int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/router/src/main/java/org/mobicents/slee/runtime/eventrouter/stats/EventRouterStatisticsImpl.java#L175-L178 | test | Gets the execution time of the specified executor. | Of course, here is the Java code you requested:
```java
public long getExecutingTime(int executor) {
final EventRouterExecutorStatistics executorStats = getExecutors()[executor].getStatistics();
return executorStats == null ? 0 : executorStats.getExecutingTime();
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java | RandomAccessFile.readStringMax | public String readStringMax(int nbytes) throws IOException {
byte[] b = new byte[nbytes];
readFully(b);
int count;
for (count = 0; count < nbytes; count++)
if (b[count] == 0) break;
return new String(b, 0, count, CDM.utf8Charset);
} | java | public String readStringMax(int nbytes) throws IOException {
byte[] b = new byte[nbytes];
readFully(b);
int count;
for (count = 0; count < nbytes; count++)
if (b[count] == 0) break;
return new String(b, 0, count, CDM.utf8Charset);
} | [
"public",
"String",
"readStringMax",
"(",
"int",
"nbytes",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"b",
"=",
"new",
"byte",
"[",
"nbytes",
"]",
";",
"readFully",
"(",
"b",
")",
";",
"int",
"count",
";",
"for",
"(",
"count",
"=",
"0",
"... | Read a String of max length, zero terminate.
@param nbytes number of bytes to read
@return String wrapping the bytes.
@throws IOException if an I/O error occurs. | [
"Read",
"a",
"String",
"of",
"max",
"length",
"zero",
"terminate",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L1506-L1513 | test | Reads a string of nbytes bytes from the underlying stream. | Of course, here is the Java code you requested:
```java
public String readStringMax(int nbytes) throws IOException {
byte[] b = new byte[nbytes];
readFully(b);
int count;
for (count = 0; count < nbytes; count++)
if (b[count] == 0) break;
return new String(b, 0, count, CDM.utf8Charset);
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/sigmet/SigmetIOServiceProvider.java | SigmetIOServiceProvider.isValidFile | public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
try {
raf.order(RandomAccessFile.LITTLE_ENDIAN);
// The first struct in the file is the product_hdr, which will have the
// standard structure_header, followed by other embedded structures.
// Each of these structures al... | java | public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
try {
raf.order(RandomAccessFile.LITTLE_ENDIAN);
// The first struct in the file is the product_hdr, which will have the
// standard structure_header, followed by other embedded structures.
// Each of these structures al... | [
"public",
"boolean",
"isValidFile",
"(",
"ucar",
".",
"unidata",
".",
"io",
".",
"RandomAccessFile",
"raf",
")",
"{",
"try",
"{",
"raf",
".",
"order",
"(",
"RandomAccessFile",
".",
"LITTLE_ENDIAN",
")",
";",
"// The first struct in the file is the product_hdr, which... | Check if this is a valid SIGMET-IRIS file for this IOServiceProvider. | [
"Check",
"if",
"this",
"is",
"a",
"valid",
"SIGMET",
"-",
"IRIS",
"file",
"for",
"this",
"IOServiceProvider",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/sigmet/SigmetIOServiceProvider.java#L121-L141 | test | Checks if a file is a valid NFD file. | Of course, here is the Java code you requested:
```java
public boolean isValidFile(ucar.unidata.io.RandomAccessFile raf) {
try {
raf.order(RandomAccessFile.LITTLE_ENDIAN);
// The first struct in the file is the product_hdr, which will have the
// standard structure_header, followed by other e... |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.initNewThreadScheduler | @NonNull
public static Scheduler initNewThreadScheduler(@NonNull Callable<Scheduler> defaultScheduler) {
ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null");
Function<? super Callable<Scheduler>, ? extends Scheduler> f = onInitNewThreadHandler;
if (f == null) {
... | java | @NonNull
public static Scheduler initNewThreadScheduler(@NonNull Callable<Scheduler> defaultScheduler) {
ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null");
Function<? super Callable<Scheduler>, ? extends Scheduler> f = onInitNewThreadHandler;
if (f == null) {
... | [
"@",
"NonNull",
"public",
"static",
"Scheduler",
"initNewThreadScheduler",
"(",
"@",
"NonNull",
"Callable",
"<",
"Scheduler",
">",
"defaultScheduler",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"defaultScheduler",
",",
"\"Scheduler Callable can't be null\"",
... | Calls the associated hook function.
@param defaultScheduler a {@link Callable} which returns the hook's input value
@return the value returned by the hook, not null
@throws NullPointerException if the callable parameter or its result are null | [
"Calls",
"the",
"associated",
"hook",
"function",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L299-L307 | test | Creates a new thread scheduler. | Of course, here is the Java code you requested:
```java
@NonNull
public static Scheduler initNewThreadScheduler(@NonNull Callable<Scheduler> defaultScheduler) {
ObjectHelper.requireNonNull(defaultScheduler, "Scheduler Callable can't be null");
Function<? super Callable<Scheduler>, ? extends Schedul... |
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/Locale.java | Locale.eclass | static UnicodeSet eclass(char c, boolean cases) {
/* otherwise, none */
if (cases) {
return allcases(c);
} else {
UnicodeSet set = new UnicodeSet();
set.add(c);
return set;
}
} | java | static UnicodeSet eclass(char c, boolean cases) {
/* otherwise, none */
if (cases) {
return allcases(c);
} else {
UnicodeSet set = new UnicodeSet();
set.add(c);
return set;
}
} | [
"static",
"UnicodeSet",
"eclass",
"(",
"char",
"c",
",",
"boolean",
"cases",
")",
"{",
"/* otherwise, none */",
"if",
"(",
"cases",
")",
"{",
"return",
"allcases",
"(",
"c",
")",
";",
"}",
"else",
"{",
"UnicodeSet",
"set",
"=",
"new",
"UnicodeSet",
"(",
... | eclass - Because we have no MCCE support, this
just processing single characters. | [
"eclass",
"-",
"Because",
"we",
"have",
"no",
"MCCE",
"support",
"this",
"just",
"processing",
"single",
"characters",
"."
] | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Locale.java#L202-L212 | test | Returns a UnicodeSet representing the EClass of a character. | Of course, here is the Java code you requested:
```java
static UnicodeSet eclass(char c, boolean cases) {
/* otherwise, none */
if (cases) {
return allcases(c);
} else {
UnicodeSet set = new UnicodeSet();
set.add(c);
return set;
}
}
```
... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/flow/FlowStepRule.java | FlowStepRule.toJsonObject | @Override
public JSONObject toJsonObject() throws JSONException
{
JSONObject returnVal = super.toJsonObject();
//Order...
if(this.getOrder() != null)
{
returnVal.put(JSONMapping.ORDER, this.getOrder());
}
//Rule...
if(this.getRule() != null)
... | java | @Override
public JSONObject toJsonObject() throws JSONException
{
JSONObject returnVal = super.toJsonObject();
//Order...
if(this.getOrder() != null)
{
returnVal.put(JSONMapping.ORDER, this.getOrder());
}
//Rule...
if(this.getRule() != null)
... | [
"@",
"Override",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//Order...",
"if",
"(",
"this",
".",
"getOrder",
"(",
")",
"!=",
"null",
")",
"... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code FlowStepRule}
@throws JSONException If there is a problem with the JSON Body.
@see ABaseFluidJSONObject#toJsonObject() | [
"Conversion",
"to",
"{",
"@code",
"JSONObject",
"}",
"from",
"Java",
"Object",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/flow/FlowStepRule.java#L146-L196 | test | Override toJsonObject to return JSONObject | Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException
{
JSONObject returnVal = super.toJsonObject();
//Order...
if(this.getOrder() != null)
{
returnVal.put(JSONMapping.ORDER, this.getOrder());
... |
apache/parquet-mr | parquet-thrift/src/main/java/org/apache/parquet/thrift/ParquetWriteProtocol.java | ParquetWriteProtocol.writeFieldBegin | @Override
public void writeFieldBegin(TField field) throws TException {
LOG.debug("writeFieldBegin({})", field);
currentProtocol.writeFieldBegin(field);
} | java | @Override
public void writeFieldBegin(TField field) throws TException {
LOG.debug("writeFieldBegin({})", field);
currentProtocol.writeFieldBegin(field);
} | [
"@",
"Override",
"public",
"void",
"writeFieldBegin",
"(",
"TField",
"field",
")",
"throws",
"TException",
"{",
"LOG",
".",
"debug",
"(",
"\"writeFieldBegin({})\"",
",",
"field",
")",
";",
"currentProtocol",
".",
"writeFieldBegin",
"(",
"field",
")",
";",
"}"
... | {@inheritDoc}
@see org.apache.parquet.thrift.ParquetProtocol#writeFieldBegin(org.apache.thrift.protocol.TField) | [
"{"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-thrift/src/main/java/org/apache/parquet/thrift/ParquetWriteProtocol.java#L479-L483 | test | Write field begin. | Of course, here is the Java code you requested:
```java
@Override
public void writeFieldBegin(TField field) throws TException {
LOG.debug("writeFieldBegin({})", field);
currentProtocol.writeFieldBegin(field);
}
```
Hope this helps! |
dbmdz/iiif-apis | src/main/java/de/digitalcollections/iiif/model/image/SizeRequest.java | SizeRequest.fromString | @JsonCreator
public static SizeRequest fromString(String str) throws ResolvingException {
if (str.equals("full")) {
return new SizeRequest();
}
if (str.equals("max")) {
return new SizeRequest(true);
}
Matcher matcher = PARSE_PAT.matcher(str);
if (!matcher.matches()) {
throw n... | java | @JsonCreator
public static SizeRequest fromString(String str) throws ResolvingException {
if (str.equals("full")) {
return new SizeRequest();
}
if (str.equals("max")) {
return new SizeRequest(true);
}
Matcher matcher = PARSE_PAT.matcher(str);
if (!matcher.matches()) {
throw n... | [
"@",
"JsonCreator",
"public",
"static",
"SizeRequest",
"fromString",
"(",
"String",
"str",
")",
"throws",
"ResolvingException",
"{",
"if",
"(",
"str",
".",
"equals",
"(",
"\"full\"",
")",
")",
"{",
"return",
"new",
"SizeRequest",
"(",
")",
";",
"}",
"if",
... | Parse an IIIF Image API compliant size request string
@param str IIIF Image API compliant size request string
@return parsed SizeRequest
@throws ResolvingException if the request string is malformed | [
"Parse",
"an",
"IIIF",
"Image",
"API",
"compliant",
"size",
"request",
"string"
] | 3e77c1044ca4bf4acabb38269c7d72af2f042fc8 | https://github.com/dbmdz/iiif-apis/blob/3e77c1044ca4bf4acabb38269c7d72af2f042fc8/src/main/java/de/digitalcollections/iiif/model/image/SizeRequest.java#L31-L62 | test | Create a SizeRequest object from a String. | Of course, here is the Java code you requested:
```java
@JsonCreator
public static SizeRequest fromString(String str) throws ResolvingException {
if (str.equals("full")) {
return new SizeRequest();
}
if (str.equals("max")) {
return new SizeRequest(true);
}
Matcher matcher = PARSE_PAT.... |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.notAcceptable | public static Result notAcceptable(JsonNode content, JsonEncoding encoding) {
return status(NOT_ACCEPTABLE, content, encoding);
} | java | public static Result notAcceptable(JsonNode content, JsonEncoding encoding) {
return status(NOT_ACCEPTABLE, content, encoding);
} | [
"public",
"static",
"Result",
"notAcceptable",
"(",
"JsonNode",
"content",
",",
"JsonEncoding",
"encoding",
")",
"{",
"return",
"status",
"(",
"NOT_ACCEPTABLE",
",",
"content",
",",
"encoding",
")",
";",
"}"
] | Generates a 406 Not Acceptable result.
@param content the result's body content as a play-json object
@param encoding the encoding into which the json should be encoded
@return the result | [
"Generates",
"a",
"406",
"Not",
"Acceptable",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L2489-L2491 | test | A status code that indicates that the content is not acceptable. | Of course, here is the Java code you requested:
```java
public static Result notAcceptable(JsonNode content, JsonEncoding encoding) {
return status(NOT_ACCEPTABLE, content, encoding);
}
```
Hope this helps! |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/Container.java | Container.getNumStreams | public int getNumStreams() throws java.lang.InterruptedException, java.io.IOException {
return VideoJNI.Container_getNumStreams(swigCPtr, this);
} | java | public int getNumStreams() throws java.lang.InterruptedException, java.io.IOException {
return VideoJNI.Container_getNumStreams(swigCPtr, this);
} | [
"public",
"int",
"getNumStreams",
"(",
")",
"throws",
"java",
".",
"lang",
".",
"InterruptedException",
",",
"java",
".",
"io",
".",
"IOException",
"{",
"return",
"VideoJNI",
".",
"Container_getNumStreams",
"(",
"swigCPtr",
",",
"this",
")",
";",
"}"
] | The number of streams in this container.<br>
<p>If this container is a Source this will query the stream and find out<br>
how many streams are in it.</p><p>If the current thread is interrupted while this blocking method<br>
is running the method will return with a negative value.<br>
To check if the method exited becau... | [
"The",
"number",
"of",
"streams",
"in",
"this",
"container",
".",
"<br",
">",
"<p",
">",
"If",
"this",
"container",
"is",
"a",
"Source",
"this",
"will",
"query",
"the",
"stream",
"and",
"find",
"out<br",
">",
"how",
"many",
"streams",
"are",
"in",
"it"... | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Container.java#L137-L139 | test | Gets the number of streams in this container. | Of course, here is the Java code you requested:
```java
public int getNumStreams() throws java.lang.InterruptedException, java.io.IOException {
return VideoJNI.Container_getNumStreams(swigCPtr, this);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/thredds/client/catalog/tools/CatalogXmlWriter.java | CatalogXmlWriter.writeInheritedMetadata | protected void writeInheritedMetadata(Element elem, Dataset ds) {
Element mdataElem = new Element("metadata", Catalog.defNS);
mdataElem.setAttribute("inherited", "true");
ThreddsMetadata tmi = (ThreddsMetadata) ds.getLocalField(Dataset.ThreddsMetadataInheritable);
if (tmi == null) return;
writeThred... | java | protected void writeInheritedMetadata(Element elem, Dataset ds) {
Element mdataElem = new Element("metadata", Catalog.defNS);
mdataElem.setAttribute("inherited", "true");
ThreddsMetadata tmi = (ThreddsMetadata) ds.getLocalField(Dataset.ThreddsMetadataInheritable);
if (tmi == null) return;
writeThred... | [
"protected",
"void",
"writeInheritedMetadata",
"(",
"Element",
"elem",
",",
"Dataset",
"ds",
")",
"{",
"Element",
"mdataElem",
"=",
"new",
"Element",
"(",
"\"metadata\"",
",",
"Catalog",
".",
"defNS",
")",
";",
"mdataElem",
".",
"setAttribute",
"(",
"\"inherit... | /* protected void writeCat6InheritedMetadata( Element elem, ThreddsMetadata tmi) {
if ((tmi.getDataType() == null) && (tmi.getServiceName() == null) &&
(tmi.getAuthority() == null) && ( tmi.getProperties().size() == 0))
return;
Element mdataElem = new Element("metadata", Catalog.defNS);
mdataElem.setAttribute("inherit... | [
"/",
"*",
"protected",
"void",
"writeCat6InheritedMetadata",
"(",
"Element",
"elem",
"ThreddsMetadata",
"tmi",
")",
"{",
"if",
"((",
"tmi",
".",
"getDataType",
"()",
"==",
"null",
")",
"&&",
"(",
"tmi",
".",
"getServiceName",
"()",
"==",
"null",
")",
"&&",... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/thredds/client/catalog/tools/CatalogXmlWriter.java#L438-L446 | test | Write inherited ThreddsMetadata | Of course, here is the Java code you requested:
```java
protected void writeInheritedMetadata(Element elem, Dataset ds) {
Element mdataElem = new Element("metadata", Catalog.defNS);
mdataElem.setAttribute("inherited", "true");
ThreddsMetadata tmi = (ThreddsMetadata) ds.getLocalField(Dataset.ThreddsMetadata... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormUtil.java | SQLFormUtil.getFormDescendants | @Override
public List<Form> getFormDescendants(
List<Long> electronicFormIdsParam,
boolean includeFieldDataParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam) {
if(electronicFormIdsParam == null || electronicFormIdsParam.isEmpty()) {
return null;
}
List<Form> re... | java | @Override
public List<Form> getFormDescendants(
List<Long> electronicFormIdsParam,
boolean includeFieldDataParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam) {
if(electronicFormIdsParam == null || electronicFormIdsParam.isEmpty()) {
return null;
}
List<Form> re... | [
"@",
"Override",
"public",
"List",
"<",
"Form",
">",
"getFormDescendants",
"(",
"List",
"<",
"Long",
">",
"electronicFormIdsParam",
",",
"boolean",
"includeFieldDataParam",
",",
"boolean",
"includeTableFieldsParam",
",",
"boolean",
"includeTableFieldFormRecordInfoParam",
... | Gets the descendants for the {@code electronicFormIdsParam} Forms.
@param electronicFormIdsParam Identifiers for the Forms to retrieve.
@param includeFieldDataParam Whether to populate the return {@code List<Form>} fields.
@param includeTableFieldsParam Whether to populate the return {@code List<Form>} table fields.
@... | [
"Gets",
"the",
"descendants",
"for",
"the",
"{",
"@code",
"electronicFormIdsParam",
"}",
"Forms",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/util/sql/impl/SQLFormUtil.java#L168-L196 | test | Returns a list of all the descendants of the specified electronicFormIds. | Of course, here is the Java code you requested:
```java
@Override
public List<Form> getFormDescendants(
List<Long> electronicFormIdsParam,
boolean includeFieldDataParam,
boolean includeTableFieldsParam,
boolean includeTableFieldFormRecordInfoParam) {
if(electronicFormIdsParam == null || electronicFormI... |
jboss/jboss-common-core | src/main/java/org/jboss/util/collection/SoftValueRef.java | SoftValueRef.create | static <K, V> SoftValueRef<K, V> create(K key, V val, ReferenceQueue<V> q)
{
if (val == null)
return null;
else
return new SoftValueRef<K, V>(key, val, q);
} | java | static <K, V> SoftValueRef<K, V> create(K key, V val, ReferenceQueue<V> q)
{
if (val == null)
return null;
else
return new SoftValueRef<K, V>(key, val, q);
} | [
"static",
"<",
"K",
",",
"V",
">",
"SoftValueRef",
"<",
"K",
",",
"V",
">",
"create",
"(",
"K",
"key",
",",
"V",
"val",
",",
"ReferenceQueue",
"<",
"V",
">",
"q",
")",
"{",
"if",
"(",
"val",
"==",
"null",
")",
"return",
"null",
";",
"else",
"... | Safely create a new SoftValueRef
@param <K> the key type
@param <V> the value type
@param key the key
@param val the value
@param q the reference queue
@return the reference or null if the value is null | [
"Safely",
"create",
"a",
"new",
"SoftValueRef"
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/collection/SoftValueRef.java#L49-L55 | test | Create a SoftValueRef. | Of course, here is the Java code you requested:
```java
static <K, V> SoftValueRef<K, V> create(K key, V val, ReferenceQueue<V> q)
{
if (val == null)
return null;
else
return new SoftValueRef<K, V>(key, val, q);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/dmsp/DMSPHeader.java | DMSPHeader.handleSatelliteInformation | private void handleSatelliteInformation()
{
spacecraftIdAtt = new Attribute(
this.spacecraftIdAttName,
headerInfo.get(HeaderInfoTitle.SPACECRAFT_ID.toString()));
noradIdAtt = new Attribute(
this.noradIdAttName,
headerInfo.get(HeaderInfoTitle.NORAD_ID.toString())... | java | private void handleSatelliteInformation()
{
spacecraftIdAtt = new Attribute(
this.spacecraftIdAttName,
headerInfo.get(HeaderInfoTitle.SPACECRAFT_ID.toString()));
noradIdAtt = new Attribute(
this.noradIdAttName,
headerInfo.get(HeaderInfoTitle.NORAD_ID.toString())... | [
"private",
"void",
"handleSatelliteInformation",
"(",
")",
"{",
"spacecraftIdAtt",
"=",
"new",
"Attribute",
"(",
"this",
".",
"spacecraftIdAttName",
",",
"headerInfo",
".",
"get",
"(",
"HeaderInfoTitle",
".",
"SPACECRAFT_ID",
".",
"toString",
"(",
")",
")",
")",... | Parse the satellite information from the header. | [
"Parse",
"the",
"satellite",
"information",
"from",
"the",
"header",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/dmsp/DMSPHeader.java#L428-L436 | test | Handle the RAFT and NORAD attributes. | Of course, here is the Java code you requested:
```java
private void handleSatelliteInformation()
{
spacecraftIdAtt = new Attribute(
this.spacecraftIdAttName,
headerInfo.get(HeaderInfoTitle.SPACECRAFT_ID.toString()));
noradIdAtt = new Attribute(
this.noradIdAttName,
... |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java | CSIv2Util.decodeInitialContextToken | public static InitialContextToken decodeInitialContextToken(byte[] encodedToken, Codec codec) {
if (encodedToken[0] != 0x60)
return null;
int encodedLength = 0;
int n = 0;
if (encodedToken[1] >= 0)
encodedLength = encodedToken[1];
else {
n = ... | java | public static InitialContextToken decodeInitialContextToken(byte[] encodedToken, Codec codec) {
if (encodedToken[0] != 0x60)
return null;
int encodedLength = 0;
int n = 0;
if (encodedToken[1] >= 0)
encodedLength = encodedToken[1];
else {
n = ... | [
"public",
"static",
"InitialContextToken",
"decodeInitialContextToken",
"(",
"byte",
"[",
"]",
"encodedToken",
",",
"Codec",
"codec",
")",
"{",
"if",
"(",
"encodedToken",
"[",
"0",
"]",
"!=",
"0x60",
")",
"return",
"null",
";",
"int",
"encodedLength",
"=",
"... | <p>
Decodes an ASN.1-encoded {@code InitialContextToken}. See {@code encodeInitialContextToken} for a description of
the encoded token format.
</p>
@param encodedToken the encoded token.
@param codec the {@code Codec} used to decode the token.
@return the decoded {@code InitialContextToken} instance.
@see #enco... | [
"<p",
">",
"Decodes",
"an",
"ASN",
".",
"1",
"-",
"encoded",
"{",
"@code",
"InitialContextToken",
"}",
".",
"See",
"{",
"@code",
"encodeInitialContextToken",
"}",
"for",
"a",
"description",
"of",
"the",
"encoded",
"token",
"format",
".",
"<",
"/",
"p",
"... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/csiv2/CSIv2Util.java#L649-L679 | test | Decode an initial context token. | Of course, here is the Java code you requested:
```java
public static InitialContextToken decodeInitialContextToken(byte[] encodedToken, Codec codec) {
if (encodedToken[0] != 0x60)
return null;
int encodedLength = 0;
int n = 0;
if (encodedToken[1] >= 0)
encoded... |
RestComm/jain-slee | container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/SbbAbstractClassDecorator.java | SbbAbstractClassDecorator.decorateAbstractSbb | public boolean decorateAbstractSbb() throws DeploymentException {
ClassPool pool = component.getClassPool();
String sbbAbstractClassName = component.getDescriptor().getSbbAbstractClass().getSbbAbstractClassName();
try {
sbbAbstractClass = pool.get(sbbAbstractClassName);
... | java | public boolean decorateAbstractSbb() throws DeploymentException {
ClassPool pool = component.getClassPool();
String sbbAbstractClassName = component.getDescriptor().getSbbAbstractClass().getSbbAbstractClassName();
try {
sbbAbstractClass = pool.get(sbbAbstractClassName);
... | [
"public",
"boolean",
"decorateAbstractSbb",
"(",
")",
"throws",
"DeploymentException",
"{",
"ClassPool",
"pool",
"=",
"component",
".",
"getClassPool",
"(",
")",
";",
"String",
"sbbAbstractClassName",
"=",
"component",
".",
"getDescriptor",
"(",
")",
".",
"getSbbA... | Decorate the abstract sbb Class
@return the decorated sbb abstract class | [
"Decorate",
"the",
"abstract",
"sbb",
"Class"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/SbbAbstractClassDecorator.java#L102-L153 | test | Decorate Abstract Sbb. | Of course, here is the Java code you requested:
```java
public boolean decorateAbstractSbb() throws DeploymentException {
ClassPool pool = component.getClassPool();
String sbbAbstractClassName = component.getDescriptor().getSbbAbstractClass().getSbbAbstractClassName();
try {
... |
deliveredtechnologies/rulebook | rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java | RuleBuilder.create | public static RuleBuilder<Object, Object> create() {
RuleBuilder<Object, Object> rule = new RuleBuilder<>(GoldenRule.class);
rule._factType = Object.class;
return rule;
} | java | public static RuleBuilder<Object, Object> create() {
RuleBuilder<Object, Object> rule = new RuleBuilder<>(GoldenRule.class);
rule._factType = Object.class;
return rule;
} | [
"public",
"static",
"RuleBuilder",
"<",
"Object",
",",
"Object",
">",
"create",
"(",
")",
"{",
"RuleBuilder",
"<",
"Object",
",",
"Object",
">",
"rule",
"=",
"new",
"RuleBuilder",
"<>",
"(",
"GoldenRule",
".",
"class",
")",
";",
"rule",
".",
"_factType",... | Returns a new RuleBuilder for the default Rule type.
@return a new RuleBuilder | [
"Returns",
"a",
"new",
"RuleBuilder",
"for",
"the",
"default",
"Rule",
"type",
"."
] | 253738f6bc1e7804bb8649863e969956075a19ae | https://github.com/deliveredtechnologies/rulebook/blob/253738f6bc1e7804bb8649863e969956075a19ae/rulebook-core/src/main/java/com/deliveredtechnologies/rulebook/lang/RuleBuilder.java#L66-L70 | test | Create a new instance of the GoldenRule class. | Of course, here is the Java code you requested:
```java
public static RuleBuilder<Object, Object> create() {
RuleBuilder<Object, Object> rule = new RuleBuilder<>(GoldenRule.class);
rule._factType = Object.class;
return rule;
}
```
Hope this helps! |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java | ElementEditor.getNamespaces | public static Namespaces getNamespaces(Element element) {
Assert.isNotNull(element);
Node parent = element.getParentNode();
while (parent != null && !isElement(parent))
parent = parent.getParentNode();
Namespaces namespaces = null;
if (parent != null)
name... | java | public static Namespaces getNamespaces(Element element) {
Assert.isNotNull(element);
Node parent = element.getParentNode();
while (parent != null && !isElement(parent))
parent = parent.getParentNode();
Namespaces namespaces = null;
if (parent != null)
name... | [
"public",
"static",
"Namespaces",
"getNamespaces",
"(",
"Element",
"element",
")",
"{",
"Assert",
".",
"isNotNull",
"(",
"element",
")",
";",
"Node",
"parent",
"=",
"element",
".",
"getParentNode",
"(",
")",
";",
"while",
"(",
"parent",
"!=",
"null",
"&&",... | Returns the given element's namespace declarations. The element must
not be <code>null</code>.
@param element the element whose namespace declarations are returned
@return the element's namespace declarations | [
"Returns",
"the",
"given",
"element",
"s",
"namespace",
"declarations",
".",
"The",
"element",
"must",
"not",
"be",
"<code",
">",
"null<",
"/",
"code",
">",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/dom/ElementEditor.java#L938-L947 | test | Get the namespaces of a given element. | Of course, here is the Java code you requested:
```java
public static Namespaces getNamespaces(Element element) {
Assert.isNotNull(element);
Node parent = element.getParentNode();
while (parent != null && !isElement(parent))
parent = parent.getParentNode();
Namespaces namesp... |
streamsets/datacollector | commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java | ProtobufTypeUtil.getAllFileDescriptors | public static void getAllFileDescriptors(
DescriptorProtos.FileDescriptorSet set,
Map<String, Set<Descriptors.FileDescriptor>> dependenciesMap,
Map<String, Descriptors.FileDescriptor> fileDescriptorMap
) throws StageException {
List<DescriptorProtos.FileDescriptorProto> fileList = set.getFileLis... | java | public static void getAllFileDescriptors(
DescriptorProtos.FileDescriptorSet set,
Map<String, Set<Descriptors.FileDescriptor>> dependenciesMap,
Map<String, Descriptors.FileDescriptor> fileDescriptorMap
) throws StageException {
List<DescriptorProtos.FileDescriptorProto> fileList = set.getFileLis... | [
"public",
"static",
"void",
"getAllFileDescriptors",
"(",
"DescriptorProtos",
".",
"FileDescriptorSet",
"set",
",",
"Map",
"<",
"String",
",",
"Set",
"<",
"Descriptors",
".",
"FileDescriptor",
">",
">",
"dependenciesMap",
",",
"Map",
"<",
"String",
",",
"Descrip... | Loads a Protobuf file descriptor set into an ubermap of file descriptors.
@param set FileDescriptorSet
@param dependenciesMap FileDescriptor dependency map
@param fileDescriptorMap The populated map of FileDescriptors
@throws StageException | [
"Loads",
"a",
"Protobuf",
"file",
"descriptor",
"set",
"into",
"an",
"ubermap",
"of",
"file",
"descriptors",
"."
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/commonlib/src/main/java/com/streamsets/pipeline/lib/util/ProtobufTypeUtil.java#L132-L157 | test | Get all file descriptors from a FileDescriptorSet. | Of course, here is the Java code you requested:
```java
public static void getAllFileDescriptors(
DescriptorProtos.FileDescriptorSet set,
Map<String, Set<Descriptors.FileDescriptor>> dependenciesMap,
Map<String, Descriptors.FileDescriptor> fileDescriptorMap
) throws StageException {
List<Descri... |
dschulten/hydra-java | hydra-jsonld/src/main/java/de/escalon/hypermedia/hydra/serialize/LdContextFactory.java | LdContextFactory.getAnnotatedTerms | private Map<String, Object> getAnnotatedTerms(AnnotatedElement annotatedElement, String name) {
final Terms annotatedTerms = findAnnotation(annotatedElement, Terms.class);
final Term annotatedTerm = findAnnotation(annotatedElement, Term.class);
if (annotatedTerms != null && annotatedTerm != nul... | java | private Map<String, Object> getAnnotatedTerms(AnnotatedElement annotatedElement, String name) {
final Terms annotatedTerms = findAnnotation(annotatedElement, Terms.class);
final Term annotatedTerm = findAnnotation(annotatedElement, Term.class);
if (annotatedTerms != null && annotatedTerm != nul... | [
"private",
"Map",
"<",
"String",
",",
"Object",
">",
"getAnnotatedTerms",
"(",
"AnnotatedElement",
"annotatedElement",
",",
"String",
"name",
")",
"{",
"final",
"Terms",
"annotatedTerms",
"=",
"findAnnotation",
"(",
"annotatedElement",
",",
"Terms",
".",
"class",
... | Gets explicitly defined terms, e.g. on package, class or mixin.
@param annotatedElement
to find terms
@param name
of annotated element, i.e. class name or package name
@return terms | [
"Gets",
"explicitly",
"defined",
"terms",
"e",
".",
"g",
".",
"on",
"package",
"class",
"or",
"mixin",
"."
] | 21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a | https://github.com/dschulten/hydra-java/blob/21f2ec64ed8f8294dcd7705a55477a4f85ed9d0a/hydra-jsonld/src/main/java/de/escalon/hypermedia/hydra/serialize/LdContextFactory.java#L160-L177 | test | Get annotated terms. | Of course, here is the Java code you requested:
```java
private Map<String, Object> getAnnotatedTerms(AnnotatedElement annotatedElement, String name) {
final Terms annotatedTerms = findAnnotation(annotatedElement, Terms.class);
final Term annotatedTerm = findAnnotation(annotatedElement, Term.class);
... |
OpenEstate/OpenEstate-IO | Core/src/main/java/org/openestate/io/core/NumberUtils.java | NumberUtils.printNumber | public static String printNumber(Number value, int integerDigits, int fractionDigits) {
return printNumber(value, integerDigits, fractionDigits, null);
} | java | public static String printNumber(Number value, int integerDigits, int fractionDigits) {
return printNumber(value, integerDigits, fractionDigits, null);
} | [
"public",
"static",
"String",
"printNumber",
"(",
"Number",
"value",
",",
"int",
"integerDigits",
",",
"int",
"fractionDigits",
")",
"{",
"return",
"printNumber",
"(",
"value",
",",
"integerDigits",
",",
"fractionDigits",
",",
"null",
")",
";",
"}"
] | Write a number into a string value.
@param value the number to write
@param integerDigits maximal number of integer digits
@param fractionDigits maximal number of fraction digits
@return the formatted number | [
"Write",
"a",
"number",
"into",
"a",
"string",
"value",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Core/src/main/java/org/openestate/io/core/NumberUtils.java#L139-L141 | test | Print a number. | Of course, here is the Java code you requested:
```java
public static String printNumber(Number value, int integerDigits, int fractionDigits) {
return printNumber(value, integerDigits, fractionDigits, null);
}
```
Hope this helps! |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspConfig.java | JspConfig.isJspPage | public boolean isJspPage(String uri) throws JasperException {
init();
if (jspProperties == null) {
return false;
}
String uriPath = null;
int index = uri.lastIndexOf('/');
if (index >=0 ) {
uriPath = uri.substring(0, index+1);
}
S... | java | public boolean isJspPage(String uri) throws JasperException {
init();
if (jspProperties == null) {
return false;
}
String uriPath = null;
int index = uri.lastIndexOf('/');
if (index >=0 ) {
uriPath = uri.substring(0, index+1);
}
S... | [
"public",
"boolean",
"isJspPage",
"(",
"String",
"uri",
")",
"throws",
"JasperException",
"{",
"init",
"(",
")",
";",
"if",
"(",
"jspProperties",
"==",
"null",
")",
"{",
"return",
"false",
";",
"}",
"String",
"uriPath",
"=",
"null",
";",
"int",
"index",
... | To find out if an uri matches an url pattern in jsp config. If so,
then the uri is a JSP page. This is used primarily for jspc. | [
"To",
"find",
"out",
"if",
"an",
"uri",
"matches",
"an",
"url",
"pattern",
"in",
"jsp",
"config",
".",
"If",
"so",
"then",
"the",
"uri",
"is",
"a",
"JSP",
"page",
".",
"This",
"is",
"used",
"primarily",
"for",
"jspc",
"."
] | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspConfig.java#L414-L453 | test | Check if the specified URI is a jsp page. | Of course, here is the Java code you requested:
```java
public boolean isJspPage(String uri) throws JasperException {
init();
if (jspProperties == null) {
return false;
}
String uriPath = null;
int index = uri.lastIndexOf('/');
if (index >=0 ) {
... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/util/Arith.java | Arith.round | public static float round(final float v,int scale,int roundingMode){
if(scale<0){
scale=DIV_SCALE;
}
if(roundingMode<0){
roundingMode=ROUNDING_MODE;
}
BigDecimal b = new BigDecimal(Float.toString(v));
BigDecimal one = new BigDecimal("1");
return b.divide(one,scale,rounding... | java | public static float round(final float v,int scale,int roundingMode){
if(scale<0){
scale=DIV_SCALE;
}
if(roundingMode<0){
roundingMode=ROUNDING_MODE;
}
BigDecimal b = new BigDecimal(Float.toString(v));
BigDecimal one = new BigDecimal("1");
return b.divide(one,scale,rounding... | [
"public",
"static",
"float",
"round",
"(",
"final",
"float",
"v",
",",
"int",
"scale",
",",
"int",
"roundingMode",
")",
"{",
"if",
"(",
"scale",
"<",
"0",
")",
"{",
"scale",
"=",
"DIV_SCALE",
";",
"}",
"if",
"(",
"roundingMode",
"<",
"0",
")",
"{",... | random
@param v value
@param scale scale,default is {@link #DIV_SCALE}
@param roundingMode default is {@link #ROUNDING_MODE}
@return round float | [
"random"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/Arith.java#L261-L271 | test | Round a float value. | Of course, here is the Java code you requested:
```java
public static float round(final float v,int scale,int roundingMode){
if(scale<0){
scale=DIV_SCALE;
}
if(roundingMode<0){
roundingMode=ROUNDING_MODE;
}
BigDecimal b = new BigDecimal(Float.toString(v));
BigDecimal one = new... |
streamsets/datacollector | common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java | Pattern.groupNames | public List<String> groupNames() {
if (groupNames == null) {
groupNames = new ArrayList<String>(groupInfo.keySet());
}
return groupNames;
} | java | public List<String> groupNames() {
if (groupNames == null) {
groupNames = new ArrayList<String>(groupInfo.keySet());
}
return groupNames;
} | [
"public",
"List",
"<",
"String",
">",
"groupNames",
"(",
")",
"{",
"if",
"(",
"groupNames",
"==",
"null",
")",
"{",
"groupNames",
"=",
"new",
"ArrayList",
"<",
"String",
">",
"(",
"groupInfo",
".",
"keySet",
"(",
")",
")",
";",
"}",
"return",
"groupN... | Gets the names of all capture groups
@return the list of names | [
"Gets",
"the",
"names",
"of",
"all",
"capture",
"groups"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/common/src/main/java/com/streamsets/pipeline/lib/parser/shaded/com/google/code/regexp/Pattern.java#L191-L196 | test | Gets the list of group names. | Of course, here is the Java code you requested:
```java
public List<String> groupNames() {
if (groupNames == null) {
groupNames = new ArrayList<String>(groupInfo.keySet());
}
return groupNames;
}
```
Hope this helps! |
ArpNetworking/logback-steno | src/main/java/com/arpnetworking/steno/Logger.java | Logger.warn | public void warn(
@Nullable final String event,
@Nullable final String message,
@Nullable final Map<String, Object> data,
@Nullable final Throwable throwable) {
if (getSlf4jLogger().isWarnEnabled()) {
LogLevel.WARN.log(
getSlf4jLogg... | java | public void warn(
@Nullable final String event,
@Nullable final String message,
@Nullable final Map<String, Object> data,
@Nullable final Throwable throwable) {
if (getSlf4jLogger().isWarnEnabled()) {
LogLevel.WARN.log(
getSlf4jLogg... | [
"public",
"void",
"warn",
"(",
"@",
"Nullable",
"final",
"String",
"event",
",",
"@",
"Nullable",
"final",
"String",
"message",
",",
"@",
"Nullable",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"data",
",",
"@",
"Nullable",
"final",
"Throwable",
"... | Log a message for a canonical event with supporting key-value pairs at
the warn level.
@since 1.3.0
@param event The canonical event that occurred.
@param message The message to be logged.
@param data Map of data key-value pairs.
@param throwable The exception (<code>Throwable</code>) to be logged. | [
"Log",
"a",
"message",
"for",
"a",
"canonical",
"event",
"with",
"supporting",
"key",
"-",
"value",
"pairs",
"at",
"the",
"warn",
"level",
"."
] | abd5c68ce7d42c39f80ffbad6d162d5fed3a346e | https://github.com/ArpNetworking/logback-steno/blob/abd5c68ce7d42c39f80ffbad6d162d5fed3a346e/src/main/java/com/arpnetworking/steno/Logger.java#L1132-L1149 | test | Logs a warning event. | Of course, here is the Java code you requested:
```java
public void warn(
@Nullable final String event,
@Nullable final String message,
@Nullable final Map<String, Object> data,
@Nullable final Throwable throwable) {
if (getSlf4jLogger().isWarnEnabled()) {
... |
GleasonK/android-webrtc-api | pnwebrtc/src/main/java/me/kevingleason/pnwebrtc/PnSignalingParams.java | PnSignalingParams.addIceServers | public void addIceServers(List<PeerConnection.IceServer> iceServers){
if(this.iceServers!=null) {
iceServers.addAll(this.iceServers);
}
this.iceServers = iceServers;
} | java | public void addIceServers(List<PeerConnection.IceServer> iceServers){
if(this.iceServers!=null) {
iceServers.addAll(this.iceServers);
}
this.iceServers = iceServers;
} | [
"public",
"void",
"addIceServers",
"(",
"List",
"<",
"PeerConnection",
".",
"IceServer",
">",
"iceServers",
")",
"{",
"if",
"(",
"this",
".",
"iceServers",
"!=",
"null",
")",
"{",
"iceServers",
".",
"addAll",
"(",
"this",
".",
"iceServers",
")",
";",
"}"... | Append default servers to the end of given list and set as iceServers instance variable
@param iceServers List of iceServers | [
"Append",
"default",
"servers",
"to",
"the",
"end",
"of",
"given",
"list",
"and",
"set",
"as",
"iceServers",
"instance",
"variable"
] | 1db4cf5838f1e880c327906dd01a02f82d8d329c | https://github.com/GleasonK/android-webrtc-api/blob/1db4cf5838f1e880c327906dd01a02f82d8d329c/pnwebrtc/src/main/java/me/kevingleason/pnwebrtc/PnSignalingParams.java#L145-L150 | test | Add the list of ICE servers to the ICE server list. | Of course, here is the Java code you requested:
```java
public void addIceServers(List<PeerConnection.IceServer> iceServers){
if(this.iceServers!=null) {
iceServers.addAll(this.iceServers);
}
this.iceServers = iceServers;
}
```
Hope this helps! |
oblac/jodd | jodd-bean/src/main/java/jodd/typeconverter/impl/CollectionConverter.java | CollectionConverter.convertToSingleElementCollection | protected Collection<T> convertToSingleElementCollection(final Object value) {
Collection<T> collection = createCollection(0);
//noinspection unchecked
collection.add((T) value);
return collection;
} | java | protected Collection<T> convertToSingleElementCollection(final Object value) {
Collection<T> collection = createCollection(0);
//noinspection unchecked
collection.add((T) value);
return collection;
} | [
"protected",
"Collection",
"<",
"T",
">",
"convertToSingleElementCollection",
"(",
"final",
"Object",
"value",
")",
"{",
"Collection",
"<",
"T",
">",
"collection",
"=",
"createCollection",
"(",
"0",
")",
";",
"//noinspection unchecked",
"collection",
".",
"add",
... | Creates a collection with single element. | [
"Creates",
"a",
"collection",
"with",
"single",
"element",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/typeconverter/impl/CollectionConverter.java#L132-L139 | test | Converts the given value to a collection of elements. | Of course, here is the Java code you requested:
```java
protected Collection<T> convertToSingleElementCollection(final Object value) {
Collection<T> collection = createCollection(0);
//noinspection unchecked
collection.add((T) value);
return collection;
}
```
Hope this helps! |
haducloc/appslandia-common | src/main/java/com/appslandia/common/jdbc/StatementImpl.java | StatementImpl.setBoolean2 | public void setBoolean2(String parameterName, Boolean value) throws java.sql.SQLException {
if (value == null) {
setNull(parameterName, Types.BIT);
} else {
setBoolean(parameterName, value);
}
} | java | public void setBoolean2(String parameterName, Boolean value) throws java.sql.SQLException {
if (value == null) {
setNull(parameterName, Types.BIT);
} else {
setBoolean(parameterName, value);
}
} | [
"public",
"void",
"setBoolean2",
"(",
"String",
"parameterName",
",",
"Boolean",
"value",
")",
"throws",
"java",
".",
"sql",
".",
"SQLException",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterName",
",",
"Types",
".",
"BIT",
... | Set Nullable Parameters | [
"Set",
"Nullable",
"Parameters"
] | 41dc9b0e1dd4fa86a9ad03627f70cbee61e74061 | https://github.com/haducloc/appslandia-common/blob/41dc9b0e1dd4fa86a9ad03627f70cbee61e74061/src/main/java/com/appslandia/common/jdbc/StatementImpl.java#L397-L403 | test | Sets the designated parameter to the given Java Boolean value. | Of course, here is the Java code you requested:
```java
public void setBoolean2(String parameterName, Boolean value) throws java.sql.SQLException {
if (value == null) {
setNull(parameterName, Types.BIT);
} else {
setBoolean(parameterName, value);
}
}
```
Hope this helps! |
agentsoz/jill | jill/src/main/java/io/github/agentsoz/jill/core/IntentionSelector.java | IntentionSelector.setAgentIdle | public void setAgentIdle(int agentId, boolean idle) {
// If agent is becoming active, and not already active
if (!idle /* && !activeAgents.contains(agentId) */) {
synchronized (extToAdd) {
extToAdd.add(agentId);
}
}
// If agent is becoming idle, and not already idle
if (idle /* &... | java | public void setAgentIdle(int agentId, boolean idle) {
// If agent is becoming active, and not already active
if (!idle /* && !activeAgents.contains(agentId) */) {
synchronized (extToAdd) {
extToAdd.add(agentId);
}
}
// If agent is becoming idle, and not already idle
if (idle /* &... | [
"public",
"void",
"setAgentIdle",
"(",
"int",
"agentId",
",",
"boolean",
"idle",
")",
"{",
"// If agent is becoming active, and not already active",
"if",
"(",
"!",
"idle",
"/* && !activeAgents.contains(agentId) */",
")",
"{",
"synchronized",
"(",
"extToAdd",
")",
"{",
... | and this thread is still iterating over activeagents | [
"and",
"this",
"thread",
"is",
"still",
"iterating",
"over",
"activeagents"
] | 13126fc78350465b477386132465f84cad719426 | https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/jill/src/main/java/io/github/agentsoz/jill/core/IntentionSelector.java#L361-L374 | test | Set the agent idle flag. | Of course, here is the Java code you requested:
```java
public void setAgentIdle(int agentId, boolean idle) {
// If agent is becoming active, and not already active
if (!idle /* && !activeAgents.contains(agentId) */) {
synchronized (extToAdd) {
extToAdd.add(agentId);
}
}
// If agent... |
mikolajmitura/java-properties-to-json | src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonConverter.java | PropertiesToJsonConverter.convertPropertiesFromFileToJson | public String convertPropertiesFromFileToJson(String pathToFile, String... includeDomainKeys) throws ReadInputException, ParsePropertiesException {
return convertPropertiesFromFileToJson(new File(pathToFile), includeDomainKeys);
} | java | public String convertPropertiesFromFileToJson(String pathToFile, String... includeDomainKeys) throws ReadInputException, ParsePropertiesException {
return convertPropertiesFromFileToJson(new File(pathToFile), includeDomainKeys);
} | [
"public",
"String",
"convertPropertiesFromFileToJson",
"(",
"String",
"pathToFile",
",",
"String",
"...",
"includeDomainKeys",
")",
"throws",
"ReadInputException",
",",
"ParsePropertiesException",
"{",
"return",
"convertPropertiesFromFileToJson",
"(",
"new",
"File",
"(",
... | Generate Json by given path to file with properties with only included domain keys.
@param pathToFile path to File
@param includeDomainKeys domain head keys which should be parsed to json <br>
example properties:<br>
object1.field1=value1<br>
object1.field2=value2<br>
someObject2.field2=value3<br>
filter "objec... | [
"Generate",
"Json",
"by",
"given",
"path",
"to",
"file",
"with",
"properties",
"with",
"only",
"included",
"domain",
"keys",
"."
] | 8f264a6e9e34aaba10f81ad5832dcfe821c3576d | https://github.com/mikolajmitura/java-properties-to-json/blob/8f264a6e9e34aaba10f81ad5832dcfe821c3576d/src/main/java/pl/jalokim/propertiestojson/util/PropertiesToJsonConverter.java#L107-L109 | test | Convert properties from a file to a JSON string. | Of course, here is the Java code you requested:
```java
public String convertPropertiesFromFileToJson(String pathToFile, String... includeDomainKeys) throws ReadInputException, ParsePropertiesException {
return convertPropertiesFromFileToJson(new File(pathToFile), includeDomainKeys);
}
```
Hope this helps... |
fabric8io/fabric8-maven-plugin | plugin/src/main/java/io/fabric8/maven/plugin/enricher/EnricherManager.java | EnricherManager.logEnrichers | private void logEnrichers(List<Enricher> enrichers) {
log.verbose("Enrichers:");
for (Enricher enricher : enrichers) {
log.verbose("- %s", enricher.getName());
}
} | java | private void logEnrichers(List<Enricher> enrichers) {
log.verbose("Enrichers:");
for (Enricher enricher : enrichers) {
log.verbose("- %s", enricher.getName());
}
} | [
"private",
"void",
"logEnrichers",
"(",
"List",
"<",
"Enricher",
">",
"enrichers",
")",
"{",
"log",
".",
"verbose",
"(",
"\"Enrichers:\"",
")",
";",
"for",
"(",
"Enricher",
"enricher",
":",
"enrichers",
")",
"{",
"log",
".",
"verbose",
"(",
"\"- %s\"",
"... | ============================================================================================= | [
"============================================================================================="
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/plugin/src/main/java/io/fabric8/maven/plugin/enricher/EnricherManager.java#L100-L105 | test | Log enrichers. | Of course, here is the Java code you requested:
```java
private void logEnrichers(List<Enricher> enrichers) {
log.verbose("Enrichers:");
for (Enricher enricher : enrichers) {
log.verbose("- %s", enricher.getName());
}
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ImmobilieBaseTyp.java | ImmobilieBaseTyp.getImportmodus | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public AktionsTyp getImportmodus() {
if (importmodus == null) {
return AktionsTyp.IMPORTIEREN;
} else {
return importmodus;
}
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public AktionsTyp getImportmodus() {
if (importmodus == null) {
return AktionsTyp.IMPORTIEREN;
} else {
return importmodus;
}
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:52:47+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"AktionsTyp",
"getImportmodus",
"(",
")",
"{",
"if",
"(",
"importmodus",
"==",
"null",... | Gets the value of the importmodus property.
@return
possible object is
{@link AktionsTyp } | [
"Gets",
"the",
"value",
"of",
"the",
"importmodus",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ImmobilieBaseTyp.java#L553-L560 | test | Gets the value of the importmodus property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public AktionsTyp getImportmodus() {
if (importmodus == null) {
return AktionsTyp.IMPORTIEREN;
} else {
re... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/util/queues/Queues.java | Queues.getTransactionalReQueue | public static <E> Queue<E> getTransactionalReQueue(java.util.Queue<E> queue, Collection<E> requeue)
{
return new WrapperQueue<E>(queue, requeue, true, false, false);
} | java | public static <E> Queue<E> getTransactionalReQueue(java.util.Queue<E> queue, Collection<E> requeue)
{
return new WrapperQueue<E>(queue, requeue, true, false, false);
} | [
"public",
"static",
"<",
"E",
">",
"Queue",
"<",
"E",
">",
"getTransactionalReQueue",
"(",
"java",
".",
"util",
".",
"Queue",
"<",
"E",
">",
"queue",
",",
"Collection",
"<",
"E",
">",
"requeue",
")",
"{",
"return",
"new",
"WrapperQueue",
"<",
"E",
">... | Provides a transactional requeue, that delays all queue manipulation operations until the transaction is
committed, or erases them if it is rolled back. As this is a requeue, the requeue buffer may be examined directly
and the queue fully supports browsing with iterators.
@param queue The queue to use as the underl... | [
"Provides",
"a",
"transactional",
"requeue",
"that",
"delays",
"all",
"queue",
"manipulation",
"operations",
"until",
"the",
"transaction",
"is",
"committed",
"or",
"erases",
"them",
"if",
"it",
"is",
"rolled",
"back",
".",
"As",
"this",
"is",
"a",
"requeue",
... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/util/queues/Queues.java#L159-L162 | test | Gets a transactional re - queue. | Of course, here is the Java code you requested:
```java
public static <E> Queue<E> getTransactionalReQueue(java.util.Queue<E> queue, Collection<E> requeue)
{
return new WrapperQueue<E>(queue, requeue, true, false, false);
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java | LdapAuthenticationProviderConfigurer.createLdapAuthenticator | private LdapAuthenticator createLdapAuthenticator(
BaseLdapPathContextSource contextSource) {
AbstractLdapAuthenticator ldapAuthenticator = passwordEncoder == null ? createBindAuthenticator(contextSource)
: createPasswordCompareAuthenticator(contextSource);
LdapUserSearch userSearch = createUserSearch();
i... | java | private LdapAuthenticator createLdapAuthenticator(
BaseLdapPathContextSource contextSource) {
AbstractLdapAuthenticator ldapAuthenticator = passwordEncoder == null ? createBindAuthenticator(contextSource)
: createPasswordCompareAuthenticator(contextSource);
LdapUserSearch userSearch = createUserSearch();
i... | [
"private",
"LdapAuthenticator",
"createLdapAuthenticator",
"(",
"BaseLdapPathContextSource",
"contextSource",
")",
"{",
"AbstractLdapAuthenticator",
"ldapAuthenticator",
"=",
"passwordEncoder",
"==",
"null",
"?",
"createBindAuthenticator",
"(",
"contextSource",
")",
":",
"cre... | Creates the {@link LdapAuthenticator} to use
@param contextSource the {@link BaseLdapPathContextSource} to use
@return the {@link LdapAuthenticator} to use | [
"Creates",
"the",
"{",
"@link",
"LdapAuthenticator",
"}",
"to",
"use"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/authentication/configurers/ldap/LdapAuthenticationProviderConfigurer.java#L178-L190 | test | Creates the LdapAuthenticator. | Of course, here is the Java code you requested:
```java
private LdapAuthenticator createLdapAuthenticator(
BaseLdapPathContextSource contextSource) {
AbstractLdapAuthenticator ldapAuthenticator = passwordEncoder == null ? createBindAuthenticator(contextSource)
: createPasswordCompareAuthenticator(contextSourc... |
haducloc/appslandia-common | src/main/java/com/appslandia/common/crypto/PKIUtils.java | PKIUtils.toPemEncoded | public static String toPemEncoded(byte[] der, String label) {
StringWriter pem = new StringWriter();
PrintWriter pw = new PrintWriter(pem);
pw.append("-----BEGIN ").append(label).println("-----");
pw.write(new String(Base64Delegate.getDefault().mimeEncode(der), CharsetUtils.US_ASCII));
pw.println();
pw.appe... | java | public static String toPemEncoded(byte[] der, String label) {
StringWriter pem = new StringWriter();
PrintWriter pw = new PrintWriter(pem);
pw.append("-----BEGIN ").append(label).println("-----");
pw.write(new String(Base64Delegate.getDefault().mimeEncode(der), CharsetUtils.US_ASCII));
pw.println();
pw.appe... | [
"public",
"static",
"String",
"toPemEncoded",
"(",
"byte",
"[",
"]",
"der",
",",
"String",
"label",
")",
"{",
"StringWriter",
"pem",
"=",
"new",
"StringWriter",
"(",
")",
";",
"PrintWriter",
"pw",
"=",
"new",
"PrintWriter",
"(",
"pem",
")",
";",
"pw",
... | PEM: Privacy-enhanced Electronic Mail | [
"PEM",
":",
"Privacy",
"-",
"enhanced",
"Electronic",
"Mail"
] | 41dc9b0e1dd4fa86a9ad03627f70cbee61e74061 | https://github.com/haducloc/appslandia-common/blob/41dc9b0e1dd4fa86a9ad03627f70cbee61e74061/src/main/java/com/appslandia/common/crypto/PKIUtils.java#L52-L61 | test | Encode a byte array to a PEM encoded string | Of course, here is the Java code you requested:
```java
public static String toPemEncoded(byte[] der, String label) {
StringWriter pem = new StringWriter();
PrintWriter pw = new PrintWriter(pem);
pw.append("-----BEGIN ").append(label).println("-----");
pw.write(new String(Base64Delegate.getDefault().mimeEncode... |
real-logic/aeron | aeron-cluster/src/main/java/io/aeron/cluster/service/RecoveryState.java | RecoveryState.getSnapshotRecordingId | public static long getSnapshotRecordingId(final CountersReader counters, final int counterId, final int serviceId)
{
final DirectBuffer buffer = counters.metaDataBuffer();
if (counters.getCounterState(counterId) == RECORD_ALLOCATED)
{
final int recordOffset = CountersReader.meta... | java | public static long getSnapshotRecordingId(final CountersReader counters, final int counterId, final int serviceId)
{
final DirectBuffer buffer = counters.metaDataBuffer();
if (counters.getCounterState(counterId) == RECORD_ALLOCATED)
{
final int recordOffset = CountersReader.meta... | [
"public",
"static",
"long",
"getSnapshotRecordingId",
"(",
"final",
"CountersReader",
"counters",
",",
"final",
"int",
"counterId",
",",
"final",
"int",
"serviceId",
")",
"{",
"final",
"DirectBuffer",
"buffer",
"=",
"counters",
".",
"metaDataBuffer",
"(",
")",
"... | Get the recording id of the snapshot for a service.
@param counters to search within.
@param counterId for the active recovery counter.
@param serviceId for the snapshot required.
@return the count of replay terms if found otherwise {@link Aeron#NULL_VALUE}. | [
"Get",
"the",
"recording",
"id",
"of",
"the",
"snapshot",
"for",
"a",
"service",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-cluster/src/main/java/io/aeron/cluster/service/RecoveryState.java#L260-L282 | test | Gets the snapshot recording id. | Of course, here is the Java code you requested:
```java
public static long getSnapshotRecordingId(final CountersReader counters, final int counterId, final int serviceId)
{
final DirectBuffer buffer = counters.metaDataBuffer();
if (counters.getCounterState(counterId) == RECORD_ALLOCATED)
{... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/AbstractRemotingProcessor.java | AbstractRemotingProcessor.process | @Override
public void process(RemotingContext ctx, T msg, ExecutorService defaultExecutor)
throws Exception {
ProcessTask task = new ProcessTask(ctx, msg);
if (this.getExecutor() != null) {
this.getExecut... | java | @Override
public void process(RemotingContext ctx, T msg, ExecutorService defaultExecutor)
throws Exception {
ProcessTask task = new ProcessTask(ctx, msg);
if (this.getExecutor() != null) {
this.getExecut... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"RemotingContext",
"ctx",
",",
"T",
"msg",
",",
"ExecutorService",
"defaultExecutor",
")",
"throws",
"Exception",
"{",
"ProcessTask",
"task",
"=",
"new",
"ProcessTask",
"(",
"ctx",
",",
"msg",
")",
";",
"if"... | Process the remoting command with its own executor or with the defaultExecutor if its own if null.
@param ctx
@param msg
@param defaultExecutor
@throws Exception | [
"Process",
"the",
"remoting",
"command",
"with",
"its",
"own",
"executor",
"or",
"with",
"the",
"defaultExecutor",
"if",
"its",
"own",
"if",
"null",
"."
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/AbstractRemotingProcessor.java#L87-L96 | test | Process a message. | Of course, here is the Java code you requested:
```java
@Override
public void process(RemotingContext ctx, T msg, ExecutorService defaultExecutor)
throws Exception {
ProcessTask task = new ProcessTask(ctx, msg);
if ... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/grid/GridServiceProvider.java | GridServiceProvider.setExtendIndex | static public void setExtendIndex(boolean b) {
indexFileModeOnOpen = b ? IndexExtendMode.extendwrite : IndexExtendMode.readonly;
indexFileModeOnSync = b ? IndexExtendMode.extendwrite : IndexExtendMode.readonly;
} | java | static public void setExtendIndex(boolean b) {
indexFileModeOnOpen = b ? IndexExtendMode.extendwrite : IndexExtendMode.readonly;
indexFileModeOnSync = b ? IndexExtendMode.extendwrite : IndexExtendMode.readonly;
} | [
"static",
"public",
"void",
"setExtendIndex",
"(",
"boolean",
"b",
")",
"{",
"indexFileModeOnOpen",
"=",
"b",
"?",
"IndexExtendMode",
".",
"extendwrite",
":",
"IndexExtendMode",
".",
"readonly",
";",
"indexFileModeOnSync",
"=",
"b",
"?",
"IndexExtendMode",
".",
... | Set how indexes are used for both open and sync
@param b if true, set modes to IndexExtendMode.extendwrite, else IndexExtendMode.readonly
@deprecated use setIndexFileModeOnSync and setIndexFileModeOnOpen | [
"Set",
"how",
"indexes",
"are",
"used",
"for",
"both",
"open",
"and",
"sync"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/grid/GridServiceProvider.java#L130-L133 | test | Sets whether the index should be extended. | Of course, here is the Java code you requested:
```java
static public void setExtendIndex(boolean b) {
indexFileModeOnOpen = b ? IndexExtendMode.extendwrite : IndexExtendMode.readonly;
indexFileModeOnSync = b ? IndexExtendMode.extendwrite : IndexExtendMode.readonly;
}
```
Hope this helps! |
rest-assured/rest-assured | rest-assured/src/main/java/io/restassured/RestAssured.java | RestAssured.filters | public static void filters(Filter filter, Filter... additionalFilters) {
Validate.notNull(filter, "Filter cannot be null");
RestAssured.filters.add(filter);
if (additionalFilters != null) {
Collections.addAll(RestAssured.filters, additionalFilters);
}
} | java | public static void filters(Filter filter, Filter... additionalFilters) {
Validate.notNull(filter, "Filter cannot be null");
RestAssured.filters.add(filter);
if (additionalFilters != null) {
Collections.addAll(RestAssured.filters, additionalFilters);
}
} | [
"public",
"static",
"void",
"filters",
"(",
"Filter",
"filter",
",",
"Filter",
"...",
"additionalFilters",
")",
"{",
"Validate",
".",
"notNull",
"(",
"filter",
",",
"\"Filter cannot be null\"",
")",
";",
"RestAssured",
".",
"filters",
".",
"add",
"(",
"filter"... | Add default filters to apply to each request.
@param filter The filter to add
@param additionalFilters An optional array of additional filters to add | [
"Add",
"default",
"filters",
"to",
"apply",
"to",
"each",
"request",
"."
] | 165a85b65070f5a07fe0045175613fb2c2811642 | https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L515-L521 | test | Add a filter to the RestAssured. | Of course, here is the Java code you requested:
```java
public static void filters(Filter filter, Filter... additionalFilters) {
Validate.notNull(filter, "Filter cannot be null");
RestAssured.filters.add(filter);
if (additionalFilters != null) {
Collections.addAll(RestAssured.filter... |
oblac/jodd | jodd-core/src/main/java/jodd/util/ArraysUtil.java | ArraysUtil.valuesOf | public static Boolean[] valuesOf(boolean[] array) {
Boolean[] dest = new Boolean[array.length];
for (int i = 0; i < array.length; i++) {
dest[i] = Boolean.valueOf(array[i]);
}
return dest;
} | java | public static Boolean[] valuesOf(boolean[] array) {
Boolean[] dest = new Boolean[array.length];
for (int i = 0; i < array.length; i++) {
dest[i] = Boolean.valueOf(array[i]);
}
return dest;
} | [
"public",
"static",
"Boolean",
"[",
"]",
"valuesOf",
"(",
"boolean",
"[",
"]",
"array",
")",
"{",
"Boolean",
"[",
"]",
"dest",
"=",
"new",
"Boolean",
"[",
"array",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",... | Converts to object array. | [
"Converts",
"to",
"object",
"array",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L1314-L1320 | test | Get the values of the boolean array. | Of course, here is the Java code you requested:
```java
public static Boolean[] valuesOf(boolean[] array) {
Boolean[] dest = new Boolean[array.length];
for (int i = 0; i < array.length; i++) {
dest[i] = Boolean.valueOf(array[i]);
}
return dest;
}
```
Hope this helps! |
wildfly/wildfly | iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ContainerAnalysis.java | ContainerAnalysis.escapeIRName | protected String escapeIRName(String name) {
StringBuffer b = new StringBuffer();
for (int i = 0; i < name.length(); ++i) {
char c = name.charAt(i);
if (c < 256)
b.append(c);
else
b.append("\\U").append(toHexString((int) c));
... | java | protected String escapeIRName(String name) {
StringBuffer b = new StringBuffer();
for (int i = 0; i < name.length(); ++i) {
char c = name.charAt(i);
if (c < 256)
b.append(c);
else
b.append("\\U").append(toHexString((int) c));
... | [
"protected",
"String",
"escapeIRName",
"(",
"String",
"name",
")",
"{",
"StringBuffer",
"b",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"name",
".",
"length",
"(",
")",
";",
"++",
"i",
")",
"{",
"c... | Escape non-ISO characters for an IR name. | [
"Escape",
"non",
"-",
"ISO",
"characters",
"for",
"an",
"IR",
"name",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/iiop-openjdk/src/main/java/org/wildfly/iiop/openjdk/rmi/ContainerAnalysis.java#L713-L725 | test | Escape the name of an IRA. | Of course, here is the Java code you requested:
```java
protected String escapeIRName(String name) {
StringBuffer b = new StringBuffer();
for (int i = 0; i < name.length(); ++i) {
char c = name.charAt(i);
if (c < 256)
b.append(c);
else
... |
Unidata/thredds | legacy/src/main/java/thredds/catalog/parser/jdom/InvCatalogFactory10.java | InvCatalogFactory10.writeXML | public void writeXML(InvCatalogImpl catalog, OutputStream os, boolean raw) throws IOException {
this.raw = raw;
writeXML(catalog, os);
this.raw = false;
} | java | public void writeXML(InvCatalogImpl catalog, OutputStream os, boolean raw) throws IOException {
this.raw = raw;
writeXML(catalog, os);
this.raw = false;
} | [
"public",
"void",
"writeXML",
"(",
"InvCatalogImpl",
"catalog",
",",
"OutputStream",
"os",
",",
"boolean",
"raw",
")",
"throws",
"IOException",
"{",
"this",
".",
"raw",
"=",
"raw",
";",
"writeXML",
"(",
"catalog",
",",
"os",
")",
";",
"this",
".",
"raw",... | Write the catalog as an XML document to the specified stream.
@param catalog write this catalog
@param os write to this OutputStream
@param raw write raw file if true (for server configuration)
@throws IOException | [
"Write",
"the",
"catalog",
"as",
"an",
"XML",
"document",
"to",
"the",
"specified",
"stream",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/parser/jdom/InvCatalogFactory10.java#L1475-L1479 | test | Write the XML content of the catalog to the OutputStream. | Of course, here is the Java code you requested:
```java
public void writeXML(InvCatalogImpl catalog, OutputStream os, boolean raw) throws IOException {
this.raw = raw;
writeXML(catalog, os);
this.raw = false;
}
```
Hope this helps! |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/GenericsReader.java | GenericsReader.parseSignatureForGenerics | public Map<String, String> parseSignatureForGenerics(final String signature, final boolean isInterface) {
if (signature == null) {
return Collections.emptyMap();
}
final Map<String, String> genericsMap = new HashMap<>();
SignatureReader sr = new SignatureReader(signature);
StringBuilder sb = new StringB... | java | public Map<String, String> parseSignatureForGenerics(final String signature, final boolean isInterface) {
if (signature == null) {
return Collections.emptyMap();
}
final Map<String, String> genericsMap = new HashMap<>();
SignatureReader sr = new SignatureReader(signature);
StringBuilder sb = new StringB... | [
"public",
"Map",
"<",
"String",
",",
"String",
">",
"parseSignatureForGenerics",
"(",
"final",
"String",
"signature",
",",
"final",
"boolean",
"isInterface",
")",
"{",
"if",
"(",
"signature",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyMap",
... | Parses signature for generic information and returns a map where key is generic name
and value is raw type. Returns an empty map if signature does not define any generics. | [
"Parses",
"signature",
"for",
"generic",
"information",
"and",
"returns",
"a",
"map",
"where",
"key",
"is",
"generic",
"name",
"and",
"value",
"is",
"raw",
"type",
".",
"Returns",
"an",
"empty",
"map",
"if",
"signature",
"does",
"not",
"define",
"any",
"ge... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/GenericsReader.java#L44-L76 | test | Parses a signature and returns a map of generics to be used in the trace. | Of course, here is the Java code you requested:
```java
public Map<String, String> parseSignatureForGenerics(final String signature, final boolean isInterface) {
if (signature == null) {
return Collections.emptyMap();
}
final Map<String, String> genericsMap = new HashMap<>();
SignatureReader sr = new Sig... |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.apply | @NonNull
static <T, U, R> R apply(@NonNull BiFunction<T, U, R> f, @NonNull T t, @NonNull U u) {
try {
return f.apply(t, u);
} catch (Throwable ex) {
throw ExceptionHelper.wrapOrThrow(ex);
}
} | java | @NonNull
static <T, U, R> R apply(@NonNull BiFunction<T, U, R> f, @NonNull T t, @NonNull U u) {
try {
return f.apply(t, u);
} catch (Throwable ex) {
throw ExceptionHelper.wrapOrThrow(ex);
}
} | [
"@",
"NonNull",
"static",
"<",
"T",
",",
"U",
",",
"R",
">",
"R",
"apply",
"(",
"@",
"NonNull",
"BiFunction",
"<",
"T",
",",
"U",
",",
"R",
">",
"f",
",",
"@",
"NonNull",
"T",
"t",
",",
"@",
"NonNull",
"U",
"u",
")",
"{",
"try",
"{",
"retur... | Wraps the call to the function in try-catch and propagates thrown
checked exceptions as RuntimeException.
@param <T> the first input type
@param <U> the second input type
@param <R> the output type
@param f the function to call, not null (not verified)
@param t the first parameter value to the function
@param u the sec... | [
"Wraps",
"the",
"call",
"to",
"the",
"function",
"in",
"try",
"-",
"catch",
"and",
"propagates",
"thrown",
"checked",
"exceptions",
"as",
"RuntimeException",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L1285-L1292 | test | Apply a binary function to a single object. | Of course, here is the Java code you requested:
```java
@NonNull
static <T, U, R> R apply(@NonNull BiFunction<T, U, R> f, @NonNull T t, @NonNull U u) {
try {
return f.apply(t, u);
} catch (Throwable ex) {
throw ExceptionHelper.wrapOrThrow(ex);
}
}
```
Hope this ... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/proxetta/asm/InvokeReplacerMethodAdapter.java | InvokeReplacerMethodAdapter.appendArgument | protected static String appendArgument(final String desc, final String type) {
int ndx = desc.indexOf(')');
return desc.substring(0, ndx) + type + desc.substring(ndx);
} | java | protected static String appendArgument(final String desc, final String type) {
int ndx = desc.indexOf(')');
return desc.substring(0, ndx) + type + desc.substring(ndx);
} | [
"protected",
"static",
"String",
"appendArgument",
"(",
"final",
"String",
"desc",
",",
"final",
"String",
"type",
")",
"{",
"int",
"ndx",
"=",
"desc",
".",
"indexOf",
"(",
"'",
"'",
")",
";",
"return",
"desc",
".",
"substring",
"(",
"0",
",",
"ndx",
... | Appends argument to the existing description. | [
"Appends",
"argument",
"to",
"the",
"existing",
"description",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/proxetta/asm/InvokeReplacerMethodAdapter.java#L348-L351 | test | Append an argument to the description. | Of course, here is the Java code you requested:
```java
protected static String appendArgument(final String desc, final String type) {
int ndx = desc.indexOf(')');
return desc.substring(0, ndx) + type + desc.substring(ndx);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/SortingStationPointFeatureCache.java | SortingStationPointFeatureCache.getStationFeatureCopyFactory | private StationFeatureCopyFactory getStationFeatureCopyFactory(StationPointFeature proto) throws IOException {
if (stationFeatCopyFactory == null) {
synchronized (this) {
if (stationFeatCopyFactory == null) {
stationFeatCopyFactory = createStationFeatureCopyFactor... | java | private StationFeatureCopyFactory getStationFeatureCopyFactory(StationPointFeature proto) throws IOException {
if (stationFeatCopyFactory == null) {
synchronized (this) {
if (stationFeatCopyFactory == null) {
stationFeatCopyFactory = createStationFeatureCopyFactor... | [
"private",
"StationFeatureCopyFactory",
"getStationFeatureCopyFactory",
"(",
"StationPointFeature",
"proto",
")",
"throws",
"IOException",
"{",
"if",
"(",
"stationFeatCopyFactory",
"==",
"null",
")",
"{",
"synchronized",
"(",
"this",
")",
"{",
"if",
"(",
"stationFeatC... | Double-check idiom for lazy initialization of instance fields. See Effective Java 2nd Ed, p. 283. | [
"Double",
"-",
"check",
"idiom",
"for",
"lazy",
"initialization",
"of",
"instance",
"fields",
".",
"See",
"Effective",
"Java",
"2nd",
"Ed",
"p",
".",
"283",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/SortingStationPointFeatureCache.java#L82-L93 | test | Get the StationFeatureCopyFactory. | Of course, here is the Java code you requested:
```java
private StationFeatureCopyFactory getStationFeatureCopyFactory(StationPointFeature proto) throws IOException {
if (stationFeatCopyFactory == null) {
synchronized (this) {
if (stationFeatCopyFactory == null) {
... |
oblac/jodd | jodd-db/src/main/java/jodd/db/DbQueryBase.java | DbQueryBase.getGeneratedColumns | public ResultSet getGeneratedColumns() {
checkInitialized();
if (generatedColumns == null) {
throw new DbSqlException(this, "No column is specified as auto-generated");
}
final ResultSet rs;
try {
rs = statement.getGeneratedKeys();
} catch (SQLException sex) {
throw new DbSqlException(this, "No gen... | java | public ResultSet getGeneratedColumns() {
checkInitialized();
if (generatedColumns == null) {
throw new DbSqlException(this, "No column is specified as auto-generated");
}
final ResultSet rs;
try {
rs = statement.getGeneratedKeys();
} catch (SQLException sex) {
throw new DbSqlException(this, "No gen... | [
"public",
"ResultSet",
"getGeneratedColumns",
"(",
")",
"{",
"checkInitialized",
"(",
")",
";",
"if",
"(",
"generatedColumns",
"==",
"null",
")",
"{",
"throw",
"new",
"DbSqlException",
"(",
"this",
",",
"\"No column is specified as auto-generated\"",
")",
";",
"}"... | Returns generated columns. | [
"Returns",
"generated",
"columns",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/DbQueryBase.java#L902-L916 | test | Returns a ResultSet containing the columns that were generated by the database. | Of course, here is the Java code you requested:
```java
public ResultSet getGeneratedColumns() {
checkInitialized();
if (generatedColumns == null) {
throw new DbSqlException(this, "No column is specified as auto-generated");
}
final ResultSet rs;
try {
rs = statement.getGeneratedKeys();
} catch (SQLE... |
Unidata/thredds | tds/src/main/java/thredds/server/admin/HtmlWriting.java | HtmlWriting.writeDirectory | public int writeDirectory(HttpServletResponse res, File dir, String path) throws IOException {
// error checking
if (dir == null) {
res.sendError(HttpServletResponse.SC_NOT_FOUND);
return 0;
}
if (!dir.exists() || !dir.isDirectory()) {
res.sendError(HttpServletResponse.SC_NOT_FOUND);
... | java | public int writeDirectory(HttpServletResponse res, File dir, String path) throws IOException {
// error checking
if (dir == null) {
res.sendError(HttpServletResponse.SC_NOT_FOUND);
return 0;
}
if (!dir.exists() || !dir.isDirectory()) {
res.sendError(HttpServletResponse.SC_NOT_FOUND);
... | [
"public",
"int",
"writeDirectory",
"(",
"HttpServletResponse",
"res",
",",
"File",
"dir",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"// error checking",
"if",
"(",
"dir",
"==",
"null",
")",
"{",
"res",
".",
"sendError",
"(",
"HttpServletRespons... | Write a file directory.
@param res the HttpServletResponse on which to write the file directory response.
@param dir directory
@param path the URL path reletive to the base
@return the number of characters (Unicode code units) in the response.
@throws java.io.IOException if an I/O exception occurs. | [
"Write",
"a",
"file",
"directory",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/admin/HtmlWriting.java#L180-L202 | test | Write directory to response | Of course, here is the Java code you requested:
```java
public int writeDirectory(HttpServletResponse res, File dir, String path) throws IOException {
// error checking
if (dir == null) {
res.sendError(HttpServletResponse.SC_NOT_FOUND);
return 0;
}
if (!dir.exists() || !dir.isDirectory()) ... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/component/RootPackages.java | RootPackages.findPackagePathForActionPackage | public String findPackagePathForActionPackage(final String actionPackage) {
if (packages == null) {
return null;
}
if (packagePaths == null) {
packagePaths = new HashMap<>();
}
String packagePath = packagePaths.get(actionPackage);
if (packagePath != null) {
return packagePath;
}
int ndx = -1;... | java | public String findPackagePathForActionPackage(final String actionPackage) {
if (packages == null) {
return null;
}
if (packagePaths == null) {
packagePaths = new HashMap<>();
}
String packagePath = packagePaths.get(actionPackage);
if (packagePath != null) {
return packagePath;
}
int ndx = -1;... | [
"public",
"String",
"findPackagePathForActionPackage",
"(",
"final",
"String",
"actionPackage",
")",
"{",
"if",
"(",
"packages",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"packagePaths",
"==",
"null",
")",
"{",
"packagePaths",
"=",
"new"... | Finds mapping for given action class. Returns <code>null</code>
if no mapping is found. If there is more then one matching root
package, the closest one will be returned. | [
"Finds",
"mapping",
"for",
"given",
"action",
"class",
".",
"Returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"no",
"mapping",
"is",
"found",
".",
"If",
"there",
"is",
"more",
"then",
"one",
"matching",
"root",
"package",
"the",
"closest",
"one",... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/component/RootPackages.java#L153-L205 | test | Find the package path for the action package. | Of course, here is the Java code you requested:
```java
public String findPackagePathForActionPackage(final String actionPackage) {
if (packages == null) {
return null;
}
if (packagePaths == null) {
packagePaths = new HashMap<>();
}
String packagePath = packagePaths.get(actionPackage);
if (packagePa... |
RuedigerMoeller/fast-serialization | src/main/java/org/nustaq/serialization/simpleapi/OffHeapCoder.java | OffHeapCoder.toMemory | public int toMemory(Object o, long address, int availableSize) throws IOException {
out.resetForReUse();
writeTarget.setBase(address, availableSize);
out.writeObject(o);
int written = out.getWritten();
return written;
} | java | public int toMemory(Object o, long address, int availableSize) throws IOException {
out.resetForReUse();
writeTarget.setBase(address, availableSize);
out.writeObject(o);
int written = out.getWritten();
return written;
} | [
"public",
"int",
"toMemory",
"(",
"Object",
"o",
",",
"long",
"address",
",",
"int",
"availableSize",
")",
"throws",
"IOException",
"{",
"out",
".",
"resetForReUse",
"(",
")",
";",
"writeTarget",
".",
"setBase",
"(",
"address",
",",
"availableSize",
")",
"... | throws FSTBufferTooSmallException in case object does not fit into given range
@param o
@param address
@param availableSize
@throws IOException
@return number of bytes written to the memory region | [
"throws",
"FSTBufferTooSmallException",
"in",
"case",
"object",
"does",
"not",
"fit",
"into",
"given",
"range"
] | 59f8f800b79479d0b9c80901cf55903d9b027f26 | https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/simpleapi/OffHeapCoder.java#L121-L127 | test | Write an object to memory. | Of course, here is the Java code you requested:
```java
public int toMemory(Object o, long address, int availableSize) throws IOException {
out.resetForReUse();
writeTarget.setBase(address, availableSize);
out.writeObject(o);
int written = out.getWritten();
return written;
}... |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OMicroTransaction.java | OMicroTransaction.rollback | public void rollback() {
if (!active)
throw error("Inactive micro-transaction on rollback");
if (level < 1)
throw error("Unbalanced micro-transaction, level = " + level);
--level;
if (level == 0) {
active = false;
doRollback();
}
} | java | public void rollback() {
if (!active)
throw error("Inactive micro-transaction on rollback");
if (level < 1)
throw error("Unbalanced micro-transaction, level = " + level);
--level;
if (level == 0) {
active = false;
doRollback();
}
} | [
"public",
"void",
"rollback",
"(",
")",
"{",
"if",
"(",
"!",
"active",
")",
"throw",
"error",
"(",
"\"Inactive micro-transaction on rollback\"",
")",
";",
"if",
"(",
"level",
"<",
"1",
")",
"throw",
"error",
"(",
"\"Unbalanced micro-transaction, level = \"",
"+"... | Rollbacks the micro-transaction if it's a top-level micro-transaction. | [
"Rollbacks",
"the",
"micro",
"-",
"transaction",
"if",
"it",
"s",
"a",
"top",
"-",
"level",
"micro",
"-",
"transaction",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/OMicroTransaction.java#L175-L187 | test | Rollback the current micro - transaction. | Of course, here is the Java code you requested:
```java
public void rollback() {
if (!active)
throw error("Inactive micro-transaction on rollback");
if (level < 1)
throw error("Unbalanced micro-transaction, level = " + level);
--level;
if (level == 0) {
active = false;
doRollb... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/gempak/GempakSoundingFileReader.java | GempakSoundingFileReader.makeHeader | private String makeHeader(GempakStation stn, String date) {
StringBuilder builder = new StringBuilder();
builder.append("STID = ");
builder.append(StringUtil2.padRight((stn.getSTID().trim()
+ stn.getSTD2().trim()), 8));
builder.append("\t");
builder.append("STNM = ");
builder.... | java | private String makeHeader(GempakStation stn, String date) {
StringBuilder builder = new StringBuilder();
builder.append("STID = ");
builder.append(StringUtil2.padRight((stn.getSTID().trim()
+ stn.getSTD2().trim()), 8));
builder.append("\t");
builder.append("STNM = ");
builder.... | [
"private",
"String",
"makeHeader",
"(",
"GempakStation",
"stn",
",",
"String",
"date",
")",
"{",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"builder",
".",
"append",
"(",
"\"STID = \"",
")",
";",
"builder",
".",
"append",
"(",
... | Make the header for the text report
@param stn the station
@param date the date
@return the header | [
"Make",
"the",
"header",
"for",
"the",
"text",
"report"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakSoundingFileReader.java#L322-L344 | test | Creates a header string from a GempakStation object. | Of course, here is the Java code you requested:
```java
private String makeHeader(GempakStation stn, String date) {
StringBuilder builder = new StringBuilder();
builder.append("STID = ");
builder.append(StringUtil2.padRight((stn.getSTID().trim()
+ stn.getSTD2().trim()), 8));
builder.ap... |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/op/NcmlEditor.java | NcmlEditor.checkNcml | private void checkNcml(Formatter f) {
if (ncmlLocation == null) { return; }
try {
NetcdfDataset ncd = NetcdfDataset.openDataset(ncmlLocation);
ncd.check(f);
}
catch (IOException ioe) {
JOptionPane.showMessageDialog(this, "ERROR: " + ioe.getMessage());... | java | private void checkNcml(Formatter f) {
if (ncmlLocation == null) { return; }
try {
NetcdfDataset ncd = NetcdfDataset.openDataset(ncmlLocation);
ncd.check(f);
}
catch (IOException ioe) {
JOptionPane.showMessageDialog(this, "ERROR: " + ioe.getMessage());... | [
"private",
"void",
"checkNcml",
"(",
"Formatter",
"f",
")",
"{",
"if",
"(",
"ncmlLocation",
"==",
"null",
")",
"{",
"return",
";",
"}",
"try",
"{",
"NetcdfDataset",
"ncd",
"=",
"NetcdfDataset",
".",
"openDataset",
"(",
"ncmlLocation",
")",
";",
"ncd",
".... | Read text from textArea through NcMLReader
then write it back out via resulting dataset | [
"Read",
"text",
"from",
"textArea",
"through",
"NcMLReader",
"then",
"write",
"it",
"back",
"out",
"via",
"resulting",
"dataset"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/op/NcmlEditor.java#L377-L388 | test | check NCML file | Of course, here is the Java code you requested:
```java
private void checkNcml(Formatter f) {
if (ncmlLocation == null) { return; }
try {
NetcdfDataset ncd = NetcdfDataset.openDataset(ncmlLocation);
ncd.check(f);
}
catch (IOException ioe) {
JOptionPa... |
wildfly/wildfly | webservices/server-integration/src/main/java/org/jboss/as/webservices/util/WebMetaDataHelper.java | WebMetaDataHelper.getServlets | public static JBossServletsMetaData getServlets(final JBossWebMetaData jbossWebMD) {
JBossServletsMetaData servletsMD = jbossWebMD.getServlets();
if (servletsMD == null) {
servletsMD = new JBossServletsMetaData();
jbossWebMD.setServlets(servletsMD);
}
return ser... | java | public static JBossServletsMetaData getServlets(final JBossWebMetaData jbossWebMD) {
JBossServletsMetaData servletsMD = jbossWebMD.getServlets();
if (servletsMD == null) {
servletsMD = new JBossServletsMetaData();
jbossWebMD.setServlets(servletsMD);
}
return ser... | [
"public",
"static",
"JBossServletsMetaData",
"getServlets",
"(",
"final",
"JBossWebMetaData",
"jbossWebMD",
")",
"{",
"JBossServletsMetaData",
"servletsMD",
"=",
"jbossWebMD",
".",
"getServlets",
"(",
")",
";",
"if",
"(",
"servletsMD",
"==",
"null",
")",
"{",
"ser... | Gets servlets meta data from jboss web meta data. If not found it creates new servlets meta data and associates them
with jboss web meta data.
@param jbossWebMD jboss web meta data
@return servlets meta data | [
"Gets",
"servlets",
"meta",
"data",
"from",
"jboss",
"web",
"meta",
"data",
".",
"If",
"not",
"found",
"it",
"creates",
"new",
"servlets",
"meta",
"data",
"and",
"associates",
"them",
"with",
"jboss",
"web",
"meta",
"data",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/util/WebMetaDataHelper.java#L129-L138 | test | Gets the servlets. | Of course, here is the Java code you requested:
```java
public static JBossServletsMetaData getServlets(final JBossWebMetaData jbossWebMD) {
JBossServletsMetaData servletsMD = jbossWebMD.getServlets();
if (servletsMD == null) {
servletsMD = new JBossServletsMetaData();
jbossWeb... |
rupertlssmith/lojix | lojix/text_model/src/main/com/thesett/text/impl/model/NestedTextGridImpl.java | NestedTextGridImpl.createTable | public TextTableModel createTable(int c, int r, int w, int h)
{
return parent.createTable(c + column, r + row, w, h);
} | java | public TextTableModel createTable(int c, int r, int w, int h)
{
return parent.createTable(c + column, r + row, w, h);
} | [
"public",
"TextTableModel",
"createTable",
"(",
"int",
"c",
",",
"int",
"r",
",",
"int",
"w",
",",
"int",
"h",
")",
"{",
"return",
"parent",
".",
"createTable",
"(",
"c",
"+",
"column",
",",
"r",
"+",
"row",
",",
"w",
",",
"h",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/text_model/src/main/com/thesett/text/impl/model/NestedTextGridImpl.java#L94-L97 | test | Create a new table with the specified columns and rows. | Of course, here is the Java code you requested:
```java
public TextTableModel createTable(int c, int r, int w, int h)
{
return parent.createTable(c + column, r + row, w, h);
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createMonatlichekostenbrutto | @XmlElementDecl(namespace = "", name = "monatlichekostenbrutto")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createMonatlichekostenbrutto(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Monatlichekostenbrutto_QNAME, BigDecimal.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "monatlichekostenbrutto")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createMonatlichekostenbrutto(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Monatlichekostenbrutto_QNAME, BigDecimal.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"monatlichekostenbrutto\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter2",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"BigDecimal",
">",
"createMonatlichekostenbrutto",
"(",
"BigDecima... | Create an instance of {@link JAXBElement }{@code <}{@link BigDecimal }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"BigDecimal",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java#L1695-L1699 | test | Create an instance of the Monatlichekostenbrutto JAXBElement. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "monatlichekostenbrutto")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createMonatlichekostenbrutto(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Monatlichekostenbrutto_QNAME,... |
RestComm/jain-slee | container/common/src/main/java/org/mobicents/slee/container/management/jmx/DeploymentMBeanImpl.java | DeploymentMBeanImpl.getDescriptor | public DeployableUnitDescriptor getDescriptor(
DeployableUnitID deployableUnitID) throws NullPointerException,
UnrecognizedDeployableUnitException, ManagementException {
if (deployableUnitID == null)
throw new NullPointerException(
"deployableUnitID should not be null");
DeployableUnitDescriptor dud... | java | public DeployableUnitDescriptor getDescriptor(
DeployableUnitID deployableUnitID) throws NullPointerException,
UnrecognizedDeployableUnitException, ManagementException {
if (deployableUnitID == null)
throw new NullPointerException(
"deployableUnitID should not be null");
DeployableUnitDescriptor dud... | [
"public",
"DeployableUnitDescriptor",
"getDescriptor",
"(",
"DeployableUnitID",
"deployableUnitID",
")",
"throws",
"NullPointerException",
",",
"UnrecognizedDeployableUnitException",
",",
"ManagementException",
"{",
"if",
"(",
"deployableUnitID",
"==",
"null",
")",
"throw",
... | /*
(non-Javadoc)
@see javax.slee.management.DeploymentMBean#getDescriptor(javax.slee.management.DeployableUnitID) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/common/src/main/java/org/mobicents/slee/container/management/jmx/DeploymentMBeanImpl.java#L766-L795 | test | Get the DeployableUnitDescriptor for the given deployable unit ID. | Of course, here is the Java code you requested:
```java
public DeployableUnitDescriptor getDescriptor(
DeployableUnitID deployableUnitID) throws NullPointerException,
UnrecognizedDeployableUnitException, ManagementException {
if (deployableUnitID == null)
throw new NullPointerException(
"deployableUni... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/projection/sat/GEOSTransform.java | GEOSTransform.sweepAngleAxisToScanGeom | public static String sweepAngleAxisToScanGeom(String sweepAngleAxis) {
String scanGeom = GOES;
if (sweepAngleAxis.equals("y")) {
scanGeom = GEOS;
}
return scanGeom;
} | java | public static String sweepAngleAxisToScanGeom(String sweepAngleAxis) {
String scanGeom = GOES;
if (sweepAngleAxis.equals("y")) {
scanGeom = GEOS;
}
return scanGeom;
} | [
"public",
"static",
"String",
"sweepAngleAxisToScanGeom",
"(",
"String",
"sweepAngleAxis",
")",
"{",
"String",
"scanGeom",
"=",
"GOES",
";",
"if",
"(",
"sweepAngleAxis",
".",
"equals",
"(",
"\"y\"",
")",
")",
"{",
"scanGeom",
"=",
"GEOS",
";",
"}",
"return",... | Find scan geometry associated with sweep_angle_axis
@param sweepAngleAxis sweep_angle_axis (x or y)
@return scan_geom scanning geometry (GOES or GEOS) | [
"Find",
"scan",
"geometry",
"associated",
"with",
"sweep_angle_axis"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/projection/sat/GEOSTransform.java#L364-L372 | test | Convert sweepAngleAxis to scan geom | Of course, here is the Java code you requested:
```java
public static String sweepAngleAxisToScanGeom(String sweepAngleAxis) {
String scanGeom = GOES;
if (sweepAngleAxis.equals("y")) {
scanGeom = GEOS;
}
return scanGeom;
}
```
Hope this helps! |
marklogic/marklogic-jena | marklogic-jena/src/main/java/com/marklogic/semantics/jena/MarkLogicDatasetGraph.java | MarkLogicDatasetGraph.mergeGraph | public void mergeGraph(Node graphName, Graph graph) {
checkIsOpen();
sync();
client.mergeGraph(graphName.getURI(), graph);
} | java | public void mergeGraph(Node graphName, Graph graph) {
checkIsOpen();
sync();
client.mergeGraph(graphName.getURI(), graph);
} | [
"public",
"void",
"mergeGraph",
"(",
"Node",
"graphName",
",",
"Graph",
"graph",
")",
"{",
"checkIsOpen",
"(",
")",
";",
"sync",
"(",
")",
";",
"client",
".",
"mergeGraph",
"(",
"graphName",
".",
"getURI",
"(",
")",
",",
"graph",
")",
";",
"}"
] | Merges triples into a graph on the MarkLogic server. mergeGraph() is NOT
part of Jena's DatasetGraph interface.
@param graphName
The graph to merge with server state.
@param graph
The graph data. | [
"Merges",
"triples",
"into",
"a",
"graph",
"on",
"the",
"MarkLogic",
"server",
".",
"mergeGraph",
"()",
"is",
"NOT",
"part",
"of",
"Jena",
"s",
"DatasetGraph",
"interface",
"."
] | c083f5c45e55036f5b0985aabe75e9206ba0cf9e | https://github.com/marklogic/marklogic-jena/blob/c083f5c45e55036f5b0985aabe75e9206ba0cf9e/marklogic-jena/src/main/java/com/marklogic/semantics/jena/MarkLogicDatasetGraph.java#L435-L439 | test | Merge a graph into a single node. | Of course, here is the Java code you requested:
```java
public void mergeGraph(Node graphName, Graph graph) {
checkIsOpen();
sync();
client.mergeGraph(graphName.getURI(), graph);
}
```
Hope this helps! |
jboss/jboss-common-core | src/main/java/org/jboss/util/threadpool/BlockingMode.java | BlockingMode.readResolve | Object readResolve() throws ObjectStreamException
{
// Replace the marshalled instance type with the local instance
BlockingMode mode = ABORT;
switch( type )
{
case RUN_TYPE:
mode = RUN;
break;
case WAIT_TYPE:
mode = RUN;
break... | java | Object readResolve() throws ObjectStreamException
{
// Replace the marshalled instance type with the local instance
BlockingMode mode = ABORT;
switch( type )
{
case RUN_TYPE:
mode = RUN;
break;
case WAIT_TYPE:
mode = RUN;
break... | [
"Object",
"readResolve",
"(",
")",
"throws",
"ObjectStreamException",
"{",
"// Replace the marshalled instance type with the local instance",
"BlockingMode",
"mode",
"=",
"ABORT",
";",
"switch",
"(",
"type",
")",
"{",
"case",
"RUN_TYPE",
":",
"mode",
"=",
"RUN",
";",
... | Overriden to return the indentity instance of BlockingMode based on the
stream type int value. This ensures that BlockingMode enums can be
compared using ==.
@return The BlockingMode instance for the XXX_TYPE int.
@throws ObjectStreamException | [
"Overriden",
"to",
"return",
"the",
"indentity",
"instance",
"of",
"BlockingMode",
"based",
"on",
"the",
"stream",
"type",
"int",
"value",
".",
"This",
"ensures",
"that",
"BlockingMode",
"enums",
"can",
"be",
"compared",
"using",
"==",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/threadpool/BlockingMode.java#L120-L143 | test | This method is called by the ObjectStreamImpl. readResolve method. | Of course, here is the Java code you requested:
```java
Object readResolve() throws ObjectStreamException
{
// Replace the marshalled instance type with the local instance
BlockingMode mode = ABORT;
switch( type )
{
case RUN_TYPE:
mode = RUN;
break;
... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/ImageUrlRewriter.java | ImageUrlRewriter.computeNewImageLocation | private String computeNewImageLocation(final String cssUri, final String imageUrl) {
LOG.debug("cssUri: {}, imageUrl {}", cssUri, imageUrl);
final String cleanImageUrl = cleanImageUrl(imageUrl);
// TODO move to ServletContextUriLocator as a helper method?
// for the following input: /a/b/c/1.css => /a/b... | java | private String computeNewImageLocation(final String cssUri, final String imageUrl) {
LOG.debug("cssUri: {}, imageUrl {}", cssUri, imageUrl);
final String cleanImageUrl = cleanImageUrl(imageUrl);
// TODO move to ServletContextUriLocator as a helper method?
// for the following input: /a/b/c/1.css => /a/b... | [
"private",
"String",
"computeNewImageLocation",
"(",
"final",
"String",
"cssUri",
",",
"final",
"String",
"imageUrl",
")",
"{",
"LOG",
".",
"debug",
"(",
"\"cssUri: {}, imageUrl {}\"",
",",
"cssUri",
",",
"imageUrl",
")",
";",
"final",
"String",
"cleanImageUrl",
... | Concatenates cssUri and imageUrl after few changes are applied to both input parameters.
@param cssUri
the URI of css resource.
@param imageUrl
the URL of image referred in css.
@return processed new location of image url. | [
"Concatenates",
"cssUri",
"and",
"imageUrl",
"after",
"few",
"changes",
"are",
"applied",
"to",
"both",
"input",
"parameters",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/model/resource/processor/support/ImageUrlRewriter.java#L174-L199 | test | Compute the new image location for the cssUri and imageUrl. | Of course, here is the Java code you requested:
```java
private String computeNewImageLocation(final String cssUri, final String imageUrl) {
LOG.debug("cssUri: {}, imageUrl {}", cssUri, imageUrl);
final String cleanImageUrl = cleanImageUrl(imageUrl);
// TODO move to ServletContextUriLocator as a helper met... |
oaqa/baseqa | src/main/java/edu/cmu/lti/oaqa/type/retrieval/Search.java | Search.setQuery | public void setQuery(String v) {
if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_query == null)
jcasType.jcas.throwFeatMissing("query", "edu.cmu.lti.oaqa.type.retrieval.Search");
jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jcasType).casFeatCode_query, v);} | java | public void setQuery(String v) {
if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_query == null)
jcasType.jcas.throwFeatMissing("query", "edu.cmu.lti.oaqa.type.retrieval.Search");
jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jcasType).casFeatCode_query, v);} | [
"public",
"void",
"setQuery",
"(",
"String",
"v",
")",
"{",
"if",
"(",
"Search_Type",
".",
"featOkTst",
"&&",
"(",
"(",
"Search_Type",
")",
"jcasType",
")",
".",
"casFeat_query",
"==",
"null",
")",
"jcasType",
".",
"jcas",
".",
"throwFeatMissing",
"(",
"... | setter for query - sets The query in the native syntax of the corresponding search engine.
@generated
@param v value to set into the feature | [
"setter",
"for",
"query",
"-",
"sets",
"The",
"query",
"in",
"the",
"native",
"syntax",
"of",
"the",
"corresponding",
"search",
"engine",
"."
] | 6ea632d8e51e3e617d4876fc1185c49be0ad7eb8 | https://github.com/oaqa/baseqa/blob/6ea632d8e51e3e617d4876fc1185c49be0ad7eb8/src/main/java/edu/cmu/lti/oaqa/type/retrieval/Search.java#L84-L87 | test | setter for query - sets | Of course, here is the Java code you requested:
```java
public void setQuery(String v) {
if (Search_Type.featOkTst && ((Search_Type)jcasType).casFeat_query == null)
jcasType.jcas.throwFeatMissing("query", "edu.cmu.lti.oaqa.type.retrieval.Search");
jcasType.ll_cas.ll_setStringValue(addr, ((Search_Type)jca... |
OpenEstate/OpenEstate-IO | Examples/src/main/java/org/openestate/io/examples/TrovitWritingExample.java | TrovitWritingExample.createPicture | protected static PictureType createPicture(int pos) {
try {
PictureType pic = FACTORY.createPictureType();
pic.setPictureTitle("some descriptive title");
pic.setPictureUrl(new URI("http://mywebsite.org/image" + pos + ".jpg"));
pic.setFeatured(pos == 0);
... | java | protected static PictureType createPicture(int pos) {
try {
PictureType pic = FACTORY.createPictureType();
pic.setPictureTitle("some descriptive title");
pic.setPictureUrl(new URI("http://mywebsite.org/image" + pos + ".jpg"));
pic.setFeatured(pos == 0);
... | [
"protected",
"static",
"PictureType",
"createPicture",
"(",
"int",
"pos",
")",
"{",
"try",
"{",
"PictureType",
"pic",
"=",
"FACTORY",
".",
"createPictureType",
"(",
")",
";",
"pic",
".",
"setPictureTitle",
"(",
"\"some descriptive title\"",
")",
";",
"pic",
".... | Create a {@link PictureType} with some example data.
@param pos image position
@return created example object | [
"Create",
"a",
"{",
"@link",
"PictureType",
"}",
"with",
"some",
"example",
"data",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/TrovitWritingExample.java#L192-L202 | test | Create a PictureType object from the position. | Of course, here is the Java code you requested:
```java
protected static PictureType createPicture(int pos) {
try {
PictureType pic = FACTORY.createPictureType();
pic.setPictureTitle("some descriptive title");
pic.setPictureUrl(new URI("http://mywebsite.org/image" + pos + ".... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java | SymbolTable.addConstantMethodHandle | private void addConstantMethodHandle(
final int index,
final int referenceKind,
final String owner,
final String name,
final String descriptor) {
final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
int hashCode = hash(tag, owner, name, descriptor, referenceKind);
add(new Entry(i... | java | private void addConstantMethodHandle(
final int index,
final int referenceKind,
final String owner,
final String name,
final String descriptor) {
final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
int hashCode = hash(tag, owner, name, descriptor, referenceKind);
add(new Entry(i... | [
"private",
"void",
"addConstantMethodHandle",
"(",
"final",
"int",
"index",
",",
"final",
"int",
"referenceKind",
",",
"final",
"String",
"owner",
",",
"final",
"String",
"name",
",",
"final",
"String",
"descriptor",
")",
"{",
"final",
"int",
"tag",
"=",
"Sy... | Adds a new CONSTANT_MethodHandle_info to the constant pool of this symbol table.
@param index the constant pool index of the new Symbol.
@param referenceKind one of {@link Opcodes#H_GETFIELD}, {@link Opcodes#H_GETSTATIC}, {@link
Opcodes#H_PUTFIELD}, {@link Opcodes#H_PUTSTATIC}, {@link Opcodes#H_INVOKEVIRTUAL}, {@link
... | [
"Adds",
"a",
"new",
"CONSTANT_MethodHandle_info",
"to",
"the",
"constant",
"pool",
"of",
"this",
"symbol",
"table",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm7/SymbolTable.java#L846-L855 | test | Add a constant method handle entry. | Of course, here is the Java code you requested:
```java
private void addConstantMethodHandle(
final int index,
final int referenceKind,
final String owner,
final String name,
final String descriptor) {
final int tag = Symbol.CONSTANT_METHOD_HANDLE_TAG;
int hashCode = hash(tag, own... |
oblac/jodd | jodd-core/src/main/java/jodd/buffer/FastByteBuffer.java | FastByteBuffer.append | public FastByteBuffer append(final FastByteBuffer buff) {
if (buff.offset == 0) {
return this;
}
append(buff.buffer, 0, buff.offset);
return this;
} | java | public FastByteBuffer append(final FastByteBuffer buff) {
if (buff.offset == 0) {
return this;
}
append(buff.buffer, 0, buff.offset);
return this;
} | [
"public",
"FastByteBuffer",
"append",
"(",
"final",
"FastByteBuffer",
"buff",
")",
"{",
"if",
"(",
"buff",
".",
"offset",
"==",
"0",
")",
"{",
"return",
"this",
";",
"}",
"append",
"(",
"buff",
".",
"buffer",
",",
"0",
",",
"buff",
".",
"offset",
")"... | Appends another fast buffer to this one. | [
"Appends",
"another",
"fast",
"buffer",
"to",
"this",
"one",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/buffer/FastByteBuffer.java#L105-L111 | test | Append the contents of the specified FastByteBuffer to this FastByteBuffer. | Of course, here is the Java code you requested:
```java
public FastByteBuffer append(final FastByteBuffer buff) {
if (buff.offset == 0) {
return this;
}
append(buff.buffer, 0, buff.offset);
return this;
}
```
Hope this helps! |
Unidata/thredds | opendap/src/main/java/opendap/dap/Attribute.java | Attribute.checkUInt | private static final boolean checkUInt(String s)
{
// Note: Because there is no Unsigned class in Java, use Long instead.
try {
long val = Long.parseLong(s);
if(DebugValueChecking) {
DAPNode.log.debug("Attribute.checkUInt() - string: '" + s + "' value: " + v... | java | private static final boolean checkUInt(String s)
{
// Note: Because there is no Unsigned class in Java, use Long instead.
try {
long val = Long.parseLong(s);
if(DebugValueChecking) {
DAPNode.log.debug("Attribute.checkUInt() - string: '" + s + "' value: " + v... | [
"private",
"static",
"final",
"boolean",
"checkUInt",
"(",
"String",
"s",
")",
"{",
"// Note: Because there is no Unsigned class in Java, use Long instead.",
"try",
"{",
"long",
"val",
"=",
"Long",
".",
"parseLong",
"(",
"s",
")",
";",
"if",
"(",
"DebugValueChecking... | Check if string is a valid UInt32.
@param s the <code>String</code> to check.
@return true if the value is legal. | [
"Check",
"if",
"string",
"is",
"a",
"valid",
"UInt32",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/Attribute.java#L645-L660 | test | checkUInt Method. | Of course, here is the Java code you requested:
```java
private static final boolean checkUInt(String s)
{
// Note: Because there is no Unsigned class in Java, use Long instead.
try {
long val = Long.parseLong(s);
if(DebugValueChecking) {
DAPNode.log.debug("A... |
agentsoz/jill | examples/src/main/java/io/github/agentsoz/jill/example/tokenpassing/TokenAgent3.java | TokenAgent3.parse | public static void parse(String[] args) {
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case "-neighbourhood":
if (i + 1 < args.length) {
i++;
try {
neighbourhood = Integer.parseInt(args[i]);
} catch (NumberFormatException e) {
... | java | public static void parse(String[] args) {
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case "-neighbourhood":
if (i + 1 < args.length) {
i++;
try {
neighbourhood = Integer.parseInt(args[i]);
} catch (NumberFormatException e) {
... | [
"public",
"static",
"void",
"parse",
"(",
"String",
"[",
"]",
"args",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",
"{",
"switch",
"(",
"args",
"[",
"i",
"]",
")",
"{",
"case",
"\"-neig... | Parses the command line arguments.
@param args the command line arguments | [
"Parses",
"the",
"command",
"line",
"arguments",
"."
] | 13126fc78350465b477386132465f84cad719426 | https://github.com/agentsoz/jill/blob/13126fc78350465b477386132465f84cad719426/examples/src/main/java/io/github/agentsoz/jill/example/tokenpassing/TokenAgent3.java#L107-L135 | test | Parse the arguments to get the neighbourhood and rounds from the command line. | Of course, here is the Java code you requested:
```java
public static void parse(String[] args) {
for (int i = 0; i < args.length; i++) {
switch (args[i]) {
case "-neighbourhood":
if (i + 1 < args.length) {
i++;
try {
neighbourhood = Integer.parseInt(ar... |
oblac/jodd | jodd-mail/src/main/java/jodd/mail/ReceiveMailSession.java | ReceiveMailSession.getAllFolders | public String[] getAllFolders() {
final Folder[] folders;
try {
folders = getService().getDefaultFolder().list("*");
} catch (final MessagingException msgexc) {
throw new MailException("Failed to connect to folder", msgexc);
}
final String[] folderNames = new String[folders.length];
for (int i = 0; i... | java | public String[] getAllFolders() {
final Folder[] folders;
try {
folders = getService().getDefaultFolder().list("*");
} catch (final MessagingException msgexc) {
throw new MailException("Failed to connect to folder", msgexc);
}
final String[] folderNames = new String[folders.length];
for (int i = 0; i... | [
"public",
"String",
"[",
"]",
"getAllFolders",
"(",
")",
"{",
"final",
"Folder",
"[",
"]",
"folders",
";",
"try",
"{",
"folders",
"=",
"getService",
"(",
")",
".",
"getDefaultFolder",
"(",
")",
".",
"list",
"(",
"\"*\"",
")",
";",
"}",
"catch",
"(",
... | Returns array of all {@link Folder}s as {@code String}s. You can use these names in
{@link #useFolder(String)} method.
@return array of all {@link Folder}s as {@code String}s. | [
"Returns",
"array",
"of",
"all",
"{",
"@link",
"Folder",
"}",
"s",
"as",
"{",
"@code",
"String",
"}",
"s",
".",
"You",
"can",
"use",
"these",
"names",
"in",
"{",
"@link",
"#useFolder",
"(",
"String",
")",
"}",
"method",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/ReceiveMailSession.java#L85-L99 | test | Gets all folders. | Of course, here is the Java code you requested:
```java
public String[] getAllFolders() {
final Folder[] folders;
try {
folders = getService().getDefaultFolder().list("*");
} catch (final MessagingException msgexc) {
throw new MailException("Failed to connect to folder", msgexc);
}
final String[] folde... |
jkuhnert/ognl | src/main/java/ognl/Ognl.java | Ognl.getValue | public static Object getValue(Object tree, Map context, Object root)
throws OgnlException
{
return getValue(tree, context, root, null);
} | java | public static Object getValue(Object tree, Map context, Object root)
throws OgnlException
{
return getValue(tree, context, root, null);
} | [
"public",
"static",
"Object",
"getValue",
"(",
"Object",
"tree",
",",
"Map",
"context",
",",
"Object",
"root",
")",
"throws",
"OgnlException",
"{",
"return",
"getValue",
"(",
"tree",
",",
"context",
",",
"root",
",",
"null",
")",
";",
"}"
] | Evaluates the given OGNL expression tree to extract a value from the given root object. The
default context is set for the given context and root via <CODE>addDefaultContext()</CODE>.
@param tree
the OGNL expression tree to evaluate, as returned by parseExpression()
@param context
the naming context for the evaluation... | [
"Evaluates",
"the",
"given",
"OGNL",
"expression",
"tree",
"to",
"extract",
"a",
"value",
"from",
"the",
"given",
"root",
"object",
".",
"The",
"default",
"context",
"is",
"set",
"for",
"the",
"given",
"context",
"and",
"root",
"via",
"<CODE",
">",
"addDef... | 53d51a30c8c299b750dede779d05cb84beee73c3 | https://github.com/jkuhnert/ognl/blob/53d51a30c8c299b750dede779d05cb84beee73c3/src/main/java/ognl/Ognl.java#L454-L458 | test | Get the value of the CIDIVA from the given tree and context. | Of course, here is the Java code you requested:
```java
public static Object getValue(Object tree, Map context, Object root)
throws OgnlException
{
return getValue(tree, context, root, null);
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java | DefaultFeatureTiles.addLineString | private void addLineString(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Path path, LineString lineString) {
List<Point> points = lineString.getPoints();
if (points.size() >= 2) {
// Try to simplify the number of points in the LineString
poi... | java | private void addLineString(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Path path, LineString lineString) {
List<Point> points = lineString.getPoints();
if (points.size() >= 2) {
// Try to simplify the number of points in the LineString
poi... | [
"private",
"void",
"addLineString",
"(",
"double",
"simplifyTolerance",
",",
"BoundingBox",
"boundingBox",
",",
"ProjectionTransform",
"transform",
",",
"Path",
"path",
",",
"LineString",
"lineString",
")",
"{",
"List",
"<",
"Point",
">",
"points",
"=",
"lineStrin... | Add the linestring to the path
@param simplifyTolerance simplify tolerance in meters
@param boundingBox bounding box
@param transform projection transform
@param path path
@param lineString line string | [
"Add",
"the",
"linestring",
"to",
"the",
"path"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/DefaultFeatureTiles.java#L420-L443 | test | Add a LineString to the Path | Of course, here is the Java code you requested:
```java
private void addLineString(double simplifyTolerance, BoundingBox boundingBox, ProjectionTransform transform, Path path, LineString lineString) {
List<Point> points = lineString.getPoints();
if (points.size() >= 2) {
// Try to simpli... |
streamsets/datacollector | kinetica-protolib/src/main/java/com/streamsets/pipeline/stage/kinetica/util/KineticaTableUtils.java | KineticaTableUtils.getColumnType | private Class<?> getColumnType(JSONObject field) throws GPUdbException {
Class<?> columnType = null;
// The Avro "type" element might be an array if the type is nullable
if (field.get("type") instanceof JSONArray) {
JSONArray columnTypes = field.getJSONArray("type");
for (int j = 0; j < column... | java | private Class<?> getColumnType(JSONObject field) throws GPUdbException {
Class<?> columnType = null;
// The Avro "type" element might be an array if the type is nullable
if (field.get("type") instanceof JSONArray) {
JSONArray columnTypes = field.getJSONArray("type");
for (int j = 0; j < column... | [
"private",
"Class",
"<",
"?",
">",
"getColumnType",
"(",
"JSONObject",
"field",
")",
"throws",
"GPUdbException",
"{",
"Class",
"<",
"?",
">",
"columnType",
"=",
"null",
";",
"// The Avro \"type\" element might be an array if the type is nullable",
"if",
"(",
"field",
... | Get the Class for the column type | [
"Get",
"the",
"Class",
"for",
"the",
"column",
"type"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/kinetica-protolib/src/main/java/com/streamsets/pipeline/stage/kinetica/util/KineticaTableUtils.java#L162-L183 | test | Get the type of the field | Of course, here is the Java code you requested:
```java
private Class<?> getColumnType(JSONObject field) throws GPUdbException {
Class<?> columnType = null;
// The Avro "type" element might be an array if the type is nullable
if (field.get("type") instanceof JSONArray) {
JSONArray columnTypes = fie... |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java | ServletUtil.value | public static Object value(final PageContext pageContext, final String name) {
Object value = pageContext.getAttribute(name);
if (value != null) {
return value;
}
return value((HttpServletRequest) pageContext.getRequest(), name);
} | java | public static Object value(final PageContext pageContext, final String name) {
Object value = pageContext.getAttribute(name);
if (value != null) {
return value;
}
return value((HttpServletRequest) pageContext.getRequest(), name);
} | [
"public",
"static",
"Object",
"value",
"(",
"final",
"PageContext",
"pageContext",
",",
"final",
"String",
"name",
")",
"{",
"Object",
"value",
"=",
"pageContext",
".",
"getAttribute",
"(",
"name",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"r... | Returns value of property/attribute. The following value sets are looked up:
<ul>
<li>page context attributes</li>
<li>request attributes</li>
<li>request parameters (multi-part request detected)</li>
<li>session attributes</li>
<li>context attributes</li>
</ul> | [
"Returns",
"value",
"of",
"property",
"/",
"attribute",
".",
"The",
"following",
"value",
"sets",
"are",
"looked",
"up",
":",
"<ul",
">",
"<li",
">",
"page",
"context",
"attributes<",
"/",
"li",
">",
"<li",
">",
"request",
"attributes<",
"/",
"li",
">",
... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/ServletUtil.java#L392-L398 | test | Get the value of a named attribute. | Of course, here is the Java code you requested:
```java
public static Object value(final PageContext pageContext, final String name) {
Object value = pageContext.getAttribute(name);
if (value != null) {
return value;
}
return value((HttpServletRequest) pageContext.getRequest(), name);
}
```
Hope this help... |
jboss/jboss-common-core | src/main/java/org/jboss/util/TimedCachePolicy.java | TimedCachePolicy.getValidKeys | public List getValidKeys()
{
ArrayList validKeys = new ArrayList();
synchronized( entryMap )
{
Iterator iter = entryMap.entrySet().iterator();
while( iter.hasNext() )
{
Map.Entry entry = (Map.Entry) iter.next();
TimedEntry value = (TimedEntry) entr... | java | public List getValidKeys()
{
ArrayList validKeys = new ArrayList();
synchronized( entryMap )
{
Iterator iter = entryMap.entrySet().iterator();
while( iter.hasNext() )
{
Map.Entry entry = (Map.Entry) iter.next();
TimedEntry value = (TimedEntry) entr... | [
"public",
"List",
"getValidKeys",
"(",
")",
"{",
"ArrayList",
"validKeys",
"=",
"new",
"ArrayList",
"(",
")",
";",
"synchronized",
"(",
"entryMap",
")",
"{",
"Iterator",
"iter",
"=",
"entryMap",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
")",
";",
... | Get the list of keys for entries that are not expired.
@return A List of the keys corresponding to valid entries | [
"Get",
"the",
"list",
"of",
"keys",
"for",
"entries",
"that",
"are",
"not",
"expired",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/TimedCachePolicy.java#L352-L367 | test | Get the list of valid keys. | Of course, here is the Java code you requested:
```java
public List getValidKeys()
{
ArrayList validKeys = new ArrayList();
synchronized( entryMap )
{
Iterator iter = entryMap.entrySet().iterator();
while( iter.hasNext() )
{
Map.Entry entry = (Map.Entry) iter... |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/core/index/key/HollowPrimaryKeyValueDeriver.java | HollowPrimaryKeyValueDeriver.getRecordKey | public Object[] getRecordKey(int ordinal) {
Object[] results = new Object[fieldPathIndexes.length];
for (int i = 0; i < fieldPathIndexes.length; i++) {
results[i] = readValue(ordinal, i);
}
return results;
} | java | public Object[] getRecordKey(int ordinal) {
Object[] results = new Object[fieldPathIndexes.length];
for (int i = 0; i < fieldPathIndexes.length; i++) {
results[i] = readValue(ordinal, i);
}
return results;
} | [
"public",
"Object",
"[",
"]",
"getRecordKey",
"(",
"int",
"ordinal",
")",
"{",
"Object",
"[",
"]",
"results",
"=",
"new",
"Object",
"[",
"fieldPathIndexes",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"fieldPathIndexes",
... | Retrieve the primary key value for the specified ordinal.
@param ordinal the oridinal
@return the primary keys | [
"Retrieve",
"the",
"primary",
"key",
"value",
"for",
"the",
"specified",
"ordinal",
"."
] | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/core/index/key/HollowPrimaryKeyValueDeriver.java#L125-L132 | test | Gets the record key. | Of course, here is the Java code you requested:
```java
public Object[] getRecordKey(int ordinal) {
Object[] results = new Object[fieldPathIndexes.length];
for (int i = 0; i < fieldPathIndexes.length; i++) {
results[i] = readValue(ordinal, i);
}
return results;
}
```
H... |
Unidata/thredds | opendap/src/main/java/opendap/servers/parsers/AST.java | ASTconstant.translate | SubClause translate()
throws DAP2ServerSideException, DAP2Exception,
NoSuchFunctionException, NoSuchVariableException
{
SubClause subclause = null;
switch (tag) {
case ExprParserConstants.INTCONST: {
String s = String.format("%d", intvalue);
DInt32 i =... | java | SubClause translate()
throws DAP2ServerSideException, DAP2Exception,
NoSuchFunctionException, NoSuchVariableException
{
SubClause subclause = null;
switch (tag) {
case ExprParserConstants.INTCONST: {
String s = String.format("%d", intvalue);
DInt32 i =... | [
"SubClause",
"translate",
"(",
")",
"throws",
"DAP2ServerSideException",
",",
"DAP2Exception",
",",
"NoSuchFunctionException",
",",
"NoSuchVariableException",
"{",
"SubClause",
"subclause",
"=",
"null",
";",
"switch",
"(",
"tag",
")",
"{",
"case",
"ExprParserConstants... | /*
public String toString()
{
StringBuilder buf = new StringBuilder();
switch (tag) {
case STRINGCONST:
buf.append(String.format("\"%s\"", text));
break;
case INTCONST:
buf.append(String.format("%d", intvalue));
break;
case FLOATCONST:
buf.append(String.format("%.1f", floatvalue));
break;
default:
assert(false);
}
retu... | [
"/",
"*",
"public",
"String",
"toString",
"()",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"()",
";",
"switch",
"(",
"tag",
")",
"{",
"case",
"STRINGCONST",
":",
"buf",
".",
"append",
"(",
"String",
".",
"format",
"(",
"\\",
"%s",
"\\",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/servers/parsers/AST.java#L483-L517 | test | Translate a CRA - 2 ACS value into a DAP - 2 ACS value. | Of course, here is the Java code you requested:
```java
SubClause translate()
throws DAP2ServerSideException, DAP2Exception,
NoSuchFunctionException, NoSuchVariableException
{
SubClause subclause = null;
switch (tag) {
case ExprParserConstants.INTCONST: {
String ... |
playframework/playframework | web/play-java-forms/src/main/java/play/data/Form.java | Form.convertErrorArguments | private List<Object> convertErrorArguments(Object[] arguments) {
if (arguments == null) {
return Collections.emptyList();
}
List<Object> converted =
Arrays.stream(arguments)
.filter(
arg ->
!(arg
instanceof
... | java | private List<Object> convertErrorArguments(Object[] arguments) {
if (arguments == null) {
return Collections.emptyList();
}
List<Object> converted =
Arrays.stream(arguments)
.filter(
arg ->
!(arg
instanceof
... | [
"private",
"List",
"<",
"Object",
">",
"convertErrorArguments",
"(",
"Object",
"[",
"]",
"arguments",
")",
"{",
"if",
"(",
"arguments",
"==",
"null",
")",
"{",
"return",
"Collections",
".",
"emptyList",
"(",
")",
";",
"}",
"List",
"<",
"Object",
">",
"... | Convert the error arguments.
@param arguments The arguments to convert.
@return The converted arguments. | [
"Convert",
"the",
"error",
"arguments",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/web/play-java-forms/src/main/java/play/data/Form.java#L1157-L1170 | test | Convert error arguments to a list of errors. | Of course, here is the Java code you requested:
```java
private List<Object> convertErrorArguments(Object[] arguments) {
if (arguments == null) {
return Collections.emptyList();
}
List<Object> converted =
Arrays.stream(arguments)
.filter(
arg ->
... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java | LogoutConfigurer.logoutSuccessHandler | public LogoutConfigurer<H> logoutSuccessHandler(
LogoutSuccessHandler logoutSuccessHandler) {
this.logoutSuccessUrl = null;
this.customLogoutSuccess = true;
this.logoutSuccessHandler = logoutSuccessHandler;
return this;
} | java | public LogoutConfigurer<H> logoutSuccessHandler(
LogoutSuccessHandler logoutSuccessHandler) {
this.logoutSuccessUrl = null;
this.customLogoutSuccess = true;
this.logoutSuccessHandler = logoutSuccessHandler;
return this;
} | [
"public",
"LogoutConfigurer",
"<",
"H",
">",
"logoutSuccessHandler",
"(",
"LogoutSuccessHandler",
"logoutSuccessHandler",
")",
"{",
"this",
".",
"logoutSuccessUrl",
"=",
"null",
";",
"this",
".",
"customLogoutSuccess",
"=",
"true",
";",
"this",
".",
"logoutSuccessHa... | Sets the {@link LogoutSuccessHandler} to use. If this is specified,
{@link #logoutSuccessUrl(String)} is ignored.
@param logoutSuccessHandler the {@link LogoutSuccessHandler} to use after a user
has been logged out.
@return the {@link LogoutConfigurer} for further customizations | [
"Sets",
"the",
"{",
"@link",
"LogoutSuccessHandler",
"}",
"to",
"use",
".",
"If",
"this",
"is",
"specified",
"{",
"@link",
"#logoutSuccessUrl",
"(",
"String",
")",
"}",
"is",
"ignored",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/LogoutConfigurer.java#L206-L212 | test | Sets the logout success handler. | Of course, here is the Java code you requested:
```java
public LogoutConfigurer<H> logoutSuccessHandler(
LogoutSuccessHandler logoutSuccessHandler) {
this.logoutSuccessUrl = null;
this.customLogoutSuccess = true;
this.logoutSuccessHandler = logoutSuccessHandler;
return this;
}
```
Hope this helps! |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducer.java | AbstractHollowProducer.initializeDataModel | public void initializeDataModel(HollowSchema... schemas) {
Objects.requireNonNull(schemas);
if (schemas.length == 0) {
throw new IllegalArgumentException("classes is empty");
}
long start = currentTimeMillis();
HollowWriteStateCreator.populateStateEngineWithTypeWrite... | java | public void initializeDataModel(HollowSchema... schemas) {
Objects.requireNonNull(schemas);
if (schemas.length == 0) {
throw new IllegalArgumentException("classes is empty");
}
long start = currentTimeMillis();
HollowWriteStateCreator.populateStateEngineWithTypeWrite... | [
"public",
"void",
"initializeDataModel",
"(",
"HollowSchema",
"...",
"schemas",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"schemas",
")",
";",
"if",
"(",
"schemas",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"... | Initializes the producer data model for the given schemas.
<p>
Data model initialization is required prior to {@link #restore(long, HollowConsumer.BlobRetriever) restoring}
the producer.
This ensures that restoration can correctly compare the producer's current data model
with the data model of the restored data state ... | [
"Initializes",
"the",
"producer",
"data",
"model",
"for",
"the",
"given",
"schemas",
".",
"<p",
">",
"Data",
"model",
"initialization",
"is",
"required",
"prior",
"to",
"{",
"@link",
"#restore",
"(",
"long",
"HollowConsumer",
".",
"BlobRetriever",
")",
"restor... | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/api/producer/AbstractHollowProducer.java#L206-L217 | test | Initializes the data model with the given schemas. | Of course, here is the Java code you requested:
```java
public void initializeDataModel(HollowSchema... schemas) {
Objects.requireNonNull(schemas);
if (schemas.length == 0) {
throw new IllegalArgumentException("classes is empty");
}
long start = currentTimeMillis();
... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/rpc/RpcRemoting.java | RpcRemoting.invokeWithCallback | public void invokeWithCallback(final Connection conn, final Object request,
final InvokeContext invokeContext,
final InvokeCallback invokeCallback, final int timeoutMillis)
... | java | public void invokeWithCallback(final Connection conn, final Object request,
final InvokeContext invokeContext,
final InvokeCallback invokeCallback, final int timeoutMillis)
... | [
"public",
"void",
"invokeWithCallback",
"(",
"final",
"Connection",
"conn",
",",
"final",
"Object",
"request",
",",
"final",
"InvokeContext",
"invokeContext",
",",
"final",
"InvokeCallback",
"invokeCallback",
",",
"final",
"int",
"timeoutMillis",
")",
"throws",
"Rem... | Rpc invocation with callback.<br>
Notice! DO NOT modify the request object concurrently when this method is called.
@param conn
@param request
@param invokeContext
@param invokeCallback
@param timeoutMillis
@throws RemotingException | [
"Rpc",
"invocation",
"with",
"callback",
".",
"<br",
">",
"Notice!",
"DO",
"NOT",
"modify",
"the",
"request",
"object",
"concurrently",
"when",
"this",
"method",
"is",
"called",
"."
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcRemoting.java#L301-L309 | test | Invoke with callback. | Of course, here is the Java code you requested:
```java
public void invokeWithCallback(final Connection conn, final Object request,
final InvokeContext invokeContext,
final InvokeCallback invokeCallback, final int timeoutMillis)
... |
liveontologies/elk-reasoner | elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/SubPropertyExplorer.java | SubPropertyExplorer.getSubPropertyChains | static Set<IndexedPropertyChain> getSubPropertyChains(
IndexedPropertyChain input,
Producer<? super SubPropertyChainInference> inferenceProducer,
final PropertyHierarchyCompositionState.Dispatcher dispatcher) {
return computeSubProperties(input, inferenceProducer, dispatcher)
.getSubPropertyChains();
} | java | static Set<IndexedPropertyChain> getSubPropertyChains(
IndexedPropertyChain input,
Producer<? super SubPropertyChainInference> inferenceProducer,
final PropertyHierarchyCompositionState.Dispatcher dispatcher) {
return computeSubProperties(input, inferenceProducer, dispatcher)
.getSubPropertyChains();
} | [
"static",
"Set",
"<",
"IndexedPropertyChain",
">",
"getSubPropertyChains",
"(",
"IndexedPropertyChain",
"input",
",",
"Producer",
"<",
"?",
"super",
"SubPropertyChainInference",
">",
"inferenceProducer",
",",
"final",
"PropertyHierarchyCompositionState",
".",
"Dispatcher",
... | Computes all sub-{@link IndexedPropertyChain}s of the given
{@link IndexedPropertyChain}, if not computing before, recording all
{@link ObjectPropertyInference}s using the provided {@link Producer}. It
is ensured that all {@link ObjectPropertyInference}s are applied only
once even if the method is called multiple times... | [
"Computes",
"all",
"sub",
"-",
"{",
"@link",
"IndexedPropertyChain",
"}",
"s",
"of",
"the",
"given",
"{",
"@link",
"IndexedPropertyChain",
"}",
"if",
"not",
"computing",
"before",
"recording",
"all",
"{",
"@link",
"ObjectPropertyInference",
"}",
"s",
"using",
... | cfbe5279a57e0433d45c1676c7658ddb6e29b9eb | https://github.com/liveontologies/elk-reasoner/blob/cfbe5279a57e0433d45c1676c7658ddb6e29b9eb/elk-reasoner/src/main/java/org/semanticweb/elk/reasoner/saturation/properties/SubPropertyExplorer.java#L196-L202 | test | Returns a set of all sub - property chains of the given input. | Of course, here is the Java code you requested:
```java
static Set<IndexedPropertyChain> getSubPropertyChains(
IndexedPropertyChain input,
Producer<? super SubPropertyChainInference> inferenceProducer,
final PropertyHierarchyCompositionState.Dispatcher dispatcher) {
return computeSubProperties(input, infere... |
snakerflow/snakerflow | snaker-core/src/main/java/org/snaker/engine/core/OrderService.java | OrderService.updateCCStatus | public void updateCCStatus(String orderId, String... actorIds) {
List<CCOrder> ccorders = access().getCCOrder(orderId, actorIds);
AssertHelper.notNull(ccorders);
for(CCOrder ccorder : ccorders) {
ccorder.setStatus(STATE_FINISH);
ccorder.setFinishTime(DateHelper.getTime())... | java | public void updateCCStatus(String orderId, String... actorIds) {
List<CCOrder> ccorders = access().getCCOrder(orderId, actorIds);
AssertHelper.notNull(ccorders);
for(CCOrder ccorder : ccorders) {
ccorder.setStatus(STATE_FINISH);
ccorder.setFinishTime(DateHelper.getTime())... | [
"public",
"void",
"updateCCStatus",
"(",
"String",
"orderId",
",",
"String",
"...",
"actorIds",
")",
"{",
"List",
"<",
"CCOrder",
">",
"ccorders",
"=",
"access",
"(",
")",
".",
"getCCOrder",
"(",
"orderId",
",",
"actorIds",
")",
";",
"AssertHelper",
".",
... | 更新抄送记录状态为已阅 | [
"更新抄送记录状态为已阅"
] | 9c8cb3148a76702f1eda22f1d113053cb44b1eff | https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/OrderService.java#L127-L135 | test | Update the status of all ccorders in an order. | Of course, here is the Java code you requested:
```java
public void updateCCStatus(String orderId, String... actorIds) {
List<CCOrder> ccorders = access().getCCOrder(orderId, actorIds);
AssertHelper.notNull(ccorders);
for(CCOrder ccorder : ccorders) {
ccorder.setStatus(STATE_FINISH)... |
Unidata/thredds | udunits/src/main/java/ucar/units/BaseQuantity.java | BaseQuantity.compareTo | public int compareTo(final BaseQuantity that) {
int comp;
if (this == that) {
comp = 0;
}
else {
comp = getName().compareToIgnoreCase(that.getName());
if (comp == 0 && getSymbol() != null) {
comp = getSymbol().compareTo(that.getSymbol());
}
}
return comp;
} | java | public int compareTo(final BaseQuantity that) {
int comp;
if (this == that) {
comp = 0;
}
else {
comp = getName().compareToIgnoreCase(that.getName());
if (comp == 0 && getSymbol() != null) {
comp = getSymbol().compareTo(that.getSymbol());
}
}
return comp;
} | [
"public",
"int",
"compareTo",
"(",
"final",
"BaseQuantity",
"that",
")",
"{",
"int",
"comp",
";",
"if",
"(",
"this",
"==",
"that",
")",
"{",
"comp",
"=",
"0",
";",
"}",
"else",
"{",
"comp",
"=",
"getName",
"(",
")",
".",
"compareToIgnoreCase",
"(",
... | Compares this base quantity to another base quantity.
@param that
The BaseQuantity to compare against.
@return An integer that is negative, zero, or positive depending on
whether this BaseQuantity is less than, equal to, or greater than
<code>that</code>. | [
"Compares",
"this",
"base",
"quantity",
"to",
"another",
"base",
"quantity",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/BaseQuantity.java#L224-L236 | test | Compares two quantity objects. | Of course, here is the Java code you requested:
```java
public int compareTo(final BaseQuantity that) {
int comp;
if (this == that) {
comp = 0;
}
else {
comp = getName().compareToIgnoreCase(that.getName());
if (comp == 0 && getSymbol() != null) {
comp = getSymbol().compareTo(that.getSymbol());
... |
oblac/jodd | jodd-core/src/main/java/jodd/io/NetUtil.java | NetUtil.resolveIpAddress | public static String resolveIpAddress(final String hostname) {
try {
InetAddress netAddress;
if (hostname == null || hostname.equalsIgnoreCase(LOCAL_HOST)) {
netAddress = InetAddress.getLocalHost();
} else {
netAddress = Inet4Address.getByName(hostname);
}
return netAddress.getHostAddress();
... | java | public static String resolveIpAddress(final String hostname) {
try {
InetAddress netAddress;
if (hostname == null || hostname.equalsIgnoreCase(LOCAL_HOST)) {
netAddress = InetAddress.getLocalHost();
} else {
netAddress = Inet4Address.getByName(hostname);
}
return netAddress.getHostAddress();
... | [
"public",
"static",
"String",
"resolveIpAddress",
"(",
"final",
"String",
"hostname",
")",
"{",
"try",
"{",
"InetAddress",
"netAddress",
";",
"if",
"(",
"hostname",
"==",
"null",
"||",
"hostname",
".",
"equalsIgnoreCase",
"(",
"LOCAL_HOST",
")",
")",
"{",
"n... | Resolves IP address from a hostname. | [
"Resolves",
"IP",
"address",
"from",
"a",
"hostname",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/NetUtil.java#L55-L68 | test | Resolves an IP address from a hostname. | Of course, here is the Java code you requested:
```java
public static String resolveIpAddress(final String hostname) {
try {
InetAddress netAddress;
if (hostname == null || hostname.equalsIgnoreCase(LOCAL_HOST)) {
netAddress = InetAddress.getLocalHost();
} else {
netAddress = Inet4Address.getByName... |
orientechnologies/orientdb | graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java | OrientEdge.getOutVertex | public OIdentifiable getOutVertex() {
if (vOut != null)
// LIGHTWEIGHT EDGE
return vOut;
setCurrentGraphInThreadLocal();
final ODocument doc = getRecord();
if (doc == null)
return null;
if (settings != null && settings.isKeepInMemoryReferences())
// AVOID LAZY RESOLVING+SE... | java | public OIdentifiable getOutVertex() {
if (vOut != null)
// LIGHTWEIGHT EDGE
return vOut;
setCurrentGraphInThreadLocal();
final ODocument doc = getRecord();
if (doc == null)
return null;
if (settings != null && settings.isKeepInMemoryReferences())
// AVOID LAZY RESOLVING+SE... | [
"public",
"OIdentifiable",
"getOutVertex",
"(",
")",
"{",
"if",
"(",
"vOut",
"!=",
"null",
")",
"// LIGHTWEIGHT EDGE",
"return",
"vOut",
";",
"setCurrentGraphInThreadLocal",
"(",
")",
";",
"final",
"ODocument",
"doc",
"=",
"getRecord",
"(",
")",
";",
"if",
"... | (Blueprints Extension) Returns the outgoing vertex in form of record. | [
"(",
"Blueprints",
"Extension",
")",
"Returns",
"the",
"outgoing",
"vertex",
"in",
"form",
"of",
"record",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/tinkerpop/blueprints/impls/orient/OrientEdge.java#L173-L189 | test | Get the out vertex. | Of course, here is the Java code you requested:
```java
public OIdentifiable getOutVertex() {
if (vOut != null)
// LIGHTWEIGHT EDGE
return vOut;
setCurrentGraphInThreadLocal();
final ODocument doc = getRecord();
if (doc == null)
return null;
if (settings != null && settings.isK... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/hdf5/H5iosp.java | H5iosp.readStructure | private StructureData readStructure(Structure s, ArrayStructureW asw, long dataPos) throws IOException, InvalidRangeException {
StructureDataW sdata = new StructureDataW(asw.getStructureMembers());
if (debug) System.out.println(" readStructure " + s.getFullName() + " dataPos = " + dataPos);
for (Variable v... | java | private StructureData readStructure(Structure s, ArrayStructureW asw, long dataPos) throws IOException, InvalidRangeException {
StructureDataW sdata = new StructureDataW(asw.getStructureMembers());
if (debug) System.out.println(" readStructure " + s.getFullName() + " dataPos = " + dataPos);
for (Variable v... | [
"private",
"StructureData",
"readStructure",
"(",
"Structure",
"s",
",",
"ArrayStructureW",
"asw",
",",
"long",
"dataPos",
")",
"throws",
"IOException",
",",
"InvalidRangeException",
"{",
"StructureDataW",
"sdata",
"=",
"new",
"StructureDataW",
"(",
"asw",
".",
"g... | old way | [
"old",
"way"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/hdf5/H5iosp.java#L541-L553 | test | Read a structure from the stream. | Of course, here is the Java code you requested:
```java
private StructureData readStructure(Structure s, ArrayStructureW asw, long dataPos) throws IOException, InvalidRangeException {
StructureDataW sdata = new StructureDataW(asw.getStructureMembers());
if (debug) System.out.println(" readStructure " + s.getFu... |
oblac/jodd | jodd-htmlstapler/src/main/java/jodd/htmlstapler/BundleAction.java | BundleAction.replaceBundleId | public char[] replaceBundleId(final char[] content) {
if (strategy == ACTION_MANAGED || bundleId == null) {
return content;
}
int index = ArraysUtil.indexOf(content, bundleIdMark);
if (index == -1) {
return content;
}
char[] bundleIdChars = bundleId.toCharArray();
char[] result = new char[content.... | java | public char[] replaceBundleId(final char[] content) {
if (strategy == ACTION_MANAGED || bundleId == null) {
return content;
}
int index = ArraysUtil.indexOf(content, bundleIdMark);
if (index == -1) {
return content;
}
char[] bundleIdChars = bundleId.toCharArray();
char[] result = new char[content.... | [
"public",
"char",
"[",
"]",
"replaceBundleId",
"(",
"final",
"char",
"[",
"]",
"content",
")",
"{",
"if",
"(",
"strategy",
"==",
"ACTION_MANAGED",
"||",
"bundleId",
"==",
"null",
")",
"{",
"return",
"content",
";",
"}",
"int",
"index",
"=",
"ArraysUtil",... | Replaces bundle marker with calculated bundle id.
Used for <code>RESOURCE_ONLY</code> strategy. | [
"Replaces",
"bundle",
"marker",
"with",
"calculated",
"bundle",
"id",
".",
"Used",
"for",
"<code",
">",
"RESOURCE_ONLY<",
"/",
"code",
">",
"strategy",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-htmlstapler/src/main/java/jodd/htmlstapler/BundleAction.java#L146-L164 | test | Replaces the bundleId in the content with the bundleId of the current action. | Of course, here is the Java code you requested:
```java
public char[] replaceBundleId(final char[] content) {
if (strategy == ACTION_MANAGED || bundleId == null) {
return content;
}
int index = ArraysUtil.indexOf(content, bundleIdMark);
if (index == -1) {
return content;
}
char[] bundleIdChars = bu... |
ReactiveX/RxJava | src/main/java/io/reactivex/Flowable.java | Flowable.subscribeWith | @CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <E extends Subscriber<? super T>> E subscribeWith(E subscriber) {
subscribe(subscriber);
return subscriber;
} | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <E extends Subscriber<? super T>> E subscribeWith(E subscriber) {
subscribe(subscriber);
return subscriber;
} | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"SPECIAL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"<",
"E",
"extends",
"Subscriber",
"<",
"?",
"super",
"T",
">",
">",
"E",
... | Subscribes a given Subscriber (subclass) to this Flowable and returns the given
Subscriber as is.
<p>Usage example:
<pre><code>
Flowable<Integer> source = Flowable.range(1, 10);
CompositeDisposable composite = new CompositeDisposable();
ResourceSubscriber<Integer> rs = new ResourceSubscriber<>() {
//... | [
"Subscribes",
"a",
"given",
"Subscriber",
"(",
"subclass",
")",
"to",
"this",
"Flowable",
"and",
"returns",
"the",
"given",
"Subscriber",
"as",
"is",
".",
"<p",
">",
"Usage",
"example",
":",
"<pre",
">",
"<code",
">",
"Flowable<",
";",
"Integer>",
";",... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Flowable.java#L14878-L14884 | test | Subscribes the given subscriber with the current exception. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final <E extends Subscriber<? super T>> E subscribeWith(E subscriber) {
subscribe(subscriber);
return subscriber;
}
``... |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingkidsprogramming/recipes/completed/section05recursion/RecursiveSquare.java | RecursiveSquare.moveBackToCenter | private static void moveBackToCenter(double length)
{
Tortoise.setPenUp();
Tortoise.turn(90);
Tortoise.move(length / 2);
Tortoise.turn(90);
Tortoise.move(length / 2);
Tortoise.turn(180);
Tortoise.setPenDown();
//
} | java | private static void moveBackToCenter(double length)
{
Tortoise.setPenUp();
Tortoise.turn(90);
Tortoise.move(length / 2);
Tortoise.turn(90);
Tortoise.move(length / 2);
Tortoise.turn(180);
Tortoise.setPenDown();
//
} | [
"private",
"static",
"void",
"moveBackToCenter",
"(",
"double",
"length",
")",
"{",
"Tortoise",
".",
"setPenUp",
"(",
")",
";",
"Tortoise",
".",
"turn",
"(",
"90",
")",
";",
"Tortoise",
".",
"move",
"(",
"length",
"/",
"2",
")",
";",
"Tortoise",
".",
... | Create the moveBackToCenter recipe | [
"Create",
"the",
"moveBackToCenter",
"recipe"
] | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingkidsprogramming/recipes/completed/section05recursion/RecursiveSquare.java#L72-L82 | test | Move the block back to the center of the block. | Of course, here is the Java code you requested:
```java
private static void moveBackToCenter(double length)
{
Tortoise.setPenUp();
Tortoise.turn(90);
Tortoise.move(length / 2);
Tortoise.turn(90);
Tortoise.move(length / 2);
Tortoise.turn(180);
Tortoise.setPenDown();
//
}
```
Hope th... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Query.java | Query.setAttributesToHighlight | @Deprecated
public @NonNull
Query setAttributesToHighlight(List<String> attributes) {
return set(KEY_ATTRIBUTES_TO_HIGHLIGHT, buildJSONArray((String[]) attributes.toArray()));
} | java | @Deprecated
public @NonNull
Query setAttributesToHighlight(List<String> attributes) {
return set(KEY_ATTRIBUTES_TO_HIGHLIGHT, buildJSONArray((String[]) attributes.toArray()));
} | [
"@",
"Deprecated",
"public",
"@",
"NonNull",
"Query",
"setAttributesToHighlight",
"(",
"List",
"<",
"String",
">",
"attributes",
")",
"{",
"return",
"set",
"(",
"KEY_ATTRIBUTES_TO_HIGHLIGHT",
",",
"buildJSONArray",
"(",
"(",
"String",
"[",
"]",
")",
"attributes"... | Deprecated, use {@link #setAttributesToHighlight(String...)} | [
"Deprecated",
"use",
"{"
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Query.java#L448-L452 | test | Sets the attributes to highlight. | Of course, here is the Java code you requested:
```java
@Deprecated
public @NonNull
Query setAttributesToHighlight(List<String> attributes) {
return set(KEY_ATTRIBUTES_TO_HIGHLIGHT, buildJSONArray((String[]) attributes.toArray()));
}
```
Hope this helps! |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/QueryImpl.java | QueryImpl.filter | @Override
public QueryImpl<T> filter(final String condition, final Object value) {
final QueryImpl<T> q = createQuery();
q.addFilter(condition, value);
return q;
} | java | @Override
public QueryImpl<T> filter(final String condition, final Object value) {
final QueryImpl<T> q = createQuery();
q.addFilter(condition, value);
return q;
} | [
"@",
"Override",
"public",
"QueryImpl",
"<",
"T",
">",
"filter",
"(",
"final",
"String",
"condition",
",",
"final",
"Object",
"value",
")",
"{",
"final",
"QueryImpl",
"<",
"T",
">",
"q",
"=",
"createQuery",
"(",
")",
";",
"q",
".",
"addFilter",
"(",
... | /* (non-Javadoc)
@see com.googlecode.objectify.cmd.Query#filter(java.lang.String, java.lang.Object) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/QueryImpl.java#L87-L92 | test | Creates a new query that only contains the objects matching the condition and value. | Of course, here is the Java code you requested:
```java
@Override
public QueryImpl<T> filter(final String condition, final Object value) {
final QueryImpl<T> q = createQuery();
q.addFilter(condition, value);
return q;
}
```
Hope this helps! |
playframework/playframework | core/play/src/main/java/play/mvc/RangeResults.java | RangeResults.ofFile | @Deprecated
public static Result ofFile(File file, String fileName) {
return ofFile(Http.Context.current().request(), file, fileName);
} | java | @Deprecated
public static Result ofFile(File file, String fileName) {
return ofFile(Http.Context.current().request(), file, fileName);
} | [
"@",
"Deprecated",
"public",
"static",
"Result",
"ofFile",
"(",
"File",
"file",
",",
"String",
"fileName",
")",
"{",
"return",
"ofFile",
"(",
"Http",
".",
"Context",
".",
"current",
"(",
")",
".",
"request",
"(",
")",
",",
"file",
",",
"fileName",
")",... | Returns the file as a result considering "Range" header. If the header is present and it is
satisfiable, then a Result containing just the requested part will be returned. If the header
is not present or is unsatisfiable, then a regular Result will be returned.
@param file the content file
@param fileName filename use... | [
"Returns",
"the",
"file",
"as",
"a",
"result",
"considering",
"Range",
"header",
".",
"If",
"the",
"header",
"is",
"present",
"and",
"it",
"is",
"satisfiable",
"then",
"a",
"Result",
"containing",
"just",
"the",
"requested",
"part",
"will",
"be",
"returned",... | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/RangeResults.java#L301-L304 | test | Returns a result of reading the content of the specified file. | Of course, here is the Java code you requested:
```java
@Deprecated
public static Result ofFile(File file, String fileName) {
return ofFile(Http.Context.current().request(), file, fileName);
}
```
Hope this helps! |
apache/parquet-mr | parquet-common/src/main/java/org/apache/parquet/Exceptions.java | Exceptions.throwIfInstance | public static <E extends Exception> void throwIfInstance(Throwable t,
Class<E> excClass)
throws E {
if (excClass.isAssignableFrom(t.getClass())) {
// the throwable is already an exception, so return it
throw excClass.cast(t);
}
} | java | public static <E extends Exception> void throwIfInstance(Throwable t,
Class<E> excClass)
throws E {
if (excClass.isAssignableFrom(t.getClass())) {
// the throwable is already an exception, so return it
throw excClass.cast(t);
}
} | [
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"void",
"throwIfInstance",
"(",
"Throwable",
"t",
",",
"Class",
"<",
"E",
">",
"excClass",
")",
"throws",
"E",
"{",
"if",
"(",
"excClass",
".",
"isAssignableFrom",
"(",
"t",
".",
"getClass",
"(",... | If the given throwable is an instance of E, throw it as an E.
@param t an exception instance
@param excClass an exception class t may be an instance of
@param <E> the type of exception that will be thrown if throwable is an instance
@throws E if t is an instance of E | [
"If",
"the",
"given",
"throwable",
"is",
"an",
"instance",
"of",
"E",
"throw",
"it",
"as",
"an",
"E",
"."
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-common/src/main/java/org/apache/parquet/Exceptions.java#L31-L38 | test | Throw an exception if the throwable is an instance of the specified exception class. | Of course, here is the Java code you requested:
```java
public static <E extends Exception> void throwIfInstance(Throwable t,
Class<E> excClass)
throws E {
if (excClass.isAssignableFrom(t.getClass())) {
// the throwable is already an exception,... |
ieb/sparsemapcontent | core/src/main/java/org/sakaiproject/nakamura/lite/authorizable/AuthorizableManagerImpl.java | AuthorizableManagerImpl.changePassword | public void changePassword(Authorizable authorizable, String password, String oldPassword) throws StorageClientException,
AccessDeniedException {
long t = System.currentTimeMillis();
try {
String id = authorizable.getId();
if (thisUser.isAdmin() || currentUserId.equa... | java | public void changePassword(Authorizable authorizable, String password, String oldPassword) throws StorageClientException,
AccessDeniedException {
long t = System.currentTimeMillis();
try {
String id = authorizable.getId();
if (thisUser.isAdmin() || currentUserId.equa... | [
"public",
"void",
"changePassword",
"(",
"Authorizable",
"authorizable",
",",
"String",
"password",
",",
"String",
"oldPassword",
")",
"throws",
"StorageClientException",
",",
"AccessDeniedException",
"{",
"long",
"t",
"=",
"System",
".",
"currentTimeMillis",
"(",
"... | TODO: Unit test | [
"TODO",
":",
"Unit",
"test"
] | 0570fdf868adbbf7734790cbc09fe66480e5f2dc | https://github.com/ieb/sparsemapcontent/blob/0570fdf868adbbf7734790cbc09fe66480e5f2dc/core/src/main/java/org/sakaiproject/nakamura/lite/authorizable/AuthorizableManagerImpl.java#L483-L512 | test | Change the password of an authorizable. | Of course, here is the Java code you requested:
```java
public void changePassword(Authorizable authorizable, String password, String oldPassword) throws StorageClientException,
AccessDeniedException {
long t = System.currentTimeMillis();
try {
String id = authorizable.getId();
... |
RestComm/jain-slee | container/usage/src/main/java/org/mobicents/slee/container/deployment/ConcreteUsageNotificationManagerMBeanGenerator.java | ConcreteUsageNotificationManagerMBeanGenerator.createConstructor | private void createConstructor(CtClass concreteClass, CtClass usageMBeanInterface, CtClass notificationSource,CtClass usageComponent)
throws Exception {
CtConstructor ctCons = new CtConstructor(new CtClass[]{usageMBeanInterface,notificationSource,usageComponent}, concreteClass);
ctCons.... | java | private void createConstructor(CtClass concreteClass, CtClass usageMBeanInterface, CtClass notificationSource,CtClass usageComponent)
throws Exception {
CtConstructor ctCons = new CtConstructor(new CtClass[]{usageMBeanInterface,notificationSource,usageComponent}, concreteClass);
ctCons.... | [
"private",
"void",
"createConstructor",
"(",
"CtClass",
"concreteClass",
",",
"CtClass",
"usageMBeanInterface",
",",
"CtClass",
"notificationSource",
",",
"CtClass",
"usageComponent",
")",
"throws",
"Exception",
"{",
"CtConstructor",
"ctCons",
"=",
"new",
"CtConstructor... | Create a constructor. This method simply records the input parameters in
appropriately named fields.
@param
@param classes | [
"Create",
"a",
"constructor",
".",
"This",
"method",
"simply",
"records",
"the",
"input",
"parameters",
"in",
"appropriately",
"named",
"fields",
"."
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/container/deployment/ConcreteUsageNotificationManagerMBeanGenerator.java#L78-L85 | test | Creates the constructor for
CTYPE. | Of course, here is the Java code you requested:
```java
private void createConstructor(CtClass concreteClass, CtClass usageMBeanInterface, CtClass notificationSource,CtClass usageComponent)
throws Exception {
CtConstructor ctCons = new CtConstructor(new CtClass[]{usageMBeanInterface,notificatio... |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/util/DapUtil.java | DapUtil.isSinglePoint | static public boolean
isSinglePoint(List<Slice> slices)
{
for(Slice sl : slices) {
if(sl.getCount() != 1) return false;
}
return true;
} | java | static public boolean
isSinglePoint(List<Slice> slices)
{
for(Slice sl : slices) {
if(sl.getCount() != 1) return false;
}
return true;
} | [
"static",
"public",
"boolean",
"isSinglePoint",
"(",
"List",
"<",
"Slice",
">",
"slices",
")",
"{",
"for",
"(",
"Slice",
"sl",
":",
"slices",
")",
"{",
"if",
"(",
"sl",
".",
"getCount",
"(",
")",
"!=",
"1",
")",
"return",
"false",
";",
"}",
"return... | Test if a set of slices represent a single position
@param slices
@return | [
"Test",
"if",
"a",
"set",
"of",
"slices",
"represent",
"a",
"single",
"position"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/util/DapUtil.java#L768-L775 | test | Checks if the list of slices contains only one element. | Of course, here is the Java code you requested:
```java
static public boolean
isSinglePoint(List<Slice> slices)
{
for(Slice sl : slices) {
if(sl.getCount() != 1) return false;
}
return true;
}
```
Hope this helps! |
intellimate/IzouSDK | src/main/java/org/intellimate/izou/sdk/frameworks/permanentSoundOutput/events/StopEvent.java | StopEvent.createStopEvent | public static Optional<StopEvent> createStopEvent(Identification source) {
try {
StopEvent stopRequest = new StopEvent(source);
return Optional.of(stopRequest);
} catch (IllegalArgumentException e) {
return Optional.empty();
}
} | java | public static Optional<StopEvent> createStopEvent(Identification source) {
try {
StopEvent stopRequest = new StopEvent(source);
return Optional.of(stopRequest);
} catch (IllegalArgumentException e) {
return Optional.empty();
}
} | [
"public",
"static",
"Optional",
"<",
"StopEvent",
">",
"createStopEvent",
"(",
"Identification",
"source",
")",
"{",
"try",
"{",
"StopEvent",
"stopRequest",
"=",
"new",
"StopEvent",
"(",
"source",
")",
";",
"return",
"Optional",
".",
"of",
"(",
"stopRequest",
... | creates a new StopEvent
@param source the caller
@return the optional StartMusicRequest | [
"creates",
"a",
"new",
"StopEvent"
] | bc8705ad48a6ca12a722f2b787be435949fa5d08 | https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/permanentSoundOutput/events/StopEvent.java#L55-L62 | test | Creates a StopEvent object from an Identification. | Of course, here is the Java code you requested:
```java
public static Optional<StopEvent> createStopEvent(Identification source) {
try {
StopEvent stopRequest = new StopEvent(source);
return Optional.of(stopRequest);
} catch (IllegalArgumentException e) {
return Opti... |
eclipse/packagedrone | bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspUtil.java | JspUtil.booleanValue | public static boolean booleanValue(String s) {
boolean b = false;
if (s != null) {
if (s.equalsIgnoreCase("yes")) {
b = true;
} else {
b = Boolean.valueOf(s).booleanValue();
}
}
return b;
} | java | public static boolean booleanValue(String s) {
boolean b = false;
if (s != null) {
if (s.equalsIgnoreCase("yes")) {
b = true;
} else {
b = Boolean.valueOf(s).booleanValue();
}
}
return b;
} | [
"public",
"static",
"boolean",
"booleanValue",
"(",
"String",
"s",
")",
"{",
"boolean",
"b",
"=",
"false",
";",
"if",
"(",
"s",
"!=",
"null",
")",
"{",
"if",
"(",
"s",
".",
"equalsIgnoreCase",
"(",
"\"yes\"",
")",
")",
"{",
"b",
"=",
"true",
";",
... | Convert a String value to 'boolean'.
Besides the standard conversions done by
Boolean.valueOf(s).booleanValue(), the value "yes"
(ignore case) is also converted to 'true'.
If 's' is null, then 'false' is returned.
@param s the string to be converted
@return the boolean value associated with the string s | [
"Convert",
"a",
"String",
"value",
"to",
"boolean",
".",
"Besides",
"the",
"standard",
"conversions",
"done",
"by",
"Boolean",
".",
"valueOf",
"(",
"s",
")",
".",
"booleanValue",
"()",
"the",
"value",
"yes",
"(",
"ignore",
"case",
")",
"is",
"also",
"con... | 3869c1643cdc6f7cb8b26097a7b6994683b13d7e | https://github.com/eclipse/packagedrone/blob/3869c1643cdc6f7cb8b26097a7b6994683b13d7e/bundles/org.apache.jasper.glassfish/src/org/apache/jasper/compiler/JspUtil.java#L451-L461 | test | Returns the boolean value of the given string. | Of course, here is the Java code you requested:
```java
public static boolean booleanValue(String s) {
boolean b = false;
if (s != null) {
if (s.equalsIgnoreCase("yes")) {
b = true;
} else {
b = Boolean.valueOf(s).booleanValue();
}
}
return b;
}
```
Hope this helps! |
Unidata/thredds | ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java | Grib2ReportPanel.doRename | private void doRename(Formatter f, MCollection dcm, boolean useIndex) throws IOException {
f.format("CHECK Grib-2 Names: Old vs New for collection %s%n", dcm.getCollectionName());
List<VarName> varNames = new ArrayList<>(3000);
Map<String, List<String>> gridsAll = new HashMap<>(1000); // old -> list<new>
... | java | private void doRename(Formatter f, MCollection dcm, boolean useIndex) throws IOException {
f.format("CHECK Grib-2 Names: Old vs New for collection %s%n", dcm.getCollectionName());
List<VarName> varNames = new ArrayList<>(3000);
Map<String, List<String>> gridsAll = new HashMap<>(1000); // old -> list<new>
... | [
"private",
"void",
"doRename",
"(",
"Formatter",
"f",
",",
"MCollection",
"dcm",
",",
"boolean",
"useIndex",
")",
"throws",
"IOException",
"{",
"f",
".",
"format",
"(",
"\"CHECK Grib-2 Names: Old vs New for collection %s%n\"",
",",
"dcm",
".",
"getCollectionName",
"... | ///////////////////////////////////////////////////////////////////////////////// | [
"/////////////////////////////////////////////////////////////////////////////////"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/ucar/nc2/ui/grib/Grib2ReportPanel.java#L1026-L1219 | test | Rename the files in the given MCollection. | Of course, here is the Java code you requested:
```java
private void doRename(Formatter f, MCollection dcm, boolean useIndex) throws IOException {
f.format("CHECK Grib-2 Names: Old vs New for collection %s%n", dcm.getCollectionName());
List<VarName> varNames = new ArrayList<>(3000);
Map<String, List<Strin... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.wrap | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Observable<T> wrap(ObservableSource<T> source) {
ObjectHelper.requireNonNull(source, "source is null");
if (source instanceof Observable) {
return RxJavaPlugins.onAssembly((Observable<T>)source);
}
... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Observable<T> wrap(ObservableSource<T> source) {
ObjectHelper.requireNonNull(source, "source is null");
if (source instanceof Observable) {
return RxJavaPlugins.onAssembly((Observable<T>)source);
}
... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"wrap",
"(",
"ObservableSource",
"<",
"T",
">",
"source",
")",
"{",
"ObjectHelper",
".",
"requireNonN... | Wraps an ObservableSource into an Observable if not already an Observable.
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code wrap} does not operate by default on a particular {@link Scheduler}.</dd>
</dl>
@param <T> the value type
@param source the source ObservableSource instance
@return the new Observable instance or the ... | [
"Wraps",
"an",
"ObservableSource",
"into",
"an",
"Observable",
"if",
"not",
"already",
"an",
"Observable",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L4082-L4090 | test | Wrap an observable source into an observable. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Observable<T> wrap(ObservableSource<T> source) {
ObjectHelper.requireNonNull(source, "source is null");
if (source instanceof Observable) {
return RxJ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.