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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/Nfa.java | Nfa.pullback | void pullback() throws RegexException {
State s;
State nexts;
Arc a;
Arc nexta;
boolean progress;
/* find and pull until there are no more */
do {
progress = false;
for (s = states; s != null; s = nexts) {
nexts = s.next;
... | java | void pullback() throws RegexException {
State s;
State nexts;
Arc a;
Arc nexta;
boolean progress;
/* find and pull until there are no more */
do {
progress = false;
for (s = states; s != null; s = nexts) {
nexts = s.next;
... | [
"void",
"pullback",
"(",
")",
"throws",
"RegexException",
"{",
"State",
"s",
";",
"State",
"nexts",
";",
"Arc",
"a",
";",
"Arc",
"nexta",
";",
"boolean",
"progress",
";",
"/* find and pull until there are no more */",
"do",
"{",
"progress",
"=",
"false",
";",
... | pullback - pull back constraints backward to (with luck) eliminate them | [
"pullback",
"-",
"pull",
"back",
"constraints",
"backward",
"to",
"(",
"with",
"luck",
")",
"eliminate",
"them"
] | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Nfa.java#L576-L611 | test | Pull back all Arcs from the source. | Of course, here is the Java code you requested:
```java
void pullback() throws RegexException {
State s;
State nexts;
Arc a;
Arc nexta;
boolean progress;
/* find and pull until there are no more */
do {
progress = false;
for (s = states; s !=... |
oblac/jodd | jodd-servlet/src/main/java/jodd/servlet/tag/IteratorTag.java | IteratorTag.iterateArray | protected void iterateArray(final Object[] array, final int from, final int count, final PageContext pageContext) throws JspException {
JspFragment body = getJspBody();
int len = array.length;
int to = calculateTo(from, count, len);
int last = to - 1;
for (int i = from; i < to; i++) {
Object item = array[i... | java | protected void iterateArray(final Object[] array, final int from, final int count, final PageContext pageContext) throws JspException {
JspFragment body = getJspBody();
int len = array.length;
int to = calculateTo(from, count, len);
int last = to - 1;
for (int i = from; i < to; i++) {
Object item = array[i... | [
"protected",
"void",
"iterateArray",
"(",
"final",
"Object",
"[",
"]",
"array",
",",
"final",
"int",
"from",
",",
"final",
"int",
"count",
",",
"final",
"PageContext",
"pageContext",
")",
"throws",
"JspException",
"{",
"JspFragment",
"body",
"=",
"getJspBody",... | Iterates arrays. | [
"Iterates",
"arrays",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-servlet/src/main/java/jodd/servlet/tag/IteratorTag.java#L175-L188 | test | Iterate array. | Of course, here is the Java code you requested:
```java
protected void iterateArray(final Object[] array, final int from, final int count, final PageContext pageContext) throws JspException {
JspFragment body = getJspBody();
int len = array.length;
int to = calculateTo(from, count, len);
int last = to - 1;
f... |
orientechnologies/orientdb | graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java | OGraphSONUtility.vertexFromJson | public Vertex vertexFromJson(final InputStream json) throws IOException {
final JsonParser jp = jsonFactory.createParser(json);
final JsonNode node = jp.readValueAsTree();
return this.vertexFromJson(node);
} | java | public Vertex vertexFromJson(final InputStream json) throws IOException {
final JsonParser jp = jsonFactory.createParser(json);
final JsonNode node = jp.readValueAsTree();
return this.vertexFromJson(node);
} | [
"public",
"Vertex",
"vertexFromJson",
"(",
"final",
"InputStream",
"json",
")",
"throws",
"IOException",
"{",
"final",
"JsonParser",
"jp",
"=",
"jsonFactory",
".",
"createParser",
"(",
"json",
")",
";",
"final",
"JsonNode",
"node",
"=",
"jp",
".",
"readValueAs... | Creates a vertex from GraphSON using settings supplied in the constructor. | [
"Creates",
"a",
"vertex",
"from",
"GraphSON",
"using",
"settings",
"supplied",
"in",
"the",
"constructor",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/graphdb/src/main/java/com/orientechnologies/orient/graph/graphml/OGraphSONUtility.java#L115-L119 | test | Create a Vertex from a JSON document. | Of course, here is the Java code you requested:
```java
public Vertex vertexFromJson(final InputStream json) throws IOException {
final JsonParser jp = jsonFactory.createParser(json);
final JsonNode node = jp.readValueAsTree();
return this.vertexFromJson(node);
}
```
Hope this helps! |
spring-projects/spring-security | oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/userinfo/OidcUserService.java | OidcUserService.setOauth2UserService | public final void setOauth2UserService(OAuth2UserService<OAuth2UserRequest, OAuth2User> oauth2UserService) {
Assert.notNull(oauth2UserService, "oauth2UserService cannot be null");
this.oauth2UserService = oauth2UserService;
} | java | public final void setOauth2UserService(OAuth2UserService<OAuth2UserRequest, OAuth2User> oauth2UserService) {
Assert.notNull(oauth2UserService, "oauth2UserService cannot be null");
this.oauth2UserService = oauth2UserService;
} | [
"public",
"final",
"void",
"setOauth2UserService",
"(",
"OAuth2UserService",
"<",
"OAuth2UserRequest",
",",
"OAuth2User",
">",
"oauth2UserService",
")",
"{",
"Assert",
".",
"notNull",
"(",
"oauth2UserService",
",",
"\"oauth2UserService cannot be null\"",
")",
";",
"this... | Sets the {@link OAuth2UserService} used when requesting the user info resource.
@since 5.1
@param oauth2UserService the {@link OAuth2UserService} used when requesting the user info resource. | [
"Sets",
"the",
"{",
"@link",
"OAuth2UserService",
"}",
"used",
"when",
"requesting",
"the",
"user",
"info",
"resource",
"."
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/oauth2/oauth2-client/src/main/java/org/springframework/security/oauth2/client/oidc/userinfo/OidcUserService.java#L131-L134 | test | Sets the OAuth2UserService. | Of course, here is the Java code you requested:
```java
public final void setOauth2UserService(OAuth2UserService<OAuth2UserRequest, OAuth2User> oauth2UserService) {
Assert.notNull(oauth2UserService, "oauth2UserService cannot be null");
this.oauth2UserService = oauth2UserService;
}
```
Hope this helps! |
apache/parquet-mr | parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java | AvroSchemaConverter.isElementType | private boolean isElementType(Type repeatedType, String parentName) {
return (
// can't be a synthetic layer because it would be invalid
repeatedType.isPrimitive() ||
repeatedType.asGroupType().getFieldCount() > 1 ||
repeatedType.asGroupType().getType(0).isRepetition(REPEATED) ||
... | java | private boolean isElementType(Type repeatedType, String parentName) {
return (
// can't be a synthetic layer because it would be invalid
repeatedType.isPrimitive() ||
repeatedType.asGroupType().getFieldCount() > 1 ||
repeatedType.asGroupType().getType(0).isRepetition(REPEATED) ||
... | [
"private",
"boolean",
"isElementType",
"(",
"Type",
"repeatedType",
",",
"String",
"parentName",
")",
"{",
"return",
"(",
"// can't be a synthetic layer because it would be invalid",
"repeatedType",
".",
"isPrimitive",
"(",
")",
"||",
"repeatedType",
".",
"asGroupType",
... | Implements the rules for interpreting existing data from the logical type
spec for the LIST annotation. This is used to produce the expected schema.
<p>
The AvroArrayConverter will decide whether the repeated type is the array
element type by testing whether the element schema and repeated type are
the same. This ensur... | [
"Implements",
"the",
"rules",
"for",
"interpreting",
"existing",
"data",
"from",
"the",
"logical",
"type",
"spec",
"for",
"the",
"LIST",
"annotation",
".",
"This",
"is",
"used",
"to",
"produce",
"the",
"expected",
"schema",
".",
"<p",
">",
"The",
"AvroArrayC... | 62dcc68acaf64012bf731e103be780956f1f446d | https://github.com/apache/parquet-mr/blob/62dcc68acaf64012bf731e103be780956f1f446d/parquet-avro/src/main/java/org/apache/parquet/avro/AvroSchemaConverter.java#L473-L485 | test | Checks if the type is an element type of a sequence of repeated types. | Of course, here is the Java code you requested:
```java
private boolean isElementType(Type repeatedType, String parentName) {
return (
// can't be a synthetic layer because it would be invalid
repeatedType.isPrimitive() ||
repeatedType.asGroupType().getFieldCount() > 1 ||
repeatedTy... |
lessthanoptimal/GeoRegression | main/src/georegression/metric/ClosestPoint3D_F64.java | ClosestPoint3D_F64.closestPoint | public static Point3D_F64 closestPoint( PlaneNormal3D_F64 plane , Point3D_F64 point , Point3D_F64 found ) {
if( found == null )
found = new Point3D_F64();
double A = plane.n.x;
double B = plane.n.y;
double C = plane.n.z;
double D = plane.n.x*plane.p.x + plane.n.y*plane.p.y + plane.n.z*plane.p.z;
double... | java | public static Point3D_F64 closestPoint( PlaneNormal3D_F64 plane , Point3D_F64 point , Point3D_F64 found ) {
if( found == null )
found = new Point3D_F64();
double A = plane.n.x;
double B = plane.n.y;
double C = plane.n.z;
double D = plane.n.x*plane.p.x + plane.n.y*plane.p.y + plane.n.z*plane.p.z;
double... | [
"public",
"static",
"Point3D_F64",
"closestPoint",
"(",
"PlaneNormal3D_F64",
"plane",
",",
"Point3D_F64",
"point",
",",
"Point3D_F64",
"found",
")",
"{",
"if",
"(",
"found",
"==",
"null",
")",
"found",
"=",
"new",
"Point3D_F64",
"(",
")",
";",
"double",
"A",... | Finds the closest point on the plane to the specified point.
@param plane The plane
@param point The point
@param found (Optional) Storage for the closest point. If null a new point is declared internally.
@return The closest point | [
"Finds",
"the",
"closest",
"point",
"on",
"the",
"plane",
"to",
"the",
"specified",
"point",
"."
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/ClosestPoint3D_F64.java#L174-L192 | test | Returns the closest point to the given plane. | Of course, here is the Java code you requested:
```java
public static Point3D_F64 closestPoint( PlaneNormal3D_F64 plane , Point3D_F64 point , Point3D_F64 found ) {
if( found == null )
found = new Point3D_F64();
double A = plane.n.x;
double B = plane.n.y;
double C = plane.n.z;
double D = plane.n.x*plane.p... |
zalando-stups/fullstop | fullstop-aws-support/fullstop-aws-cloudtrail-support/src/main/java/org/zalando/stups/fullstop/events/CloudTrailEventSupport.java | CloudTrailEventSupport.read | public static List<String> read(final String responseElements, final String pattern) {
return read(responseElements, pattern, false);
} | java | public static List<String> read(final String responseElements, final String pattern) {
return read(responseElements, pattern, false);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"read",
"(",
"final",
"String",
"responseElements",
",",
"final",
"String",
"pattern",
")",
"{",
"return",
"read",
"(",
"responseElements",
",",
"pattern",
",",
"false",
")",
";",
"}"
] | Reads the given 'responseElements' and extracts information based on given 'pattern'.<br/>
If 'responseElements' is null or empty raises {@link IllegalArgumentException}. | [
"Reads",
"the",
"given",
"responseElements",
"and",
"extracts",
"information",
"based",
"on",
"given",
"pattern",
".",
"<br",
"/",
">",
"If",
"responseElements",
"is",
"null",
"or",
"empty",
"raises",
"{"
] | 42f3bab557380aab0114028b58d745e3000897e8 | https://github.com/zalando-stups/fullstop/blob/42f3bab557380aab0114028b58d745e3000897e8/fullstop-aws-support/fullstop-aws-cloudtrail-support/src/main/java/org/zalando/stups/fullstop/events/CloudTrailEventSupport.java#L117-L119 | test | Read a list of words from a CID resource. | Of course, here is the Java code you requested:
```java
public static List<String> read(final String responseElements, final String pattern) {
return read(responseElements, pattern, false);
}
```
Hope this helps! |
Unidata/thredds | tds/src/main/java/thredds/server/wfs/WFSGetCapabilitiesWriter.java | WFSGetCapabilitiesWriter.writeAConstraint | private void writeAConstraint(String name, boolean isImplemented) {
String defValue;
if(isImplemented) defValue = "TRUE"; else defValue = "FALSE";
fileOutput += "<ows:Constraint name=\"" + name + "\"> "
+ "<ows:NoValues/> "
+ "<ows:DefaultValue>" + defValue +"</ows:DefaultValue> "
... | java | private void writeAConstraint(String name, boolean isImplemented) {
String defValue;
if(isImplemented) defValue = "TRUE"; else defValue = "FALSE";
fileOutput += "<ows:Constraint name=\"" + name + "\"> "
+ "<ows:NoValues/> "
+ "<ows:DefaultValue>" + defValue +"</ows:DefaultValue> "
... | [
"private",
"void",
"writeAConstraint",
"(",
"String",
"name",
",",
"boolean",
"isImplemented",
")",
"{",
"String",
"defValue",
";",
"if",
"(",
"isImplemented",
")",
"defValue",
"=",
"\"TRUE\"",
";",
"else",
"defValue",
"=",
"\"FALSE\"",
";",
"fileOutput",
"+="... | Writes a constraint OWS element out.
@param name of the constraint
@boolean isImplemented or not | [
"Writes",
"a",
"constraint",
"OWS",
"element",
"out",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/tds/src/main/java/thredds/server/wfs/WFSGetCapabilitiesWriter.java#L65-L75 | test | Write an AConstraint to the output file. | Of course, here is the Java code you requested:
```java
private void writeAConstraint(String name, boolean isImplemented) {
String defValue;
if(isImplemented) defValue = "TRUE"; else defValue = "FALSE";
fileOutput += "<ows:Constraint name=\"" + name + "\"> "
+ "<ows:NoValues/> "
+ "<ows:... |
flow/noise | src/main/java/com/flowpowered/noise/model/Line.java | Line.setStartPoint | public void setStartPoint(double x, double y, double z) {
this.x0 = x;
this.y0 = y;
this.z0 = z;
} | java | public void setStartPoint(double x, double y, double z) {
this.x0 = x;
this.y0 = y;
this.z0 = z;
} | [
"public",
"void",
"setStartPoint",
"(",
"double",
"x",
",",
"double",
"y",
",",
"double",
"z",
")",
"{",
"this",
".",
"x0",
"=",
"x",
";",
"this",
".",
"y0",
"=",
"y",
";",
"this",
".",
"z0",
"=",
"z",
";",
"}"
] | Sets the position ( @a x, @a y, @a z ) of the start of the line segment to choose values along.
@param x x coordinate of the start position.
@param y y coordinate of the start position.
@param z z coordinate of the start position. | [
"Sets",
"the",
"position",
"(",
"@a",
"x",
"@a",
"y",
"@a",
"z",
")",
"of",
"the",
"start",
"of",
"the",
"line",
"segment",
"to",
"choose",
"values",
"along",
"."
] | fe880dbbb09731ade59d9b4c0da6720b70f17509 | https://github.com/flow/noise/blob/fe880dbbb09731ade59d9b4c0da6720b70f17509/src/main/java/com/flowpowered/noise/model/Line.java#L96-L100 | test | Sets the start point of the page. | Of course, here is the Java code you requested:
```java
public void setStartPoint(double x, double y, double z) {
this.x0 = x;
this.y0 = y;
this.z0 = z;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/units/DateRange.java | DateRange.chooseResolution | private String chooseResolution(double time) {
if (time < 180) // 3 minutes
return "secs";
time /= 60; // minutes
if (time < 180) // 3 hours
return "minutes";
time /= 60; // hours
if (time < 72) // 3 days
return "hours";
time /= 24; // days
if (time < 90) // 3 months
... | java | private String chooseResolution(double time) {
if (time < 180) // 3 minutes
return "secs";
time /= 60; // minutes
if (time < 180) // 3 hours
return "minutes";
time /= 60; // hours
if (time < 72) // 3 days
return "hours";
time /= 24; // days
if (time < 90) // 3 months
... | [
"private",
"String",
"chooseResolution",
"(",
"double",
"time",
")",
"{",
"if",
"(",
"time",
"<",
"180",
")",
"// 3 minutes",
"return",
"\"secs\"",
";",
"time",
"/=",
"60",
";",
"// minutes",
"if",
"(",
"time",
"<",
"180",
")",
"// 3 hours",
"return",
"\... | choose a resolution based on # seconds | [
"choose",
"a",
"resolution",
"based",
"on",
"#",
"seconds"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/units/DateRange.java#L133-L149 | test | Choose resolution for a given time | Of course, here is the Java code you requested:
```java
private String chooseResolution(double time) {
if (time < 180) // 3 minutes
return "secs";
time /= 60; // minutes
if (time < 180) // 3 hours
return "minutes";
time /= 60; // hours
if (time < 72) // 3 days
return "hours";
... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java | RouteFieldClient.updateFieldMultiChoicePlain | public Field updateFieldMultiChoicePlain(
Field routeFieldParam,
List<String> multiChoiceValuesParam
) {
if(routeFieldParam != null && this.serviceTicket != null) {
routeFieldParam.setServiceTicket(this.serviceTicket);
}
if(multiChoiceValuesParam == null ||
multiChoiceValuesParam.isEmpty()) {
th... | java | public Field updateFieldMultiChoicePlain(
Field routeFieldParam,
List<String> multiChoiceValuesParam
) {
if(routeFieldParam != null && this.serviceTicket != null) {
routeFieldParam.setServiceTicket(this.serviceTicket);
}
if(multiChoiceValuesParam == null ||
multiChoiceValuesParam.isEmpty()) {
th... | [
"public",
"Field",
"updateFieldMultiChoicePlain",
"(",
"Field",
"routeFieldParam",
",",
"List",
"<",
"String",
">",
"multiChoiceValuesParam",
")",
"{",
"if",
"(",
"routeFieldParam",
"!=",
"null",
"&&",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"route... | Update an existing Multi Choice field.
@param routeFieldParam Field to Update.
@param multiChoiceValuesParam New available Multi-choices.
@return Updated Field. | [
"Update",
"an",
"existing",
"Multi",
"Choice",
"field",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/RouteFieldClient.java#L347-L370 | test | Update a Field in the Fluid Server with a MultiChoice plain form. | Of course, here is the Java code you requested:
```java
public Field updateFieldMultiChoicePlain(
Field routeFieldParam,
List<String> multiChoiceValuesParam
) {
if(routeFieldParam != null && this.serviceTicket != null) {
routeFieldParam.setServiceTicket(this.serviceTicket);
}
if(multiChoiceValuesParam... |
amlinv/stat-collection-utils | src/main/java/com/amlinv/jmxutil/polling/JmxAttributePoller.java | JmxAttributePoller.poll | public void poll() throws IOException {
synchronized (this) {
// Make sure not to check and create a connection if shutting down.
if (shutdownInd) {
return;
}
// Atomically indicate polling is active now so a caller can determine with certainty wh... | java | public void poll() throws IOException {
synchronized (this) {
// Make sure not to check and create a connection if shutting down.
if (shutdownInd) {
return;
}
// Atomically indicate polling is active now so a caller can determine with certainty wh... | [
"public",
"void",
"poll",
"(",
")",
"throws",
"IOException",
"{",
"synchronized",
"(",
"this",
")",
"{",
"// Make sure not to check and create a connection if shutting down.",
"if",
"(",
"shutdownInd",
")",
"{",
"return",
";",
"}",
"// Atomically indicate polling is activ... | Poll the configured objects now and store the results in the objects themselves.
@throws IOException | [
"Poll",
"the",
"configured",
"objects",
"now",
"and",
"store",
"the",
"results",
"in",
"the",
"objects",
"themselves",
"."
] | 44da9965afbd2e92ce17ce2271d3bf21f69e2e97 | https://github.com/amlinv/stat-collection-utils/blob/44da9965afbd2e92ce17ce2271d3bf21f69e2e97/src/main/java/com/amlinv/jmxutil/polling/JmxAttributePoller.java#L136-L172 | test | Poll for the MBean. | Of course, here is the Java code you requested:
```java
public void poll() throws IOException {
synchronized (this) {
// Make sure not to check and create a connection if shutting down.
if (shutdownInd) {
return;
}
// Atomically indicate polling ... |
boonproject/boon | slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/mysql/MySQLDataStore.java | MySQLDataStore.flushWritesIfNeeded | protected void flushWritesIfNeeded() throws InterruptedException {
long now = timer.time();
/* Every 30 seconds flush the write queue. */
if (now - lastWriteFlushTime > dataStoreConfig.dbWriteFlushQueueIntervalMS()) {
if (outputMap.size() > 0) {
if (!writeQueue.o... | java | protected void flushWritesIfNeeded() throws InterruptedException {
long now = timer.time();
/* Every 30 seconds flush the write queue. */
if (now - lastWriteFlushTime > dataStoreConfig.dbWriteFlushQueueIntervalMS()) {
if (outputMap.size() > 0) {
if (!writeQueue.o... | [
"protected",
"void",
"flushWritesIfNeeded",
"(",
")",
"throws",
"InterruptedException",
"{",
"long",
"now",
"=",
"timer",
".",
"time",
"(",
")",
";",
"/* Every 30 seconds flush the write queue. */",
"if",
"(",
"now",
"-",
"lastWriteFlushTime",
">",
"dataStoreConfig",... | Will flush to secondary storage if needed. This is used mostly by REMOTE_DB at the moment. | [
"Will",
"flush",
"to",
"secondary",
"storage",
"if",
"needed",
".",
"This",
"is",
"used",
"mostly",
"by",
"REMOTE_DB",
"at",
"the",
"moment",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/slumberdb/slumberdb-service-model/src/main/java/org/boon/slumberdb/stores/mysql/MySQLDataStore.java#L138-L172 | test | Flush writes if necessary. | Of course, here is the Java code you requested:
```java
protected void flushWritesIfNeeded() throws InterruptedException {
long now = timer.time();
/* Every 30 seconds flush the write queue. */
if (now - lastWriteFlushTime > dataStoreConfig.dbWriteFlushQueueIntervalMS()) {
if (o... |
streamsets/datacollector | azure-lib/src/main/java/com/streamsets/pipeline/stage/destination/datalake/writer/DataLakeGeneratorManager.java | DataLakeGeneratorManager.getFilePath | public String getFilePath(
String dirPathTemplate,
Record record,
Date recordTime
) throws StageException {
String dirPath;
// get directory path
if (dirPathTemplateInHeader) {
dirPath = record.getHeader().getAttribute(DataLakeTarget.TARGET_DIRECTORY_HEADER);
Utils.checkArgum... | java | public String getFilePath(
String dirPathTemplate,
Record record,
Date recordTime
) throws StageException {
String dirPath;
// get directory path
if (dirPathTemplateInHeader) {
dirPath = record.getHeader().getAttribute(DataLakeTarget.TARGET_DIRECTORY_HEADER);
Utils.checkArgum... | [
"public",
"String",
"getFilePath",
"(",
"String",
"dirPathTemplate",
",",
"Record",
"record",
",",
"Date",
"recordTime",
")",
"throws",
"StageException",
"{",
"String",
"dirPath",
";",
"// get directory path",
"if",
"(",
"dirPathTemplateInHeader",
")",
"{",
"dirPath... | Returns the temp file path to write records to
@param dirPathTemplate Directory Template
@param record Record for which file path is calculated
@param recordTime Record time
@return Temporary File Path to write records to
@throws StageException | [
"Returns",
"the",
"temp",
"file",
"path",
"to",
"write",
"records",
"to"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/azure-lib/src/main/java/com/streamsets/pipeline/stage/destination/datalake/writer/DataLakeGeneratorManager.java#L139-L160 | test | Get the file path for a single segment. | Of course, here is the Java code you requested:
```java
public String getFilePath(
String dirPathTemplate,
Record record,
Date recordTime
) throws StageException {
String dirPath;
// get directory path
if (dirPathTemplateInHeader) {
dirPath = record.getHeader().getAttribute(DataLa... |
spring-projects/spring-security | web/src/main/java/org/springframework/security/web/authentication/SimpleUrlAuthenticationFailureHandler.java | SimpleUrlAuthenticationFailureHandler.onAuthenticationFailure | public void onAuthenticationFailure(HttpServletRequest request,
HttpServletResponse response, AuthenticationException exception)
throws IOException, ServletException {
if (defaultFailureUrl == null) {
logger.debug("No failure URL set, sending 401 Unauthorized error");
response.sendError(HttpStatus.UNAUT... | java | public void onAuthenticationFailure(HttpServletRequest request,
HttpServletResponse response, AuthenticationException exception)
throws IOException, ServletException {
if (defaultFailureUrl == null) {
logger.debug("No failure URL set, sending 401 Unauthorized error");
response.sendError(HttpStatus.UNAUT... | [
"public",
"void",
"onAuthenticationFailure",
"(",
"HttpServletRequest",
"request",
",",
"HttpServletResponse",
"response",
",",
"AuthenticationException",
"exception",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"if",
"(",
"defaultFailureUrl",
"==",
"null"... | Performs the redirect or forward to the {@code defaultFailureUrl} if set, otherwise
returns a 401 error code.
<p>
If redirecting or forwarding, {@code saveException} will be called to cache the
exception for use in the target view. | [
"Performs",
"the",
"redirect",
"or",
"forward",
"to",
"the",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/web/src/main/java/org/springframework/security/web/authentication/SimpleUrlAuthenticationFailureHandler.java#L71-L95 | test | Called when authentication failure occurs. | Of course, here is the Java code you requested:
```java
public void onAuthenticationFailure(HttpServletRequest request,
HttpServletResponse response, AuthenticationException exception)
throws IOException, ServletException {
if (defaultFailureUrl == null) {
logger.debug("No failure URL set, sending 401 Unau... |
ReactiveX/RxJava | src/main/java/io/reactivex/Single.java | Single.defer | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<T> defer(final Callable<? extends SingleSource<? extends T>> singleSupplier) {
ObjectHelper.requireNonNull(singleSupplier, "singleSupplier is null");
return RxJavaPlugins.onAssembly(new SingleDefer<T... | java | @CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<T> defer(final Callable<? extends SingleSource<? extends T>> singleSupplier) {
ObjectHelper.requireNonNull(singleSupplier, "singleSupplier is null");
return RxJavaPlugins.onAssembly(new SingleDefer<T... | [
"@",
"CheckReturnValue",
"@",
"NonNull",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"static",
"<",
"T",
">",
"Single",
"<",
"T",
">",
"defer",
"(",
"final",
"Callable",
"<",
"?",
"extends",
"SingleSource",
"<",
"?",
"exte... | Calls a {@link Callable} for each individual {@link SingleObserver} to return the actual {@link SingleSource} to
be subscribed to.
<p>
<img width="640" height="515" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/Single.defer.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code defer} does not ... | [
"Calls",
"a",
"{"
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Single.java#L536-L542 | test | Defer to a single source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@NonNull
@SchedulerSupport(SchedulerSupport.NONE)
public static <T> Single<T> defer(final Callable<? extends SingleSource<? extends T>> singleSupplier) {
ObjectHelper.requireNonNull(singleSupplier, "singleSupplier is null");
... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/util/DirectedGraph.java | DirectedGraph.addDirectedEdge | public void addDirectedEdge(V vertex1, V vertex2) {
addVertex(vertex1);
addVertex(vertex2);
outwardEdgeVertices.put(vertex1, vertex2);
inwardEdgesVertices.put(vertex2, vertex1);
} | java | public void addDirectedEdge(V vertex1, V vertex2) {
addVertex(vertex1);
addVertex(vertex2);
outwardEdgeVertices.put(vertex1, vertex2);
inwardEdgesVertices.put(vertex2, vertex1);
} | [
"public",
"void",
"addDirectedEdge",
"(",
"V",
"vertex1",
",",
"V",
"vertex2",
")",
"{",
"addVertex",
"(",
"vertex1",
")",
";",
"addVertex",
"(",
"vertex2",
")",
";",
"outwardEdgeVertices",
".",
"put",
"(",
"vertex1",
",",
"vertex2",
")",
";",
"inwardEdges... | Add a directed edge from vertex1 to vertex2 adding those vertices graph (if needed)
@param vertex1 vertex1
@param vertex2 vertex2 | [
"Add",
"a",
"directed",
"edge",
"from",
"vertex1",
"to",
"vertex2",
"adding",
"those",
"vertices",
"graph",
"(",
"if",
"needed",
")"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/util/DirectedGraph.java#L84-L89 | test | Adds two directed edges. | Of course, here is the Java code you requested:
```java
public void addDirectedEdge(V vertex1, V vertex2) {
addVertex(vertex1);
addVertex(vertex2);
outwardEdgeVertices.put(vertex1, vertex2);
inwardEdgesVertices.put(vertex2, vertex1);
}
```
Hope this helps! |
Unidata/thredds | dap4/d4core/src/main/java/dap4/core/util/DapUtil.java | DapUtil.getProtocols | static public List<String>
getProtocols(String url, int[] breakpoint)
{
// break off any leading protocols;
// there may be more than one.
// Watch out for Windows paths starting with a drive letter.
// Each protocol has trailing ':' removed
List<String> allprotocols = ... | java | static public List<String>
getProtocols(String url, int[] breakpoint)
{
// break off any leading protocols;
// there may be more than one.
// Watch out for Windows paths starting with a drive letter.
// Each protocol has trailing ':' removed
List<String> allprotocols = ... | [
"static",
"public",
"List",
"<",
"String",
">",
"getProtocols",
"(",
"String",
"url",
",",
"int",
"[",
"]",
"breakpoint",
")",
"{",
"// break off any leading protocols;",
"// there may be more than one.",
"// Watch out for Windows paths starting with a drive letter.",
"// Eac... | Return the set of leading protocols for a url; may be more than one.
@param url the url whose protocols to return
@param breakpoint return the index past last protocol
@return list of leading protocols without the trailing : | [
"Return",
"the",
"set",
"of",
"leading",
"protocols",
"for",
"a",
"url",
";",
"may",
"be",
"more",
"than",
"one",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4core/src/main/java/dap4/core/util/DapUtil.java#L544-L573 | test | Get protocol list from url. | Of course, here is the Java code you requested:
```java
static public List<String>
getProtocols(String url, int[] breakpoint)
{
// break off any leading protocols;
// there may be more than one.
// Watch out for Windows paths starting with a drive letter.
// Each protocol has tr... |
ombre42/jrobotremoteserver | src/main/java/org/robotframework/remoteserver/RemoteServer.java | RemoteServer.stop | public void stop(int timeoutMS) throws Exception {
log.info("Robot Framework remote server stopping");
if (timeoutMS > 0) {
server.setGracefulShutdown(timeoutMS);
Thread stopper = new Thread() {
@Override
public void run() {
try... | java | public void stop(int timeoutMS) throws Exception {
log.info("Robot Framework remote server stopping");
if (timeoutMS > 0) {
server.setGracefulShutdown(timeoutMS);
Thread stopper = new Thread() {
@Override
public void run() {
try... | [
"public",
"void",
"stop",
"(",
"int",
"timeoutMS",
")",
"throws",
"Exception",
"{",
"log",
".",
"info",
"(",
"\"Robot Framework remote server stopping\"",
")",
";",
"if",
"(",
"timeoutMS",
">",
"0",
")",
"{",
"server",
".",
"setGracefulShutdown",
"(",
"timeout... | A non-blocking method for stopping the remote server that allows requests
to complete within the given timeout before shutting down the server. New
connections will not be accepted after calling this.
@param timeoutMS
the milliseconds to wait for existing request to complete
before stopping the server | [
"A",
"non",
"-",
"blocking",
"method",
"for",
"stopping",
"the",
"remote",
"server",
"that",
"allows",
"requests",
"to",
"complete",
"within",
"the",
"given",
"timeout",
"before",
"shutting",
"down",
"the",
"server",
".",
"New",
"connections",
"will",
"not",
... | 688ab33a6bd04951d9dee7f5ec23c6f1cc709c10 | https://github.com/ombre42/jrobotremoteserver/blob/688ab33a6bd04951d9dee7f5ec23c6f1cc709c10/src/main/java/org/robotframework/remoteserver/RemoteServer.java#L275-L293 | test | Stop the robot Framework remote server. | Of course, here is the Java code you requested:
```java
public void stop(int timeoutMS) throws Exception {
log.info("Robot Framework remote server stopping");
if (timeoutMS > 0) {
server.setGracefulShutdown(timeoutMS);
Thread stopper = new Thread() {
@Override
... |
oblac/jodd | jodd-petite/src/main/java/jodd/petite/resolver/ReferencesResolver.java | ReferencesResolver.convertAnnValueToReferences | private BeanReferences[] convertAnnValueToReferences(String value) {
if (value == null) {
return null;
}
value = value.trim();
if (value.length() == 0) {
return null;
}
String[] refNames = Converter.get().toStringArray(value);
BeanReferences[] references = new BeanReferences[refNames.length];
f... | java | private BeanReferences[] convertAnnValueToReferences(String value) {
if (value == null) {
return null;
}
value = value.trim();
if (value.length() == 0) {
return null;
}
String[] refNames = Converter.get().toStringArray(value);
BeanReferences[] references = new BeanReferences[refNames.length];
f... | [
"private",
"BeanReferences",
"[",
"]",
"convertAnnValueToReferences",
"(",
"String",
"value",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"value",
"=",
"value",
".",
"trim",
"(",
")",
";",
"if",
"(",
"value",
".",
... | Converts comma-separated string into array of Bean references. | [
"Converts",
"comma",
"-",
"separated",
"string",
"into",
"array",
"of",
"Bean",
"references",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-petite/src/main/java/jodd/petite/resolver/ReferencesResolver.java#L355-L372 | test | Convert an annotation value to a list of BeanReferences. | Of course, here is the Java code you requested:
```java
private BeanReferences[] convertAnnValueToReferences(String value) {
if (value == null) {
return null;
}
value = value.trim();
if (value.length() == 0) {
return null;
}
String[] refNames = Converter.get().toStringArray(value);
BeanReference... |
artclarke/humble-video | humble-video-noarch/src/main/java/io/humble/ferry/JNIThreadProxy.java | JNIThreadProxy.interrupt | @Override
public void interrupt()
{
final Thread thread = mThreads.get().mThread;
log.trace("interrupt (thread {})", thread);
thread.interrupt();
return;
} | java | @Override
public void interrupt()
{
final Thread thread = mThreads.get().mThread;
log.trace("interrupt (thread {})", thread);
thread.interrupt();
return;
} | [
"@",
"Override",
"public",
"void",
"interrupt",
"(",
")",
"{",
"final",
"Thread",
"thread",
"=",
"mThreads",
".",
"get",
"(",
")",
".",
"mThread",
";",
"log",
".",
"trace",
"(",
"\"interrupt (thread {})\"",
",",
"thread",
")",
";",
"thread",
".",
"interr... | {@inheritDoc} | [
"{"
] | aa349ae2d7ef74160b7074feac8d298cf90394d1 | https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/ferry/JNIThreadProxy.java#L148-L155 | test | Interrupt the sequence. | Of course, here is the Java code you requested:
```java
@Override
public void interrupt()
{
final Thread thread = mThreads.get().mThread;
log.trace("interrupt (thread {})", thread);
thread.interrupt();
return;
}
```
Hope this helps! |
Netflix/hollow | hollow/src/main/java/com/netflix/hollow/tools/diff/HollowDiff.java | HollowDiff.addTypeDiff | public HollowTypeDiff addTypeDiff(String type, String... primaryKeyPaths) {
HollowTypeDiff typeDiff = new HollowTypeDiff(this, type, primaryKeyPaths);
if(typeDiff.hasAnyData())
typeDiffs.put(type, typeDiff);
return typeDiff;
} | java | public HollowTypeDiff addTypeDiff(String type, String... primaryKeyPaths) {
HollowTypeDiff typeDiff = new HollowTypeDiff(this, type, primaryKeyPaths);
if(typeDiff.hasAnyData())
typeDiffs.put(type, typeDiff);
return typeDiff;
} | [
"public",
"HollowTypeDiff",
"addTypeDiff",
"(",
"String",
"type",
",",
"String",
"...",
"primaryKeyPaths",
")",
"{",
"HollowTypeDiff",
"typeDiff",
"=",
"new",
"HollowTypeDiff",
"(",
"this",
",",
"type",
",",
"primaryKeyPaths",
")",
";",
"if",
"(",
"typeDiff",
... | Add a type to be included in the diff report
@param type the type name
@param primaryKeyPaths the path(s) to the field(s) which comprise the type's primary key
@return the diff type | [
"Add",
"a",
"type",
"to",
"be",
"included",
"in",
"the",
"diff",
"report"
] | 43ca100034a01050fb764170bd32b085ac9a3c22 | https://github.com/Netflix/hollow/blob/43ca100034a01050fb764170bd32b085ac9a3c22/hollow/src/main/java/com/netflix/hollow/tools/diff/HollowDiff.java#L102-L107 | test | Add a type diff to this class. | Of course, here is the Java code you requested:
```java
public HollowTypeDiff addTypeDiff(String type, String... primaryKeyPaths) {
HollowTypeDiff typeDiff = new HollowTypeDiff(this, type, primaryKeyPaths);
if(typeDiff.hasAnyData())
typeDiffs.put(type, typeDiff);
return typeDiff;
... |
lessthanoptimal/GeoRegression | main/src/georegression/metric/Distance3D_F64.java | Distance3D_F64.distance | public static double distance( Triangle3D_F64 triangle, Point3D_F64 point ) {
DistancePointTriangle3D_F64 alg = new DistancePointTriangle3D_F64();
alg.setTriangle(triangle.v0,triangle.v1,triangle.v2);
Point3D_F64 cp = new Point3D_F64();
alg.closestPoint(point,cp);
double d = point.distance(cp);
return ... | java | public static double distance( Triangle3D_F64 triangle, Point3D_F64 point ) {
DistancePointTriangle3D_F64 alg = new DistancePointTriangle3D_F64();
alg.setTriangle(triangle.v0,triangle.v1,triangle.v2);
Point3D_F64 cp = new Point3D_F64();
alg.closestPoint(point,cp);
double d = point.distance(cp);
return ... | [
"public",
"static",
"double",
"distance",
"(",
"Triangle3D_F64",
"triangle",
",",
"Point3D_F64",
"point",
")",
"{",
"DistancePointTriangle3D_F64",
"alg",
"=",
"new",
"DistancePointTriangle3D_F64",
"(",
")",
";",
"alg",
".",
"setTriangle",
"(",
"triangle",
".",
"v0... | Signed distance from a 3D point to 3D triangle. The sign indicates which side of the triangle the point
is on. See {@link georegression.metric.alg.DistancePointTriangle3D_F64} for the details.
@param triangle 3D triangle
@param point Point for which the closest point on the triangle is found
@return The closest poi... | [
"Signed",
"distance",
"from",
"a",
"3D",
"point",
"to",
"3D",
"triangle",
".",
"The",
"sign",
"indicates",
"which",
"side",
"of",
"the",
"triangle",
"the",
"point",
"is",
"on",
".",
"See",
"{",
"@link",
"georegression",
".",
"metric",
".",
"alg",
".",
... | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/metric/Distance3D_F64.java#L203-L215 | test | Computes the distance between two points in the triangle and the point. | Of course, here is the Java code you requested:
```java
public static double distance( Triangle3D_F64 triangle, Point3D_F64 point ) {
DistancePointTriangle3D_F64 alg = new DistancePointTriangle3D_F64();
alg.setTriangle(triangle.v0,triangle.v1,triangle.v2);
Point3D_F64 cp = new Point3D_F64();
alg.closestPoin... |
wildfly/wildfly | ee/src/main/java/org/jboss/as/ee/subsystem/EeExtension.java | EeExtension.initialize | @Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
// Register the root subsystem resource.
final ManagementResourceRegistration rootResource = subsystem.registerSubsystemMode... | java | @Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
// Register the root subsystem resource.
final ManagementResourceRegistration rootResource = subsystem.registerSubsystemMode... | [
"@",
"Override",
"public",
"void",
"initialize",
"(",
"ExtensionContext",
"context",
")",
"{",
"final",
"SubsystemRegistration",
"subsystem",
"=",
"context",
".",
"registerSubsystem",
"(",
"SUBSYSTEM_NAME",
",",
"CURRENT_MODEL_VERSION",
")",
";",
"// Register the root s... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/subsystem/EeExtension.java#L60-L79 | test | Initialize the resource manager for the AIC | Of course, here is the Java code you requested:
```java
@Override
public void initialize(ExtensionContext context) {
final SubsystemRegistration subsystem = context.registerSubsystem(SUBSYSTEM_NAME, CURRENT_MODEL_VERSION);
// Register the root subsystem resource.
final ManagementResourceRe... |
buschmais/jqa-commandline-tool | application/src/main/java/com/buschmais/jqassistant/commandline/Main.java | Main.printUsage | private void printUsage(final Options options, final String errorMessage) {
if(errorMessage != null) {
System.out.println("Error: " + errorMessage);
}
final HelpFormatter formatter = new HelpFormatter();
formatter.printHelp(Main.class.getCanonicalName() + " <task> [options]",... | java | private void printUsage(final Options options, final String errorMessage) {
if(errorMessage != null) {
System.out.println("Error: " + errorMessage);
}
final HelpFormatter formatter = new HelpFormatter();
formatter.printHelp(Main.class.getCanonicalName() + " <task> [options]",... | [
"private",
"void",
"printUsage",
"(",
"final",
"Options",
"options",
",",
"final",
"String",
"errorMessage",
")",
"{",
"if",
"(",
"errorMessage",
"!=",
"null",
")",
"{",
"System",
".",
"out",
".",
"println",
"(",
"\"Error: \"",
"+",
"errorMessage",
")",
";... | Print usage information.
@param options
The known options.
@param errorMessage
The error message to append. | [
"Print",
"usage",
"information",
"."
] | c24de584ef4414fca673a75c16f4a533a188481f | https://github.com/buschmais/jqa-commandline-tool/blob/c24de584ef4414fca673a75c16f4a533a188481f/application/src/main/java/com/buschmais/jqassistant/commandline/Main.java#L309-L317 | test | Prints usage message. | Of course, here is the Java code you requested:
```java
private void printUsage(final Options options, final String errorMessage) {
if(errorMessage != null) {
System.out.println("Error: " + errorMessage);
}
final HelpFormatter formatter = new HelpFormatter();
formatter.print... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/rpc/RpcTaskScanner.java | RpcTaskScanner.start | public void start() {
scheduledService.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
for (Scannable scanned : scanList) {
try {
scanned.scan();
} catch (Throwable t) {
... | java | public void start() {
scheduledService.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
for (Scannable scanned : scanList) {
try {
scanned.scan();
} catch (Throwable t) {
... | [
"public",
"void",
"start",
"(",
")",
"{",
"scheduledService",
".",
"scheduleWithFixedDelay",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"for",
"(",
"Scannable",
"scanned",
":",
"scanList",
")",
"{",
"t... | Start! | [
"Start!"
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcTaskScanner.java#L49-L64 | test | Start the service. | Of course, here is the Java code you requested:
```java
public void start() {
scheduledService.scheduleWithFixedDelay(new Runnable() {
@Override
public void run() {
for (Scannable scanned : scanList) {
try {
scanned.scan();
... |
wro4j/wro4j | wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/support/AggregatedFolderPathResolver.java | AggregatedFolderPathResolver.resolve | public String resolve() {
notNull(buildDirectory, "Build directory cannot be null!");
notNull(log, "Logger cannot be null!");
String result = null;
final File cssTargetFolder = cssDestinationFolder == null ? destinationFolder : cssDestinationFolder;
File rootFolder = null;
notNull(cssTargetFolde... | java | public String resolve() {
notNull(buildDirectory, "Build directory cannot be null!");
notNull(log, "Logger cannot be null!");
String result = null;
final File cssTargetFolder = cssDestinationFolder == null ? destinationFolder : cssDestinationFolder;
File rootFolder = null;
notNull(cssTargetFolde... | [
"public",
"String",
"resolve",
"(",
")",
"{",
"notNull",
"(",
"buildDirectory",
",",
"\"Build directory cannot be null!\"",
")",
";",
"notNull",
"(",
"log",
",",
"\"Logger cannot be null!\"",
")",
";",
"String",
"result",
"=",
"null",
";",
"final",
"File",
"cssT... | The idea is to compute the aggregatedFolderPath based on a root folder. The root folder is determined by comparing
the cssTargetFolder (the folder where aggregated css files are located) with build directory or contextFolder. If
rootFolder is null, then the result is also null (equivalent to using the cssTargetFolder t... | [
"The",
"idea",
"is",
"to",
"compute",
"the",
"aggregatedFolderPath",
"based",
"on",
"a",
"root",
"folder",
".",
"The",
"root",
"folder",
"is",
"determined",
"by",
"comparing",
"the",
"cssTargetFolder",
"(",
"the",
"folder",
"where",
"aggregated",
"css",
"files... | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-maven-plugin/src/main/java/ro/isdc/wro/maven/plugin/support/AggregatedFolderPathResolver.java#L37-L67 | test | Resolves the target path to the output path. | Of course, here is the Java code you requested:
```java
public String resolve() {
notNull(buildDirectory, "Build directory cannot be null!");
notNull(log, "Logger cannot be null!");
String result = null;
final File cssTargetFolder = cssDestinationFolder == null ? destinationFolder : cssDestinationFolde... |
awslabs/aws-hal-client-java | src/main/java/com/amazonaws/hal/client/HalJsonArrayUnmarshaller.java | HalJsonArrayUnmarshaller.unmarshall | @Override
public List<T> unmarshall(JsonUnmarshallerContext context)
throws Exception {
List<T> list = new ArrayList<>();
JsonToken token = context.getCurrentToken();
while (token != null && token != END_ARRAY) {
if (token == JsonToken.START_OBJECT) {
... | java | @Override
public List<T> unmarshall(JsonUnmarshallerContext context)
throws Exception {
List<T> list = new ArrayList<>();
JsonToken token = context.getCurrentToken();
while (token != null && token != END_ARRAY) {
if (token == JsonToken.START_OBJECT) {
... | [
"@",
"Override",
"public",
"List",
"<",
"T",
">",
"unmarshall",
"(",
"JsonUnmarshallerContext",
"context",
")",
"throws",
"Exception",
"{",
"List",
"<",
"T",
">",
"list",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"JsonToken",
"token",
"=",
"context",
... | ------------------------------------------------------------- | [
"-------------------------------------------------------------"
] | bbbb67326f6f1ff6e583d6fa95a7768a0c60b62b | https://github.com/awslabs/aws-hal-client-java/blob/bbbb67326f6f1ff6e583d6fa95a7768a0c60b62b/src/main/java/com/amazonaws/hal/client/HalJsonArrayUnmarshaller.java#L53-L68 | test | Unmarshall a list of Crazilian Australia. | Of course, here is the Java code you requested:
```java
@Override
public List<T> unmarshall(JsonUnmarshallerContext context)
throws Exception {
List<T> list = new ArrayList<>();
JsonToken token = context.getCurrentToken();
while (token != null && token != END_ARRAY) {
... |
wro4j/wro4j | wro4j-core/src/main/java/ro/isdc/wro/util/Transformers.java | Transformers.baseNameSuffixTransformer | public static Transformer<String> baseNameSuffixTransformer(final String suffix) {
return new Transformer<String>() {
public String transform(final String input) {
final String baseName = FilenameUtils.getBaseName(input);
final String extension = FilenameUtils.getExtension(input);
... | java | public static Transformer<String> baseNameSuffixTransformer(final String suffix) {
return new Transformer<String>() {
public String transform(final String input) {
final String baseName = FilenameUtils.getBaseName(input);
final String extension = FilenameUtils.getExtension(input);
... | [
"public",
"static",
"Transformer",
"<",
"String",
">",
"baseNameSuffixTransformer",
"(",
"final",
"String",
"suffix",
")",
"{",
"return",
"new",
"Transformer",
"<",
"String",
">",
"(",
")",
"{",
"public",
"String",
"transform",
"(",
"final",
"String",
"input",... | Appends a suffix to the source baseName.
@param suffix to append.
@return {@link Transformer} capable to append a suffix to provided baseName. | [
"Appends",
"a",
"suffix",
"to",
"the",
"source",
"baseName",
"."
] | d2a3de71ab8bf0af7061fb6327501e08198338df | https://github.com/wro4j/wro4j/blob/d2a3de71ab8bf0af7061fb6327501e08198338df/wro4j-core/src/main/java/ro/isdc/wro/util/Transformers.java#L33-L41 | test | Transformer that converts a base name suffix to a base name suffix. | Of course, here is the Java code you requested:
```java
public static Transformer<String> baseNameSuffixTransformer(final String suffix) {
return new Transformer<String>() {
public String transform(final String input) {
final String baseName = FilenameUtils.getBaseName(input);
final Strin... |
rupertlssmith/lojix | base/common/src/main/com/thesett/common/properties/ParsedProperties.java | ParsedProperties.setSysPropertyIfNull | public static long setSysPropertyIfNull(String propname, long value)
{
return Long.parseLong(setSysPropertyIfNull(propname, Long.toString(value)));
} | java | public static long setSysPropertyIfNull(String propname, long value)
{
return Long.parseLong(setSysPropertyIfNull(propname, Long.toString(value)));
} | [
"public",
"static",
"long",
"setSysPropertyIfNull",
"(",
"String",
"propname",
",",
"long",
"value",
")",
"{",
"return",
"Long",
".",
"parseLong",
"(",
"setSysPropertyIfNull",
"(",
"propname",
",",
"Long",
".",
"toString",
"(",
"value",
")",
")",
")",
";",
... | Helper method for setting system properties to defaults when they are not already set.
@param propname The name of the system property to set.
@param value The value to set it to.
@return The value of the property after this method call. | [
"Helper",
"method",
"for",
"setting",
"system",
"properties",
"to",
"defaults",
"when",
"they",
"are",
"not",
"already",
"set",
"."
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/base/common/src/main/com/thesett/common/properties/ParsedProperties.java#L99-L102 | test | Set a system property of a CRAsCTYPE. | Of course, here is the Java code you requested:
```java
public static long setSysPropertyIfNull(String propname, long value)
{
return Long.parseLong(setSysPropertyIfNull(propname, Long.toString(value)));
}
```
Hope this helps! |
Unidata/thredds | legacy/src/main/java/thredds/catalog/InvCatalogFactory.java | InvCatalogFactory.readXML | public InvCatalogImpl readXML(URI uri) {
// get ready for XML parsing
warnMessages.setLength(0);
errMessages.setLength(0);
fatalMessages.setLength(0);
org.jdom2.Document jdomDoc;
InputStream is = null;
try {
jdomDoc = saxBuilder.build(uri.toURL());
// HttpUriResolver httpUriResol... | java | public InvCatalogImpl readXML(URI uri) {
// get ready for XML parsing
warnMessages.setLength(0);
errMessages.setLength(0);
fatalMessages.setLength(0);
org.jdom2.Document jdomDoc;
InputStream is = null;
try {
jdomDoc = saxBuilder.build(uri.toURL());
// HttpUriResolver httpUriResol... | [
"public",
"InvCatalogImpl",
"readXML",
"(",
"URI",
"uri",
")",
"{",
"// get ready for XML parsing",
"warnMessages",
".",
"setLength",
"(",
"0",
")",
";",
"errMessages",
".",
"setLength",
"(",
"0",
")",
";",
"fatalMessages",
".",
"setLength",
"(",
"0",
")",
"... | Read an InvCatalog from an a URI.
Failures and exceptions are handled
by causing validate() to fail. Therefore, be sure to call validate() before trying
to use the InvCatalog object.
@param uri : the URI of the document, used for resolving reletive references.
@return an InvCatalogImpl object | [
"Read",
"an",
"InvCatalog",
"from",
"an",
"a",
"URI",
".",
"Failures",
"and",
"exceptions",
"are",
"handled",
"by",
"causing",
"validate",
"()",
"to",
"fail",
".",
"Therefore",
"be",
"sure",
"to",
"call",
"validate",
"()",
"before",
"trying",
"to",
"use",
... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/InvCatalogFactory.java#L279-L323 | test | read XML from a URI | Of course, here is the Java code you requested:
```java
public InvCatalogImpl readXML(URI uri) {
// get ready for XML parsing
warnMessages.setLength(0);
errMessages.setLength(0);
fatalMessages.setLength(0);
org.jdom2.Document jdomDoc;
InputStream is = null;
try {
jdomDoc = saxBuilder... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/util/XmlUtil.java | XmlUtil.format | public static String format(String xmlStr, OutputFormat formater) {
if (CommUtil.isBlank(xmlStr))
return xmlStr;
SAXReader reader = new SAXReader();
StringReader sr = new StringReader(xmlStr);
Document doc;
XMLWriter writer = null;
StringWriter sw = new Str... | java | public static String format(String xmlStr, OutputFormat formater) {
if (CommUtil.isBlank(xmlStr))
return xmlStr;
SAXReader reader = new SAXReader();
StringReader sr = new StringReader(xmlStr);
Document doc;
XMLWriter writer = null;
StringWriter sw = new Str... | [
"public",
"static",
"String",
"format",
"(",
"String",
"xmlStr",
",",
"OutputFormat",
"formater",
")",
"{",
"if",
"(",
"CommUtil",
".",
"isBlank",
"(",
"xmlStr",
")",
")",
"return",
"xmlStr",
";",
"SAXReader",
"reader",
"=",
"new",
"SAXReader",
"(",
")",
... | Format xml
@param xmlStr xml String
@param formater {@link OutputFormat}
@return format String | [
"Format",
"xml"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/XmlUtil.java#L137-L168 | test | Format a string with the specified output format. | Of course, here is the Java code you requested:
```java
public static String format(String xmlStr, OutputFormat formater) {
if (CommUtil.isBlank(xmlStr))
return xmlStr;
SAXReader reader = new SAXReader();
StringReader sr = new StringReader(xmlStr);
Document doc;
X... |
basis-technology-corp/tcl-regex-java | src/main/java/com/basistech/tclre/Compiler.java | Compiler.bracket | private void bracket(State lp, State rp) throws RegexException {
assert see('[');
lex.next();
while (!see(']') && !see(EOS)) {
brackpart(lp, rp);
}
assert see(']');
cm.okcolors(nfa);
} | java | private void bracket(State lp, State rp) throws RegexException {
assert see('[');
lex.next();
while (!see(']') && !see(EOS)) {
brackpart(lp, rp);
}
assert see(']');
cm.okcolors(nfa);
} | [
"private",
"void",
"bracket",
"(",
"State",
"lp",
",",
"State",
"rp",
")",
"throws",
"RegexException",
"{",
"assert",
"see",
"(",
"'",
"'",
")",
";",
"lex",
".",
"next",
"(",
")",
";",
"while",
"(",
"!",
"see",
"(",
"'",
"'",
")",
"&&",
"!",
"s... | bracket - handle non-complemented bracket expression
Also called from cbracket for complemented bracket expressions. | [
"bracket",
"-",
"handle",
"non",
"-",
"complemented",
"bracket",
"expression",
"Also",
"called",
"from",
"cbracket",
"for",
"complemented",
"bracket",
"expressions",
"."
] | de0d5eaccf9a61b694cb8793f234cc229c395b43 | https://github.com/basis-technology-corp/tcl-regex-java/blob/de0d5eaccf9a61b694cb8793f234cc229c395b43/src/main/java/com/basistech/tclre/Compiler.java#L1245-L1253 | test | brackets a single class or class name. | Of course, here is the Java code you requested:
```java
private void bracket(State lp, State rp) throws RegexException {
assert see('[');
lex.next();
while (!see(']') && !see(EOS)) {
brackpart(lp, rp);
}
assert see(']');
cm.okcolors(nfa);
}
```
Hope this... |
Jasig/NotificationPortlet | notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/action/favorite/FavoriteAction.java | FavoriteAction.invoke | @Override
public void invoke(final ActionRequest req, final ActionResponse res) throws IOException {
final NotificationEntry entry = getTarget();
final String notificationId = entry.getId();
final Set<String> favoriteNotices = this.getFavoriteNotices(req);
if (favoriteNotices.contain... | java | @Override
public void invoke(final ActionRequest req, final ActionResponse res) throws IOException {
final NotificationEntry entry = getTarget();
final String notificationId = entry.getId();
final Set<String> favoriteNotices = this.getFavoriteNotices(req);
if (favoriteNotices.contain... | [
"@",
"Override",
"public",
"void",
"invoke",
"(",
"final",
"ActionRequest",
"req",
",",
"final",
"ActionResponse",
"res",
")",
"throws",
"IOException",
"{",
"final",
"NotificationEntry",
"entry",
"=",
"getTarget",
"(",
")",
";",
"final",
"String",
"notificationI... | Invoking a FavoriteAction toggles it. | [
"Invoking",
"a",
"FavoriteAction",
"toggles",
"it",
"."
] | a74b87c145b66166a2cb6849d17ce9b0f2c98f3b | https://github.com/Jasig/NotificationPortlet/blob/a74b87c145b66166a2cb6849d17ce9b0f2c98f3b/notification-portlet-webapp/src/main/java/org/jasig/portlet/notice/action/favorite/FavoriteAction.java#L75-L86 | test | Override to add the favorite notices to the set of favorite notices. | Of course, here is the Java code you requested:
```java
@Override
public void invoke(final ActionRequest req, final ActionResponse res) throws IOException {
final NotificationEntry entry = getTarget();
final String notificationId = entry.getId();
final Set<String> favoriteNotices = this.get... |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/TableContextUtil.java | TableContextUtil.getQualifiedTableName | public static String getQualifiedTableName(String schema, String tableName) {
return StringUtils.isEmpty(schema) ? tableName : schema + "." + tableName ;
} | java | public static String getQualifiedTableName(String schema, String tableName) {
return StringUtils.isEmpty(schema) ? tableName : schema + "." + tableName ;
} | [
"public",
"static",
"String",
"getQualifiedTableName",
"(",
"String",
"schema",
",",
"String",
"tableName",
")",
"{",
"return",
"StringUtils",
".",
"isEmpty",
"(",
"schema",
")",
"?",
"tableName",
":",
"schema",
"+",
"\".\"",
"+",
"tableName",
";",
"}"
] | Returns qualified table name (schema.table name)
@param schema schema name, can be null
@param tableName table name
@return qualified table name if schema is not null and tableName alone if schema is null. | [
"Returns",
"qualified",
"table",
"name",
"(",
"schema",
".",
"table",
"name",
")"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/lib/jdbc/multithread/TableContextUtil.java#L161-L163 | test | Get the qualified table name. | Of course, here is the Java code you requested:
```java
public static String getQualifiedTableName(String schema, String tableName) {
return StringUtils.isEmpty(schema) ? tableName : schema + "." + tableName ;
}
```
Hope this helps! |
oblac/jodd | jodd-core/src/main/java/jodd/io/FileUtil.java | FileUtil.outString | protected static void outString(final File dest, final String data, final String encoding, final boolean append) throws IOException {
if (dest.exists()) {
checkIsFile(dest);
}
FileOutputStream out = null;
try {
out = new FileOutputStream(dest, append);
out.write(data.getBytes(encoding));
} finally {
... | java | protected static void outString(final File dest, final String data, final String encoding, final boolean append) throws IOException {
if (dest.exists()) {
checkIsFile(dest);
}
FileOutputStream out = null;
try {
out = new FileOutputStream(dest, append);
out.write(data.getBytes(encoding));
} finally {
... | [
"protected",
"static",
"void",
"outString",
"(",
"final",
"File",
"dest",
",",
"final",
"String",
"data",
",",
"final",
"String",
"encoding",
",",
"final",
"boolean",
"append",
")",
"throws",
"IOException",
"{",
"if",
"(",
"dest",
".",
"exists",
"(",
")",
... | Writes data using encoding to {@link File}.
@param dest destination {@link File}
@param data Data as a {@link String}
@param encoding Encoding as a {@link String}
@param append {@code true} if appending; {@code false} if {@link File} should be overwritten.
@throws IOException if something went wrong. | [
"Writes",
"data",
"using",
"encoding",
"to",
"{",
"@link",
"File",
"}",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/io/FileUtil.java#L830-L841 | test | Write a string to a file. | Of course, here is the Java code you requested:
```java
protected static void outString(final File dest, final String data, final String encoding, final boolean append) throws IOException {
if (dest.exists()) {
checkIsFile(dest);
}
FileOutputStream out = null;
try {
out = new FileOutputStream(dest, appen... |
wildfly/wildfly | ee/src/main/java/org/jboss/as/ee/component/BasicComponentInstance.java | BasicComponentInstance.getInterceptor | public Interceptor getInterceptor(final Method method) throws IllegalStateException {
Interceptor interceptor = methodMap.get(method);
if (interceptor == null) {
throw EeLogger.ROOT_LOGGER.methodNotFound(method);
}
return interceptor;
} | java | public Interceptor getInterceptor(final Method method) throws IllegalStateException {
Interceptor interceptor = methodMap.get(method);
if (interceptor == null) {
throw EeLogger.ROOT_LOGGER.methodNotFound(method);
}
return interceptor;
} | [
"public",
"Interceptor",
"getInterceptor",
"(",
"final",
"Method",
"method",
")",
"throws",
"IllegalStateException",
"{",
"Interceptor",
"interceptor",
"=",
"methodMap",
".",
"get",
"(",
"method",
")",
";",
"if",
"(",
"interceptor",
"==",
"null",
")",
"{",
"th... | {@inheritDoc} | [
"{"
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/ee/src/main/java/org/jboss/as/ee/component/BasicComponentInstance.java#L99-L105 | test | Get the interceptor for the given method. | Of course, here is the Java code you requested:
```java
public Interceptor getInterceptor(final Method method) throws IllegalStateException {
Interceptor interceptor = methodMap.get(method);
if (interceptor == null) {
throw EeLogger.ROOT_LOGGER.methodNotFound(method);
}
retu... |
rackerlabs/blueflood | blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DAbstractMetricsRW.java | DAbstractMetricsRW.getRollupType | private RollupType getRollupType( Map<Long, Object> tsRollupMap ) {
if( tsRollupMap.isEmpty() )
return null;
else {
Object value = tsRollupMap.values().iterator().next();
return value instanceof Rollup ? ( (Rollup) value ).getRollupType() : null;
}
} | java | private RollupType getRollupType( Map<Long, Object> tsRollupMap ) {
if( tsRollupMap.isEmpty() )
return null;
else {
Object value = tsRollupMap.values().iterator().next();
return value instanceof Rollup ? ( (Rollup) value ).getRollupType() : null;
}
} | [
"private",
"RollupType",
"getRollupType",
"(",
"Map",
"<",
"Long",
",",
"Object",
">",
"tsRollupMap",
")",
"{",
"if",
"(",
"tsRollupMap",
".",
"isEmpty",
"(",
")",
")",
"return",
"null",
";",
"else",
"{",
"Object",
"value",
"=",
"tsRollupMap",
".",
"valu... | Given a map of timestamps -> Rollups/SimpleNumbers, return RollupType, or null, if not a Rollup.
@param tsRollupMap
@return | [
"Given",
"a",
"map",
"of",
"timestamps",
"-",
">",
"Rollups",
"/",
"SimpleNumbers",
"return",
"RollupType",
"or",
"null",
"if",
"not",
"a",
"Rollup",
"."
] | 4722a3449b1a7f8e88889ea8c340c6f24396b5b0 | https://github.com/rackerlabs/blueflood/blob/4722a3449b1a7f8e88889ea8c340c6f24396b5b0/blueflood-core/src/main/java/com/rackspacecloud/blueflood/io/datastax/DAbstractMetricsRW.java#L310-L319 | test | Get the RollupType from the Map. | Of course, here is the Java code you requested:
```java
private RollupType getRollupType( Map<Long, Object> tsRollupMap ) {
if( tsRollupMap.isEmpty() )
return null;
else {
Object value = tsRollupMap.values().iterator().next();
return value instanceof Rollup ? ( (Ro... |
oblac/jodd | jodd-mail/src/main/java/jodd/mail/EmailUtil.java | EmailUtil.extractEncoding | public static String extractEncoding(final String contentType, String defaultEncoding) {
String encoding = extractEncoding(contentType);
if (encoding == null) {
if (defaultEncoding == null) {
defaultEncoding = JoddCore.encoding;
}
encoding = defaultEncoding;
}
return encoding;
} | java | public static String extractEncoding(final String contentType, String defaultEncoding) {
String encoding = extractEncoding(contentType);
if (encoding == null) {
if (defaultEncoding == null) {
defaultEncoding = JoddCore.encoding;
}
encoding = defaultEncoding;
}
return encoding;
} | [
"public",
"static",
"String",
"extractEncoding",
"(",
"final",
"String",
"contentType",
",",
"String",
"defaultEncoding",
")",
"{",
"String",
"encoding",
"=",
"extractEncoding",
"(",
"contentType",
")",
";",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"if",... | Extracts encoding from a given content type.
@param contentType content type.
@param defaultEncoding Default encoding to be used if extract returns {@code null}.
If defaultEncoding is {@code null}, {@link JoddCore#encoding} will be used.
@return Encoding from the content type.
@see #extractEncoding(String) | [
"Extracts",
"encoding",
"from",
"a",
"given",
"content",
"type",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-mail/src/main/java/jodd/mail/EmailUtil.java#L109-L119 | test | Extract encoding from content type. | Of course, here is the Java code you requested:
```java
public static String extractEncoding(final String contentType, String defaultEncoding) {
String encoding = extractEncoding(contentType);
if (encoding == null) {
if (defaultEncoding == null) {
defaultEncoding = JoddCore.encoding;
}
encoding = def... |
PeterisP/morphology | src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java | MarkupConverter.verifyAndSetAVSAttribute | private static void verifyAndSetAVSAttribute(
String tag, FeatureStructure avs, int index, char tagValue,
String attribute, String attributeValue) {
//TODO - šī metode 'silently fails' uz jauniem variantiem/simboliem
//marķējumā. Normāli atrisinās tikai šīs klases pāreja uz xml
//konfigfaila apstrādi
if (... | java | private static void verifyAndSetAVSAttribute(
String tag, FeatureStructure avs, int index, char tagValue,
String attribute, String attributeValue) {
//TODO - šī metode 'silently fails' uz jauniem variantiem/simboliem
//marķējumā. Normāli atrisinās tikai šīs klases pāreja uz xml
//konfigfaila apstrādi
if (... | [
"private",
"static",
"void",
"verifyAndSetAVSAttribute",
"(",
"String",
"tag",
",",
"FeatureStructure",
"avs",
",",
"int",
"index",
",",
"char",
"tagValue",
",",
"String",
"attribute",
",",
"String",
"attributeValue",
")",
"{",
"//TODO - šī metode 'silently fails' uz ... | Check if tag has given value in specified position and if so then set
corresponding attribute-value pair in the given attribute-value
structure. | [
"Check",
"if",
"tag",
"has",
"given",
"value",
"in",
"specified",
"position",
"and",
"if",
"so",
"then",
"set",
"corresponding",
"attribute",
"-",
"value",
"pair",
"in",
"the",
"given",
"attribute",
"-",
"value",
"structure",
"."
] | a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783 | https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java#L457-L466 | test | verifica avs - attribute - value | Of course, here is the Java code you requested:
```java
private static void verifyAndSetAVSAttribute(
String tag, FeatureStructure avs, int index, char tagValue,
String attribute, String attributeValue) {
//TODO - šī metode 'silently fails' uz jauniem variantiem/simboliem
//marķējumā. Normāli atrisinās tikai... |
lessthanoptimal/GeoRegression | main/src/georegression/struct/GeoTuple3D_F64.java | GeoTuple3D_F64.plus | public T plus( GeoTuple3D_F64 a ) {
T ret = createNewInstance();
ret.x = x + a.x;
ret.y = y + a.y;
ret.z = z + a.z;
return ret;
} | java | public T plus( GeoTuple3D_F64 a ) {
T ret = createNewInstance();
ret.x = x + a.x;
ret.y = y + a.y;
ret.z = z + a.z;
return ret;
} | [
"public",
"T",
"plus",
"(",
"GeoTuple3D_F64",
"a",
")",
"{",
"T",
"ret",
"=",
"createNewInstance",
"(",
")",
";",
"ret",
".",
"x",
"=",
"x",
"+",
"a",
".",
"x",
";",
"ret",
".",
"y",
"=",
"y",
"+",
"a",
".",
"y",
";",
"ret",
".",
"z",
"=",
... | <p>Addition</p>
ret.x = this.x + a.x;
@param a value which is to be added | [
"<p",
">",
"Addition<",
"/",
"p",
">"
] | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/struct/GeoTuple3D_F64.java#L143-L149 | test | Computes the sum of the three points in this image | Of course, here is the Java code you requested:
```java
public T plus( GeoTuple3D_F64 a ) {
T ret = createNewInstance();
ret.x = x + a.x;
ret.y = y + a.y;
ret.z = z + a.z;
return ret;
}
```
Hope this helps! |
ReactiveX/RxJava | src/main/java/io/reactivex/internal/observers/BlockingMultiObserver.java | BlockingMultiObserver.blockingGetError | public Throwable blockingGetError(long timeout, TimeUnit unit) {
if (getCount() != 0) {
try {
BlockingHelper.verifyNonBlocking();
if (!await(timeout, unit)) {
dispose();
throw ExceptionHelper.wrapOrThrow(new TimeoutException(tim... | java | public Throwable blockingGetError(long timeout, TimeUnit unit) {
if (getCount() != 0) {
try {
BlockingHelper.verifyNonBlocking();
if (!await(timeout, unit)) {
dispose();
throw ExceptionHelper.wrapOrThrow(new TimeoutException(tim... | [
"public",
"Throwable",
"blockingGetError",
"(",
"long",
"timeout",
",",
"TimeUnit",
"unit",
")",
"{",
"if",
"(",
"getCount",
"(",
")",
"!=",
"0",
")",
"{",
"try",
"{",
"BlockingHelper",
".",
"verifyNonBlocking",
"(",
")",
";",
"if",
"(",
"!",
"await",
... | Block until the latch is counted down and return the error received or
when the wait is interrupted or times out, null otherwise.
@param timeout the timeout value
@param unit the time unit
@return the error received or null | [
"Block",
"until",
"the",
"latch",
"is",
"counted",
"down",
"and",
"return",
"the",
"error",
"received",
"or",
"when",
"the",
"wait",
"is",
"interrupted",
"or",
"times",
"out",
"null",
"otherwise",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/internal/observers/BlockingMultiObserver.java#L147-L161 | test | Blocking get error. | Of course, here is the Java code you requested:
```java
public Throwable blockingGetError(long timeout, TimeUnit unit) {
if (getCount() != 0) {
try {
BlockingHelper.verifyNonBlocking();
if (!await(timeout, unit)) {
dispose();
t... |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/GfdImportFunction.java | GfdImportFunction.importOnRegion | protected boolean importOnRegion(RegionFunctionContext rfc) throws Exception
{
// get argument
// check if region is partitioned
Region<Object, Object> region = rfc.getDataSet();
return importRegion(region);
} | java | protected boolean importOnRegion(RegionFunctionContext rfc) throws Exception
{
// get argument
// check if region is partitioned
Region<Object, Object> region = rfc.getDataSet();
return importRegion(region);
} | [
"protected",
"boolean",
"importOnRegion",
"(",
"RegionFunctionContext",
"rfc",
")",
"throws",
"Exception",
"{",
"// get argument\r",
"// check if region is partitioned\r",
"Region",
"<",
"Object",
",",
"Object",
">",
"region",
"=",
"rfc",
".",
"getDataSet",
"(",
")",
... | ------------------------------------------------ | [
"------------------------------------------------"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/GfdImportFunction.java#L84-L93 | test | Import on region. | Of course, here is the Java code you requested:
```java
protected boolean importOnRegion(RegionFunctionContext rfc) throws Exception
{
// get argument
// check if region is partitioned
Region<Object, Object> region = rfc.getDataSet();
return importRegion(region);
}
```
Hope this helps! |
RuedigerMoeller/fast-serialization | src/main/java/org/nustaq/serialization/FSTObjectOutput.java | FSTObjectOutput.getCopyOfWrittenBuffer | public byte[] getCopyOfWrittenBuffer() {
if ( ! getCodec().isByteArrayBased() ) {
return getBuffer();
}
byte res [] = new byte[getCodec().getWritten()];
byte[] buffer = getBuffer();
System.arraycopy(buffer,0,res,0, getCodec().getWritten());
return res;
} | java | public byte[] getCopyOfWrittenBuffer() {
if ( ! getCodec().isByteArrayBased() ) {
return getBuffer();
}
byte res [] = new byte[getCodec().getWritten()];
byte[] buffer = getBuffer();
System.arraycopy(buffer,0,res,0, getCodec().getWritten());
return res;
} | [
"public",
"byte",
"[",
"]",
"getCopyOfWrittenBuffer",
"(",
")",
"{",
"if",
"(",
"!",
"getCodec",
"(",
")",
".",
"isByteArrayBased",
"(",
")",
")",
"{",
"return",
"getBuffer",
"(",
")",
";",
"}",
"byte",
"res",
"[",
"]",
"=",
"new",
"byte",
"[",
"ge... | @return a copy of written bytes.
Warning: if the stream has been flushed, this will fail with an exception.
a flush is triggered after each 1st level writeObject.
note: in case of non-stream based serialization (directbuffer, offheap mem) getBuffer will return a copy anyways. | [
"@return",
"a",
"copy",
"of",
"written",
"bytes",
".",
"Warning",
":",
"if",
"the",
"stream",
"has",
"been",
"flushed",
"this",
"will",
"fail",
"with",
"an",
"exception",
".",
"a",
"flush",
"is",
"triggered",
"after",
"each",
"1st",
"level",
"writeObject",... | 59f8f800b79479d0b9c80901cf55903d9b027f26 | https://github.com/RuedigerMoeller/fast-serialization/blob/59f8f800b79479d0b9c80901cf55903d9b027f26/src/main/java/org/nustaq/serialization/FSTObjectOutput.java#L1102-L1110 | test | Get a copy of the written buffer. | Of course, here is the Java code you requested:
```java
public byte[] getCopyOfWrittenBuffer() {
if ( ! getCodec().isByteArrayBased() ) {
return getBuffer();
}
byte res [] = new byte[getCodec().getWritten()];
byte[] buffer = getBuffer();
System.arraycopy(buffer,0,res... |
HotelsDotCom/beeju | src/main/java/com/hotels/beeju/BeejuJUnitRule.java | BeejuJUnitRule.createDatabase | public void createDatabase(String databaseName) throws TException {
HiveMetaStoreClient client = new HiveMetaStoreClient(conf());
String databaseFolder = new File(temporaryFolder.getRoot(), databaseName).toURI().toString();
try {
client.createDatabase(new Database(databaseName, null, databaseFolder, n... | java | public void createDatabase(String databaseName) throws TException {
HiveMetaStoreClient client = new HiveMetaStoreClient(conf());
String databaseFolder = new File(temporaryFolder.getRoot(), databaseName).toURI().toString();
try {
client.createDatabase(new Database(databaseName, null, databaseFolder, n... | [
"public",
"void",
"createDatabase",
"(",
"String",
"databaseName",
")",
"throws",
"TException",
"{",
"HiveMetaStoreClient",
"client",
"=",
"new",
"HiveMetaStoreClient",
"(",
"conf",
"(",
")",
")",
";",
"String",
"databaseFolder",
"=",
"new",
"File",
"(",
"tempor... | Create a new database with the specified name.
@param databaseName Database name.
@throws TException If an error occurs creating the database. | [
"Create",
"a",
"new",
"database",
"with",
"the",
"specified",
"name",
"."
] | 1a856b7d082a25380a07dd4fc324af3a7df1fcc3 | https://github.com/HotelsDotCom/beeju/blob/1a856b7d082a25380a07dd4fc324af3a7df1fcc3/src/main/java/com/hotels/beeju/BeejuJUnitRule.java#L166-L174 | test | Create a database in the temporary folder | Of course, here is the Java code you requested:
```java
public void createDatabase(String databaseName) throws TException {
HiveMetaStoreClient client = new HiveMetaStoreClient(conf());
String databaseFolder = new File(temporaryFolder.getRoot(), databaseName).toURI().toString();
try {
client.createDa... |
Unidata/thredds | cdm/src/main/java/ucar/unidata/geoloc/LatLonPointImpl.java | LatLonPointImpl.betweenLon | static public boolean betweenLon(double lon, double lonBeg, double lonEnd) {
lonBeg = lonNormal(lonBeg, lon);
lonEnd = lonNormal(lonEnd, lon);
return (lon >= lonBeg) && (lon <= lonEnd);
} | java | static public boolean betweenLon(double lon, double lonBeg, double lonEnd) {
lonBeg = lonNormal(lonBeg, lon);
lonEnd = lonNormal(lonEnd, lon);
return (lon >= lonBeg) && (lon <= lonEnd);
} | [
"static",
"public",
"boolean",
"betweenLon",
"(",
"double",
"lon",
",",
"double",
"lonBeg",
",",
"double",
"lonEnd",
")",
"{",
"lonBeg",
"=",
"lonNormal",
"(",
"lonBeg",
",",
"lon",
")",
";",
"lonEnd",
"=",
"lonNormal",
"(",
"lonEnd",
",",
"lon",
")",
... | Test if point lies between two longitudes, deal with wrapping.
@param lon point to test
@param lonBeg beginning longitude
@param lonEnd ending longitude
@return true if lon is between lonBeg and lonEnd.
@deprecated | [
"Test",
"if",
"point",
"lies",
"between",
"two",
"longitudes",
"deal",
"with",
"wrapping",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/geoloc/LatLonPointImpl.java#L31-L35 | test | Returns true if the longitude is between the two lon - normal values. | Of course, here is the Java code you requested:
```java
static public boolean betweenLon(double lon, double lonBeg, double lonEnd) {
lonBeg = lonNormal(lonBeg, lon);
lonEnd = lonNormal(lonEnd, lon);
return (lon >= lonBeg) && (lon <= lonEnd);
}
```
Hope this helps! |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/ReadExportFunction.java | ReadExportFunction.execute | @Override
public void execute(FunctionContext<Object> functionContext)
{
ResultSender<Object> sender = functionContext.getResultSender();
Cache cache = CacheFactory.getAnyInstance();
Logger logWriter = LogManager.getLogger(getClass());
try
{
//export data
String[] args = (String[])... | java | @Override
public void execute(FunctionContext<Object> functionContext)
{
ResultSender<Object> sender = functionContext.getResultSender();
Cache cache = CacheFactory.getAnyInstance();
Logger logWriter = LogManager.getLogger(getClass());
try
{
//export data
String[] args = (String[])... | [
"@",
"Override",
"public",
"void",
"execute",
"(",
"FunctionContext",
"<",
"Object",
">",
"functionContext",
")",
"{",
"ResultSender",
"<",
"Object",
">",
"sender",
"=",
"functionContext",
".",
"getResultSender",
"(",
")",
";",
"Cache",
"cache",
"=",
"CacheFac... | This function will use the JsonExportFunction function
to export json data and read the results to be returned to callers | [
"This",
"function",
"will",
"use",
"the",
"JsonExportFunction",
"function",
"to",
"export",
"json",
"data",
"and",
"read",
"the",
"results",
"to",
"be",
"returned",
"to",
"callers"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/operations/functions/ReadExportFunction.java#L58-L124 | test | Executes the
function. | Of course, here is the Java code you requested:
```java
@Override
public void execute(FunctionContext<Object> functionContext)
{
ResultSender<Object> sender = functionContext.getResultSender();
Cache cache = CacheFactory.getAnyInstance();
Logger logWriter = LogManager.getLogger(getClass());
try
... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepClient.java | FlowStepClient.deleteFlowStep | public FlowStep deleteFlowStep(FlowStep flowStepParam)
{
if(flowStepParam != null && this.serviceTicket != null)
{
flowStepParam.setServiceTicket(this.serviceTicket);
}
return new FlowStep(this.postJson(
flowStepParam, WS.Path.FlowStep.Version1.flowStepDe... | java | public FlowStep deleteFlowStep(FlowStep flowStepParam)
{
if(flowStepParam != null && this.serviceTicket != null)
{
flowStepParam.setServiceTicket(this.serviceTicket);
}
return new FlowStep(this.postJson(
flowStepParam, WS.Path.FlowStep.Version1.flowStepDe... | [
"public",
"FlowStep",
"deleteFlowStep",
"(",
"FlowStep",
"flowStepParam",
")",
"{",
"if",
"(",
"flowStepParam",
"!=",
"null",
"&&",
"this",
".",
"serviceTicket",
"!=",
"null",
")",
"{",
"flowStepParam",
".",
"setServiceTicket",
"(",
"this",
".",
"serviceTicket",... | Delete an existing Flow Step.
@param flowStepParam The Flow Step to delete.
@return The deleted Flow Step. | [
"Delete",
"an",
"existing",
"Flow",
"Step",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/flow/FlowStepClient.java#L355-L364 | test | Delete a FlowStep. | Of course, here is the Java code you requested:
```java
public FlowStep deleteFlowStep(FlowStep flowStepParam)
{
if(flowStepParam != null && this.serviceTicket != null)
{
flowStepParam.setServiceTicket(this.serviceTicket);
}
return new FlowStep(this.postJson(
... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/ReconnectManager.java | ReconnectManager.addReconnectTask | public void addReconnectTask(Url url) {
ReconnectTask task = new ReconnectTask();
task.url = url;
tasks.add(task);
} | java | public void addReconnectTask(Url url) {
ReconnectTask task = new ReconnectTask();
task.url = url;
tasks.add(task);
} | [
"public",
"void",
"addReconnectTask",
"(",
"Url",
"url",
")",
"{",
"ReconnectTask",
"task",
"=",
"new",
"ReconnectTask",
"(",
")",
";",
"task",
".",
"url",
"=",
"url",
";",
"tasks",
".",
"add",
"(",
"task",
")",
";",
"}"
] | add reconnect task
@param url | [
"add",
"reconnect",
"task"
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/ReconnectManager.java#L80-L84 | test | Add a reconnect task to the set of tasks. | Of course, here is the Java code you requested:
```java
public void addReconnectTask(Url url) {
ReconnectTask task = new ReconnectTask();
task.url = url;
tasks.add(task);
}
```
Hope this helps! |
jillesvangurp/urlbuilder | src/main/java/com/github/jillesvangurp/urlbuilder/UrlBuilder.java | UrlBuilder.queryParam | public UrlBuilder queryParam(String name, String value, boolean encode) {
if (StringUtils.isNotEmpty(value)) {
if (encode) {
try {
value = URLEncoder.encode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new I... | java | public UrlBuilder queryParam(String name, String value, boolean encode) {
if (StringUtils.isNotEmpty(value)) {
if (encode) {
try {
value = URLEncoder.encode(value, "UTF-8");
} catch (UnsupportedEncodingException e) {
throw new I... | [
"public",
"UrlBuilder",
"queryParam",
"(",
"String",
"name",
",",
"String",
"value",
",",
"boolean",
"encode",
")",
"{",
"if",
"(",
"StringUtils",
".",
"isNotEmpty",
"(",
"value",
")",
")",
"{",
"if",
"(",
"encode",
")",
"{",
"try",
"{",
"value",
"=",
... | Create a query parameter with a String value.
@param name name
@param value value
@param encode if true, the value is urlencoded.
@return the builder | [
"Create",
"a",
"query",
"parameter",
"with",
"a",
"String",
"value",
"."
] | 22a8a4edf74a08b07cb17aad08c58c9feec8a2c0 | https://github.com/jillesvangurp/urlbuilder/blob/22a8a4edf74a08b07cb17aad08c58c9feec8a2c0/src/main/java/com/github/jillesvangurp/urlbuilder/UrlBuilder.java#L174-L186 | test | Add a parameter to the URL. | Of course, here is the Java code you requested:
```java
public UrlBuilder queryParam(String name, String value, boolean encode) {
if (StringUtils.isNotEmpty(value)) {
if (encode) {
try {
value = URLEncoder.encode(value, "UTF-8");
} catch (Unsuppor... |
PeterisP/morphology | src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java | MarkupConverter.verifyAndSetKamolsAttribute | private static void verifyAndSetKamolsAttribute(
AttributeValues avs, StringBuilder tag, int index,
char tagValue, String attribute, String attributeValue) {
if (avs.isMatchingStrong(attribute, attributeValue))
tag.setCharAt(index, tagValue);
} | java | private static void verifyAndSetKamolsAttribute(
AttributeValues avs, StringBuilder tag, int index,
char tagValue, String attribute, String attributeValue) {
if (avs.isMatchingStrong(attribute, attributeValue))
tag.setCharAt(index, tagValue);
} | [
"private",
"static",
"void",
"verifyAndSetKamolsAttribute",
"(",
"AttributeValues",
"avs",
",",
"StringBuilder",
"tag",
",",
"int",
"index",
",",
"char",
"tagValue",
",",
"String",
"attribute",
",",
"String",
"attributeValue",
")",
"{",
"if",
"(",
"avs",
".",
... | Check if attribute-value structure has attribute matching given
attributeValue and if so then set corresponding position in the tag. | [
"Check",
"if",
"attribute",
"-",
"value",
"structure",
"has",
"attribute",
"matching",
"given",
"attributeValue",
"and",
"if",
"so",
"then",
"set",
"corresponding",
"position",
"in",
"the",
"tag",
"."
] | a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783 | https://github.com/PeterisP/morphology/blob/a7805b7cbf09fc46ebe7f2dd4009a0807a7e2783/src/main/java/lv/semti/morphology/analyzer/MarkupConverter.java#L36-L41 | test | Verify and set the namols attribute. | Of course, here is the Java code you requested:
```java
private static void verifyAndSetKamolsAttribute(
AttributeValues avs, StringBuilder tag, int index,
char tagValue, String attribute, String attributeValue) {
if (avs.isMatchingStrong(attribute, attributeValue))
tag.setCharAt(index, tagValue);
}
```
H... |
sialcasa/mvvmFX | mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java | ModelWrapper.commit | public void commit() {
if (model.get() != null) {
inCommitPhase = true;
fields.forEach(field -> field.commit(model.get()));
if(! immutableFields.isEmpty()) {
M tmp = model.get();
for (ImmutablePropertyField<?, M, ?> immutableField : immutableFields) {
tmp = immutableField.commitImmutable(tm... | java | public void commit() {
if (model.get() != null) {
inCommitPhase = true;
fields.forEach(field -> field.commit(model.get()));
if(! immutableFields.isEmpty()) {
M tmp = model.get();
for (ImmutablePropertyField<?, M, ?> immutableField : immutableFields) {
tmp = immutableField.commitImmutable(tm... | [
"public",
"void",
"commit",
"(",
")",
"{",
"if",
"(",
"model",
".",
"get",
"(",
")",
"!=",
"null",
")",
"{",
"inCommitPhase",
"=",
"true",
";",
"fields",
".",
"forEach",
"(",
"field",
"->",
"field",
".",
"commit",
"(",
"model",
".",
"get",
"(",
"... | Take the current value of each property field and write it into the wrapped model element.
<p>
If no model element is defined then nothing will happen.
<p>
<b>Note:</b> This method has no effects on the values of the defined property fields but will only change the
state of the wrapped model element. | [
"Take",
"the",
"current",
"value",
"of",
"each",
"property",
"field",
"and",
"write",
"it",
"into",
"the",
"wrapped",
"model",
"element",
".",
"<p",
">",
"If",
"no",
"model",
"element",
"is",
"defined",
"then",
"nothing",
"will",
"happen",
".",
"<p",
">"... | 240566a358a8e01c94c0bbb99228140a69690d02 | https://github.com/sialcasa/mvvmFX/blob/240566a358a8e01c94c0bbb99228140a69690d02/mvvmfx/src/main/java/de/saxsys/mvvmfx/utils/mapping/ModelWrapper.java#L441-L468 | test | Commit the changes to the model. | Of course, here is the Java code you requested:
```java
public void commit() {
if (model.get() != null) {
inCommitPhase = true;
fields.forEach(field -> field.commit(model.get()));
if(! immutableFields.isEmpty()) {
M tmp = model.get();
for (ImmutablePropertyField<?, M, ?> immutableField : immuta... |
jcuda/jcublas | JCublasJava/src/main/java/jcuda/jcublas/JCublas2.java | JCublas2.cublasSrotmg | public static int cublasSrotmg(
cublasHandle handle,
Pointer d1, /** host or device pointer */
Pointer d2, /** host or device pointer */
Pointer x1, /** host or device pointer */
Pointer y1, /** host or device pointer */
Pointer param)/** host or device pointer */
... | java | public static int cublasSrotmg(
cublasHandle handle,
Pointer d1, /** host or device pointer */
Pointer d2, /** host or device pointer */
Pointer x1, /** host or device pointer */
Pointer y1, /** host or device pointer */
Pointer param)/** host or device pointer */
... | [
"public",
"static",
"int",
"cublasSrotmg",
"(",
"cublasHandle",
"handle",
",",
"Pointer",
"d1",
",",
"/** host or device pointer */",
"Pointer",
"d2",
",",
"/** host or device pointer */",
"Pointer",
"x1",
",",
"/** host or device pointer */",
"Pointer",
"y1",
",",
"/**... | host or device pointer | [
"host",
"or",
"device",
"pointer"
] | 80875235d24562073f4d66651dd17263f306427d | https://github.com/jcuda/jcublas/blob/80875235d24562073f4d66651dd17263f306427d/JCublasJava/src/main/java/jcuda/jcublas/JCublas2.java#L1760-L1769 | test | CublasSrotmg for imaginary entry set. | Of course, here is the Java code you requested:
```java
public static int cublasSrotmg(
cublasHandle handle,
Pointer d1, /** host or device pointer */
Pointer d2, /** host or device pointer */
Pointer x1, /** host or device pointer */
Pointer y1, /** host or device pointer... |
oblac/jodd | jodd-bean/src/main/java/jodd/introspector/PropertyDescriptor.java | PropertyDescriptor.createGetter | protected Getter createGetter(final boolean declared) {
if (readMethodDescriptor != null) {
if (readMethodDescriptor.matchDeclared(declared)) {
return Getter.of(readMethodDescriptor);
}
}
if (fieldDescriptor != null) {
if (fieldDescriptor.matchDeclared(declared)) {
return Getter.of(fieldDescripto... | java | protected Getter createGetter(final boolean declared) {
if (readMethodDescriptor != null) {
if (readMethodDescriptor.matchDeclared(declared)) {
return Getter.of(readMethodDescriptor);
}
}
if (fieldDescriptor != null) {
if (fieldDescriptor.matchDeclared(declared)) {
return Getter.of(fieldDescripto... | [
"protected",
"Getter",
"createGetter",
"(",
"final",
"boolean",
"declared",
")",
"{",
"if",
"(",
"readMethodDescriptor",
"!=",
"null",
")",
"{",
"if",
"(",
"readMethodDescriptor",
".",
"matchDeclared",
"(",
"declared",
")",
")",
"{",
"return",
"Getter",
".",
... | Creates a {@link Getter}. | [
"Creates",
"a",
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-bean/src/main/java/jodd/introspector/PropertyDescriptor.java#L218-L230 | test | Creates a getter for the given declared flag. | Of course, here is the Java code you requested:
```java
protected Getter createGetter(final boolean declared) {
if (readMethodDescriptor != null) {
if (readMethodDescriptor.matchDeclared(declared)) {
return Getter.of(readMethodDescriptor);
}
}
if (fieldDescriptor != null) {
if (fieldDescriptor.match... |
boonproject/boon | boon/src/main/java/org/boon/collections/IntList.java | IntList.addInt | public boolean addInt(int integer) {
if (end + 1 >= values.length) {
values = grow(values);
}
values[end] = integer;
end++;
return true;
} | java | public boolean addInt(int integer) {
if (end + 1 >= values.length) {
values = grow(values);
}
values[end] = integer;
end++;
return true;
} | [
"public",
"boolean",
"addInt",
"(",
"int",
"integer",
")",
"{",
"if",
"(",
"end",
"+",
"1",
">=",
"values",
".",
"length",
")",
"{",
"values",
"=",
"grow",
"(",
"values",
")",
";",
"}",
"values",
"[",
"end",
"]",
"=",
"integer",
";",
"end",
"++",... | Add a new value to the list but don't employ a wrapper.
@param integer new value
@return was able to add. | [
"Add",
"a",
"new",
"value",
"to",
"the",
"list",
"but",
"don",
"t",
"employ",
"a",
"wrapper",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/collections/IntList.java#L172-L179 | test | Adds an integer to the set. | Of course, here is the Java code you requested:
```java
public boolean addInt(int integer) {
if (end + 1 >= values.length) {
values = grow(values);
}
values[end] = integer;
end++;
return true;
}
```
Hope this helps! |
oblac/jodd | jodd-lagarto/src/main/java/jodd/lagarto/dom/LagartoDOMBuilderTagVisitor.java | LagartoDOMBuilderTagVisitor.findMatchingParentOpenTag | protected Node findMatchingParentOpenTag(String tagName) {
Node parent = parentNode;
if (!rootNode.config.isCaseSensitive()) {
tagName = tagName.toLowerCase();
}
while (parent != null) {
String parentNodeName = parent.getNodeName();
if (parentNodeName != null) {
if (!rootNode.config.isCaseSe... | java | protected Node findMatchingParentOpenTag(String tagName) {
Node parent = parentNode;
if (!rootNode.config.isCaseSensitive()) {
tagName = tagName.toLowerCase();
}
while (parent != null) {
String parentNodeName = parent.getNodeName();
if (parentNodeName != null) {
if (!rootNode.config.isCaseSe... | [
"protected",
"Node",
"findMatchingParentOpenTag",
"(",
"String",
"tagName",
")",
"{",
"Node",
"parent",
"=",
"parentNode",
";",
"if",
"(",
"!",
"rootNode",
".",
"config",
".",
"isCaseSensitive",
"(",
")",
")",
"{",
"tagName",
"=",
"tagName",
".",
"toLowerCas... | Finds matching parent open tag or <code>null</code> if not found. | [
"Finds",
"matching",
"parent",
"open",
"tag",
"or",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"not",
"found",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-lagarto/src/main/java/jodd/lagarto/dom/LagartoDOMBuilderTagVisitor.java#L305-L327 | test | Find the parent node that matches the given tag name. | Of course, here is the Java code you requested:
```java
protected Node findMatchingParentOpenTag(String tagName) {
Node parent = parentNode;
if (!rootNode.config.isCaseSensitive()) {
tagName = tagName.toLowerCase();
}
while (parent != null) {
String parentNodeName = parent.getNodeName();
if (pa... |
eiichiro/bootleg | src/main/java/org/eiichiro/bootleg/Pipeline.java | Pipeline.set | public Pipeline<T> set(int index, String name, Predicate<T> predicate) {
Preconditions.checkArgument(predicate != null,
"Parameter 'predicate' must not be [" + predicate + "]");
stages.add(index, predicate);
names.put(predicate, name);
return this;
} | java | public Pipeline<T> set(int index, String name, Predicate<T> predicate) {
Preconditions.checkArgument(predicate != null,
"Parameter 'predicate' must not be [" + predicate + "]");
stages.add(index, predicate);
names.put(predicate, name);
return this;
} | [
"public",
"Pipeline",
"<",
"T",
">",
"set",
"(",
"int",
"index",
",",
"String",
"name",
",",
"Predicate",
"<",
"T",
">",
"predicate",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"predicate",
"!=",
"null",
",",
"\"Parameter 'predicate' must not be [\"... | Sets the specified {@code Predicate} to the next processing stage with
the specified index and stage name.
@param index The index the specified {@code Predicate} to be set.
@param name The stage name.
@param predicate The {@code Function} set to the next processing stage.
@return This {@code Pipeline} instance. | [
"Sets",
"the",
"specified",
"{",
"@code",
"Predicate",
"}",
"to",
"the",
"next",
"processing",
"stage",
"with",
"the",
"specified",
"index",
"and",
"stage",
"name",
"."
] | b98a108500597cb6185056be2eef7de5ba1963d2 | https://github.com/eiichiro/bootleg/blob/b98a108500597cb6185056be2eef7de5ba1963d2/src/main/java/org/eiichiro/bootleg/Pipeline.java#L179-L185 | test | Sets a pipeline to be executed. | Of course, here is the Java code you requested:
```java
public Pipeline<T> set(int index, String name, Predicate<T> predicate) {
Preconditions.checkArgument(predicate != null,
"Parameter 'predicate' must not be [" + predicate + "]");
stages.add(index, predicate);
names.put(predicate, name);
return this;
... |
stanfy/enroscar | images/src/main/java/com/stanfy/enroscar/images/ImagesManager.java | ImagesManager.memCacheImage | protected void memCacheImage(final String url, final Bitmap bitmap) {
if (debug) { Log.d(TAG, "Memcache for " + url); }
memCache.putElement(url, bitmap);
} | java | protected void memCacheImage(final String url, final Bitmap bitmap) {
if (debug) { Log.d(TAG, "Memcache for " + url); }
memCache.putElement(url, bitmap);
} | [
"protected",
"void",
"memCacheImage",
"(",
"final",
"String",
"url",
",",
"final",
"Bitmap",
"bitmap",
")",
"{",
"if",
"(",
"debug",
")",
"{",
"Log",
".",
"d",
"(",
"TAG",
",",
"\"Memcache for \"",
"+",
"url",
")",
";",
"}",
"memCache",
".",
"putElemen... | Add image to memory cache.
@param url image URL
@param bitmap bitmap | [
"Add",
"image",
"to",
"memory",
"cache",
"."
] | 0e64f3c309d62e359b55ddcba10e3cc592f5e083 | https://github.com/stanfy/enroscar/blob/0e64f3c309d62e359b55ddcba10e3cc592f5e083/images/src/main/java/com/stanfy/enroscar/images/ImagesManager.java#L472-L475 | test | This method is called to memcache an image. | Of course, here is the Java code you requested:
```java
protected void memCacheImage(final String url, final Bitmap bitmap) {
if (debug) { Log.d(TAG, "Memcache for " + url); }
memCache.putElement(url, bitmap);
}
```
Hope this helps! |
TooTallNate/Java-WebSocket | src/main/example/SSLServerCustomWebsocketFactoryExample.java | SSLServerCustomWebsocketFactoryExample.main | public static void main(String[] args) throws Exception {
ChatServer chatserver = new ChatServer(8887); // Firefox does allow multible ssl connection only via port 443 //tested on FF16
// load up the key store
String STORETYPE = "JKS";
String KEYSTORE = "keystore.jks";
String ST... | java | public static void main(String[] args) throws Exception {
ChatServer chatserver = new ChatServer(8887); // Firefox does allow multible ssl connection only via port 443 //tested on FF16
// load up the key store
String STORETYPE = "JKS";
String KEYSTORE = "keystore.jks";
String ST... | [
"public",
"static",
"void",
"main",
"(",
"String",
"[",
"]",
"args",
")",
"throws",
"Exception",
"{",
"ChatServer",
"chatserver",
"=",
"new",
"ChatServer",
"(",
"8887",
")",
";",
"// Firefox does allow multible ssl connection only via port 443 //tested on FF16",
"// loa... | /*
Keystore with certificate created like so (in JKS format):
keytool -genkey -validity 3650 -keystore "keystore.jks" -storepass "storepassword" -keypass "keypassword" -alias "default" -dname "CN=127.0.0.1, OU=MyOrgUnit, O=MyOrg, L=MyCity, S=MyRegion, C=MyCountry" | [
"/",
"*",
"Keystore",
"with",
"certificate",
"created",
"like",
"so",
"(",
"in",
"JKS",
"format",
")",
":"
] | 73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9 | https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/example/SSLServerCustomWebsocketFactoryExample.java#L50-L89 | test | Main method for the chatserver example. | Of course, here is the Java code you requested:
```java
public static void main(String[] args) throws Exception {
ChatServer chatserver = new ChatServer(8887); // Firefox does allow multible ssl connection only via port 443 //tested on FF16
// load up the key store
String STORETYPE = "JKS";
... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/internal/utils/URLDecoder.java | URLDecoder.decode | public static String decode(String url) {
try {
return decode(new URL(url)).toString();
} catch (MalformedURLException e) {
// ignore or log?
}
String file;
String ref = null;
int lastSlashIndex = url.lastIndexOf('/');
int lastHashIndex =... | java | public static String decode(String url) {
try {
return decode(new URL(url)).toString();
} catch (MalformedURLException e) {
// ignore or log?
}
String file;
String ref = null;
int lastSlashIndex = url.lastIndexOf('/');
int lastHashIndex =... | [
"public",
"static",
"String",
"decode",
"(",
"String",
"url",
")",
"{",
"try",
"{",
"return",
"decode",
"(",
"new",
"URL",
"(",
"url",
")",
")",
".",
"toString",
"(",
")",
";",
"}",
"catch",
"(",
"MalformedURLException",
"e",
")",
"{",
"// ignore or lo... | Decodes the given <code>URL</code> from an <code>ASCII</code>
readable <code>URL</code> that is safe for transport. Returns the
result.
@return the result of decoding the given <code>URL</code> from an
<code>ASCII</code> readable <code>URL</code> that is safe for
transport | [
"Decodes",
"the",
"given",
"<code",
">",
"URL<",
"/",
"code",
">",
"from",
"an",
"<code",
">",
"ASCII<",
"/",
"code",
">",
"readable",
"<code",
">",
"URL<",
"/",
"code",
">",
"that",
"is",
"safe",
"for",
"transport",
".",
"Returns",
"the",
"result",
... | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/interface/org/eclipse/webdav/internal/utils/URLDecoder.java#L94-L114 | test | Decode a URL string into a single string. | Of course, here is the Java code you requested:
```java
public static String decode(String url) {
try {
return decode(new URL(url)).toString();
} catch (MalformedURLException e) {
// ignore or log?
}
String file;
String ref = null;
int lastSlash... |
real-logic/aeron | aeron-archive/src/main/java/io/aeron/archive/client/RecordingSubscriptionDescriptorPoller.java | RecordingSubscriptionDescriptorPoller.reset | public void reset(
final long correlationId, final int subscriptionCount, final RecordingSubscriptionDescriptorConsumer consumer)
{
this.correlationId = correlationId;
this.consumer = consumer;
this.remainingSubscriptionCount = subscriptionCount;
isDispatchComplete = false;
... | java | public void reset(
final long correlationId, final int subscriptionCount, final RecordingSubscriptionDescriptorConsumer consumer)
{
this.correlationId = correlationId;
this.consumer = consumer;
this.remainingSubscriptionCount = subscriptionCount;
isDispatchComplete = false;
... | [
"public",
"void",
"reset",
"(",
"final",
"long",
"correlationId",
",",
"final",
"int",
"subscriptionCount",
",",
"final",
"RecordingSubscriptionDescriptorConsumer",
"consumer",
")",
"{",
"this",
".",
"correlationId",
"=",
"correlationId",
";",
"this",
".",
"consumer... | Reset the poller to dispatch the descriptors returned from a query.
@param correlationId for the response.
@param subscriptionCount of descriptors to expect.
@param consumer to which the recording subscription descriptors are to be dispatched. | [
"Reset",
"the",
"poller",
"to",
"dispatch",
"the",
"descriptors",
"returned",
"from",
"a",
"query",
"."
] | 045c32f0256d1ea35d562520216affc281a41239 | https://github.com/real-logic/aeron/blob/045c32f0256d1ea35d562520216affc281a41239/aeron-archive/src/main/java/io/aeron/archive/client/RecordingSubscriptionDescriptorPoller.java#L126-L133 | test | Resets the record set to the initial state. | Of course, here is the Java code you requested:
```java
public void reset(
final long correlationId, final int subscriptionCount, final RecordingSubscriptionDescriptorConsumer consumer)
{
this.correlationId = correlationId;
this.consumer = consumer;
this.remainingSubscriptionCount =... |
ReactiveX/RxJava | src/main/java/io/reactivex/Observable.java | Observable.sample | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Observable<T> sample(long period, TimeUnit unit) {
return sample(period, unit, Schedulers.computation());
} | java | @CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Observable<T> sample(long period, TimeUnit unit) {
return sample(period, unit, Schedulers.computation());
} | [
"@",
"CheckReturnValue",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"COMPUTATION",
")",
"public",
"final",
"Observable",
"<",
"T",
">",
"sample",
"(",
"long",
"period",
",",
"TimeUnit",
"unit",
")",
"{",
"return",
"sample",
"(",
"period",
",",
"u... | Returns an Observable that emits the most recently emitted item (if any) emitted by the source ObservableSource
within periodic time intervals.
<p>
<img width="640" height="305" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/sample.png" alt="">
<dl>
<dt><b>Scheduler:</b></dt>
<dd>{@code sample} o... | [
"Returns",
"an",
"Observable",
"that",
"emits",
"the",
"most",
"recently",
"emitted",
"item",
"(",
"if",
"any",
")",
"emitted",
"by",
"the",
"source",
"ObservableSource",
"within",
"periodic",
"time",
"intervals",
".",
"<p",
">",
"<img",
"width",
"=",
"640",... | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/Observable.java#L11269-L11273 | test | Sample a sequence of tokens from the source source. | Of course, here is the Java code you requested:
```java
@CheckReturnValue
@SchedulerSupport(SchedulerSupport.COMPUTATION)
public final Observable<T> sample(long period, TimeUnit unit) {
return sample(period, unit, Schedulers.computation());
}
```
Hope this helps! |
ngageoint/geopackage-android | geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java | GeometryMetadataDataSource.getBoundingBox | public BoundingBox getBoundingBox(String geoPackage, String tableName) {
return getBoundingBox(getGeoPackageId(geoPackage), tableName);
} | java | public BoundingBox getBoundingBox(String geoPackage, String tableName) {
return getBoundingBox(getGeoPackageId(geoPackage), tableName);
} | [
"public",
"BoundingBox",
"getBoundingBox",
"(",
"String",
"geoPackage",
",",
"String",
"tableName",
")",
"{",
"return",
"getBoundingBox",
"(",
"getGeoPackageId",
"(",
"geoPackage",
")",
",",
"tableName",
")",
";",
"}"
] | Query for the bounds of the feature table index
@param geoPackage GeoPackage name
@param tableName table name
@return bounding box
@since 3.1.0 | [
"Query",
"for",
"the",
"bounds",
"of",
"the",
"feature",
"table",
"index"
] | d19e9fcc636462c0f0ae1b7eca4acafae48de21b | https://github.com/ngageoint/geopackage-android/blob/d19e9fcc636462c0f0ae1b7eca4acafae48de21b/geopackage-sdk/src/main/java/mil/nga/geopackage/db/metadata/GeometryMetadataDataSource.java#L387-L389 | test | Get the bounding box of the table | Of course, here is the Java code you requested:
```java
public BoundingBox getBoundingBox(String geoPackage, String tableName) {
return getBoundingBox(getGeoPackageId(geoPackage), tableName);
}
```
Hope this helps! |
nyla-solutions/gedi-geode | gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GemFireJmxClient.java | GemFireJmxClient.listGatewayReceivers | public static Collection<GatewayReceiverMXBean> listGatewayReceivers(JMX jmx)
throws Exception
{
DistributedSystemMXBean system = jmx.newBean(DistributedSystemMXBean.class,
new ObjectName("GemFire:service=System,type=Distributed"));
ObjectName[] objectNames = system.listGatewayReceiverObject... | java | public static Collection<GatewayReceiverMXBean> listGatewayReceivers(JMX jmx)
throws Exception
{
DistributedSystemMXBean system = jmx.newBean(DistributedSystemMXBean.class,
new ObjectName("GemFire:service=System,type=Distributed"));
ObjectName[] objectNames = system.listGatewayReceiverObject... | [
"public",
"static",
"Collection",
"<",
"GatewayReceiverMXBean",
">",
"listGatewayReceivers",
"(",
"JMX",
"jmx",
")",
"throws",
"Exception",
"{",
"DistributedSystemMXBean",
"system",
"=",
"jmx",
".",
"newBean",
"(",
"DistributedSystemMXBean",
".",
"class",
",",
"new"... | -------------------------------------------------------- | [
"--------------------------------------------------------"
] | 3dd71d6e66e941ce350b306b70677ee95a7d9eee | https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/GemFireJmxClient.java#L629-L652 | test | List the GatewayReceivers. | Of course, here is the Java code you requested:
```java
public static Collection<GatewayReceiverMXBean> listGatewayReceivers(JMX jmx)
throws Exception
{
DistributedSystemMXBean system = jmx.newBean(DistributedSystemMXBean.class,
new ObjectName("GemFire:service=System,type=Distributed"));
Obj... |
wildfly/wildfly | security/subsystem/src/main/java/org/jboss/as/security/context/SecurityDomainJndiInjectable.java | SecurityDomainJndiInjectable.invoke | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Context ctx = new InitialContext();
NameParser parser = ctx.getNameParser("");
String securityDomain = null;
Name name = null;
final JNDIBasedSecurityManagement securityManagement = JNDIBasedSecu... | java | public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Context ctx = new InitialContext();
NameParser parser = ctx.getNameParser("");
String securityDomain = null;
Name name = null;
final JNDIBasedSecurityManagement securityManagement = JNDIBasedSecu... | [
"public",
"Object",
"invoke",
"(",
"Object",
"proxy",
",",
"Method",
"method",
",",
"Object",
"[",
"]",
"args",
")",
"throws",
"Throwable",
"{",
"Context",
"ctx",
"=",
"new",
"InitialContext",
"(",
")",
";",
"NameParser",
"parser",
"=",
"ctx",
".",
"getN... | This is the InvocationHandler callback for the Context interface that was created by our getObjectInstance() method. We
handle the java:jboss/jaas/domain level operations here. | [
"This",
"is",
"the",
"InvocationHandler",
"callback",
"for",
"the",
"Context",
"interface",
"that",
"was",
"created",
"by",
"our",
"getObjectInstance",
"()",
"method",
".",
"We",
"handle",
"the",
"java",
":",
"jboss",
"/",
"jaas",
"/",
"domain",
"level",
"op... | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/security/subsystem/src/main/java/org/jboss/as/security/context/SecurityDomainJndiInjectable.java#L103-L145 | test | This method is invoked by the SecurityDomainContextHandler. | Of course, here is the Java code you requested:
```java
public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {
Context ctx = new InitialContext();
NameParser parser = ctx.getNameParser("");
String securityDomain = null;
Name name = null;
final JNDIB... |
rupertlssmith/lojix | lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingJavaMachine.java | WAMResolvingJavaMachine.getMemoryLayout | public WAMMemoryLayout getMemoryLayout()
{
return new WAMMemoryLayout(0, REG_SIZE, HEAP_BASE, HEAP_SIZE, STACK_BASE, STACK_SIZE, TRAIL_BASE, TRAIL_SIZE,
TOP - PDL_SIZE, PDL_SIZE);
} | java | public WAMMemoryLayout getMemoryLayout()
{
return new WAMMemoryLayout(0, REG_SIZE, HEAP_BASE, HEAP_SIZE, STACK_BASE, STACK_SIZE, TRAIL_BASE, TRAIL_SIZE,
TOP - PDL_SIZE, PDL_SIZE);
} | [
"public",
"WAMMemoryLayout",
"getMemoryLayout",
"(",
")",
"{",
"return",
"new",
"WAMMemoryLayout",
"(",
"0",
",",
"REG_SIZE",
",",
"HEAP_BASE",
",",
"HEAP_SIZE",
",",
"STACK_BASE",
",",
"STACK_SIZE",
",",
"TRAIL_BASE",
",",
"TRAIL_SIZE",
",",
"TOP",
"-",
"PDL_... | {@inheritDoc} | [
"{"
] | ad494dc8bce2345567de7689d42291d4b30fbd51 | https://github.com/rupertlssmith/lojix/blob/ad494dc8bce2345567de7689d42291d4b30fbd51/lojix/wam_prolog/src/main/com/thesett/aima/logic/fol/wam/machine/WAMResolvingJavaMachine.java#L335-L339 | test | Get the memory layout for the WAM | Of course, here is the Java code you requested:
```java
public WAMMemoryLayout getMemoryLayout()
{
return new WAMMemoryLayout(0, REG_SIZE, HEAP_BASE, HEAP_SIZE, STACK_BASE, STACK_SIZE, TRAIL_BASE, TRAIL_SIZE,
TOP - PDL_SIZE, PDL_SIZE);
}
```
Hope this helps! |
orientechnologies/orientdb | core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java | OSessionStoragePerformanceStatistic.stopCommitTimer | public void stopCommitTimer() {
final long endTs = nanoTimer.getNano();
final long timeDiff = (endTs - timeStamps.pop());
performanceCountersHolder.commitTime += timeDiff;
performanceCountersHolder.commitCount++;
makeSnapshotIfNeeded(endTs);
} | java | public void stopCommitTimer() {
final long endTs = nanoTimer.getNano();
final long timeDiff = (endTs - timeStamps.pop());
performanceCountersHolder.commitTime += timeDiff;
performanceCountersHolder.commitCount++;
makeSnapshotIfNeeded(endTs);
} | [
"public",
"void",
"stopCommitTimer",
"(",
")",
"{",
"final",
"long",
"endTs",
"=",
"nanoTimer",
".",
"getNano",
"(",
")",
";",
"final",
"long",
"timeDiff",
"=",
"(",
"endTs",
"-",
"timeStamps",
".",
"pop",
"(",
")",
")",
";",
"performanceCountersHolder",
... | Stops and records results of timer which counts how much time was spent on atomic operation commit. | [
"Stops",
"and",
"records",
"results",
"of",
"timer",
"which",
"counts",
"how",
"much",
"time",
"was",
"spent",
"on",
"atomic",
"operation",
"commit",
"."
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/core/src/main/java/com/orientechnologies/orient/core/storage/impl/local/statistic/OSessionStoragePerformanceStatistic.java#L1092-L1100 | test | Stop commit timer. | Of course, here is the Java code you requested:
```java
public void stopCommitTimer() {
final long endTs = nanoTimer.getNano();
final long timeDiff = (endTs - timeStamps.pop());
performanceCountersHolder.commitTime += timeDiff;
performanceCountersHolder.commitCount++;
makeSnapshotIfNeeded(endTs);... |
Unidata/thredds | waterml/src/main/java/ucar/nc2/ogc/waterml/NcCollectionType.java | NcCollectionType.initCollection | public static CollectionType initCollection(CollectionType collection, FeatureDatasetPoint fdPoint,
List<VariableSimpleIF> dataVars) throws IOException {
// @gml:id
String id = MarshallingUtil.createIdForType(CollectionType.class);
collection.setId(id);
// wml2:metadata
... | java | public static CollectionType initCollection(CollectionType collection, FeatureDatasetPoint fdPoint,
List<VariableSimpleIF> dataVars) throws IOException {
// @gml:id
String id = MarshallingUtil.createIdForType(CollectionType.class);
collection.setId(id);
// wml2:metadata
... | [
"public",
"static",
"CollectionType",
"initCollection",
"(",
"CollectionType",
"collection",
",",
"FeatureDatasetPoint",
"fdPoint",
",",
"List",
"<",
"VariableSimpleIF",
">",
"dataVars",
")",
"throws",
"IOException",
"{",
"// @gml:id",
"String",
"id",
"=",
"Marshallin... | wml2:Collection | [
"wml2",
":",
"Collection"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/waterml/src/main/java/ucar/nc2/ogc/waterml/NcCollectionType.java#L22-L50 | test | Initialize a collection object. | Of course, here is the Java code you requested:
```java
public static CollectionType initCollection(CollectionType collection, FeatureDatasetPoint fdPoint,
List<VariableSimpleIF> dataVars) throws IOException {
// @gml:id
String id = MarshallingUtil.createIdForType(CollectionType.class);
... |
trung/InMemoryJavaCompiler | src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java | InMemoryJavaCompiler.compileAll | public Map<String, Class<?>> compileAll() throws Exception {
if (sourceCodes.size() == 0) {
throw new CompilationException("No source code to compile");
}
Collection<SourceCode> compilationUnits = sourceCodes.values();
CompiledCode[] code;
code = new CompiledCode[compilationUnits.size()];
Iterator<Sourc... | java | public Map<String, Class<?>> compileAll() throws Exception {
if (sourceCodes.size() == 0) {
throw new CompilationException("No source code to compile");
}
Collection<SourceCode> compilationUnits = sourceCodes.values();
CompiledCode[] code;
code = new CompiledCode[compilationUnits.size()];
Iterator<Sourc... | [
"public",
"Map",
"<",
"String",
",",
"Class",
"<",
"?",
">",
">",
"compileAll",
"(",
")",
"throws",
"Exception",
"{",
"if",
"(",
"sourceCodes",
".",
"size",
"(",
")",
"==",
"0",
")",
"{",
"throw",
"new",
"CompilationException",
"(",
"\"No source code to ... | Compile all sources
@return Map containing instances of all compiled classes
@throws Exception | [
"Compile",
"all",
"sources"
] | d84c404975dc308ee5a418c5af8a6629c5e6c995 | https://github.com/trung/InMemoryJavaCompiler/blob/d84c404975dc308ee5a418c5af8a6629c5e6c995/src/main/java/org/mdkt/compiler/InMemoryJavaCompiler.java#L67-L115 | test | Compiles all the source code to classes. | Of course, here is the Java code you requested:
```java
public Map<String, Class<?>> compileAll() throws Exception {
if (sourceCodes.size() == 0) {
throw new CompilationException("No source code to compile");
}
Collection<SourceCode> compilationUnits = sourceCodes.values();
CompiledCode[] code;
code = ne... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoUtils.java | OpenImmoUtils.createDocument | public static OpenImmoDocument createDocument(Document doc) {
if (OpenImmoTransferDocument.isReadable(doc))
return new OpenImmoTransferDocument(doc);
else if (OpenImmoFeedbackDocument.isReadable(doc))
return new OpenImmoFeedbackDocument(doc);
else
return null;... | java | public static OpenImmoDocument createDocument(Document doc) {
if (OpenImmoTransferDocument.isReadable(doc))
return new OpenImmoTransferDocument(doc);
else if (OpenImmoFeedbackDocument.isReadable(doc))
return new OpenImmoFeedbackDocument(doc);
else
return null;... | [
"public",
"static",
"OpenImmoDocument",
"createDocument",
"(",
"Document",
"doc",
")",
"{",
"if",
"(",
"OpenImmoTransferDocument",
".",
"isReadable",
"(",
"doc",
")",
")",
"return",
"new",
"OpenImmoTransferDocument",
"(",
"doc",
")",
";",
"else",
"if",
"(",
"O... | Creates a {@link OpenImmoDocument} from a {@link Document}.
@param doc XML document
@return created document or null, of the document is not supported by this format | [
"Creates",
"a",
"{",
"@link",
"OpenImmoDocument",
"}",
"from",
"a",
"{",
"@link",
"Document",
"}",
"."
] | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/OpenImmoUtils.java#L136-L143 | test | Create an OpenImmoDocument from a Document. | Of course, here is the Java code you requested:
```java
public static OpenImmoDocument createDocument(Document doc) {
if (OpenImmoTransferDocument.isReadable(doc))
return new OpenImmoTransferDocument(doc);
else if (OpenImmoFeedbackDocument.isReadable(doc))
return new OpenImmoFee... |
lessthanoptimal/GeoRegression | main/src/georegression/fitting/line/FitLine_I32.java | FitLine_I32.polar | public static LinePolar2D_F32 polar(List<Point2D_I32> points , int start , int length , LinePolar2D_F32 ret ) {
if( ret == null )
ret = new LinePolar2D_F32();
int sumX = 0;
int sumY = 0;
final int N = length;
for( int i = 0; i < N; i++ ) {
Point2D_I32 p = points.get(start+i);
sumX += p.x;
sumY +... | java | public static LinePolar2D_F32 polar(List<Point2D_I32> points , int start , int length , LinePolar2D_F32 ret ) {
if( ret == null )
ret = new LinePolar2D_F32();
int sumX = 0;
int sumY = 0;
final int N = length;
for( int i = 0; i < N; i++ ) {
Point2D_I32 p = points.get(start+i);
sumX += p.x;
sumY +... | [
"public",
"static",
"LinePolar2D_F32",
"polar",
"(",
"List",
"<",
"Point2D_I32",
">",
"points",
",",
"int",
"start",
",",
"int",
"length",
",",
"LinePolar2D_F32",
"ret",
")",
"{",
"if",
"(",
"ret",
"==",
"null",
")",
"ret",
"=",
"new",
"LinePolar2D_F32",
... | <p>
Computes the unweighted best fit line to the set of points using the polar line equation. The solution
is optimal in the Euclidean sense, see [1] for more details.
</p>
<p>
[1] K. Arras, R. Siegwart, "Feature Extraction and Scene Interpretation for Map-Based Navigation
and Map Building" Proc. SPIE, Mobile Robotics... | [
"<p",
">",
"Computes",
"the",
"unweighted",
"best",
"fit",
"line",
"to",
"the",
"set",
"of",
"points",
"using",
"the",
"polar",
"line",
"equation",
".",
"The",
"solution",
"is",
"optimal",
"in",
"the",
"Euclidean",
"sense",
"see",
"[",
"1",
"]",
"for",
... | c067cd44a4e95bd826119f6e658bd82386ef289f | https://github.com/lessthanoptimal/GeoRegression/blob/c067cd44a4e95bd826119f6e658bd82386ef289f/main/src/georegression/fitting/line/FitLine_I32.java#L49-L81 | test | Returns the line polar of the given list of points. | Of course, here is the Java code you requested:
```java
public static LinePolar2D_F32 polar(List<Point2D_I32> points , int start , int length , LinePolar2D_F32 ret ) {
if( ret == null )
ret = new LinePolar2D_F32();
int sumX = 0;
int sumY = 0;
final int N = length;
for( int i = 0; i < N; i++ ) {
Point... |
orientechnologies/orientdb | distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODistributedMessageServiceImpl.java | ODistributedMessageServiceImpl.dispatchResponseToThread | public void dispatchResponseToThread(final ODistributedResponse response) {
try {
final long msgId = response.getRequestId().getMessageId();
// GET ASYNCHRONOUS MSG MANAGER IF ANY
final ODistributedResponseManager asynchMgr = responsesByRequestIds.get(msgId);
if (asynchMgr == null) {
... | java | public void dispatchResponseToThread(final ODistributedResponse response) {
try {
final long msgId = response.getRequestId().getMessageId();
// GET ASYNCHRONOUS MSG MANAGER IF ANY
final ODistributedResponseManager asynchMgr = responsesByRequestIds.get(msgId);
if (asynchMgr == null) {
... | [
"public",
"void",
"dispatchResponseToThread",
"(",
"final",
"ODistributedResponse",
"response",
")",
"{",
"try",
"{",
"final",
"long",
"msgId",
"=",
"response",
".",
"getRequestId",
"(",
")",
".",
"getMessageId",
"(",
")",
";",
"// GET ASYNCHRONOUS MSG MANAGER IF AN... | Not synchronized, it's called when a message arrives | [
"Not",
"synchronized",
"it",
"s",
"called",
"when",
"a",
"message",
"arrives"
] | d970b12033f0462f0239ea0ad8ed41207e6e26f1 | https://github.com/orientechnologies/orientdb/blob/d970b12033f0462f0239ea0ad8ed41207e6e26f1/distributed/src/main/java/com/orientechnologies/orient/server/distributed/impl/ODistributedMessageServiceImpl.java#L186-L209 | test | Dispatches a response to the thread. | Of course, here is the Java code you requested:
```java
public void dispatchResponseToThread(final ODistributedResponse response) {
try {
final long msgId = response.getRequestId().getMessageId();
// GET ASYNCHRONOUS MSG MANAGER IF ANY
final ODistributedResponseManager asynchMgr = responsesByReq... |
OpenEstate/OpenEstate-IO | ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java | ObjectFactory.createGesamtflaeche | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "gesamtflaeche")
@XmlJavaTypeAdapter(Adapter7 .class)
public JAXBElement<BigDecimal> createGesamtflaeche(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Gesamtflaeche_QNAME, BigDecimal.class, null, value);
} | java | @XmlElementDecl(namespace = "http://www.immoxml.de", name = "gesamtflaeche")
@XmlJavaTypeAdapter(Adapter7 .class)
public JAXBElement<BigDecimal> createGesamtflaeche(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Gesamtflaeche_QNAME, BigDecimal.class, null, value);
} | [
"@",
"XmlElementDecl",
"(",
"namespace",
"=",
"\"http://www.immoxml.de\"",
",",
"name",
"=",
"\"gesamtflaeche\"",
")",
"@",
"XmlJavaTypeAdapter",
"(",
"Adapter7",
".",
"class",
")",
"public",
"JAXBElement",
"<",
"BigDecimal",
">",
"createGesamtflaeche",
"(",
"BigDec... | 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/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/ObjectFactory.java#L1429-L1433 | test | Create an instance of a Gesamtflaeche type. | Of course, here is the Java code you requested:
```java
@XmlElementDecl(namespace = "http://www.immoxml.de", name = "gesamtflaeche")
@XmlJavaTypeAdapter(Adapter7 .class)
public JAXBElement<BigDecimal> createGesamtflaeche(BigDecimal value) {
return new JAXBElement<BigDecimal>(_Gesamtflaeche_QNAME, BigDe... |
wavesplatform/WavesJ | src/main/java/com/wavesplatform/wavesj/Node.java | Node.getAddressTransactions | public List<Transaction> getAddressTransactions(String address, int limit, String after) throws IOException {
String requestUrl = String.format("/transactions/address/%s/limit/%d", address, limit);
if (after != null) {
requestUrl += String.format("?after=%s", after);
}
return... | java | public List<Transaction> getAddressTransactions(String address, int limit, String after) throws IOException {
String requestUrl = String.format("/transactions/address/%s/limit/%d", address, limit);
if (after != null) {
requestUrl += String.format("?after=%s", after);
}
return... | [
"public",
"List",
"<",
"Transaction",
">",
"getAddressTransactions",
"(",
"String",
"address",
",",
"int",
"limit",
",",
"String",
"after",
")",
"throws",
"IOException",
"{",
"String",
"requestUrl",
"=",
"String",
".",
"format",
"(",
"\"/transactions/address/%s/li... | Returns transactions by address with limit after passed transaction id.
@param address address
@param limit transactions limit
@param after separate transaction id
@return list of transactions
@throws IOException if something going wrong | [
"Returns",
"transactions",
"by",
"address",
"with",
"limit",
"after",
"passed",
"transaction",
"id",
"."
] | ae13a61c4e780b608c30a86e45c9a811549e11dd | https://github.com/wavesplatform/WavesJ/blob/ae13a61c4e780b608c30a86e45c9a811549e11dd/src/main/java/com/wavesplatform/wavesj/Node.java#L191-L197 | test | Get a list of transactions for a given address | Of course, here is the Java code you requested:
```java
public List<Transaction> getAddressTransactions(String address, int limit, String after) throws IOException {
String requestUrl = String.format("/transactions/address/%s/limit/%d", address, limit);
if (after != null) {
requestUrl += St... |
alipay/sofa-bolt | src/main/java/com/alipay/remoting/rpc/RpcResponseResolver.java | RpcResponseResolver.toResponseObject | private static Object toResponseObject(ResponseCommand responseCommand) throws CodecException {
RpcResponseCommand response = (RpcResponseCommand) responseCommand;
response.deserialize();
return response.getResponseObject();
} | java | private static Object toResponseObject(ResponseCommand responseCommand) throws CodecException {
RpcResponseCommand response = (RpcResponseCommand) responseCommand;
response.deserialize();
return response.getResponseObject();
} | [
"private",
"static",
"Object",
"toResponseObject",
"(",
"ResponseCommand",
"responseCommand",
")",
"throws",
"CodecException",
"{",
"RpcResponseCommand",
"response",
"=",
"(",
"RpcResponseCommand",
")",
"responseCommand",
";",
"response",
".",
"deserialize",
"(",
")",
... | Convert remoting response command to application response object. | [
"Convert",
"remoting",
"response",
"command",
"to",
"application",
"response",
"object",
"."
] | 0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046 | https://github.com/alipay/sofa-bolt/blob/0ad7b46b2649bfc4e2ecc1f5e1c1f935d179c046/src/main/java/com/alipay/remoting/rpc/RpcResponseResolver.java#L141-L145 | test | Converts a response command to a response object. | Of course, here is the Java code you requested:
```java
private static Object toResponseObject(ResponseCommand responseCommand) throws CodecException {
RpcResponseCommand response = (RpcResponseCommand) responseCommand;
response.deserialize();
return response.getResponseObject();
}
```
Hop... |
oblac/jodd | jodd-core/src/main/java/jodd/util/ArraysUtil.java | ArraysUtil.values | public static byte[] values(Byte[] array) {
byte[] dest = new byte[array.length];
for (int i = 0; i < array.length; i++) {
Byte v = array[i];
if (v != null) {
dest[i] = v.byteValue();
}
}
return dest;
} | java | public static byte[] values(Byte[] array) {
byte[] dest = new byte[array.length];
for (int i = 0; i < array.length; i++) {
Byte v = array[i];
if (v != null) {
dest[i] = v.byteValue();
}
}
return dest;
} | [
"public",
"static",
"byte",
"[",
"]",
"values",
"(",
"Byte",
"[",
"]",
"array",
")",
"{",
"byte",
"[",
"]",
"dest",
"=",
"new",
"byte",
"[",
"array",
".",
"length",
"]",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"array",
".",
"len... | Converts to primitive array. | [
"Converts",
"to",
"primitive",
"array",
"."
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/ArraysUtil.java#L1126-L1135 | test | Get the values of the byte array. | Of course, here is the Java code you requested:
```java
public static byte[] values(Byte[] array) {
byte[] dest = new byte[array.length];
for (int i = 0; i < array.length; i++) {
Byte v = array[i];
if (v != null) {
dest[i] = v.byteValue();
}
}
return dest;
}
```
Hope this helps! |
Unidata/thredds | cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java | CalendarPeriod.getValueInMillisecs | public double getValueInMillisecs() {
if (field == CalendarPeriod.Field.Month)
return 30.0 * 24.0 * 60.0 * 60.0 * 1000.0 * value;
else if (field == CalendarPeriod.Field.Year)
return 365.0 * 24.0 * 60.0 * 60.0 * 1000.0 * value;
else return millisecs();
} | java | public double getValueInMillisecs() {
if (field == CalendarPeriod.Field.Month)
return 30.0 * 24.0 * 60.0 * 60.0 * 1000.0 * value;
else if (field == CalendarPeriod.Field.Year)
return 365.0 * 24.0 * 60.0 * 60.0 * 1000.0 * value;
else return millisecs();
} | [
"public",
"double",
"getValueInMillisecs",
"(",
")",
"{",
"if",
"(",
"field",
"==",
"CalendarPeriod",
".",
"Field",
".",
"Month",
")",
"return",
"30.0",
"*",
"24.0",
"*",
"60.0",
"*",
"60.0",
"*",
"1000.0",
"*",
"value",
";",
"else",
"if",
"(",
"field"... | Get the duration in milliseconds -+
@return the duration in seconds
@deprecated dont use because these are fixed length and thus approximate. | [
"Get",
"the",
"duration",
"in",
"milliseconds",
"-",
"+"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/time/CalendarPeriod.java#L195-L201 | test | Gets the value in milliseconds. | Of course, here is the Java code you requested:
```java
public double getValueInMillisecs() {
if (field == CalendarPeriod.Field.Month)
return 30.0 * 24.0 * 60.0 * 60.0 * 1000.0 * value;
else if (field == CalendarPeriod.Field.Year)
return 365.0 * 24.0 * 60.0 * 60.0 * 1000.0 * value;
el... |
blademainer/common_utils | common_helper/src/main/java/com/xiongyingqi/util/xml/StaxUtils.java | StaxUtils.getXMLEventReader | public static XMLEventReader getXMLEventReader(Source source) {
if (source instanceof StAXSource) {
return ((StAXSource) source).getXMLEventReader();
} else if (source instanceof StaxSource) {
return ((StaxSource) source).getXMLEventReader();
} else {
throw ne... | java | public static XMLEventReader getXMLEventReader(Source source) {
if (source instanceof StAXSource) {
return ((StAXSource) source).getXMLEventReader();
} else if (source instanceof StaxSource) {
return ((StaxSource) source).getXMLEventReader();
} else {
throw ne... | [
"public",
"static",
"XMLEventReader",
"getXMLEventReader",
"(",
"Source",
"source",
")",
"{",
"if",
"(",
"source",
"instanceof",
"StAXSource",
")",
"{",
"return",
"(",
"(",
"StAXSource",
")",
"source",
")",
".",
"getXMLEventReader",
"(",
")",
";",
"}",
"else... | Return the {@link javax.xml.stream.XMLEventReader} for the given StAX Source.
@param source a JAXP 1.4 {@link javax.xml.transform.stax.StAXSource}
@return the {@link javax.xml.stream.XMLEventReader}
@throws IllegalArgumentException if {@code source} isn't a JAXP 1.4 {@link javax.xml.transform.stax.StAXSource}
or custo... | [
"Return",
"the",
"{",
"@link",
"javax",
".",
"xml",
".",
"stream",
".",
"XMLEventReader",
"}",
"for",
"the",
"given",
"StAX",
"Source",
"."
] | ef6baf0367c16de95a28caab67a7d5842a6d13db | https://github.com/blademainer/common_utils/blob/ef6baf0367c16de95a28caab67a7d5842a6d13db/common_helper/src/main/java/com/xiongyingqi/util/xml/StaxUtils.java#L117-L125 | test | Get an instance of the XMLEventReader class from a Source object. | Of course, here is the Java code you requested:
```java
public static XMLEventReader getXMLEventReader(Source source) {
if (source instanceof StAXSource) {
return ((StAXSource) source).getXMLEventReader();
} else if (source instanceof StaxSource) {
return ((StaxSource) source).g... |
TooTallNate/Java-WebSocket | src/main/java/org/java_websocket/client/WebSocketClient.java | WebSocketClient.onWebsocketClose | @Override
public final void onWebsocketClose( WebSocket conn, int code, String reason, boolean remote ) {
stopConnectionLostTimer();
if( writeThread != null )
writeThread.interrupt();
onClose( code, reason, remote );
connectLatch.countDown();
closeLatch.countDown();
} | java | @Override
public final void onWebsocketClose( WebSocket conn, int code, String reason, boolean remote ) {
stopConnectionLostTimer();
if( writeThread != null )
writeThread.interrupt();
onClose( code, reason, remote );
connectLatch.countDown();
closeLatch.countDown();
} | [
"@",
"Override",
"public",
"final",
"void",
"onWebsocketClose",
"(",
"WebSocket",
"conn",
",",
"int",
"code",
",",
"String",
"reason",
",",
"boolean",
"remote",
")",
"{",
"stopConnectionLostTimer",
"(",
")",
";",
"if",
"(",
"writeThread",
"!=",
"null",
")",
... | Calls subclass' implementation of <var>onClose</var>. | [
"Calls",
"subclass",
"implementation",
"of",
"<var",
">",
"onClose<",
"/",
"var",
">",
"."
] | 73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9 | https://github.com/TooTallNate/Java-WebSocket/blob/73c6805ca2c7801b2828ffd3ec12e5cb0daefcf9/src/main/java/org/java_websocket/client/WebSocketClient.java#L561-L569 | test | Called when a websocket connection is closed. | Of course, here is the Java code you requested:
```java
@Override
public final void onWebsocketClose( WebSocket conn, int code, String reason, boolean remote ) {
stopConnectionLostTimer();
if( writeThread != null )
writeThread.interrupt();
onClose( code, reason, remote );
connectLatch.countDown();
closeL... |
workplacesystems/utilsj | src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java | TransactionalBidiTreeMap.leastNode | private Node<K,V> leastNode(final Node<K,V> node, final int index) {
Node<K,V> lval = node;
if (lval != null) {
while (lval.getLeft(index) != null) {
lval = lval.getLeft(index);
}
}
return lval;
} | java | private Node<K,V> leastNode(final Node<K,V> node, final int index) {
Node<K,V> lval = node;
if (lval != null) {
while (lval.getLeft(index) != null) {
lval = lval.getLeft(index);
}
}
return lval;
} | [
"private",
"Node",
"<",
"K",
",",
"V",
">",
"leastNode",
"(",
"final",
"Node",
"<",
"K",
",",
"V",
">",
"node",
",",
"final",
"int",
"index",
")",
"{",
"Node",
"<",
"K",
",",
"V",
">",
"lval",
"=",
"node",
";",
"if",
"(",
"lval",
"!=",
"null"... | find the least node from a given node. very useful for starting
a sorting iterator ...
@param node the node from which we will start searching
@param index KEY or VALUE
@return the smallest node, from the specified node, in the
specified mapping | [
"find",
"the",
"least",
"node",
"from",
"a",
"given",
"node",
".",
"very",
"useful",
"for",
"starting",
"a",
"sorting",
"iterator",
"..."
] | 1b638be51997eafac4d368c14f62a16624a08d3e | https://github.com/workplacesystems/utilsj/blob/1b638be51997eafac4d368c14f62a16624a08d3e/src/main/java/com/workplacesystems/utilsj/collections/TransactionalBidiTreeMap.java#L1022-L1033 | test | Gets the least node from the list of nodes. | Of course, here is the Java code you requested:
```java
private Node<K,V> leastNode(final Node<K,V> node, final int index) {
Node<K,V> lval = node;
if (lval != null) {
while (lval.getLeft(index) != null) {
lval = lval.getLeft(index);
}
}
... |
sikuli/sikuli-slides | src/main/java/org/sikuli/slides/api/Slides.java | Slides.interpret | public static List<Action> interpret(File file) throws IOException {
checkNotNull(file);
Interpreter interpreter = new DefaultInterpreter();
SlidesReader reader = new PPTXSlidesReader();
List<Slide> slides;
slides = reader.read(file);
List<Action> actions = Lists.newArrayList();
for (Slide slide : slide... | java | public static List<Action> interpret(File file) throws IOException {
checkNotNull(file);
Interpreter interpreter = new DefaultInterpreter();
SlidesReader reader = new PPTXSlidesReader();
List<Slide> slides;
slides = reader.read(file);
List<Action> actions = Lists.newArrayList();
for (Slide slide : slide... | [
"public",
"static",
"List",
"<",
"Action",
">",
"interpret",
"(",
"File",
"file",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"file",
")",
";",
"Interpreter",
"interpreter",
"=",
"new",
"DefaultInterpreter",
"(",
")",
";",
"SlidesReader",
"reader",... | Interpret a presentation file as a list of executable actions
@param file the presentation file
@return a list of {@link Action}
@throws IOException | [
"Interpret",
"a",
"presentation",
"file",
"as",
"a",
"list",
"of",
"executable",
"actions"
] | 1a4a82cd97f577e0d7abe4218bf702e053acf003 | https://github.com/sikuli/sikuli-slides/blob/1a4a82cd97f577e0d7abe4218bf702e053acf003/src/main/java/org/sikuli/slides/api/Slides.java#L106-L119 | test | Interprets the specified file. | Of course, here is the Java code you requested:
```java
public static List<Action> interpret(File file) throws IOException {
checkNotNull(file);
Interpreter interpreter = new DefaultInterpreter();
SlidesReader reader = new PPTXSlidesReader();
List<Slide> slides;
slides = reader.read(file);
List<Action> a... |
kiegroup/droolsjbpm-tools | drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/EntityTag.java | EntityTag.generateEntityTag | public static EntityTag generateEntityTag() {
String xx = basetime + ":" + Integer.toHexString(Thread.currentThread().hashCode()); //$NON-NLS-1$
bcnt++;
xx += ":" + bcnt; //$NON-NLS-1$
return new EntityTag(xx);
} | java | public static EntityTag generateEntityTag() {
String xx = basetime + ":" + Integer.toHexString(Thread.currentThread().hashCode()); //$NON-NLS-1$
bcnt++;
xx += ":" + bcnt; //$NON-NLS-1$
return new EntityTag(xx);
} | [
"public",
"static",
"EntityTag",
"generateEntityTag",
"(",
")",
"{",
"String",
"xx",
"=",
"basetime",
"+",
"\":\"",
"+",
"Integer",
".",
"toHexString",
"(",
"Thread",
".",
"currentThread",
"(",
")",
".",
"hashCode",
"(",
")",
")",
";",
"//$NON-NLS-1$",
"bc... | Construct a unique EntityTag. The tag is constructed by concatening the
current time with the current thread's hash code.
@return a unique entity tag that servers may use for any purpose | [
"Construct",
"a",
"unique",
"EntityTag",
".",
"The",
"tag",
"is",
"constructed",
"by",
"concatening",
"the",
"current",
"time",
"with",
"the",
"current",
"thread",
"s",
"hash",
"code",
"."
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/kernel/org/eclipse/webdav/internal/kernel/EntityTag.java#L98-L103 | test | Generate a new EntityTag. | Of course, here is the Java code you requested:
```java
public static EntityTag generateEntityTag() {
String xx = basetime + ":" + Integer.toHexString(Thread.currentThread().hashCode()); //$NON-NLS-1$
bcnt++;
xx += ":" + bcnt; //$NON-NLS-1$
return new EntityTag(xx);
}
```
Hope this... |
wildfly/wildfly | jpa/hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/management/QueryName.java | QueryName.subst | private static void subst(final StringBuilder stringBuilder, final String from, final String to) {
int begin = 0, end = 0;
while ((end = stringBuilder.indexOf(from, end)) != -1) {
stringBuilder.delete(end, end + from.length());
stringBuilder.insert(end, to);
// upda... | java | private static void subst(final StringBuilder stringBuilder, final String from, final String to) {
int begin = 0, end = 0;
while ((end = stringBuilder.indexOf(from, end)) != -1) {
stringBuilder.delete(end, end + from.length());
stringBuilder.insert(end, to);
// upda... | [
"private",
"static",
"void",
"subst",
"(",
"final",
"StringBuilder",
"stringBuilder",
",",
"final",
"String",
"from",
",",
"final",
"String",
"to",
")",
"{",
"int",
"begin",
"=",
"0",
",",
"end",
"=",
"0",
";",
"while",
"(",
"(",
"end",
"=",
"stringBui... | Substitute sub-strings inside of a string.
@param stringBuilder String buffer to use for substitution (buffer is not reset)
@param from String to substitute from
@param to String to substitute to | [
"Substitute",
"sub",
"-",
"strings",
"inside",
"of",
"a",
"string",
"."
] | 64896f1500fe465ad83d96ede9fa19d0c3747f18 | https://github.com/wildfly/wildfly/blob/64896f1500fe465ad83d96ede9fa19d0c3747f18/jpa/hibernate4_3/src/main/java/org/jboss/as/jpa/hibernate4/management/QueryName.java#L207-L218 | test | Subst a string from a string builder to a string to. | Of course, here is the Java code you requested:
```java
private static void subst(final StringBuilder stringBuilder, final String from, final String to) {
int begin = 0, end = 0;
while ((end = stringBuilder.indexOf(from, end)) != -1) {
stringBuilder.delete(end, end + from.length());
... |
boonproject/boon | boon/src/main/java/org/boon/collections/LongList.java | LongList.add | public LongList add(long integer) {
if (end + 1 >= values.length) {
values = grow(values);
}
values[end] = integer;
end++;
return this;
} | java | public LongList add(long integer) {
if (end + 1 >= values.length) {
values = grow(values);
}
values[end] = integer;
end++;
return this;
} | [
"public",
"LongList",
"add",
"(",
"long",
"integer",
")",
"{",
"if",
"(",
"end",
"+",
"1",
">=",
"values",
".",
"length",
")",
"{",
"values",
"=",
"grow",
"(",
"values",
")",
";",
"}",
"values",
"[",
"end",
"]",
"=",
"integer",
";",
"end",
"++",
... | Add a new value to the list but don't employ a wrapper.
@param integer new value
@return was able to add. | [
"Add",
"a",
"new",
"value",
"to",
"the",
"list",
"but",
"don",
"t",
"employ",
"a",
"wrapper",
"."
] | 9bc6870dbe5dd58c45c18d8edb493e8efc089463 | https://github.com/boonproject/boon/blob/9bc6870dbe5dd58c45c18d8edb493e8efc089463/boon/src/main/java/org/boon/collections/LongList.java#L184-L191 | test | Add a new entry to the set. | Of course, here is the Java code you requested:
```java
public LongList add(long integer) {
if (end + 1 >= values.length) {
values = grow(values);
}
values[end] = integer;
end++;
return this;
}
```
Hope this helps! |
intellimate/IzouSDK | src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/Player.java | Player.renderFinalOutput | @Override
public void renderFinalOutput(List<T> data, EventModel eventModel) {
if (StartMusicRequest.verify(eventModel, capabilities, this, activators)) {
if (isOutputRunning()) {
playerError(PlayerError.ERROR_ALREADY_PLAYING, eventModel.getSource());
} else {
... | java | @Override
public void renderFinalOutput(List<T> data, EventModel eventModel) {
if (StartMusicRequest.verify(eventModel, capabilities, this, activators)) {
if (isOutputRunning()) {
playerError(PlayerError.ERROR_ALREADY_PLAYING, eventModel.getSource());
} else {
... | [
"@",
"Override",
"public",
"void",
"renderFinalOutput",
"(",
"List",
"<",
"T",
">",
"data",
",",
"EventModel",
"eventModel",
")",
"{",
"if",
"(",
"StartMusicRequest",
".",
"verify",
"(",
"eventModel",
",",
"capabilities",
",",
"this",
",",
"activators",
")",... | method that uses the data from the OutputExtensions to generate a final output that will then be rendered.
@param data the data generated
@param eventModel the Event which caused the whole thing | [
"method",
"that",
"uses",
"the",
"data",
"from",
"the",
"OutputExtensions",
"to",
"generate",
"a",
"final",
"output",
"that",
"will",
"then",
"be",
"rendered",
"."
] | bc8705ad48a6ca12a722f2b787be435949fa5d08 | https://github.com/intellimate/IzouSDK/blob/bc8705ad48a6ca12a722f2b787be435949fa5d08/src/main/java/org/intellimate/izou/sdk/frameworks/music/player/template/Player.java#L449-L470 | test | Render the final output of the music. | Of course, here is the Java code you requested:
```java
@Override
public void renderFinalOutput(List<T> data, EventModel eventModel) {
if (StartMusicRequest.verify(eventModel, capabilities, this, activators)) {
if (isOutputRunning()) {
playerError(PlayerError.ERROR_ALREADY_PLAYI... |
MagicTheGathering/mtg-sdk-java | src/main/java/io/magicthegathering/javasdk/api/SetAPI.java | SetAPI.getAllSets | public static List<MtgSet> getAllSets(List<String> filters){
return getList(RESOURCE_PATH, "sets", MtgSet.class, filters);
} | java | public static List<MtgSet> getAllSets(List<String> filters){
return getList(RESOURCE_PATH, "sets", MtgSet.class, filters);
} | [
"public",
"static",
"List",
"<",
"MtgSet",
">",
"getAllSets",
"(",
"List",
"<",
"String",
">",
"filters",
")",
"{",
"return",
"getList",
"(",
"RESOURCE_PATH",
",",
"\"sets\"",
",",
"MtgSet",
".",
"class",
",",
"filters",
")",
";",
"}"
] | Gets a list of {@link MtgSet} based on the provided filters in the
<a href="https://docs.magicthegathering.io/#sets">web API documentation.</a>
@param filters List of string filters
@return The list of {@link MtgSet}s that was found by the filter. | [
"Gets",
"a",
"list",
"of",
"{"
] | 2fce7d14155c07d41ec2830d56308287ae4646d9 | https://github.com/MagicTheGathering/mtg-sdk-java/blob/2fce7d14155c07d41ec2830d56308287ae4646d9/src/main/java/io/magicthegathering/javasdk/api/SetAPI.java#L58-L60 | test | Returns all sets matching the criteria specified in the passed in filters. | Of course, here is the Java code you requested:
```java
public static List<MtgSet> getAllSets(List<String> filters){
return getList(RESOURCE_PATH, "sets", MtgSet.class, filters);
}
```
Hope this helps! |
kiegroup/droolsjbpm-tools | drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java | DSLTree.printNode | protected void printNode(Node n) {
printTabs(n.getDepth());
System.out.println("- \"" + n.getToken() + "\"");
for (Node c : n.getChildren()) {
printNode(c);
}
} | java | protected void printNode(Node n) {
printTabs(n.getDepth());
System.out.println("- \"" + n.getToken() + "\"");
for (Node c : n.getChildren()) {
printNode(c);
}
} | [
"protected",
"void",
"printNode",
"(",
"Node",
"n",
")",
"{",
"printTabs",
"(",
"n",
".",
"getDepth",
"(",
")",
")",
";",
"System",
".",
"out",
".",
"println",
"(",
"\"- \\\"\"",
"+",
"n",
".",
"getToken",
"(",
")",
"+",
"\"\\\"\"",
")",
";",
"for"... | method will print the node and then iterate over the children
@param n | [
"method",
"will",
"print",
"the",
"node",
"and",
"then",
"iterate",
"over",
"the",
"children"
] | 05e1f73c591178360a198dca29f99d73918991db | https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.drools.eclipse/src/main/java/org/drools/eclipse/editors/completion/DSLTree.java#L502-L508 | test | Prints a node to stdout. | Of course, here is the Java code you requested:
```java
protected void printNode(Node n) {
printTabs(n.getDepth());
System.out.println("- \"" + n.getToken() + "\"");
for (Node c : n.getChildren()) {
printNode(c);
}
}
```
Hope this helps! |
spring-projects/spring-security | config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterComparator.java | FilterComparator.registerAfter | public void registerAfter(Class<? extends Filter> filter,
Class<? extends Filter> afterFilter) {
Integer position = getOrder(afterFilter);
if (position == null) {
throw new IllegalArgumentException(
"Cannot register after unregistered Filter " + afterFilter);
}
put(filter, position + 1);
} | java | public void registerAfter(Class<? extends Filter> filter,
Class<? extends Filter> afterFilter) {
Integer position = getOrder(afterFilter);
if (position == null) {
throw new IllegalArgumentException(
"Cannot register after unregistered Filter " + afterFilter);
}
put(filter, position + 1);
} | [
"public",
"void",
"registerAfter",
"(",
"Class",
"<",
"?",
"extends",
"Filter",
">",
"filter",
",",
"Class",
"<",
"?",
"extends",
"Filter",
">",
"afterFilter",
")",
"{",
"Integer",
"position",
"=",
"getOrder",
"(",
"afterFilter",
")",
";",
"if",
"(",
"po... | Registers a {@link Filter} to exist after a particular {@link Filter} that is
already registered.
@param filter the {@link Filter} to register
@param afterFilter the {@link Filter} that is already registered and that
{@code filter} should be placed after. | [
"Registers",
"a",
"{"
] | 98a8467e4c2ae05b3e09c67ece856944fa48ed23 | https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/config/src/main/java/org/springframework/security/config/annotation/web/builders/FilterComparator.java#L131-L140 | test | Register a Filter after a given Filter. | Of course, here is the Java code you requested:
```java
public void registerAfter(Class<? extends Filter> filter,
Class<? extends Filter> afterFilter) {
Integer position = getOrder(afterFilter);
if (position == null) {
throw new IllegalArgumentException(
"Cannot register after unregistered Filter " + af... |
braintree/braintree_android | Braintree/src/main/java/com/braintreepayments/api/AmericanExpress.java | AmericanExpress.getRewardsBalance | public static void getRewardsBalance(final BraintreeFragment fragment, final String nonce,
final String currencyIsoCode) {
fragment.waitForConfiguration(new ConfigurationListener() {
@Override
public void onConfigurationFetched(Configuration configuration) {
S... | java | public static void getRewardsBalance(final BraintreeFragment fragment, final String nonce,
final String currencyIsoCode) {
fragment.waitForConfiguration(new ConfigurationListener() {
@Override
public void onConfigurationFetched(Configuration configuration) {
S... | [
"public",
"static",
"void",
"getRewardsBalance",
"(",
"final",
"BraintreeFragment",
"fragment",
",",
"final",
"String",
"nonce",
",",
"final",
"String",
"currencyIsoCode",
")",
"{",
"fragment",
".",
"waitForConfiguration",
"(",
"new",
"ConfigurationListener",
"(",
"... | Gets the rewards balance associated with a Braintree nonce. Only for American Express cards.
@param fragment the {@link BraintreeFragment} This fragment will also be responsible
for handling callbacks to it's listeners
@param nonce A nonce representing a card that will be used to look up the rewards balance
@param cur... | [
"Gets",
"the",
"rewards",
"balance",
"associated",
"with",
"a",
"Braintree",
"nonce",
".",
"Only",
"for",
"American",
"Express",
"cards",
"."
] | 07b32e6fad73f9fb8432971b0e79fc8c94b11873 | https://github.com/braintree/braintree_android/blob/07b32e6fad73f9fb8432971b0e79fc8c94b11873/Braintree/src/main/java/com/braintreepayments/api/AmericanExpress.java#L28-L61 | test | Get the AMS XChange Rewards Balance information. | Of course, here is the Java code you requested:
```java
public static void getRewardsBalance(final BraintreeFragment fragment, final String nonce,
final String currencyIsoCode) {
fragment.waitForConfiguration(new ConfigurationListener() {
@Override
public void onConfiguratio... |
Unidata/thredds | cdm/src/main/java/ucar/nc2/dt/grid/GridDatasetInfo.java | GridDatasetInfo.writeCoordTransform | private Element writeCoordTransform(CoordinateTransform ct) {
Element ctElem = new Element("coordTransform");
ctElem.setAttribute("name", ct.getName());
ctElem.setAttribute("transformType", ct.getTransformType().toString());
for (Parameter param : ct.getParameters()) {
Element pElem = new Element("param... | java | private Element writeCoordTransform(CoordinateTransform ct) {
Element ctElem = new Element("coordTransform");
ctElem.setAttribute("name", ct.getName());
ctElem.setAttribute("transformType", ct.getTransformType().toString());
for (Parameter param : ct.getParameters()) {
Element pElem = new Element("param... | [
"private",
"Element",
"writeCoordTransform",
"(",
"CoordinateTransform",
"ct",
")",
"{",
"Element",
"ctElem",
"=",
"new",
"Element",
"(",
"\"coordTransform\"",
")",
";",
"ctElem",
".",
"setAttribute",
"(",
"\"name\"",
",",
"ct",
".",
"getName",
"(",
")",
")",
... | /* private Element writeCoordSys(GridCoordSystem cs) {
Element csElem = new Element("coordSys");
csElem.setAttribute("name", cs.getName());
List axes = cs.getCoordinateAxes();
for (int i = 0; i < axes.size(); i++) {
CoordinateAxis axis = (CoordinateAxis) axes.get(i);
Element axisElem = new Element("axisRef");
axisElem.... | [
"/",
"*",
"private",
"Element",
"writeCoordSys",
"(",
"GridCoordSystem",
"cs",
")",
"{",
"Element",
"csElem",
"=",
"new",
"Element",
"(",
"coordSys",
")",
";",
"csElem",
".",
"setAttribute",
"(",
"name",
"cs",
".",
"getName",
"()",
")",
";",
"List",
"axe... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/dt/grid/GridDatasetInfo.java#L571-L582 | test | Write the coordTransform element. | Of course, here is the Java code you requested:
```java
private Element writeCoordTransform(CoordinateTransform ct) {
Element ctElem = new Element("coordTransform");
ctElem.setAttribute("name", ct.getName());
ctElem.setAttribute("transformType", ct.getTransformType().toString());
for (Parameter param : ct.... |
Unidata/thredds | legacy/src/main/java/thredds/catalog/crawl/CatalogCrawler.java | CatalogCrawler.crawl | public int crawl(String catUrl, CancelTask task, PrintWriter out, Object context) {
InvCatalogFactory catFactory = InvCatalogFactory.getDefaultFactory(true);
InvCatalogImpl cat = catFactory.readXML(catUrl);
StringBuilder buff = new StringBuilder();
boolean isValid = cat.check(buff, false);
if (out ... | java | public int crawl(String catUrl, CancelTask task, PrintWriter out, Object context) {
InvCatalogFactory catFactory = InvCatalogFactory.getDefaultFactory(true);
InvCatalogImpl cat = catFactory.readXML(catUrl);
StringBuilder buff = new StringBuilder();
boolean isValid = cat.check(buff, false);
if (out ... | [
"public",
"int",
"crawl",
"(",
"String",
"catUrl",
",",
"CancelTask",
"task",
",",
"PrintWriter",
"out",
",",
"Object",
"context",
")",
"{",
"InvCatalogFactory",
"catFactory",
"=",
"InvCatalogFactory",
".",
"getDefaultFactory",
"(",
"true",
")",
";",
"InvCatalog... | Open a catalog and crawl (depth first) all the datasets in it.
Close catalogs and release their resources as you.
@param catUrl url of catalog to open
@param task user can cancel the task (may be null)
@param out send status messages to here (may be null)
@param context caller can pass this object in (used for th... | [
"Open",
"a",
"catalog",
"and",
"crawl",
"(",
"depth",
"first",
")",
"all",
"the",
"datasets",
"in",
"it",
".",
"Close",
"catalogs",
"and",
"release",
"their",
"resources",
"as",
"you",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/legacy/src/main/java/thredds/catalog/crawl/CatalogCrawler.java#L102-L115 | test | Crawl the catalog XML file. | Of course, here is the Java code you requested:
```java
public int crawl(String catUrl, CancelTask task, PrintWriter out, Object context) {
InvCatalogFactory catFactory = InvCatalogFactory.getDefaultFactory(true);
InvCatalogImpl cat = catFactory.readXML(catUrl);
StringBuilder buff = new StringBuilder();
... |
Unidata/thredds | opendap/src/main/java/opendap/dap/DGrid.java | DGrid.cloneDAG | public DAPNode cloneDAG(CloneMap map)
throws CloneNotSupportedException
{
DGrid g = (DGrid) super.cloneDAG(map);
g.arrayVar = (DArray) cloneDAG(map,arrayVar);
g.mapVars = new Vector();
for (int i = 0; i < mapVars.size(); i++) {
BaseType bt = (BaseType) mapV... | java | public DAPNode cloneDAG(CloneMap map)
throws CloneNotSupportedException
{
DGrid g = (DGrid) super.cloneDAG(map);
g.arrayVar = (DArray) cloneDAG(map,arrayVar);
g.mapVars = new Vector();
for (int i = 0; i < mapVars.size(); i++) {
BaseType bt = (BaseType) mapV... | [
"public",
"DAPNode",
"cloneDAG",
"(",
"CloneMap",
"map",
")",
"throws",
"CloneNotSupportedException",
"{",
"DGrid",
"g",
"=",
"(",
"DGrid",
")",
"super",
".",
"cloneDAG",
"(",
"map",
")",
";",
"g",
".",
"arrayVar",
"=",
"(",
"DArray",
")",
"cloneDAG",
"(... | Returns a clone of this <code>DGrid</code>.
See DAPNode.cloneDag()
@param map track previously cloned nodes
@return a clone of this object. | [
"Returns",
"a",
"clone",
"of",
"this",
"<code",
">",
"DGrid<",
"/",
"code",
">",
".",
"See",
"DAPNode",
".",
"cloneDag",
"()"
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/opendap/src/main/java/opendap/dap/DGrid.java#L633-L645 | test | Clone the DAG. | Of course, here is the Java code you requested:
```java
public DAPNode cloneDAG(CloneMap map)
throws CloneNotSupportedException
{
DGrid g = (DGrid) super.cloneDAG(map);
g.arrayVar = (DArray) cloneDAG(map,arrayVar);
g.mapVars = new Vector();
for (int i = 0; i < mapVars.... |
Koekiebox-PTY-LTD/Fluid | fluid-api/src/main/java/com/fluidbpm/program/api/vo/sqlutil/sqlnative/SQLRow.java | SQLRow.toJsonObject | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//SQL Columns...
if(this.getSqlColumns() != null)
{
JSONArray jsonArray = new JSONArray();
for(SQLColumn toAdd : this.getSqlColumns())
... | java | @Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//SQL Columns...
if(this.getSqlColumns() != null)
{
JSONArray jsonArray = new JSONArray();
for(SQLColumn toAdd : this.getSqlColumns())
... | [
"@",
"Override",
"public",
"JSONObject",
"toJsonObject",
"(",
")",
"throws",
"JSONException",
"{",
"JSONObject",
"returnVal",
"=",
"super",
".",
"toJsonObject",
"(",
")",
";",
"//SQL Columns...",
"if",
"(",
"this",
".",
"getSqlColumns",
"(",
")",
"!=",
"null",... | Conversion to {@code JSONObject} from Java Object.
@return {@code JSONObject} representation of {@code UserQuery}
@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/sqlutil/sqlnative/SQLRow.java#L101-L120 | test | Returns the JSONObject representation of the object. | Of course, here is the Java code you requested:
```java
@Override
public JSONObject toJsonObject() throws JSONException {
JSONObject returnVal = super.toJsonObject();
//SQL Columns...
if(this.getSqlColumns() != null)
{
JSONArray jsonArray = new JSONArray();
... |
OpenEstate/OpenEstate-IO | OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_7.java | OpenImmo_1_2_7.downgradeEnergiepassElements | protected void downgradeEnergiepassElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass",
doc).selectNodes(doc);
for (Object item : nodes) {
Element node = (Elem... | java | protected void downgradeEnergiepassElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass",
doc).selectNodes(doc);
for (Object item : nodes) {
Element node = (Elem... | [
"protected",
"void",
"downgradeEnergiepassElements",
"(",
"Document",
"doc",
")",
"throws",
"JaxenException",
"{",
"List",
"nodes",
"=",
"XmlUtils",
".",
"newXPath",
"(",
"\"/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass\"",
",",
"doc",
")",
".",
... | Downgrade <energiepass> elements to OpenImmo 1.2.6.
<p>
The child elements <stromwert>, <waermewert>,
<wertklasse>, <baujahr>, <ausstelldatum>,
<jahrgang>, <gebaeudeart> are copied into separate
<user_defined_simplefield> elements as it was
<a href="http://www.openi... | [
"Downgrade",
"<",
";",
"energiepass>",
";",
"elements",
"to",
"OpenImmo",
"1",
".",
"2",
".",
"6",
".",
"<p",
">",
"The",
"child",
"elements",
"<",
";",
"stromwert>",
";",
"<",
";",
"waermewert>",
";",
"<",
";",
"wertklasse>",
";",
"<",... | f961dae78f40823f05a8c0d4e59d639e718aa18a | https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/OpenImmo/src/main/java/org/openestate/io/openimmo/converters/OpenImmo_1_2_7.java#L221-L358 | test | Downgrade energiepass elements to user defined simplefields. | Of course, here is the Java code you requested:
```java
protected void downgradeEnergiepassElements(Document doc) throws JaxenException {
List nodes = XmlUtils.newXPath(
"/io:openimmo/io:anbieter/io:immobilie/io:zustand_angaben/io:energiepass",
doc).selectNodes(doc);
for... |
jcodec/jcodec | src/main/java/org/jcodec/containers/mkv/MKVParser.java | MKVParser.readEbmlId | static public byte[] readEbmlId(SeekableByteChannel source) throws IOException {
if (source.position() == source.size())
return null;
ByteBuffer buffer = ByteBuffer.allocate(8);
buffer.limit(1);
source.read(buffer);
buffer.flip();
byte firstByte = bu... | java | static public byte[] readEbmlId(SeekableByteChannel source) throws IOException {
if (source.position() == source.size())
return null;
ByteBuffer buffer = ByteBuffer.allocate(8);
buffer.limit(1);
source.read(buffer);
buffer.flip();
byte firstByte = bu... | [
"static",
"public",
"byte",
"[",
"]",
"readEbmlId",
"(",
"SeekableByteChannel",
"source",
")",
"throws",
"IOException",
"{",
"if",
"(",
"source",
".",
"position",
"(",
")",
"==",
"source",
".",
"size",
"(",
")",
")",
"return",
"null",
";",
"ByteBuffer",
... | Reads an EBML id from the channel. EBML ids have length encoded inside of them For instance, all one-byte ids have first byte set to '1', like 0xA3 or 0xE7, whereas the two-byte ids have first
byte set to '0' and second byte set to '1', thus: 0x42 0x86 or 0x42 0xF7
@return byte array filled with the ebml id
@throws I... | [
"Reads",
"an",
"EBML",
"id",
"from",
"the",
"channel",
".",
"EBML",
"ids",
"have",
"length",
"encoded",
"inside",
"of",
"them",
"For",
"instance",
"all",
"one",
"-",
"byte",
"ids",
"have",
"first",
"byte",
"set",
"to",
"1",
"like",
"0xA3",
"or",
"0xE7"... | cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75 | https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/src/main/java/org/jcodec/containers/mkv/MKVParser.java#L150-L174 | test | Read the EBML id from the specified channel. | Of course, here is the Java code you requested:
```java
static public byte[] readEbmlId(SeekableByteChannel source) throws IOException {
if (source.position() == source.size())
return null;
ByteBuffer buffer = ByteBuffer.allocate(8);
buffer.limit(1);
source.read(buffer)... |
ReactiveX/RxJava | src/main/java/io/reactivex/plugins/RxJavaPlugins.java | RxJavaPlugins.onSchedule | @NonNull
public static Runnable onSchedule(@NonNull Runnable run) {
ObjectHelper.requireNonNull(run, "run is null");
Function<? super Runnable, ? extends Runnable> f = onScheduleHandler;
if (f == null) {
return run;
}
return apply(f, run);
} | java | @NonNull
public static Runnable onSchedule(@NonNull Runnable run) {
ObjectHelper.requireNonNull(run, "run is null");
Function<? super Runnable, ? extends Runnable> f = onScheduleHandler;
if (f == null) {
return run;
}
return apply(f, run);
} | [
"@",
"NonNull",
"public",
"static",
"Runnable",
"onSchedule",
"(",
"@",
"NonNull",
"Runnable",
"run",
")",
"{",
"ObjectHelper",
".",
"requireNonNull",
"(",
"run",
",",
"\"run is null\"",
")",
";",
"Function",
"<",
"?",
"super",
"Runnable",
",",
"?",
"extends... | Called when a task is scheduled.
@param run the runnable instance
@return the replacement runnable | [
"Called",
"when",
"a",
"task",
"is",
"scheduled",
"."
] | ac84182aa2bd866b53e01c8e3fe99683b882c60e | https://github.com/ReactiveX/RxJava/blob/ac84182aa2bd866b53e01c8e3fe99683b882c60e/src/main/java/io/reactivex/plugins/RxJavaPlugins.java#L465-L474 | test | On schedule. | Of course, here is the Java code you requested:
```java
@NonNull
public static Runnable onSchedule(@NonNull Runnable run) {
ObjectHelper.requireNonNull(run, "run is null");
Function<? super Runnable, ? extends Runnable> f = onScheduleHandler;
if (f == null) {
return run;
... |
Koekiebox-PTY-LTD/Fluid | fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/sqlutil/sqlnative/SQLUtilWebSocketExecuteNativeSQLClient.java | SQLUtilWebSocketExecuteNativeSQLClient.executeNativeSQLSynchronized | public List<SQLResultSet> executeNativeSQLSynchronized(
NativeSQLQuery nativeSQLQueryParam) {
if(nativeSQLQueryParam == null)
{
return null;
}
if(nativeSQLQueryParam.getDatasourceName() == null ||
nativeSQLQueryParam.getDatasourceName().isEmpty()... | java | public List<SQLResultSet> executeNativeSQLSynchronized(
NativeSQLQuery nativeSQLQueryParam) {
if(nativeSQLQueryParam == null)
{
return null;
}
if(nativeSQLQueryParam.getDatasourceName() == null ||
nativeSQLQueryParam.getDatasourceName().isEmpty()... | [
"public",
"List",
"<",
"SQLResultSet",
">",
"executeNativeSQLSynchronized",
"(",
"NativeSQLQuery",
"nativeSQLQueryParam",
")",
"{",
"if",
"(",
"nativeSQLQueryParam",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"nativeSQLQueryParam",
".",
"getDat... | Executes a native SQL query on the remote Fluid instance.
The relevant access must exist.
@param nativeSQLQueryParam The SQL Query to execute.
@return The SQL Execution result as {@code SQLResultSet}'s.
@throws FluidClientException if data-source name is not set. | [
"Executes",
"a",
"native",
"SQL",
"query",
"on",
"the",
"remote",
"Fluid",
"instance",
"."
] | 81153d865f71b84ca933532c7115717bc3979270 | https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-ws-java-client/src/main/java/com/fluidbpm/ws/client/v1/sqlutil/sqlnative/SQLUtilWebSocketExecuteNativeSQLClient.java#L117-L207 | test | Execute Native SQL synchronized. | Of course, here is the Java code you requested:
```java
public List<SQLResultSet> executeNativeSQLSynchronized(
NativeSQLQuery nativeSQLQueryParam) {
if(nativeSQLQueryParam == null)
{
return null;
}
if(nativeSQLQueryParam.getDatasourceName() == null ||
... |
rockagen/commons-lib | src/main/java/com/rockagen/commons/util/JsonUtil.java | JsonUtil.getMapper | public static ObjectMapper getMapper() {
ObjectMapper mapper = threadMapper.get();
if (mapper == null) {
mapper = initMapper();
threadMapper.set(mapper);
}
return mapper;
} | java | public static ObjectMapper getMapper() {
ObjectMapper mapper = threadMapper.get();
if (mapper == null) {
mapper = initMapper();
threadMapper.set(mapper);
}
return mapper;
} | [
"public",
"static",
"ObjectMapper",
"getMapper",
"(",
")",
"{",
"ObjectMapper",
"mapper",
"=",
"threadMapper",
".",
"get",
"(",
")",
";",
"if",
"(",
"mapper",
"==",
"null",
")",
"{",
"mapper",
"=",
"initMapper",
"(",
")",
";",
"threadMapper",
".",
"set",... | return a ObjectMapper if exist,else new ObjectMapper
@return ObjectMapper | [
"return",
"a",
"ObjectMapper",
"if",
"exist",
"else",
"new",
"ObjectMapper"
] | f37141cf40be79d130db804c39ce61690541d5f1 | https://github.com/rockagen/commons-lib/blob/f37141cf40be79d130db804c39ce61690541d5f1/src/main/java/com/rockagen/commons/util/JsonUtil.java#L79-L88 | test | Get the ObjectMapper instance. | Of course, here is the Java code you requested:
```java
public static ObjectMapper getMapper() {
ObjectMapper mapper = threadMapper.get();
if (mapper == null) {
mapper = initMapper();
threadMapper.set(mapper);
}
return mapper;
}
```
Hope this helps! |
oblac/jodd | jodd-db/src/main/java/jodd/db/type/SqlDateSqlType.java | SqlDateSqlType.get | @Override
public Date get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException {
return rs.getDate(index);
} | java | @Override
public Date get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException {
return rs.getDate(index);
} | [
"@",
"Override",
"public",
"Date",
"get",
"(",
"final",
"ResultSet",
"rs",
",",
"final",
"int",
"index",
",",
"final",
"int",
"dbSqlType",
")",
"throws",
"SQLException",
"{",
"return",
"rs",
".",
"getDate",
"(",
"index",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | 85ad7f813ec0e07ecd27042aeb47ff2047631fa5 | https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-db/src/main/java/jodd/db/type/SqlDateSqlType.java#L38-L41 | test | Override this method to return a java. sql. Date object. | Of course, here is the Java code you requested:
```java
@Override
public Date get(final ResultSet rs, final int index, final int dbSqlType) throws SQLException {
return rs.getDate(index);
}
```
Hope this helps! |
streamsets/datacollector | jdbc-protolib/src/main/java/com/streamsets/pipeline/stage/processor/jdbctee/JdbcTeeProcessor.java | JdbcTeeProcessor.process | @Override
public void process(Batch batch, SingleLaneBatchMaker batchMaker) throws StageException {
if (!batch.getRecords().hasNext()) {
// No records - take the opportunity to clean up the cache so that we don't hold on to memory indefinitely
cacheCleaner.periodicCleanUp();
}
boolean perReco... | java | @Override
public void process(Batch batch, SingleLaneBatchMaker batchMaker) throws StageException {
if (!batch.getRecords().hasNext()) {
// No records - take the opportunity to clean up the cache so that we don't hold on to memory indefinitely
cacheCleaner.periodicCleanUp();
}
boolean perReco... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"Batch",
"batch",
",",
"SingleLaneBatchMaker",
"batchMaker",
")",
"throws",
"StageException",
"{",
"if",
"(",
"!",
"batch",
".",
"getRecords",
"(",
")",
".",
"hasNext",
"(",
")",
")",
"{",
"// No records - t... | {@inheritDoc} | [
"{"
] | ea63245ea14d59d5229248387f0628f46131eae5 | https://github.com/streamsets/datacollector/blob/ea63245ea14d59d5229248387f0628f46131eae5/jdbc-protolib/src/main/java/com/streamsets/pipeline/stage/processor/jdbctee/JdbcTeeProcessor.java#L208-L240 | test | Override the process method to write the records in the batch. | Of course, here is the Java code you requested:
```java
@Override
public void process(Batch batch, SingleLaneBatchMaker batchMaker) throws StageException {
if (!batch.getRecords().hasNext()) {
// No records - take the opportunity to clean up the cache so that we don't hold on to memory indefinitely
c... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.