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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java | ABaseClientWS.putJson | protected JSONObject putJson(
ABaseFluidJSONObject baseDomainParam,
String postfixUrlParam) {
//Create without connection check...
return this.putJson(false, baseDomainParam, postfixUrlParam);
} | java | protected JSONObject putJson(
ABaseFluidJSONObject baseDomainParam,
String postfixUrlParam) {
//Create without connection check...
return this.putJson(false, baseDomainParam, postfixUrlParam);
} | [
"protected",
"JSONObject",
"putJson",
"(",
"ABaseFluidJSONObject",
"baseDomainParam",
",",
"String",
"postfixUrlParam",
")",
"{",
"//Create without connection check...",
"return",
"this",
".",
"putJson",
"(",
"false",
",",
"baseDomainParam",
",",
"postfixUrlParam",
")",
... | Performs an HTTP-PUT request with {@code postfixUrlParam}.
@param baseDomainParam The JSON object to submit to endpoint as PUT.
@param postfixUrlParam URL mapping after the Base endpoint.
@return Return body as JSON. | [
"Performs",
"an",
"HTTP",
"-",
"PUT",
"request",
"with",
"{",
"@code",
"postfixUrlParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/ABaseClientWS.java#L564-L570 | test | Create with connection check and postfix url param | Of course, here is the Java code you requested:
```java
protected JSONObject putJson(
ABaseFluidJSONObject baseDomainParam,
String postfixUrlParam) {
//Create without connection check...
return this.putJson(false, baseDomainParam, postfixUrlParam);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3iosp.java | N3iosp.fillNonRecordVariables | protected void fillNonRecordVariables() throws IOException {
// run through each variable
for (Variable v : ncfile.getVariables()) {
if (v.isUnlimited()) continue;
try {
writeData(v, v.getShapeAsSection(), makeConstantArray(v));
} catch (InvalidRangeException e) {
e.printStackT... | java | protected void fillNonRecordVariables() throws IOException {
// run through each variable
for (Variable v : ncfile.getVariables()) {
if (v.isUnlimited()) continue;
try {
writeData(v, v.getShapeAsSection(), makeConstantArray(v));
} catch (InvalidRangeException e) {
e.printStackT... | [
"protected",
"void",
"fillNonRecordVariables",
"(",
")",
"throws",
"IOException",
"{",
"// run through each variable",
"for",
"(",
"Variable",
"v",
":",
"ncfile",
".",
"getVariables",
"(",
")",
")",
"{",
"if",
"(",
"v",
".",
"isUnlimited",
"(",
")",
")",
"co... | fill buffer with fill value | [
"fill",
"buffer",
"with",
"fill",
"value"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/netcdf3/N3iosp.java#L809-L819 | test | Fill non - record variables. | Of course, here is the Java code you requested:
```java
protected void fillNonRecordVariables() throws IOException {
// run through each variable
for (Variable v : ncfile.getVariables()) {
if (v.isUnlimited()) continue;
try {
writeData(v, v.getShapeAsSection(), makeConstantArray(v));
... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/misc/AbstractLightningIOSP.java | AbstractLightningIOSP.addLightningGlobalAttributes | protected void addLightningGlobalAttributes(NetcdfFile ncfile) {
ncfile.addAttribute(null, new Attribute(CF.FEATURE_TYPE, CF.FeatureType.point.toString()));
ncfile.addAttribute( null, new Attribute(CDM.HISTORY, "Read directly by Netcdf Java IOSP"));
} | java | protected void addLightningGlobalAttributes(NetcdfFile ncfile) {
ncfile.addAttribute(null, new Attribute(CF.FEATURE_TYPE, CF.FeatureType.point.toString()));
ncfile.addAttribute( null, new Attribute(CDM.HISTORY, "Read directly by Netcdf Java IOSP"));
} | [
"protected",
"void",
"addLightningGlobalAttributes",
"(",
"NetcdfFile",
"ncfile",
")",
"{",
"ncfile",
".",
"addAttribute",
"(",
"null",
",",
"new",
"Attribute",
"(",
"CF",
".",
"FEATURE_TYPE",
",",
"CF",
".",
"FeatureType",
".",
"point",
".",
"toString",
"(",
... | Add the global attributes. Specific implementations should call super
and then add their own.
@param ncfile the file to add to | [
"Add",
"the",
"global",
"attributes",
".",
"Specific",
"implementations",
"should",
"call",
"super",
"and",
"then",
"add",
"their",
"own",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/misc/AbstractLightningIOSP.java#L105-L108 | test | Add lightning global attributes to the NetCDF file | Of course, here is the Java code you requested:
```java
protected void addLightningGlobalAttributes(NetcdfFile ncfile) {
ncfile.addAttribute(null, new Attribute(CF.FEATURE_TYPE, CF.FeatureType.point.toString()));
ncfile.addAttribute( null, new Attribute(CDM.HISTORY, "Read directly by Netcdf Java IOSP... |
rupertlssmith/lojix | lojix/logic/src/main/com/thesett/aima/logic/fol/OpSymbol.java | OpSymbol.compareTo | public int compareTo(Object o)
{
OpSymbol opSymbol = (OpSymbol) o;
return (priority < opSymbol.priority) ? -1 : ((priority > opSymbol.priority) ? 1 : 0);
} | java | public int compareTo(Object o)
{
OpSymbol opSymbol = (OpSymbol) o;
return (priority < opSymbol.priority) ? -1 : ((priority > opSymbol.priority) ? 1 : 0);
} | [
"public",
"int",
"compareTo",
"(",
"Object",
"o",
")",
"{",
"OpSymbol",
"opSymbol",
"=",
"(",
"OpSymbol",
")",
"o",
";",
"return",
"(",
"priority",
"<",
"opSymbol",
".",
"priority",
")",
"?",
"-",
"1",
":",
"(",
"(",
"priority",
">",
"opSymbol",
".",... | Compares this object with the specified object for order, providing a negative integer, zero, or a positive
integer as this symbols priority is less than, equal to, or greater than the comparator. If this symbol is 'less'
than another that means that it has a lower priority value, which means that it binds more tightly... | [
"Compares",
"this",
"object",
"with",
"the",
"specified",
"object",
"for",
"order",
"providing",
"a",
"negative",
"integer",
"zero",
"or",
"a",
"positive",
"integer",
"as",
"this",
"symbols",
"priority",
"is",
"less",
"than",
"equal",
"to",
"or",
"greater",
... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/logic/src/main/com/thesett/aima/logic/fol/OpSymbol.java#L267-L272 | test | Compares two NCSA SEGMENTS. | Of course, here is the Java code you requested:
```java
public int compareTo(Object o)
{
OpSymbol opSymbol = (OpSymbol) o;
return (priority < opSymbol.priority) ? -1 : ((priority > opSymbol.priority) ? 1 : 0);
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dataset/EnhancementsImpl.java | EnhancementsImpl.setUnitsString | public void setUnitsString( String units) {
this.units = units;
forVar.addAttribute( new Attribute(CDM.UNITS, units));
} | java | public void setUnitsString( String units) {
this.units = units;
forVar.addAttribute( new Attribute(CDM.UNITS, units));
} | [
"public",
"void",
"setUnitsString",
"(",
"String",
"units",
")",
"{",
"this",
".",
"units",
"=",
"units",
";",
"forVar",
".",
"addAttribute",
"(",
"new",
"Attribute",
"(",
"CDM",
".",
"UNITS",
",",
"units",
")",
")",
";",
"}"
] | Set the Unit String for this Variable. Default is to use the CDM.UNITS attribute.
@param units unit string | [
"Set",
"the",
"Unit",
"String",
"for",
"this",
"Variable",
".",
"Default",
"is",
"to",
"use",
"the",
"CDM",
".",
"UNITS",
"attribute",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dataset/EnhancementsImpl.java#L107-L110 | test | Sets the units string. | Of course, here is the Java code you requested:
```java
public void setUnitsString( String units) {
this.units = units;
forVar.addAttribute( new Attribute(CDM.UNITS, units));
}
```
Hope this helps! |
TeachingKidsProgramming/TeachingKidsProgramming.Source.Java | src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdOut.java | StdOut.printf | public static void printf(String format, Object... args)
{
out.printf(LOCALE, format, args);
out.flush();
} | java | public static void printf(String format, Object... args)
{
out.printf(LOCALE, format, args);
out.flush();
} | [
"public",
"static",
"void",
"printf",
"(",
"String",
"format",
",",
"Object",
"...",
"args",
")",
"{",
"out",
".",
"printf",
"(",
"LOCALE",
",",
"format",
",",
"args",
")",
";",
"out",
".",
"flush",
"(",
")",
";",
"}"
] | Prints a formatted string to standard output, using the specified format
string and arguments, and then flushes standard output.
@param format the <a href = "http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#syntax">format string</a>
@param args the arguments accompanying the format string | [
"Prints",
"a",
"formatted",
"string",
"to",
"standard",
"output",
"using",
"the",
"specified",
"format",
"string",
"and",
"arguments",
"and",
"then",
"flushes",
"standard",
"output",
"."
] | 516fee15e537ecdb3f4dcbe3695c5cfde7e930da | https://github.com/TeachingKidsProgramming/TeachingKidsProgramming.Source.Java/blob/516fee15e537ecdb3f4dcbe3695c5cfde7e930da/src/main/java/org/teachingextensions/logo/utils/MazeUtils/StdOut.java#L287-L291 | test | Print a formatted string in the locale. | Of course, here is the Java code you requested:
```java
public static void printf(String format, Object... args)
{
out.printf(LOCALE, format, args);
out.flush();
}
```
Hope this helps! |
oblac/jodd | jodd-core/src/main/java/jodd/io/FileUtil.java | FileUtil.file | public static File file(String fileName) {
fileName = StringUtil.replace(fileName, USER_HOME, SystemUtil.info().getHomeDir());
return new File(fileName);
} | java | public static File file(String fileName) {
fileName = StringUtil.replace(fileName, USER_HOME, SystemUtil.info().getHomeDir());
return new File(fileName);
} | [
"public",
"static",
"File",
"file",
"(",
"String",
"fileName",
")",
"{",
"fileName",
"=",
"StringUtil",
".",
"replace",
"(",
"fileName",
",",
"USER_HOME",
",",
"SystemUtil",
".",
"info",
"(",
")",
".",
"getHomeDir",
"(",
")",
")",
";",
"return",
"new",
... | Simple factory for {@link File} objects but with home resolving. | [
"Simple",
"factory",
"for",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L72-L75 | test | Returns a File object for the given file name. | Of course, here is the Java code you requested:
```java
public static File file(String fileName) {
fileName = StringUtil.replace(fileName, USER_HOME, SystemUtil.info().getHomeDir());
return new File(fileName);
}
```
Hope this helps! |
wildfly/wildfly | naming/src/main/java/org/jboss/as/naming/service/BinderService.java | BinderService.release | public boolean release() {
if (refcnt != null && refcnt.decrementAndGet() <= 0 && controller != null) {
controller.setMode(ServiceController.Mode.REMOVE);
return true;
}
return false;
} | java | public boolean release() {
if (refcnt != null && refcnt.decrementAndGet() <= 0 && controller != null) {
controller.setMode(ServiceController.Mode.REMOVE);
return true;
}
return false;
} | [
"public",
"boolean",
"release",
"(",
")",
"{",
"if",
"(",
"refcnt",
"!=",
"null",
"&&",
"refcnt",
".",
"decrementAndGet",
"(",
")",
"<=",
"0",
"&&",
"controller",
"!=",
"null",
")",
"{",
"controller",
".",
"setMode",
"(",
"ServiceController",
".",
"Mode"... | Releases the service, returns <code>true</code> if the service is removed as a result, or false otherwise
@return | [
"Releases",
"the",
"service",
"returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"the",
"service",
"is",
"removed",
"as",
"a",
"result",
"or",
"false",
"otherwise"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/naming/src/main/java/org/jboss/as/naming/service/BinderService.java#L104-L110 | test | Release the resource. | Of course, here is the Java code you requested:
```java
public boolean release() {
if (refcnt != null && refcnt.decrementAndGet() <= 0 && controller != null) {
controller.setMode(ServiceController.Mode.REMOVE);
return true;
}
return false;
}
```
Hope this helps! |
playframework/playframework | core/play/src/main/java/play/mvc/Results.java | Results.internalServerError | public static Result internalServerError(File content, String filename) {
return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | java | public static Result internalServerError(File content, String filename) {
return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes());
} | [
"public",
"static",
"Result",
"internalServerError",
"(",
"File",
"content",
",",
"String",
"filename",
")",
"{",
"return",
"internalServerError",
"(",
"content",
",",
"filename",
",",
"StaticFileMimeTypes",
".",
"fileMimeTypes",
"(",
")",
")",
";",
"}"
] | Generates a 500 Internal Server Error result.
@param content The file to send.
@param filename The name to send the file as.
@return the result | [
"Generates",
"a",
"500",
"Internal",
"Server",
"Error",
"result",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/mvc/Results.java#L4038-L4040 | test | Returns an error response with a file with the given content and filename. | Of course, here is the Java code you requested:
```java
public static Result internalServerError(File content, String filename) {
return internalServerError(content, filename, StaticFileMimeTypes.fileMimeTypes());
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | Kyero/src/main/jaxb/org/openestate/io/kyero/xml/Root.java | Root.setAgent | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T01:43:04+02:00", comments = "JAXB RI v2.2.11")
public void setAgent(Root.Agent value) {
this.agent = value;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T01:43:04+02:00", comments = "JAXB RI v2.2.11")
public void setAgent(Root.Agent value) {
this.agent = value;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T01:43:04+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"void",
"setAgent",
"(",
"Root",
".",
"Agent",
"value",
")",
"{",
"this",
".",
"ag... | Sets the value of the agent property.
@param value
allowed object is
{@link Root.Agent } | [
"Sets",
"the",
"value",
"of",
"the",
"agent",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Kyero/src/main/jaxb/org/openestate/io/kyero/xml/Root.java#L138-L141 | test | Sets the value of the agent property. | Of course, here is the Java code you requested:
```java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T01:43:04+02:00", comments = "JAXB RI v2.2.11")
public void setAgent(Root.Agent value) {
this.agent = value;
}
```
Hope this helps! |
jcodec/jcodec | src/main/java/net/sourceforge/jaad/aac/syntax/BitStream.java | BitStream.skipBits | @Override
public void skipBits(int n) throws AACException {
position += n;
if(n<=bitsCached) {
bitsCached -= n;
}
else {
n -= bitsCached;
while(n>=WORD_BITS) {
n -= WORD_BITS;
readCache(false);
}
if(n>0) {
cache = readCache(false);
bitsCached = WORD_BITS-n;
}
else {
... | java | @Override
public void skipBits(int n) throws AACException {
position += n;
if(n<=bitsCached) {
bitsCached -= n;
}
else {
n -= bitsCached;
while(n>=WORD_BITS) {
n -= WORD_BITS;
readCache(false);
}
if(n>0) {
cache = readCache(false);
bitsCached = WORD_BITS-n;
}
else {
... | [
"@",
"Override",
"public",
"void",
"skipBits",
"(",
"int",
"n",
")",
"throws",
"AACException",
"{",
"position",
"+=",
"n",
";",
"if",
"(",
"n",
"<=",
"bitsCached",
")",
"{",
"bitsCached",
"-=",
"n",
";",
"}",
"else",
"{",
"n",
"-=",
"bitsCached",
";"... | /* (non-Javadoc)
@see net.sourceforge.jaad.aac.syntax.IBitStream#skipBits(int) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/net/sourceforge/jaad/aac/syntax/BitStream.java#L195-L216 | test | Skips the specified number of bits. | Of course, here is the Java code you requested:
```java
@Override
public void skipBits(int n) throws AACException {
position += n;
if(n<=bitsCached) {
bitsCached -= n;
}
else {
n -= bitsCached;
while(n>=WORD_BITS) {
n -= WORD_BITS;
readCache(false);
}
if(n>0) {
cache = readCache(... |
wildfly/wildfly | ejb3/src/main/java/org/jboss/as/ejb3/component/interceptors/ShutDownInterceptorFactory.java | ShutDownInterceptorFactory.shutdown | public void shutdown() {
int value;
int oldValue;
//set the shutdown bit
do {
oldValue = invocationCount;
value = SHUTDOWN_FLAG | oldValue;
//the component has already been shutdown
if (oldValue == value) {
return;
... | java | public void shutdown() {
int value;
int oldValue;
//set the shutdown bit
do {
oldValue = invocationCount;
value = SHUTDOWN_FLAG | oldValue;
//the component has already been shutdown
if (oldValue == value) {
return;
... | [
"public",
"void",
"shutdown",
"(",
")",
"{",
"int",
"value",
";",
"int",
"oldValue",
";",
"//set the shutdown bit",
"do",
"{",
"oldValue",
"=",
"invocationCount",
";",
"value",
"=",
"SHUTDOWN_FLAG",
"|",
"oldValue",
";",
"//the component has already been shutdown",
... | Upon calling this method the EJB will be set to a shutdown state, and no further invocations will be allowed.
It will then wait for all active invocation to finish and then return. | [
"Upon",
"calling",
"this",
"method",
"the",
"EJB",
"will",
"be",
"set",
"to",
"a",
"shutdown",
"state",
"and",
"no",
"further",
"invocations",
"will",
"be",
"allowed",
".",
"It",
"will",
"then",
"wait",
"for",
"all",
"active",
"invocation",
"to",
"finish",... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ejb3/src/main/java/org/jboss/as/ejb3/component/interceptors/ShutDownInterceptorFactory.java#L94-L121 | test | Shutdown the application. | Of course, here is the Java code you requested:
```java
public void shutdown() {
int value;
int oldValue;
//set the shutdown bit
do {
oldValue = invocationCount;
value = SHUTDOWN_FLAG | oldValue;
//the component has already been shutdown
i... |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/AbstractSecurityBuilder.java | AbstractSecurityBuilder.build | public final O build() throws Exception {
if (this.building.compareAndSet(false, true)) {
this.object = doBuild();
return this.object;
}
throw new AlreadyBuiltException("This object has already been built");
} | java | public final O build() throws Exception {
if (this.building.compareAndSet(false, true)) {
this.object = doBuild();
return this.object;
}
throw new AlreadyBuiltException("This object has already been built");
} | [
"public",
"final",
"O",
"build",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"this",
".",
"building",
".",
"compareAndSet",
"(",
"false",
",",
"true",
")",
")",
"{",
"this",
".",
"object",
"=",
"doBuild",
"(",
")",
";",
"return",
"this",
".",
... | /*
(non-Javadoc)
@see org.springframework.security.config.annotation.SecurityBuilder#build() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/AbstractSecurityBuilder.java#L39-L45 | test | Build the object. | Of course, here is the Java code you requested:
```java
public final O build() throws Exception {
if (this.building.compareAndSet(false, true)) {
this.object = doBuild();
return this.object;
}
throw new AlreadyBuiltException("This object has already been built");
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/criteria/Selector.java | Selector.selectFrom | public static <ITEM> List<Map<String, Object>> selectFrom(List<Selector> selectors, Collection<ITEM> results, Map<String, FieldAccess> fields) {
List<Map<String, Object>> rows = new ArrayList<>( results.size() );
for ( Selector s : selectors ) {
s.handleStart( results );
}
... | java | public static <ITEM> List<Map<String, Object>> selectFrom(List<Selector> selectors, Collection<ITEM> results, Map<String, FieldAccess> fields) {
List<Map<String, Object>> rows = new ArrayList<>( results.size() );
for ( Selector s : selectors ) {
s.handleStart( results );
}
... | [
"public",
"static",
"<",
"ITEM",
">",
"List",
"<",
"Map",
"<",
"String",
",",
"Object",
">",
">",
"selectFrom",
"(",
"List",
"<",
"Selector",
">",
"selectors",
",",
"Collection",
"<",
"ITEM",
">",
"results",
",",
"Map",
"<",
"String",
",",
"FieldAccess... | Performs the actual selection from the results.
@param selectors list of selectors
@param results results we are selecting from
@param fields fields
@param <ITEM> List of items
@return map of selected items per row | [
"Performs",
"the",
"actual",
"selection",
"from",
"the",
"results",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/criteria/Selector.java#L117-L141 | test | Select from. | Of course, here is the Java code you requested:
```java
public static <ITEM> List<Map<String, Object>> selectFrom(List<Selector> selectors, Collection<ITEM> results, Map<String, FieldAccess> fields) {
List<Map<String, Object>> rows = new ArrayList<>( results.size() );
for ( Selector s : selectors ) {... |
markhobson/microbrowser | tck/src/main/java/org/hobsoft/microbrowser/tck/LinkTck.java | LinkTck.unwrapWithUnknownTypeThrowsException | @Test
public void unwrapWithUnknownTypeThrowsException()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<a rel='x'/>"
+ "</body></html>"));
Link link = newBrowser().get(url(server()))
.getLink("x");
thrown().expect(IllegalArgumentException.class);
thrown().expectMessage("Cannot u... | java | @Test
public void unwrapWithUnknownTypeThrowsException()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<a rel='x'/>"
+ "</body></html>"));
Link link = newBrowser().get(url(server()))
.getLink("x");
thrown().expect(IllegalArgumentException.class);
thrown().expectMessage("Cannot u... | [
"@",
"Test",
"public",
"void",
"unwrapWithUnknownTypeThrowsException",
"(",
")",
"{",
"server",
"(",
")",
".",
"enqueue",
"(",
"new",
"MockResponse",
"(",
")",
".",
"setBody",
"(",
"\"<html><body>\"",
"+",
"\"<a rel='x'/>\"",
"+",
"\"</body></html>\"",
")",
")",... | ---------------------------------------------------------------------------------------------------------------- | [
"----------------------------------------------------------------------------------------------------------------"
] | 732d2dadc1c3eaad688de31dc09f360df580faf1 | https://github.com/markhobson/microbrowser/blob/732d2dadc1c3eaad688de31dc09f360df580faf1/tck/src/main/java/org/hobsoft/microbrowser/tck/LinkTck.java#L267-L281 | test | Unwrap with unknown type throws exception | Of course, here is the Java code you requested:
```java
@Test
public void unwrapWithUnknownTypeThrowsException()
{
server().enqueue(new MockResponse().setBody("<html><body>"
+ "<a rel='x'/>"
+ "</body></html>"));
Link link = newBrowser().get(url(server()))
.getLink("x");
thrown().expect(IllegalArg... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/util/StatusPrinter.java | StatusPrinter.print | public static void print(Context context, long threshold) {
if (context == null) {
throw new IllegalArgumentException("Context argument cannot be null");
}
StatusManager sm = context.getStatusManager();
if (sm == null) {
ps.println("WARN: Context named \"" + context.getName()
... | java | public static void print(Context context, long threshold) {
if (context == null) {
throw new IllegalArgumentException("Context argument cannot be null");
}
StatusManager sm = context.getStatusManager();
if (sm == null) {
ps.println("WARN: Context named \"" + context.getName()
... | [
"public",
"static",
"void",
"print",
"(",
"Context",
"context",
",",
"long",
"threshold",
")",
"{",
"if",
"(",
"context",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Context argument cannot be null\"",
")",
";",
"}",
"StatusManage... | Print context's status data with a timestamp higher than the threshold.
@param context | [
"Print",
"context",
"s",
"status",
"data",
"with",
"a",
"timestamp",
"higher",
"than",
"the",
"threshold",
"."
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/util/StatusPrinter.java#L109-L121 | test | Print the status of a context. | Of course, here is the Java code you requested:
```java
public static void print(Context context, long threshold) {
if (context == null) {
throw new IllegalArgumentException("Context argument cannot be null");
}
StatusManager sm = context.getStatusManager();
if (sm == null) {
ps.prin... |
algolia/algoliasearch-client-android | algoliasearch/src/main/java/com/algolia/search/saas/Index.java | Index.setSettingsAsync | public Request setSettingsAsync(final @NonNull JSONObject settings, @Nullable CompletionHandler completionHandler) {
return setSettingsAsync(settings, /* forwardToReplicas: */ false, /* requestOptions: */ null, completionHandler);
} | java | public Request setSettingsAsync(final @NonNull JSONObject settings, @Nullable CompletionHandler completionHandler) {
return setSettingsAsync(settings, /* forwardToReplicas: */ false, /* requestOptions: */ null, completionHandler);
} | [
"public",
"Request",
"setSettingsAsync",
"(",
"final",
"@",
"NonNull",
"JSONObject",
"settings",
",",
"@",
"Nullable",
"CompletionHandler",
"completionHandler",
")",
"{",
"return",
"setSettingsAsync",
"(",
"settings",
",",
"/* forwardToReplicas: */",
"false",
",",
"/*... | Set this index's settings (asynchronously).
<p>
Please refer to our <a href="https://www.algolia.com/doc/android#index-settings">API documentation</a> for the
list of supported settings.
@param settings New settings.
@param completionHandler The listener that will be notified of the request's outcome.
@return... | [
"Set",
"this",
"index",
"s",
"settings",
"(",
"asynchronously",
")",
".",
"<p",
">",
"Please",
"refer",
"to",
"our",
"<a",
"href",
"=",
"https",
":",
"//",
"www",
".",
"algolia",
".",
"com",
"/",
"doc",
"/",
"android#index",
"-",
"settings",
">",
"AP... | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/main/java/com/algolia/search/saas/Index.java#L846-L848 | test | Sets the settings for the current session. | Of course, here is the Java code you requested:
```java
public Request setSettingsAsync(final @NonNull JSONObject settings, @Nullable CompletionHandler completionHandler) {
return setSettingsAsync(settings, /* forwardToReplicas: */ false, /* requestOptions: */ null, completionHandler);
}
```
Hope this hel... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/FileHelper.java | FileHelper.readURL | public static File readURL(String urlStr) throws IOException {
URL url = new URL(urlStr);
// System.out.println(" ----------------- url ----------------- ");
// System.out.println(urlStr);
// System.out.println(url.getPath());
// System.out.println(url.getHost());
// Syst... | java | public static File readURL(String urlStr) throws IOException {
URL url = new URL(urlStr);
// System.out.println(" ----------------- url ----------------- ");
// System.out.println(urlStr);
// System.out.println(url.getPath());
// System.out.println(url.getHost());
// Syst... | [
"public",
"static",
"File",
"readURL",
"(",
"String",
"urlStr",
")",
"throws",
"IOException",
"{",
"URL",
"url",
"=",
"new",
"URL",
"(",
"urlStr",
")",
";",
"// System.out.println(\" ----------------- url ----------------- \");",
"// System.out.println(urlStr);",
"// Syst... | 从url地址读取文件信息并写入到临时文件 <br>
2013-9-2 下午2:57:15
@param urlStr
@return
@throws java.io.IOException | [
"从url地址读取文件信息并写入到临时文件",
"<br",
">",
"2013",
"-",
"9",
"-",
"2",
"下午2",
":",
"57",
":",
"15"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/FileHelper.java#L183-L199 | test | Read a URL into a File. | Of course, here is the Java code you requested:
```java
public static File readURL(String urlStr) throws IOException {
URL url = new URL(urlStr);
// System.out.println(" ----------------- url ----------------- ");
// System.out.println(urlStr);
// System.out.println(url.getPath());
... |
oblac/jodd | jodd-core/src/main/java/jodd/io/FileUtil.java | FileUtil._moveFile | private static void _moveFile(final File srcFile, final File destFile) throws IOException {
if (destFile.exists()) {
checkIsFile(destFile);
destFile.delete();
}
final boolean rename = srcFile.renameTo(destFile);
if (!rename) {
_copyFile(srcFile, destFile);
srcFile.delete();
}
} | java | private static void _moveFile(final File srcFile, final File destFile) throws IOException {
if (destFile.exists()) {
checkIsFile(destFile);
destFile.delete();
}
final boolean rename = srcFile.renameTo(destFile);
if (!rename) {
_copyFile(srcFile, destFile);
srcFile.delete();
}
} | [
"private",
"static",
"void",
"_moveFile",
"(",
"final",
"File",
"srcFile",
",",
"final",
"File",
"destFile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"destFile",
".",
"exists",
"(",
")",
")",
"{",
"checkIsFile",
"(",
"destFile",
")",
";",
"destFile",
... | Moves a {@link File}.
@param srcFile Source {@link File}.
@param destFile Destination directory.
@throws IOException | [
"Moves",
"a",
"{",
"@link",
"File",
"}",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L396-L407 | test | Move file. | Of course, here is the Java code you requested:
```java
private static void _moveFile(final File srcFile, final File destFile) throws IOException {
if (destFile.exists()) {
checkIsFile(destFile);
destFile.delete();
}
final boolean rename = srcFile.renameTo(destFile);
if (!rename) {
_copyFile(srcFile,... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/AGenericListMessageHandler.java | AGenericListMessageHandler.uncompress | protected byte[] uncompress(
byte[] compressedBytesParam
) throws IOException {
byte[] buffer = new byte[1024];
byte[] returnVal = null;
ZipInputStream zis = null;
if(CHARSET == null) {
zis = new ZipInputStream(
new ByteArrayInputStream(compressedBytesParam));
} else {
zis = new ZipInputStrea... | java | protected byte[] uncompress(
byte[] compressedBytesParam
) throws IOException {
byte[] buffer = new byte[1024];
byte[] returnVal = null;
ZipInputStream zis = null;
if(CHARSET == null) {
zis = new ZipInputStream(
new ByteArrayInputStream(compressedBytesParam));
} else {
zis = new ZipInputStrea... | [
"protected",
"byte",
"[",
"]",
"uncompress",
"(",
"byte",
"[",
"]",
"compressedBytesParam",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"buffer",
"=",
"new",
"byte",
"[",
"1024",
"]",
";",
"byte",
"[",
"]",
"returnVal",
"=",
"null",
";",
"ZipI... | Uncompress the raw {@code compressedBytesParam}.
@param compressedBytesParam The compressed bytes to uncompress.
@return Uncompressed bytes.
@throws IOException - If there is an issue during the un-compression. | [
"Uncompress",
"the",
"raw",
"{",
"@code",
"compressedBytesParam",
"}",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/AGenericListMessageHandler.java#L399-L439 | test | Uncompress the given bytes parameter into a byte array. | Of course, here is the Java code you requested:
```java
protected byte[] uncompress(
byte[] compressedBytesParam
) throws IOException {
byte[] buffer = new byte[1024];
byte[] returnVal = null;
ZipInputStream zis = null;
if(CHARSET == null) {
zis = new ZipInputStream(
new ByteArrayInputStream(comp... |
Unidata/thredds | dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java | DMRPrinter.isSpecial | static boolean isSpecial(DapAttribute attr)
{
if(attr.getParent().getSort() == DapSort.DATASET) {
for(String s : GROUPSPECIAL) {
if(s.equals(attr.getShortName()))
return true;
}
} else if(attr.getParent().getSort() == DapSort.VARIABLE) {
... | java | static boolean isSpecial(DapAttribute attr)
{
if(attr.getParent().getSort() == DapSort.DATASET) {
for(String s : GROUPSPECIAL) {
if(s.equals(attr.getShortName()))
return true;
}
} else if(attr.getParent().getSort() == DapSort.VARIABLE) {
... | [
"static",
"boolean",
"isSpecial",
"(",
"DapAttribute",
"attr",
")",
"{",
"if",
"(",
"attr",
".",
"getParent",
"(",
")",
".",
"getSort",
"(",
")",
"==",
"DapSort",
".",
"DATASET",
")",
"{",
"for",
"(",
"String",
"s",
":",
"GROUPSPECIAL",
")",
"{",
"if... | Special here is not the same as reserved
@param attr
@return | [
"Special",
"here",
"is",
"not",
"the",
"same",
"as",
"reserved"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4lib/src/main/java/dap4/dap4lib/DMRPrinter.java#L465-L479 | test | isSpecial returns true if the attribute is a special attribute | Of course, here is the Java code you requested:
```java
static boolean isSpecial(DapAttribute attr)
{
if(attr.getParent().getSort() == DapSort.DATASET) {
for(String s : GROUPSPECIAL) {
if(s.equals(attr.getShortName()))
return true;
}
} els... |
oblac/jodd | jodd-proxetta/src/main/java/jodd/asm/AsmUtil.java | AsmUtil.floatValue | public static void floatValue(final MethodVisitor mv) {
mv.visitTypeInsn(CHECKCAST, SIGNATURE_JAVA_LANG_FLOAT);
mv.visitMethodInsn(INVOKEVIRTUAL, SIGNATURE_JAVA_LANG_FLOAT, "floatValue", "()F", false);
} | java | public static void floatValue(final MethodVisitor mv) {
mv.visitTypeInsn(CHECKCAST, SIGNATURE_JAVA_LANG_FLOAT);
mv.visitMethodInsn(INVOKEVIRTUAL, SIGNATURE_JAVA_LANG_FLOAT, "floatValue", "()F", false);
} | [
"public",
"static",
"void",
"floatValue",
"(",
"final",
"MethodVisitor",
"mv",
")",
"{",
"mv",
".",
"visitTypeInsn",
"(",
"CHECKCAST",
",",
"SIGNATURE_JAVA_LANG_FLOAT",
")",
";",
"mv",
".",
"visitMethodInsn",
"(",
"INVOKEVIRTUAL",
",",
"SIGNATURE_JAVA_LANG_FLOAT",
... | Converts <code>Float</code> object to a <code>float</code>. | [
"Converts",
"<code",
">",
"Float<",
"/",
"code",
">",
"object",
"to",
"a",
"<code",
">",
"float<",
"/",
"code",
">",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-proxetta/src/main/java/jodd/asm/AsmUtil.java#L334-L337 | test | Generates the instruction to convert a float to a float. | Of course, here is the Java code you requested:
```java
public static void floatValue(final MethodVisitor mv) {
mv.visitTypeInsn(CHECKCAST, SIGNATURE_JAVA_LANG_FLOAT);
mv.visitMethodInsn(INVOKEVIRTUAL, SIGNATURE_JAVA_LANG_FLOAT, "floatValue", "()F", false);
}
```
Hope this helps! |
Unidata/thredds | bufr/src/main/java/ucar/nc2/iosp/bufr/tables/NcepMnemonic.java | NcepMnemonic.read | public static boolean read(InputStream ios, BufrTables.Tables tables) throws IOException {
if (ios == null)
return false;
if (tables.b == null)
tables.b = new TableB("fake", "fake");
if (tables.d == null)
tables.d = new TableD("fake", "fake");
HashMap<String, String> number ... | java | public static boolean read(InputStream ios, BufrTables.Tables tables) throws IOException {
if (ios == null)
return false;
if (tables.b == null)
tables.b = new TableB("fake", "fake");
if (tables.d == null)
tables.d = new TableD("fake", "fake");
HashMap<String, String> number ... | [
"public",
"static",
"boolean",
"read",
"(",
"InputStream",
"ios",
",",
"BufrTables",
".",
"Tables",
"tables",
")",
"throws",
"IOException",
"{",
"if",
"(",
"ios",
"==",
"null",
")",
"return",
"false",
";",
"if",
"(",
"tables",
".",
"b",
"==",
"null",
"... | Read NCEP mnemonic BUFR tables.
@return boolean
@throws IOException | [
"Read",
"NCEP",
"mnemonic",
"BUFR",
"tables",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/bufr/src/main/java/ucar/nc2/iosp/bufr/tables/NcepMnemonic.java#L52-L284 | test | Reads the contents of the specified input stream and creates the appropriate tables object. | Of course, here is the Java code you requested:
```java
public static boolean read(InputStream ios, BufrTables.Tables tables) throws IOException {
if (ios == null)
return false;
if (tables.b == null)
tables.b = new TableB("fake", "fake");
if (tables.d == null)
tables.d = new Table... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/user/UserNotification.java | UserNotification.toJsonObject | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//User...
if(this.getUser() != null)
{
returnVal.put(JSONMapping.USER,
this.getUser().toJsonObject());
}
//Date Created...... | java | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//User...
if(this.getUser() != null)
{
returnVal.put(JSONMapping.USER,
this.getUser().toJsonObject());
}
//Date Created...... | [
"@",
"Override",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//User...",
"if",
"(",
"this",
".",
"getUser",
"(",
")",
"!=",
"null",
")",
"{"... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code UserNotification}
@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/user/UserNotification.java#L263-L305 | test | Override toJsonObject to return JSONObject for a
| Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//User...
if(this.getUser() != null)
{
returnVal.put(JSONMapping.USER,
this.getUse... |
RestComm/jain-slee | container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileObjectImpl.java | ProfileObjectImpl.fireAddOrUpdatedEventIfNeeded | public void fireAddOrUpdatedEventIfNeeded() {
if (state == ProfileObjectState.READY) {
if (profileEntity.isDirty()) {
// check the table fires events and the object is not assigned to a default profile
if (profileTable.doesFireEvents() && profileEntity.getProfileName() != null && profileTable.getSleeCon... | java | public void fireAddOrUpdatedEventIfNeeded() {
if (state == ProfileObjectState.READY) {
if (profileEntity.isDirty()) {
// check the table fires events and the object is not assigned to a default profile
if (profileTable.doesFireEvents() && profileEntity.getProfileName() != null && profileTable.getSleeCon... | [
"public",
"void",
"fireAddOrUpdatedEventIfNeeded",
"(",
")",
"{",
"if",
"(",
"state",
"==",
"ProfileObjectState",
".",
"READY",
")",
"{",
"if",
"(",
"profileEntity",
".",
"isDirty",
"(",
")",
")",
"{",
"// check the table fires events and the object is not assigned to... | Fires a profile added or updated event if the profile object state is ready and the persistent state is dirty | [
"Fires",
"a",
"profile",
"added",
"or",
"updated",
"event",
"if",
"the",
"profile",
"object",
"state",
"is",
"ready",
"and",
"the",
"persistent",
"state",
"is",
"dirty"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileObjectImpl.java#L769-L802 | test | Fire an Add or Updated Event if necessary. | Of course, here is the Java code you requested:
```java
public void fireAddOrUpdatedEventIfNeeded() {
if (state == ProfileObjectState.READY) {
if (profileEntity.isDirty()) {
// check the table fires events and the object is not assigned to a default profile
if (profileTable.doesFireEvents() && profileE... |
real-logic/aeron | aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java | PublicationImage.processPendingLoss | int processPendingLoss()
{
int workCount = 0;
final long changeNumber = endLossChange;
if (changeNumber != lastLossChangeNumber)
{
final int termId = lossTermId;
final int termOffset = lossTermOffset;
final int length = lossLength;
UN... | java | int processPendingLoss()
{
int workCount = 0;
final long changeNumber = endLossChange;
if (changeNumber != lastLossChangeNumber)
{
final int termId = lossTermId;
final int termOffset = lossTermOffset;
final int length = lossLength;
UN... | [
"int",
"processPendingLoss",
"(",
")",
"{",
"int",
"workCount",
"=",
"0",
";",
"final",
"long",
"changeNumber",
"=",
"endLossChange",
";",
"if",
"(",
"changeNumber",
"!=",
"lastLossChangeNumber",
")",
"{",
"final",
"int",
"termId",
"=",
"lossTermId",
";",
"f... | Called from the {@link Receiver} thread to processing any pending loss of packets.
@return number of work items processed. | [
"Called",
"from",
"the",
"{",
"@link",
"Receiver",
"}",
"thread",
"to",
"processing",
"any",
"pending",
"loss",
"of",
"packets",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-driver/src/main/java/io/aeron/driver/PublicationImage.java#L643-L679 | test | Process pending loss. | Of course, here is the Java code you requested:
```java
int processPendingLoss()
{
int workCount = 0;
final long changeNumber = endLossChange;
if (changeNumber != lastLossChangeNumber)
{
final int termId = lossTermId;
final int termOffset = lossTermOffset;
... |
Unidata/thredds | visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java | GempakGridReader.DM_RPKG | public float[] DM_RPKG(int isword, int nword, int decimalScale)
throws IOException {
// from DM_RPKG
// read the data packing type
float[] data;
int ipktyp = DM_RINT(isword);
int iiword = isword + 1;
int lendat = nword - 1;
if (ipktyp == MDGNON) { // no packing
data = new fl... | java | public float[] DM_RPKG(int isword, int nword, int decimalScale)
throws IOException {
// from DM_RPKG
// read the data packing type
float[] data;
int ipktyp = DM_RINT(isword);
int iiword = isword + 1;
int lendat = nword - 1;
if (ipktyp == MDGNON) { // no packing
data = new fl... | [
"public",
"float",
"[",
"]",
"DM_RPKG",
"(",
"int",
"isword",
",",
"int",
"nword",
",",
"int",
"decimalScale",
")",
"throws",
"IOException",
"{",
"// from DM_RPKG",
"// read the data packing type",
"float",
"[",
"]",
"data",
";",
"int",
"ipktyp",
"=",
"DM_RINT... | Unpack a packed grid
@param isword starting word (1 based)
@param nword number of words to read
@param decimalScale decimal scale
@return array of unpacked data or null;
@throws IOException problem reading data | [
"Unpack",
"a",
"packed",
"grid"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/visad/src/main/java/ucar/nc2/iosp/gempak/GempakGridReader.java#L393-L450 | test | read the data in the DM_RPKG format | Of course, here is the Java code you requested:
```java
public float[] DM_RPKG(int isword, int nword, int decimalScale)
throws IOException {
// from DM_RPKG
// read the data packing type
float[] data;
int ipktyp = DM_RINT(isword);
int iiword = isword + 1;
int lendat = nword - 1;
i... |
RestComm/jain-slee | container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/ChildRelationImpl.java | ChildRelationImpl.clear | @SuppressWarnings("rawtypes")
public void clear() {
sleeContainer.getTransactionManager().mandateTransaction();
for (Iterator it = iterator();it.hasNext();) {
it.next();
it.remove();
}
} | java | @SuppressWarnings("rawtypes")
public void clear() {
sleeContainer.getTransactionManager().mandateTransaction();
for (Iterator it = iterator();it.hasNext();) {
it.next();
it.remove();
}
} | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"void",
"clear",
"(",
")",
"{",
"sleeContainer",
".",
"getTransactionManager",
"(",
")",
".",
"mandateTransaction",
"(",
")",
";",
"for",
"(",
"Iterator",
"it",
"=",
"iterator",
"(",
")",
";",
"i... | /*
(non-Javadoc)
@see java.util.Collection#clear() | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/services/src/main/java/org/mobicents/slee/runtime/sbbentity/ChildRelationImpl.java#L174-L181 | test | Removes all items from the list. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("rawtypes")
public void clear() {
sleeContainer.getTransactionManager().mandateTransaction();
for (Iterator it = iterator();it.hasNext();) {
it.next();
it.remove();
}
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java | ObjectFactory.createBefeuerungsArtTypFernwaerme | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Fernwaerme", scope = BefeuerungsArtTyp.class)
public JAXBElement<Object> createBefeuerungsArtTypFernwaerme(Object value) {
return new JAXBElement<Object>(_BefeuerungsArtTypFernwaerme_QNAME, Object.class, BefeuerungsArt... | java | @XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Fernwaerme", scope = BefeuerungsArtTyp.class)
public JAXBElement<Object> createBefeuerungsArtTypFernwaerme(Object value) {
return new JAXBElement<Object>(_BefeuerungsArtTypFernwaerme_QNAME, Object.class, BefeuerungsArt... | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immobilienscout24.de/immobilientransfer\"",
",",
"name",
"=",
"\"Fernwaerme\"",
",",
"scope",
"=",
"BefeuerungsArtTyp",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"Object",
">",
"createBefeuerungsArtTypFern... | Create an instance of {@link JAXBElement }{@code <}{@link Object }{@code >}} | [
"Create",
"an",
"instance",
"of",
"{",
"@link",
"JAXBElement",
"}",
"{",
"@code",
"<",
"}",
"{",
"@link",
"Object",
"}",
"{",
"@code",
">",
"}}"
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/ObjectFactory.java#L1233-L1236 | test | Create an instance of a Fernwaerme - Element in the immobilientransfer namespace. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immobilienscout24.de/immobilientransfer", name = "Fernwaerme", scope = BefeuerungsArtTyp.class)
public JAXBElement<Object> createBefeuerungsArtTypFernwaerme(Object value) {
return new JAXBElement<Object>(_Befeue... |
ReactiveX/RxJava | src/main/java/io/reactivex/Maybe.java | Maybe.repeatWhen | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> repeatWhen(final Function<? super Flowable<Object>, ? extends Publisher<?>> handler) {
return toFlowable().repeatWhen(handler);
} | java | @BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> repeatWhen(final Function<? super Flowable<Object>, ? extends Publisher<?>> handler) {
return toFlowable().repeatWhen(handler);
} | [
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"repeatWhen",
"(",
"final",
"Function",
"<",
"?",
... | Returns a Flowable that emits the same values as the source Publisher with the exception of an
{@code onComplete}. An {@code onComplete} notification from the source will result in the emission of
a {@code void} item to the Publisher provided as an argument to the {@code notificationHandler}
function. If that Publisher... | [
"Returns",
"a",
"Flowable",
"that",
"emits",
"the",
"same",
"values",
"as",
"the",
"source",
"Publisher",
"with",
"the",
"exception",
"of",
"an",
"{",
"@code",
"onComplete",
"}",
".",
"An",
"{",
"@code",
"onComplete",
"}",
"notification",
"from",
"the",
"s... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Maybe.java#L3967-L3972 | test | Repeats the source sequence when one of the source sequence completes. | Of course, here is the Java code you requested:
```java
@BackpressureSupport(BackpressureKind.FULL)
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> repeatWhen(final Function<? super Flowable<Object>, ? extends Publisher<?>> handler) {
return toFlowable().repeatWh... |
boonproject/boon | boon/src/main/java/org/boon/core/reflection/BeanUtils.java | BeanUtils.getCollectionProp | private static Object getCollectionProp(Object o, String propName, int index, String[] path
) {
o = _getFieldValuesFromCollectionOrArray(o, propName);
if ( index + 1 == path.length ) {
return o;
} else {
index++;
ret... | java | private static Object getCollectionProp(Object o, String propName, int index, String[] path
) {
o = _getFieldValuesFromCollectionOrArray(o, propName);
if ( index + 1 == path.length ) {
return o;
} else {
index++;
ret... | [
"private",
"static",
"Object",
"getCollectionProp",
"(",
"Object",
"o",
",",
"String",
"propName",
",",
"int",
"index",
",",
"String",
"[",
"]",
"path",
")",
"{",
"o",
"=",
"_getFieldValuesFromCollectionOrArray",
"(",
"o",
",",
"propName",
")",
";",
"if",
... | This is an amazing little recursive method. It walks a fanout of
nested collection to pull out the leaf nodes | [
"This",
"is",
"an",
"amazing",
"little",
"recursive",
"method",
".",
"It",
"walks",
"a",
"fanout",
"of",
"nested",
"collection",
"to",
"pull",
"out",
"the",
"leaf",
"nodes"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/core/reflection/BeanUtils.java#L914-L924 | test | getCollectionProp - Get a Collection Property. | Of course, here is the Java code you requested:
```java
private static Object getCollectionProp(Object o, String propName, int index, String[] path
) {
o = _getFieldValuesFromCollectionOrArray(o, propName);
if ( index + 1 == path.length ) {
return... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java | Nidsheader.pcode_radial | int pcode_radial( ByteBuffer bos, int hoff, int hedsiz, boolean isZ, byte[] data, short[] threshold ) throws IOException
{
byte[] b2 = new byte[2];
int soff;
ArrayList dims = new ArrayList();
int iscale = 1; /* data scale */
... | java | int pcode_radial( ByteBuffer bos, int hoff, int hedsiz, boolean isZ, byte[] data, short[] threshold ) throws IOException
{
byte[] b2 = new byte[2];
int soff;
ArrayList dims = new ArrayList();
int iscale = 1; /* data scale */
... | [
"int",
"pcode_radial",
"(",
"ByteBuffer",
"bos",
",",
"int",
"hoff",
",",
"int",
"hedsiz",
",",
"boolean",
"isZ",
",",
"byte",
"[",
"]",
"data",
",",
"short",
"[",
"]",
"threshold",
")",
"throws",
"IOException",
"{",
"byte",
"[",
"]",
"b2",
"=",
"new... | construct a radial dataset for NIDS radial products;
@param bos, hoff, hedsiz, isZ, data, threshold
@return soff -- not used | [
"construct",
"a",
"radial",
"dataset",
"for",
"NIDS",
"radial",
"products",
";"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/iosp/nids/Nidsheader.java#L1590-L1786 | test | Reads the data from the specified ByteBuffer and creates a list of bytes representing the data in the specified ByteBuffer. | Of course, here is the Java code you requested:
```java
int pcode_radial( ByteBuffer bos, int hoff, int hedsiz, boolean isZ, byte[] data, short[] threshold ) throws IOException
{
byte[] b2 = new byte[2];
int soff;
ArrayList dims = new ArrayList();
int iscale = 1; ... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/translate/ClassPopulator.java | ClassPopulator.isOfInterest | private boolean isOfInterest(Field field) {
return !field.isAnnotationPresent(Ignore.class)
&& ((field.getModifiers() & NOT_SAVEABLE_MODIFIERS) == 0)
&& !field.isSynthetic()
&& !field.getName().startsWith("bitmap$init"); // Scala adds a field bitmap$init$0 and bitmap$init$1 etc
} | java | private boolean isOfInterest(Field field) {
return !field.isAnnotationPresent(Ignore.class)
&& ((field.getModifiers() & NOT_SAVEABLE_MODIFIERS) == 0)
&& !field.isSynthetic()
&& !field.getName().startsWith("bitmap$init"); // Scala adds a field bitmap$init$0 and bitmap$init$1 etc
} | [
"private",
"boolean",
"isOfInterest",
"(",
"Field",
"field",
")",
"{",
"return",
"!",
"field",
".",
"isAnnotationPresent",
"(",
"Ignore",
".",
"class",
")",
"&&",
"(",
"(",
"field",
".",
"getModifiers",
"(",
")",
"&",
"NOT_SAVEABLE_MODIFIERS",
")",
"==",
"... | Determine if we should create a Property for the field. Things we ignore: static, final, @Ignore, synthetic | [
"Determine",
"if",
"we",
"should",
"create",
"a",
"Property",
"for",
"the",
"field",
".",
"Things",
"we",
"ignore",
":",
"static",
"final"
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/translate/ClassPopulator.java#L182-L187 | test | Checks if the field is of interest. | Of course, here is the Java code you requested:
```java
private boolean isOfInterest(Field field) {
return !field.isAnnotationPresent(Ignore.class)
&& ((field.getModifiers() & NOT_SAVEABLE_MODIFIERS) == 0)
&& !field.isSynthetic()
&& !field.getName().startsWith("bitmap$init"); // Scala adds a field bitmap... |
GojaFramework/goja | goja-web/src/main/java/goja/security/goja/SecurityKit.java | SecurityKit.logout | public static <T extends Model> void logout(HttpServletRequest req,
HttpServletResponse response) {
CookieUser cookie_user = getUserFromCookie(req);
Requests.deleteCookie(req, response, COOKIE_LOGIN, true);
// 清理Cache
if (cookie_user != nul... | java | public static <T extends Model> void logout(HttpServletRequest req,
HttpServletResponse response) {
CookieUser cookie_user = getUserFromCookie(req);
Requests.deleteCookie(req, response, COOKIE_LOGIN, true);
// 清理Cache
if (cookie_user != nul... | [
"public",
"static",
"<",
"T",
"extends",
"Model",
">",
"void",
"logout",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"response",
")",
"{",
"CookieUser",
"cookie_user",
"=",
"getUserFromCookie",
"(",
"req",
")",
";",
"Requests",
".",
"deleteCook... | logout
@param req http request
@param response http response | [
"logout"
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-web/src/main/java/goja/security/goja/SecurityKit.java#L102-L123 | test | Logout. | Of course, here is the Java code you requested:
```java
public static <T extends Model> void logout(HttpServletRequest req,
HttpServletResponse response) {
CookieUser cookie_user = getUserFromCookie(req);
Requests.deleteCookie(req, response, COOKIE_LOGIN,... |
deeplearning4j/nd4j | nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java | BigDecimalMath.pow | static public BigDecimal pow(final BigDecimal x, final BigDecimal y) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("Cannot power negative " + x.toString());
} else if (x.compareTo(BigDecimal.ZERO) == 0) {
return BigDecimal.ZERO;
} else {
... | java | static public BigDecimal pow(final BigDecimal x, final BigDecimal y) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("Cannot power negative " + x.toString());
} else if (x.compareTo(BigDecimal.ZERO) == 0) {
return BigDecimal.ZERO;
} else {
... | [
"static",
"public",
"BigDecimal",
"pow",
"(",
"final",
"BigDecimal",
"x",
",",
"final",
"BigDecimal",
"y",
")",
"{",
"if",
"(",
"x",
".",
"compareTo",
"(",
"BigDecimal",
".",
"ZERO",
")",
"<",
"0",
")",
"{",
"throw",
"new",
"ArithmeticException",
"(",
... | Power function.
@param x Base of the power.
@param y Exponent of the power.
@return x^y.
The estimation of the relative error in the result is |log(x)*err(y)|+|y*err(x)/x| | [
"Power",
"function",
"."
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-common/src/main/java/org/nd4j/linalg/util/BigDecimalMath.java#L683-L701 | test | Power x by y. | Of course, here is the Java code you requested:
```java
static public BigDecimal pow(final BigDecimal x, final BigDecimal y) {
if (x.compareTo(BigDecimal.ZERO) < 0) {
throw new ArithmeticException("Cannot power negative " + x.toString());
} else if (x.compareTo(BigDecimal.ZERO) == 0) {
... |
GojaFramework/goja | goja-core/src/main/java/goja/core/kits/reflect/Reflect.java | Reflect.isInterfaceImpl | public static boolean isInterfaceImpl(Class thisClass, Class targetInterface) {
for (Class x = thisClass; x != null; x = x.getSuperclass()) {
Class[] interfaces = x.getInterfaces();
for (Class i : interfaces) {
if (i == targetInterface) {
return true;
... | java | public static boolean isInterfaceImpl(Class thisClass, Class targetInterface) {
for (Class x = thisClass; x != null; x = x.getSuperclass()) {
Class[] interfaces = x.getInterfaces();
for (Class i : interfaces) {
if (i == targetInterface) {
return true;
... | [
"public",
"static",
"boolean",
"isInterfaceImpl",
"(",
"Class",
"thisClass",
",",
"Class",
"targetInterface",
")",
"{",
"for",
"(",
"Class",
"x",
"=",
"thisClass",
";",
"x",
"!=",
"null",
";",
"x",
"=",
"x",
".",
"getSuperclass",
"(",
")",
")",
"{",
"C... | Returns <code>true</code> if provided class is interface implementation. | [
"Returns",
"<code",
">",
"true<",
"/",
"code",
">",
"if",
"provided",
"class",
"is",
"interface",
"implementation",
"."
] | 77179b495f668fc1fa20accc912991df6bb2d917 | https://github.com/GojaFramework/goja/blob/77179b495f668fc1fa20accc912991df6bb2d917/goja-core/src/main/java/goja/core/kits/reflect/Reflect.java#L94-L107 | test | Check if thisClass is an interface of targetInterface. | Of course, here is the Java code you requested:
```java
public static boolean isInterfaceImpl(Class thisClass, Class targetInterface) {
for (Class x = thisClass; x != null; x = x.getSuperclass()) {
Class[] interfaces = x.getInterfaces();
for (Class i : interfaces) {
if (... |
hawkular/hawkular-metrics | core/metrics-core-service/src/main/java/org/hawkular/metrics/core/jobs/JobsServiceImpl.java | JobsServiceImpl.submitCompressJob | private void submitCompressJob(Map<String, String> parameters) {
String jobName = String.format("%s_single_%s", CompressData.JOB_NAME, parameters.get(CompressData.TARGET_TIME));
// Blocking to ensure it is actually scheduled..
scheduler.scheduleJob(CompressData.JOB_NAME, jobName, parameters,
... | java | private void submitCompressJob(Map<String, String> parameters) {
String jobName = String.format("%s_single_%s", CompressData.JOB_NAME, parameters.get(CompressData.TARGET_TIME));
// Blocking to ensure it is actually scheduled..
scheduler.scheduleJob(CompressData.JOB_NAME, jobName, parameters,
... | [
"private",
"void",
"submitCompressJob",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"String",
"jobName",
"=",
"String",
".",
"format",
"(",
"\"%s_single_%s\"",
",",
"CompressData",
".",
"JOB_NAME",
",",
"parameters",
".",
"get",
"(... | JMX management | [
"JMX",
"management"
] | 6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c | https://github.com/hawkular/hawkular-metrics/blob/6b9ab00d00c3d6d51e30c2c08c4ee48da7237e6c/core/metrics-core-service/src/main/java/org/hawkular/metrics/core/jobs/JobsServiceImpl.java#L100-L106 | test | Submit a single compress job to the cluster. | Of course, here is the Java code you requested:
```java
private void submitCompressJob(Map<String, String> parameters) {
String jobName = String.format("%s_single_%s", CompressData.JOB_NAME, parameters.get(CompressData.TARGET_TIME));
// Blocking to ensure it is actually scheduled..
scheduler.sc... |
sinetja/netty-router | src/main/java/io/netty/handler/codec/http/router/OrderlessRouter.java | OrderlessRouter.removeTarget | public void removeTarget(T target) {
Set<PathPattern> patterns = reverseRoutes.remove(ObjectUtil.checkNotNull(target, "target"));
if (patterns == null) {
return;
}
// A pattern can only point to one target.
// A target can have multiple patterns.
// Remove al... | java | public void removeTarget(T target) {
Set<PathPattern> patterns = reverseRoutes.remove(ObjectUtil.checkNotNull(target, "target"));
if (patterns == null) {
return;
}
// A pattern can only point to one target.
// A target can have multiple patterns.
// Remove al... | [
"public",
"void",
"removeTarget",
"(",
"T",
"target",
")",
"{",
"Set",
"<",
"PathPattern",
">",
"patterns",
"=",
"reverseRoutes",
".",
"remove",
"(",
"ObjectUtil",
".",
"checkNotNull",
"(",
"target",
",",
"\"target\"",
")",
")",
";",
"if",
"(",
"patterns",... | Removes all routes leading to the target. | [
"Removes",
"all",
"routes",
"leading",
"to",
"the",
"target",
"."
] | 1bdace050de26bc4d7629b7a0c1fbea238f88e5a | https://github.com/sinetja/netty-router/blob/1bdace050de26bc4d7629b7a0c1fbea238f88e5a/src/main/java/io/netty/handler/codec/http/router/OrderlessRouter.java#L98-L110 | test | Removes a target from the list of routes. | Of course, here is the Java code you requested:
```java
public void removeTarget(T target) {
Set<PathPattern> patterns = reverseRoutes.remove(ObjectUtil.checkNotNull(target, "target"));
if (patterns == null) {
return;
}
// A pattern can only point to one target.
// ... |
GlenKPeterson/Paguro | src/main/java/org/organicdesign/fp/collections/PersistentVector.java | PersistentVector.append | @SuppressWarnings("unchecked")
@Override public PersistentVector<E> append(E val) {
//room in tail?
// if(tail.length < MAX_NODE_LENGTH)
if (size - tailoff() < MAX_NODE_LENGTH) {
E[] newTail = (E[]) new Object[tail.length + 1];
System.arraycopy(tail, 0, newTail, 0, ta... | java | @SuppressWarnings("unchecked")
@Override public PersistentVector<E> append(E val) {
//room in tail?
// if(tail.length < MAX_NODE_LENGTH)
if (size - tailoff() < MAX_NODE_LENGTH) {
E[] newTail = (E[]) new Object[tail.length + 1];
System.arraycopy(tail, 0, newTail, 0, ta... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"@",
"Override",
"public",
"PersistentVector",
"<",
"E",
">",
"append",
"(",
"E",
"val",
")",
"{",
"//room in tail?",
"//\tif(tail.length < MAX_NODE_LENGTH)",
"if",
"(",
"size",
"-",
"tailoff",
"(",
")",
"<",
... | Inserts a new item at the end of the Vecsicle.
@param val the value to insert
@return a new Vecsicle with the additional item. | [
"Inserts",
"a",
"new",
"item",
"at",
"the",
"end",
"of",
"the",
"Vecsicle",
"."
] | eac0d64b2eb9496967334f635cdb270cffb2197b | https://github.com/GlenKPeterson/Paguro/blob/eac0d64b2eb9496967334f635cdb270cffb2197b/src/main/java/org/organicdesign/fp/collections/PersistentVector.java#L261-L285 | test | Append an element to the end of the vector. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
@Override public PersistentVector<E> append(E val) {
//room in tail?
// if(tail.length < MAX_NODE_LENGTH)
if (size - tailoff() < MAX_NODE_LENGTH) {
E[] newTail = (E[]) new Object[tail.length +... |
oblac/jodd | jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/ColumnsSelectChunk.java | ColumnsSelectChunk.appendColumnName | protected void appendColumnName(final StringBuilder query, final DbEntityDescriptor ded, final DbEntityColumnDescriptor dec) {
query.append(resolveTable(tableRef, ded)).append('.').append(dec.getColumnName());
if (templateData.getColumnAliasType() != null) { // create column aliases
query.append(AS);
... | java | protected void appendColumnName(final StringBuilder query, final DbEntityDescriptor ded, final DbEntityColumnDescriptor dec) {
query.append(resolveTable(tableRef, ded)).append('.').append(dec.getColumnName());
if (templateData.getColumnAliasType() != null) { // create column aliases
query.append(AS);
... | [
"protected",
"void",
"appendColumnName",
"(",
"final",
"StringBuilder",
"query",
",",
"final",
"DbEntityDescriptor",
"ded",
",",
"final",
"DbEntityColumnDescriptor",
"dec",
")",
"{",
"query",
".",
"append",
"(",
"resolveTable",
"(",
"tableRef",
",",
"ded",
")",
... | Simply appends column name with optional table reference and alias. | [
"Simply",
"appends",
"column",
"name",
"with",
"optional",
"table",
"reference",
"and",
"alias",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/oom/sqlgen/chunks/ColumnsSelectChunk.java#L283-L310 | test | Append column name. | Of course, here is the Java code you requested:
```java
protected void appendColumnName(final StringBuilder query, final DbEntityDescriptor ded, final DbEntityColumnDescriptor dec) {
query.append(resolveTable(tableRef, ded)).append('.').append(dec.getColumnName());
if (templateData.getColumnAliasType() != null)... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNIMemoryManager.java | JNIMemoryManager.gcInternal | void gcInternal()
{
JNIReference ref = null;
while ((ref = (JNIReference) mRefQueue.poll()) != null)
{
ref.delete();
}
} | java | void gcInternal()
{
JNIReference ref = null;
while ((ref = (JNIReference) mRefQueue.poll()) != null)
{
ref.delete();
}
} | [
"void",
"gcInternal",
"(",
")",
"{",
"JNIReference",
"ref",
"=",
"null",
";",
"while",
"(",
"(",
"ref",
"=",
"(",
"JNIReference",
")",
"mRefQueue",
".",
"poll",
"(",
")",
")",
"!=",
"null",
")",
"{",
"ref",
".",
"delete",
"(",
")",
";",
"}",
"}"
... | The actual GC; | [
"The",
"actual",
"GC",
";"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNIMemoryManager.java#L1336-L1343 | test | GC internal method. | Of course, here is the Java code you requested:
```java
void gcInternal()
{
JNIReference ref = null;
while ((ref = (JNIReference) mRefQueue.poll()) != null)
{
ref.delete();
}
}
```
Hope this helps! |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/configuration/ConfigBuildRef.java | ConfigBuildRef.putShiftAttrs | public final void putShiftAttrs(final String fullName,
final ConfigRangeAttrs attrs,
final RowsMapping unitRowsMapping) {
attrs.setUnitRowsMapping(unitRowsMapping);
this.shiftMap.put(fullName, attrs);
} | java | public final void putShiftAttrs(final String fullName,
final ConfigRangeAttrs attrs,
final RowsMapping unitRowsMapping) {
attrs.setUnitRowsMapping(unitRowsMapping);
this.shiftMap.put(fullName, attrs);
} | [
"public",
"final",
"void",
"putShiftAttrs",
"(",
"final",
"String",
"fullName",
",",
"final",
"ConfigRangeAttrs",
"attrs",
",",
"final",
"RowsMapping",
"unitRowsMapping",
")",
"{",
"attrs",
".",
"setUnitRowsMapping",
"(",
"unitRowsMapping",
")",
";",
"this",
".",
... | Put shift attrs.
@param fullName
the full name
@param attrs
the attrs
@param unitRowsMapping
the unit rows mapping | [
"Put",
"shift",
"attrs",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/configuration/ConfigBuildRef.java#L186-L191 | test | Put a shift attributes into the map. | Of course, here is the Java code you requested:
```java
public final void putShiftAttrs(final String fullName,
final ConfigRangeAttrs attrs,
final RowsMapping unitRowsMapping) {
attrs.setUnitRowsMapping(unitRowsMapping);
this.shiftMap.put(fullName, attrs);
}
```
Hope this helps! |
abmargb/jamppa | src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java | AbstractHashedMap.entryNext | protected HashEntry<K, V> entryNext(HashEntry<K, V> entry) {
return entry.next;
} | java | protected HashEntry<K, V> entryNext(HashEntry<K, V> entry) {
return entry.next;
} | [
"protected",
"HashEntry",
"<",
"K",
",",
"V",
">",
"entryNext",
"(",
"HashEntry",
"<",
"K",
",",
"V",
">",
"entry",
")",
"{",
"return",
"entry",
".",
"next",
";",
"}"
] | Gets the <code>next</code> field from a <code>HashEntry</code>. Used in
subclasses that have no visibility of the field.
@param entry
the entry to query, must not be null
@return the <code>next</code> field of the entry
@throws NullPointerException
if the entry is null
@since Commons Collections 3.1 | [
"Gets",
"the",
"<code",
">",
"next<",
"/",
"code",
">",
"field",
"from",
"a",
"<code",
">",
"HashEntry<",
"/",
"code",
">",
".",
"Used",
"in",
"subclasses",
"that",
"have",
"no",
"visibility",
"of",
"the",
"field",
"."
] | 76f253239923df40904c462e3b88e7278b36b282 | https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/util/collections/AbstractHashedMap.java#L748-L750 | test | Returns the next entry in the hash table. | Of course, here is the Java code you requested:
```java
protected HashEntry<K, V> entryNext(HashEntry<K, V> entry) {
return entry.next;
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java | FeatureTiles.queryIndexedFeaturesCount | public long queryIndexedFeaturesCount(int x, int y, int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
// Query for the count of geometries matching the bounds in the index
l... | java | public long queryIndexedFeaturesCount(int x, int y, int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
// Query for the count of geometries matching the bounds in the index
l... | [
"public",
"long",
"queryIndexedFeaturesCount",
"(",
"int",
"x",
",",
"int",
"y",
",",
"int",
"zoom",
")",
"{",
"// Get the web mercator bounding box",
"BoundingBox",
"webMercatorBoundingBox",
"=",
"TileBoundingBoxUtils",
".",
"getWebMercatorBoundingBox",
"(",
"x",
",",
... | Query for feature result count in the x, y, and zoom
@param x x coordinate
@param y y coordinate
@param zoom zoom level
@return feature count
@since 1.1.0 | [
"Query",
"for",
"feature",
"result",
"count",
"in",
"the",
"x",
"y",
"and",
"zoom"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/tiles/features/FeatureTiles.java#L1128-L1138 | test | Query the feature count of features in the index image | Of course, here is the Java code you requested:
```java
public long queryIndexedFeaturesCount(int x, int y, int zoom) {
// Get the web mercator bounding box
BoundingBox webMercatorBoundingBox = TileBoundingBoxUtils
.getWebMercatorBoundingBox(x, y, zoom);
// Query for the count... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/authentication/preauth/websphere/WebSpherePreAuthenticatedWebAuthenticationDetailsSource.java | WebSpherePreAuthenticatedWebAuthenticationDetailsSource.getWebSphereGroupsBasedGrantedAuthorities | private Collection<? extends GrantedAuthority> getWebSphereGroupsBasedGrantedAuthorities() {
List<String> webSphereGroups = wasHelper.getGroupsForCurrentUser();
Collection<? extends GrantedAuthority> userGas = webSphereGroups2GrantedAuthoritiesMapper
.getGrantedAuthorities(webSphereGroups);
if (logger.isDebug... | java | private Collection<? extends GrantedAuthority> getWebSphereGroupsBasedGrantedAuthorities() {
List<String> webSphereGroups = wasHelper.getGroupsForCurrentUser();
Collection<? extends GrantedAuthority> userGas = webSphereGroups2GrantedAuthoritiesMapper
.getGrantedAuthorities(webSphereGroups);
if (logger.isDebug... | [
"private",
"Collection",
"<",
"?",
"extends",
"GrantedAuthority",
">",
"getWebSphereGroupsBasedGrantedAuthorities",
"(",
")",
"{",
"List",
"<",
"String",
">",
"webSphereGroups",
"=",
"wasHelper",
".",
"getGroupsForCurrentUser",
"(",
")",
";",
"Collection",
"<",
"?",... | Get a list of Granted Authorities based on the current user's WebSphere groups.
@return authorities mapped from the user's WebSphere groups. | [
"Get",
"a",
"list",
"of",
"Granted",
"Authorities",
"based",
"on",
"the",
"current",
"user",
"s",
"WebSphere",
"groups",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/preauth/websphere/WebSpherePreAuthenticatedWebAuthenticationDetailsSource.java#L65-L74 | test | Get the list of groups based on the current user | Of course, here is the Java code you requested:
```java
private Collection<? extends GrantedAuthority> getWebSphereGroupsBasedGrantedAuthorities() {
List<String> webSphereGroups = wasHelper.getGroupsForCurrentUser();
Collection<? extends GrantedAuthority> userGas = webSphereGroups2GrantedAuthoritiesMapper
.get... |
tiefaces/TieFaces | src/org/tiefaces/components/websheet/TieWebSheetBean.java | TieWebSheetBean.getWbWrapper | public XSSFEvaluationWorkbook getWbWrapper() {
if ((this.wbWrapper == null) && (this.getWb() != null)) {
this.wbWrapper = XSSFEvaluationWorkbook
.create((XSSFWorkbook) this.getWb());
}
return wbWrapper;
} | java | public XSSFEvaluationWorkbook getWbWrapper() {
if ((this.wbWrapper == null) && (this.getWb() != null)) {
this.wbWrapper = XSSFEvaluationWorkbook
.create((XSSFWorkbook) this.getWb());
}
return wbWrapper;
} | [
"public",
"XSSFEvaluationWorkbook",
"getWbWrapper",
"(",
")",
"{",
"if",
"(",
"(",
"this",
".",
"wbWrapper",
"==",
"null",
")",
"&&",
"(",
"this",
".",
"getWb",
"(",
")",
"!=",
"null",
")",
")",
"{",
"this",
".",
"wbWrapper",
"=",
"XSSFEvaluationWorkbook... | Return evaluation wrapper if needed.
@return wbwrapper. | [
"Return",
"evaluation",
"wrapper",
"if",
"needed",
"."
] | 3b57b9701ed0f080b5fa4fa78269cc0c422b34ba | https://github.com/tiefaces/TieFaces/blob/3b57b9701ed0f080b5fa4fa78269cc0c422b34ba/src/org/tiefaces/components/websheet/TieWebSheetBean.java#L281-L287 | test | Gets the related object that represents the WBS. | Of course, here is the Java code you requested:
```java
public XSSFEvaluationWorkbook getWbWrapper() {
if ((this.wbWrapper == null) && (this.getWb() != null)) {
this.wbWrapper = XSSFEvaluationWorkbook
.create((XSSFWorkbook) this.getWb());
}
return wbWrapper;
}
```
Hope this helps! |
deeplearning4j/nd4j | nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java | SameDiff.onesLike | public SDVariable onesLike(String name, SDVariable input) {
return f().onesLike(name, input);
} | java | public SDVariable onesLike(String name, SDVariable input) {
return f().onesLike(name, input);
} | [
"public",
"SDVariable",
"onesLike",
"(",
"String",
"name",
",",
"SDVariable",
"input",
")",
"{",
"return",
"f",
"(",
")",
".",
"onesLike",
"(",
"name",
",",
"input",
")",
";",
"}"
] | Return a variable of all 1s, with the same shape as the input
@param input
@return | [
"Return",
"a",
"variable",
"of",
"all",
"1s",
"with",
"the",
"same",
"shape",
"as",
"the",
"input"
] | 8f005bcecb240d1fbb83b9d390ad801d1d3b6933 | https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/SameDiff.java#L1359-L1361 | test | One - station operation with ones like operation | Of course, here is the Java code you requested:
```java
public SDVariable onesLike(String name, SDVariable input) {
return f().onesLike(name, input);
}
```
Hope this helps! |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/ABaseClientWebSocket.java | ABaseClientWebSocket.closeAndClean | @Override
public void closeAndClean()
{
CloseConnectionRunnable closeConnectionRunnable =
new CloseConnectionRunnable(this);
Thread closeConnThread = new Thread(
closeConnectionRunnable,"Close ABaseClientWebSocket Connection");
closeConnThread.start();
} | java | @Override
public void closeAndClean()
{
CloseConnectionRunnable closeConnectionRunnable =
new CloseConnectionRunnable(this);
Thread closeConnThread = new Thread(
closeConnectionRunnable,"Close ABaseClientWebSocket Connection");
closeConnThread.start();
} | [
"@",
"Override",
"public",
"void",
"closeAndClean",
"(",
")",
"{",
"CloseConnectionRunnable",
"closeConnectionRunnable",
"=",
"new",
"CloseConnectionRunnable",
"(",
"this",
")",
";",
"Thread",
"closeConnThread",
"=",
"new",
"Thread",
"(",
"closeConnectionRunnable",
",... | If the HTTP Client is set, this will
close and clean any connections that needs to be closed.
@since v1.1 | [
"If",
"the",
"HTTP",
"Client",
"is",
"set",
"this",
"will",
"close",
"and",
"clean",
"any",
"connections",
"that",
"needs",
"to",
"be",
"closed",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/websocket/ABaseClientWebSocket.java#L195-L204 | test | Close the connection and clean up any resources that are not needed. | Of course, here is the Java code you requested:
```java
@Override
public void closeAndClean()
{
CloseConnectionRunnable closeConnectionRunnable =
new CloseConnectionRunnable(this);
Thread closeConnThread = new Thread(
closeConnectionRunnable,"Close ABaseClientWebSocket Connection");
closeConnThread.st... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNILibraryLoader.java | JNILibraryLoader.loadCandidateLibrary | boolean loadCandidateLibrary(String aLibraryName, Long aMajorVersion,
List<String> aLibCandidates)
{
boolean retval = false;
for (String candidate : aLibCandidates)
{
log
.trace(
"Attempt: library load of library: {}; version: {}: relative path: {}",
new O... | java | boolean loadCandidateLibrary(String aLibraryName, Long aMajorVersion,
List<String> aLibCandidates)
{
boolean retval = false;
for (String candidate : aLibCandidates)
{
log
.trace(
"Attempt: library load of library: {}; version: {}: relative path: {}",
new O... | [
"boolean",
"loadCandidateLibrary",
"(",
"String",
"aLibraryName",
",",
"Long",
"aMajorVersion",
",",
"List",
"<",
"String",
">",
"aLibCandidates",
")",
"{",
"boolean",
"retval",
"=",
"false",
";",
"for",
"(",
"String",
"candidate",
":",
"aLibCandidates",
")",
... | Iterates through the set of aLibCandidates until it succeeds in loading a
library. If it succeeds, it lets the cache know.
@param aLibraryName
The library name.
@param aMajorVersion
The version we want, or null if we don't care.
@param aLibCandidates
The set of candidates generated by
{@link #getLibraryCandidates(Stri... | [
"Iterates",
"through",
"the",
"set",
"of",
"aLibCandidates",
"until",
"it",
"succeeds",
"in",
"loading",
"a",
"library",
".",
"If",
"it",
"succeeds",
"it",
"lets",
"the",
"cache",
"know",
"."
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNILibraryLoader.java#L317-L390 | test | Load the candidate libraries. | Of course, here is the Java code you requested:
```java
boolean loadCandidateLibrary(String aLibraryName, Long aMajorVersion,
List<String> aLibCandidates)
{
boolean retval = false;
for (String candidate : aLibCandidates)
{
log
.trace(
"Attempt: library load of library:... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/video/Codec.java | Codec.getSupportedProfile | public CodecProfile getSupportedProfile(int index) {
long cPtr = VideoJNI.Codec_getSupportedProfile(swigCPtr, this, index);
return (cPtr == 0) ? null : new CodecProfile(cPtr, false);
} | java | public CodecProfile getSupportedProfile(int index) {
long cPtr = VideoJNI.Codec_getSupportedProfile(swigCPtr, this, index);
return (cPtr == 0) ? null : new CodecProfile(cPtr, false);
} | [
"public",
"CodecProfile",
"getSupportedProfile",
"(",
"int",
"index",
")",
"{",
"long",
"cPtr",
"=",
"VideoJNI",
".",
"Codec_getSupportedProfile",
"(",
"swigCPtr",
",",
"this",
",",
"index",
")",
";",
"return",
"(",
"cPtr",
"==",
"0",
")",
"?",
"null",
":"... | Get the supported CodecProfile at this index.<br>
<br>
@param index the index<br>
@return A CodecProfile, or null if unknown, index < 0<br>
or lindex >= #getNumSupportedProfiles. | [
"Get",
"the",
"supported",
"CodecProfile",
"at",
"this",
"index",
".",
"<br",
">",
"<br",
">"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Codec.java#L609-L612 | test | Returns the supported profile for the specified index. | Of course, here is the Java code you requested:
```java
public CodecProfile getSupportedProfile(int index) {
long cPtr = VideoJNI.Codec_getSupportedProfile(swigCPtr, this, index);
return (cPtr == 0) ? null : new CodecProfile(cPtr, false);
}
```
Hope this helps! |
RestComm/jain-slee | container/remote/src/main/java/org/mobicents/slee/connector/local/SleeConnectionServiceImpl.java | SleeConnectionServiceImpl.getEventTypeID | public EventTypeID getEventTypeID(String name, String vendor, String version) throws UnrecognizedEventException, ResourceException {
if(sleeContainer == null)
{
throw new ResourceException("Connection is in closed state");
}
if(sleeContainer.getSleeState()!=SleeState.RUNNING)
{
throw new Resource... | java | public EventTypeID getEventTypeID(String name, String vendor, String version) throws UnrecognizedEventException, ResourceException {
if(sleeContainer == null)
{
throw new ResourceException("Connection is in closed state");
}
if(sleeContainer.getSleeState()!=SleeState.RUNNING)
{
throw new Resource... | [
"public",
"EventTypeID",
"getEventTypeID",
"(",
"String",
"name",
",",
"String",
"vendor",
",",
"String",
"version",
")",
"throws",
"UnrecognizedEventException",
",",
"ResourceException",
"{",
"if",
"(",
"sleeContainer",
"==",
"null",
")",
"{",
"throw",
"new",
"... | /* (non-Javadoc)
@see javax.slee.connection.SleeConnection#getEventTypeID(java.lang.String, java.lang.String, java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/remote/src/main/java/org/mobicents/slee/connector/local/SleeConnectionServiceImpl.java#L191-L208 | test | Gets the EventTypeID from the connection. | Of course, here is the Java code you requested:
```java
public EventTypeID getEventTypeID(String name, String vendor, String version) throws UnrecognizedEventException, ResourceException {
if(sleeContainer == null)
{
throw new ResourceException("Connection is in closed state");
}
if(sleeContainer.getSl... |
shopping24/solr-jdbc | src/main/java/com/s24/search/solr/analysis/jdbc/SimpleJdbcReader.java | SimpleJdbcReader.checkDatasource | protected final void checkDatasource() {
// Check database connection information of data source
if (dataSource != null) {
//noinspection unused,EmptyTryBlock
try (Connection connection = dataSource.getConnection()) {
// Just get the connection to check if data source parameter... | java | protected final void checkDatasource() {
// Check database connection information of data source
if (dataSource != null) {
//noinspection unused,EmptyTryBlock
try (Connection connection = dataSource.getConnection()) {
// Just get the connection to check if data source parameter... | [
"protected",
"final",
"void",
"checkDatasource",
"(",
")",
"{",
"// Check database connection information of data source",
"if",
"(",
"dataSource",
"!=",
"null",
")",
"{",
"//noinspection unused,EmptyTryBlock",
"try",
"(",
"Connection",
"connection",
"=",
"dataSource",
".... | Check if the datasource is able to provide connections. | [
"Check",
"if",
"the",
"datasource",
"is",
"able",
"to",
"provide",
"connections",
"."
] | 3806370f2a5e26db2194f4f63b98edf2fee5efd8 | https://github.com/shopping24/solr-jdbc/blob/3806370f2a5e26db2194f4f63b98edf2fee5efd8/src/main/java/com/s24/search/solr/analysis/jdbc/SimpleJdbcReader.java#L83-L97 | test | Check the data source. | Of course, here is the Java code you requested:
```java
protected final void checkDatasource() {
// Check database connection information of data source
if (dataSource != null) {
//noinspection unused,EmptyTryBlock
try (Connection connection = dataSource.getConnection()) {
// ... |
RestComm/jain-slee | container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitJarComponentBuilder.java | DeployableUnitJarComponentBuilder.buildComponents | @SuppressWarnings("deprecation")
public List<AbstractSleeComponent> buildComponents(
String componentJarFileName, JarFile deployableUnitJar,
File deploymentDir)
throws DeploymentException {
// extract the component jar from the DU jar, to the temp du dir
File extractedFile = extractFile(componentJarFil... | java | @SuppressWarnings("deprecation")
public List<AbstractSleeComponent> buildComponents(
String componentJarFileName, JarFile deployableUnitJar,
File deploymentDir)
throws DeploymentException {
// extract the component jar from the DU jar, to the temp du dir
File extractedFile = extractFile(componentJarFil... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"public",
"List",
"<",
"AbstractSleeComponent",
">",
"buildComponents",
"(",
"String",
"componentJarFileName",
",",
"JarFile",
"deployableUnitJar",
",",
"File",
"deploymentDir",
")",
"throws",
"DeploymentException",
... | Builds the DU component from a jar with the specified file name,
contained in the specified DU jar file. The component is built in the
specified deployment dir.
@param componentJarFileName
@param deployableUnitJar
@param deploymentDir
@param documentBuilder
@return
@throws DeploymentException | [
"Builds",
"the",
"DU",
"component",
"from",
"a",
"jar",
"with",
"the",
"specified",
"file",
"name",
"contained",
"in",
"the",
"specified",
"DU",
"jar",
"file",
".",
"The",
"component",
"is",
"built",
"in",
"the",
"specified",
"deployment",
"dir",
"."
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/components/components/src/main/java/org/mobicents/slee/container/component/deployment/DeployableUnitJarComponentBuilder.java#L104-L345 | test | Build the components from the DU jar to the temp du dir | Of course, here is the Java code you requested:
```java
@SuppressWarnings("deprecation")
public List<AbstractSleeComponent> buildComponents(
String componentJarFileName, JarFile deployableUnitJar,
File deploymentDir)
throws DeploymentException {
// extract the component jar from the DU jar, to the temp ... |
tony19/logback-android | logback-android/src/main/java/ch/qos/logback/core/encoder/ByteArrayUtil.java | ByteArrayUtil.readInt | static int readInt(byte[] byteArray, int offset) {
int i = 0;
for (int j = 0; j < 4; j++) {
int shift = 24 - j * 8;
i += (byteArray[offset + j] & 0xFF) << shift;
}
return i;
} | java | static int readInt(byte[] byteArray, int offset) {
int i = 0;
for (int j = 0; j < 4; j++) {
int shift = 24 - j * 8;
i += (byteArray[offset + j] & 0xFF) << shift;
}
return i;
} | [
"static",
"int",
"readInt",
"(",
"byte",
"[",
"]",
"byteArray",
",",
"int",
"offset",
")",
"{",
"int",
"i",
"=",
"0",
";",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"4",
";",
"j",
"++",
")",
"{",
"int",
"shift",
"=",
"24",
"-",
"j",
... | big-endian | [
"big",
"-",
"endian"
] | 028489c11ccfc1237a53923db06f22a90b41809c | https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/encoder/ByteArrayUtil.java#L38-L45 | test | read int from byte array | Of course, here is the Java code you requested:
```java
static int readInt(byte[] byteArray, int offset) {
int i = 0;
for (int j = 0; j < 4; j++) {
int shift = 24 - j * 8;
i += (byteArray[offset + j] & 0xFF) << shift;
}
return i;
}
```
Hope this helps! |
jcodec/jcodec | src/main/java/org/jcodec/codecs/h264/H264Utils.java | H264Utils.encodeMOVPacket | public static ByteBuffer encodeMOVPacket(ByteBuffer avcFrame) {
ByteBuffer dup = avcFrame.duplicate();
List<ByteBuffer> list = new ArrayList<ByteBuffer>();
ByteBuffer buf;
int totalLen = 0;
while ((buf = H264Utils.nextNALUnit(dup)) != null) {
list.add(buf);
... | java | public static ByteBuffer encodeMOVPacket(ByteBuffer avcFrame) {
ByteBuffer dup = avcFrame.duplicate();
List<ByteBuffer> list = new ArrayList<ByteBuffer>();
ByteBuffer buf;
int totalLen = 0;
while ((buf = H264Utils.nextNALUnit(dup)) != null) {
list.add(buf);
... | [
"public",
"static",
"ByteBuffer",
"encodeMOVPacket",
"(",
"ByteBuffer",
"avcFrame",
")",
"{",
"ByteBuffer",
"dup",
"=",
"avcFrame",
".",
"duplicate",
"(",
")",
";",
"List",
"<",
"ByteBuffer",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"ByteBuffer",
">",
"(",... | Encodes AVC frame in ISO BMF format. Takes Annex B format.
Scans the packet for each NAL Unit starting with 00 00 00 01 and replaces
this 4 byte sequence with 4 byte integer representing this NAL unit
length.
@param avcFrame
AVC frame encoded in Annex B NAL unit format | [
"Encodes",
"AVC",
"frame",
"in",
"ISO",
"BMF",
"format",
".",
"Takes",
"Annex",
"B",
"format",
"."
] | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/codecs/h264/H264Utils.java#L284-L302 | test | Encode a MOV frame. | Of course, here is the Java code you requested:
```java
public static ByteBuffer encodeMOVPacket(ByteBuffer avcFrame) {
ByteBuffer dup = avcFrame.duplicate();
List<ByteBuffer> list = new ArrayList<ByteBuffer>();
ByteBuffer buf;
int totalLen = 0;
while ((buf = H264Utils.nextNAL... |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java | GrundstueckEmpfohleneNutzung.setVilla | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setVilla(JAXBElement<Object> value) {
this.villa = value;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setVilla(JAXBElement<Object> value) {
this.villa = value;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:52:47+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"void",
"setVilla",
"(",
"JAXBElement",
"<",
"Object",
">",
"value",
")",
"{",
"this... | Sets the value of the villa property.
@param value
allowed object is
{@link JAXBElement }{@code <}{@link Object }{@code >} | [
"Sets",
"the",
"value",
"of",
"the",
"villa",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java#L808-L811 | test | Sets the value of the villa 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 void setVilla(JAXBElement<Object> value) {
this.villa = value;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/vertical/OceanS.java | OceanS.makeC | private Array makeC(Array s, double a, double b) {
int nz = (int) s.getSize();
Index sIndex = s.getIndex();
if (a == 0) return s; // per R. Signell, USGS
ArrayDouble.D1 c = new ArrayDouble.D1(nz);
double fac1 = 1.0 - b;
double denom1 = 1.0 / Math.sinh(a);
double denom2 = 1.0 / (2... | java | private Array makeC(Array s, double a, double b) {
int nz = (int) s.getSize();
Index sIndex = s.getIndex();
if (a == 0) return s; // per R. Signell, USGS
ArrayDouble.D1 c = new ArrayDouble.D1(nz);
double fac1 = 1.0 - b;
double denom1 = 1.0 / Math.sinh(a);
double denom2 = 1.0 / (2... | [
"private",
"Array",
"makeC",
"(",
"Array",
"s",
",",
"double",
"a",
",",
"double",
"b",
")",
"{",
"int",
"nz",
"=",
"(",
"int",
")",
"s",
".",
"getSize",
"(",
")",
";",
"Index",
"sIndex",
"=",
"s",
".",
"getIndex",
"(",
")",
";",
"if",
"(",
"... | Make the C array
@param s s Array
@param a "a" value
@param b "b" value
@return the C array | [
"Make",
"the",
"C",
"array"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/vertical/OceanS.java#L163-L183 | test | Make a C array of the specified size using the specified parameters. | Of course, here is the Java code you requested:
```java
private Array makeC(Array s, double a, double b) {
int nz = (int) s.getSize();
Index sIndex = s.getIndex();
if (a == 0) return s; // per R. Signell, USGS
ArrayDouble.D1 c = new ArrayDouble.D1(nz);
double fac1 = 1.0 - b;
double d... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/ft/point/standard/Evaluator.java | Evaluator.findNameOfVariableWithAttributeValue | static public String findNameOfVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue) {
Variable v = findVariableWithAttributeValue(ds, attName, attValue);
return (v == null) ? null : v.getShortName();
} | java | static public String findNameOfVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue) {
Variable v = findVariableWithAttributeValue(ds, attName, attValue);
return (v == null) ? null : v.getShortName();
} | [
"static",
"public",
"String",
"findNameOfVariableWithAttributeValue",
"(",
"NetcdfDataset",
"ds",
",",
"String",
"attName",
",",
"String",
"attValue",
")",
"{",
"Variable",
"v",
"=",
"findVariableWithAttributeValue",
"(",
"ds",
",",
"attName",
",",
"attValue",
")",
... | Find first variable with given attribute name and value
@param ds in this dataset
@param attName attribute name, case insensitive
@param attValue attribute value, case sensitive
@return name of first variable with given attribute name and value, or null | [
"Find",
"first",
"variable",
"with",
"given",
"attribute",
"name",
"and",
"value"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/ft/point/standard/Evaluator.java#L134-L137 | test | Returns the name of the variable with the specified attribute value. | Of course, here is the Java code you requested:
```java
static public String findNameOfVariableWithAttributeValue(NetcdfDataset ds, String attName, String attValue) {
Variable v = findVariableWithAttributeValue(ds, attName, attValue);
return (v == null) ? null : v.getShortName();
}
```
Hope this helps! |
real-logic/aeron | aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java | ArchiveProxy.extendRecording | public boolean extendRecording(
final String channel,
final int streamId,
final SourceLocation sourceLocation,
final long recordingId,
final long correlationId,
final long controlSessionId)
{
extendRecordingRequestEncoder
.wrapAndApplyHeader(buffer... | java | public boolean extendRecording(
final String channel,
final int streamId,
final SourceLocation sourceLocation,
final long recordingId,
final long correlationId,
final long controlSessionId)
{
extendRecordingRequestEncoder
.wrapAndApplyHeader(buffer... | [
"public",
"boolean",
"extendRecording",
"(",
"final",
"String",
"channel",
",",
"final",
"int",
"streamId",
",",
"final",
"SourceLocation",
"sourceLocation",
",",
"final",
"long",
"recordingId",
",",
"final",
"long",
"correlationId",
",",
"final",
"long",
"control... | Extend an existing, non-active, recorded stream for a the same channel and stream id.
The channel must be configured for the initial position from which it will be extended. This can be done
with {@link ChannelUriStringBuilder#initialPosition(long, int, int)}. The details required to initialise can
be found by calling... | [
"Extend",
"an",
"existing",
"non",
"-",
"active",
"recorded",
"stream",
"for",
"a",
"the",
"same",
"channel",
"and",
"stream",
"id",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/ArchiveProxy.java#L418-L436 | test | Extend a recording operation. | Of course, here is the Java code you requested:
```java
public boolean extendRecording(
final String channel,
final int streamId,
final SourceLocation sourceLocation,
final long recordingId,
final long correlationId,
final long controlSessionId)
{
extendRecor... |
RestComm/jain-slee | container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileTableImpl.java | ProfileTableImpl.create | public ProfileLocalObject create(String profileName)
throws NullPointerException, IllegalArgumentException,
TransactionRequiredLocalException, ReadOnlyProfileException,
ProfileAlreadyExistsException, CreateException, SLEEException {
sleeContainer.getTransactionManager().mandateTransaction();
checkProfile... | java | public ProfileLocalObject create(String profileName)
throws NullPointerException, IllegalArgumentException,
TransactionRequiredLocalException, ReadOnlyProfileException,
ProfileAlreadyExistsException, CreateException, SLEEException {
sleeContainer.getTransactionManager().mandateTransaction();
checkProfile... | [
"public",
"ProfileLocalObject",
"create",
"(",
"String",
"profileName",
")",
"throws",
"NullPointerException",
",",
"IllegalArgumentException",
",",
"TransactionRequiredLocalException",
",",
"ReadOnlyProfileException",
",",
"ProfileAlreadyExistsException",
",",
"CreateException",... | /*
(non-Javadoc)
@see javax.slee.profile.ProfileTable#create(java.lang.String) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/profiles/src/main/java/org/mobicents/slee/container/profile/ProfileTableImpl.java#L260-L271 | test | Creates a new ProfileLocalObject. | Of course, here is the Java code you requested:
```java
public ProfileLocalObject create(String profileName)
throws NullPointerException, IllegalArgumentException,
TransactionRequiredLocalException, ReadOnlyProfileException,
ProfileAlreadyExistsException, CreateException, SLEEException {
sleeContainer.getT... |
kocakosm/pitaya | src/org/kocakosm/pitaya/io/CharStreams.java | CharStreams.read | public static String read(InputStream in) throws IOException
{
return read(new InputStreamReader(in, Charsets.DEFAULT));
} | java | public static String read(InputStream in) throws IOException
{
return read(new InputStreamReader(in, Charsets.DEFAULT));
} | [
"public",
"static",
"String",
"read",
"(",
"InputStream",
"in",
")",
"throws",
"IOException",
"{",
"return",
"read",
"(",
"new",
"InputStreamReader",
"(",
"in",
",",
"Charsets",
".",
"DEFAULT",
")",
")",
";",
"}"
] | Reads the whole content of the given {@code InputStream} into a
{@code String} using the system's default charset.
@param in the stream to read.
@return the stream's content as a {@code String}.
@throws NullPointerException if {@code in} is {@code null}.
@throws IOException if the stream cannot be read. | [
"Reads",
"the",
"whole",
"content",
"of",
"the",
"given",
"{",
"@code",
"InputStream",
"}",
"into",
"a",
"{",
"@code",
"String",
"}",
"using",
"the",
"system",
"s",
"default",
"charset",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/CharStreams.java#L251-L254 | test | Read a String from an input stream. | Of course, here is the Java code you requested:
```java
public static String read(InputStream in) throws IOException
{
return read(new InputStreamReader(in, Charsets.DEFAULT));
}
```
Hope this helps! |
subchen/jetbrick-all-1x | jetbrick-webmvc/src/main/java/jetbrick/web/mvc/multipart/MultipartRequest.java | MultipartRequest.setParameter | public void setParameter(String name, String value) {
String[] values = parameters.get(name);
if (values == null) {
values = new String[] { value };
parameters.put(name, values);
} else {
String[] newValues = new String[values.length + 1];
System.... | java | public void setParameter(String name, String value) {
String[] values = parameters.get(name);
if (values == null) {
values = new String[] { value };
parameters.put(name, values);
} else {
String[] newValues = new String[values.length + 1];
System.... | [
"public",
"void",
"setParameter",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"String",
"[",
"]",
"values",
"=",
"parameters",
".",
"get",
"(",
"name",
")",
";",
"if",
"(",
"values",
"==",
"null",
")",
"{",
"values",
"=",
"new",
"String"... | <p> Sets a parameter for this request. The parameter is actually
separate from the request parameters, but calling on the getParameter()
methods of this class will work as if they weren't. </p> | [
"<p",
">",
"Sets",
"a",
"parameter",
"for",
"this",
"request",
".",
"The",
"parameter",
"is",
"actually",
"separate",
"from",
"the",
"request",
"parameters",
"but",
"calling",
"on",
"the",
"getParameter",
"()",
"methods",
"of",
"this",
"class",
"will",
"work... | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-webmvc/src/main/java/jetbrick/web/mvc/multipart/MultipartRequest.java#L42-L54 | test | Sets the value of a parameter. | Of course, here is the Java code you requested:
```java
public void setParameter(String name, String value) {
String[] values = parameters.get(name);
if (values == null) {
values = new String[] { value };
parameters.put(name, values);
} else {
String[] newVa... |
oblac/jodd | jodd-decora/src/main/java/jodd/decora/parser/DecoraTag.java | DecoraTag.startRegion | public void startRegion(final int start, final int tagLen, final int deepLevel) {
this.regionStart = start + tagLen;
this.regionLength = 0;
this.regionTagStart = start;
this.deepLevel = deepLevel;
} | java | public void startRegion(final int start, final int tagLen, final int deepLevel) {
this.regionStart = start + tagLen;
this.regionLength = 0;
this.regionTagStart = start;
this.deepLevel = deepLevel;
} | [
"public",
"void",
"startRegion",
"(",
"final",
"int",
"start",
",",
"final",
"int",
"tagLen",
",",
"final",
"int",
"deepLevel",
")",
"{",
"this",
".",
"regionStart",
"=",
"start",
"+",
"tagLen",
";",
"this",
".",
"regionLength",
"=",
"0",
";",
"this",
... | Starts defining region by setting the start index and reset region length to zero. | [
"Starts",
"defining",
"region",
"by",
"setting",
"the",
"start",
"index",
"and",
"reset",
"region",
"length",
"to",
"zero",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-decora/src/main/java/jodd/decora/parser/DecoraTag.java#L175-L180 | test | Start region. | Of course, here is the Java code you requested:
```java
public void startRegion(final int start, final int tagLen, final int deepLevel) {
this.regionStart = start + tagLen;
this.regionLength = 0;
this.regionTagStart = start;
this.deepLevel = deepLevel;
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java | HeadersConfigurer.defaultsDisabled | public HeadersConfigurer<H> defaultsDisabled() {
contentTypeOptions.disable();
xssProtection.disable();
cacheControl.disable();
hsts.disable();
frameOptions.disable();
return this;
} | java | public HeadersConfigurer<H> defaultsDisabled() {
contentTypeOptions.disable();
xssProtection.disable();
cacheControl.disable();
hsts.disable();
frameOptions.disable();
return this;
} | [
"public",
"HeadersConfigurer",
"<",
"H",
">",
"defaultsDisabled",
"(",
")",
"{",
"contentTypeOptions",
".",
"disable",
"(",
")",
";",
"xssProtection",
".",
"disable",
"(",
")",
";",
"cacheControl",
".",
"disable",
"(",
")",
";",
"hsts",
".",
"disable",
"("... | Clears all of the default headers from the response. After doing so, one can add
headers back. For example, if you only want to use Spring Security's cache control
you can use the following:
<pre>
http.headers().defaultsDisabled().cacheControl();
</pre>
@return the {@link HeadersConfigurer} for additional customizati... | [
"Clears",
"all",
"of",
"the",
"default",
"headers",
"from",
"the",
"response",
".",
"After",
"doing",
"so",
"one",
"can",
"add",
"headers",
"back",
".",
"For",
"example",
"if",
"you",
"only",
"want",
"to",
"use",
"Spring",
"Security",
"s",
"cache",
"cont... | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/configurers/HeadersConfigurer.java#L755-L762 | test | Disable all headers that are not configured. | Of course, here is the Java code you requested:
```java
public HeadersConfigurer<H> defaultsDisabled() {
contentTypeOptions.disable();
xssProtection.disable();
cacheControl.disable();
hsts.disable();
frameOptions.disable();
return this;
}
```
Hope this helps! |
subchen/jetbrick-all-1x | jetbrick-commons/src/main/java/jetbrick/beans/ClasspathUtils.java | ClasspathUtils.getClasspathURLs | public static Collection<URL> getClasspathURLs(ClassLoader classLoader, String packageName) {
if (packageName == null) {
throw new IllegalArgumentException("PackageName must be not null.");
}
Collection<URL> urls = new ArrayList<URL>();
String dirname = packageName.replace('.... | java | public static Collection<URL> getClasspathURLs(ClassLoader classLoader, String packageName) {
if (packageName == null) {
throw new IllegalArgumentException("PackageName must be not null.");
}
Collection<URL> urls = new ArrayList<URL>();
String dirname = packageName.replace('.... | [
"public",
"static",
"Collection",
"<",
"URL",
">",
"getClasspathURLs",
"(",
"ClassLoader",
"classLoader",
",",
"String",
"packageName",
")",
"{",
"if",
"(",
"packageName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"PackageName must... | 根据 classLoader 获取指定 package 对应的 URLs. | [
"根据",
"classLoader",
"获取指定",
"package",
"对应的",
"URLs",
"."
] | abe54629a508592287afe5ca4ffc93bf8bf4940c | https://github.com/subchen/jetbrick-all-1x/blob/abe54629a508592287afe5ca4ffc93bf8bf4940c/jetbrick-commons/src/main/java/jetbrick/beans/ClasspathUtils.java#L119-L134 | test | Gets the class path URLs. | Of course, here is the Java code you requested:
```java
public static Collection<URL> getClasspathURLs(ClassLoader classLoader, String packageName) {
if (packageName == null) {
throw new IllegalArgumentException("PackageName must be not null.");
}
Collection<URL> urls = new ArrayLis... |
kocakosm/pitaya | src/org/kocakosm/pitaya/io/ObjectCodec.java | ObjectCodec.encode | public static byte[] encode(Serializable object)
{
Parameters.checkNotNull(object);
ObjectOutputStream oos = null;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
oos = new ObjectOutputStream(out);
oos.writeObject(object);
oos.flush();
return out.toByteArray();
} catch (IOExceptio... | java | public static byte[] encode(Serializable object)
{
Parameters.checkNotNull(object);
ObjectOutputStream oos = null;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
oos = new ObjectOutputStream(out);
oos.writeObject(object);
oos.flush();
return out.toByteArray();
} catch (IOExceptio... | [
"public",
"static",
"byte",
"[",
"]",
"encode",
"(",
"Serializable",
"object",
")",
"{",
"Parameters",
".",
"checkNotNull",
"(",
"object",
")",
";",
"ObjectOutputStream",
"oos",
"=",
"null",
";",
"try",
"{",
"ByteArrayOutputStream",
"out",
"=",
"new",
"ByteA... | Serializes the given {@code Serializable} object into an array of
{@code byte}s.
@param object the object to encode.
@return the given object's encoding.
@throws NullPointerException if {@code object} is {@code null}.
@throws EncodingException if the given object cannot be serialized. | [
"Serializes",
"the",
"given",
"{",
"@code",
"Serializable",
"}",
"object",
"into",
"an",
"array",
"of",
"{",
"@code",
"byte",
"}",
"s",
"."
] | f2b203b6cdb32723bd1249a1325a3bb5918bf99a | https://github.com/kocakosm/pitaya/blob/f2b203b6cdb32723bd1249a1325a3bb5918bf99a/src/org/kocakosm/pitaya/io/ObjectCodec.java#L46-L61 | test | Encode the given object to bytes. | Of course, here is the Java code you requested:
```java
public static byte[] encode(Serializable object)
{
Parameters.checkNotNull(object);
ObjectOutputStream oos = null;
try {
ByteArrayOutputStream out = new ByteArrayOutputStream();
oos = new ObjectOutputStream(out);
oos.writeObject(object);
oos.fl... |
pierre/goodwill-access | src/main/java/com/ning/metrics/goodwill/access/GoodwillSchemaField.java | GoodwillSchemaField.getFullSQLType | @SuppressWarnings("unused")
public String getFullSQLType()
{
String fullSQLType = null;
if (sql.type == null) {
return null;
}
else if (sql.type.equals("decimal") || sql.type.equals("numeric")) {
if (sql.precision != null) {
if (sql.scale ... | java | @SuppressWarnings("unused")
public String getFullSQLType()
{
String fullSQLType = null;
if (sql.type == null) {
return null;
}
else if (sql.type.equals("decimal") || sql.type.equals("numeric")) {
if (sql.precision != null) {
if (sql.scale ... | [
"@",
"SuppressWarnings",
"(",
"\"unused\"",
")",
"public",
"String",
"getFullSQLType",
"(",
")",
"{",
"String",
"fullSQLType",
"=",
"null",
";",
"if",
"(",
"sql",
".",
"type",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"if",
"(",
"sql"... | Pretty print the SQL type.
TODO: add layer of abstraction, too Netezza specific
@return a human readable representation of the SQL type | [
"Pretty",
"print",
"the",
"SQL",
"type",
".",
"TODO",
":",
"add",
"layer",
"of",
"abstraction",
"too",
"Netezza",
"specific"
] | 2a9741a106599b417eb280404ed39bdfa046caef | https://github.com/pierre/goodwill-access/blob/2a9741a106599b417eb280404ed39bdfa046caef/src/main/java/com/ning/metrics/goodwill/access/GoodwillSchemaField.java#L293-L324 | test | Gets the full SQL type. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unused")
public String getFullSQLType()
{
String fullSQLType = null;
if (sql.type == null) {
return null;
}
else if (sql.type.equals("decimal") || sql.type.equals("numeric")) {
if... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.blockingFirst | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final T blockingFirst() {
BlockingFirstObserver<T> observer = new BlockingFirstObserver<T>();
subscribe(observer);
T v = observer.blockingGet();
if (v != null) {
return v;
}
throw new No... | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final T blockingFirst() {
BlockingFirstObserver<T> observer = new BlockingFirstObserver<T>();
subscribe(observer);
T v = observer.blockingGet();
if (v != null) {
return v;
}
throw new No... | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"T",
"blockingFirst",
"(",
")",
"{",
"BlockingFirstObserver",
"<",
"T",
">",
"observer",
"=",
"new",
"BlockingFirstObserver",
"<",
"T",
">",
"(",
")... | Returns the first item emitted by this {@code Observable}, or throws
{@code NoSuchElementException} if it emits no items.
<p>
<img width="640" height="412" src="https://github.com/ReactiveX/RxJava/wiki/images/rx-operators/blockingFirst.o.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code blockingFirst} does not op... | [
"Returns",
"the",
"first",
"item",
"emitted",
"by",
"this",
"{",
"@code",
"Observable",
"}",
"or",
"throws",
"{",
"@code",
"NoSuchElementException",
"}",
"if",
"it",
"emits",
"no",
"items",
".",
"<p",
">",
"<img",
"width",
"=",
"640",
"height",
"=",
"412... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L5115-L5125 | test | Blocking first. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.NONE)
public final T blockingFirst() {
BlockingFirstObserver<T> observer = new BlockingFirstObserver<T>();
subscribe(observer);
T v = observer.blockingGet();
if (v != nul... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java | PositionAndOccurrenceVisitor.enterFunctor | protected void enterFunctor(Functor functor)
{
/*log.fine("Functor: " + functor.getName() + " <- " + symbolTable.getSymbolKey(functor.getName()));*/
// Only check position of occurrence for constants.
if (functor.getArity() == 0)
{
// Add the constant to the set of all c... | java | protected void enterFunctor(Functor functor)
{
/*log.fine("Functor: " + functor.getName() + " <- " + symbolTable.getSymbolKey(functor.getName()));*/
// Only check position of occurrence for constants.
if (functor.getArity() == 0)
{
// Add the constant to the set of all c... | [
"protected",
"void",
"enterFunctor",
"(",
"Functor",
"functor",
")",
"{",
"/*log.fine(\"Functor: \" + functor.getName() + \" <- \" + symbolTable.getSymbolKey(functor.getName()));*/",
"// Only check position of occurrence for constants.",
"if",
"(",
"functor",
".",
"getArity",
"(",
")... | {@inheritDoc}
<p/>Checks if a constant ever appears in an argument position.
<p/>Sets the 'inTopLevelFunctor' flag, whenever the traversal is directly within a top-level functors arguments.
This is set at the end, so that subsequent calls to this will pick up the state of this flag at the point
immediately below a to... | [
"{",
"@inheritDoc",
"}"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/compiler/PositionAndOccurrenceVisitor.java#L140-L170 | test | Enter a functor. | Of course, here is the Java code you requested:
```java
protected void enterFunctor(Functor functor)
{
/*log.fine("Functor: " + functor.getName() + " <- " + symbolTable.getSymbolKey(functor.getName()));*/
// Only check position of occurrence for constants.
if (functor.getArity() == 0)
... |
wildfly/wildfly | webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java | AbstractSecurityMetaDataAccessorEJB.isSecureWsdlAccess | public boolean isSecureWsdlAccess(final Endpoint endpoint) {
final EJBSecurityMetaData ejbSecurityMD = this.getEjbSecurityMetaData(endpoint);
final boolean hasEjbSecurityMD = ejbSecurityMD != null;
return hasEjbSecurityMD ? ejbSecurityMD.getSecureWSDLAccess() : false;
} | java | public boolean isSecureWsdlAccess(final Endpoint endpoint) {
final EJBSecurityMetaData ejbSecurityMD = this.getEjbSecurityMetaData(endpoint);
final boolean hasEjbSecurityMD = ejbSecurityMD != null;
return hasEjbSecurityMD ? ejbSecurityMD.getSecureWSDLAccess() : false;
} | [
"public",
"boolean",
"isSecureWsdlAccess",
"(",
"final",
"Endpoint",
"endpoint",
")",
"{",
"final",
"EJBSecurityMetaData",
"ejbSecurityMD",
"=",
"this",
".",
"getEjbSecurityMetaData",
"(",
"endpoint",
")",
";",
"final",
"boolean",
"hasEjbSecurityMD",
"=",
"ejbSecurity... | @see org.jboss.webservices.integration.tomcat.SecurityMetaDataAccessorEJB#isSecureWsdlAccess(Endpoint)
@param endpoint EJB webservice endpoint
@return whether WSDL access have to be secured | [
"@see",
"org",
".",
"jboss",
".",
"webservices",
".",
"integration",
".",
"tomcat",
".",
"SecurityMetaDataAccessorEJB#isSecureWsdlAccess",
"(",
"Endpoint",
")"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/webservices/server-integration/src/main/java/org/jboss/as/webservices/tomcat/AbstractSecurityMetaDataAccessorEJB.java#L121-L126 | test | Check if the security metadata for the given endpoint is secure WSDL access. | Of course, here is the Java code you requested:
```java
public boolean isSecureWsdlAccess(final Endpoint endpoint) {
final EJBSecurityMetaData ejbSecurityMD = this.getEjbSecurityMetaData(endpoint);
final boolean hasEjbSecurityMD = ejbSecurityMD != null;
return hasEjbSecurityMD ? ejbSecurityMD.... |
TooTallNate/Java-WebSocket | src/main/java/org/java_websocket/SSLSocketChannel2.java | SSLSocketChannel2.unwrap | private synchronized ByteBuffer unwrap() throws SSLException {
int rem;
//There are some ssl test suites, which get around the selector.select() call, which cause an infinite unwrap and 100% cpu usage (see #459 and #458)
if(readEngineResult.getStatus() == SSLEngineResult.Status.CLOSED && sslEngi... | java | private synchronized ByteBuffer unwrap() throws SSLException {
int rem;
//There are some ssl test suites, which get around the selector.select() call, which cause an infinite unwrap and 100% cpu usage (see #459 and #458)
if(readEngineResult.getStatus() == SSLEngineResult.Status.CLOSED && sslEngi... | [
"private",
"synchronized",
"ByteBuffer",
"unwrap",
"(",
")",
"throws",
"SSLException",
"{",
"int",
"rem",
";",
"//There are some ssl test suites, which get around the selector.select() call, which cause an infinite unwrap and 100% cpu usage (see #459 and #458)",
"if",
"(",
"readEngineR... | performs the unwrap operation by unwrapping from {@link #inCrypt} to {@link #inData} | [
"performs",
"the",
"unwrap",
"operation",
"by",
"unwrapping",
"from",
"{"
] | 73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9 | https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/SSLSocketChannel2.java#L190-L206 | test | Unwrap the input data. | Of course, here is the Java code you requested:
```java
private synchronized ByteBuffer unwrap() throws SSLException {
int rem;
//There are some ssl test suites, which get around the selector.select() call, which cause an infinite unwrap and 100% cpu usage (see #459 and #458)
if(readEngineResul... |
objectify/objectify | src/main/java/com/googlecode/objectify/impl/Keys.java | Keys.fromUrlSafe | @SneakyThrows
public static com.google.cloud.datastore.Key fromUrlSafe(final String urlSafeKey) {
if (urlSafeKey.startsWith("a")) {
return KeyFormat.INSTANCE.parseOldStyleAppEngineKey(urlSafeKey);
} else {
return com.google.cloud.datastore.Key.fromUrlSafe(urlSafeKey);
}
} | java | @SneakyThrows
public static com.google.cloud.datastore.Key fromUrlSafe(final String urlSafeKey) {
if (urlSafeKey.startsWith("a")) {
return KeyFormat.INSTANCE.parseOldStyleAppEngineKey(urlSafeKey);
} else {
return com.google.cloud.datastore.Key.fromUrlSafe(urlSafeKey);
}
} | [
"@",
"SneakyThrows",
"public",
"static",
"com",
".",
"google",
".",
"cloud",
".",
"datastore",
".",
"Key",
"fromUrlSafe",
"(",
"final",
"String",
"urlSafeKey",
")",
"{",
"if",
"(",
"urlSafeKey",
".",
"startsWith",
"(",
"\"a\"",
")",
")",
"{",
"return",
"... | Understands both the legacy format "ag1zfnZvb2Rvb2R5bmUwcgcLEgFCGAEM" and new format,
providing the key either way. | [
"Understands",
"both",
"the",
"legacy",
"format",
"ag1zfnZvb2Rvb2R5bmUwcgcLEgFCGAEM",
"and",
"new",
"format",
"providing",
"the",
"key",
"either",
"way",
"."
] | 4bf325d2e49b400326416977c7d9bbdf5380175b | https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/Keys.java#L253-L260 | test | Converts a URL safe key to a Cloud Datastore key. | Of course, here is the Java code you requested:
```java
@SneakyThrows
public static com.google.cloud.datastore.Key fromUrlSafe(final String urlSafeKey) {
if (urlSafeKey.startsWith("a")) {
return KeyFormat.INSTANCE.parseOldStyleAppEngineKey(urlSafeKey);
} else {
return com.google.cloud.datastore.Key.fromUrlS... |
OpenEstate/OpenEstate-IO | Examples/src/main/java/org/openestate/io/examples/OpenImmoReadingExample.java | OpenImmoReadingExample.read | @SuppressWarnings("Duplicates")
protected static void read(File xmlFile) throws SAXException, IOException, ParserConfigurationException, JAXBException {
LOGGER.info("process file: " + xmlFile.getAbsolutePath());
if (!xmlFile.isFile()) {
LOGGER.warn("> provided file is invalid");
... | java | @SuppressWarnings("Duplicates")
protected static void read(File xmlFile) throws SAXException, IOException, ParserConfigurationException, JAXBException {
LOGGER.info("process file: " + xmlFile.getAbsolutePath());
if (!xmlFile.isFile()) {
LOGGER.warn("> provided file is invalid");
... | [
"@",
"SuppressWarnings",
"(",
"\"Duplicates\"",
")",
"protected",
"static",
"void",
"read",
"(",
"File",
"xmlFile",
")",
"throws",
"SAXException",
",",
"IOException",
",",
"ParserConfigurationException",
",",
"JAXBException",
"{",
"LOGGER",
".",
"info",
"(",
"\"pr... | Read a {@link File} into an {@link OpenImmoTransferDocument} or
{@link OpenImmoFeedbackDocument} and print some of their content to
console.
@param xmlFile the file to read
@throws SAXException if the file is not readable by the XML parser
@throws IOException if the file is not readabl... | [
"Read",
"a",
"{",
"@link",
"File",
"}",
"into",
"an",
"{",
"@link",
"OpenImmoTransferDocument",
"}",
"or",
"{",
"@link",
"OpenImmoFeedbackDocument",
"}",
"and",
"print",
"some",
"of",
"their",
"content",
"to",
"console",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/Examples/src/main/java/org/openestate/io/examples/OpenImmoReadingExample.java#L106-L124 | test | Read an XML file and print it to console. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("Duplicates")
protected static void read(File xmlFile) throws SAXException, IOException, ParserConfigurationException, JAXBException {
LOGGER.info("process file: " + xmlFile.getAbsolutePath());
if (!xmlFile.isFile()) {
... |
ReactiveX/RxJava | src/main/java/io/reactivex/parallel/ParallelFlowable.java | ParallelFlowable.sequentialDelayError | @BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@NonNull
public final Flowable<T> sequentialDelayError() {
return sequentialDelayError(Flowable.bufferSize());
} | java | @BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@NonNull
public final Flowable<T> sequentialDelayError() {
return sequentialDelayError(Flowable.bufferSize());
} | [
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"FULL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"@",
"CheckReturnValue",
"@",
"NonNull",
"public",
"final",
"Flowable",
"<",
"T",
">",
"sequentialDelayError",
"(",
")",
"{... | Merges the values from each 'rail' in a round-robin or same-order fashion and
exposes it as a regular Flowable sequence, running with a default prefetch value
for the rails and delaying errors from all rails till all terminate.
<p>
This operator uses the default prefetch size returned by {@code Flowable.bufferSize()}.
... | [
"Merges",
"the",
"values",
"from",
"each",
"rail",
"in",
"a",
"round",
"-",
"robin",
"or",
"same",
"-",
"order",
"fashion",
"and",
"exposes",
"it",
"as",
"a",
"regular",
"Flowable",
"sequence",
"running",
"with",
"a",
"default",
"prefetch",
"value",
"for",... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/parallel/ParallelFlowable.java#L407-L413 | test | Returns a sequence of tokens that have been sent to the server in an error state. | Of course, here is the Java code you requested:
```java
@BackpressureSupport(BackpressureKind.FULL)
@SchedulerSupport(SchedulerSupport.NONE)
@CheckReturnValue
@NonNull
public final Flowable<T> sequentialDelayError() {
return sequentialDelayError(Flowable.bufferSize());
}
```
Hope this help... |
Unidata/thredds | opendap/src/main/java/opendap/dap/DConnect2.java | DConnect2.getDDX | public DDS getDDX(String CE) throws IOException, ParseException, DDSException, DAP2Exception
{
DDXCommand command = new DDXCommand();
openConnection(urlString + ".ddx" + (getCompleteCE(CE)), command);
return command.dds;
} | java | public DDS getDDX(String CE) throws IOException, ParseException, DDSException, DAP2Exception
{
DDXCommand command = new DDXCommand();
openConnection(urlString + ".ddx" + (getCompleteCE(CE)), command);
return command.dds;
} | [
"public",
"DDS",
"getDDX",
"(",
"String",
"CE",
")",
"throws",
"IOException",
",",
"ParseException",
",",
"DDSException",
",",
"DAP2Exception",
"{",
"DDXCommand",
"command",
"=",
"new",
"DDXCommand",
"(",
")",
";",
"openConnection",
"(",
"urlString",
"+",
"\".... | Returns the DDS object from the dataset referenced by this object's URL.
The DDS object is referred to by appending `.ddx' to the end of a OPeNDAP
URL. The server should send back a DDX (A DDS in XML format) which
will get parsed here (locally) and a new DDS instantiated using
the DDSXMLParser.
@param CE The constrain... | [
"Returns",
"the",
"DDS",
"object",
"from",
"the",
"dataset",
"referenced",
"by",
"this",
"object",
"s",
"URL",
".",
"The",
"DDS",
"object",
"is",
"referred",
"to",
"by",
"appending",
".",
"ddx",
"to",
"the",
"end",
"of",
"a",
"OPeNDAP",
"URL",
".",
"Th... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DConnect2.java#L754-L759 | test | Get the DDX for a single CE | Of course, here is the Java code you requested:
```java
public DDS getDDX(String CE) throws IOException, ParseException, DDSException, DAP2Exception
{
DDXCommand command = new DDXCommand();
openConnection(urlString + ".ddx" + (getCompleteCE(CE)), command);
return command.dds;
}
```
Hop... |
FitLayout/api | src/main/java/org/fit/layout/model/Rectangular.java | Rectangular.union | public Rectangular union(Rectangular other)
{
return new Rectangular(Math.min(x1, other.x1),
Math.min(y1, other.y1),
Math.max(x2, other.x2),
Math.max(y2, other.y2));
} | java | public Rectangular union(Rectangular other)
{
return new Rectangular(Math.min(x1, other.x1),
Math.min(y1, other.y1),
Math.max(x2, other.x2),
Math.max(y2, other.y2));
} | [
"public",
"Rectangular",
"union",
"(",
"Rectangular",
"other",
")",
"{",
"return",
"new",
"Rectangular",
"(",
"Math",
".",
"min",
"(",
"x1",
",",
"other",
".",
"x1",
")",
",",
"Math",
".",
"min",
"(",
"y1",
",",
"other",
".",
"y1",
")",
",",
"Math"... | Computes the union of this rectangle with another one.
@param other the other rectangle
@return the union rectangle | [
"Computes",
"the",
"union",
"of",
"this",
"rectangle",
"with",
"another",
"one",
"."
] | fcfa67ce2a7485fbd722576413191fff5d68bae8 | https://github.com/FitLayout/api/blob/fcfa67ce2a7485fbd722576413191fff5d68bae8/src/main/java/org/fit/layout/model/Rectangular.java#L301-L307 | test | Union the two set of coordinates. | Of course, here is the Java code you requested:
```java
public Rectangular union(Rectangular other)
{
return new Rectangular(Math.min(x1, other.x1),
Math.min(y1, other.y1),
Math.max(x2, other.x2),
Math.max(y2, othe... |
RestComm/jain-slee | container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java | ServiceUsageMBeanImpl.createUsageParameterSet | public void createUsageParameterSet(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException,
UsageParameterSetNameAlreadyExistsException, ManagementException {
_createUsageParameterSet(sbbId, null, false);
} | java | public void createUsageParameterSet(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException,
UsageParameterSetNameAlreadyExistsException, ManagementException {
_createUsageParameterSet(sbbId, null, false);
} | [
"public",
"void",
"createUsageParameterSet",
"(",
"SbbID",
"sbbId",
")",
"throws",
"NullPointerException",
",",
"UnrecognizedSbbException",
",",
"InvalidArgumentException",
",",
"UsageParameterSetNameAlreadyExistsException",
",",
"ManagementException",
"{",
"_createUsageParameter... | /*
creates the default usage parameter set | [
"/",
"*",
"creates",
"the",
"default",
"usage",
"parameter",
"set"
] | 0eaa16ff2d4b6faf43f0d99260e88878fd54dee0 | https://github.com/RestComm/jain-slee/blob/0eaa16ff2d4b6faf43f0d99260e88878fd54dee0/container/usage/src/main/java/org/mobicents/slee/container/management/jmx/ServiceUsageMBeanImpl.java#L179-L184 | test | This method is called to create a usage parameter set. It will create the usage parameter set if it does not already exist. | Of course, here is the Java code you requested:
```java
public void createUsageParameterSet(SbbID sbbId)
throws NullPointerException, UnrecognizedSbbException,
InvalidArgumentException,
UsageParameterSetNameAlreadyExistsException, ManagementException {
_createUsageParameterSet(sbbId, null, false);
}
`... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/features/user/FeatureTableReader.java | FeatureTableReader.createColumn | @Override
protected FeatureColumn createColumn(FeatureCursor cursor, int index, String name,
String type, Long max, boolean notNull, int defaultValueIndex,
boolean primaryKey) {
boolean geometry = name.equalsIgnoreCase(geomet... | java | @Override
protected FeatureColumn createColumn(FeatureCursor cursor, int index, String name,
String type, Long max, boolean notNull, int defaultValueIndex,
boolean primaryKey) {
boolean geometry = name.equalsIgnoreCase(geomet... | [
"@",
"Override",
"protected",
"FeatureColumn",
"createColumn",
"(",
"FeatureCursor",
"cursor",
",",
"int",
"index",
",",
"String",
"name",
",",
"String",
"type",
",",
"Long",
"max",
",",
"boolean",
"notNull",
",",
"int",
"defaultValueIndex",
",",
"boolean",
"p... | {@inheritDoc} | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/features/user/FeatureTableReader.java#L45-L67 | test | Create a feature column | Of course, here is the Java code you requested:
```java
@Override
protected FeatureColumn createColumn(FeatureCursor cursor, int index, String name,
String type, Long max, boolean notNull, int defaultValueIndex,
boolean primaryKey) {... |
open-korean-text/open-korean-text | src/main/java/org/openkoreantext/processor/OpenKoreanTextProcessorJava.java | OpenKoreanTextProcessorJava.extractPhrases | public static List<KoreanPhraseExtractor.KoreanPhrase> extractPhrases(Seq<KoreanToken> tokens, boolean filterSpam, boolean includeHashtags) {
Seq<KoreanPhraseExtractor.KoreanPhrase> seq = OpenKoreanTextProcessor.extractPhrases(tokens, filterSpam, includeHashtags);
return toJavaList(seq);
} | java | public static List<KoreanPhraseExtractor.KoreanPhrase> extractPhrases(Seq<KoreanToken> tokens, boolean filterSpam, boolean includeHashtags) {
Seq<KoreanPhraseExtractor.KoreanPhrase> seq = OpenKoreanTextProcessor.extractPhrases(tokens, filterSpam, includeHashtags);
return toJavaList(seq);
} | [
"public",
"static",
"List",
"<",
"KoreanPhraseExtractor",
".",
"KoreanPhrase",
">",
"extractPhrases",
"(",
"Seq",
"<",
"KoreanToken",
">",
"tokens",
",",
"boolean",
"filterSpam",
",",
"boolean",
"includeHashtags",
")",
"{",
"Seq",
"<",
"KoreanPhraseExtractor",
"."... | Extract phrases from Korean input text
@param tokens Korean tokens (output of tokenize(CharSequence text)).
@return List of phrase CharSequences. | [
"Extract",
"phrases",
"from",
"Korean",
"input",
"text"
] | ed815a224b986e5a5d03fbd8f5c8d154e84e5b40 | https://github.com/open-korean-text/open-korean-text/blob/ed815a224b986e5a5d03fbd8f5c8d154e84e5b40/src/main/java/org/openkoreantext/processor/OpenKoreanTextProcessorJava.java#L165-L168 | test | Extract phrase from a sequence of tokens. | Of course, here is the Java code you requested:
```java
public static List<KoreanPhraseExtractor.KoreanPhrase> extractPhrases(Seq<KoreanToken> tokens, boolean filterSpam, boolean includeHashtags) {
Seq<KoreanPhraseExtractor.KoreanPhrase> seq = OpenKoreanTextProcessor.extractPhrases(tokens, filterSpam, includeHasht... |
spring-projects/spring-security | acl/src/main/java/org/springframework/security/acls/domain/AclImpl.java | AclImpl.deleteAce | @Override
public void deleteAce(int aceIndex) throws NotFoundException {
aclAuthorizationStrategy.securityCheck(this,
AclAuthorizationStrategy.CHANGE_GENERAL);
verifyAceIndexExists(aceIndex);
synchronized (aces) {
this.aces.remove(aceIndex);
}
} | java | @Override
public void deleteAce(int aceIndex) throws NotFoundException {
aclAuthorizationStrategy.securityCheck(this,
AclAuthorizationStrategy.CHANGE_GENERAL);
verifyAceIndexExists(aceIndex);
synchronized (aces) {
this.aces.remove(aceIndex);
}
} | [
"@",
"Override",
"public",
"void",
"deleteAce",
"(",
"int",
"aceIndex",
")",
"throws",
"NotFoundException",
"{",
"aclAuthorizationStrategy",
".",
"securityCheck",
"(",
"this",
",",
"AclAuthorizationStrategy",
".",
"CHANGE_GENERAL",
")",
";",
"verifyAceIndexExists",
"(... | ======================================================================================================== | [
"========================================================================================================"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/acl/src/main/java/org/springframework/security/acls/domain/AclImpl.java#L126-L135 | test | Delete an ACE from the cache. | Of course, here is the Java code you requested:
```java
@Override
public void deleteAce(int aceIndex) throws NotFoundException {
aclAuthorizationStrategy.securityCheck(this,
AclAuthorizationStrategy.CHANGE_GENERAL);
verifyAceIndexExists(aceIndex);
synchronized (aces) {
this.aces.remove(aceIndex);
}
}... |
snakerflow/snakerflow | snaker-core/src/main/java/org/snaker/engine/core/TaskService.java | TaskService.resume | public Task resume(String taskId, String operator) {
HistoryTask histTask = access().getHistTask(taskId);
AssertHelper.notNull(histTask, "指定的历史任务[id=" + taskId + "]不存在");
boolean isAllowed = true;
if(StringHelper.isNotEmpty(histTask.getOperator())) {
isAllowed = histTask.getO... | java | public Task resume(String taskId, String operator) {
HistoryTask histTask = access().getHistTask(taskId);
AssertHelper.notNull(histTask, "指定的历史任务[id=" + taskId + "]不存在");
boolean isAllowed = true;
if(StringHelper.isNotEmpty(histTask.getOperator())) {
isAllowed = histTask.getO... | [
"public",
"Task",
"resume",
"(",
"String",
"taskId",
",",
"String",
"operator",
")",
"{",
"HistoryTask",
"histTask",
"=",
"access",
"(",
")",
".",
"getHistTask",
"(",
"taskId",
")",
";",
"AssertHelper",
".",
"notNull",
"(",
"histTask",
",",
"\"指定的历史任务[id=\" ... | 唤醒指定的历史任务 | [
"唤醒指定的历史任务"
] | 9c8cb3148a76702f1eda22f1d113053cb44b1eff | https://github.com/snakerflow/snakerflow/blob/9c8cb3148a76702f1eda22f1d113053cb44b1eff/snaker-core/src/main/java/org/snaker/engine/core/TaskService.java#L141-L158 | test | Resume a task. | Of course, here is the Java code you requested:
```java
public Task resume(String taskId, String operator) {
HistoryTask histTask = access().getHistTask(taskId);
AssertHelper.notNull(histTask, "指定的历史任务[id=" + taskId + "]不存在");
boolean isAllowed = true;
if(StringHelper.isNotEmpty(histTas... |
apache/parquet-mr | parquet-column/src/main/java/org/apache/parquet/schema/PrimitiveType.java | PrimitiveType.writeToStringBuilder | @Override
public void writeToStringBuilder(StringBuilder sb, String indent) {
sb.append(indent)
.append(getRepetition().name().toLowerCase(Locale.ENGLISH))
.append(" ")
.append(primitive.name().toLowerCase());
if (primitive == PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY) {
sb.append("... | java | @Override
public void writeToStringBuilder(StringBuilder sb, String indent) {
sb.append(indent)
.append(getRepetition().name().toLowerCase(Locale.ENGLISH))
.append(" ")
.append(primitive.name().toLowerCase());
if (primitive == PrimitiveTypeName.FIXED_LEN_BYTE_ARRAY) {
sb.append("... | [
"@",
"Override",
"public",
"void",
"writeToStringBuilder",
"(",
"StringBuilder",
"sb",
",",
"String",
"indent",
")",
"{",
"sb",
".",
"append",
"(",
"indent",
")",
".",
"append",
"(",
"getRepetition",
"(",
")",
".",
"name",
"(",
")",
".",
"toLowerCase",
"... | {@inheritDoc} | [
"{"
] | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-column/src/main/java/org/apache/parquet/schema/PrimitiveType.java#L602-L619 | test | Override the toStringBuilder method to append the content of the CID to a StringBuilder. | Of course, here is the Java code you requested:
```java
@Override
public void writeToStringBuilder(StringBuilder sb, String indent) {
sb.append(indent)
.append(getRepetition().name().toLowerCase(Locale.ENGLISH))
.append(" ")
.append(primitive.name().toLowerCase());
if (primitive == Pr... |
orientechnologies/orientdb | server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java | ODistributedConfiguration.getDataCenterWriteQuorum | public int getDataCenterWriteQuorum(final String dataCenter) {
final ODocument dc = getDataCenterConfiguration(dataCenter);
Object wq = dc.field(WRITE_QUORUM);
if (wq instanceof String) {
if (wq.toString().equalsIgnoreCase(ODistributedConfiguration.QUORUM_MAJORITY)) {
final List<String> serv... | java | public int getDataCenterWriteQuorum(final String dataCenter) {
final ODocument dc = getDataCenterConfiguration(dataCenter);
Object wq = dc.field(WRITE_QUORUM);
if (wq instanceof String) {
if (wq.toString().equalsIgnoreCase(ODistributedConfiguration.QUORUM_MAJORITY)) {
final List<String> serv... | [
"public",
"int",
"getDataCenterWriteQuorum",
"(",
"final",
"String",
"dataCenter",
")",
"{",
"final",
"ODocument",
"dc",
"=",
"getDataCenterConfiguration",
"(",
"dataCenter",
")",
";",
"Object",
"wq",
"=",
"dc",
".",
"field",
"(",
"WRITE_QUORUM",
")",
";",
"if... | Returns the data center write quorum.
@param dataCenter Data center name | [
"Returns",
"the",
"data",
"center",
"write",
"quorum",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/server/src/main/java/com/orientechnologies/orient/server/distributed/ODistributedConfiguration.java#L592-L608 | test | Get the data center write quorum. | Of course, here is the Java code you requested:
```java
public int getDataCenterWriteQuorum(final String dataCenter) {
final ODocument dc = getDataCenterConfiguration(dataCenter);
Object wq = dc.field(WRITE_QUORUM);
if (wq instanceof String) {
if (wq.toString().equalsIgnoreCase(ODistributedConfigur... |
Unidata/thredds | udunits/src/main/java/ucar/units/UnitDBImpl.java | UnitDBImpl.addUnit | public void addUnit(final Unit unit) throws UnitExistsException,
NameException {
if (unit.getName() == null) {
throw new NameException("Unit name can't be null");
}
addByName(unit.getName(), unit);
addByName(unit.getPlural(), unit);
addBySymbol(unit.getSymbol(), unit);
unitSet.add(unit);
} | java | public void addUnit(final Unit unit) throws UnitExistsException,
NameException {
if (unit.getName() == null) {
throw new NameException("Unit name can't be null");
}
addByName(unit.getName(), unit);
addByName(unit.getPlural(), unit);
addBySymbol(unit.getSymbol(), unit);
unitSet.add(unit);
} | [
"public",
"void",
"addUnit",
"(",
"final",
"Unit",
"unit",
")",
"throws",
"UnitExistsException",
",",
"NameException",
"{",
"if",
"(",
"unit",
".",
"getName",
"(",
")",
"==",
"null",
")",
"{",
"throw",
"new",
"NameException",
"(",
"\"Unit name can't be null\""... | Adds a unit to the database.
@param unit
The unit to be added.
@throws UnitExistsException
Another unit with the same name or symbol already exists in
the database.
@throws NameException
Bad unit name. | [
"Adds",
"a",
"unit",
"to",
"the",
"database",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/udunits/src/main/java/ucar/units/UnitDBImpl.java#L106-L115 | test | Add a unit to the unit set. | Of course, here is the Java code you requested:
```java
public void addUnit(final Unit unit) throws UnitExistsException,
NameException {
if (unit.getName() == null) {
throw new NameException("Unit name can't be null");
}
addByName(unit.getName(), unit);
addByName(unit.getPlural(), unit);
addBySymbol(un... |
OpenEstate/OpenEstate-IO | IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java | GrundstueckEmpfohleneNutzung.setLager | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setLager(JAXBElement<Object> value) {
this.lager = value;
} | java | @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11")
public void setLager(JAXBElement<Object> value) {
this.lager = value;
} | [
"@",
"Generated",
"(",
"value",
"=",
"\"com.sun.tools.xjc.Driver\"",
",",
"date",
"=",
"\"2018-10-12T02:52:47+02:00\"",
",",
"comments",
"=",
"\"JAXB RI v2.2.11\"",
")",
"public",
"void",
"setLager",
"(",
"JAXBElement",
"<",
"Object",
">",
"value",
")",
"{",
"this... | Sets the value of the lager property.
@param value
allowed object is
{@link JAXBElement }{@code <}{@link Object }{@code >} | [
"Sets",
"the",
"value",
"of",
"the",
"lager",
"property",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java#L626-L629 | test | Sets the value of the lager 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 void setLager(JAXBElement<Object> value) {
this.lager = value;
}
```
Hope this helps! |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/jaxb/org/openestate/io/openimmo/xml/ObjectFactory.java | ObjectFactory.createKellerflaeche | @XmlElementDecl(namespace = "", name = "kellerflaeche")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createKellerflaeche(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Kellerflaeche_QNAME, BigDecimal.class, null, value);
} | java | @XmlElementDecl(namespace = "", name = "kellerflaeche")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createKellerflaeche(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Kellerflaeche_QNAME, BigDecimal.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"\"",
",",
"name",
"=",
"\"kellerflaeche\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter2",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"BigDecimal",
">",
"createKellerflaeche",
"(",
"BigDecimal",
"value",
"... | 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#L2358-L2362 | test | Create an instance of an JAXBElement<BigDecimal > that is a subclass of JAXBElement<BigDecimal >. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "", name = "kellerflaeche")
@XmlJavaTypeAdapter(Adapter2 .class)
public JAXBElement<BigDecimal> createKellerflaeche(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Kellerflaeche_QNAME, BigDecimal.class, null, va... |
phax/ph-math | ph-math/src/main/java/com/helger/numbercruncher/matrix/IdentityMatrix.java | IdentityMatrix.convert | public static void convert (final SquareMatrix sm)
{
for (int r = 0; r < sm.m_nRows; ++r)
{
for (int c = 0; c < sm.m_nCols; ++c)
{
sm.m_aValues[r][c] = (r == c) ? 1 : 0;
}
}
} | java | public static void convert (final SquareMatrix sm)
{
for (int r = 0; r < sm.m_nRows; ++r)
{
for (int c = 0; c < sm.m_nCols; ++c)
{
sm.m_aValues[r][c] = (r == c) ? 1 : 0;
}
}
} | [
"public",
"static",
"void",
"convert",
"(",
"final",
"SquareMatrix",
"sm",
")",
"{",
"for",
"(",
"int",
"r",
"=",
"0",
";",
"r",
"<",
"sm",
".",
"m_nRows",
";",
"++",
"r",
")",
"{",
"for",
"(",
"int",
"c",
"=",
"0",
";",
"c",
"<",
"sm",
".",
... | Convert a square matrix into an identity matrix.
@param sm
the square matrix to convert | [
"Convert",
"a",
"square",
"matrix",
"into",
"an",
"identity",
"matrix",
"."
] | 9f998870c7e05226e032b1f38c23e7d45ec0169d | https://github.com/phax/ph-math/blob/9f998870c7e05226e032b1f38c23e7d45ec0169d/ph-math/src/main/java/com/helger/numbercruncher/matrix/IdentityMatrix.java#L40-L49 | test | Convert a square matrix to a single integer. | Of course, here is the Java code you requested:
```java
public static void convert (final SquareMatrix sm)
{
for (int r = 0; r < sm.m_nRows; ++r)
{
for (int c = 0; c < sm.m_nCols; ++c)
{
sm.m_aValues[r][c] = (r == c) ? 1 : 0;
}
}
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.onAssembly | @SuppressWarnings({ "rawtypes", "unchecked" })
@NonNull
public static <T> Observable<T> onAssembly(@NonNull Observable<T> source) {
Function<? super Observable, ? extends Observable> f = onObservableAssembly;
if (f != null) {
return apply(f, source);
}
return source;
... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
@NonNull
public static <T> Observable<T> onAssembly(@NonNull Observable<T> source) {
Function<? super Observable, ? extends Observable> f = onObservableAssembly;
if (f != null) {
return apply(f, source);
}
return source;
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"@",
"NonNull",
"public",
"static",
"<",
"T",
">",
"Observable",
"<",
"T",
">",
"onAssembly",
"(",
"@",
"NonNull",
"Observable",
"<",
"T",
">",
"source",
")",
"{",
"Functi... | Calls the associated hook function.
@param <T> the value type
@param source the hook's input value
@return the value returned by the hook | [
"Calls",
"the",
"associated",
"hook",
"function",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L1049-L1057 | test | On assembly. | Of course, here is the Java code you requested:
```java
@SuppressWarnings({ "rawtypes", "unchecked" })
@NonNull
public static <T> Observable<T> onAssembly(@NonNull Observable<T> source) {
Function<? super Observable, ? extends Observable> f = onObservableAssembly;
if (f != null) {
r... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/Variable.java | Variable.getNameAndDimensions | public void getNameAndDimensions(StringBuffer buf) {
Formatter proxy = new Formatter();
getNameAndDimensions(proxy, true, false);
buf.append(proxy.toString());
} | java | public void getNameAndDimensions(StringBuffer buf) {
Formatter proxy = new Formatter();
getNameAndDimensions(proxy, true, false);
buf.append(proxy.toString());
} | [
"public",
"void",
"getNameAndDimensions",
"(",
"StringBuffer",
"buf",
")",
"{",
"Formatter",
"proxy",
"=",
"new",
"Formatter",
"(",
")",
";",
"getNameAndDimensions",
"(",
"proxy",
",",
"true",
",",
"false",
")",
";",
"buf",
".",
"append",
"(",
"proxy",
"."... | Get the display name plus the dimensions, eg 'name(dim1, dim2)'
@param buf add info to this StringBuffer
@deprecated use getNameAndDimensions(StringBuilder buf) | [
"Get",
"the",
"display",
"name",
"plus",
"the",
"dimensions",
"eg",
"name",
"(",
"dim1",
"dim2",
")"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/Variable.java#L889-L893 | test | Get the name and dimensions of the SEP. | Of course, here is the Java code you requested:
```java
public void getNameAndDimensions(StringBuffer buf) {
Formatter proxy = new Formatter();
getNameAndDimensions(proxy, true, false);
buf.append(proxy.toString());
}
```
Hope this helps! |
boonproject/boon | boon/src/main/java/org/boon/StringScanner.java | StringScanner.splitByCharsNoneEmpty | public static String[] splitByCharsNoneEmpty( final String string, int start, int end, final char... delimiters ) {
Exceptions.requireNonNull( string );
char[][] comps = CharScanner.splitByCharsNoneEmpty( FastStringUtils.toCharArray( string ), start, end, delimiters );
return Str.fromCharArrayO... | java | public static String[] splitByCharsNoneEmpty( final String string, int start, int end, final char... delimiters ) {
Exceptions.requireNonNull( string );
char[][] comps = CharScanner.splitByCharsNoneEmpty( FastStringUtils.toCharArray( string ), start, end, delimiters );
return Str.fromCharArrayO... | [
"public",
"static",
"String",
"[",
"]",
"splitByCharsNoneEmpty",
"(",
"final",
"String",
"string",
",",
"int",
"start",
",",
"int",
"end",
",",
"final",
"char",
"...",
"delimiters",
")",
"{",
"Exceptions",
".",
"requireNonNull",
"(",
"string",
")",
";",
"c... | Split string by a list of delimiters but none are empty within a range
@param string string to split
@param delimiters delimeters to split it by
@return the split up string | [
"Split",
"string",
"by",
"a",
"list",
"of",
"delimiters",
"but",
"none",
"are",
"empty",
"within",
"a",
"range"
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/StringScanner.java#L180-L185 | test | Split a string by chars none empty. | Of course, here is the Java code you requested:
```java
public static String[] splitByCharsNoneEmpty( final String string, int start, int end, final char... delimiters ) {
Exceptions.requireNonNull( string );
char[][] comps = CharScanner.splitByCharsNoneEmpty( FastStringUtils.toCharArray( string ), st... |
Unidata/thredds | dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java | CDMArrayAtomic.getElementType | public Class
getElementType()
{
DataType dt = CDMTypeFcns.daptype2cdmtype(this.basetype);
if(dt == null)
throw new IllegalArgumentException("Unknown datatype: " + this.basetype);
return CDMTypeFcns.cdmElementClass(dt);
} | java | public Class
getElementType()
{
DataType dt = CDMTypeFcns.daptype2cdmtype(this.basetype);
if(dt == null)
throw new IllegalArgumentException("Unknown datatype: " + this.basetype);
return CDMTypeFcns.cdmElementClass(dt);
} | [
"public",
"Class",
"getElementType",
"(",
")",
"{",
"DataType",
"dt",
"=",
"CDMTypeFcns",
".",
"daptype2cdmtype",
"(",
"this",
".",
"basetype",
")",
";",
"if",
"(",
"dt",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Unknown datatype: ... | TODO: add index range checks | [
"TODO",
":",
"add",
"index",
"range",
"checks"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/nc2/CDMArrayAtomic.java#L118-L125 | test | Gets the type of the element. | Of course, here is the Java code you requested:
```java
public Class
getElementType()
{
DataType dt = CDMTypeFcns.daptype2cdmtype(this.basetype);
if(dt == null)
throw new IllegalArgumentException("Unknown datatype: " + this.basetype);
return CDMTypeFcns.cdmElementClass(dt);
... |
medcl/elasticsearch-analysis-ik | src/main/java/org/wltea/analyzer/core/QuickSortSet.java | QuickSortSet.pollLast | Lexeme pollLast(){
if(this.size == 1){
Lexeme last = this.head.lexeme;
this.head = null;
this.tail = null;
this.size--;
return last;
}else if(this.size > 1){
Lexeme last = this.tail.lexeme;
this.tail = this.tail.prev;
this.size--;
return last;
}else{
return nul... | java | Lexeme pollLast(){
if(this.size == 1){
Lexeme last = this.head.lexeme;
this.head = null;
this.tail = null;
this.size--;
return last;
}else if(this.size > 1){
Lexeme last = this.tail.lexeme;
this.tail = this.tail.prev;
this.size--;
return last;
}else{
return nul... | [
"Lexeme",
"pollLast",
"(",
")",
"{",
"if",
"(",
"this",
".",
"size",
"==",
"1",
")",
"{",
"Lexeme",
"last",
"=",
"this",
".",
"head",
".",
"lexeme",
";",
"this",
".",
"head",
"=",
"null",
";",
"this",
".",
"tail",
"=",
"null",
";",
"this",
".",... | 取出链表集合的最后一个元素
@return Lexeme | [
"取出链表集合的最后一个元素"
] | a1d6ba8ca206d750e68bbf3e53a25284100174bd | https://github.com/medcl/elasticsearch-analysis-ik/blob/a1d6ba8ca206d750e68bbf3e53a25284100174bd/src/main/java/org/wltea/analyzer/core/QuickSortSet.java#L141-L158 | test | Polls the last element of the list of tokens. | Of course, here is the Java code you requested:
```java
Lexeme pollLast(){
if(this.size == 1){
Lexeme last = this.head.lexeme;
this.head = null;
this.tail = null;
this.size--;
return last;
}else if(this.size > 1){
Lexeme last = this.tail.lexeme;
this.tail = this.tail.prev;
th... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/swing/workflow/WorkFlowController.java | WorkFlowController.saveWorkFlow | protected void saveWorkFlow()
{
/*log.fine("void saveWorkFlow(): called");*/
// Cycle through all the accessed screens in the work flow
while (!accessedScreens.isEmpty())
{
WorkFlowScreenPanel nextScreen = (WorkFlowScreenPanel) accessedScreens.pop();
// Chec... | java | protected void saveWorkFlow()
{
/*log.fine("void saveWorkFlow(): called");*/
// Cycle through all the accessed screens in the work flow
while (!accessedScreens.isEmpty())
{
WorkFlowScreenPanel nextScreen = (WorkFlowScreenPanel) accessedScreens.pop();
// Chec... | [
"protected",
"void",
"saveWorkFlow",
"(",
")",
"{",
"/*log.fine(\"void saveWorkFlow(): called\");*/",
"// Cycle through all the accessed screens in the work flow",
"while",
"(",
"!",
"accessedScreens",
".",
"isEmpty",
"(",
")",
")",
"{",
"WorkFlowScreenPanel",
"nextScreen",
"... | Method called when the finish button is pressed. It works through all the screens in the order in which they were
accessed (or reverse order, depending on the order set by the {@link #setCommitOrder} method). Any screens that
are in the NOT_SAVED state will have their {@link WorkFlowScreenPanel#saveWork} method called.... | [
"Method",
"called",
"when",
"the",
"finish",
"button",
"is",
"pressed",
".",
"It",
"works",
"through",
"all",
"the",
"screens",
"in",
"the",
"order",
"in",
"which",
"they",
"were",
"accessed",
"(",
"or",
"reverse",
"order",
"depending",
"on",
"the",
"order... | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/swing/workflow/WorkFlowController.java#L223-L241 | test | Save the work flow. | Of course, here is the Java code you requested:
```java
protected void saveWorkFlow()
{
/*log.fine("void saveWorkFlow(): called");*/
// Cycle through all the accessed screens in the work flow
while (!accessedScreens.isEmpty())
{
WorkFlowScreenPanel nextScreen = (WorkFlo... |
oblac/jodd | jodd-madvoc/src/main/java/jodd/madvoc/Madvoc.java | Madvoc.startWebApplication | @SuppressWarnings("InstanceofCatchParameter")
public WebApp startWebApplication(final ServletContext servletContext) {
try {
WebApp webApp = _start(servletContext);
log.info("Madvoc is up and running.");
return webApp;
}
catch (Exception ex) {
if (log != null) {
log.error("Madvoc startup failur... | java | @SuppressWarnings("InstanceofCatchParameter")
public WebApp startWebApplication(final ServletContext servletContext) {
try {
WebApp webApp = _start(servletContext);
log.info("Madvoc is up and running.");
return webApp;
}
catch (Exception ex) {
if (log != null) {
log.error("Madvoc startup failur... | [
"@",
"SuppressWarnings",
"(",
"\"InstanceofCatchParameter\"",
")",
"public",
"WebApp",
"startWebApplication",
"(",
"final",
"ServletContext",
"servletContext",
")",
"{",
"try",
"{",
"WebApp",
"webApp",
"=",
"_start",
"(",
"servletContext",
")",
";",
"log",
".",
"i... | Creates and starts new <code>Madvoc</code> web application.
<code>Madvoc</code> instance is stored in servlet context.
Important: <code>servletContext</code> may be <code>null</code>,
when web application is run out from container. | [
"Creates",
"and",
"starts",
"new",
"<code",
">",
"Madvoc<",
"/",
"code",
">",
"web",
"application",
".",
"<code",
">",
"Madvoc<",
"/",
"code",
">",
"instance",
"is",
"stored",
"in",
"servlet",
"context",
".",
"Important",
":",
"<code",
">",
"servletContext... | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-madvoc/src/main/java/jodd/madvoc/Madvoc.java#L141-L161 | test | Start the application. | Of course, here is the Java code you requested:
```java
@SuppressWarnings("InstanceofCatchParameter")
public WebApp startWebApplication(final ServletContext servletContext) {
try {
WebApp webApp = _start(servletContext);
log.info("Madvoc is up and running.");
return webApp;
}
catch (Exception ex) {
... |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/user/UserDao.java | UserDao.queryForIdRow | @Override
public TRow queryForIdRow(long id) {
TRow row = null;
TResult readCursor = queryForId(id);
if (readCursor.moveToNext()) {
row = readCursor.getRow();
if (!row.isValid() && readCursor.moveToNext()) {
row = readCursor.getRow();
}
... | java | @Override
public TRow queryForIdRow(long id) {
TRow row = null;
TResult readCursor = queryForId(id);
if (readCursor.moveToNext()) {
row = readCursor.getRow();
if (!row.isValid() && readCursor.moveToNext()) {
row = readCursor.getRow();
}
... | [
"@",
"Override",
"public",
"TRow",
"queryForIdRow",
"(",
"long",
"id",
")",
"{",
"TRow",
"row",
"=",
"null",
";",
"TResult",
"readCursor",
"=",
"queryForId",
"(",
"id",
")",
";",
"if",
"(",
"readCursor",
".",
"moveToNext",
"(",
")",
")",
"{",
"row",
... | {@inheritDoc}
Handles requery of invalid id row | [
"{"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/user/UserDao.java#L107-L119 | test | Query for a single row of a single ID. | Of course, here is the Java code you requested:
```java
@Override
public TRow queryForIdRow(long id) {
TRow row = null;
TResult readCursor = queryForId(id);
if (readCursor.moveToNext()) {
row = readCursor.getRow();
if (!row.isValid() && readCursor.moveToNext()) {
... |
algolia/algoliasearch-client-android | algoliasearch/src/offline/java/com/algolia/search/saas/OfflineIndex.java | OfflineIndex.deleteByQueryAsync | public Request deleteByQueryAsync(@NonNull Query query, CompletionHandler completionHandler) {
final WriteTransaction transaction = newTransaction();
final Query queryCopy = new Query(query);
return getClient().new AsyncTaskRequest(completionHandler, getClient().transactionExecutorService) {
... | java | public Request deleteByQueryAsync(@NonNull Query query, CompletionHandler completionHandler) {
final WriteTransaction transaction = newTransaction();
final Query queryCopy = new Query(query);
return getClient().new AsyncTaskRequest(completionHandler, getClient().transactionExecutorService) {
... | [
"public",
"Request",
"deleteByQueryAsync",
"(",
"@",
"NonNull",
"Query",
"query",
",",
"CompletionHandler",
"completionHandler",
")",
"{",
"final",
"WriteTransaction",
"transaction",
"=",
"newTransaction",
"(",
")",
";",
"final",
"Query",
"queryCopy",
"=",
"new",
... | Delete all objects matching a query (helper).
@param query The query that objects to delete must match.
@param completionHandler The listener that will be notified of the request's outcome.
@return A cancellable request. | [
"Delete",
"all",
"objects",
"matching",
"a",
"query",
"(",
"helper",
")",
"."
] | 3293ba6e6116a4f6c1face2cc606bc047d6d4a3c | https://github.com/algolia/algoliasearch-client-android/blob/3293ba6e6116a4f6c1face2cc606bc047d6d4a3c/algoliasearch/src/offline/java/com/algolia/search/saas/OfflineIndex.java#L990-L1009 | test | Asynchronously delete objects by query asynchronously. | Of course, here is the Java code you requested:
```java
public Request deleteByQueryAsync(@NonNull Query query, CompletionHandler completionHandler) {
final WriteTransaction transaction = newTransaction();
final Query queryCopy = new Query(query);
return getClient().new AsyncTaskRequest(complet... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java | DateHelper.isSameWeekDates | public static boolean isSameWeekDates(Date date1, Date date2) {
Calendar cal1 = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance();
cal1.setTime(date1);
cal2.setTime(date2);
int subYear = cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR);
if (0 == subYear) {
... | java | public static boolean isSameWeekDates(Date date1, Date date2) {
Calendar cal1 = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance();
cal1.setTime(date1);
cal2.setTime(date2);
int subYear = cal1.get(Calendar.YEAR) - cal2.get(Calendar.YEAR);
if (0 == subYear) {
... | [
"public",
"static",
"boolean",
"isSameWeekDates",
"(",
"Date",
"date1",
",",
"Date",
"date2",
")",
"{",
"Calendar",
"cal1",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"Calendar",
"cal2",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal1",
... | 判断二个时间是否在同一个周
@param date1
@param date2
@return | [
"判断二个时间是否在同一个周"
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/DateHelper.java#L409-L427 | test | isSameWeekDates This method checks if two dates are in the same week. | Of course, here is the Java code you requested:
```java
public static boolean isSameWeekDates(Date date1, Date date2) {
Calendar cal1 = Calendar.getInstance();
Calendar cal2 = Calendar.getInstance();
cal1.setTime(date1);
cal2.setTime(date2);
int subYear = cal1.get(Calendar.YEAR)... |
fabric8io/fabric8-maven-plugin | enricher/deprecated/src/main/java/io/fabric8/maven/enricher/deprecated/AbstractLiveEnricher.java | AbstractLiveEnricher.getExternalServiceURL | protected String getExternalServiceURL(String serviceName, String protocol) {
if (!isOnline()) {
getLog().info("Not looking for service " + serviceName + " as we are in offline mode");
return null;
} else {
try {
KubernetesClient kubernetes = getKubern... | java | protected String getExternalServiceURL(String serviceName, String protocol) {
if (!isOnline()) {
getLog().info("Not looking for service " + serviceName + " as we are in offline mode");
return null;
} else {
try {
KubernetesClient kubernetes = getKubern... | [
"protected",
"String",
"getExternalServiceURL",
"(",
"String",
"serviceName",
",",
"String",
"protocol",
")",
"{",
"if",
"(",
"!",
"isOnline",
"(",
")",
")",
"{",
"getLog",
"(",
")",
".",
"info",
"(",
"\"Not looking for service \"",
"+",
"serviceName",
"+",
... | Returns the external access to the given service name
@param serviceName name of the service
@param protocol URL protocol such as <code>http</code> | [
"Returns",
"the",
"external",
"access",
"to",
"the",
"given",
"service",
"name"
] | b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3 | https://github.com/fabric8io/fabric8-maven-plugin/blob/b0e7ad860a5bbe4ab71be3d0613862a1f14a8be3/enricher/deprecated/src/main/java/io/fabric8/maven/enricher/deprecated/AbstractLiveEnricher.java#L76-L113 | test | Get the external service URL. | Of course, here is the Java code you requested:
```java
protected String getExternalServiceURL(String serviceName, String protocol) {
if (!isOnline()) {
getLog().info("Not looking for service " + serviceName + " as we are in offline mode");
return null;
} else {
try ... |
oblac/jodd | jodd-vtor/src/main/java/jodd/vtor/ValidationContext.java | ValidationContext.resolveFor | public static ValidationContext resolveFor(final Class<?> target) {
ValidationContext vc = new ValidationContext();
vc.addClassChecks(target);
return vc;
} | java | public static ValidationContext resolveFor(final Class<?> target) {
ValidationContext vc = new ValidationContext();
vc.addClassChecks(target);
return vc;
} | [
"public",
"static",
"ValidationContext",
"resolveFor",
"(",
"final",
"Class",
"<",
"?",
">",
"target",
")",
"{",
"ValidationContext",
"vc",
"=",
"new",
"ValidationContext",
"(",
")",
";",
"vc",
".",
"addClassChecks",
"(",
"target",
")",
";",
"return",
"vc",
... | Resolve validation context for provided target class.
@see #addClassChecks(Class) | [
"Resolve",
"validation",
"context",
"for",
"provided",
"target",
"class",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-vtor/src/main/java/jodd/vtor/ValidationContext.java#L85-L89 | test | Resolve for validation context. | Of course, here is the Java code you requested:
```java
public static ValidationContext resolveFor(final Class<?> target) {
ValidationContext vc = new ValidationContext();
vc.addClassChecks(target);
return vc;
}
```
Hope this helps! |
js-lib-com/tiny-container | src/main/java/js/servlet/AppServlet.java | AppServlet.sendError | protected static void sendError(RequestContext context, Throwable throwable) throws IOException {
if (throwable instanceof InvocationException && throwable.getCause() != null) {
throwable = throwable.getCause();
}
if (throwable instanceof InvocationTargetException) {
throwable = ((InvocationTargetExcep... | java | protected static void sendError(RequestContext context, Throwable throwable) throws IOException {
if (throwable instanceof InvocationException && throwable.getCause() != null) {
throwable = throwable.getCause();
}
if (throwable instanceof InvocationTargetException) {
throwable = ((InvocationTargetExcep... | [
"protected",
"static",
"void",
"sendError",
"(",
"RequestContext",
"context",
",",
"Throwable",
"throwable",
")",
"throws",
"IOException",
"{",
"if",
"(",
"throwable",
"instanceof",
"InvocationException",
"&&",
"throwable",
".",
"getCause",
"(",
")",
"!=",
"null",... | Send server error response with given exception serialized JSON. This utility method dumps stack trace and request
context to application logger and send back throwable object. Response is encoded JSON and status code is
{@link HttpServletResponse#SC_INTERNAL_SERVER_ERROR}. If given exception argument is {@link Invocat... | [
"Send",
"server",
"error",
"response",
"with",
"given",
"exception",
"serialized",
"JSON",
".",
"This",
"utility",
"method",
"dumps",
"stack",
"trace",
"and",
"request",
"context",
"to",
"application",
"logger",
"and",
"send",
"back",
"throwable",
"object",
".",... | ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e | https://github.com/js-lib-com/tiny-container/blob/ef68deb9ec40b217b4cd2df56d9c5a213dd6b89e/src/main/java/js/servlet/AppServlet.java#L309-L325 | test | Sends an error response to the client. | Of course, here is the Java code you requested:
```java
protected static void sendError(RequestContext context, Throwable throwable) throws IOException {
if (throwable instanceof InvocationException && throwable.getCause() != null) {
throwable = throwable.getCause();
}
if (throwable instanceof InvocationT... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.