repo stringlengths 7 59 | path stringlengths 3 222 | func_name stringlengths 3 127 | original_string stringlengths 0 466k | language stringclasses 1
value | code stringlengths 0 466k | code_tokens listlengths 0 68.3k | docstring stringlengths 0 21.3k | docstring_tokens listlengths 0 1.93k | sha stringlengths 0 40 | url stringlengths 0 339 | partition stringclasses 3
values | summary stringlengths 0 250 | instruction stringlengths 38 3.13k | input stringclasses 1
value | output stringlengths 146 466k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunkblock/ChunkBlockHandler.java | ChunkBlockHandler.addCoord | private void addCoord(Chunk chunk, BlockPos pos)
{
chunks(chunk).add(chunk, pos);
} | java | private void addCoord(Chunk chunk, BlockPos pos)
{
chunks(chunk).add(chunk, pos);
} | [
"private",
"void",
"addCoord",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"pos",
")",
"{",
"chunks",
"(",
"chunk",
")",
".",
"add",
"(",
"chunk",
",",
"pos",
")",
";",
"}"
] | Adds a coordinate for the specified {@link Chunk}.
@param chunk the chunk
@param pos the pos | [
"Adds",
"a",
"coordinate",
"for",
"the",
"specified",
"{",
"@link",
"Chunk",
"}",
"."
] | 4f8e1fa462d5c372fc23414482ba9f429881cc54 | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunkblock/ChunkBlockHandler.java#L159-L162 | train | Add a coordinate to the chunk list. | Create a Java method that does the following: "Add a coordinate to the chunk list.". | Of course, here is the Java code you requested:
```java
private void addCoord(Chunk chunk, BlockPos pos)
{
chunks(chunk).add(chunk, pos);
}
```
Hope this helps! | |
raydac/netbeans-mmd-plugin | mind-map/scia-reto/src/main/java/com/igormaznitsa/sciareto/ui/editors/mmeditors/NoteEditor.java | NoteEditor.updateWrapping | private void updateWrapping() {
this.editorPane.setWrapStyleWord(this.wrapping != Wrapping.CHAR_WRAP);
this.editorPane.setLineWrap(this.wrapping != Wrapping.NONE);
updateBottomPanel();
} | java | private void updateWrapping() {
this.editorPane.setWrapStyleWord(this.wrapping != Wrapping.CHAR_WRAP);
this.editorPane.setLineWrap(this.wrapping != Wrapping.NONE);
updateBottomPanel();
} | [
"private",
"void",
"updateWrapping",
"(",
")",
"{",
"this",
".",
"editorPane",
".",
"setWrapStyleWord",
"(",
"this",
".",
"wrapping",
"!=",
"Wrapping",
".",
"CHAR_WRAP",
")",
";",
"this",
".",
"editorPane",
".",
"setLineWrap",
"(",
"this",
".",
"wrapping",
... | GEN-LAST:event_labelWrapModeMouseClicked | [
"GEN",
"-",
"LAST",
":",
"event_labelWrapModeMouseClicked"
] | 997493d23556a25354372b6419a64a0fbd0ac6ba | https://github.com/raydac/netbeans-mmd-plugin/blob/997493d23556a25354372b6419a64a0fbd0ac6ba/mind-map/scia-reto/src/main/java/com/igormaznitsa/sciareto/ui/editors/mmeditors/NoteEditor.java#L543-L547 | train | Update the wrapping settings. | Create a Java method that does the following: "Update the wrapping settings.". | Of course, here is the Java code you requested:
```java
private void updateWrapping() {
this.editorPane.setWrapStyleWord(this.wrapping != Wrapping.CHAR_WRAP);
this.editorPane.setLineWrap(this.wrapping != Wrapping.NONE);
updateBottomPanel();
}
```
Hope this helps! | |
eiichiro/acidhouse | acidhouse-api/src/main/java/org/eiichiro/acidhouse/Aggregations.java | Aggregations.max | public static <T extends Comparable<T>> Aggregation<T> max(Property<?, T> property) {
return new Max<T>(property);
} | java | public static <T extends Comparable<T>> Aggregation<T> max(Property<?, T> property) {
return new Max<T>(property);
} | [
"public",
"static",
"<",
"T",
"extends",
"Comparable",
"<",
"T",
">",
">",
"Aggregation",
"<",
"T",
">",
"max",
"(",
"Property",
"<",
"?",
",",
"T",
">",
"property",
")",
"{",
"return",
"new",
"Max",
"<",
"T",
">",
"(",
"property",
")",
";",
"}"
... | Get the max aggregation implementation for the specified property.
@param <T> The property value type that this max aggregation aggregates.
@param property The metamodel property that this max aggregation
aggregates.
@return Max aggregation implementation for the specified property. | [
"Get",
"the",
"max",
"aggregation",
"implementation",
"for",
"the",
"specified",
"property",
"."
] | c50eaa0bb0f24abb46def4afa611f170637cdd62 | https://github.com/eiichiro/acidhouse/blob/c50eaa0bb0f24abb46def4afa611f170637cdd62/acidhouse-api/src/main/java/org/eiichiro/acidhouse/Aggregations.java#L64-L66 | train | Get max aggregation. | Create a Java method that does the following: "Get max aggregation.". | Of course, here is the Java code you requested:
```java
public static <T extends Comparable<T>> Aggregation<T> max(Property<?, T> property) {
return new Max<T>(property);
}
```
Hope this helps! | |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/api/MetadataApiService.java | MetadataApiService.addToken | @Post("/metadata/{projectName}/tokens")
public CompletableFuture<Revision> addToken(@Param("projectName") String projectName,
IdentifierWithRole request,
Author author) {
final ProjectRole role = toProjectRole(re... | java | @Post("/metadata/{projectName}/tokens")
public CompletableFuture<Revision> addToken(@Param("projectName") String projectName,
IdentifierWithRole request,
Author author) {
final ProjectRole role = toProjectRole(re... | [
"@",
"Post",
"(",
"\"/metadata/{projectName}/tokens\"",
")",
"public",
"CompletableFuture",
"<",
"Revision",
">",
"addToken",
"(",
"@",
"Param",
"(",
"\"projectName\"",
")",
"String",
"projectName",
",",
"IdentifierWithRole",
"request",
",",
"Author",
"author",
")",... | POST /metadata/{projectName}/tokens
<p>Adds a {@link Token} to the specified {@code projectName}. | [
"POST",
"/",
"metadata",
"/",
"{",
"projectName",
"}",
"/",
"tokens"
] | b9e46c67fbc26628c2186ce2f46e7fb303c831e9 | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/api/MetadataApiService.java#L126-L133 | train | Add a token to a project. | Create a Java method that does the following: "Add a token to a project.". | Of course, here is the Java code you requested:
```java
@Post("/metadata/{projectName}/tokens")
public CompletableFuture<Revision> addToken(@Param("projectName") String projectName,
IdentifierWithRole request,
Author au... | |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/graph/SparseDirectedGraph.java | SparseDirectedGraph.predecessors | public IntSet predecessors(int vertex) {
IntSet preds = new TroveIntSet();
for (DirectedEdge e : inEdges(vertex))
preds.add(e.from());
return preds;
}
/**
* {@inheritDoc}
*/
public DirectedGraph subgraph(Set<Integer> vertices) {
Graph<DirectedEdge> subg... | java | public IntSet predecessors(int vertex) {
IntSet preds = new TroveIntSet();
for (DirectedEdge e : inEdges(vertex))
preds.add(e.from());
return preds;
}
/**
* {@inheritDoc}
*/
public DirectedGraph subgraph(Set<Integer> vertices) {
Graph<DirectedEdge> subg... | [
"public",
"IntSet",
"predecessors",
"(",
"int",
"vertex",
")",
"{",
"IntSet",
"preds",
"=",
"new",
"TroveIntSet",
"(",
")",
";",
"for",
"(",
"DirectedEdge",
"e",
":",
"inEdges",
"(",
"vertex",
")",
")",
"preds",
".",
"(",
"e",
".",
"from",
"(",
")",
... | {@inheritDoc} | [
"{"
] | a608102737dfd3d59038a9ead33fe60356bc6029 | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/graph/SparseDirectedGraph.java#L148-L382 | train | Returns the set of predecessors of the given vertex. | Create a Java method that does the following: "Returns the set of predecessors of the given vertex.". | Of course, here is the Java code you requested:
```java
public IntSet predecessors(int vertex) {
IntSet preds = new TroveIntSet();
for (DirectedEdge e : inEdges(vertex))
preds.add(e.from());
return preds;
}
/**
* {@inheritDoc}
*/
public DirectedGraph subgraph(... | |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java | SARLOperationHelper.isPurableOperation | boolean isPurableOperation(XtendFunction operation, ISideEffectContext context) {
if (isUnpureOperationPrototype(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForNotPureOperation(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForPureOperation(operation)) {
retur... | java | boolean isPurableOperation(XtendFunction operation, ISideEffectContext context) {
if (isUnpureOperationPrototype(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForNotPureOperation(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForPureOperation(operation)) {
retur... | [
"boolean",
"isPurableOperation",
"(",
"XtendFunction",
"operation",
",",
"ISideEffectContext",
"context",
")",
"{",
"if",
"(",
"isUnpureOperationPrototype",
"(",
"operation",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"this",
".",
"nameValidator",
".... | Replies if the given is purable in the given context.
@param operation the operation to test.
@param context the context.
@return {@code true} if the operation could be marked as pure. | [
"Replies",
"if",
"the",
"given",
"is",
"purable",
"in",
"the",
"given",
"context",
"."
] | ca00ff994598c730339972def4e19a60e0b8cace | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/typesystem/SARLOperationHelper.java#L178-L195 | train | Replies if the given operation is pure. | Create a Java method that does the following: "Replies if the given operation is pure.". | Of course, here is the Java code you requested:
```java
boolean isPurableOperation(XtendFunction operation, ISideEffectContext context) {
if (isUnpureOperationPrototype(operation)) {
return false;
}
if (this.nameValidator.isNamePatternForNotPureOperation(operation)) {
return false;
}
if (this.nameValid... | |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/resolvers/ResourceReferenceResolver.java | ResourceReferenceResolver.getName | private static String getName(final String resourceName, final String fallBackName)
{
return resourceName.length() > 0 ? resourceName : fallBackName;
} | java | private static String getName(final String resourceName, final String fallBackName)
{
return resourceName.length() > 0 ? resourceName : fallBackName;
} | [
"private",
"static",
"String",
"getName",
"(",
"final",
"String",
"resourceName",
",",
"final",
"String",
"fallBackName",
")",
"{",
"return",
"resourceName",
".",
"length",
"(",
")",
">",
"0",
"?",
"resourceName",
":",
"fallBackName",
";",
"}"
] | Returns JNDI resource name.
@param resourceName to use if specified
@param fallBackName fall back bean name otherwise
@return JNDI resource name | [
"Returns",
"JNDI",
"resource",
"name",
"."
] | fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7 | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/resolvers/ResourceReferenceResolver.java#L77-L80 | train | Get name from resource name. | Create a Java method that does the following: "Get name from resource name.". | Of course, here is the Java code you requested:
```java
private static String getName(final String resourceName, final String fallBackName)
{
return resourceName.length() > 0 ? resourceName : fallBackName;
}
```
Hope this helps! | |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java | StrSpliter.splitByLength | public static String[] splitByLength(String str, int len) {
int partCount = str.length() / len;
int lastPartCount = str.length() % len;
int fixPart = 0;
if (lastPartCount != 0) {
fixPart = 1;
}
final String[] strs = new String[partCount + fixPart];
for (int i = 0; i < partCount + fixPart; i++... | java | public static String[] splitByLength(String str, int len) {
int partCount = str.length() / len;
int lastPartCount = str.length() % len;
int fixPart = 0;
if (lastPartCount != 0) {
fixPart = 1;
}
final String[] strs = new String[partCount + fixPart];
for (int i = 0; i < partCount + fixPart; i++... | [
"public",
"static",
"String",
"[",
"]",
"splitByLength",
"(",
"String",
"str",
",",
"int",
"len",
")",
"{",
"int",
"partCount",
"=",
"str",
".",
"length",
"(",
")",
"/",
"len",
";",
"int",
"lastPartCount",
"=",
"str",
".",
"length",
"(",
")",
"%",
... | 根据给定长度,将给定字符串截取为多个部分
@param str 字符串
@param len 每一个小节的长度
@return 截取后的字符串数组 | [
"根据给定长度,将给定字符串截取为多个部分"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/text/StrSpliter.java#L466-L483 | train | Splits a string by len characters. | Create a Java method that does the following: "Splits a string by len characters.". | Of course, here is the Java code you requested:
```java
public static String[] splitByLength(String str, int len) {
int partCount = str.length() / len;
int lastPartCount = str.length() % len;
int fixPart = 0;
if (lastPartCount != 0) {
fixPart = 1;
}
final String[] strs = new String[partCount + ... | |
line/armeria | core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFile.java | AbstractHttpFile.generateEntityTag | @Nullable
protected final String generateEntityTag(HttpFileAttributes attrs) {
requireNonNull(attrs, "attrs");
return entityTagFunction != null ? entityTagFunction.apply(pathOrUri(), attrs) : null;
} | java | @Nullable
protected final String generateEntityTag(HttpFileAttributes attrs) {
requireNonNull(attrs, "attrs");
return entityTagFunction != null ? entityTagFunction.apply(pathOrUri(), attrs) : null;
} | [
"@",
"Nullable",
"protected",
"final",
"String",
"generateEntityTag",
"(",
"HttpFileAttributes",
"attrs",
")",
"{",
"requireNonNull",
"(",
"attrs",
",",
"\"attrs\"",
")",
";",
"return",
"entityTagFunction",
"!=",
"null",
"?",
"entityTagFunction",
".",
"apply",
"("... | Generates an entity tag of the file with the given attributes using the {@code entityTagFunction}
which was specified with the constructor.
@return the entity tag or {@code null} if {@code entityTagFunction} is {@code null}. | [
"Generates",
"an",
"entity",
"tag",
"of",
"the",
"file",
"with",
"the",
"given",
"attributes",
"using",
"the",
"{",
"@code",
"entityTagFunction",
"}",
"which",
"was",
"specified",
"with",
"the",
"constructor",
"."
] | 67d29e019fd35a35f89c45cc8f9119ff9b12b44d | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/server/file/AbstractHttpFile.java#L136-L140 | train | Generate the entity tag. | Create a Java method that does the following: "Generate the entity tag.". | Of course, here is the Java code you requested:
```java
@Nullable
protected final String generateEntityTag(HttpFileAttributes attrs) {
requireNonNull(attrs, "attrs");
return entityTagFunction != null ? entityTagFunction.apply(pathOrUri(), attrs) : null;
}
```
Hope this helps! | |
playframework/playframework | core/play/src/main/java/play/Logger.java | Logger.warn | @Deprecated
public static void warn(String message, Throwable error) {
logger.warn(message, error);
} | java | @Deprecated
public static void warn(String message, Throwable error) {
logger.warn(message, error);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"warn",
"(",
"String",
"message",
",",
"Throwable",
"error",
")",
"{",
"logger",
".",
"warn",
"(",
"message",
",",
"error",
")",
";",
"}"
] | Log a message with the WARN level.
@param message message to log
@param error associated exception
@deprecated Deprecated as of 2.7.0. Create an instance of {@link ALogger} via {@link
#of(String)} / {@link #of(Class)} and use the same-named method. Or use SLF4J directly. | [
"Log",
"a",
"message",
"with",
"the",
"WARN",
"level",
"."
] | 3c46dca803d24e715d85de678c59dcfac9525a00 | https://github.com/playframework/playframework/blob/3c46dca803d24e715d85de678c59dcfac9525a00/core/play/src/main/java/play/Logger.java#L391-L394 | test | Log a warning message and exception. | Create a Java method that does the following: "Log a warning message and exception.". | Of course, here is the Java code you requested:
```java
@Deprecated
public static void warn(String message, Throwable error) {
logger.warn(message, error);
}
```
Hope this helps! | |
jOOQ/jOOX | jOOX-java-6/src/main/java/org/joox/Util.java | Util.textNodesOnly | static final boolean textNodesOnly(NodeList list) {
final int length = list.getLength();
for (int i = 0; i < length; i++)
if (list.item(i).getNodeType() != Node.TEXT_NODE)
return false;
return true;
} | java | static final boolean textNodesOnly(NodeList list) {
final int length = list.getLength();
for (int i = 0; i < length; i++)
if (list.item(i).getNodeType() != Node.TEXT_NODE)
return false;
return true;
} | [
"static",
"final",
"boolean",
"textNodesOnly",
"(",
"NodeList",
"list",
")",
"{",
"final",
"int",
"length",
"=",
"list",
".",
"getLength",
"(",
")",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"length",
";",
"i",
"++",
")",
"if",
"(",
"... | Check whether there are any element nodes in a {@link NodeList} | [
"Check",
"whether",
"there",
"are",
"any",
"element",
"nodes",
"in",
"a",
"{"
] | 3793b96f0cee126f64074da4d7fad63f91d2440e | https://github.com/jOOQ/jOOX/blob/3793b96f0cee126f64074da4d7fad63f91d2440e/jOOX-java-6/src/main/java/org/joox/Util.java#L244-L252 | train | Check if the NodeList is text nodes only. | Create a Java method that does the following: "Check if the NodeList is text nodes only.". | Of course, here is the Java code you requested:
```java
static final boolean textNodesOnly(NodeList list) {
final int length = list.getLength();
for (int i = 0; i < length; i++)
if (list.item(i).getNodeType() != Node.TEXT_NODE)
return false;
return true;
}
```
... | |
kiegroup/drools | drools-decisiontables/src/main/java/org/drools/decisiontable/SpreadsheetCompiler.java | SpreadsheetCompiler.compile | public String compile(final InputStream stream,
final String worksheetName) {
return compile( ResourceFactory.newInputStreamResource( stream ), worksheetName );
} | java | public String compile(final InputStream stream,
final String worksheetName) {
return compile( ResourceFactory.newInputStreamResource( stream ), worksheetName );
} | [
"public",
"String",
"compile",
"(",
"final",
"InputStream",
"stream",
",",
"final",
"String",
"worksheetName",
")",
"{",
"return",
"compile",
"(",
"ResourceFactory",
".",
"newInputStreamResource",
"(",
"stream",
")",
",",
"worksheetName",
")",
";",
"}"
] | Looks for a named worksheet to find the decision tables on. Only works
with XLS format spreadsheets (as they have multiple worksheets).
@param stream
The stream of the decision tables (spreadsheet) IN XLS format !!
@param worksheetName
The name of the worksheet that the decision tables live on.
@return DRL, ready to g... | [
"Looks",
"for",
"a",
"named",
"worksheet",
"to",
"find",
"the",
"decision",
"tables",
"on",
".",
"Only",
"works",
"with",
"XLS",
"format",
"spreadsheets",
"(",
"as",
"they",
"have",
"multiple",
"worksheets",
")",
"."
] | 22b0275d6dbe93070b8090948502cf46eda543c4 | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-decisiontables/src/main/java/org/drools/decisiontable/SpreadsheetCompiler.java#L175-L178 | train | Compile a single resource from an input stream. | Create a Java method that does the following: "Compile a single resource from an input stream.". | Of course, here is the Java code you requested:
```java
public String compile(final InputStream stream,
final String worksheetName) {
return compile( ResourceFactory.newInputStreamResource( stream ), worksheetName );
}
```
Hope this helps! | |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/GVRApplication.java | GVRApplication.enableGestureDetector | public synchronized void enableGestureDetector() {
final GVRTouchPadGestureListener gestureListener = new GVRTouchPadGestureListener() {
@Override
public boolean onSwipe(MotionEvent e, Action action, float vx, float vy) {
if (null != mGVRMain) {
mGVRMa... | java | public synchronized void enableGestureDetector() {
final GVRTouchPadGestureListener gestureListener = new GVRTouchPadGestureListener() {
@Override
public boolean onSwipe(MotionEvent e, Action action, float vx, float vy) {
if (null != mGVRMain) {
mGVRMa... | [
"public",
"synchronized",
"void",
"enableGestureDetector",
"(",
")",
"{",
"final",
"GVRTouchPadGestureListener",
"gestureListener",
"=",
"new",
"GVRTouchPadGestureListener",
"(",
")",
"{",
"@",
"Override",
"public",
"boolean",
"onSwipe",
"(",
"MotionEvent",
"e",
",",
... | Enables the Android GestureDetector which in turn fires the appropriate {@link GVRMain} callbacks.
By default it is not.
@see GVRMain#onSwipe(GVRTouchPadGestureListener.Action, float)
@see GVRMain#onSingleTapUp(MotionEvent)
@see GVRTouchPadGestureListener | [
"Enables",
"the",
"Android",
"GestureDetector",
"which",
"in",
"turn",
"fires",
"the",
"appropriate",
"{"
] | 05034d465a7b0a494fabb9e9f2971ac19392f32d | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/GVRApplication.java#L710-L735 | train | Enable the touch gesture detector. | Create a Java method that does the following: "Enable the touch gesture detector.". | Of course, here is the Java code you requested:
```java
public synchronized void enableGestureDetector() {
final GVRTouchPadGestureListener gestureListener = new GVRTouchPadGestureListener() {
@Override
public boolean onSwipe(MotionEvent e, Action action, float vx, float vy) {
... | |
tomgibara/bits | src/main/java/com/tomgibara/bits/BooleansBitStore.java | BooleansBitStore.range | @Override
public BitStore range(int from, int to) {
if (from < 0) throw new IllegalArgumentException();
if (from > to) throw new IllegalArgumentException();
from += start;
to += start;
if (to > finish) throw new IllegalArgumentException();
return new BooleansBitStore(bits, from, to, mutable);
} | java | @Override
public BitStore range(int from, int to) {
if (from < 0) throw new IllegalArgumentException();
if (from > to) throw new IllegalArgumentException();
from += start;
to += start;
if (to > finish) throw new IllegalArgumentException();
return new BooleansBitStore(bits, from, to, mutable);
} | [
"@",
"Override",
"public",
"BitStore",
"range",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"if",
"(",
"from",
"<",
"0",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
")",
";",
"if",
"(",
"from",
">",
"to",
")",
"throw",
"new",
"IllegalAr... | views | [
"views"
] | 56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97 | https://github.com/tomgibara/bits/blob/56c32c0a30efd3d7c4e7c6600a0ca39e51eecc97/src/main/java/com/tomgibara/bits/BooleansBitStore.java#L135-L143 | train | Returns a new BitStore containing bits from the specified range of bits. | Create a Java method that does the following: "Returns a new BitStore containing bits from the specified range of bits.". | Of course, here is the Java code you requested:
```java
@Override
public BitStore range(int from, int to) {
if (from < 0) throw new IllegalArgumentException();
if (from > to) throw new IllegalArgumentException();
from += start;
to += start;
if (to > finish) throw new IllegalArgumentException();
return new... | |
logic-ng/LogicNG | src/main/java/org/logicng/solvers/maxsat/encodings/Encoding.java | Encoding.addBinaryClause | void addBinaryClause(final MiniSatStyleSolver s, int a, int b) {
this.addBinaryClause(s, a, b, LIT_UNDEF);
} | java | void addBinaryClause(final MiniSatStyleSolver s, int a, int b) {
this.addBinaryClause(s, a, b, LIT_UNDEF);
} | [
"void",
"addBinaryClause",
"(",
"final",
"MiniSatStyleSolver",
"s",
",",
"int",
"a",
",",
"int",
"b",
")",
"{",
"this",
".",
"addBinaryClause",
"(",
"s",
",",
"a",
",",
"b",
",",
"LIT_UNDEF",
")",
";",
"}"
] | Adds a binary clause to the given SAT solver.
@param s the sat solver
@param a the first literal
@param b the second literal | [
"Adds",
"a",
"binary",
"clause",
"to",
"the",
"given",
"SAT",
"solver",
"."
] | bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e | https://github.com/logic-ng/LogicNG/blob/bb9eb88a768be4be8e02a76cfc4a59e6c3fb7f2e/src/main/java/org/logicng/solvers/maxsat/encodings/Encoding.java#L107-L109 | train | Add a binary clause to the given solver. | Create a Java method that does the following: "Add a binary clause to the given solver.". | Of course, here is the Java code you requested:
```java
void addBinaryClause(final MiniSatStyleSolver s, int a, int b) {
this.addBinaryClause(s, a, b, LIT_UNDEF);
}
```
Hope this helps! | |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/HttpStreamWrapper.java | HttpStreamWrapper.close | public void close() throws IOException
{
HttpStream stream = _stream;
_stream = null;
if (stream != null)
stream.close();
} | java | public void close() throws IOException
{
HttpStream stream = _stream;
_stream = null;
if (stream != null)
stream.close();
} | [
"public",
"void",
"close",
"(",
")",
"throws",
"IOException",
"{",
"HttpStream",
"stream",
"=",
"_stream",
";",
"_stream",
"=",
"null",
";",
"if",
"(",
"stream",
"!=",
"null",
")",
"stream",
".",
"close",
"(",
")",
";",
"}"
] | Close the connection. | [
"Close",
"the",
"connection",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/HttpStreamWrapper.java#L240-L247 | train | Close the underlying stream. | Create a Java method that does the following: "Close the underlying stream.". | Of course, here is the Java code you requested:
```java
public void close() throws IOException
{
HttpStream stream = _stream;
_stream = null;
if (stream != null)
stream.close();
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/cmdline/Utils.java | Utils.getServerOutputDir | public static File getServerOutputDir(String serverName, boolean isClient) {
if (serverName == null) {
throw new IllegalArgumentException("Parameter serverName can not be 'null'");
}
File outputDir = Utils.getOutputDir(isClient);
if (outputDir != null) {
return ne... | java | public static File getServerOutputDir(String serverName, boolean isClient) {
if (serverName == null) {
throw new IllegalArgumentException("Parameter serverName can not be 'null'");
}
File outputDir = Utils.getOutputDir(isClient);
if (outputDir != null) {
return ne... | [
"public",
"static",
"File",
"getServerOutputDir",
"(",
"String",
"serverName",
",",
"boolean",
"isClient",
")",
"{",
"if",
"(",
"serverName",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Parameter serverName can not be 'null'\"",
")",
... | Returns server output directory. This directory contains server generated
output (logs, the server's workarea, generated files, etc). It corresponds
to the value of ${server.output.dir} variable in server.xml configuration file.
@param serverName server's name
@param isClient true if the current process is client.
@re... | [
"Returns",
"server",
"output",
"directory",
".",
"This",
"directory",
"contains",
"server",
"generated",
"output",
"(",
"logs",
"the",
"server",
"s",
"workarea",
"generated",
"files",
"etc",
")",
".",
"It",
"corresponds",
"to",
"the",
"value",
"of",
"$",
"{"... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/cmdline/Utils.java#L212-L221 | train | Gets the output directory for a single server. | Create a Java method that does the following: "Gets the output directory for a single server.". | Of course, here is the Java code you requested:
```java
public static File getServerOutputDir(String serverName, boolean isClient) {
if (serverName == null) {
throw new IllegalArgumentException("Parameter serverName can not be 'null'");
}
File outputDir = Utils.getOutputDir(isClient... | |
jbundle/jbundle | app/program/project/src/main/java/org/jbundle/app/program/project/report/NameIndentConverter.java | NameIndentConverter.getString | public String getString()
{
String string = super.getString();
int iIndent = (int)m_convIndent.getValue();
string = gstrSpaces.substring(0, iIndent * m_iIndentAmount) + string;
return string;
} | java | public String getString()
{
String string = super.getString();
int iIndent = (int)m_convIndent.getValue();
string = gstrSpaces.substring(0, iIndent * m_iIndentAmount) + string;
return string;
} | [
"public",
"String",
"getString",
"(",
")",
"{",
"String",
"string",
"=",
"super",
".",
"getString",
"(",
")",
";",
"int",
"iIndent",
"=",
"(",
"int",
")",
"m_convIndent",
".",
"getValue",
"(",
")",
";",
"string",
"=",
"gstrSpaces",
".",
"substring",
"(... | GetString Method. | [
"GetString",
"Method",
"."
] | 4037fcfa85f60c7d0096c453c1a3cd573c2b0abc | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/project/src/main/java/org/jbundle/app/program/project/report/NameIndentConverter.java#L61-L67 | train | Get the string of the SECTYPE. | Create a Java method that does the following: "Get the string of the SECTYPE.". | Of course, here is the Java code you requested:
```java
public String getString()
{
String string = super.getString();
int iIndent = (int)m_convIndent.getValue();
string = gstrSpaces.substring(0, iIndent * m_iIndentAmount) + string;
return string;
}
```
Hope this helps! | |
yasserg/crawler4j | crawler4j/src/main/java/edu/uci/ics/crawler4j/crawler/WebCrawler.java | WebCrawler.onUnexpectedStatusCode | protected void onUnexpectedStatusCode(String urlStr, int statusCode, String contentType,
String description) {
logger.warn("Skipping URL: {}, StatusCode: {}, {}, {}", urlStr, statusCode, contentType,
description);
// Do nothing by default (ex... | java | protected void onUnexpectedStatusCode(String urlStr, int statusCode, String contentType,
String description) {
logger.warn("Skipping URL: {}, StatusCode: {}, {}, {}", urlStr, statusCode, contentType,
description);
// Do nothing by default (ex... | [
"protected",
"void",
"onUnexpectedStatusCode",
"(",
"String",
"urlStr",
",",
"int",
"statusCode",
",",
"String",
"contentType",
",",
"String",
"description",
")",
"{",
"logger",
".",
"warn",
"(",
"\"Skipping URL: {}, StatusCode: {}, {}, {}\"",
",",
"urlStr",
",",
"s... | This function is called if the crawler encountered an unexpected http status code ( a
status code other than 3xx)
@param urlStr URL in which an unexpected error was encountered while crawling
@param statusCode Html StatusCode
@param contentType Type of Content
@param description Error Description | [
"This",
"function",
"is",
"called",
"if",
"the",
"crawler",
"encountered",
"an",
"unexpected",
"http",
"status",
"code",
"(",
"a",
"status",
"code",
"other",
"than",
"3xx",
")"
] | 4fcddc86414d1831973aff94050af55c7aeff3bc | https://github.com/yasserg/crawler4j/blob/4fcddc86414d1831973aff94050af55c7aeff3bc/crawler4j/src/main/java/edu/uci/ics/crawler4j/crawler/WebCrawler.java#L228-L234 | train | Called when an unexpected HTTP status code is encountered. | Create a Java method that does the following: "Called when an unexpected HTTP status code is encountered.". | Of course, here is the Java code you requested:
```java
protected void onUnexpectedStatusCode(String urlStr, int statusCode, String contentType,
String description) {
logger.warn("Skipping URL: {}, StatusCode: {}, {}, {}", urlStr, statusCode, contentType,
... | |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java | CPTaxCategoryServiceBaseImpl.setUserService | public void setUserService(
com.liferay.portal.kernel.service.UserService userService) {
this.userService = userService;
} | java | public void setUserService(
com.liferay.portal.kernel.service.UserService userService) {
this.userService = userService;
} | [
"public",
"void",
"setUserService",
"(",
"com",
".",
"liferay",
".",
"portal",
".",
"kernel",
".",
"service",
".",
"UserService",
"userService",
")",
"{",
"this",
".",
"userService",
"=",
"userService",
";",
"}"
] | Sets the user remote service.
@param userService the user remote service | [
"Sets",
"the",
"user",
"remote",
"service",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/base/CPTaxCategoryServiceBaseImpl.java#L1303-L1306 | train | Sets the user service. | Create a Java method that does the following: "Sets the user service.". | Of course, here is the Java code you requested:
```java
public void setUserService(
com.liferay.portal.kernel.service.UserService userService) {
this.userService = userService;
}
```
Hope this helps! | |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java | MeshGenerator.generateCrosshairs | public static VertexData generateCrosshairs(float length) {
final VertexData destination = new VertexData();
final VertexAttribute positionsAttribute = new VertexAttribute("positions", DataType.FLOAT, 3);
destination.addAttribute(0, positionsAttribute);
final TFloatList positions = new T... | java | public static VertexData generateCrosshairs(float length) {
final VertexData destination = new VertexData();
final VertexAttribute positionsAttribute = new VertexAttribute("positions", DataType.FLOAT, 3);
destination.addAttribute(0, positionsAttribute);
final TFloatList positions = new T... | [
"public",
"static",
"VertexData",
"generateCrosshairs",
"(",
"float",
"length",
")",
"{",
"final",
"VertexData",
"destination",
"=",
"new",
"VertexData",
"(",
")",
";",
"final",
"VertexAttribute",
"positionsAttribute",
"=",
"new",
"VertexAttribute",
"(",
"\"position... | Generates a crosshairs shaped wireframe in 3D. The center is at the intersection point of the three lines.
@param length The length for the three lines
@return The vertex data | [
"Generates",
"a",
"crosshairs",
"shaped",
"wireframe",
"in",
"3D",
".",
"The",
"center",
"is",
"at",
"the",
"intersection",
"point",
"of",
"the",
"three",
"lines",
"."
] | 88652fcf0621ce158a0e92ce4c570ed6b1f6fca9 | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java#L484-L495 | train | Generate the crosshairs for a given length | Create a Java method that does the following: "Generate the crosshairs for a given length". | Of course, here is the Java code you requested:
```java
public static VertexData generateCrosshairs(float length) {
final VertexData destination = new VertexData();
final VertexAttribute positionsAttribute = new VertexAttribute("positions", DataType.FLOAT, 3);
destination.addAttribute(0, positi... | |
hazelcast/hazelcast | hazelcast/src/main/java/com/hazelcast/flakeidgen/impl/AutoBatcher.java | AutoBatcher.newId | public long newId() {
for (; ; ) {
Block block = this.block;
long res = block.next();
if (res != Long.MIN_VALUE) {
return res;
}
synchronized (this) {
if (block != this.block) {
// new block was assi... | java | public long newId() {
for (; ; ) {
Block block = this.block;
long res = block.next();
if (res != Long.MIN_VALUE) {
return res;
}
synchronized (this) {
if (block != this.block) {
// new block was assi... | [
"public",
"long",
"newId",
"(",
")",
"{",
"for",
"(",
";",
";",
")",
"{",
"Block",
"block",
"=",
"this",
".",
"block",
";",
"long",
"res",
"=",
"block",
".",
"next",
"(",
")",
";",
"if",
"(",
"res",
"!=",
"Long",
".",
"MIN_VALUE",
")",
"{",
"... | Return next ID from current batch or get new batch from supplier if
current batch is spent or expired. | [
"Return",
"next",
"ID",
"from",
"current",
"batch",
"or",
"get",
"new",
"batch",
"from",
"supplier",
"if",
"current",
"batch",
"is",
"spent",
"or",
"expired",
"."
] | 8c4bc10515dbbfb41a33e0302c0caedf3cda1baf | https://github.com/hazelcast/hazelcast/blob/8c4bc10515dbbfb41a33e0302c0caedf3cda1baf/hazelcast/src/main/java/com/hazelcast/flakeidgen/impl/AutoBatcher.java#L45-L61 | train | Gets the next id from the iterator. | Create a Java method that does the following: "Gets the next id from the iterator.". | Of course, here is the Java code you requested:
```java
public long newId() {
for (; ; ) {
Block block = this.block;
long res = block.next();
if (res != Long.MIN_VALUE) {
return res;
}
synchronized (this) {
if (block !... | |
liferay/com-liferay-commerce | commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/base/CommerceTaxMethodLocalServiceBaseImpl.java | CommerceTaxMethodLocalServiceBaseImpl.deleteCommerceTaxMethod | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceTaxMethod deleteCommerceTaxMethod(long commerceTaxMethodId)
throws PortalException {
return commerceTaxMethodPersistence.remove(commerceTaxMethodId);
} | java | @Indexable(type = IndexableType.DELETE)
@Override
public CommerceTaxMethod deleteCommerceTaxMethod(long commerceTaxMethodId)
throws PortalException {
return commerceTaxMethodPersistence.remove(commerceTaxMethodId);
} | [
"@",
"Indexable",
"(",
"type",
"=",
"IndexableType",
".",
"DELETE",
")",
"@",
"Override",
"public",
"CommerceTaxMethod",
"deleteCommerceTaxMethod",
"(",
"long",
"commerceTaxMethodId",
")",
"throws",
"PortalException",
"{",
"return",
"commerceTaxMethodPersistence",
".",
... | Deletes the commerce tax method with the primary key from the database. Also notifies the appropriate model listeners.
@param commerceTaxMethodId the primary key of the commerce tax method
@return the commerce tax method that was removed
@throws PortalException if a commerce tax method with the primary key could not b... | [
"Deletes",
"the",
"commerce",
"tax",
"method",
"with",
"the",
"primary",
"key",
"from",
"the",
"database",
".",
"Also",
"notifies",
"the",
"appropriate",
"model",
"listeners",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-tax-service/src/main/java/com/liferay/commerce/tax/service/base/CommerceTaxMethodLocalServiceBaseImpl.java#L111-L116 | train | Deletes the commerce tax method with the primary key from the database. Also notifies the appropriate model listeners. | Create a Java method that does the following: "Deletes the commerce tax method with the primary key from the database. Also notifies the appropriate model listeners.". | Of course, here is the Java code you requested:
```java
@Indexable(type = IndexableType.DELETE)
@Override
public CommerceTaxMethod deleteCommerceTaxMethod(long commerceTaxMethodId)
throws PortalException {
return commerceTaxMethodPersistence.remove(commerceTaxMethodId);
}
```
Hope this helps! | |
lecousin/java-framework-core | net.lecousin.core/src/main/java/net/lecousin/framework/memory/MemoryManager.java | MemoryManager.init | public static void init() {
logger = LCCore.get().getMemoryLogger();
if (logger.debug())
logMemory(Level.DEBUG);
// after 15 minutes the application is running, every 5 minutes, ask to clean expired cached data
Task<Void,NoException> cleanExpiredData = new Task.Cpu<Void,NoException>(
"Free memory ... | java | public static void init() {
logger = LCCore.get().getMemoryLogger();
if (logger.debug())
logMemory(Level.DEBUG);
// after 15 minutes the application is running, every 5 minutes, ask to clean expired cached data
Task<Void,NoException> cleanExpiredData = new Task.Cpu<Void,NoException>(
"Free memory ... | [
"public",
"static",
"void",
"init",
"(",
")",
"{",
"logger",
"=",
"LCCore",
".",
"get",
"(",
")",
".",
"getMemoryLogger",
"(",
")",
";",
"if",
"(",
"logger",
".",
"debug",
"(",
")",
")",
"logMemory",
"(",
"Level",
".",
"DEBUG",
")",
";",
"// after ... | Initialization. | [
"Initialization",
"."
] | b0c893b44bfde2c03f90ea846a49ef5749d598f3 | https://github.com/lecousin/java-framework-core/blob/b0c893b44bfde2c03f90ea846a49ef5749d598f3/net.lecousin.core/src/main/java/net/lecousin/framework/memory/MemoryManager.java#L34-L136 | train | Initializes the application. | Create a Java method that does the following: "Initializes the application.". | Of course, here is the Java code you requested:
```java
public static void init() {
logger = LCCore.get().getMemoryLogger();
if (logger.debug())
logMemory(Level.DEBUG);
// after 15 minutes the application is running, every 5 minutes, ask to clean expired cached data
Task<Void,NoException> cleanExpire... | |
opensourceBIM/BIMserver | PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java | Ifc4PackageImpl.getIfcDerivedUnitEnum | @Override
public EEnum getIfcDerivedUnitEnum() {
if (ifcDerivedUnitEnumEEnum == null) {
ifcDerivedUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(957);
}
return ifcDerivedUnitEnumEEnum;
} | java | @Override
public EEnum getIfcDerivedUnitEnum() {
if (ifcDerivedUnitEnumEEnum == null) {
ifcDerivedUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(957);
}
return ifcDerivedUnitEnumEEnum;
} | [
"@",
"Override",
"public",
"EEnum",
"getIfcDerivedUnitEnum",
"(",
")",
"{",
"if",
"(",
"ifcDerivedUnitEnumEEnum",
"==",
"null",
")",
"{",
"ifcDerivedUnitEnumEEnum",
"=",
"(",
"EEnum",
")",
"EPackage",
".",
"Registry",
".",
"INSTANCE",
".",
"getEPackage",
"(",
... | <!-- begin-user-doc -->
<!-- end-user-doc -->
@generated | [
"<!",
"--",
"begin",
"-",
"user",
"-",
"doc",
"--",
">",
"<!",
"--",
"end",
"-",
"user",
"-",
"doc",
"--",
">"
] | 116803c3047d1b32217366757cee1bb3880fda63 | https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L45032-L45039 | train | Override the javadoc method for the IfcDerivedUnitEnum interface. | Create a Java method that does the following: "Override the javadoc method for the IfcDerivedUnitEnum interface.". | Of course, here is the Java code you requested:
```java
@Override
public EEnum getIfcDerivedUnitEnum() {
if (ifcDerivedUnitEnumEEnum == null) {
ifcDerivedUnitEnumEEnum = (EEnum) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI)
.getEClassifiers().get(957);
}
return ifcDerivedUnitEnumEEnu... | |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java | ClassWriter.instance | public static ClassWriter instance(Context context) {
ClassWriter instance = context.get(classWriterKey);
if (instance == null)
instance = new ClassWriter(context);
return instance;
} | java | public static ClassWriter instance(Context context) {
ClassWriter instance = context.get(classWriterKey);
if (instance == null)
instance = new ClassWriter(context);
return instance;
} | [
"public",
"static",
"ClassWriter",
"instance",
"(",
"Context",
"context",
")",
"{",
"ClassWriter",
"instance",
"=",
"context",
".",
"get",
"(",
"classWriterKey",
")",
";",
"if",
"(",
"instance",
"==",
"null",
")",
"instance",
"=",
"new",
"ClassWriter",
"(",
... | Get the ClassWriter instance for this context. | [
"Get",
"the",
"ClassWriter",
"instance",
"for",
"this",
"context",
"."
] | a53d069bbdb2c60232ed3811c19b65e41c3e60e0 | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassWriter.java#L163-L168 | train | Get the ClassWriter instance for this context. | Create a Java method that does the following: "Get the ClassWriter instance for this context.". | Of course, here is the Java code you requested:
```java
public static ClassWriter instance(Context context) {
ClassWriter instance = context.get(classWriterKey);
if (instance == null)
instance = new ClassWriter(context);
return instance;
}
```
Hope this helps! | |
Unidata/thredds | cdm/src/main/java/ucar/nc2/units/DateFromString.java | DateFromString.getDateUsingRegExp | public static Date getDateUsingRegExp( String dateString,
String matchPattern,
String substitutionPattern )
{
String dateFormatString = "yyyy-MM-dd'T'HH:mm";
return getDateUsingRegExpAndDateFormat( dateString,
... | java | public static Date getDateUsingRegExp( String dateString,
String matchPattern,
String substitutionPattern )
{
String dateFormatString = "yyyy-MM-dd'T'HH:mm";
return getDateUsingRegExpAndDateFormat( dateString,
... | [
"public",
"static",
"Date",
"getDateUsingRegExp",
"(",
"String",
"dateString",
",",
"String",
"matchPattern",
",",
"String",
"substitutionPattern",
")",
"{",
"String",
"dateFormatString",
"=",
"\"yyyy-MM-dd'T'HH:mm\"",
";",
"return",
"getDateUsingRegExpAndDateFormat",
"("... | Use regular expression capture group replacement to construct a date
string and return the Date that is obtained by parseing the constructed
date string using the date format string "yyyy-MM-dd'T'HH:mm".
The date string is constructed by matching the given dateString against
the given regular expression matchPattern a... | [
"Use",
"regular",
"expression",
"capture",
"group",
"replacement",
"to",
"construct",
"a",
"date",
"string",
"and",
"return",
"the",
"Date",
"that",
"is",
"obtained",
"by",
"parseing",
"the",
"constructed",
"date",
"string",
"using",
"the",
"date",
"format",
"... | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/nc2/units/DateFromString.java#L246-L255 | test | Get a Date using a regular expression and a date format string. | Create a Java method that does the following: "Get a Date using a regular expression and a date format string.". | Of course, here is the Java code you requested:
```java
public static Date getDateUsingRegExp( String dateString,
String matchPattern,
String substitutionPattern )
{
String dateFormatString = "yyyy-MM-dd'T'HH:mm";
return getDat... | |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java | PathOperations.renameFile | @Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = _getUnifiedPath (aSourceFile);
final Path aRealTarget... | java | @Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = _getUnifiedPath (aSourceFile);
final Path aRealTarget... | [
"@",
"Nonnull",
"public",
"static",
"FileIOError",
"renameFile",
"(",
"@",
"Nonnull",
"final",
"Path",
"aSourceFile",
",",
"@",
"Nonnull",
"final",
"Path",
"aTargetFile",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aSourceFile",
",",
"\"SourceFile\"",
")",
... | Rename a file.
@param aSourceFile
The original file name. May not be <code>null</code>.
@param aTargetFile
The destination file name. May not be <code>null</code>.
@return A non-<code>null</code> error code. | [
"Rename",
"a",
"file",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/PathOperations.java#L430-L465 | train | Rename the source file to the target file. | Create a Java method that does the following: "Rename the source file to the target file.". | Of course, here is the Java code you requested:
```java
@Nonnull
public static FileIOError renameFile (@Nonnull final Path aSourceFile, @Nonnull final Path aTargetFile)
{
ValueEnforcer.notNull (aSourceFile, "SourceFile");
ValueEnforcer.notNull (aTargetFile, "TargetFile");
final Path aRealSourceFile = ... | |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/dialect/impl/ForwardingGridDialect.java | ForwardingGridDialect.injectServices | @Override
public void injectServices(ServiceRegistryImplementor serviceRegistry) {
if ( gridDialect instanceof ServiceRegistryAwareService ) {
( (ServiceRegistryAwareService) gridDialect ).injectServices( serviceRegistry );
}
} | java | @Override
public void injectServices(ServiceRegistryImplementor serviceRegistry) {
if ( gridDialect instanceof ServiceRegistryAwareService ) {
( (ServiceRegistryAwareService) gridDialect ).injectServices( serviceRegistry );
}
} | [
"@",
"Override",
"public",
"void",
"injectServices",
"(",
"ServiceRegistryImplementor",
"serviceRegistry",
")",
"{",
"if",
"(",
"gridDialect",
"instanceof",
"ServiceRegistryAwareService",
")",
"{",
"(",
"(",
"ServiceRegistryAwareService",
")",
"gridDialect",
")",
".",
... | /*
@see org.hibernate.service.spi.ServiceRegistryAwareService | [
"/",
"*"
] | 9ea971df7c27277029006a6f748d8272fb1d69d2 | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/dialect/impl/ForwardingGridDialect.java#L269-L274 | train | Injects the service registry. | Create a Java method that does the following: "Injects the service registry.". | Of course, here is the Java code you requested:
```java
@Override
public void injectServices(ServiceRegistryImplementor serviceRegistry) {
if ( gridDialect instanceof ServiceRegistryAwareService ) {
( (ServiceRegistryAwareService) gridDialect ).injectServices( serviceRegistry );
}
}
```
Hope this helps! | |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/WilcoxonOneSample.java | WilcoxonOneSample.scoreToPvalue | private static double scoreToPvalue(double score, int n) {
/*
if(n<=20) {
//calculate it from binomial distribution
}
*/
double mean=n*(n+1.0)/4.0;
double variable=n*(n+1.0)*(2.0*n+1.0)/24.0;
double z=(score-mean)/Math.sqrt(variable);
... | java | private static double scoreToPvalue(double score, int n) {
/*
if(n<=20) {
//calculate it from binomial distribution
}
*/
double mean=n*(n+1.0)/4.0;
double variable=n*(n+1.0)*(2.0*n+1.0)/24.0;
double z=(score-mean)/Math.sqrt(variable);
... | [
"private",
"static",
"double",
"scoreToPvalue",
"(",
"double",
"score",
",",
"int",
"n",
")",
"{",
"/*\n if(n<=20) {\n //calculate it from binomial distribution\n }\n */",
"double",
"mean",
"=",
"n",
"*",
"(",
"n",
"+",
"1.0",
")",
"/",
... | Returns the Pvalue for a particular score
@param score
@param n
@return | [
"Returns",
"the",
"Pvalue",
"for",
"a",
"particular",
"score"
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/nonparametrics/onesample/WilcoxonOneSample.java#L112-L125 | train | Calculate the value of a score from a binomial distribution. | Create a Java method that does the following: "Calculate the value of a score from a binomial distribution.". | Of course, here is the Java code you requested:
```java
private static double scoreToPvalue(double score, int n) {
/*
if(n<=20) {
//calculate it from binomial distribution
}
*/
double mean=n*(n+1.0)/4.0;
double variable=n*(n+1.0)*(2.0*n+1.0)/24.0;
... | |
Unidata/thredds | dap4/d4cdm/src/main/java/dap4/cdm/nc2/DataToCDM.java | DataToCDM.createSequence | protected CDMArraySequence
createSequence(DataCursor data)
throws DapException
{
CDMArraySequence arrayseq = new CDMArraySequence(this.cdmroot, data);
DapVariable var = (DapVariable) data.getTemplate();
DapSequence template = (DapSequence) var.getBaseType();
List<DapD... | java | protected CDMArraySequence
createSequence(DataCursor data)
throws DapException
{
CDMArraySequence arrayseq = new CDMArraySequence(this.cdmroot, data);
DapVariable var = (DapVariable) data.getTemplate();
DapSequence template = (DapSequence) var.getBaseType();
List<DapD... | [
"protected",
"CDMArraySequence",
"createSequence",
"(",
"DataCursor",
"data",
")",
"throws",
"DapException",
"{",
"CDMArraySequence",
"arrayseq",
"=",
"new",
"CDMArraySequence",
"(",
"this",
".",
"cdmroot",
",",
"data",
")",
";",
"DapVariable",
"var",
"=",
"(",
... | Create a sequence. WARNING: the underlying CDM code
(esp. NetcdfDataset) apparently does not support nested
sequence arrays.
@param data the data underlying this sequence instance
@return A CDMArraySequence for this instance
@throws DapException | [
"Create",
"a",
"sequence",
".",
"WARNING",
":",
"the",
"underlying",
"CDM",
"code",
"(",
"esp",
".",
"NetcdfDataset",
")",
"apparently",
"does",
"not",
"support",
"nested",
"sequence",
"arrays",
"."
] | d2d68f9eee87f345625211324d71d5dc3e162ee1 | https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4cdm/src/main/java/dap4/cdm/nc2/DataToCDM.java#L189-L214 | test | Create a sequence of the type DAP. | Create a Java method that does the following: "Create a sequence of the type DAP.". | Of course, here is the Java code you requested:
```java
protected CDMArraySequence
createSequence(DataCursor data)
throws DapException
{
CDMArraySequence arrayseq = new CDMArraySequence(this.cdmroot, data);
DapVariable var = (DapVariable) data.getTemplate();
DapSequence temp... | |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/distances/Distance.java | Distance.manhattan | public static double manhattan(AssociativeArray a1, AssociativeArray a2) {
Map<Object, Double> columnDistances = columnDistances(a1, a2, null);
double distance = 0.0;
for(double columnDistance : columnDistances.values()) {
distance+=Math.abs(columnDistance);
}
... | java | public static double manhattan(AssociativeArray a1, AssociativeArray a2) {
Map<Object, Double> columnDistances = columnDistances(a1, a2, null);
double distance = 0.0;
for(double columnDistance : columnDistances.values()) {
distance+=Math.abs(columnDistance);
}
... | [
"public",
"static",
"double",
"manhattan",
"(",
"AssociativeArray",
"a1",
",",
"AssociativeArray",
"a2",
")",
"{",
"Map",
"<",
"Object",
",",
"Double",
">",
"columnDistances",
"=",
"columnDistances",
"(",
"a1",
",",
"a2",
",",
"null",
")",
";",
"double",
"... | Estimates the manhattan distance of two Associative Arrays.
@param a1
@param a2
@return | [
"Estimates",
"the",
"manhattan",
"distance",
"of",
"two",
"Associative",
"Arrays",
"."
] | 909dff0476e80834f05ecdde0624dd2390e9b0ca | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/mathematics/distances/Distance.java#L75-L84 | train | Get the manhattan distance between two Associative Arrays. | Create a Java method that does the following: "Get the manhattan distance between two Associative Arrays.". | Of course, here is the Java code you requested:
```java
public static double manhattan(AssociativeArray a1, AssociativeArray a2) {
Map<Object, Double> columnDistances = columnDistances(a1, a2, null);
double distance = 0.0;
for(double columnDistance : columnDistances.values()) {
... | |
mpetazzoni/ttorrent | ttorrent-tracker/src/main/java/com/turn/ttorrent/tracker/TrackerRequestProcessor.java | TrackerRequestProcessor.parseQuery | private HTTPAnnounceRequestMessage parseQuery(final String uri, final String hostAddress)
throws IOException, MessageValidationException {
Map<String, BEValue> params = new HashMap<String, BEValue>();
try {
// String uri = request.getAddress().toString();
for (String pair : uri.split("[?]")[1... | java | private HTTPAnnounceRequestMessage parseQuery(final String uri, final String hostAddress)
throws IOException, MessageValidationException {
Map<String, BEValue> params = new HashMap<String, BEValue>();
try {
// String uri = request.getAddress().toString();
for (String pair : uri.split("[?]")[1... | [
"private",
"HTTPAnnounceRequestMessage",
"parseQuery",
"(",
"final",
"String",
"uri",
",",
"final",
"String",
"hostAddress",
")",
"throws",
"IOException",
",",
"MessageValidationException",
"{",
"Map",
"<",
"String",
",",
"BEValue",
">",
"params",
"=",
"new",
"Has... | Parse the query parameters using our defined BYTE_ENCODING.
<p>
<p>
Because we're expecting byte-encoded strings as query parameters, we
can't rely on SimpleHTTP's QueryParser which uses the wrong encoding for
the job and returns us unparsable byte data. We thus have to implement
our own little parsing method that uses... | [
"Parse",
"the",
"query",
"parameters",
"using",
"our",
"defined",
"BYTE_ENCODING",
".",
"<p",
">",
"<p",
">",
"Because",
"we",
"re",
"expecting",
"byte",
"-",
"encoded",
"strings",
"as",
"query",
"parameters",
"we",
"can",
"t",
"rely",
"on",
"SimpleHTTP",
... | ecd0e6caf853b63393c4ab63cfd8f20114f73f70 | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-tracker/src/main/java/com/turn/ttorrent/tracker/TrackerRequestProcessor.java#L237-L264 | train | Parse a query string into a HTTPAnnounceRequestMessage object. | Create a Java method that does the following: "Parse a query string into a HTTPAnnounceRequestMessage object.". | Of course, here is the Java code you requested:
```java
private HTTPAnnounceRequestMessage parseQuery(final String uri, final String hostAddress)
throws IOException, MessageValidationException {
Map<String, BEValue> params = new HashMap<String, BEValue>();
try {
// String uri = request.getAddress(... | |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ConcurrentHashMap.java | Traverser.recoverState | private void recoverState(int n) {
TableStack<K,V> s; int len;
while ((s = stack) != null && (index += (len = s.length)) >= n) {
n = len;
index = s.index;
tab = s.tab;
s.tab = null;
TableStack<K,V> next = s.next;
... | java | private void recoverState(int n) {
TableStack<K,V> s; int len;
while ((s = stack) != null && (index += (len = s.length)) >= n) {
n = len;
index = s.index;
tab = s.tab;
s.tab = null;
TableStack<K,V> next = s.next;
... | [
"private",
"void",
"recoverState",
"(",
"int",
"n",
")",
"{",
"TableStack",
"<",
"K",
",",
"V",
">",
"s",
";",
"int",
"len",
";",
"while",
"(",
"(",
"s",
"=",
"stack",
")",
"!=",
"null",
"&&",
"(",
"index",
"+=",
"(",
"len",
"=",
"s",
".",
"l... | Possibly pops traversal state.
@param n length of current table | [
"Possibly",
"pops",
"traversal",
"state",
"."
] | 471504a735b48d5d4ace51afa1542cc4790a921a | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/concurrent/ConcurrentHashMap.java#L3426-L3440 | train | Recover state. | Create a Java method that does the following: "Recover state.". | Of course, here is the Java code you requested:
```java
private void recoverState(int n) {
TableStack<K,V> s; int len;
while ((s = stack) != null && (index += (len = s.length)) >= n) {
n = len;
index = s.index;
tab = s.tab;
s.tab =... | |
zxing/zxing | core/src/main/java/com/google/zxing/qrcode/decoder/BitMatrixParser.java | BitMatrixParser.readVersion | Version readVersion() throws FormatException {
if (parsedVersion != null) {
return parsedVersion;
}
int dimension = bitMatrix.getHeight();
int provisionalVersion = (dimension - 17) / 4;
if (provisionalVersion <= 6) {
return Version.getVersionForNumber(provisionalVersion);
}
/... | java | Version readVersion() throws FormatException {
if (parsedVersion != null) {
return parsedVersion;
}
int dimension = bitMatrix.getHeight();
int provisionalVersion = (dimension - 17) / 4;
if (provisionalVersion <= 6) {
return Version.getVersionForNumber(provisionalVersion);
}
/... | [
"Version",
"readVersion",
"(",
")",
"throws",
"FormatException",
"{",
"if",
"(",
"parsedVersion",
"!=",
"null",
")",
"{",
"return",
"parsedVersion",
";",
"}",
"int",
"dimension",
"=",
"bitMatrix",
".",
"getHeight",
"(",
")",
";",
"int",
"provisionalVersion",
... | <p>Reads version information from one of its two locations within the QR Code.</p>
@return {@link Version} encapsulating the QR Code's version
@throws FormatException if both version information locations cannot be parsed as
the valid encoding of version information | [
"<p",
">",
"Reads",
"version",
"information",
"from",
"one",
"of",
"its",
"two",
"locations",
"within",
"the",
"QR",
"Code",
".",
"<",
"/",
"p",
">"
] | 653ac2a3beb11481eff82e7d5f2bab8a745f7fac | https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/qrcode/decoder/BitMatrixParser.java#L96-L138 | train | Read the version information from the bit matrix. | Create a Java method that does the following: "Read the version information from the bit matrix.". | Of course, here is the Java code you requested:
```java
Version readVersion() throws FormatException {
if (parsedVersion != null) {
return parsedVersion;
}
int dimension = bitMatrix.getHeight();
int provisionalVersion = (dimension - 17) / 4;
if (provisionalVersion <= 6) {
return Vers... | |
krummas/DrizzleJDBC | src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java | DrizzlePreparedStatement.setAsciiStream | public void setAsciiStream(final int parameterIndex, final InputStream x, final int length) throws SQLException {
if(x == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
try {
setParameter(parameterIndex, new StreamParameter(x, length));
} cat... | java | public void setAsciiStream(final int parameterIndex, final InputStream x, final int length) throws SQLException {
if(x == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
try {
setParameter(parameterIndex, new StreamParameter(x, length));
} cat... | [
"public",
"void",
"setAsciiStream",
"(",
"final",
"int",
"parameterIndex",
",",
"final",
"InputStream",
"x",
",",
"final",
"int",
"length",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"x",
"==",
"null",
")",
"{",
"setNull",
"(",
"parameterIndex",
",",
"... | Sets the designated parameter to the given input stream, which will have the specified number of bytes. When a
very large ASCII value is input to a <code>LONGVARCHAR</code> parameter, it may be more practical to send it via
a <code>java.io.InputStream</code>. Data will be read from the stream as needed until end-of-fil... | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"input",
"stream",
"which",
"will",
"have",
"the",
"specified",
"number",
"of",
"bytes",
".",
"When",
"a",
"very",
"large",
"ASCII",
"value",
"is",
"input",
"to",
"a",
"<code",
">",
"LONGVARCH... | 716f31fd71f3cc289edf69844d8117deb86d98d6 | https://github.com/krummas/DrizzleJDBC/blob/716f31fd71f3cc289edf69844d8117deb86d98d6/src/main/java/org/drizzle/jdbc/DrizzlePreparedStatement.java#L1200-L1212 | train | Sets the designated parameter to an input stream of bytes. | Create a Java method that does the following: "Sets the designated parameter to an input stream of bytes.". | Of course, here is the Java code you requested:
```java
public void setAsciiStream(final int parameterIndex, final InputStream x, final int length) throws SQLException {
if(x == null) {
setNull(parameterIndex, Types.BLOB);
return;
}
try {
setParameter(param... | |
alkacon/opencms-core | src-modules/org/opencms/workplace/CmsWidgetDialog.java | CmsWidgetDialog.createDialogHtml | protected String createDialogHtml(String dialog) {
StringBuffer result = new StringBuffer(1024);
// create table
result.append(createWidgetTableStart());
// show error header once if there were validation errors
result.append(createWidgetErrorHeader());
Iterator<CmsWi... | java | protected String createDialogHtml(String dialog) {
StringBuffer result = new StringBuffer(1024);
// create table
result.append(createWidgetTableStart());
// show error header once if there were validation errors
result.append(createWidgetErrorHeader());
Iterator<CmsWi... | [
"protected",
"String",
"createDialogHtml",
"(",
"String",
"dialog",
")",
"{",
"StringBuffer",
"result",
"=",
"new",
"StringBuffer",
"(",
"1024",
")",
";",
"// create table",
"result",
".",
"append",
"(",
"createWidgetTableStart",
"(",
")",
")",
";",
"// show err... | Creates the dialog HTML for all defined widgets of the named dialog (page).<p>
To get a more complex layout variation, you have to overwrite this method in your dialog class.<p>
@param dialog the dialog (page) to get the HTML for
@return the dialog HTML for all defined widgets of the named dialog (page) | [
"Creates",
"the",
"dialog",
"HTML",
"for",
"all",
"defined",
"widgets",
"of",
"the",
"named",
"dialog",
"(",
"page",
")",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/CmsWidgetDialog.java#L877-L902 | train | Creates the HTML for the dialog. | Create a Java method that does the following: "Creates the HTML for the dialog.". | Of course, here is the Java code you requested:
```java
protected String createDialogHtml(String dialog) {
StringBuffer result = new StringBuffer(1024);
// create table
result.append(createWidgetTableStart());
// show error header once if there were validation errors
result.a... | |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgLwPolyline.java | DwgLwPolyline.readDwgLwPolylineV15 | public void readDwgLwPolylineV15(int[] data, int offset) throws Exception {
//System.out.println("DwgLwPolyline.readDwgLwPolyline() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitShort(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
int flag... | java | public void readDwgLwPolylineV15(int[] data, int offset) throws Exception {
//System.out.println("DwgLwPolyline.readDwgLwPolyline() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitShort(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
int flag... | [
"public",
"void",
"readDwgLwPolylineV15",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"//System.out.println(\"DwgLwPolyline.readDwgLwPolyline() executed ...\");",
"int",
"bitPos",
"=",
"offset",
";",
"bitPos",
"=",
"readObjectHea... | Read a LwPolyline in the DWG format Version 15
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines. | [
"Read",
"a",
"LwPolyline",
"in",
"the",
"DWG",
"format",
"Version",
"15"
] | d2b436bbdf951dc1fda56096a42dbc0eae4d35a5 | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgLwPolyline.java#L50-L168 | train | Read a LW Polyline in a DWG file Version 15 | Create a Java method that does the following: "Read a LW Polyline in a DWG file Version 15". | Of course, here is the Java code you requested:
```java
public void readDwgLwPolylineV15(int[] data, int offset) throws Exception {
//System.out.println("DwgLwPolyline.readDwgLwPolyline() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitShort(data, bitPo... | |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java | IoUtil.readLines | public static <T extends Collection<String>> T readLines(Reader reader, final T collection) throws IORuntimeException {
readLines(reader, new LineHandler() {
@Override
public void handle(String line) {
collection.add(line);
}
});
return collection;
} | java | public static <T extends Collection<String>> T readLines(Reader reader, final T collection) throws IORuntimeException {
readLines(reader, new LineHandler() {
@Override
public void handle(String line) {
collection.add(line);
}
});
return collection;
} | [
"public",
"static",
"<",
"T",
"extends",
"Collection",
"<",
"String",
">",
">",
"T",
"readLines",
"(",
"Reader",
"reader",
",",
"final",
"T",
"collection",
")",
"throws",
"IORuntimeException",
"{",
"readLines",
"(",
"reader",
",",
"new",
"LineHandler",
"(",
... | 从Reader中读取内容
@param <T> 集合类型
@param reader {@link Reader}
@param collection 返回集合
@return 内容
@throws IORuntimeException IO异常 | [
"从Reader中读取内容"
] | bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/IoUtil.java#L671-L679 | train | Reads a collection of lines from the specified reader. | Create a Java method that does the following: "Reads a collection of lines from the specified reader.". | Of course, here is the Java code you requested:
```java
public static <T extends Collection<String>> T readLines(Reader reader, final T collection) throws IORuntimeException {
readLines(reader, new LineHandler() {
@Override
public void handle(String line) {
collection.add(line);
}
});
return ... | |
contentful/contentful.java | src/main/java/com/contentful/java/cda/image/ImageOption.java | ImageOption.apply | public String apply(String url) {
return format(
getDefault(),
"%s%s%s=%s",
url,
concatenationOperator(url),
operation,
argument);
} | java | public String apply(String url) {
return format(
getDefault(),
"%s%s%s=%s",
url,
concatenationOperator(url),
operation,
argument);
} | [
"public",
"String",
"apply",
"(",
"String",
"url",
")",
"{",
"return",
"format",
"(",
"getDefault",
"(",
")",
",",
"\"%s%s%s=%s\"",
",",
"url",
",",
"concatenationOperator",
"(",
"url",
")",
",",
"operation",
",",
"argument",
")",
";",
"}"
] | Apply this image option to a url, replacing and updating this url.
@param url a url to be handled
@return the changed url. | [
"Apply",
"this",
"image",
"option",
"to",
"a",
"url",
"replacing",
"and",
"updating",
"this",
"url",
"."
] | 6ecc2ace454c674b218b99489dc50697b1dbffcb | https://github.com/contentful/contentful.java/blob/6ecc2ace454c674b218b99489dc50697b1dbffcb/src/main/java/com/contentful/java/cda/image/ImageOption.java#L340-L348 | train | Returns a string representation of the CIDCTYPE. | Create a Java method that does the following: "Returns a string representation of the CIDCTYPE.". | Of course, here is the Java code you requested:
```java
public String apply(String url) {
return format(
getDefault(),
"%s%s%s=%s",
url,
concatenationOperator(url),
operation,
argument);
}
```
Hope this helps! | |
OpenLiberty/open-liberty | dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTS/Configuration.java | Configuration.getApplId | public static final byte[] getApplId()
{
// Determine the applId.
final byte[] result = applId;
if (tc.isDebugEnabled())
Tr.debug(tc, "getApplId", result);
return result;
} | java | public static final byte[] getApplId()
{
// Determine the applId.
final byte[] result = applId;
if (tc.isDebugEnabled())
Tr.debug(tc, "getApplId", result);
return result;
} | [
"public",
"static",
"final",
"byte",
"[",
"]",
"getApplId",
"(",
")",
"{",
"// Determine the applId.",
"final",
"byte",
"[",
"]",
"result",
"=",
"applId",
";",
"if",
"(",
"tc",
".",
"isDebugEnabled",
"(",
")",
")",
"Tr",
".",
"debug",
"(",
"tc",
",",
... | Returns the applId of the server.
<p>
Non-recoverable servers may have an applid but not a name.
@return The applId of the server. | [
"Returns",
"the",
"applId",
"of",
"the",
"server",
".",
"<p",
">",
"Non",
"-",
"recoverable",
"servers",
"may",
"have",
"an",
"applid",
"but",
"not",
"a",
"name",
"."
] | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/ws/Transaction/JTS/Configuration.java#L148-L156 | train | Returns the applId. | Create a Java method that does the following: "Returns the applId.". | Of course, here is the Java code you requested:
```java
public static final byte[] getApplId()
{
// Determine the applId.
final byte[] result = applId;
if (tc.isDebugEnabled())
Tr.debug(tc, "getApplId", result);
return result;
}
```
Hope this helps! | |
diirt/util | src/main/java/org/epics/util/array/CircularBufferDouble.java | CircularBufferDouble.addDouble | public void addDouble(double value) {
data[endOffset] = value;
endOffset++;
// Grow the buffer if needed
if (endOffset == data.length && !reachedMax)
resize();
// Loop over and advance the start point if needed
if (endOffset == data.... | java | public void addDouble(double value) {
data[endOffset] = value;
endOffset++;
// Grow the buffer if needed
if (endOffset == data.length && !reachedMax)
resize();
// Loop over and advance the start point if needed
if (endOffset == data.... | [
"public",
"void",
"addDouble",
"(",
"double",
"value",
")",
"{",
"data",
"[",
"endOffset",
"]",
"=",
"value",
";",
"endOffset",
"++",
";",
"// Grow the buffer if needed\r",
"if",
"(",
"endOffset",
"==",
"data",
".",
"length",
"&&",
"!",
"reachedMax",
")",
... | Adds a new value.
@param value new value | [
"Adds",
"a",
"new",
"value",
"."
] | 24aca0a173a635aaf0b78d213a3fee8d4f91c077 | https://github.com/diirt/util/blob/24aca0a173a635aaf0b78d213a3fee8d4f91c077/src/main/java/org/epics/util/array/CircularBufferDouble.java#L85-L101 | train | Adds the specified double value to the end of the array. | Create a Java method that does the following: "Adds the specified double value to the end of the array.". | Of course, here is the Java code you requested:
```java
public void addDouble(double value) {
data[endOffset] = value;
endOffset++;
// Grow the buffer if needed
if (endOffset == data.length && !reachedMax)
resize();
// Loop over and advance ... | |
glyptodon/guacamole-client | extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java | LDAPConnectionService.createLDAPConnection | private LDAPConnection createLDAPConnection() throws GuacamoleException {
// Map encryption method to proper connection and socket factory
EncryptionMethod encryptionMethod = confService.getEncryptionMethod();
switch (encryptionMethod) {
// Unencrypted LDAP connection
c... | java | private LDAPConnection createLDAPConnection() throws GuacamoleException {
// Map encryption method to proper connection and socket factory
EncryptionMethod encryptionMethod = confService.getEncryptionMethod();
switch (encryptionMethod) {
// Unencrypted LDAP connection
c... | [
"private",
"LDAPConnection",
"createLDAPConnection",
"(",
")",
"throws",
"GuacamoleException",
"{",
"// Map encryption method to proper connection and socket factory",
"EncryptionMethod",
"encryptionMethod",
"=",
"confService",
".",
"getEncryptionMethod",
"(",
")",
";",
"switch",... | Creates a new instance of LDAPConnection, configured as required to use
whichever encryption method is requested within guacamole.properties.
@return
A new LDAPConnection instance which has already been configured to
use the encryption method requested within guacamole.properties.
@throws GuacamoleException
If an err... | [
"Creates",
"a",
"new",
"instance",
"of",
"LDAPConnection",
"configured",
"as",
"required",
"to",
"use",
"whichever",
"encryption",
"method",
"is",
"requested",
"within",
"guacamole",
".",
"properties",
"."
] | ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9 | https://github.com/glyptodon/guacamole-client/blob/ea1b10e9d1e3f1fa640dff2ca64d61b44bf1ace9/extensions/guacamole-auth-ldap/src/main/java/org/apache/guacamole/auth/ldap/LDAPConnectionService.java#L63-L91 | train | Creates an LDAP connection using the configuration service. | Create a Java method that does the following: "Creates an LDAP connection using the configuration service.". | Of course, here is the Java code you requested:
```java
private LDAPConnection createLDAPConnection() throws GuacamoleException {
// Map encryption method to proper connection and socket factory
EncryptionMethod encryptionMethod = confService.getEncryptionMethod();
switch (encryptionMethod) {
... | |
motown-io/motown | ocpi/ocpi-identification-authorization-plugin/src/main/java/io/motown/ocpi/service/AuthorizationService.java | AuthorizationService.synchronizeTokens | public void synchronizeTokens(Endpoint tokenEndPoint) {
Integer subscriptionId = tokenEndPoint.getSubscriptionId();
String partnerAuthorizationToken = tokenEndPoint.getSubscription().getPartnerAuthorizationToken();
String lastSyncDate = getLastSyncDate(subscriptionId);
int totalCount = 1;
int numberRe... | java | public void synchronizeTokens(Endpoint tokenEndPoint) {
Integer subscriptionId = tokenEndPoint.getSubscriptionId();
String partnerAuthorizationToken = tokenEndPoint.getSubscription().getPartnerAuthorizationToken();
String lastSyncDate = getLastSyncDate(subscriptionId);
int totalCount = 1;
int numberRe... | [
"public",
"void",
"synchronizeTokens",
"(",
"Endpoint",
"tokenEndPoint",
")",
"{",
"Integer",
"subscriptionId",
"=",
"tokenEndPoint",
".",
"getSubscriptionId",
"(",
")",
";",
"String",
"partnerAuthorizationToken",
"=",
"tokenEndPoint",
".",
"getSubscription",
"(",
")"... | Retrieves tokens from the enpoint passed as argument, and stores these in
the database
@param tokenEndPoint endpoint to use for retrieving tokens | [
"Retrieves",
"tokens",
"from",
"the",
"enpoint",
"passed",
"as",
"argument",
"and",
"stores",
"these",
"in",
"the",
"database"
] | 783ccda7c28b273a529ddd47defe8673b1ea365b | https://github.com/motown-io/motown/blob/783ccda7c28b273a529ddd47defe8673b1ea365b/ocpi/ocpi-identification-authorization-plugin/src/main/java/io/motown/ocpi/service/AuthorizationService.java#L49-L85 | train | Synchronize tokens at the given endpoint. | Create a Java method that does the following: "Synchronize tokens at the given endpoint.". | Of course, here is the Java code you requested:
```java
public void synchronizeTokens(Endpoint tokenEndPoint) {
Integer subscriptionId = tokenEndPoint.getSubscriptionId();
String partnerAuthorizationToken = tokenEndPoint.getSubscription().getPartnerAuthorizationToken();
String lastSyncDate = getLastSyncDa... | |
headius/invokebinder | src/main/java/com/headius/invokebinder/Binder.java | Binder.foldStatic | public Binder foldStatic(MethodHandles.Lookup lookup, Class<?> target, String method) {
return fold(Binder.from(type()).invokeStaticQuiet(lookup, target, method));
} | java | public Binder foldStatic(MethodHandles.Lookup lookup, Class<?> target, String method) {
return fold(Binder.from(type()).invokeStaticQuiet(lookup, target, method));
} | [
"public",
"Binder",
"foldStatic",
"(",
"MethodHandles",
".",
"Lookup",
"lookup",
",",
"Class",
"<",
"?",
">",
"target",
",",
"String",
"method",
")",
"{",
"return",
"fold",
"(",
"Binder",
".",
"from",
"(",
"type",
"(",
")",
")",
".",
"invokeStaticQuiet",... | Process the incoming arguments by calling the given static method on the
given class, inserting the result as the first argument.
@param lookup the java.lang.invoke.MethodHandles.Lookup to use
@param target the class on which the method is defined
@param method the method to invoke on the first argument
@return a new ... | [
"Process",
"the",
"incoming",
"arguments",
"by",
"calling",
"the",
"given",
"static",
"method",
"on",
"the",
"given",
"class",
"inserting",
"the",
"result",
"as",
"the",
"first",
"argument",
"."
] | ce6bfeb8e33265480daa7b797989dd915d51238d | https://github.com/headius/invokebinder/blob/ce6bfeb8e33265480daa7b797989dd915d51238d/src/main/java/com/headius/invokebinder/Binder.java#L956-L958 | train | Folds the class into a single class by invoking a static method on the target class. | Create a Java method that does the following: "Folds the class into a single class by invoking a static method on the target class.". | Of course, here is the Java code you requested:
```java
public Binder foldStatic(MethodHandles.Lookup lookup, Class<?> target, String method) {
return fold(Binder.from(type()).invokeStaticQuiet(lookup, target, method));
}
```
Hope this helps! | |
shrinkwrap/resolver | maven/impl-maven-archive/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/archive/plugins/ConfigurationUtils.java | ConfigurationUtils.valueAsMap | static Map<String, Object> valueAsMap(Map<String, Object> map, Key key, Map<String, Object> defaultValue) {
if (map.containsKey(key.key)) {
Object rawOrMap = map.get(key.key);
if (rawOrMap instanceof Map) {
@SuppressWarnings("unchecked")
Map<String, Object... | java | static Map<String, Object> valueAsMap(Map<String, Object> map, Key key, Map<String, Object> defaultValue) {
if (map.containsKey(key.key)) {
Object rawOrMap = map.get(key.key);
if (rawOrMap instanceof Map) {
@SuppressWarnings("unchecked")
Map<String, Object... | [
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"valueAsMap",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
",",
"Key",
"key",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"defaultValue",
")",
"{",
"if",
"(",
"map",
".",
"containsKey",
... | Fetches a value specified by key
@param map XPP3 map equivalent
@param key navigation key
@param defaultValue Default value if no such key exists
@return Map representation of the value | [
"Fetches",
"a",
"value",
"specified",
"by",
"key"
] | e881a84b8cff5b0a014f2a5ebf612be3eb9db01f | https://github.com/shrinkwrap/resolver/blob/e881a84b8cff5b0a014f2a5ebf612be3eb9db01f/maven/impl-maven-archive/src/main/java/org/jboss/shrinkwrap/resolver/impl/maven/archive/plugins/ConfigurationUtils.java#L95-L107 | train | ValueAsMap Method. | Create a Java method that does the following: "ValueAsMap Method.". | Of course, here is the Java code you requested:
```java
static Map<String, Object> valueAsMap(Map<String, Object> map, Key key, Map<String, Object> defaultValue) {
if (map.containsKey(key.key)) {
Object rawOrMap = map.get(key.key);
if (rawOrMap instanceof Map) {
@Suppres... | |
infinispan/infinispan | cdi/common/src/main/java/org/infinispan/cdi/common/util/InjectableMethod.java | InjectableMethod.invoke | public <T> T invoke(Object receiver, CreationalContext<T> creationalContext) {
return invoke(receiver, creationalContext, null);
} | java | public <T> T invoke(Object receiver, CreationalContext<T> creationalContext) {
return invoke(receiver, creationalContext, null);
} | [
"public",
"<",
"T",
">",
"T",
"invoke",
"(",
"Object",
"receiver",
",",
"CreationalContext",
"<",
"T",
">",
"creationalContext",
")",
"{",
"return",
"invoke",
"(",
"receiver",
",",
"creationalContext",
",",
"null",
")",
";",
"}"
] | Invoke the method, causing all parameters to be injected according to the
CDI type safe resolution rules.
@param <T> the return type of the method
@param receiver the instance upon which to call the method
@param creationalContext the creational context to use to obtain
injectable references for... | [
"Invoke",
"the",
"method",
"causing",
"all",
"parameters",
"to",
"be",
"injected",
"according",
"to",
"the",
"CDI",
"type",
"safe",
"resolution",
"rules",
"."
] | 7c62b94886c3febb4774ae8376acf2baa0265ab5 | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/cdi/common/src/main/java/org/infinispan/cdi/common/util/InjectableMethod.java#L109-L111 | train | Invoke the method with the given creational context. | Create a Java method that does the following: "Invoke the method with the given creational context.". | Of course, here is the Java code you requested:
```java
public <T> T invoke(Object receiver, CreationalContext<T> creationalContext) {
return invoke(receiver, creationalContext, null);
}
```
Hope this helps! | |
Alluxio/alluxio | core/common/src/main/java/alluxio/util/CommonUtils.java | CommonUtils.singleElementIterator | public static <T> Iterator<T> singleElementIterator(final T element) {
return new Iterator<T>() {
private boolean mHasNext = true;
@Override
public boolean hasNext() {
return mHasNext;
}
@Override
public T next() {
if (!hasNext()) {
throw new NoSuchEle... | java | public static <T> Iterator<T> singleElementIterator(final T element) {
return new Iterator<T>() {
private boolean mHasNext = true;
@Override
public boolean hasNext() {
return mHasNext;
}
@Override
public T next() {
if (!hasNext()) {
throw new NoSuchEle... | [
"public",
"static",
"<",
"T",
">",
"Iterator",
"<",
"T",
">",
"singleElementIterator",
"(",
"final",
"T",
"element",
")",
"{",
"return",
"new",
"Iterator",
"<",
"T",
">",
"(",
")",
"{",
"private",
"boolean",
"mHasNext",
"=",
"true",
";",
"@",
"Override... | Returns an iterator that iterates on a single element.
@param element the element
@param <T> the type of the element
@return the iterator | [
"Returns",
"an",
"iterator",
"that",
"iterates",
"on",
"a",
"single",
"element",
"."
] | af38cf3ab44613355b18217a3a4d961f8fec3a10 | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/util/CommonUtils.java#L439-L462 | train | Returns an iterator over the elements in the specified element. | Create a Java method that does the following: "Returns an iterator over the elements in the specified element.". | Of course, here is the Java code you requested:
```java
public static <T> Iterator<T> singleElementIterator(final T element) {
return new Iterator<T>() {
private boolean mHasNext = true;
@Override
public boolean hasNext() {
return mHasNext;
}
@Override
public T next() ... | |
igniterealtime/Smack | smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java | MultiUserChatLight.setRoomConfigs | public void setRoomConfigs(HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
setRoomConfigs(null, customConfigs);
} | java | public void setRoomConfigs(HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
setRoomConfigs(null, customConfigs);
} | [
"public",
"void",
"setRoomConfigs",
"(",
"HashMap",
"<",
"String",
",",
"String",
">",
"customConfigs",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"setRoomConfigs",
"(",
"null",
",",... | Set the room configurations.
@param customConfigs
@throws NoResponseException
@throws XMPPErrorException
@throws NotConnectedException
@throws InterruptedException | [
"Set",
"the",
"room",
"configurations",
"."
] | 870756997faec1e1bfabfac0cd6c2395b04da873 | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-experimental/src/main/java/org/jivesoftware/smackx/muclight/MultiUserChatLight.java#L484-L487 | train | Sets the room configurations for the user. | Create a Java method that does the following: "Sets the room configurations for the user.". | Of course, here is the Java code you requested:
```java
public void setRoomConfigs(HashMap<String, String> customConfigs)
throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
setRoomConfigs(null, customConfigs);
}
```
Hope this helps! | |
jboss/jboss-common-core | src/main/java/org/jboss/util/xml/catalog/Catalog.java | Catalog.resolveLocalSystem | protected String resolveLocalSystem(String systemId)
throws MalformedURLException, IOException {
String osname = System.getProperty("os.name");
boolean windows = (osname.indexOf("Windows") >= 0);
Enumeration enumt = catalogEntries.elements();
while (enumt.hasMoreElements()) {
CatalogEntry e =... | java | protected String resolveLocalSystem(String systemId)
throws MalformedURLException, IOException {
String osname = System.getProperty("os.name");
boolean windows = (osname.indexOf("Windows") >= 0);
Enumeration enumt = catalogEntries.elements();
while (enumt.hasMoreElements()) {
CatalogEntry e =... | [
"protected",
"String",
"resolveLocalSystem",
"(",
"String",
"systemId",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"String",
"osname",
"=",
"System",
".",
"getProperty",
"(",
"\"os.name\"",
")",
";",
"boolean",
"windows",
"=",
"(",
"osname",
... | Return the applicable SYSTEM system identifier in this
catalog.
<p>If a SYSTEM entry exists in the catalog file
for the system ID specified, return the mapped value.</p>
@param systemId The system ID to locate in the catalog
@return The mapped system identifier or null
@throws MalformedURLException
@throws IOExcepti... | [
"Return",
"the",
"applicable",
"SYSTEM",
"system",
"identifier",
"in",
"this",
"catalog",
"."
] | c191bb18db83fa106c6913cf34ed47989b65dc97 | https://github.com/jboss/jboss-common-core/blob/c191bb18db83fa106c6913cf34ed47989b65dc97/src/main/java/org/jboss/util/xml/catalog/Catalog.java#L1684-L1766 | test | Resolves a system ID in the local catalog. | Create a Java method that does the following: "Resolves a system ID in the local catalog.". | Of course, here is the Java code you requested:
```java
protected String resolveLocalSystem(String systemId)
throws MalformedURLException, IOException {
String osname = System.getProperty("os.name");
boolean windows = (osname.indexOf("Windows") >= 0);
Enumeration enumt = catalogEntries.elements();
... | |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/history/event/HistoryEventProcessor.java | HistoryEventProcessor.processHistoryEvents | public static void processHistoryEvents(HistoryEventCreator creator) {
HistoryEventProducer historyEventProducer = Context.getProcessEngineConfiguration().getHistoryEventProducer();
HistoryEventHandler historyEventHandler = Context.getProcessEngineConfiguration().getHistoryEventHandler();
HistoryEvent sing... | java | public static void processHistoryEvents(HistoryEventCreator creator) {
HistoryEventProducer historyEventProducer = Context.getProcessEngineConfiguration().getHistoryEventProducer();
HistoryEventHandler historyEventHandler = Context.getProcessEngineConfiguration().getHistoryEventHandler();
HistoryEvent sing... | [
"public",
"static",
"void",
"processHistoryEvents",
"(",
"HistoryEventCreator",
"creator",
")",
"{",
"HistoryEventProducer",
"historyEventProducer",
"=",
"Context",
".",
"getProcessEngineConfiguration",
"(",
")",
".",
"getHistoryEventProducer",
"(",
")",
";",
"HistoryEven... | Process an {@link HistoryEvent} and handle them directly after creation.
The {@link HistoryEvent} is created with the help of the given
{@link HistoryEventCreator} implementation.
@param creator the creator is used to create the {@link HistoryEvent} which should be thrown | [
"Process",
"an",
"{",
"@link",
"HistoryEvent",
"}",
"and",
"handle",
"them",
"directly",
"after",
"creation",
".",
"The",
"{",
"@link",
"HistoryEvent",
"}",
"is",
"created",
"with",
"the",
"help",
"of",
"the",
"given",
"{",
"@link",
"HistoryEventCreator",
"}... | 1a464fc887ef3760e53d6f91b9e5b871a0d77cc0 | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/history/event/HistoryEventProcessor.java#L69-L80 | train | Process the events of the application. | Create a Java method that does the following: "Process the events of the application.". | Of course, here is the Java code you requested:
```java
public static void processHistoryEvents(HistoryEventCreator creator) {
HistoryEventProducer historyEventProducer = Context.getProcessEngineConfiguration().getHistoryEventProducer();
HistoryEventHandler historyEventHandler = Context.getProcessEngineConfigu... | |
hatunet/spring-data-mybatis | spring-data-mybatis/src/main/java/org/springframework/data/mybatis/auditing/MybatisAuditingHandler.java | MybatisAuditingHandler.isAuditable | protected final boolean isAuditable(Object source) {
Assert.notNull(source, "Source must not be null!");
return factory.getBeanWrapperFor(source).isPresent();
} | java | protected final boolean isAuditable(Object source) {
Assert.notNull(source, "Source must not be null!");
return factory.getBeanWrapperFor(source).isPresent();
} | [
"protected",
"final",
"boolean",
"isAuditable",
"(",
"Object",
"source",
")",
"{",
"Assert",
".",
"notNull",
"(",
"source",
",",
"\"Source must not be null!\"",
")",
";",
"return",
"factory",
".",
"getBeanWrapperFor",
"(",
"source",
")",
".",
"isPresent",
"(",
... | Returns whether the given source is considered to be auditable in the first place
@param source must not be {@literal null}.
@return | [
"Returns",
"whether",
"the",
"given",
"source",
"is",
"considered",
"to",
"be",
"auditable",
"in",
"the",
"first",
"place"
] | ee6316f2c29f45e8e9ef1538957a29c21c89055f | https://github.com/hatunet/spring-data-mybatis/blob/ee6316f2c29f45e8e9ef1538957a29c21c89055f/spring-data-mybatis/src/main/java/org/springframework/data/mybatis/auditing/MybatisAuditingHandler.java#L128-L133 | train | Checks if the given object is auditable. | Create a Java method that does the following: "Checks if the given object is auditable.". | Of course, here is the Java code you requested:
```java
protected final boolean isAuditable(Object source) {
Assert.notNull(source, "Source must not be null!");
return factory.getBeanWrapperFor(source).isPresent();
}
```
Hope this helps! | |
BlueBrain/bluima | modules/bluima_abbreviations/src/main/java/com/wcohen/ss/lookup/SoftTFIDFDictionary.java | SoftTFIDFDictionary.storeUpperBound | private void storeUpperBound(Token tok, Token simTok, List usefulTokens, Map upperBoundOnWeight, double sim)
{
double upperBound = tfidfDistance.getWeight(tok)*maxTFIDFScore[simTok.getIndex()]*sim;
if (DEBUG) System.out.println("upper-bounding tok "+simTok+" sim="+sim+" to "+tok+" upperBound "+up... | java | private void storeUpperBound(Token tok, Token simTok, List usefulTokens, Map upperBoundOnWeight, double sim)
{
double upperBound = tfidfDistance.getWeight(tok)*maxTFIDFScore[simTok.getIndex()]*sim;
if (DEBUG) System.out.println("upper-bounding tok "+simTok+" sim="+sim+" to "+tok+" upperBound "+up... | [
"private",
"void",
"storeUpperBound",
"(",
"Token",
"tok",
",",
"Token",
"simTok",
",",
"List",
"usefulTokens",
",",
"Map",
"upperBoundOnWeight",
",",
"double",
"sim",
")",
"{",
"double",
"upperBound",
"=",
"tfidfDistance",
".",
"getWeight",
"(",
"tok",
")",
... | subroutine of lookup | [
"subroutine",
"of",
"lookup"
] | 793ea3f46761dce72094e057a56cddfa677156ae | https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_abbreviations/src/main/java/com/wcohen/ss/lookup/SoftTFIDFDictionary.java#L567-L574 | train | Stores the upperBound of a token in the usefulTokens list upperBoundOnWeight and upperBound on sim | Create a Java method that does the following: "Stores the upperBound of a token in the usefulTokens list upperBoundOnWeight and upperBound on sim". | Of course, here is the Java code you requested:
```java
private void storeUpperBound(Token tok, Token simTok, List usefulTokens, Map upperBoundOnWeight, double sim)
{
double upperBound = tfidfDistance.getWeight(tok)*maxTFIDFScore[simTok.getIndex()]*sim;
if (DEBUG) System.out.println("upper-bound... | |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java | VelocityParser.getTableElement | public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context)
{
return getParameters(array, currentIndex, velocityBlock, ']', context);
} | java | public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context)
{
return getParameters(array, currentIndex, velocityBlock, ']', context);
} | [
"public",
"int",
"getTableElement",
"(",
"char",
"[",
"]",
"array",
",",
"int",
"currentIndex",
",",
"StringBuffer",
"velocityBlock",
",",
"VelocityParserContext",
"context",
")",
"{",
"return",
"getParameters",
"(",
"array",
",",
"currentIndex",
",",
"velocityBlo... | Get a Velocity table.
@param array the source to parse
@param currentIndex the current index in the <code>array</code>
@param velocityBlock the buffer where to append matched velocity block
@param context the parser context to put some informations
@return the index in the <code>array</code> after the matched block | [
"Get",
"a",
"Velocity",
"table",
"."
] | 5374d8c6d966588c1eac7392c83da610dfb9f129 | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-velocity/src/main/java/org/xwiki/velocity/internal/util/VelocityParser.java#L517-L521 | train | Gets the table element. | Create a Java method that does the following: "Gets the table element.". | Of course, here is the Java code you requested:
```java
public int getTableElement(char[] array, int currentIndex, StringBuffer velocityBlock,
VelocityParserContext context)
{
return getParameters(array, currentIndex, velocityBlock, ']', context);
}
```
Hope this helps! | |
Hack23/cia | service.impl/src/main/java/com/hack23/cia/service/impl/rules/AbstractComplianceCheckImpl.java | AbstractComplianceCheckImpl.getRuleSummary | @Override
public final String getRuleSummary() {
final Collection<RuleViolation> values = ruleViolationMap.values();
final StringBuilder builder = new StringBuilder();
for (final RuleViolation ruleViolation : values) {
builder.append('[').append(ruleViolation.getRuleName()).append('/').append(ruleViolation.ge... | java | @Override
public final String getRuleSummary() {
final Collection<RuleViolation> values = ruleViolationMap.values();
final StringBuilder builder = new StringBuilder();
for (final RuleViolation ruleViolation : values) {
builder.append('[').append(ruleViolation.getRuleName()).append('/').append(ruleViolation.ge... | [
"@",
"Override",
"public",
"final",
"String",
"getRuleSummary",
"(",
")",
"{",
"final",
"Collection",
"<",
"RuleViolation",
">",
"values",
"=",
"ruleViolationMap",
".",
"values",
"(",
")",
";",
"final",
"StringBuilder",
"builder",
"=",
"new",
"StringBuilder",
... | Gets the rule summary.
@return the rule summary | [
"Gets",
"the",
"rule",
"summary",
"."
] | 223312ca0eec74888a57a060de5b164f95a7785f | https://github.com/Hack23/cia/blob/223312ca0eec74888a57a060de5b164f95a7785f/service.impl/src/main/java/com/hack23/cia/service/impl/rules/AbstractComplianceCheckImpl.java#L98-L106 | valid | Gets the rule summary. | Create a Java method that does the following: "Gets the rule summary.". | Of course, here is the Java code you requested:
```java
@Override
public final String getRuleSummary() {
final Collection<RuleViolation> values = ruleViolationMap.values();
final StringBuilder builder = new StringBuilder();
for (final RuleViolation ruleViolation : values) {
builder.append('[').append(ruleVio... | |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/painter/TitlePaneMaximizeButtonPainter.java | TitlePaneMaximizeButtonPainter.paintBackground | private void paintBackground(Graphics2D g, JComponent c, int width, int height, ButtonColors colors) {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
g.setColor(colors.top);
g.drawLine(0, 0, width - 2, 0);
g.setColor(colors.left);
g.drawL... | java | private void paintBackground(Graphics2D g, JComponent c, int width, int height, ButtonColors colors) {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
g.setColor(colors.top);
g.drawLine(0, 0, width - 2, 0);
g.setColor(colors.left);
g.drawL... | [
"private",
"void",
"paintBackground",
"(",
"Graphics2D",
"g",
",",
"JComponent",
"c",
",",
"int",
"width",
",",
"int",
"height",
",",
"ButtonColors",
"colors",
")",
"{",
"g",
".",
"setRenderingHint",
"(",
"RenderingHints",
".",
"KEY_ANTIALIASING",
",",
"Render... | Paint the background of the button using the specified colors.
@param g the Graphics2D context to paint with.
@param c the component.
@param width the width of the component.
@param height the height of the component.
@param colors the color set to use to paint the button. | [
"Paint",
"the",
"background",
"of",
"the",
"button",
"using",
"the",
"specified",
"colors",
"."
] | f25ecba622923d7b29b64cb7d6068dd8005989b3 | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/painter/TitlePaneMaximizeButtonPainter.java#L246-L259 | train | Paint the background of the button. | Create a Java method that does the following: "Paint the background of the button.". | Of course, here is the Java code you requested:
```java
private void paintBackground(Graphics2D g, JComponent c, int width, int height, ButtonColors colors) {
g.setRenderingHint(RenderingHints.KEY_ANTIALIASING, RenderingHints.VALUE_ANTIALIAS_OFF);
g.setColor(colors.top);
g.drawLine(0, 0, width ... | |
ModeShape/modeshape | sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/DdlTokenStream.java | DdlTokenStream.computeNextStatementStartKeywordCount | public int computeNextStatementStartKeywordCount() {
int result = 0;
if (isNextKeyWord()) {
for (String[] nextStmtStart : registeredStatementStartPhrases) {
if (this.matches(nextStmtStart)) {
return nextStmtStart.length;
}
}
... | java | public int computeNextStatementStartKeywordCount() {
int result = 0;
if (isNextKeyWord()) {
for (String[] nextStmtStart : registeredStatementStartPhrases) {
if (this.matches(nextStmtStart)) {
return nextStmtStart.length;
}
}
... | [
"public",
"int",
"computeNextStatementStartKeywordCount",
"(",
")",
"{",
"int",
"result",
"=",
"0",
";",
"if",
"(",
"isNextKeyWord",
"(",
")",
")",
"{",
"for",
"(",
"String",
"[",
"]",
"nextStmtStart",
":",
"registeredStatementStartPhrases",
")",
"{",
"if",
... | Method to determine if next tokens match a registered statement start phrase.
@return number of keywords in matched registered statement start phrase or zero if not matched | [
"Method",
"to",
"determine",
"if",
"next",
"tokens",
"match",
"a",
"registered",
"statement",
"start",
"phrase",
"."
] | 794cfdabb67a90f24629c4fff0424a6125f8f95b | https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/sequencers/modeshape-sequencer-ddl/src/main/java/org/modeshape/sequencer/ddl/DdlTokenStream.java#L189-L201 | train | Compute the number of keywords in the next statement start phrase. | Create a Java method that does the following: "Compute the number of keywords in the next statement start phrase.". | Of course, here is the Java code you requested:
```java
public int computeNextStatementStartKeywordCount() {
int result = 0;
if (isNextKeyWord()) {
for (String[] nextStmtStart : registeredStatementStartPhrases) {
if (this.matches(nextStmtStart)) {
return... | |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java | LocaleFormatter.getFormatted | @Nonnull
public static String getFormatted (final double dValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getNumberInstance (aDisplayLocale).format (dValue);
} | java | @Nonnull
public static String getFormatted (final double dValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getNumberInstance (aDisplayLocale).format (dValue);
} | [
"@",
"Nonnull",
"public",
"static",
"String",
"getFormatted",
"(",
"final",
"double",
"dValue",
",",
"@",
"Nonnull",
"final",
"Locale",
"aDisplayLocale",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aDisplayLocale",
",",
"\"DisplayLocale\"",
")",
";",
"retur... | Format the passed value according to the rules specified by the given
locale. All calls to {@link Double#toString(double)} that are displayed to
the user should instead use this method.
@param dValue
The value to be formatted.
@param aDisplayLocale
The locale to be used. May not be <code>null</code>.
@return The forma... | [
"Format",
"the",
"passed",
"value",
"according",
"to",
"the",
"rules",
"specified",
"by",
"the",
"given",
"locale",
".",
"All",
"calls",
"to",
"{",
"@link",
"Double#toString",
"(",
"double",
")",
"}",
"that",
"are",
"displayed",
"to",
"the",
"user",
"shoul... | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/locale/LocaleFormatter.java#L56-L62 | train | Get the formatted value of the passed double value. | Create a Java method that does the following: "Get the formatted value of the passed double value.". | Of course, here is the Java code you requested:
```java
@Nonnull
public static String getFormatted (final double dValue, @Nonnull final Locale aDisplayLocale)
{
ValueEnforcer.notNull (aDisplayLocale, "DisplayLocale");
return NumberFormat.getNumberInstance (aDisplayLocale).format (dValue);
}
```
Hope th... | |
aws/aws-sdk-java | aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ModifyCapacityReservationRequest.java | ModifyCapacityReservationRequest.getDryRunRequest | @Override
public Request<ModifyCapacityReservationRequest> getDryRunRequest() {
Request<ModifyCapacityReservationRequest> request = new ModifyCapacityReservationRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
} | java | @Override
public Request<ModifyCapacityReservationRequest> getDryRunRequest() {
Request<ModifyCapacityReservationRequest> request = new ModifyCapacityReservationRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toString(true));
return request;
} | [
"@",
"Override",
"public",
"Request",
"<",
"ModifyCapacityReservationRequest",
">",
"getDryRunRequest",
"(",
")",
"{",
"Request",
"<",
"ModifyCapacityReservationRequest",
">",
"request",
"=",
"new",
"ModifyCapacityReservationRequestMarshaller",
"(",
")",
".",
"marshall",
... | This method is intended for internal use only. Returns the marshaled request configured with additional
parameters to enable operation dry-run. | [
"This",
"method",
"is",
"intended",
"for",
"internal",
"use",
"only",
".",
"Returns",
"the",
"marshaled",
"request",
"configured",
"with",
"additional",
"parameters",
"to",
"enable",
"operation",
"dry",
"-",
"run",
"."
] | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/ModifyCapacityReservationRequest.java#L438-L443 | train | Returns a request configured to delete the resource in the DryRun state. | Create a Java method that does the following: "Returns a request configured to delete the resource in the DryRun state.". | Of course, here is the Java code you requested:
```java
@Override
public Request<ModifyCapacityReservationRequest> getDryRunRequest() {
Request<ModifyCapacityReservationRequest> request = new ModifyCapacityReservationRequestMarshaller().marshall(this);
request.addParameter("DryRun", Boolean.toStrin... | |
google/error-prone | check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java | SuggestedFixes.removeModifiers | public static Optional<SuggestedFix> removeModifiers(
ModifiersTree originalModifiers, VisitorState state, Set<Modifier> toRemove) {
SuggestedFix.Builder fix = SuggestedFix.builder();
List<ErrorProneToken> tokens = state.getTokensForNode(originalModifiers);
int basePos = ((JCTree) originalModifiers).g... | java | public static Optional<SuggestedFix> removeModifiers(
ModifiersTree originalModifiers, VisitorState state, Set<Modifier> toRemove) {
SuggestedFix.Builder fix = SuggestedFix.builder();
List<ErrorProneToken> tokens = state.getTokensForNode(originalModifiers);
int basePos = ((JCTree) originalModifiers).g... | [
"public",
"static",
"Optional",
"<",
"SuggestedFix",
">",
"removeModifiers",
"(",
"ModifiersTree",
"originalModifiers",
",",
"VisitorState",
"state",
",",
"Set",
"<",
"Modifier",
">",
"toRemove",
")",
"{",
"SuggestedFix",
".",
"Builder",
"fix",
"=",
"SuggestedFix"... | Adds modifiers to the given declaration and corresponding modifiers tree. | [
"Adds",
"modifiers",
"to",
"the",
"given",
"declaration",
"and",
"corresponding",
"modifiers",
"tree",
"."
] | fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d | https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/fixes/SuggestedFixes.java#L240-L257 | train | Removes all modifiers from originalModifiers. | Create a Java method that does the following: "Removes all modifiers from originalModifiers.". | Of course, here is the Java code you requested:
```java
public static Optional<SuggestedFix> removeModifiers(
ModifiersTree originalModifiers, VisitorState state, Set<Modifier> toRemove) {
SuggestedFix.Builder fix = SuggestedFix.builder();
List<ErrorProneToken> tokens = state.getTokensForNode(originalMod... | |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/report/ReportThrowablePanel.java | ReportThrowablePanel.newSubmitButton | protected Button newSubmitButton(final String id)
{
return new Button(id)
{
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onSubmit()
{
/**
* Here comes the action what to do like (i.e. Send Email)
*/
onSubmitError(null);
}... | java | protected Button newSubmitButton(final String id)
{
return new Button(id)
{
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onSubmit()
{
/**
* Here comes the action what to do like (i.e. Send Email)
*/
onSubmitError(null);
}... | [
"protected",
"Button",
"newSubmitButton",
"(",
"final",
"String",
"id",
")",
"{",
"return",
"new",
"Button",
"(",
"id",
")",
"{",
"private",
"static",
"final",
"long",
"serialVersionUID",
"=",
"1L",
";",
"/**\n\t\t\t * {@inheritDoc}\n\t\t\t */",
"@",
"Override",
... | Factory method for creating the new {@link Button}. This method is invoked in the constructor
from the derived classes and can be overridden so users can provide their own version of a
new {@link Button}.
@param id
the id
@return the new {@link Button} | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"Button",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"... | 85d74368d00abd9bb97659b5794e38c0f8a013d4 | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/report/ReportThrowablePanel.java#L193-L211 | train | Creates a new submit button. | Create a Java method that does the following: "Creates a new submit button.". | Of course, here is the Java code you requested:
```java
protected Button newSubmitButton(final String id)
{
return new Button(id)
{
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onSubmit()
{
/**
* Here comes the action what to do lik... | |
apptik/jus | jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java | HttpHeaderParser.parseCacheHeaders | public static Cache.Entry parseCacheHeaders(NetworkResponse response) {
long now = System.currentTimeMillis();
Headers headers = response.headers;
long serverDate = 0;
long lastModified = 0;
long serverExpires = 0;
long softExpire = 0;
long finalExpire = 0;
... | java | public static Cache.Entry parseCacheHeaders(NetworkResponse response) {
long now = System.currentTimeMillis();
Headers headers = response.headers;
long serverDate = 0;
long lastModified = 0;
long serverExpires = 0;
long softExpire = 0;
long finalExpire = 0;
... | [
"public",
"static",
"Cache",
".",
"Entry",
"parseCacheHeaders",
"(",
"NetworkResponse",
"response",
")",
"{",
"long",
"now",
"=",
"System",
".",
"currentTimeMillis",
"(",
")",
";",
"Headers",
"headers",
"=",
"response",
".",
"headers",
";",
"long",
"serverDate... | Extracts a {@link Cache.Entry} from a {@link NetworkResponse}.
@param response The network response to parse headers from
@return a cache entry for the given response, or null if the response is not cacheable. | [
"Extracts",
"a",
"{",
"@link",
"Cache",
".",
"Entry",
"}",
"from",
"a",
"{",
"@link",
"NetworkResponse",
"}",
"."
] | 8a37a21b41f897d68eaeaab07368ec22a1e5a60e | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/toolbox/HttpHeaderParser.java#L42-L129 | train | Parses the cache headers from the response. | Create a Java method that does the following: "Parses the cache headers from the response.". | Of course, here is the Java code you requested:
```java
public static Cache.Entry parseCacheHeaders(NetworkResponse response) {
long now = System.currentTimeMillis();
Headers headers = response.headers;
long serverDate = 0;
long lastModified = 0;
long serverExpires = 0;
... | |
liferay/com-liferay-commerce | commerce-price-list-api/src/main/java/com/liferay/commerce/price/list/service/CommercePriceListUserSegmentEntryRelLocalServiceUtil.java | CommercePriceListUserSegmentEntryRelLocalServiceUtil.getCommercePriceListUserSegmentEntryRelByUuidAndGroupId | public static com.liferay.commerce.price.list.model.CommercePriceListUserSegmentEntryRel getCommercePriceListUserSegmentEntryRelByUuidAndGroupId(
String uuid, long groupId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getCommercePriceListUserSegmentEntryRelByUuidAndGrou... | java | public static com.liferay.commerce.price.list.model.CommercePriceListUserSegmentEntryRel getCommercePriceListUserSegmentEntryRelByUuidAndGroupId(
String uuid, long groupId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
.getCommercePriceListUserSegmentEntryRelByUuidAndGrou... | [
"public",
"static",
"com",
".",
"liferay",
".",
"commerce",
".",
"price",
".",
"list",
".",
"model",
".",
"CommercePriceListUserSegmentEntryRel",
"getCommercePriceListUserSegmentEntryRelByUuidAndGroupId",
"(",
"String",
"uuid",
",",
"long",
"groupId",
")",
"throws",
"... | Returns the commerce price list user segment entry rel matching the UUID and group.
@param uuid the commerce price list user segment entry rel's UUID
@param groupId the primary key of the group
@return the matching commerce price list user segment entry rel
@throws PortalException if a matching commerce price list use... | [
"Returns",
"the",
"commerce",
"price",
"list",
"user",
"segment",
"entry",
"rel",
"matching",
"the",
"UUID",
"and",
"group",
"."
] | 9e54362d7f59531fc684016ba49ee7cdc3a2f22b | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-price-list-api/src/main/java/com/liferay/commerce/price/list/service/CommercePriceListUserSegmentEntryRelLocalServiceUtil.java#L253-L259 | train | Returns the commerce price list user segment entry rel matching the UUID and group. | Create a Java method that does the following: "Returns the commerce price list user segment entry rel matching the UUID and group.". | Of course, here is the Java code you requested:
```java
public static com.liferay.commerce.price.list.model.CommercePriceListUserSegmentEntryRel getCommercePriceListUserSegmentEntryRelByUuidAndGroupId(
String uuid, long groupId)
throws com.liferay.portal.kernel.exception.PortalException {
return getService()
... | |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/functions/util/RuntimeUDFContext.java | RuntimeUDFContext.setBroadcastVariable | public void setBroadcastVariable(String name, List<?> value) {
this.uninitializedBroadcastVars.put(name, value);
this.initializedBroadcastVars.remove(name);
} | java | public void setBroadcastVariable(String name, List<?> value) {
this.uninitializedBroadcastVars.put(name, value);
this.initializedBroadcastVars.remove(name);
} | [
"public",
"void",
"setBroadcastVariable",
"(",
"String",
"name",
",",
"List",
"<",
"?",
">",
"value",
")",
"{",
"this",
".",
"uninitializedBroadcastVars",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"this",
".",
"initializedBroadcastVars",
".",
"remove"... | -------------------------------------------------------------------------------------------- | [
"--------------------------------------------------------------------------------------------"
] | b62db93bf63cb3bb34dd03d611a779d9e3fc61ac | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/functions/util/RuntimeUDFContext.java#L107-L110 | train | Sets a broadcast variable to the given list of values. | Create a Java method that does the following: "Sets a broadcast variable to the given list of values.". | Of course, here is the Java code you requested:
```java
public void setBroadcastVariable(String name, List<?> value) {
this.uninitializedBroadcastVars.put(name, value);
this.initializedBroadcastVars.remove(name);
}
```
Hope this helps! | |
DDTH/ddth-kafka | src/main/java/com/github/ddth/kafka/KafkaClient.java | KafkaClient.setExecutorService | public KafkaClient setExecutorService(ExecutorService executorService) {
if (this.executorService != null) {
this.executorService.shutdown();
}
this.executorService = executorService;
myOwnExecutorService = false;
return this;
} | java | public KafkaClient setExecutorService(ExecutorService executorService) {
if (this.executorService != null) {
this.executorService.shutdown();
}
this.executorService = executorService;
myOwnExecutorService = false;
return this;
} | [
"public",
"KafkaClient",
"setExecutorService",
"(",
"ExecutorService",
"executorService",
")",
"{",
"if",
"(",
"this",
".",
"executorService",
"!=",
"null",
")",
"{",
"this",
".",
"executorService",
".",
"shutdown",
"(",
")",
";",
"}",
"this",
".",
"executorSe... | Sets an {@link ExecutorService} to be used for async task.
@param executorService
@return | [
"Sets",
"an",
"{",
"@link",
"ExecutorService",
"}",
"to",
"be",
"used",
"for",
"async",
"task",
"."
] | aaeb8536e28a109ac0b69022f0ea4bbf5696b76f | https://github.com/DDTH/ddth-kafka/blob/aaeb8536e28a109ac0b69022f0ea4bbf5696b76f/src/main/java/com/github/ddth/kafka/KafkaClient.java#L153-L160 | train | Sets the executor service. | Create a Java method that does the following: "Sets the executor service.". | Of course, here is the Java code you requested:
```java
public KafkaClient setExecutorService(ExecutorService executorService) {
if (this.executorService != null) {
this.executorService.shutdown();
}
this.executorService = executorService;
myOwnExecutorService = false;
... | |
Commonjava/webdav-handler | common/src/main/java/net/sf/webdav/locking/LockedObject.java | LockedObject.checkChildren | private boolean checkChildren(boolean exclusive, int depth) {
if (_children == null) {
// a file
return _owner == null || !(_exclusive || exclusive);
} else {
// a folder
if (_owner == null) {
// no owner, checking children
... | java | private boolean checkChildren(boolean exclusive, int depth) {
if (_children == null) {
// a file
return _owner == null || !(_exclusive || exclusive);
} else {
// a folder
if (_owner == null) {
// no owner, checking children
... | [
"private",
"boolean",
"checkChildren",
"(",
"boolean",
"exclusive",
",",
"int",
"depth",
")",
"{",
"if",
"(",
"_children",
"==",
"null",
")",
"{",
"// a file",
"return",
"_owner",
"==",
"null",
"||",
"!",
"(",
"_exclusive",
"||",
"exclusive",
")",
";",
"... | helper of checkLocks(). looks if the children are locked
@param exclusive
wheather the new lock should be exclusive
@return true if no locks at the children paths are forbidding a new lock
@param depth
depth | [
"helper",
"of",
"checkLocks",
"()",
".",
"looks",
"if",
"the",
"children",
"are",
"locked"
] | 39bb7032fc75c1b67d3f2440dd1c234ead96cb9d | https://github.com/Commonjava/webdav-handler/blob/39bb7032fc75c1b67d3f2440dd1c234ead96cb9d/common/src/main/java/net/sf/webdav/locking/LockedObject.java#L298-L328 | train | Check if the children of this class are locked. | Create a Java method that does the following: "Check if the children of this class are locked.". | Of course, here is the Java code you requested:
```java
private boolean checkChildren(boolean exclusive, int depth) {
if (_children == null) {
// a file
return _owner == null || !(_exclusive || exclusive);
} else {
// a folder
if (_owner == null) {
... | |
ebean-orm/querybean-agent-now-merged-into-ebean-agent- | src/main/java/io/ebean/typequery/agent/offline/OfflineFileTransform.java | OfflineFileTransform.process | public void process(String packageNames) {
if (packageNames == null) {
processPackage("", true);
return;
}
String[] pkgs = packageNames.split(",");
for (int i = 0; i < pkgs.length; i++) {
String pkg = pkgs[i].trim().replace('.', '/');
boolean recurse = false;
if (pkg.endsWith("**")) {
rec... | java | public void process(String packageNames) {
if (packageNames == null) {
processPackage("", true);
return;
}
String[] pkgs = packageNames.split(",");
for (int i = 0; i < pkgs.length; i++) {
String pkg = pkgs[i].trim().replace('.', '/');
boolean recurse = false;
if (pkg.endsWith("**")) {
rec... | [
"public",
"void",
"process",
"(",
"String",
"packageNames",
")",
"{",
"if",
"(",
"packageNames",
"==",
"null",
")",
"{",
"processPackage",
"(",
"\"\"",
",",
"true",
")",
";",
"return",
";",
"}",
"String",
"[",
"]",
"pkgs",
"=",
"packageNames",
".",
"sp... | Process all the comma delimited list of packages.
<p>
Package names are effectively converted into a directory on the file
system, and the class files are found and processed.
</p> | [
"Process",
"all",
"the",
"comma",
"delimited",
"list",
"of",
"packages",
".",
"<p",
">",
"Package",
"names",
"are",
"effectively",
"converted",
"into",
"a",
"directory",
"on",
"the",
"file",
"system",
"and",
"the",
"class",
"files",
"are",
"found",
"and",
... | a063554fabdbed15ff5e10ad0a0b53b67e039006 | https://github.com/ebean-orm/querybean-agent-now-merged-into-ebean-agent-/blob/a063554fabdbed15ff5e10ad0a0b53b67e039006/src/main/java/io/ebean/typequery/agent/offline/OfflineFileTransform.java#L61-L86 | train | Process the packageNames. | Create a Java method that does the following: "Process the packageNames.". | Of course, here is the Java code you requested:
```java
public void process(String packageNames) {
if (packageNames == null) {
processPackage("", true);
return;
}
String[] pkgs = packageNames.split(",");
for (int i = 0; i < pkgs.length; i++) {
String pkg = pkgs[i].trim().replace('.', '/');
bool... | |
Graylog2/gelfclient | src/main/java/org/graylog2/gelfclient/transport/AbstractGelfTransport.java | AbstractGelfTransport.send | @Override
public void send(final GelfMessage message) throws InterruptedException {
LOG.debug("Sending message: {}", message);
queue.put(message);
} | java | @Override
public void send(final GelfMessage message) throws InterruptedException {
LOG.debug("Sending message: {}", message);
queue.put(message);
} | [
"@",
"Override",
"public",
"void",
"send",
"(",
"final",
"GelfMessage",
"message",
")",
"throws",
"InterruptedException",
"{",
"LOG",
".",
"debug",
"(",
"\"Sending message: {}\"",
",",
"message",
")",
";",
"queue",
".",
"put",
"(",
"message",
")",
";",
"}"
] | {@inheritDoc}
<p>This implementation is backed by a {@link java.util.concurrent.BlockingQueue}. When this method returns the
message has been added to the {@link java.util.concurrent.BlockingQueue} but has not been sent to the remote
host yet.</p>
@param message message to send to the remote host | [
"{",
"@inheritDoc",
"}",
"<p",
">",
"This",
"implementation",
"is",
"backed",
"by",
"a",
"{",
"@link",
"java",
".",
"util",
".",
"concurrent",
".",
"BlockingQueue",
"}",
".",
"When",
"this",
"method",
"returns",
"the",
"message",
"has",
"been",
"added",
... | 87cf261e81addaf4e8c93f75020def0c32f9e69f | https://github.com/Graylog2/gelfclient/blob/87cf261e81addaf4e8c93f75020def0c32f9e69f/src/main/java/org/graylog2/gelfclient/transport/AbstractGelfTransport.java#L86-L90 | train | Send a message to the application. | Create a Java method that does the following: "Send a message to the application.". | Of course, here is the Java code you requested:
```java
@Override
public void send(final GelfMessage message) throws InterruptedException {
LOG.debug("Sending message: {}", message);
queue.put(message);
}
```
Hope this helps! | |
kmi/iserve | iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ConcurrentSparqlGraphStoreManager.java | ConcurrentSparqlGraphStoreManager.loadDefaultModels | private boolean loadDefaultModels() {
Map<URI, Future<Boolean>> concurrentTasks = new HashMap<URI, Future<Boolean>>();
for (URI modelUri : baseModels) {
if (modelUri != null && modelUri.isAbsolute() && !this.containsGraph(modelUri)) {
concurrentTasks.put(modelUri, this.async... | java | private boolean loadDefaultModels() {
Map<URI, Future<Boolean>> concurrentTasks = new HashMap<URI, Future<Boolean>>();
for (URI modelUri : baseModels) {
if (modelUri != null && modelUri.isAbsolute() && !this.containsGraph(modelUri)) {
concurrentTasks.put(modelUri, this.async... | [
"private",
"boolean",
"loadDefaultModels",
"(",
")",
"{",
"Map",
"<",
"URI",
",",
"Future",
"<",
"Boolean",
">",
">",
"concurrentTasks",
"=",
"new",
"HashMap",
"<",
"URI",
",",
"Future",
"<",
"Boolean",
">",
">",
"(",
")",
";",
"for",
"(",
"URI",
"mo... | Loads the default models for this Graph Store and verifies they were correctly retrieved
NOTE: For now models with local mappings cannot be TTL for Jena does not guess the format properly in that case.
We need to specify the format while loading in this case.
This method pre-checks the presence of the model already in... | [
"Loads",
"the",
"default",
"models",
"for",
"this",
"Graph",
"Store",
"and",
"verifies",
"they",
"were",
"correctly",
"retrieved",
"NOTE",
":",
"For",
"now",
"models",
"with",
"local",
"mappings",
"cannot",
"be",
"TTL",
"for",
"Jena",
"does",
"not",
"guess",... | 13e7016e64c1d5a539b838c6debf1a5cc4aefcb7 | https://github.com/kmi/iserve/blob/13e7016e64c1d5a539b838c6debf1a5cc4aefcb7/iserve-sal-core/src/main/java/uk/ac/open/kmi/iserve/sal/manager/impl/ConcurrentSparqlGraphStoreManager.java#L237-L264 | train | Load the default models. | Create a Java method that does the following: "Load the default models.". | Of course, here is the Java code you requested:
```java
private boolean loadDefaultModels() {
Map<URI, Future<Boolean>> concurrentTasks = new HashMap<URI, Future<Boolean>>();
for (URI modelUri : baseModels) {
if (modelUri != null && modelUri.isAbsolute() && !this.containsGraph(modelUri)) {... | |
apache/incubator-druid | server/src/main/java/org/apache/druid/server/coordinator/CostBalancerStrategy.java | CostBalancerStrategy.calculateInitialTotalCost | public double calculateInitialTotalCost(final List<ServerHolder> serverHolders)
{
double cost = 0;
for (ServerHolder server : serverHolders) {
Iterable<DataSegment> segments = server.getServer().getLazyAllSegments();
for (DataSegment s : segments) {
cost += computeJointSegmentsCost(s, segm... | java | public double calculateInitialTotalCost(final List<ServerHolder> serverHolders)
{
double cost = 0;
for (ServerHolder server : serverHolders) {
Iterable<DataSegment> segments = server.getServer().getLazyAllSegments();
for (DataSegment s : segments) {
cost += computeJointSegmentsCost(s, segm... | [
"public",
"double",
"calculateInitialTotalCost",
"(",
"final",
"List",
"<",
"ServerHolder",
">",
"serverHolders",
")",
"{",
"double",
"cost",
"=",
"0",
";",
"for",
"(",
"ServerHolder",
"server",
":",
"serverHolders",
")",
"{",
"Iterable",
"<",
"DataSegment",
"... | Calculates the initial cost of the Druid segment configuration.
@param serverHolders A list of ServerHolders for a particular tier.
@return The initial cost of the Druid tier. | [
"Calculates",
"the",
"initial",
"cost",
"of",
"the",
"Druid",
"segment",
"configuration",
"."
] | f776b9408962b9006cfcfe4d6c1794751972cc8e | https://github.com/apache/incubator-druid/blob/f776b9408962b9006cfcfe4d6c1794751972cc8e/server/src/main/java/org/apache/druid/server/coordinator/CostBalancerStrategy.java#L257-L267 | train | Calculate the total cost of the segments of all server holders. | Create a Java method that does the following: "Calculate the total cost of the segments of all server holders.". | Of course, here is the Java code you requested:
```java
public double calculateInitialTotalCost(final List<ServerHolder> serverHolders)
{
double cost = 0;
for (ServerHolder server : serverHolders) {
Iterable<DataSegment> segments = server.getServer().getLazyAllSegments();
for (DataSegment s : seg... | |
baratine/baratine | kraken/src/main/java/com/caucho/v5/kelp/BlockLeaf.java | BlockLeaf.findFirstSorted | private boolean findFirstSorted(RowCursor minCursor,
RowCursor resultCursor,
boolean isMatch)
{
int rowOffset = _rowSortHead;
int rowLength = resultCursor.length();
int cmp = resultCursor.compareKey(_keyMinSort, 0);
if (cmp < 0 || c... | java | private boolean findFirstSorted(RowCursor minCursor,
RowCursor resultCursor,
boolean isMatch)
{
int rowOffset = _rowSortHead;
int rowLength = resultCursor.length();
int cmp = resultCursor.compareKey(_keyMinSort, 0);
if (cmp < 0 || c... | [
"private",
"boolean",
"findFirstSorted",
"(",
"RowCursor",
"minCursor",
",",
"RowCursor",
"resultCursor",
",",
"boolean",
"isMatch",
")",
"{",
"int",
"rowOffset",
"=",
"_rowSortHead",
";",
"int",
"rowLength",
"=",
"resultCursor",
".",
"length",
"(",
")",
";",
... | In a sorted block, find the minimum key less than the currentResult
and greater than the min.
The sort is reverse order. The smallest value is at the end.
@param minCursor the minimum allowed key value for the search
@param resultCursor the current best match for the search
@param isMatch true if the current resultCu... | [
"In",
"a",
"sorted",
"block",
"find",
"the",
"minimum",
"key",
"less",
"than",
"the",
"currentResult",
"and",
"greater",
"than",
"the",
"min",
"."
] | db34b45c03c5a5e930d8142acc72319125569fcf | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/kraken/src/main/java/com/caucho/v5/kelp/BlockLeaf.java#L409-L472 | train | Find the first row in the block that is sorted by the given min cursor. | Create a Java method that does the following: "Find the first row in the block that is sorted by the given min cursor.". | Of course, here is the Java code you requested:
```java
private boolean findFirstSorted(RowCursor minCursor,
RowCursor resultCursor,
boolean isMatch)
{
int rowOffset = _rowSortHead;
int rowLength = resultCursor.length();
int cmp = resul... | |
phax/ph-commons | ph-tree/src/main/java/com/helger/tree/util/TreeWithIDBuilder.java | TreeWithIDBuilder.buildTree | @Nonnull
public static <KEYTYPE, DATATYPE extends IHasID <KEYTYPE>> DefaultTreeWithID <KEYTYPE, DATATYPE> buildTree (@Nonnull final Collection <? extends DATATYPE> aAll,
@Nonnull final IParentProvider <DATATY... | java | @Nonnull
public static <KEYTYPE, DATATYPE extends IHasID <KEYTYPE>> DefaultTreeWithID <KEYTYPE, DATATYPE> buildTree (@Nonnull final Collection <? extends DATATYPE> aAll,
@Nonnull final IParentProvider <DATATY... | [
"@",
"Nonnull",
"public",
"static",
"<",
"KEYTYPE",
",",
"DATATYPE",
"extends",
"IHasID",
"<",
"KEYTYPE",
">",
">",
"DefaultTreeWithID",
"<",
"KEYTYPE",
",",
"DATATYPE",
">",
"buildTree",
"(",
"@",
"Nonnull",
"final",
"Collection",
"<",
"?",
"extends",
"DATA... | A generic method to build a tree of objects.
@param <KEYTYPE>
The tree key type.
@param <DATATYPE>
The tree item value type.
@param aAll
A linear list of objects to build the tree from. May not be
<code>null</code>.
@param aParentResolver
The callback method to determine the parental object of a given
object. May not ... | [
"A",
"generic",
"method",
"to",
"build",
"a",
"tree",
"of",
"objects",
"."
] | d28c03565f44a0b804d96028d0969f9bb38c4313 | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-tree/src/main/java/com/helger/tree/util/TreeWithIDBuilder.java#L117-L125 | train | Build a tree from a collection of data. | Create a Java method that does the following: "Build a tree from a collection of data.". | Of course, here is the Java code you requested:
```java
@Nonnull
public static <KEYTYPE, DATATYPE extends IHasID <KEYTYPE>> DefaultTreeWithID <KEYTYPE, DATATYPE> buildTree (@Nonnull final Collection <? extends DATATYPE> aAll,
... | |
zrlio/disni | src/main/java/com/ibm/disni/RdmaEndpoint.java | RdmaEndpoint.dispatchCmEvent | public synchronized void dispatchCmEvent(RdmaCmEvent cmEvent)
throws IOException {
try {
int eventType = cmEvent.getEvent();
if (eventType == RdmaCmEvent.EventType.RDMA_CM_EVENT_ADDR_RESOLVED.ordinal()) {
connState = RdmaEndpoint.CONN_STATE_ADDR_RESOLVED;
notifyAll();
} else if (cmEvent.getEvent()... | java | public synchronized void dispatchCmEvent(RdmaCmEvent cmEvent)
throws IOException {
try {
int eventType = cmEvent.getEvent();
if (eventType == RdmaCmEvent.EventType.RDMA_CM_EVENT_ADDR_RESOLVED.ordinal()) {
connState = RdmaEndpoint.CONN_STATE_ADDR_RESOLVED;
notifyAll();
} else if (cmEvent.getEvent()... | [
"public",
"synchronized",
"void",
"dispatchCmEvent",
"(",
"RdmaCmEvent",
"cmEvent",
")",
"throws",
"IOException",
"{",
"try",
"{",
"int",
"eventType",
"=",
"cmEvent",
".",
"getEvent",
"(",
")",
";",
"if",
"(",
"eventType",
"==",
"RdmaCmEvent",
".",
"EventType"... | /* (non-Javadoc)
@see com.ibm.jverbs.endpoints.ICmConsumer#dispatchCmEvent(com.ibm.jverbs.cm.RdmaCmEvent) | [
"/",
"*",
"(",
"non",
"-",
"Javadoc",
")"
] | cfcee63cf054fb151f459357f601d7717f658b6c | https://github.com/zrlio/disni/blob/cfcee63cf054fb151f459357f601d7717f658b6c/src/main/java/com/ibm/disni/RdmaEndpoint.java#L135-L161 | train | This method dispatches the RdmaCMEvent to the RdmaEndpoint. | Create a Java method that does the following: "This method dispatches the RdmaCMEvent to the RdmaEndpoint.". | Of course, here is the Java code you requested:
```java
public synchronized void dispatchCmEvent(RdmaCmEvent cmEvent)
throws IOException {
try {
int eventType = cmEvent.getEvent();
if (eventType == RdmaCmEvent.EventType.RDMA_CM_EVENT_ADDR_RESOLVED.ordinal()) {
connState = RdmaEndpoint.CONN_STATE_ADDR_RE... | |
ef-labs/vertx-jersey | examples/inject-securitycontext/src/main/java/com/englishtown/vertx/jersey/examples/CustomSecurityContextProvider.java | CustomSecurityContextProvider.process | @Override
public void process(final HttpServerRequest vertxRequest, final ContainerRequest jerseyRequest, final Handler<Void> done) {
vertx.runOnContext(aVoid -> {
Principal p = () -> "test";
SecurityContext securityContext = new SecurityContext() {
/**
... | java | @Override
public void process(final HttpServerRequest vertxRequest, final ContainerRequest jerseyRequest, final Handler<Void> done) {
vertx.runOnContext(aVoid -> {
Principal p = () -> "test";
SecurityContext securityContext = new SecurityContext() {
/**
... | [
"@",
"Override",
"public",
"void",
"process",
"(",
"final",
"HttpServerRequest",
"vertxRequest",
",",
"final",
"ContainerRequest",
"jerseyRequest",
",",
"final",
"Handler",
"<",
"Void",
">",
"done",
")",
"{",
"vertx",
".",
"runOnContext",
"(",
"aVoid",
"->",
"... | Provide additional async request processing
@param vertxRequest the vert.x http server request
@param jerseyRequest the jersey container request
@param done the done async callback handler | [
"Provide",
"additional",
"async",
"request",
"processing"
] | 733482a8a5afb1fb257c682b3767655e56f7a0fe | https://github.com/ef-labs/vertx-jersey/blob/733482a8a5afb1fb257c682b3767655e56f7a0fe/examples/inject-securitycontext/src/main/java/com/englishtown/vertx/jersey/examples/CustomSecurityContextProvider.java#L31-L75 | train | Process the request. | Create a Java method that does the following: "Process the request.". | Of course, here is the Java code you requested:
```java
@Override
public void process(final HttpServerRequest vertxRequest, final ContainerRequest jerseyRequest, final Handler<Void> done) {
vertx.runOnContext(aVoid -> {
Principal p = () -> "test";
SecurityContext securityContext = ... | |
adessoAG/wicked-charts | showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java | DonutOptions.getOperaUsageData | private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setColor(operaColor);
data
.getVersionUsageData()
... | java | private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setColor(operaColor);
data
.getVersionUsageData()
... | [
"private",
"BrowserUsageData",
"getOperaUsageData",
"(",
")",
"{",
"BrowserUsageData",
"data",
"=",
"new",
"BrowserUsageData",
"(",
")",
";",
"data",
".",
"setBrowserName",
"(",
"\"Opera\"",
")",
";",
"data",
".",
"setMarketShare",
"(",
"2.14f",
")",
";",
"Col... | Creates the Opera data. | [
"Creates",
"the",
"Opera",
"data",
"."
] | 498aceff025f612e22ba5135b26531afeabac03c | https://github.com/adessoAG/wicked-charts/blob/498aceff025f612e22ba5135b26531afeabac03c/showcase/wicked-charts-showcase-options/src/main/java/de/adesso/wickedcharts/showcase/options/highcharts/base/DonutOptions.java#L313-L338 | train | This method returns the Opera usage data. | Create a Java method that does the following: "This method returns the Opera usage data.". | Of course, here is the Java code you requested:
```java
private BrowserUsageData getOperaUsageData() {
BrowserUsageData data = new BrowserUsageData();
data
.setBrowserName("Opera");
data
.setMarketShare(2.14f);
ColorReference operaColor = new HighchartsColor(4);
data
.setCol... | |
Axway/Grapes | server/src/main/java/org/axway/grapes/server/core/OrganizationHandler.java | OrganizationHandler.addCorporateGroupId | public void addCorporateGroupId(final String organizationId, final String corporateGroupId) {
final DbOrganization dbOrganization = getOrganization(organizationId);
if(!dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){
dbOrganization.getCorporateGroupIdPrefixes().add... | java | public void addCorporateGroupId(final String organizationId, final String corporateGroupId) {
final DbOrganization dbOrganization = getOrganization(organizationId);
if(!dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){
dbOrganization.getCorporateGroupIdPrefixes().add... | [
"public",
"void",
"addCorporateGroupId",
"(",
"final",
"String",
"organizationId",
",",
"final",
"String",
"corporateGroupId",
")",
"{",
"final",
"DbOrganization",
"dbOrganization",
"=",
"getOrganization",
"(",
"organizationId",
")",
";",
"if",
"(",
"!",
"dbOrganiza... | Adds a corporate groupId to an organization
@param organizationId String
@param corporateGroupId String | [
"Adds",
"a",
"corporate",
"groupId",
"to",
"an",
"organization"
] | ce9cc73d85f83eaa5fbc991abb593915a8c8374e | https://github.com/Axway/Grapes/blob/ce9cc73d85f83eaa5fbc991abb593915a8c8374e/server/src/main/java/org/axway/grapes/server/core/OrganizationHandler.java#L90-L99 | train | Add a corporate groupId to an organization. | Create a Java method that does the following: "Add a corporate groupId to an organization.". | Of course, here is the Java code you requested:
```java
public void addCorporateGroupId(final String organizationId, final String corporateGroupId) {
final DbOrganization dbOrganization = getOrganization(organizationId);
if(!dbOrganization.getCorporateGroupIdPrefixes().contains(corporateGroupId)){
... | |
facebook/fresco | imagepipeline/src/main/java/com/facebook/imagepipeline/core/ProducerSequenceFactory.java | ProducerSequenceFactory.newEncodedCacheMultiplexToTranscodeSequence | private Producer<EncodedImage> newEncodedCacheMultiplexToTranscodeSequence(
Producer<EncodedImage> inputProducer) {
if (WebpSupportStatus.sIsWebpSupportRequired &&
(!mWebpSupportEnabled || WebpSupportStatus.sWebpBitmapFactory == null)) {
inputProducer = mProducerFactory.newWebpTranscodeProducer(... | java | private Producer<EncodedImage> newEncodedCacheMultiplexToTranscodeSequence(
Producer<EncodedImage> inputProducer) {
if (WebpSupportStatus.sIsWebpSupportRequired &&
(!mWebpSupportEnabled || WebpSupportStatus.sWebpBitmapFactory == null)) {
inputProducer = mProducerFactory.newWebpTranscodeProducer(... | [
"private",
"Producer",
"<",
"EncodedImage",
">",
"newEncodedCacheMultiplexToTranscodeSequence",
"(",
"Producer",
"<",
"EncodedImage",
">",
"inputProducer",
")",
"{",
"if",
"(",
"WebpSupportStatus",
".",
"sIsWebpSupportRequired",
"&&",
"(",
"!",
"mWebpSupportEnabled",
"|... | encoded cache multiplex -> encoded cache -> (disk cache) -> (webp transcode)
@param inputProducer producer providing the input to the transcode
@return encoded cache multiplex to webp transcode sequence | [
"encoded",
"cache",
"multiplex",
"-",
">",
"encoded",
"cache",
"-",
">",
"(",
"disk",
"cache",
")",
"-",
">",
"(",
"webp",
"transcode",
")"
] | 0b85879d51c5036d5e46e627a6651afefc0b971a | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline/src/main/java/com/facebook/imagepipeline/core/ProducerSequenceFactory.java#L702-L714 | train | This method is used to convert a MultiplexProducer to a TranscodeProducer. | Create a Java method that does the following: "This method is used to convert a MultiplexProducer to a TranscodeProducer.". | Of course, here is the Java code you requested:
```java
private Producer<EncodedImage> newEncodedCacheMultiplexToTranscodeSequence(
Producer<EncodedImage> inputProducer) {
if (WebpSupportStatus.sIsWebpSupportRequired &&
(!mWebpSupportEnabled || WebpSupportStatus.sWebpBitmapFactory == null)) {
i... | |
haifengl/smile | interpolation/src/main/java/smile/interpolation/LaplaceInterpolation.java | LaplaceInterpolation.ax | private static void ax(double[][] matrix, double[] x, double[] r, boolean[] mask) {
int nrows = matrix.length;
int ncols = matrix[0].length;
int n = r.length, jjt, it;
Arrays.fill(r, 0.0);
for (int k = 0; k < n; k++) {
int i = k / ncols;
int j = k - i * ... | java | private static void ax(double[][] matrix, double[] x, double[] r, boolean[] mask) {
int nrows = matrix.length;
int ncols = matrix[0].length;
int n = r.length, jjt, it;
Arrays.fill(r, 0.0);
for (int k = 0; k < n; k++) {
int i = k / ncols;
int j = k - i * ... | [
"private",
"static",
"void",
"ax",
"(",
"double",
"[",
"]",
"[",
"]",
"matrix",
",",
"double",
"[",
"]",
"x",
",",
"double",
"[",
"]",
"r",
",",
"boolean",
"[",
"]",
"mask",
")",
"{",
"int",
"nrows",
"=",
"matrix",
".",
"length",
";",
"int",
"n... | Returns A * x. | [
"Returns",
"A",
"*",
"x",
"."
] | e27e43e90fbaacce3f99d30120cf9dd6a764c33d | https://github.com/haifengl/smile/blob/e27e43e90fbaacce3f99d30120cf9dd6a764c33d/interpolation/src/main/java/smile/interpolation/LaplaceInterpolation.java#L174-L198 | train | A method to compute the ax of matrix x and r | Create a Java method that does the following: "A method to compute the ax of matrix x and r". | Of course, here is the Java code you requested:
```java
private static void ax(double[][] matrix, double[] x, double[] r, boolean[] mask) {
int nrows = matrix.length;
int ncols = matrix[0].length;
int n = r.length, jjt, it;
Arrays.fill(r, 0.0);
for (int k = 0; k < n; k++) {
... | |
linkedin/parseq | subprojects/parseq-lambda-names/src/main/java/com/linkedin/parseq/lambda/SourcePointer.java | SourcePointer.get | static Optional<SourcePointer> get() {
//create an exception, discard known elements from stack trace and find first element with suspect
return Arrays.stream(new Exception().getStackTrace())
.filter(SourcePointer::notLambdaStuff)
.findFirst()
.map(SourcePointer::sourcePointer);
} | java | static Optional<SourcePointer> get() {
//create an exception, discard known elements from stack trace and find first element with suspect
return Arrays.stream(new Exception().getStackTrace())
.filter(SourcePointer::notLambdaStuff)
.findFirst()
.map(SourcePointer::sourcePointer);
} | [
"static",
"Optional",
"<",
"SourcePointer",
">",
"get",
"(",
")",
"{",
"//create an exception, discard known elements from stack trace and find first element with suspect",
"return",
"Arrays",
".",
"stream",
"(",
"new",
"Exception",
"(",
")",
".",
"getStackTrace",
"(",
")... | /* package private | [
"/",
"*",
"package",
"private"
] | 35b194c2837ad45c36e80c2333c5feeb561ca24e | https://github.com/linkedin/parseq/blob/35b194c2837ad45c36e80c2333c5feeb561ca24e/subprojects/parseq-lambda-names/src/main/java/com/linkedin/parseq/lambda/SourcePointer.java#L18-L24 | valid | Get the first source pointer from the stack trace | Create a Java method that does the following: "Get the first source pointer from the stack trace". | Of course, here is the Java code you requested:
```java
static Optional<SourcePointer> get() {
//create an exception, discard known elements from stack trace and find first element with suspect
return Arrays.stream(new Exception().getStackTrace())
.filter(SourcePointer::notLambdaStuff)
.findFir... | |
arquillian/arquillian-extension-warp | impl/src/main/java/org/jboss/arquillian/warp/impl/utils/URLUtils.java | URLUtils.buildUrl | public static URL buildUrl(String context, String... relocations) {
try {
return buildUrl(new URL(context), relocations);
} catch (MalformedURLException e) {
throw new AssertionError("URL('" + context + "') isn't valid URL");
}
} | java | public static URL buildUrl(String context, String... relocations) {
try {
return buildUrl(new URL(context), relocations);
} catch (MalformedURLException e) {
throw new AssertionError("URL('" + context + "') isn't valid URL");
}
} | [
"public",
"static",
"URL",
"buildUrl",
"(",
"String",
"context",
",",
"String",
"...",
"relocations",
")",
"{",
"try",
"{",
"return",
"buildUrl",
"(",
"new",
"URL",
"(",
"context",
")",
",",
"relocations",
")",
";",
"}",
"catch",
"(",
"MalformedURLExceptio... | Use URL context and one or more relocations to build end URL.
@param context first URL used like a context root for all relocation changes
@param relocations array of relocation URLs
@return end url after all changes made on context with relocations
@throws AssertionError when context or some of relocations are ma... | [
"Use",
"URL",
"context",
"and",
"one",
"or",
"more",
"relocations",
"to",
"build",
"end",
"URL",
"."
] | e958f4d782851baf7f40e39835d3d1ad185b74dd | https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/impl/src/main/java/org/jboss/arquillian/warp/impl/utils/URLUtils.java#L40-L46 | train | Build a URL from a context and a list of relocations. | Create a Java method that does the following: "Build a URL from a context and a list of relocations.". | Of course, here is the Java code you requested:
```java
public static URL buildUrl(String context, String... relocations) {
try {
return buildUrl(new URL(context), relocations);
} catch (MalformedURLException e) {
throw new AssertionError("URL('" + context + "') isn't valid URL"... | |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataWriter.java | PersistedValueDataWriter.write | public void write(ObjectWriter out, PersistedValueData vd) throws IOException
{
out.writeInt(SerializationConstants.PERSISTED_VALUE_DATA);
out.writeInt(vd.getOrderNumber());
boolean isByteArray = vd.isByteArray();
out.writeBoolean(isByteArray);
if (isByteArray)
{
byte[]... | java | public void write(ObjectWriter out, PersistedValueData vd) throws IOException
{
out.writeInt(SerializationConstants.PERSISTED_VALUE_DATA);
out.writeInt(vd.getOrderNumber());
boolean isByteArray = vd.isByteArray();
out.writeBoolean(isByteArray);
if (isByteArray)
{
byte[]... | [
"public",
"void",
"write",
"(",
"ObjectWriter",
"out",
",",
"PersistedValueData",
"vd",
")",
"throws",
"IOException",
"{",
"out",
".",
"writeInt",
"(",
"SerializationConstants",
".",
"PERSISTED_VALUE_DATA",
")",
";",
"out",
".",
"writeInt",
"(",
"vd",
".",
"ge... | Write to stream all necessary object data.
@param out
SerializationOutputStream.
@throws IOException
If an I/O error has occurred. | [
"Write",
"to",
"stream",
"all",
"necessary",
"object",
"data",
"."
] | 3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2 | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/serialization/PersistedValueDataWriter.java#L50-L119 | train | Write a PersistedValueData object to an ObjectWriter. | Create a Java method that does the following: "Write a PersistedValueData object to an ObjectWriter.". | Of course, here is the Java code you requested:
```java
public void write(ObjectWriter out, PersistedValueData vd) throws IOException
{
out.writeInt(SerializationConstants.PERSISTED_VALUE_DATA);
out.writeInt(vd.getOrderNumber());
boolean isByteArray = vd.isByteArray();
out.writeBoolean(isBy... | |
sdl/Testy | src/main/java/com/sdl/selenium/web/WebLocatorAbstractBuilder.java | WebLocatorAbstractBuilder.setTemplate | @SuppressWarnings("unchecked")
public <T extends WebLocatorAbstractBuilder> T setTemplate(final String key, final String value) {
pathBuilder.setTemplate(key, value);
return (T) this;
} | java | @SuppressWarnings("unchecked")
public <T extends WebLocatorAbstractBuilder> T setTemplate(final String key, final String value) {
pathBuilder.setTemplate(key, value);
return (T) this;
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
"extends",
"WebLocatorAbstractBuilder",
">",
"T",
"setTemplate",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"value",
")",
"{",
"pathBuilder",
".",
"setTemplate",
"(",
"key",
",... | For customize template please see here: See http://docs.oracle.com/javase/7/docs/api/java/util/Formatter.html#dpos
@param key name template
@param value template
@param <T> the element which calls this method
@return this element | [
"For",
"customize",
"template",
"please",
"see",
"here",
":",
"See",
"http",
":",
"//",
"docs",
".",
"oracle",
".",
"com",
"/",
"javase",
"/",
"7",
"/",
"docs",
"/",
"api",
"/",
"java",
"/",
"util",
"/",
"Formatter",
".",
"html#dpos"
] | b3ae061554016f926f04694a39ff00dab7576609 | https://github.com/sdl/Testy/blob/b3ae061554016f926f04694a39ff00dab7576609/src/main/java/com/sdl/selenium/web/WebLocatorAbstractBuilder.java#L324-L328 | train | Sets the template. | Create a Java method that does the following: "Sets the template.". | Of course, here is the Java code you requested:
```java
@SuppressWarnings("unchecked")
public <T extends WebLocatorAbstractBuilder> T setTemplate(final String key, final String value) {
pathBuilder.setTemplate(key, value);
return (T) this;
}
```
Hope this helps! | |
alkacon/opencms-core | src/org/opencms/util/CmsMacroResolver.java | CmsMacroResolver.resolveMacros | public static String resolveMacros(final String input, I_CmsMacroResolver resolver) {
if ((input == null) || (input.length() < 3)) {
// macro must have at last 3 chars "${}" or "%()"
return input;
}
int pn = input.indexOf(I_CmsMacroResolver.MACRO_DELIMITER);
int... | java | public static String resolveMacros(final String input, I_CmsMacroResolver resolver) {
if ((input == null) || (input.length() < 3)) {
// macro must have at last 3 chars "${}" or "%()"
return input;
}
int pn = input.indexOf(I_CmsMacroResolver.MACRO_DELIMITER);
int... | [
"public",
"static",
"String",
"resolveMacros",
"(",
"final",
"String",
"input",
",",
"I_CmsMacroResolver",
"resolver",
")",
"{",
"if",
"(",
"(",
"input",
"==",
"null",
")",
"||",
"(",
"input",
".",
"length",
"(",
")",
"<",
"3",
")",
")",
"{",
"// macro... | Resolves macros in the provided input String using the given macro resolver.<p>
A macro in the form <code>%(key)</code> or <code>${key}</code> in the content is replaced with it's assigned value
returned by the <code>{@link I_CmsMacroResolver#getMacroValue(String)}</code> method of the given
<code>{@link I_CmsMacroRes... | [
"Resolves",
"macros",
"in",
"the",
"provided",
"input",
"String",
"using",
"the",
"given",
"macro",
"resolver",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/util/CmsMacroResolver.java#L550-L660 | train | Resolves the macros in the input string. | Create a Java method that does the following: "Resolves the macros in the input string.". | Of course, here is the Java code you requested:
```java
public static String resolveMacros(final String input, I_CmsMacroResolver resolver) {
if ((input == null) || (input.length() < 3)) {
// macro must have at last 3 chars "${}" or "%()"
return input;
}
int pn = input... | |
jeppetto/jeppetto | jeppetto-dao-mongo/src/main/java/org/iternine/jeppetto/dao/mongodb/MongoDBSession.java | MongoDBSession.enter | private void enter(Logger logger, String name) {
int offset = 3;
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
StackTraceElement creator = stackTrace[Math.min(offset, stackTrace.length - 1)];
creators.push(new SessionEntryPoint(creator, logger, name));
} | java | private void enter(Logger logger, String name) {
int offset = 3;
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
StackTraceElement creator = stackTrace[Math.min(offset, stackTrace.length - 1)];
creators.push(new SessionEntryPoint(creator, logger, name));
} | [
"private",
"void",
"enter",
"(",
"Logger",
"logger",
",",
"String",
"name",
")",
"{",
"int",
"offset",
"=",
"3",
";",
"StackTraceElement",
"[",
"]",
"stackTrace",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getStackTrace",
"(",
")",
";",
"StackT... | ------------------------------------------------------------- | [
"-------------------------------------------------------------"
] | bd2796dcf53376052f590e727931990a2902a933 | https://github.com/jeppetto/jeppetto/blob/bd2796dcf53376052f590e727931990a2902a933/jeppetto-dao-mongo/src/main/java/org/iternine/jeppetto/dao/mongodb/MongoDBSession.java#L214-L220 | train | Enter a session. | Create a Java method that does the following: "Enter a session.". | Of course, here is the Java code you requested:
```java
private void enter(Logger logger, String name) {
int offset = 3;
StackTraceElement[] stackTrace = Thread.currentThread().getStackTrace();
StackTraceElement creator = stackTrace[Math.min(offset, stackTrace.length - 1)];
creators.pu... | |
ArpNetworking/logback-steno | src/main/java/com/arpnetworking/steno/LoggerFactory.java | LoggerFactory.getLogger | public static Logger getLogger(final String name) {
return new Logger(org.slf4j.LoggerFactory.getLogger(name));
} | java | public static Logger getLogger(final String name) {
return new Logger(org.slf4j.LoggerFactory.getLogger(name));
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"final",
"String",
"name",
")",
"{",
"return",
"new",
"Logger",
"(",
"org",
".",
"slf4j",
".",
"LoggerFactory",
".",
"getLogger",
"(",
"name",
")",
")",
";",
"}"
] | Return a Steno <code>Logger</code> for a context name.
@param name The <code>Logger</code> context name.
@return Steno <code>Logger</code> instance. | [
"Return",
"a",
"Steno",
"<code",
">",
"Logger<",
"/",
"code",
">",
"for",
"a",
"context",
"name",
"."
] | abd5c68ce7d42c39f80ffbad6d162d5fed3a346e | https://github.com/ArpNetworking/logback-steno/blob/abd5c68ce7d42c39f80ffbad6d162d5fed3a346e/src/main/java/com/arpnetworking/steno/LoggerFactory.java#L60-L62 | test | Get a Logger with the specified name. | Create a Java method that does the following: "Get a Logger with the specified name.". | Of course, here is the Java code you requested:
```java
public static Logger getLogger(final String name) {
return new Logger(org.slf4j.LoggerFactory.getLogger(name));
}
```
Hope this helps! | |
elki-project/elki | elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java | OnDiskArray.resizeFile | public synchronized void resizeFile(int newsize) throws IOException {
if (!writable) {
throw new IOException("File is not writeable!");
}
// update the number of records
this.numrecs = newsize;
file.seek(HEADER_POS_SIZE);
file.writeInt(numrecs);
// resize file
file.setLength(index... | java | public synchronized void resizeFile(int newsize) throws IOException {
if (!writable) {
throw new IOException("File is not writeable!");
}
// update the number of records
this.numrecs = newsize;
file.seek(HEADER_POS_SIZE);
file.writeInt(numrecs);
// resize file
file.setLength(index... | [
"public",
"synchronized",
"void",
"resizeFile",
"(",
"int",
"newsize",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"writable",
")",
"{",
"throw",
"new",
"IOException",
"(",
"\"File is not writeable!\"",
")",
";",
"}",
"// update the number of records",
"thi... | Resize file to the intended size
@param newsize New file size.
@throws IOException on IO errors | [
"Resize",
"file",
"to",
"the",
"intended",
"size"
] | b54673327e76198ecd4c8a2a901021f1a9174498 | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-persistent/src/main/java/de/lmu/ifi/dbs/elki/persistent/OnDiskArray.java#L324-L336 | train | Resize the file to a new size. | Create a Java method that does the following: "Resize the file to a new size.". | Of course, here is the Java code you requested:
```java
public synchronized void resizeFile(int newsize) throws IOException {
if (!writable) {
throw new IOException("File is not writeable!");
}
// update the number of records
this.numrecs = newsize;
file.seek(HEADER_POS_SIZE);
file.writeI... | |
betfair/cougar | cougar-framework/cougar-util/src/main/java/com/betfair/cougar/util/stream/ByteCountingDataInput.java | ByteCountingDataInput.readLine | @Override
@Deprecated
public String readLine() throws IOException {
String value = dataInput.readLine();
if (value != null) {
count += value.getBytes().length;
}
return value;
} | java | @Override
@Deprecated
public String readLine() throws IOException {
String value = dataInput.readLine();
if (value != null) {
count += value.getBytes().length;
}
return value;
} | [
"@",
"Override",
"@",
"Deprecated",
"public",
"String",
"readLine",
"(",
")",
"throws",
"IOException",
"{",
"String",
"value",
"=",
"dataInput",
".",
"readLine",
"(",
")",
";",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"count",
"+=",
"value",
".",
"g... | Please note that this isn't going to accurately count line separators, which are discarded by
the underlying DataInput object
This call is deprecated because you cannot accurately account for the CR/LF count
@return
@throws IOException | [
"Please",
"note",
"that",
"this",
"isn",
"t",
"going",
"to",
"accurately",
"count",
"line",
"separators",
"which",
"are",
"discarded",
"by",
"the",
"underlying",
"DataInput",
"object",
"This",
"call",
"is",
"deprecated",
"because",
"you",
"cannot",
"accurately",... | 08d1fe338fbd0e8572a9c2305bb5796402d5b1f5 | https://github.com/betfair/cougar/blob/08d1fe338fbd0e8572a9c2305bb5796402d5b1f5/cougar-framework/cougar-util/src/main/java/com/betfair/cougar/util/stream/ByteCountingDataInput.java#L130-L138 | train | Read a single line from the input stream. | Create a Java method that does the following: "Read a single line from the input stream.". | Of course, here is the Java code you requested:
```java
@Override
@Deprecated
public String readLine() throws IOException {
String value = dataInput.readLine();
if (value != null) {
count += value.getBytes().length;
}
return value;
}
```
Hope this helps! | |
jMetal/jMetal | jmetal-problem/src/main/java/org/uma/jmetal/problem/singleobjective/Rastrigin.java | Rastrigin.evaluate | @Override
public void evaluate(DoubleSolution solution) {
int numberOfVariables = getNumberOfVariables() ;
double[] x = new double[numberOfVariables] ;
for (int i = 0; i < numberOfVariables; i++) {
x[i] = solution.getVariableValue(i) ;
}
double result = 0.0;
double a = 10.0;
doubl... | java | @Override
public void evaluate(DoubleSolution solution) {
int numberOfVariables = getNumberOfVariables() ;
double[] x = new double[numberOfVariables] ;
for (int i = 0; i < numberOfVariables; i++) {
x[i] = solution.getVariableValue(i) ;
}
double result = 0.0;
double a = 10.0;
doubl... | [
"@",
"Override",
"public",
"void",
"evaluate",
"(",
"DoubleSolution",
"solution",
")",
"{",
"int",
"numberOfVariables",
"=",
"getNumberOfVariables",
"(",
")",
";",
"double",
"[",
"]",
"x",
"=",
"new",
"double",
"[",
"numberOfVariables",
"]",
";",
"for",
"(",... | Evaluate() method | [
"Evaluate",
"()",
"method"
] | bc981e6aede275d26c5216c9a01227d9675b0cf7 | https://github.com/jMetal/jMetal/blob/bc981e6aede275d26c5216c9a01227d9675b0cf7/jmetal-problem/src/main/java/org/uma/jmetal/problem/singleobjective/Rastrigin.java#L36-L56 | train | Evaluate the Cosine Hessian. | Create a Java method that does the following: "Evaluate the Cosine Hessian.". | Of course, here is the Java code you requested:
```java
@Override
public void evaluate(DoubleSolution solution) {
int numberOfVariables = getNumberOfVariables() ;
double[] x = new double[numberOfVariables] ;
for (int i = 0; i < numberOfVariables; i++) {
x[i] = solution.getVariableValue(i) ;
}... | |
h2oai/h2o-3 | h2o-core/src/main/java/jsr166y/CountedCompleter.java | CountedCompleter.__tryComplete | public final void __tryComplete(CountedCompleter caller) {
CountedCompleter a = this, s = caller;
for (int c;;) {
if((c = a.pending) == 0) {
a.onCompletion(s);
if ((a = (s = a).completer) == null) {
s.quietlyComplete();
return;
}
}
else if (U.compare... | java | public final void __tryComplete(CountedCompleter caller) {
CountedCompleter a = this, s = caller;
for (int c;;) {
if((c = a.pending) == 0) {
a.onCompletion(s);
if ((a = (s = a).completer) == null) {
s.quietlyComplete();
return;
}
}
else if (U.compare... | [
"public",
"final",
"void",
"__tryComplete",
"(",
"CountedCompleter",
"caller",
")",
"{",
"CountedCompleter",
"a",
"=",
"this",
",",
"s",
"=",
"caller",
";",
"for",
"(",
"int",
"c",
";",
";",
")",
"{",
"if",
"(",
"(",
"c",
"=",
"a",
".",
"pending",
... | H2O Hack to get distributed FJ behavior closer to the behavior on local node.
It allows us to continue in "completion propagation" interrupted by remote task.
Should *not* be called by anyone outside of RPC mechanism.
In standard FJ, tryComplete is always called by the task itself and the task is thus it's own caller.... | [
"H2O",
"Hack",
"to",
"get",
"distributed",
"FJ",
"behavior",
"closer",
"to",
"the",
"behavior",
"on",
"local",
"node",
".",
"It",
"allows",
"us",
"to",
"continue",
"in",
"completion",
"propagation",
"interrupted",
"by",
"remote",
"task",
".",
"Should",
"*",
... | 845eb49dfeaadf638b6e2f779d82fac996391fad | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/jsr166y/CountedCompleter.java#L421-L434 | train | Try to complete the current counted completer. | Create a Java method that does the following: "Try to complete the current counted completer.". | Of course, here is the Java code you requested:
```java
public final void __tryComplete(CountedCompleter caller) {
CountedCompleter a = this, s = caller;
for (int c;;) {
if((c = a.pending) == 0) {
a.onCompletion(s);
if ((a = (s = a).completer) == null) {
s.quietlyComplete();
... | |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java | AbstractMap.chooseMeanCapacity | protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) {
return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad)))));
} | java | protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) {
return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad)))));
} | [
"protected",
"int",
"chooseMeanCapacity",
"(",
"int",
"size",
",",
"double",
"minLoad",
",",
"double",
"maxLoad",
")",
"{",
"return",
"nextPrime",
"(",
"Math",
".",
"max",
"(",
"size",
"+",
"1",
",",
"(",
"int",
")",
"(",
"(",
"2",
"*",
"size",
"/",
... | Chooses a new prime table capacity neither favoring shrinking nor growing,
that (approximately) satisfies the invariant
<tt>c * minLoadFactor <= size <= c * maxLoadFactor</tt>
and has at least one FREE slot for the given size. | [
"Chooses",
"a",
"new",
"prime",
"table",
"capacity",
"neither",
"favoring",
"shrinking",
"nor",
"growing",
"that",
"(",
"approximately",
")",
"satisfies",
"the",
"invariant",
"<tt",
">",
"c",
"*",
"minLoadFactor",
"<",
"=",
"size",
"<",
"=",
"c",
"*",
"max... | ab8b0a83dbf600fe80c27711815c90bd3055b217 | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/map/AbstractMap.java#L84-L86 | train | Returns the mean capacity of the given size. | Create a Java method that does the following: "Returns the mean capacity of the given size.". | Of course, here is the Java code you requested:
```java
protected int chooseMeanCapacity(int size, double minLoad, double maxLoad) {
return nextPrime(Math.max(size+1, (int) ((2*size / (minLoad+maxLoad)))));
}
```
Hope this helps! | |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java | JsonWebKey.fromAes | public static JsonWebKey fromAes(SecretKey secretKey) {
if (secretKey == null) {
return null;
}
return new JsonWebKey().withK(secretKey.getEncoded()).withKty(JsonWebKeyType.OCT);
} | java | public static JsonWebKey fromAes(SecretKey secretKey) {
if (secretKey == null) {
return null;
}
return new JsonWebKey().withK(secretKey.getEncoded()).withKty(JsonWebKeyType.OCT);
} | [
"public",
"static",
"JsonWebKey",
"fromAes",
"(",
"SecretKey",
"secretKey",
")",
"{",
"if",
"(",
"secretKey",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"return",
"new",
"JsonWebKey",
"(",
")",
".",
"withK",
"(",
"secretKey",
".",
"getEncoded",
... | Converts AES key to JSON web key.
@param secretKey
AES key
@return the JSON web key, converted from AES key. | [
"Converts",
"AES",
"key",
"to",
"JSON",
"web",
"key",
"."
] | aab183ddc6686c82ec10386d5a683d2691039626 | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault-webkey/src/main/java/com/microsoft/azure/keyvault/webkey/JsonWebKey.java#L877-L883 | train | Creates a new instance of the class JsonWebKey from the given secret key. | Create a Java method that does the following: "Creates a new instance of the class JsonWebKey from the given secret key.". | Of course, here is the Java code you requested:
```java
public static JsonWebKey fromAes(SecretKey secretKey) {
if (secretKey == null) {
return null;
}
return new JsonWebKey().withK(secretKey.getEncoded()).withKty(JsonWebKeyType.OCT);
}
```
Hope this helps! | |
aws/aws-sdk-java | aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/DescribeServicesRequest.java | DescribeServicesRequest.getInclude | public java.util.List<String> getInclude() {
if (include == null) {
include = new com.amazonaws.internal.SdkInternalList<String>();
}
return include;
} | java | public java.util.List<String> getInclude() {
if (include == null) {
include = new com.amazonaws.internal.SdkInternalList<String>();
}
return include;
} | [
"public",
"java",
".",
"util",
".",
"List",
"<",
"String",
">",
"getInclude",
"(",
")",
"{",
"if",
"(",
"include",
"==",
"null",
")",
"{",
"include",
"=",
"new",
"com",
".",
"amazonaws",
".",
"internal",
".",
"SdkInternalList",
"<",
"String",
">",
"(... | <p>
Specifies whether you want to see the resource tags for the service. If <code>TAGS</code> is specified, the tags
are included in the response. If this field is omitted, tags are not included in the response.
</p>
@return Specifies whether you want to see the resource tags for the service. If <code>TAGS</code> is s... | [
"<p",
">",
"Specifies",
"whether",
"you",
"want",
"to",
"see",
"the",
"resource",
"tags",
"for",
"the",
"service",
".",
"If",
"<code",
">",
"TAGS<",
"/",
"code",
">",
"is",
"specified",
"the",
"tags",
"are",
"included",
"in",
"the",
"response",
".",
"I... | aa38502458969b2d13a1c3665a56aba600e4dbd0 | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ecs/src/main/java/com/amazonaws/services/ecs/model/DescribeServicesRequest.java#L179-L184 | train | Gets the value of the include property. | Create a Java method that does the following: "Gets the value of the include property.". | Of course, here is the Java code you requested:
```java
public java.util.List<String> getInclude() {
if (include == null) {
include = new com.amazonaws.internal.SdkInternalList<String>();
}
return include;
}
```
Hope this helps! | |
ldp4j/ldp4j | commons/http/src/main/java/org/ldp4j/http/Languages.java | Languages.of | public static Language of(final Locale locale) {
requireNonNull(locale,"Locale cannot be null");
checkArgument(locale.getVariant().isEmpty(),"Language does not allow locale variants (%s)",locale.getVariant());
return new ImmutableLanguage(locale);
} | java | public static Language of(final Locale locale) {
requireNonNull(locale,"Locale cannot be null");
checkArgument(locale.getVariant().isEmpty(),"Language does not allow locale variants (%s)",locale.getVariant());
return new ImmutableLanguage(locale);
} | [
"public",
"static",
"Language",
"of",
"(",
"final",
"Locale",
"locale",
")",
"{",
"requireNonNull",
"(",
"locale",
",",
"\"Locale cannot be null\"",
")",
";",
"checkArgument",
"(",
"locale",
".",
"getVariant",
"(",
")",
".",
"isEmpty",
"(",
")",
",",
"\"Lang... | Create a {@code Language} for a given {@code Locale}.
@param locale
the {@code Locale} for the {@code Language}
@return a {@code Language} instance with the specified {@code Locale}
@throws NullPointerException
if {@code locale} is {@code null}
@throws IllegalArgumentException
if the provided locale is a variant (i.e.... | [
"Create",
"a",
"{",
"@code",
"Language",
"}",
"for",
"a",
"given",
"{",
"@code",
"Locale",
"}",
"."
] | 4236dfb3a746be390155c1056bbb5a8d4dccc49f | https://github.com/ldp4j/ldp4j/blob/4236dfb3a746be390155c1056bbb5a8d4dccc49f/commons/http/src/main/java/org/ldp4j/http/Languages.java#L112-L116 | valid | Returns an immutable language for the given locale. | Create a Java method that does the following: "Returns an immutable language for the given locale.". | Of course, here is the Java code you requested:
```java
public static Language of(final Locale locale) {
requireNonNull(locale,"Locale cannot be null");
checkArgument(locale.getVariant().isEmpty(),"Language does not allow locale variants (%s)",locale.getVariant());
return new ImmutableLanguage(locale);
}
```
H... | |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/AbstractItem.java | AbstractItem.remove | public final void remove(final Transaction transaction, final long lockID) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "remove");
Membership membership = _getMembership();
if (null == membership)
{... | java | public final void remove(final Transaction transaction, final long lockID) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "remove");
Membership membership = _getMembership();
if (null == membership)
{... | [
"public",
"final",
"void",
"remove",
"(",
"final",
"Transaction",
"transaction",
",",
"final",
"long",
"lockID",
")",
"throws",
"MessageStoreException",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(... | If the receiver is currently 'in' an {@link ItemStream} then remove
it from the {@link ItemStream}. The removal is performed under the
aegis of a transaction, and is subject to the item being removable.
An item is removable if either:
<ul>
<li>The item is unlocked, and not part of a transaction.</li>
<li>The item is lo... | [
"If",
"the",
"receiver",
"is",
"currently",
"in",
"an",
"{",
"@link",
"ItemStream",
"}",
"then",
"remove",
"it",
"from",
"the",
"{",
"@link",
"ItemStream",
"}",
".",
"The",
"removal",
"is",
"performed",
"under",
"the",
"aegis",
"of",
"a",
"transaction",
... | ca725d9903e63645018f9fa8cbda25f60af83a5d | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.common/src/com/ibm/ws/sib/msgstore/AbstractItem.java#L933-L950 | train | Remove a single lock from the message store. | Create a Java method that does the following: "Remove a single lock from the message store.". | Of course, here is the Java code you requested:
```java
public final void remove(final Transaction transaction, final long lockID) throws MessageStoreException
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled())
SibTr.entry(this, tc, "remove");
Membership membership = _g... | |
hankcs/HanLP | src/main/java/com/hankcs/hanlp/collection/dartsclone/details/BitVector.java | BitVector.build | void build()
{
_ranks = new int[_units.size()];
_numOnes = 0;
for (int i = 0; i < _units.size(); ++i)
{
_ranks[i] = _numOnes;
_numOnes += popCount(_units.get(i));
}
} | java | void build()
{
_ranks = new int[_units.size()];
_numOnes = 0;
for (int i = 0; i < _units.size(); ++i)
{
_ranks[i] = _numOnes;
_numOnes += popCount(_units.get(i));
}
} | [
"void",
"build",
"(",
")",
"{",
"_ranks",
"=",
"new",
"int",
"[",
"_units",
".",
"size",
"(",
")",
"]",
";",
"_numOnes",
"=",
"0",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"_units",
".",
"size",
"(",
")",
";",
"++",
"i",
")",
... | 构建 | [
"构建"
] | a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce | https://github.com/hankcs/HanLP/blob/a538d0722ab2e4980a9dcd9ea40324fc3ddba7ce/src/main/java/com/hankcs/hanlp/collection/dartsclone/details/BitVector.java#L91-L101 | train | Build the base class. | Create a Java method that does the following: "Build the base class.". | Of course, here is the Java code you requested:
```java
void build()
{
_ranks = new int[_units.size()];
_numOnes = 0;
for (int i = 0; i < _units.size(); ++i)
{
_ranks[i] = _numOnes;
_numOnes += popCount(_units.get(i));
}
}
```
Hope this helps! | |
johnkil/Android-RobotoTextView | robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java | RobotoTypefaces.obtainTypeface | @NonNull
public static Typeface obtainTypeface(@NonNull Context context, @NonNull TypedArray attrs) {
if (attrs.hasValue(R.styleable.RobotoTextView_robotoTypeface)) {
@RobotoTypeface int typefaceValue = attrs.getInt(R.styleable.RobotoTextView_robotoTypeface, TYPEFACE_ROBOTO_REGULAR);
... | java | @NonNull
public static Typeface obtainTypeface(@NonNull Context context, @NonNull TypedArray attrs) {
if (attrs.hasValue(R.styleable.RobotoTextView_robotoTypeface)) {
@RobotoTypeface int typefaceValue = attrs.getInt(R.styleable.RobotoTextView_robotoTypeface, TYPEFACE_ROBOTO_REGULAR);
... | [
"@",
"NonNull",
"public",
"static",
"Typeface",
"obtainTypeface",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"NonNull",
"TypedArray",
"attrs",
")",
"{",
"if",
"(",
"attrs",
".",
"hasValue",
"(",
"R",
".",
"styleable",
".",
"RobotoTextView_robotoTypef... | Obtain typeface from attributes.
@param context The Context the widget is running in, through which it can access the current theme, resources, etc.
@param attrs The styled attribute values in this Context's theme.
@return specify {@link Typeface} | [
"Obtain",
"typeface",
"from",
"attributes",
"."
] | 1341602f16c08057dddd193411e7dab96f963b77 | https://github.com/johnkil/Android-RobotoTextView/blob/1341602f16c08057dddd193411e7dab96f963b77/robototextview/src/main/java/com/devspark/robototextview/RobotoTypefaces.java#L483-L494 | train | Obtain a Typeface object from the attribute set. | Create a Java method that does the following: "Obtain a Typeface object from the attribute set.". | Of course, here is the Java code you requested:
```java
@NonNull
public static Typeface obtainTypeface(@NonNull Context context, @NonNull TypedArray attrs) {
if (attrs.hasValue(R.styleable.RobotoTextView_robotoTypeface)) {
@RobotoTypeface int typefaceValue = attrs.getInt(R.styleable.RobotoTextV... | |
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseReferenceType | private Type parseReferenceType(EnclosingScope scope) {
int start = index;
match(Ampersand);
// Try to parse an annotated lifetime
int backtrack = index;
Identifier lifetimeIdentifier = parseOptionalLifetimeIdentifier(scope, false);
if (lifetimeIdentifier != null) {
// We cannot allow a newline after th... | java | private Type parseReferenceType(EnclosingScope scope) {
int start = index;
match(Ampersand);
// Try to parse an annotated lifetime
int backtrack = index;
Identifier lifetimeIdentifier = parseOptionalLifetimeIdentifier(scope, false);
if (lifetimeIdentifier != null) {
// We cannot allow a newline after th... | [
"private",
"Type",
"parseReferenceType",
"(",
"EnclosingScope",
"scope",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"Ampersand",
")",
";",
"// Try to parse an annotated lifetime",
"int",
"backtrack",
"=",
"index",
";",
"Identifier",
"lifetimeIdentifi... | Parse a reference type, which is of the form:
<pre>
ReferenceType ::= '&' Type
| '&' Lifetime ':' Type
Lifetime ::= Identifier | 'this' | '*'
</pre>
@return | [
"Parse",
"a",
"reference",
"type",
"which",
"is",
"of",
"the",
"form",
":"
] | 680f8a657d3fc286f8cc422755988b6d74ab3f4c | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L3693-L3718 | train | Parses a reference type. | Create a Java method that does the following: "Parses a reference type.". | Of course, here is the Java code you requested:
```java
private Type parseReferenceType(EnclosingScope scope) {
int start = index;
match(Ampersand);
// Try to parse an annotated lifetime
int backtrack = index;
Identifier lifetimeIdentifier = parseOptionalLifetimeIdentifier(scope, false);
if (lifetimeIdent... | |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.determineMethodsAllowed | private StringBuffer determineMethodsAllowed(String path) {
StringBuffer methodsAllowed = new StringBuffer();
boolean exists = true;
I_CmsRepositoryItem item = null;
try {
item = m_session.getItem(path);
} catch (CmsException e) {
exists = false;
... | java | private StringBuffer determineMethodsAllowed(String path) {
StringBuffer methodsAllowed = new StringBuffer();
boolean exists = true;
I_CmsRepositoryItem item = null;
try {
item = m_session.getItem(path);
} catch (CmsException e) {
exists = false;
... | [
"private",
"StringBuffer",
"determineMethodsAllowed",
"(",
"String",
"path",
")",
"{",
"StringBuffer",
"methodsAllowed",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"boolean",
"exists",
"=",
"true",
";",
"I_CmsRepositoryItem",
"item",
"=",
"null",
";",
"try",
"{"... | Determines the methods normally allowed for the resource.<p>
@param path the path to the resource
@return a StringBuffer with the WebDAV methods allowed for the resource at the given path | [
"Determines",
"the",
"methods",
"normally",
"allowed",
"for",
"the",
"resource",
".",
"<p",
">"
] | bc104acc75d2277df5864da939a1f2de5fdee504 | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L2973-L3018 | train | Determines the methods allowed for a resource. | Create a Java method that does the following: "Determines the methods allowed for a resource.". | Of course, here is the Java code you requested:
```java
private StringBuffer determineMethodsAllowed(String path) {
StringBuffer methodsAllowed = new StringBuffer();
boolean exists = true;
I_CmsRepositoryItem item = null;
try {
item = m_session.getItem(path);
} catc... | |
kiegroup/drools | drools-compiler/src/main/java/org/drools/compiler/reteoo/compiled/ObjectTypeNodeCompiler.java | ObjectTypeNodeCompiler.createConstructor | private void createConstructor(Collection<HashedAlphasDeclaration> hashedAlphaDeclarations) {
builder.append("public ").append(generatedClassSimpleName).append("(org.drools.core.spi.InternalReadAccessor readAccessor) {").append(NEWLINE);
builder.append("this.readAccessor = readAccessor;\n");
/... | java | private void createConstructor(Collection<HashedAlphasDeclaration> hashedAlphaDeclarations) {
builder.append("public ").append(generatedClassSimpleName).append("(org.drools.core.spi.InternalReadAccessor readAccessor) {").append(NEWLINE);
builder.append("this.readAccessor = readAccessor;\n");
/... | [
"private",
"void",
"createConstructor",
"(",
"Collection",
"<",
"HashedAlphasDeclaration",
">",
"hashedAlphaDeclarations",
")",
"{",
"builder",
".",
"append",
"(",
"\"public \"",
")",
".",
"append",
"(",
"generatedClassSimpleName",
")",
".",
"append",
"(",
"\"(org.d... | Creates the constructor for the generated class. If the hashedAlphaDeclarations is empty, it will just
output a empty default constructor; if it is not, the constructor will contain code to fill the hash
alpha maps with the values and node ids.
@param hashedAlphaDeclarations declarations used for creating statements t... | [
"Creates",
"the",
"constructor",
"for",
"the",
"generated",
"class",
".",
"If",
"the",
"hashedAlphaDeclarations",
"is",
"empty",
"it",
"will",
"just",
"output",
"a",
"empty",
"default",
"constructor",
";",
"if",
"it",
"is",
"not",
"the",
"constructor",
"will",... | 22b0275d6dbe93070b8090948502cf46eda543c4 | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/reteoo/compiled/ObjectTypeNodeCompiler.java#L153-L192 | train | Create the constructor for the CDI class. | Create a Java method that does the following: "Create the constructor for the CDI class.". | Of course, here is the Java code you requested:
```java
private void createConstructor(Collection<HashedAlphasDeclaration> hashedAlphaDeclarations) {
builder.append("public ").append(generatedClassSimpleName).append("(org.drools.core.spi.InternalReadAccessor readAccessor) {").append(NEWLINE);
builder... | |
isisaddons-legacy/isis-module-stringinterpolator | fixture/src/main/java/org/isisaddons/module/stringinterpolator/fixture/scripts/StringInterpolatorDemoToDoItemsFixture.java | StringInterpolatorDemoToDoItemsFixture.createToDoItem | private StringInterpolatorDemoToDoItem createToDoItem(final String description, final String documentationPage) {
return toDoItems.newToDo(description, documentationPage);
} | java | private StringInterpolatorDemoToDoItem createToDoItem(final String description, final String documentationPage) {
return toDoItems.newToDo(description, documentationPage);
} | [
"private",
"StringInterpolatorDemoToDoItem",
"createToDoItem",
"(",
"final",
"String",
"description",
",",
"final",
"String",
"documentationPage",
")",
"{",
"return",
"toDoItems",
".",
"newToDo",
"(",
"description",
",",
"documentationPage",
")",
";",
"}"
] | ////////////////////////////////////// | [
"//////////////////////////////////////"
] | 0018f3f694b8ccb154312454adf817d813edd4b0 | https://github.com/isisaddons-legacy/isis-module-stringinterpolator/blob/0018f3f694b8ccb154312454adf817d813edd4b0/fixture/src/main/java/org/isisaddons/module/stringinterpolator/fixture/scripts/StringInterpolatorDemoToDoItemsFixture.java#L60-L62 | train | Create toDo item. | Create a Java method that does the following: "Create toDo item.". | Of course, here is the Java code you requested:
```java
private StringInterpolatorDemoToDoItem createToDoItem(final String description, final String documentationPage) {
return toDoItems.newToDo(description, documentationPage);
}
```
Hope this helps! |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.