repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 204 | func_name stringlengths 5 103 | whole_func_string stringlengths 87 3.44k | language stringclasses 1
value | func_code_string stringlengths 87 3.44k | func_code_tokens listlengths 21 714 | func_documentation_string stringlengths 61 1.95k | func_documentation_tokens listlengths 1 482 | split_name stringclasses 1
value | func_code_url stringlengths 102 309 |
|---|---|---|---|---|---|---|---|---|---|---|
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java | BinaryFast.generateBackgroundEdgeFromForegroundEdge | public void generateBackgroundEdgeFromForegroundEdge() {
backgroundEdgePixels.clear();
Point p, p2;
Iterator<Point> it = foregroundEdgePixels.iterator();
while( it.hasNext() ) {
p = new Point(it.next());
for( int j = -1; j < 2; ++j ) {
for( int i =... | java | public void generateBackgroundEdgeFromForegroundEdge() {
backgroundEdgePixels.clear();
Point p, p2;
Iterator<Point> it = foregroundEdgePixels.iterator();
while( it.hasNext() ) {
p = new Point(it.next());
for( int j = -1; j < 2; ++j ) {
for( int i =... | [
"public",
"void",
"generateBackgroundEdgeFromForegroundEdge",
"(",
")",
"{",
"backgroundEdgePixels",
".",
"clear",
"(",
")",
";",
"Point",
"p",
",",
"p2",
";",
"Iterator",
"<",
"Point",
">",
"it",
"=",
"foregroundEdgePixels",
".",
"iterator",
"(",
")",
";",
... | Generates the background edge hash set from the foreground edge
hash set and the 2D array of pixels. | [
"Generates",
"the",
"background",
"edge",
"hash",
"set",
"from",
"the",
"foreground",
"edge",
"hash",
"set",
"and",
"the",
"2D",
"array",
"of",
"pixels",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/modules/utils/BinaryFast.java#L207-L224 |
OpenTSDB/opentsdb | src/tsd/HttpJsonSerializer.java | HttpJsonSerializer.parseQueryV1 | public TSQuery parseQueryV1() {
final String json = query.getContent();
if (json == null || json.isEmpty()) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Missing message content",
"Supply valid JSON formatted data in the body of your request");
}
try {
... | java | public TSQuery parseQueryV1() {
final String json = query.getContent();
if (json == null || json.isEmpty()) {
throw new BadRequestException(HttpResponseStatus.BAD_REQUEST,
"Missing message content",
"Supply valid JSON formatted data in the body of your request");
}
try {
... | [
"public",
"TSQuery",
"parseQueryV1",
"(",
")",
"{",
"final",
"String",
"json",
"=",
"query",
".",
"getContent",
"(",
")",
";",
"if",
"(",
"json",
"==",
"null",
"||",
"json",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"BadRequestException",
"("... | Parses a timeseries data query
@return A TSQuery with data ready to validate
@throws JSONException if parsing failed
@throws BadRequestException if the content was missing or parsing failed | [
"Parses",
"a",
"timeseries",
"data",
"query"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tsd/HttpJsonSerializer.java#L264-L281 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/BufferedByteOutputStream.java | BufferedByteOutputStream.wrapOutputStream | public static DataOutputStream wrapOutputStream(OutputStream os,
int bufferSize, int writeBufferSize) {
// wrapping BufferedByteOutputStream in BufferedOutputStream decreases
// pressure on BBOS internal locks, and we read from the BBOS in
// bigger chunks
return new DataOutputStream(new BufferedO... | java | public static DataOutputStream wrapOutputStream(OutputStream os,
int bufferSize, int writeBufferSize) {
// wrapping BufferedByteOutputStream in BufferedOutputStream decreases
// pressure on BBOS internal locks, and we read from the BBOS in
// bigger chunks
return new DataOutputStream(new BufferedO... | [
"public",
"static",
"DataOutputStream",
"wrapOutputStream",
"(",
"OutputStream",
"os",
",",
"int",
"bufferSize",
",",
"int",
"writeBufferSize",
")",
"{",
"// wrapping BufferedByteOutputStream in BufferedOutputStream decreases",
"// pressure on BBOS internal locks, and we read from th... | Wrap given output stream with BufferedByteInputOutput.
This is the only way to instantiate the buffered output stream.
@param os underlying output stream
@param bufferSize size of the in memory buffer
@param writeBufferSize size of the buffer used for writing to is | [
"Wrap",
"given",
"output",
"stream",
"with",
"BufferedByteInputOutput",
".",
"This",
"is",
"the",
"only",
"way",
"to",
"instantiate",
"the",
"buffered",
"output",
"stream",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/BufferedByteOutputStream.java#L59-L66 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/labeled/checkbox/img/LabeledImageCheckboxPanel.java | LabeledImageCheckboxPanel.newImage | protected Image newImage(final String id, final IModel<LabeledImageCheckboxModelBean> model)
{
return ComponentFactory.newImage(id, model.getObject().getImageResource());
} | java | protected Image newImage(final String id, final IModel<LabeledImageCheckboxModelBean> model)
{
return ComponentFactory.newImage(id, model.getObject().getImageResource());
} | [
"protected",
"Image",
"newImage",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"LabeledImageCheckboxModelBean",
">",
"model",
")",
"{",
"return",
"ComponentFactory",
".",
"newImage",
"(",
"id",
",",
"model",
".",
"getObject",
"(",
")",
".",
"ge... | Factory method for create a new {@link Image}. This method is invoked in the constructor from
this class and can be overridden so users can provide their own version of a new
{@link Image}.
@param id
the id
@param model
the model that contains the IResource object
@return the new {@link Image}. | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"Image",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"this",
"class",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",
"their",
"own",
... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/labeled/checkbox/img/LabeledImageCheckboxPanel.java#L91-L94 |
EsotericSoftware/kryonet | src/com/esotericsoftware/kryonet/util/ObjectIntMap.java | ObjectIntMap.getAndIncrement | public int getAndIncrement (K key, int defaultValue, int increment) {
int hashCode = key.hashCode();
int index = hashCode & mask;
if (!key.equals(keyTable[index])) {
index = hash2(hashCode);
if (!key.equals(keyTable[index])) {
index = hash3(hashCode);
if (!key.equals(keyTable[index])) return getAndI... | java | public int getAndIncrement (K key, int defaultValue, int increment) {
int hashCode = key.hashCode();
int index = hashCode & mask;
if (!key.equals(keyTable[index])) {
index = hash2(hashCode);
if (!key.equals(keyTable[index])) {
index = hash3(hashCode);
if (!key.equals(keyTable[index])) return getAndI... | [
"public",
"int",
"getAndIncrement",
"(",
"K",
"key",
",",
"int",
"defaultValue",
",",
"int",
"increment",
")",
"{",
"int",
"hashCode",
"=",
"key",
".",
"hashCode",
"(",
")",
";",
"int",
"index",
"=",
"hashCode",
"&",
"mask",
";",
"if",
"(",
"!",
"key... | Returns the key's current value and increments the stored value. If the key is not in the map, defaultValue + increment is
put into the map. | [
"Returns",
"the",
"key",
"s",
"current",
"value",
"and",
"increments",
"the",
"stored",
"value",
".",
"If",
"the",
"key",
"is",
"not",
"in",
"the",
"map",
"defaultValue",
"+",
"increment",
"is",
"put",
"into",
"the",
"map",
"."
] | train | https://github.com/EsotericSoftware/kryonet/blob/2ed19b4743667664d15e3778447e579855ba3a65/src/com/esotericsoftware/kryonet/util/ObjectIntMap.java#L294-L307 |
TNG/property-loader | src/main/java/com/tngtech/propertyloader/Obfuscator.java | Obfuscator.decryptInternal | private String decryptInternal(SecretKeySpec key, byte[] encryptedBytes) {
try {
Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
... | java | private String decryptInternal(SecretKeySpec key, byte[] encryptedBytes) {
try {
Cipher cipher = Cipher.getInstance(ENCRYPTION_ALGORITHM + ENCRYPTION_ALGORITHM_MODIFIER);
cipher.init(Cipher.DECRYPT_MODE, key);
byte[] decryptedBytes = cipher.doFinal(encryptedBytes);
... | [
"private",
"String",
"decryptInternal",
"(",
"SecretKeySpec",
"key",
",",
"byte",
"[",
"]",
"encryptedBytes",
")",
"{",
"try",
"{",
"Cipher",
"cipher",
"=",
"Cipher",
".",
"getInstance",
"(",
"ENCRYPTION_ALGORITHM",
"+",
"ENCRYPTION_ALGORITHM_MODIFIER",
")",
";",
... | Internal decryption method.
@param key - the SecretKeySpec used to decrypt
@param encryptedBytes - the byte[] to decrypt
@return the decrypted plaintext String. | [
"Internal",
"decryption",
"method",
"."
] | train | https://github.com/TNG/property-loader/blob/0fbc8a091795aaf2bdaf7c0d494a32772bff0e1f/src/main/java/com/tngtech/propertyloader/Obfuscator.java#L83-L94 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java | BeanPath.createMap | @SuppressWarnings("unchecked")
protected <K, V, E extends SimpleExpression<? super V>> MapPath<K, V, E> createMap(String property, Class<? super K> key, Class<? super V> value, Class<? super E> queryType) {
return add(new MapPath<K, V, E>(key, value, (Class) queryType, forProperty(property)));
} | java | @SuppressWarnings("unchecked")
protected <K, V, E extends SimpleExpression<? super V>> MapPath<K, V, E> createMap(String property, Class<? super K> key, Class<? super V> value, Class<? super E> queryType) {
return add(new MapPath<K, V, E>(key, value, (Class) queryType, forProperty(property)));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"K",
",",
"V",
",",
"E",
"extends",
"SimpleExpression",
"<",
"?",
"super",
"V",
">",
">",
"MapPath",
"<",
"K",
",",
"V",
",",
"E",
">",
"createMap",
"(",
"String",
"property",
",",
... | Create a new Map typed path
@param <K>
@param <V>
@param <E>
@param property property name
@param key key type
@param value value type
@param queryType expression type
@return property path | [
"Create",
"a",
"new",
"Map",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java#L233-L236 |
google/j2objc | translator/src/main/java/com/google/devtools/j2objc/util/ElementUtil.java | ElementUtil.isNonnull | public static boolean isNonnull(Element element, boolean parametersNonnullByDefault) {
return hasNonnullAnnotation(element)
|| isConstructor(element) // Java constructors are always non-null.
|| (isParameter(element)
&& parametersNonnullByDefault
&& !((VariableElement) eleme... | java | public static boolean isNonnull(Element element, boolean parametersNonnullByDefault) {
return hasNonnullAnnotation(element)
|| isConstructor(element) // Java constructors are always non-null.
|| (isParameter(element)
&& parametersNonnullByDefault
&& !((VariableElement) eleme... | [
"public",
"static",
"boolean",
"isNonnull",
"(",
"Element",
"element",
",",
"boolean",
"parametersNonnullByDefault",
")",
"{",
"return",
"hasNonnullAnnotation",
"(",
"element",
")",
"||",
"isConstructor",
"(",
"element",
")",
"// Java constructors are always non-null.",
... | Returns whether an element is marked as always being non-null. Field, method,
and parameter elements can be defined as non-null with a Nonnull annotation.
Method parameters can also be defined as non-null by annotating the owning
package or type element with the ParametersNonnullByDefault annotation. | [
"Returns",
"whether",
"an",
"element",
"is",
"marked",
"as",
"always",
"being",
"non",
"-",
"null",
".",
"Field",
"method",
"and",
"parameter",
"elements",
"can",
"be",
"defined",
"as",
"non",
"-",
"null",
"with",
"a",
"Nonnull",
"annotation",
".",
"Method... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/translator/src/main/java/com/google/devtools/j2objc/util/ElementUtil.java#L809-L815 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java | TranscoderUtils.byteBufToGenericObject | public static Object byteBufToGenericObject(ByteBuf input, ObjectMapper mapper) throws IOException {
//skip leading whitespaces
int toSkip = input.forEachByte(new WhitespaceSkipper());
if (toSkip > 0) {
input.skipBytes(toSkip);
}
//peek into the buffer for quick detec... | java | public static Object byteBufToGenericObject(ByteBuf input, ObjectMapper mapper) throws IOException {
//skip leading whitespaces
int toSkip = input.forEachByte(new WhitespaceSkipper());
if (toSkip > 0) {
input.skipBytes(toSkip);
}
//peek into the buffer for quick detec... | [
"public",
"static",
"Object",
"byteBufToGenericObject",
"(",
"ByteBuf",
"input",
",",
"ObjectMapper",
"mapper",
")",
"throws",
"IOException",
"{",
"//skip leading whitespaces",
"int",
"toSkip",
"=",
"input",
".",
"forEachByte",
"(",
"new",
"WhitespaceSkipper",
"(",
... | Converts a {@link ByteBuf} representing a valid JSON entity to a generic {@link Object},
<b>without releasing the buffer</b>. The entity can either be a JSON object, array or scalar value,
potentially with leading whitespace (which gets ignored). JSON objects are converted to a {@link JsonObject}
and JSON arrays to a {... | [
"Converts",
"a",
"{",
"@link",
"ByteBuf",
"}",
"representing",
"a",
"valid",
"JSON",
"entity",
"to",
"a",
"generic",
"{",
"@link",
"Object",
"}",
"<b",
">",
"without",
"releasing",
"the",
"buffer<",
"/",
"b",
">",
".",
"The",
"entity",
"can",
"either",
... | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/transcoder/TranscoderUtils.java#L362-L398 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java | BackendBucketClient.insertBackendBucket | @BetaApi
public final Operation insertBackendBucket(String project, BackendBucket backendBucketResource) {
InsertBackendBucketHttpRequest request =
InsertBackendBucketHttpRequest.newBuilder()
.setProject(project)
.setBackendBucketResource(backendBucketResource)
.build(... | java | @BetaApi
public final Operation insertBackendBucket(String project, BackendBucket backendBucketResource) {
InsertBackendBucketHttpRequest request =
InsertBackendBucketHttpRequest.newBuilder()
.setProject(project)
.setBackendBucketResource(backendBucketResource)
.build(... | [
"@",
"BetaApi",
"public",
"final",
"Operation",
"insertBackendBucket",
"(",
"String",
"project",
",",
"BackendBucket",
"backendBucketResource",
")",
"{",
"InsertBackendBucketHttpRequest",
"request",
"=",
"InsertBackendBucketHttpRequest",
".",
"newBuilder",
"(",
")",
".",
... | Creates a BackendBucket resource in the specified project using the data included in the
request.
<p>Sample code:
<pre><code>
try (BackendBucketClient backendBucketClient = BackendBucketClient.create()) {
ProjectName project = ProjectName.of("[PROJECT]");
BackendBucket backendBucketResource = BackendBucket.newBuilder... | [
"Creates",
"a",
"BackendBucket",
"resource",
"in",
"the",
"specified",
"project",
"using",
"the",
"data",
"included",
"in",
"the",
"request",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-compute/src/main/java/com/google/cloud/compute/v1/BackendBucketClient.java#L640-L649 |
dickschoeller/gedbrowser | gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/crud/PersonCrud.java | PersonCrud.createOne | @Override
public ApiPerson createOne(final String db, final ApiPerson person) {
logger.info("Entering create person in db: " + db);
return create(readRoot(db), person, (i, id) -> new ApiPerson(i, id));
} | java | @Override
public ApiPerson createOne(final String db, final ApiPerson person) {
logger.info("Entering create person in db: " + db);
return create(readRoot(db), person, (i, id) -> new ApiPerson(i, id));
} | [
"@",
"Override",
"public",
"ApiPerson",
"createOne",
"(",
"final",
"String",
"db",
",",
"final",
"ApiPerson",
"person",
")",
"{",
"logger",
".",
"info",
"(",
"\"Entering create person in db: \"",
"+",
"db",
")",
";",
"return",
"create",
"(",
"readRoot",
"(",
... | Create a new person from the passed object.
@param db the name of the db to access
@param person the data for the person
@return the person as created | [
"Create",
"a",
"new",
"person",
"from",
"the",
"passed",
"object",
"."
] | train | https://github.com/dickschoeller/gedbrowser/blob/e3e10b1ff3a34ebde9b7edcbfafcd5fe6fb3b3e1/gedbrowserng/src/main/java/org/schoellerfamily/gedbrowser/api/crud/PersonCrud.java#L61-L65 |
bThink-BGU/BPjs | src/main/java/il/ac/bgu/cs/bp/bpjs/analysis/DfsTraversalNode.java | DfsTraversalNode.getNextNode | public DfsTraversalNode getNextNode(BEvent e, ExecutorService exSvc) throws BPjsRuntimeException {
try {
return new DfsTraversalNode(bp, BProgramSyncSnapshotCloner.clone(systemState).triggerEvent(e, exSvc, Collections.emptySet()), e);
} catch ( InterruptedException ie ) {
throw n... | java | public DfsTraversalNode getNextNode(BEvent e, ExecutorService exSvc) throws BPjsRuntimeException {
try {
return new DfsTraversalNode(bp, BProgramSyncSnapshotCloner.clone(systemState).triggerEvent(e, exSvc, Collections.emptySet()), e);
} catch ( InterruptedException ie ) {
throw n... | [
"public",
"DfsTraversalNode",
"getNextNode",
"(",
"BEvent",
"e",
",",
"ExecutorService",
"exSvc",
")",
"throws",
"BPjsRuntimeException",
"{",
"try",
"{",
"return",
"new",
"DfsTraversalNode",
"(",
"bp",
",",
"BProgramSyncSnapshotCloner",
".",
"clone",
"(",
"systemSta... | Get a Node object for each possible state of the system after triggering
the given event.
@param e the selected event
@param exSvc The executor service that will run the threads
@return State of the BProgram after event {@code e} was selected while
the program was at {@code this} node's state.
@throws BPjsRuntimeExcep... | [
"Get",
"a",
"Node",
"object",
"for",
"each",
"possible",
"state",
"of",
"the",
"system",
"after",
"triggering",
"the",
"given",
"event",
"."
] | train | https://github.com/bThink-BGU/BPjs/blob/2d388365a27ad79ded108eaf98a35a7ef292ae1f/src/main/java/il/ac/bgu/cs/bp/bpjs/analysis/DfsTraversalNode.java#L88-L94 |
alamkanak/Android-Week-View | library/src/main/java/com/alamkanak/weekview/WeekView.java | WeekView.isEventsCollide | private boolean isEventsCollide(WeekViewEvent event1, WeekViewEvent event2) {
long start1 = event1.getStartTime().getTimeInMillis();
long end1 = event1.getEndTime().getTimeInMillis();
long start2 = event2.getStartTime().getTimeInMillis();
long end2 = event2.getEndTime().getTimeInMillis()... | java | private boolean isEventsCollide(WeekViewEvent event1, WeekViewEvent event2) {
long start1 = event1.getStartTime().getTimeInMillis();
long end1 = event1.getEndTime().getTimeInMillis();
long start2 = event2.getStartTime().getTimeInMillis();
long end2 = event2.getEndTime().getTimeInMillis()... | [
"private",
"boolean",
"isEventsCollide",
"(",
"WeekViewEvent",
"event1",
",",
"WeekViewEvent",
"event2",
")",
"{",
"long",
"start1",
"=",
"event1",
".",
"getStartTime",
"(",
")",
".",
"getTimeInMillis",
"(",
")",
";",
"long",
"end1",
"=",
"event1",
".",
"get... | Checks if two events overlap.
@param event1 The first event.
@param event2 The second event.
@return true if the events overlap. | [
"Checks",
"if",
"two",
"events",
"overlap",
"."
] | train | https://github.com/alamkanak/Android-Week-View/blob/dc3f97d65d44785d1a761b52b58527c86c4eee1b/library/src/main/java/com/alamkanak/weekview/WeekView.java#L1194-L1200 |
lessthanoptimal/ddogleg | src/org/ddogleg/optimization/math/HessianSchurComplement_DDRM.java | HessianSchurComplement_DDRM.computeHessian | @Override
public void computeHessian(DMatrixRMaj jacLeft , DMatrixRMaj jacRight) {
A.reshape(jacLeft.numCols,jacLeft.numCols);
B.reshape(jacLeft.numCols,jacRight.numCols);
D.reshape(jacRight.numCols,jacRight.numCols);
// take advantage of the inner product's symmetry when possible to reduce
// the number of... | java | @Override
public void computeHessian(DMatrixRMaj jacLeft , DMatrixRMaj jacRight) {
A.reshape(jacLeft.numCols,jacLeft.numCols);
B.reshape(jacLeft.numCols,jacRight.numCols);
D.reshape(jacRight.numCols,jacRight.numCols);
// take advantage of the inner product's symmetry when possible to reduce
// the number of... | [
"@",
"Override",
"public",
"void",
"computeHessian",
"(",
"DMatrixRMaj",
"jacLeft",
",",
"DMatrixRMaj",
"jacRight",
")",
"{",
"A",
".",
"reshape",
"(",
"jacLeft",
".",
"numCols",
",",
"jacLeft",
".",
"numCols",
")",
";",
"B",
".",
"reshape",
"(",
"jacLeft"... | Compuets the Hessian in block form
@param jacLeft (Input) Left side of Jacobian
@param jacRight (Input) Right side of Jacobian | [
"Compuets",
"the",
"Hessian",
"in",
"block",
"form"
] | train | https://github.com/lessthanoptimal/ddogleg/blob/3786bf448ba23d0e04962dd08c34fa68de276029/src/org/ddogleg/optimization/math/HessianSchurComplement_DDRM.java#L54-L67 |
massimozappino/tagmycode-java-plugin-framework | src/main/java/com/tagmycode/plugin/gui/TextPrompt.java | TextPrompt.changeAlpha | public void changeAlpha(int alpha) {
alpha = alpha > 255 ? 255 : alpha < 0 ? 0 : alpha;
Color foreground = getForeground();
int red = foreground.getRed();
int green = foreground.getGreen();
int blue = foreground.getBlue();
Color withAlpha = new Color(red, green, blue, a... | java | public void changeAlpha(int alpha) {
alpha = alpha > 255 ? 255 : alpha < 0 ? 0 : alpha;
Color foreground = getForeground();
int red = foreground.getRed();
int green = foreground.getGreen();
int blue = foreground.getBlue();
Color withAlpha = new Color(red, green, blue, a... | [
"public",
"void",
"changeAlpha",
"(",
"int",
"alpha",
")",
"{",
"alpha",
"=",
"alpha",
">",
"255",
"?",
"255",
":",
"alpha",
"<",
"0",
"?",
"0",
":",
"alpha",
";",
"Color",
"foreground",
"=",
"getForeground",
"(",
")",
";",
"int",
"red",
"=",
"fore... | Convenience method to applyChanges the alpha value of the current foreground
Color to the specifice value.
@param alpha value in the range of 0 - 255. | [
"Convenience",
"method",
"to",
"applyChanges",
"the",
"alpha",
"value",
"of",
"the",
"current",
"foreground",
"Color",
"to",
"the",
"specifice",
"value",
"."
] | train | https://github.com/massimozappino/tagmycode-java-plugin-framework/blob/06637e32bf737e3e0d318859c718815edac9d0f0/src/main/java/com/tagmycode/plugin/gui/TextPrompt.java#L68-L78 |
thinkaurelius/titan | titan-core/src/main/java/com/thinkaurelius/titan/util/stats/ObjectAccumulator.java | ObjectAccumulator.incBy | public double incBy(K o, double inc) {
Counter c = countMap.get(o);
if (c == null) {
c = new Counter();
countMap.put(o, c);
}
c.count += inc;
return c.count;
} | java | public double incBy(K o, double inc) {
Counter c = countMap.get(o);
if (c == null) {
c = new Counter();
countMap.put(o, c);
}
c.count += inc;
return c.count;
} | [
"public",
"double",
"incBy",
"(",
"K",
"o",
",",
"double",
"inc",
")",
"{",
"Counter",
"c",
"=",
"countMap",
".",
"get",
"(",
"o",
")",
";",
"if",
"(",
"c",
"==",
"null",
")",
"{",
"c",
"=",
"new",
"Counter",
"(",
")",
";",
"countMap",
".",
"... | Increases the count of object o by inc and returns the new count value
@param o
@param inc
@return | [
"Increases",
"the",
"count",
"of",
"object",
"o",
"by",
"inc",
"and",
"returns",
"the",
"new",
"count",
"value"
] | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-core/src/main/java/com/thinkaurelius/titan/util/stats/ObjectAccumulator.java#L36-L44 |
roboconf/roboconf-platform | core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java | OcciVMUtils.deleteVM | public static boolean deleteVM(String hostIpPort, String id) throws TargetException {
if(id.startsWith("urn:uuid:")) id = id.substring(9);
String ret = null;
URL url = null;
try {
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
url = new URL("http://" + hostIpPort + "/" + id);... | java | public static boolean deleteVM(String hostIpPort, String id) throws TargetException {
if(id.startsWith("urn:uuid:")) id = id.substring(9);
String ret = null;
URL url = null;
try {
CookieHandler.setDefault(new CookieManager(null, CookiePolicy.ACCEPT_ALL));
url = new URL("http://" + hostIpPort + "/" + id);... | [
"public",
"static",
"boolean",
"deleteVM",
"(",
"String",
"hostIpPort",
",",
"String",
"id",
")",
"throws",
"TargetException",
"{",
"if",
"(",
"id",
".",
"startsWith",
"(",
"\"urn:uuid:\"",
")",
")",
"id",
"=",
"id",
".",
"substring",
"(",
"9",
")",
";",... | Deletes a VM (OCCI / VMWare).
@param hostIpPort IP and port of OCCI server (eg. "172.16.225.91:8080")
@param id Unique VM ID
@return true if deletion OK, false otherwise | [
"Deletes",
"a",
"VM",
"(",
"OCCI",
"/",
"VMWare",
")",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-target-iaas-occi/src/main/java/net/roboconf/target/occi/internal/OcciVMUtils.java#L533-L569 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.newDriverInstance | public Object newDriverInstance(CmsParameterConfiguration configuration, String driverName, String driverPoolUrl)
throws CmsException {
Class<?>[] initParamClasses = {CmsParameterConfiguration.class, String.class, CmsDriverManager.class};
Object[] initParams = {configuration, driverPoolUrl, this};
... | java | public Object newDriverInstance(CmsParameterConfiguration configuration, String driverName, String driverPoolUrl)
throws CmsException {
Class<?>[] initParamClasses = {CmsParameterConfiguration.class, String.class, CmsDriverManager.class};
Object[] initParams = {configuration, driverPoolUrl, this};
... | [
"public",
"Object",
"newDriverInstance",
"(",
"CmsParameterConfiguration",
"configuration",
",",
"String",
"driverName",
",",
"String",
"driverPoolUrl",
")",
"throws",
"CmsException",
"{",
"Class",
"<",
"?",
">",
"[",
"]",
"initParamClasses",
"=",
"{",
"CmsParameter... | Method to create a new instance of a driver.<p>
@param configuration the configurations from the propertyfile
@param driverName the class name of the driver
@param driverPoolUrl the pool url for the driver
@return an initialized instance of the driver
@throws CmsException if something goes wrong | [
"Method",
"to",
"create",
"a",
"new",
"instance",
"of",
"a",
"driver",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L5970-L6009 |
cdk/cdk | base/core/src/main/java/org/openscience/cdk/graph/PathTools.java | PathTools.breadthFirstSearch | public static void breadthFirstSearch(IAtomContainer atomContainer, List<IAtom> sphere, IAtomContainer molecule) {
// logger.debug("Staring partitioning with this ac: " + ac);
breadthFirstSearch(atomContainer, sphere, molecule, -1);
} | java | public static void breadthFirstSearch(IAtomContainer atomContainer, List<IAtom> sphere, IAtomContainer molecule) {
// logger.debug("Staring partitioning with this ac: " + ac);
breadthFirstSearch(atomContainer, sphere, molecule, -1);
} | [
"public",
"static",
"void",
"breadthFirstSearch",
"(",
"IAtomContainer",
"atomContainer",
",",
"List",
"<",
"IAtom",
">",
"sphere",
",",
"IAtomContainer",
"molecule",
")",
"{",
"// logger.debug(\"Staring partitioning with this ac: \" + ac);",
"breadthFirstSearch",
"(",
"ato... | Performs a breadthFirstSearch in an AtomContainer starting with a
particular sphere, which usually consists of one start atom. While
searching the graph, the method marks each visited atom. It then puts all
the atoms connected to the atoms in the given sphere into a new vector
which forms the sphere to search for the n... | [
"Performs",
"a",
"breadthFirstSearch",
"in",
"an",
"AtomContainer",
"starting",
"with",
"a",
"particular",
"sphere",
"which",
"usually",
"consists",
"of",
"one",
"start",
"atom",
".",
"While",
"searching",
"the",
"graph",
"the",
"method",
"marks",
"each",
"visit... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/core/src/main/java/org/openscience/cdk/graph/PathTools.java#L203-L206 |
landawn/AbacusUtil | src/com/landawn/abacus/util/CSVUtil.java | CSVUtil.loadCSV | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final InputStream csvInputStream, final long offset, final long count,
final Try.Predicate<String[], E> filter, final List<? extends Type> columnTypeList) throws E {
final Reader csvReader = new InputStreamReade... | java | @SuppressWarnings("rawtypes")
public static <E extends Exception> DataSet loadCSV(final InputStream csvInputStream, final long offset, final long count,
final Try.Predicate<String[], E> filter, final List<? extends Type> columnTypeList) throws E {
final Reader csvReader = new InputStreamReade... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"<",
"E",
"extends",
"Exception",
">",
"DataSet",
"loadCSV",
"(",
"final",
"InputStream",
"csvInputStream",
",",
"final",
"long",
"offset",
",",
"final",
"long",
"count",
",",
"final",
"Try... | Load the data from CSV.
@param csvInputStream
@param offset
@param count
@param filter
@param columnTypeList set the column type to null to skip the column in CSV.
@return | [
"Load",
"the",
"data",
"from",
"CSV",
".",
"@param",
"csvInputStream",
"@param",
"offset",
"@param",
"count",
"@param",
"filter",
"@param",
"columnTypeList",
"set",
"the",
"column",
"type",
"to",
"null",
"to",
"skip",
"the",
"column",
"in",
"CSV",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/CSVUtil.java#L595-L601 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java | ConnectionMonitorsInner.createOrUpdate | public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().b... | java | public ConnectionMonitorResultInner createOrUpdate(String resourceGroupName, String networkWatcherName, String connectionMonitorName, ConnectionMonitorInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkWatcherName, connectionMonitorName, parameters).toBlocking().last().b... | [
"public",
"ConnectionMonitorResultInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkWatcherName",
",",
"String",
"connectionMonitorName",
",",
"ConnectionMonitorInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
... | Create or update a connection monitor.
@param resourceGroupName The name of the resource group containing Network Watcher.
@param networkWatcherName The name of the Network Watcher resource.
@param connectionMonitorName The name of the connection monitor.
@param parameters Parameters that define the operation to creat... | [
"Create",
"or",
"update",
"a",
"connection",
"monitor",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ConnectionMonitorsInner.java#L122-L124 |
negusoft/holoaccent | HoloAccent/src/com/negusoft/holoaccent/AccentResources.java | AccentResources.getTintendResourceStream | private InputStream getTintendResourceStream(int id, TypedValue value, int color) {
Bitmap bitmap = getBitmapFromResource(id, value);
bitmap = BitmapUtils.applyColor(bitmap, color);
return getStreamFromBitmap(bitmap);
} | java | private InputStream getTintendResourceStream(int id, TypedValue value, int color) {
Bitmap bitmap = getBitmapFromResource(id, value);
bitmap = BitmapUtils.applyColor(bitmap, color);
return getStreamFromBitmap(bitmap);
} | [
"private",
"InputStream",
"getTintendResourceStream",
"(",
"int",
"id",
",",
"TypedValue",
"value",
",",
"int",
"color",
")",
"{",
"Bitmap",
"bitmap",
"=",
"getBitmapFromResource",
"(",
"id",
",",
"value",
")",
";",
"bitmap",
"=",
"BitmapUtils",
".",
"applyCol... | Get a reference to a resource that is equivalent to the one requested,
but with the accent color applied to it. | [
"Get",
"a",
"reference",
"to",
"a",
"resource",
"that",
"is",
"equivalent",
"to",
"the",
"one",
"requested",
"but",
"with",
"the",
"accent",
"color",
"applied",
"to",
"it",
"."
] | train | https://github.com/negusoft/holoaccent/blob/7121a02dde94834e770cb81174d0bdc596323324/HoloAccent/src/com/negusoft/holoaccent/AccentResources.java#L366-L370 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.drawImage | public void drawImage (final PDInlineImage inlineImage,
final float x,
final float y,
final float width,
final float height) throws IOException
{
if (inTextMode)
{
throw new IllegalStateException ("Error:... | java | public void drawImage (final PDInlineImage inlineImage,
final float x,
final float y,
final float width,
final float height) throws IOException
{
if (inTextMode)
{
throw new IllegalStateException ("Error:... | [
"public",
"void",
"drawImage",
"(",
"final",
"PDInlineImage",
"inlineImage",
",",
"final",
"float",
"x",
",",
"final",
"float",
"y",
",",
"final",
"float",
"width",
",",
"final",
"float",
"height",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inTextMode",
... | Draw an inline image at the x,y coordinates and a certain width and height.
@param inlineImage
The inline image to draw.
@param x
The x-coordinate to draw the inline image.
@param y
The y-coordinate to draw the inline image.
@param width
The width of the inline image to draw.
@param height
The height of the inline ima... | [
"Draw",
"an",
"inline",
"image",
"at",
"the",
"x",
"y",
"coordinates",
"and",
"a",
"certain",
"width",
"and",
"height",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L568-L627 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java | AbstractSecurityController.setVisibilityOnControlledObject | private void setVisibilityOnControlledObject(Object controlledObject, boolean authorized) {
try {
Method method = controlledObject.getClass().getMethod( "setVisible", new Class[] { boolean.class } );
method.invoke( controlledObject, new Object[] { new Boolean( authorized ) } );
}... | java | private void setVisibilityOnControlledObject(Object controlledObject, boolean authorized) {
try {
Method method = controlledObject.getClass().getMethod( "setVisible", new Class[] { boolean.class } );
method.invoke( controlledObject, new Object[] { new Boolean( authorized ) } );
}... | [
"private",
"void",
"setVisibilityOnControlledObject",
"(",
"Object",
"controlledObject",
",",
"boolean",
"authorized",
")",
"{",
"try",
"{",
"Method",
"method",
"=",
"controlledObject",
".",
"getClass",
"(",
")",
".",
"getMethod",
"(",
"\"setVisible\"",
",",
"new"... | Set the visible property on a controlled action according to the provided
authorization. | [
"Set",
"the",
"visible",
"property",
"on",
"a",
"controlled",
"action",
"according",
"to",
"the",
"provided",
"authorization",
"."
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/security/support/AbstractSecurityController.java#L218-L230 |
netscaler/nitro | src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_binding.java | wisite_binding.get | public static wisite_binding get(nitro_service service, String sitepath) throws Exception{
wisite_binding obj = new wisite_binding();
obj.set_sitepath(sitepath);
wisite_binding response = (wisite_binding) obj.get_resource(service);
return response;
} | java | public static wisite_binding get(nitro_service service, String sitepath) throws Exception{
wisite_binding obj = new wisite_binding();
obj.set_sitepath(sitepath);
wisite_binding response = (wisite_binding) obj.get_resource(service);
return response;
} | [
"public",
"static",
"wisite_binding",
"get",
"(",
"nitro_service",
"service",
",",
"String",
"sitepath",
")",
"throws",
"Exception",
"{",
"wisite_binding",
"obj",
"=",
"new",
"wisite_binding",
"(",
")",
";",
"obj",
".",
"set_sitepath",
"(",
"sitepath",
")",
";... | Use this API to fetch wisite_binding resource of given name . | [
"Use",
"this",
"API",
"to",
"fetch",
"wisite_binding",
"resource",
"of",
"given",
"name",
"."
] | train | https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/wi/wisite_binding.java#L125-L130 |
carewebframework/carewebframework-core | org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpHistory.java | HelpHistory.sameTopic | private boolean sameTopic(HelpTopic topic1, HelpTopic topic2) {
return topic1 == topic2 || (topic1 != null && topic2 != null && topic1.equals(topic2));
} | java | private boolean sameTopic(HelpTopic topic1, HelpTopic topic2) {
return topic1 == topic2 || (topic1 != null && topic2 != null && topic1.equals(topic2));
} | [
"private",
"boolean",
"sameTopic",
"(",
"HelpTopic",
"topic1",
",",
"HelpTopic",
"topic2",
")",
"{",
"return",
"topic1",
"==",
"topic2",
"||",
"(",
"topic1",
"!=",
"null",
"&&",
"topic2",
"!=",
"null",
"&&",
"topic1",
".",
"equals",
"(",
"topic2",
")",
"... | Because the HelpTopic class does not implement its own equals method, have to implement
equality test here. Two topics are considered equal if the are the same instance or if their
targets are equal.
@param topic1 First topic to compare.
@param topic2 Second topic to compare.
@return True if topics are equal. | [
"Because",
"the",
"HelpTopic",
"class",
"does",
"not",
"implement",
"its",
"own",
"equals",
"method",
"have",
"to",
"implement",
"equality",
"test",
"here",
".",
"Two",
"topics",
"are",
"considered",
"equal",
"if",
"the",
"are",
"the",
"same",
"instance",
"o... | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.help-parent/org.carewebframework.help.core/src/main/java/org/carewebframework/help/viewer/HelpHistory.java#L116-L118 |
alibaba/jstorm | example/sequence-split-merge/src/main/java/org/apache/storm/starter/trident/TridentMinMaxOfVehiclesTopology.java | TridentMinMaxOfVehiclesTopology.buildVehiclesTopology | public static StormTopology buildVehiclesTopology() {
Fields driverField = new Fields(Driver.FIELD_NAME);
Fields vehicleField = new Fields(Vehicle.FIELD_NAME);
Fields allFields = new Fields(Vehicle.FIELD_NAME, Driver.FIELD_NAME);
FixedBatchSpout spout = new FixedBatchSpout(allFi... | java | public static StormTopology buildVehiclesTopology() {
Fields driverField = new Fields(Driver.FIELD_NAME);
Fields vehicleField = new Fields(Vehicle.FIELD_NAME);
Fields allFields = new Fields(Vehicle.FIELD_NAME, Driver.FIELD_NAME);
FixedBatchSpout spout = new FixedBatchSpout(allFi... | [
"public",
"static",
"StormTopology",
"buildVehiclesTopology",
"(",
")",
"{",
"Fields",
"driverField",
"=",
"new",
"Fields",
"(",
"Driver",
".",
"FIELD_NAME",
")",
";",
"Fields",
"vehicleField",
"=",
"new",
"Fields",
"(",
"Vehicle",
".",
"FIELD_NAME",
")",
";",... | Creates a topology which demonstrates min/max operations on tuples of
stream which contain vehicle and driver fields with values
{@link TridentMinMaxOfVehiclesTopology.Vehicle} and
{@link TridentMinMaxOfVehiclesTopology.Driver} respectively. | [
"Creates",
"a",
"topology",
"which",
"demonstrates",
"min",
"/",
"max",
"operations",
"on",
"tuples",
"of",
"stream",
"which",
"contain",
"vehicle",
"and",
"driver",
"fields",
"with",
"values",
"{"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/example/sequence-split-merge/src/main/java/org/apache/storm/starter/trident/TridentMinMaxOfVehiclesTopology.java#L57-L84 |
atomix/atomix | primitive/src/main/java/io/atomix/primitive/proxy/impl/LogProxySession.java | LogProxySession.getOrCreateSession | private Session getOrCreateSession(SessionId sessionId) {
Session session = sessions.get(sessionId);
if (session == null) {
session = new LocalSession(sessionId, name(), type(), null, service.serializer());
sessions.put(session.sessionId(), session);
service.register(session);
}
return... | java | private Session getOrCreateSession(SessionId sessionId) {
Session session = sessions.get(sessionId);
if (session == null) {
session = new LocalSession(sessionId, name(), type(), null, service.serializer());
sessions.put(session.sessionId(), session);
service.register(session);
}
return... | [
"private",
"Session",
"getOrCreateSession",
"(",
"SessionId",
"sessionId",
")",
"{",
"Session",
"session",
"=",
"sessions",
".",
"get",
"(",
"sessionId",
")",
";",
"if",
"(",
"session",
"==",
"null",
")",
"{",
"session",
"=",
"new",
"LocalSession",
"(",
"s... | Gets or creates a session.
@param sessionId the session identifier
@return the session | [
"Gets",
"or",
"creates",
"a",
"session",
"."
] | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/primitive/src/main/java/io/atomix/primitive/proxy/impl/LogProxySession.java#L170-L178 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java | Widget.setRotation | public void setRotation(float w, float x, float y, float z) {
getTransform().setRotation(w, x, y, z);
if (mTransformCache.setRotation(w, x, y, z)) {
onTransformChanged();
}
} | java | public void setRotation(float w, float x, float y, float z) {
getTransform().setRotation(w, x, y, z);
if (mTransformCache.setRotation(w, x, y, z)) {
onTransformChanged();
}
} | [
"public",
"void",
"setRotation",
"(",
"float",
"w",
",",
"float",
"x",
",",
"float",
"y",
",",
"float",
"z",
")",
"{",
"getTransform",
"(",
")",
".",
"setRotation",
"(",
"w",
",",
"x",
",",
"y",
",",
"z",
")",
";",
"if",
"(",
"mTransformCache",
"... | Set rotation, as a quaternion.
Sets the widget's current rotation in quaternion terms. Overrides any
previous rotations using {@link #rotate(float, float, float, float)
rotate()}, {@link #rotateByAxis(float, float, float, float)
rotateByAxis()} , or
{@link #rotateByAxisWithPivot(float, float, float, float, float, floa... | [
"Set",
"rotation",
"as",
"a",
"quaternion",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L1393-L1398 |
cdapio/tigon | tigon-yarn/src/main/java/co/cask/tigon/lang/ClassLoaders.java | ClassLoaders.getClassLoader | public static ClassLoader getClassLoader(TypeToken<?> type) {
Set<ClassLoader> classLoaders = Sets.newIdentityHashSet();
// Breath first traversal into the Type.
Queue<TypeToken<?>> queue = Lists.newLinkedList();
queue.add(type);
while (!queue.isEmpty()) {
type = queue.remove();
ClassLo... | java | public static ClassLoader getClassLoader(TypeToken<?> type) {
Set<ClassLoader> classLoaders = Sets.newIdentityHashSet();
// Breath first traversal into the Type.
Queue<TypeToken<?>> queue = Lists.newLinkedList();
queue.add(type);
while (!queue.isEmpty()) {
type = queue.remove();
ClassLo... | [
"public",
"static",
"ClassLoader",
"getClassLoader",
"(",
"TypeToken",
"<",
"?",
">",
"type",
")",
"{",
"Set",
"<",
"ClassLoader",
">",
"classLoaders",
"=",
"Sets",
".",
"newIdentityHashSet",
"(",
")",
";",
"// Breath first traversal into the Type.",
"Queue",
"<",... | Returns the ClassLoader of the given type. If the given type is a {@link java.lang.reflect.ParameterizedType},
it returns a {@link CombineClassLoader} of all types. The context ClassLoader or System ClassLoader would be used
as the parent of the CombineClassLoader.
@return A new CombineClassLoader. If no ClassLoader i... | [
"Returns",
"the",
"ClassLoader",
"of",
"the",
"given",
"type",
".",
"If",
"the",
"given",
"type",
"is",
"a",
"{",
"@link",
"java",
".",
"lang",
".",
"reflect",
".",
"ParameterizedType",
"}",
"it",
"returns",
"a",
"{",
"@link",
"CombineClassLoader",
"}",
... | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-yarn/src/main/java/co/cask/tigon/lang/ClassLoaders.java#L101-L129 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.setEnum | public <T extends Enum<T>> void setEnum(String name, T value) {
set(name, value.toString());
} | java | public <T extends Enum<T>> void setEnum(String name, T value) {
set(name, value.toString());
} | [
"public",
"<",
"T",
"extends",
"Enum",
"<",
"T",
">",
">",
"void",
"setEnum",
"(",
"String",
"name",
",",
"T",
"value",
")",
"{",
"set",
"(",
"name",
",",
"value",
".",
"toString",
"(",
")",
")",
";",
"}"
] | Set the value of the <code>name</code> property to the given type. This
is equivalent to <code>set(<name>, value.toString())</code>.
@param name property name
@param value new value | [
"Set",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"to",
"the",
"given",
"type",
".",
"This",
"is",
"equivalent",
"to",
"<code",
">",
"set",
"(",
"<",
";",
"name>",
";",
"value",
".",
"toString",
"()",
")",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1572-L1574 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java | UIManager.createRenderer | private static Renderer createRenderer(final String rendererName) {
if (rendererName.endsWith(".vm")) {
// This is a velocity template, so use a VelocityLayout
return new VelocityRenderer(rendererName);
}
try {
Class<?> managerClass = Class.forName(rendererName);
Object manager = managerClass.newInst... | java | private static Renderer createRenderer(final String rendererName) {
if (rendererName.endsWith(".vm")) {
// This is a velocity template, so use a VelocityLayout
return new VelocityRenderer(rendererName);
}
try {
Class<?> managerClass = Class.forName(rendererName);
Object manager = managerClass.newInst... | [
"private",
"static",
"Renderer",
"createRenderer",
"(",
"final",
"String",
"rendererName",
")",
"{",
"if",
"(",
"rendererName",
".",
"endsWith",
"(",
"\".vm\"",
")",
")",
"{",
"// This is a velocity template, so use a VelocityLayout",
"return",
"new",
"VelocityRenderer"... | Attempts to create a Renderer with the given name.
@param rendererName the name of the Renderer
@return a Renderer of the given type, or null if the class was not found. | [
"Attempts",
"to",
"create",
"a",
"Renderer",
"with",
"the",
"given",
"name",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/layout/UIManager.java#L288-L311 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler2.java | BreakpointMessageHandler2.isBreakpoint | public boolean isBreakpoint(Message aMessage, boolean isRequest, boolean onlyIfInScope) {
if (aMessage.isForceIntercept()) {
// The browser told us to do it Your Honour
return true;
}
if (onlyIfInScope && ! aMessage.isInScope()) {
return false;... | java | public boolean isBreakpoint(Message aMessage, boolean isRequest, boolean onlyIfInScope) {
if (aMessage.isForceIntercept()) {
// The browser told us to do it Your Honour
return true;
}
if (onlyIfInScope && ! aMessage.isInScope()) {
return false;... | [
"public",
"boolean",
"isBreakpoint",
"(",
"Message",
"aMessage",
",",
"boolean",
"isRequest",
",",
"boolean",
"onlyIfInScope",
")",
"{",
"if",
"(",
"aMessage",
".",
"isForceIntercept",
"(",
")",
")",
"{",
"// The browser told us to do it Your Honour\r",
"return",
"t... | You have to handle {@link Mode#safe} outside.
@param aMessage
@param isRequest
@param onlyIfInScope
@return True if a breakpoint for given message exists. | [
"You",
"have",
"to",
"handle",
"{",
"@link",
"Mode#safe",
"}",
"outside",
"."
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/brk/BreakpointMessageHandler2.java#L142-L164 |
jbundle/jbundle | base/db/jdbc/src/main/java/org/jbundle/base/db/jdbc/JdbcTable.java | JdbcTable.setResultSet | public void setResultSet(ResultSet resultSet, int iType)
{
if (this.getResultSet(iType) != null)
{ // If this is a new resultSet for my current statement, close the old resultSet.
try {
this.getResultSet(iType).close();
} catch (SQLException e) {
... | java | public void setResultSet(ResultSet resultSet, int iType)
{
if (this.getResultSet(iType) != null)
{ // If this is a new resultSet for my current statement, close the old resultSet.
try {
this.getResultSet(iType).close();
} catch (SQLException e) {
... | [
"public",
"void",
"setResultSet",
"(",
"ResultSet",
"resultSet",
",",
"int",
"iType",
")",
"{",
"if",
"(",
"this",
".",
"getResultSet",
"(",
"iType",
")",
"!=",
"null",
")",
"{",
"// If this is a new resultSet for my current statement, close the old resultSet.",
"try"... | Set the ResultSet for this select or seek statement type.
@param resultSet The resultSet to set.
@return The old resultSet. | [
"Set",
"the",
"ResultSet",
"for",
"this",
"select",
"or",
"seek",
"statement",
"type",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/db/jdbc/src/main/java/org/jbundle/base/db/jdbc/JdbcTable.java#L472-L510 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java | IntuitResponseDeserializer.getCDCQueryResponse | private CDCResponse getCDCQueryResponse(JsonNode jsonNode) throws IOException {
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("CDCQueryResponseDeserializer", new Version(1, 0, 0, null));
simpleModule.addDeserializer(CDCResponse.class, new CDCQueryResponseDeserializer());
... | java | private CDCResponse getCDCQueryResponse(JsonNode jsonNode) throws IOException {
ObjectMapper mapper = new ObjectMapper();
SimpleModule simpleModule = new SimpleModule("CDCQueryResponseDeserializer", new Version(1, 0, 0, null));
simpleModule.addDeserializer(CDCResponse.class, new CDCQueryResponseDeserializer());
... | [
"private",
"CDCResponse",
"getCDCQueryResponse",
"(",
"JsonNode",
"jsonNode",
")",
"throws",
"IOException",
"{",
"ObjectMapper",
"mapper",
"=",
"new",
"ObjectMapper",
"(",
")",
";",
"SimpleModule",
"simpleModule",
"=",
"new",
"SimpleModule",
"(",
"\"CDCQueryResponseDe... | Method to deserialize the CDCQueryResponse object
@param jsonNode
@return CDCResponse | [
"Method",
"to",
"deserialize",
"the",
"CDCQueryResponse",
"object"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/serialization/IntuitResponseDeserializer.java#L336-L346 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java | GlobalUsersInner.stopEnvironmentAsync | public Observable<Void> stopEnvironmentAsync(String userName, String environmentId) {
return stopEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return... | java | public Observable<Void> stopEnvironmentAsync(String userName, String environmentId) {
return stopEnvironmentWithServiceResponseAsync(userName, environmentId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceResponse<Void> response) {
return... | [
"public",
"Observable",
"<",
"Void",
">",
"stopEnvironmentAsync",
"(",
"String",
"userName",
",",
"String",
"environmentId",
")",
"{",
"return",
"stopEnvironmentWithServiceResponseAsync",
"(",
"userName",
",",
"environmentId",
")",
".",
"map",
"(",
"new",
"Func1",
... | Stops an environment by stopping all resources inside the environment This operation can take a while to complete.
@param userName The name of the user.
@param environmentId The resourceId of the environment
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the reques... | [
"Stops",
"an",
"environment",
"by",
"stopping",
"all",
"resources",
"inside",
"the",
"environment",
"This",
"operation",
"can",
"take",
"a",
"while",
"to",
"complete",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/GlobalUsersInner.java#L1259-L1266 |
youseries/urule | urule-core/src/main/java/com/bstek/urule/runtime/KnowledgeSessionFactory.java | KnowledgeSessionFactory.newBatchSession | public static BatchSession newBatchSession(KnowledgePackage[] knowledgePackages,int threadSize,int batchSize){
return new BatchSessionImpl(knowledgePackages,threadSize,batchSize);
} | java | public static BatchSession newBatchSession(KnowledgePackage[] knowledgePackages,int threadSize,int batchSize){
return new BatchSessionImpl(knowledgePackages,threadSize,batchSize);
} | [
"public",
"static",
"BatchSession",
"newBatchSession",
"(",
"KnowledgePackage",
"[",
"]",
"knowledgePackages",
",",
"int",
"threadSize",
",",
"int",
"batchSize",
")",
"{",
"return",
"new",
"BatchSessionImpl",
"(",
"knowledgePackages",
",",
"threadSize",
",",
"batchS... | 创建一个用于批处理的BatchSession对象,第二个参数来指定线程池中可用线程个数,第三个参数用来决定单个线程处理的任务数
@param knowledgePackages 创建BatchSession对象所需要的KnowledgePackage集合对象
@param threadSize 线程池中可用的线程个数
@param batchSize 单个线程处理的任务数
@return 返回一个新的BatchSession对象 | [
"创建一个用于批处理的BatchSession对象,第二个参数来指定线程池中可用线程个数,第三个参数用来决定单个线程处理的任务数"
] | train | https://github.com/youseries/urule/blob/3fa0eb4439e97aa292e744bcbd88a9faa36661d8/urule-core/src/main/java/com/bstek/urule/runtime/KnowledgeSessionFactory.java#L132-L134 |
apptik/jus | android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java | ImageLoader.isCached | public boolean isCached(String requestUrl, int maxWidth, int maxHeight) {
return isCached(requestUrl, maxWidth, maxHeight, ScaleType.CENTER_INSIDE);
} | java | public boolean isCached(String requestUrl, int maxWidth, int maxHeight) {
return isCached(requestUrl, maxWidth, maxHeight, ScaleType.CENTER_INSIDE);
} | [
"public",
"boolean",
"isCached",
"(",
"String",
"requestUrl",
",",
"int",
"maxWidth",
",",
"int",
"maxHeight",
")",
"{",
"return",
"isCached",
"(",
"requestUrl",
",",
"maxWidth",
",",
"maxHeight",
",",
"ScaleType",
".",
"CENTER_INSIDE",
")",
";",
"}"
] | Checks if the item is available in the cache.
@param requestUrl The url of the remote image
@param maxWidth The maximum width of the returned image.
@param maxHeight The maximum height of the returned image.
@return True if the item exists in cache, false otherwise. | [
"Checks",
"if",
"the",
"item",
"is",
"available",
"in",
"the",
"cache",
"."
] | train | https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/android/jus-android/src/main/java/io/apptik/comm/jus/ui/ImageLoader.java#L209-L211 |
undertow-io/undertow | core/src/main/java/io/undertow/websockets/core/WebSockets.java | WebSockets.sendBinary | public static void sendBinary(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback, long timeoutmillis) {
sendInternal(mergeBuffers(data), WebSocketFrameType.BINARY, wsChannel, callback, null, timeoutmillis);
} | java | public static void sendBinary(final ByteBuffer[] data, final WebSocketChannel wsChannel, final WebSocketCallback<Void> callback, long timeoutmillis) {
sendInternal(mergeBuffers(data), WebSocketFrameType.BINARY, wsChannel, callback, null, timeoutmillis);
} | [
"public",
"static",
"void",
"sendBinary",
"(",
"final",
"ByteBuffer",
"[",
"]",
"data",
",",
"final",
"WebSocketChannel",
"wsChannel",
",",
"final",
"WebSocketCallback",
"<",
"Void",
">",
"callback",
",",
"long",
"timeoutmillis",
")",
"{",
"sendInternal",
"(",
... | Sends a complete binary message, invoking the callback when complete
@param data The data to send
@param wsChannel The web socket channel
@param callback The callback to invoke on completion
@param timeoutmillis the timeout in milliseconds | [
"Sends",
"a",
"complete",
"binary",
"message",
"invoking",
"the",
"callback",
"when",
"complete"
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/websockets/core/WebSockets.java#L661-L663 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Solo.java | Solo.scrollViewToSide | public void scrollViewToSide(View view, int side, float scrollPosition, int stepCount) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollViewToSide("+view+", "+side+", "+scrollPosition+", "+stepCount+")");
}
waitForView(view);
sleeper.sleep();
switch (side){
case RIGHT: scroller.scro... | java | public void scrollViewToSide(View view, int side, float scrollPosition, int stepCount) {
if(config.commandLogging){
Log.d(config.commandLoggingTag, "scrollViewToSide("+view+", "+side+", "+scrollPosition+", "+stepCount+")");
}
waitForView(view);
sleeper.sleep();
switch (side){
case RIGHT: scroller.scro... | [
"public",
"void",
"scrollViewToSide",
"(",
"View",
"view",
",",
"int",
"side",
",",
"float",
"scrollPosition",
",",
"int",
"stepCount",
")",
"{",
"if",
"(",
"config",
".",
"commandLogging",
")",
"{",
"Log",
".",
"d",
"(",
"config",
".",
"commandLoggingTag"... | Scrolls a View horizontally.
@param view the View to scroll
@param side the side to scroll; {@link #RIGHT} or {@link #LEFT}
@param scrollPosition the position to scroll to, from 0 to 1 where 1 is all the way. Example is: 0.60
@param stepCount how many move steps to include in the scroll. Less steps results in a faster... | [
"Scrolls",
"a",
"View",
"horizontally",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Solo.java#L2356-L2367 |
facebookarchive/hadoop-20 | src/contrib/raid/src/java/org/apache/hadoop/raid/ChecksumStore.java | ChecksumStore.putIfAbsentChecksum | public Long putIfAbsentChecksum(Block blk, Long newChecksum)
throws IOException {
Long oldChecksum = putIfAbsent(blk, newChecksum);
if (oldChecksum!= null && !oldChecksum.equals(newChecksum)) {
throw new IOException("Block " + blk.toString()
+ " has different checksums " + oldChecksum + "(ol... | java | public Long putIfAbsentChecksum(Block blk, Long newChecksum)
throws IOException {
Long oldChecksum = putIfAbsent(blk, newChecksum);
if (oldChecksum!= null && !oldChecksum.equals(newChecksum)) {
throw new IOException("Block " + blk.toString()
+ " has different checksums " + oldChecksum + "(ol... | [
"public",
"Long",
"putIfAbsentChecksum",
"(",
"Block",
"blk",
",",
"Long",
"newChecksum",
")",
"throws",
"IOException",
"{",
"Long",
"oldChecksum",
"=",
"putIfAbsent",
"(",
"blk",
",",
"newChecksum",
")",
";",
"if",
"(",
"oldChecksum",
"!=",
"null",
"&&",
"!... | Save the checksum for a raided block into store and compare the old value
with new value, if different throw an exception
@param blk
@param newChecksum
@param oldChecksum
@throws IOException | [
"Save",
"the",
"checksum",
"for",
"a",
"raided",
"block",
"into",
"store",
"and",
"compare",
"the",
"old",
"value",
"with",
"new",
"value",
"if",
"different",
"throw",
"an",
"exception"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/raid/src/java/org/apache/hadoop/raid/ChecksumStore.java#L47-L56 |
PinaeOS/nala | src/main/java/org/pinae/nala/xb/Xml.java | Xml.toXML | public static String toXML(Object object, String encoding, boolean nodeMode) throws MarshalException {
Properties properties = new Properties();
properties.put("node", Boolean.toString(nodeMode));
properties.put("lowcase", "true");
properties.put("pretty", "true");
properties.put("cdata", "true");
properti... | java | public static String toXML(Object object, String encoding, boolean nodeMode) throws MarshalException {
Properties properties = new Properties();
properties.put("node", Boolean.toString(nodeMode));
properties.put("lowcase", "true");
properties.put("pretty", "true");
properties.put("cdata", "true");
properti... | [
"public",
"static",
"String",
"toXML",
"(",
"Object",
"object",
",",
"String",
"encoding",
",",
"boolean",
"nodeMode",
")",
"throws",
"MarshalException",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"properties",
".",
"put",
"(",
... | 将对象生成XML文本
@param object 需要生成XML的对象
@param encoding XML文本编码, 例如UTF-8, GBK
@param nodeMode 是否采用节点模式, 如果采用节点模式将不生成XML属性
@return XML文本
@throws MarshalException 编组异常 | [
"将对象生成XML文本"
] | train | https://github.com/PinaeOS/nala/blob/2047ade4af197cec938278d300d111ea94af6fbf/src/main/java/org/pinae/nala/xb/Xml.java#L88-L102 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/dsl/functions/NumberFunctions.java | NumberFunctions.atan | public static Expression atan(String expression1, String expression2) {
return atan(x(expression1), x(expression2));
} | java | public static Expression atan(String expression1, String expression2) {
return atan(x(expression1), x(expression2));
} | [
"public",
"static",
"Expression",
"atan",
"(",
"String",
"expression1",
",",
"String",
"expression2",
")",
"{",
"return",
"atan",
"(",
"x",
"(",
"expression1",
")",
",",
"x",
"(",
"expression2",
")",
")",
";",
"}"
] | Returned expression results in the arctangent of expression2/expression1. | [
"Returned",
"expression",
"results",
"in",
"the",
"arctangent",
"of",
"expression2",
"/",
"expression1",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/dsl/functions/NumberFunctions.java#L104-L106 |
briandilley/jsonrpc4j | src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java | JsonRpcClient.internalCreateRequest | private ObjectNode internalCreateRequest(String methodName, Object arguments, String id) {
final ObjectNode request = mapper.createObjectNode();
addId(id, request);
addProtocolAndMethod(methodName, request);
addParameters(arguments, request);
addAdditionalHeaders(request);
notifyBeforeRequestListener(reques... | java | private ObjectNode internalCreateRequest(String methodName, Object arguments, String id) {
final ObjectNode request = mapper.createObjectNode();
addId(id, request);
addProtocolAndMethod(methodName, request);
addParameters(arguments, request);
addAdditionalHeaders(request);
notifyBeforeRequestListener(reques... | [
"private",
"ObjectNode",
"internalCreateRequest",
"(",
"String",
"methodName",
",",
"Object",
"arguments",
",",
"String",
"id",
")",
"{",
"final",
"ObjectNode",
"request",
"=",
"mapper",
".",
"createObjectNode",
"(",
")",
";",
"addId",
"(",
"id",
",",
"request... | Creates RPC request.
@param methodName the method name
@param arguments the arguments
@param id the optional id
@return Jackson request object | [
"Creates",
"RPC",
"request",
"."
] | train | https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcClient.java#L339-L347 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java | SimpleDocTreeVisitor.visitEndElement | @Override
public R visitEndElement(EndElementTree node, P p) {
return defaultAction(node, p);
} | java | @Override
public R visitEndElement(EndElementTree node, P p) {
return defaultAction(node, p);
} | [
"@",
"Override",
"public",
"R",
"visitEndElement",
"(",
"EndElementTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"defaultAction",
"(",
"node",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation calls {@code defaultAction}.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of {@code defaultAction} | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"calls",
"{",
"@code",
"defaultAction",
"}",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/SimpleDocTreeVisitor.java#L177-L180 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/wrapper/json/PJsonObject.java | PJsonObject.optJSONObject | public final PJsonObject optJSONObject(final String key) {
final JSONObject val = this.obj.optJSONObject(key);
return val != null ? new PJsonObject(this, val, key) : null;
} | java | public final PJsonObject optJSONObject(final String key) {
final JSONObject val = this.obj.optJSONObject(key);
return val != null ? new PJsonObject(this, val, key) : null;
} | [
"public",
"final",
"PJsonObject",
"optJSONObject",
"(",
"final",
"String",
"key",
")",
"{",
"final",
"JSONObject",
"val",
"=",
"this",
".",
"obj",
".",
"optJSONObject",
"(",
"key",
")",
";",
"return",
"val",
"!=",
"null",
"?",
"new",
"PJsonObject",
"(",
... | Get a property as a json object or null.
@param key the property name | [
"Get",
"a",
"property",
"as",
"a",
"json",
"object",
"or",
"null",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/wrapper/json/PJsonObject.java#L145-L148 |
EdwardRaff/JSAT | JSAT/src/jsat/math/decayrates/ExponetialDecay.java | ExponetialDecay.setMaxTime | public void setMaxTime(double maxTime)
{
if(maxTime <= 0 || Double.isInfinite(maxTime) || Double.isNaN(maxTime))
throw new RuntimeException("maxTime should be positive, not " + maxTime);
this.maxTime = maxTime;
} | java | public void setMaxTime(double maxTime)
{
if(maxTime <= 0 || Double.isInfinite(maxTime) || Double.isNaN(maxTime))
throw new RuntimeException("maxTime should be positive, not " + maxTime);
this.maxTime = maxTime;
} | [
"public",
"void",
"setMaxTime",
"(",
"double",
"maxTime",
")",
"{",
"if",
"(",
"maxTime",
"<=",
"0",
"||",
"Double",
".",
"isInfinite",
"(",
"maxTime",
")",
"||",
"Double",
".",
"isNaN",
"(",
"maxTime",
")",
")",
"throw",
"new",
"RuntimeException",
"(",
... | Sets the maximum amount of time to allow in the rate decay. Any time
value larger will be treated as the set maximum.<br>
<br>
Any calls to {@link #rate(double, double, double) } will use the value
provided in that method call instead.
@param maxTime the maximum amount of time to allow | [
"Sets",
"the",
"maximum",
"amount",
"of",
"time",
"to",
"allow",
"in",
"the",
"rate",
"decay",
".",
"Any",
"time",
"value",
"larger",
"will",
"be",
"treated",
"as",
"the",
"set",
"maximum",
".",
"<br",
">",
"<br",
">",
"Any",
"calls",
"to",
"{"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/math/decayrates/ExponetialDecay.java#L89-L94 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/DateTimeField.java | DateTimeField.setDateTime | public int setDateTime(java.util.Date date, boolean bDisplayOption, int iMoveMode)
{
if (date != null)
return this.setValue(date.getTime(), bDisplayOption, iMoveMode);
else
return this.setData(null, bDisplayOption, iMoveMode);
} | java | public int setDateTime(java.util.Date date, boolean bDisplayOption, int iMoveMode)
{
if (date != null)
return this.setValue(date.getTime(), bDisplayOption, iMoveMode);
else
return this.setData(null, bDisplayOption, iMoveMode);
} | [
"public",
"int",
"setDateTime",
"(",
"java",
".",
"util",
".",
"Date",
"date",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"date",
"!=",
"null",
")",
"return",
"this",
".",
"setValue",
"(",
"date",
".",
"getTime",
"(... | Change the date and time of day.
@param date The date to set.
@param bDisplayOption Display changed fields if true.
@param iMoveMode The move mode.
@return The error code (or NORMAL_RETURN). | [
"Change",
"the",
"date",
"and",
"time",
"of",
"day",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/DateTimeField.java#L285-L291 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.sameHqDeleteBySign | public JSONObject sameHqDeleteBySign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
request.s... | java | public JSONObject sameHqDeleteBySign(String contSign, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("cont_sign", contSign);
if (options != null) {
request.addBody(options);
}
request.s... | [
"public",
"JSONObject",
"sameHqDeleteBySign",
"(",
"String",
"contSign",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"requ... | 相同图检索—删除接口
**删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign**
@param contSign - 图片签名
@param options - 可选参数对象,key: value都为string类型
options - options列表:
@return JSONObject | [
"相同图检索—删除接口",
"**",
"删除图库中的图片,支持批量删除,批量删除时请传cont_sign参数,勿传image,最多支持1000个cont_sign",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L345-L356 |
apache/groovy | src/main/java/org/codehaus/groovy/vmplugin/v7/TypeHelper.java | TypeHelper.replaceWithMoreSpecificType | protected static MethodType replaceWithMoreSpecificType(Object[] args, MethodType callSiteType) {
for (int i=0; i<args.length; i++) {
// if argument null, take the static type
if (args[i]==null) continue;
if (callSiteType.parameterType(i).isPrimitive()) continue;
... | java | protected static MethodType replaceWithMoreSpecificType(Object[] args, MethodType callSiteType) {
for (int i=0; i<args.length; i++) {
// if argument null, take the static type
if (args[i]==null) continue;
if (callSiteType.parameterType(i).isPrimitive()) continue;
... | [
"protected",
"static",
"MethodType",
"replaceWithMoreSpecificType",
"(",
"Object",
"[",
"]",
"args",
",",
"MethodType",
"callSiteType",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"args",
".",
"length",
";",
"i",
"++",
")",
"{",
"// if arg... | Replaces the types in the callSiteType parameter if more specific types
given through the arguments. This is in general the case, unless
the argument is null. | [
"Replaces",
"the",
"types",
"in",
"the",
"callSiteType",
"parameter",
"if",
"more",
"specific",
"types",
"given",
"through",
"the",
"arguments",
".",
"This",
"is",
"in",
"general",
"the",
"case",
"unless",
"the",
"argument",
"is",
"null",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/vmplugin/v7/TypeHelper.java#L77-L86 |
joestelmach/natty | src/main/java/com/joestelmach/natty/WalkerState.java | WalkerState.seekToDayOfWeek | public void seekToDayOfWeek(String direction, String seekType, String seekAmount, String dayOfWeek) {
int dayOfWeekInt = Integer.parseInt(dayOfWeek);
int seekAmountInt = Integer.parseInt(seekAmount);
assert(direction.equals(DIR_LEFT) || direction.equals(DIR_RIGHT));
assert(seekType.equals(SEEK_BY_DAY) |... | java | public void seekToDayOfWeek(String direction, String seekType, String seekAmount, String dayOfWeek) {
int dayOfWeekInt = Integer.parseInt(dayOfWeek);
int seekAmountInt = Integer.parseInt(seekAmount);
assert(direction.equals(DIR_LEFT) || direction.equals(DIR_RIGHT));
assert(seekType.equals(SEEK_BY_DAY) |... | [
"public",
"void",
"seekToDayOfWeek",
"(",
"String",
"direction",
",",
"String",
"seekType",
",",
"String",
"seekAmount",
",",
"String",
"dayOfWeek",
")",
"{",
"int",
"dayOfWeekInt",
"=",
"Integer",
".",
"parseInt",
"(",
"dayOfWeek",
")",
";",
"int",
"seekAmoun... | seeks to a specified day of the week in the past or future.
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekType the type of seek to perform (by_day or by_week)
by_day means we seek to the very next occurrence of the given day
by_week means we seek to the first occu... | [
"seeks",
"to",
"a",
"specified",
"day",
"of",
"the",
"week",
"in",
"the",
"past",
"or",
"future",
"."
] | train | https://github.com/joestelmach/natty/blob/74389feb4c9372e51cd51eb0800a0177fec3e5a0/src/main/java/com/joestelmach/natty/WalkerState.java#L80-L108 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java | UserAttrs.setDoubleAttribute | public static final void setDoubleAttribute(Path path, String attribute, double value, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
Files.setAttribute(path, attribute, Primitives.writeDouble(value), options);
} | java | public static final void setDoubleAttribute(Path path, String attribute, double value, LinkOption... options) throws IOException
{
attribute = attribute.startsWith("user:") ? attribute : "user:"+attribute;
Files.setAttribute(path, attribute, Primitives.writeDouble(value), options);
} | [
"public",
"static",
"final",
"void",
"setDoubleAttribute",
"(",
"Path",
"path",
",",
"String",
"attribute",
",",
"double",
"value",
",",
"LinkOption",
"...",
"options",
")",
"throws",
"IOException",
"{",
"attribute",
"=",
"attribute",
".",
"startsWith",
"(",
"... | Set user-defined-attribute
@param path
@param attribute user:attribute name. user: can be omitted.
@param value
@param options
@throws IOException | [
"Set",
"user",
"-",
"defined",
"-",
"attribute"
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/file/attribute/UserAttrs.java#L92-L96 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/CriteriaReader.java | CriteriaReader.addCriteria | private void addCriteria(List<GenericCriteria> list, byte[] block)
{
byte[] leftBlock = getChildBlock(block);
byte[] rightBlock1 = getListNextBlock(leftBlock);
byte[] rightBlock2 = getListNextBlock(rightBlock1);
TestOperator operator = TestOperator.getInstance(MPPUtility.getShort(block, 0) - ... | java | private void addCriteria(List<GenericCriteria> list, byte[] block)
{
byte[] leftBlock = getChildBlock(block);
byte[] rightBlock1 = getListNextBlock(leftBlock);
byte[] rightBlock2 = getListNextBlock(rightBlock1);
TestOperator operator = TestOperator.getInstance(MPPUtility.getShort(block, 0) - ... | [
"private",
"void",
"addCriteria",
"(",
"List",
"<",
"GenericCriteria",
">",
"list",
",",
"byte",
"[",
"]",
"block",
")",
"{",
"byte",
"[",
"]",
"leftBlock",
"=",
"getChildBlock",
"(",
"block",
")",
";",
"byte",
"[",
"]",
"rightBlock1",
"=",
"getListNextB... | Adds a basic LHS OPERATOR RHS block.
@param list parent criteria list
@param block current block | [
"Adds",
"a",
"basic",
"LHS",
"OPERATOR",
"RHS",
"block",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/CriteriaReader.java#L251-L280 |
KyoriPowered/text | api/src/main/java/net/kyori/text/event/HoverEvent.java | HoverEvent.showEntity | public static @NonNull HoverEvent showEntity(final @NonNull Component entity) {
return new HoverEvent(Action.SHOW_ENTITY, entity);
} | java | public static @NonNull HoverEvent showEntity(final @NonNull Component entity) {
return new HoverEvent(Action.SHOW_ENTITY, entity);
} | [
"public",
"static",
"@",
"NonNull",
"HoverEvent",
"showEntity",
"(",
"final",
"@",
"NonNull",
"Component",
"entity",
")",
"{",
"return",
"new",
"HoverEvent",
"(",
"Action",
".",
"SHOW_ENTITY",
",",
"entity",
")",
";",
"}"
] | Creates a hover event that shows an entity on hover.
@param entity the entity to show on hover
@return a hover event | [
"Creates",
"a",
"hover",
"event",
"that",
"shows",
"an",
"entity",
"on",
"hover",
"."
] | train | https://github.com/KyoriPowered/text/blob/4496c593bf89e8fb036dd6efe26f8ac60f7655c9/api/src/main/java/net/kyori/text/event/HoverEvent.java#L76-L78 |
wildfly/wildfly-core | host-controller/src/main/java/org/jboss/as/domain/controller/operations/ReadMasterDomainModelUtil.java | ReadMasterDomainModelUtil.processServerConfig | static void processServerConfig(final Resource root, final RequiredConfigurationHolder requiredConfigurationHolder, final IgnoredNonAffectedServerGroupsUtil.ServerConfigInfo serverConfig, final ExtensionRegistry extensionRegistry) {
final Set<String> serverGroups = requiredConfigurationHolder.serverGroups;
... | java | static void processServerConfig(final Resource root, final RequiredConfigurationHolder requiredConfigurationHolder, final IgnoredNonAffectedServerGroupsUtil.ServerConfigInfo serverConfig, final ExtensionRegistry extensionRegistry) {
final Set<String> serverGroups = requiredConfigurationHolder.serverGroups;
... | [
"static",
"void",
"processServerConfig",
"(",
"final",
"Resource",
"root",
",",
"final",
"RequiredConfigurationHolder",
"requiredConfigurationHolder",
",",
"final",
"IgnoredNonAffectedServerGroupsUtil",
".",
"ServerConfigInfo",
"serverConfig",
",",
"final",
"ExtensionRegistry",... | Determine the relevant pieces of configuration which need to be included when processing the domain model.
@param root the resource root
@param requiredConfigurationHolder the resolution context
@param serverConfig the server config
@param extensionRegistry the extension registry | [
"Determine",
"the",
"relevant",
"pieces",
"of",
"configuration",
"which",
"need",
"to",
"be",
"included",
"when",
"processing",
"the",
"domain",
"model",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/domain/controller/operations/ReadMasterDomainModelUtil.java#L240-L268 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java | SortedBugCollection.readXML | public void readXML(File file) throws IOException, DocumentException {
project.setCurrentWorkingDirectory(file.getParentFile());
dataSource = file.getAbsolutePath();
InputStream in = progessMonitoredInputStream(file, "Loading analysis");
try {
readXML(in, file);
} cat... | java | public void readXML(File file) throws IOException, DocumentException {
project.setCurrentWorkingDirectory(file.getParentFile());
dataSource = file.getAbsolutePath();
InputStream in = progessMonitoredInputStream(file, "Loading analysis");
try {
readXML(in, file);
} cat... | [
"public",
"void",
"readXML",
"(",
"File",
"file",
")",
"throws",
"IOException",
",",
"DocumentException",
"{",
"project",
".",
"setCurrentWorkingDirectory",
"(",
"file",
".",
"getParentFile",
"(",
")",
")",
";",
"dataSource",
"=",
"file",
".",
"getAbsolutePath",... | Read XML data from given file into this object, populating given Project
as a side effect.
@param file
the file | [
"Read",
"XML",
"data",
"from",
"given",
"file",
"into",
"this",
"object",
"populating",
"given",
"Project",
"as",
"a",
"side",
"effect",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SortedBugCollection.java#L267-L278 |
jenetics/jenetics | jenetics.ext/src/main/java/io/jenetics/ext/internal/random.java | random.nextLong | public static long nextLong(final long n, final Random random) {
if (n <= 0) {
throw new IllegalArgumentException(format(
"n is smaller than one: %d", n
));
}
long bits;
long result;
do {
bits = random.nextLong() & 0x7fffffffffffffffL;
result = bits%n;
} while (bits - result + (n - 1) < 0);... | java | public static long nextLong(final long n, final Random random) {
if (n <= 0) {
throw new IllegalArgumentException(format(
"n is smaller than one: %d", n
));
}
long bits;
long result;
do {
bits = random.nextLong() & 0x7fffffffffffffffL;
result = bits%n;
} while (bits - result + (n - 1) < 0);... | [
"public",
"static",
"long",
"nextLong",
"(",
"final",
"long",
"n",
",",
"final",
"Random",
"random",
")",
"{",
"if",
"(",
"n",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"format",
"(",
"\"n is smaller than one: %d\"",
",",
"n",
"... | Returns a pseudo-random, uniformly distributed int value between 0
(inclusive) and the specified value (exclusive), drawn from the given
random number generator's sequence.
@param n the bound on the random number to be returned. Must be
positive.
@param random the random engine used for creating the random number.
@re... | [
"Returns",
"a",
"pseudo",
"-",
"random",
"uniformly",
"distributed",
"int",
"value",
"between",
"0",
"(",
"inclusive",
")",
"and",
"the",
"specified",
"value",
"(",
"exclusive",
")",
"drawn",
"from",
"the",
"given",
"random",
"number",
"generator",
"s",
"seq... | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics.ext/src/main/java/io/jenetics/ext/internal/random.java#L50-L65 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java | ComputeNodeOperations.disableComputeNodeScheduling | public void disableComputeNodeScheduling(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption) throws BatchErrorException, IOException {
disableComputeNodeScheduling(poolId, nodeId, nodeDisableSchedulingOption, null);
} | java | public void disableComputeNodeScheduling(String poolId, String nodeId, DisableComputeNodeSchedulingOption nodeDisableSchedulingOption) throws BatchErrorException, IOException {
disableComputeNodeScheduling(poolId, nodeId, nodeDisableSchedulingOption, null);
} | [
"public",
"void",
"disableComputeNodeScheduling",
"(",
"String",
"poolId",
",",
"String",
"nodeId",
",",
"DisableComputeNodeSchedulingOption",
"nodeDisableSchedulingOption",
")",
"throws",
"BatchErrorException",
",",
"IOException",
"{",
"disableComputeNodeScheduling",
"(",
"p... | Disables task scheduling on the specified compute node.
@param poolId The ID of the pool.
@param nodeId The ID of the compute node.
@param nodeDisableSchedulingOption Specifies what to do with currently running tasks.
@throws BatchErrorException Exception thrown when an error response is received from the Batch servic... | [
"Disables",
"task",
"scheduling",
"on",
"the",
"specified",
"compute",
"node",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/ComputeNodeOperations.java#L381-L383 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadViewS.java | CreateSyntheticOverheadViewS.process | public void process(T input, T output) {
this.output = FactoryGImageGray.wrap(output,this.output);
interp.setImage(input);
int indexMap = 0;
for( int i = 0; i < output.height; i++ ) {
int indexOut = output.startIndex + i*output.stride;
for( int j = 0; j < output.width; j++ , indexOut++,indexMap++ ) {
... | java | public void process(T input, T output) {
this.output = FactoryGImageGray.wrap(output,this.output);
interp.setImage(input);
int indexMap = 0;
for( int i = 0; i < output.height; i++ ) {
int indexOut = output.startIndex + i*output.stride;
for( int j = 0; j < output.width; j++ , indexOut++,indexMap++ ) {
... | [
"public",
"void",
"process",
"(",
"T",
"input",
",",
"T",
"output",
")",
"{",
"this",
".",
"output",
"=",
"FactoryGImageGray",
".",
"wrap",
"(",
"output",
",",
"this",
".",
"output",
")",
";",
"interp",
".",
"setImage",
"(",
"input",
")",
";",
"int",... | Computes overhead view of input image. All pixels in input image are assumed to be on the ground plane.
@param input (Input) Camera image.
@param output (Output) Image containing overhead view. | [
"Computes",
"overhead",
"view",
"of",
"input",
"image",
".",
"All",
"pixels",
"in",
"input",
"image",
"are",
"assumed",
"to",
"be",
"on",
"the",
"ground",
"plane",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/sfm/overhead/CreateSyntheticOverheadViewS.java#L54-L69 |
carrotsearch/hppc | hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayList.java | KTypeArrayList.forEach | public <T extends KTypeProcedure<? super KType>> T forEach(T procedure, int fromIndex, final int toIndex) {
assert (fromIndex >= 0 && fromIndex <= size()) :
"Index " + fromIndex + " out of bounds [" + 0 + ", " + size() + ").";
assert (toIndex >= 0 && toIndex <= size()) :
"Index " + toIndex + " ... | java | public <T extends KTypeProcedure<? super KType>> T forEach(T procedure, int fromIndex, final int toIndex) {
assert (fromIndex >= 0 && fromIndex <= size()) :
"Index " + fromIndex + " out of bounds [" + 0 + ", " + size() + ").";
assert (toIndex >= 0 && toIndex <= size()) :
"Index " + toIndex + " ... | [
"public",
"<",
"T",
"extends",
"KTypeProcedure",
"<",
"?",
"super",
"KType",
">",
">",
"T",
"forEach",
"(",
"T",
"procedure",
",",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"assert",
"(",
"fromIndex",
">=",
"0",
"&&",
"fromIndex",
"... | Applies <code>procedure</code> to a slice of the list,
<code>fromIndex</code>, inclusive, to <code>toIndex</code>, exclusive. | [
"Applies",
"<code",
">",
"procedure<",
"/",
"code",
">",
"to",
"a",
"slice",
"of",
"the",
"list",
"<code",
">",
"fromIndex<",
"/",
"code",
">",
"inclusive",
"to",
"<code",
">",
"toIndex<",
"/",
"code",
">",
"exclusive",
"."
] | train | https://github.com/carrotsearch/hppc/blob/e359e9da358e846fcbffc64a765611df954ba3f6/hppc/src/main/templates/com/carrotsearch/hppc/KTypeArrayList.java#L552-L568 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java | CudaDataBufferFactory.createHalf | @Override
public DataBuffer createHalf(long offset, byte[] data, boolean copy) {
return new CudaHalfDataBuffer(ArrayUtil.toFloatArray(data), copy, offset);
} | java | @Override
public DataBuffer createHalf(long offset, byte[] data, boolean copy) {
return new CudaHalfDataBuffer(ArrayUtil.toFloatArray(data), copy, offset);
} | [
"@",
"Override",
"public",
"DataBuffer",
"createHalf",
"(",
"long",
"offset",
",",
"byte",
"[",
"]",
"data",
",",
"boolean",
"copy",
")",
"{",
"return",
"new",
"CudaHalfDataBuffer",
"(",
"ArrayUtil",
".",
"toFloatArray",
"(",
"data",
")",
",",
"copy",
",",... | Creates a half-precision data buffer
@param offset
@param data the data to create the buffer from
@param copy
@return the new buffer | [
"Creates",
"a",
"half",
"-",
"precision",
"data",
"buffer"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/buffer/factory/CudaDataBufferFactory.java#L717-L720 |
UrielCh/ovh-java-sdk | ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java | ApiOvhEmailpro.service_serviceInfos_PUT | public void service_serviceInfos_PUT(String service, net.minidev.ovh.api.services.OvhService body) throws IOException {
String qPath = "/email/pro/{service}/serviceInfos";
StringBuilder sb = path(qPath, service);
exec(qPath, "PUT", sb.toString(), body);
} | java | public void service_serviceInfos_PUT(String service, net.minidev.ovh.api.services.OvhService body) throws IOException {
String qPath = "/email/pro/{service}/serviceInfos";
StringBuilder sb = path(qPath, service);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"service_serviceInfos_PUT",
"(",
"String",
"service",
",",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"services",
".",
"OvhService",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/email/pro/{service}/serviceInfos\... | Alter this object properties
REST: PUT /email/pro/{service}/serviceInfos
@param body [required] New object properties
@param service [required] The internal name of your pro organization
API beta | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-emailpro/src/main/java/net/minidev/ovh/api/ApiOvhEmailpro.java#L267-L271 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Operation.java | Operation.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
m_left.fixupVariables(vars, globalsSize);
m_right.fixupVariables(vars, globalsSize);
} | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
m_left.fixupVariables(vars, globalsSize);
m_right.fixupVariables(vars, globalsSize);
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"m_left",
".",
"fixupVariables",
"(",
"vars",
",",
"globalsSize",
")",
";",
"m_right",
".",
"fixupVariables",
"(",
"vars",
",",
"globa... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/operations/Operation.java#L54-L58 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getCharacterInformation | public void getCharacterInformation(String API, String name, Callback<CharacterCore> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterCore(name, API).enqueue(callback);
} | java | public void getCharacterInformation(String API, String name, Callback<CharacterCore> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ParamType.API, API), new ParamChecker(ParamType.CHAR, name));
gw2API.getCharacterCore(name, API).enqueue(callback);
} | [
"public",
"void",
"getCharacterInformation",
"(",
"String",
"API",
",",
"String",
"name",
",",
"Callback",
"<",
"CharacterCore",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",... | For more info on Character Core API go <a href="https://wiki.guildwars2.com/wiki/API:2/characters#Core">here</a><br/>
Get basic character information for the given character name that is linked to given API key
@param API API key
@param name name of character
@param callback callback that is going to be used ... | [
"For",
"more",
"info",
"on",
"Character",
"Core",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"characters#Core",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
">",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L721-L724 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/Node.java | Node.copy | public void copy(Node dest) throws NodeNotFoundException, CopyException {
try {
if (isDirectory()) {
dest.mkdirOpt();
copyDirectory(dest);
} else {
copyFile(dest);
}
} catch (FileNotFoundException | CopyException e) {
... | java | public void copy(Node dest) throws NodeNotFoundException, CopyException {
try {
if (isDirectory()) {
dest.mkdirOpt();
copyDirectory(dest);
} else {
copyFile(dest);
}
} catch (FileNotFoundException | CopyException e) {
... | [
"public",
"void",
"copy",
"(",
"Node",
"dest",
")",
"throws",
"NodeNotFoundException",
",",
"CopyException",
"{",
"try",
"{",
"if",
"(",
"isDirectory",
"(",
")",
")",
"{",
"dest",
".",
"mkdirOpt",
"(",
")",
";",
"copyDirectory",
"(",
"dest",
")",
";",
... | Copies this to dest. Overwrites existing file and adds to existing directories.
@throws NodeNotFoundException if this does not exist | [
"Copies",
"this",
"to",
"dest",
".",
"Overwrites",
"existing",
"file",
"and",
"adds",
"to",
"existing",
"directories",
"."
] | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/Node.java#L729-L742 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/ErrorCodes.java | ErrorCodes.getExceptionType | public Class<? extends WebDriverException> getExceptionType(int statusCode) {
if (SUCCESS == statusCode) {
return null;
}
// We know that the tuple of (status code, exception) is distinct.
Set<Class<? extends WebDriverException>> allPossibleExceptions = KNOWN_ERRORS.stream()
.filter(knownEr... | java | public Class<? extends WebDriverException> getExceptionType(int statusCode) {
if (SUCCESS == statusCode) {
return null;
}
// We know that the tuple of (status code, exception) is distinct.
Set<Class<? extends WebDriverException>> allPossibleExceptions = KNOWN_ERRORS.stream()
.filter(knownEr... | [
"public",
"Class",
"<",
"?",
"extends",
"WebDriverException",
">",
"getExceptionType",
"(",
"int",
"statusCode",
")",
"{",
"if",
"(",
"SUCCESS",
"==",
"statusCode",
")",
"{",
"return",
"null",
";",
"}",
"// We know that the tuple of (status code, exception) is distinc... | Returns the exception type that corresponds to the given {@code statusCode}. All unrecognized
status codes will be mapped to {@link WebDriverException WebDriverException.class}.
@param statusCode The status code to convert.
@return The exception type that corresponds to the provided status code or {@code null} if
{@co... | [
"Returns",
"the",
"exception",
"type",
"that",
"corresponds",
"to",
"the",
"given",
"{",
"@code",
"statusCode",
"}",
".",
"All",
"unrecognized",
"status",
"codes",
"will",
"be",
"mapped",
"to",
"{",
"@link",
"WebDriverException",
"WebDriverException",
".",
"clas... | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/ErrorCodes.java#L172-L184 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/CustomUserRegistryFactory.java | CustomUserRegistryFactory.unsetCustomUserRegistry | protected synchronized void unsetCustomUserRegistry(Map<String, Object> props) {
String id = getId(props);
customUserRegistries.remove(id);
ServiceRegistration<UserRegistry> registration = registrynRegistrationsToUnregister.remove(id);
if (registration != null) {
registration... | java | protected synchronized void unsetCustomUserRegistry(Map<String, Object> props) {
String id = getId(props);
customUserRegistries.remove(id);
ServiceRegistration<UserRegistry> registration = registrynRegistrationsToUnregister.remove(id);
if (registration != null) {
registration... | [
"protected",
"synchronized",
"void",
"unsetCustomUserRegistry",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"props",
")",
"{",
"String",
"id",
"=",
"getId",
"(",
"props",
")",
";",
"customUserRegistries",
".",
"remove",
"(",
"id",
")",
";",
"ServiceRegist... | Method will be called for each com.ibm.websphere.security.UserRegistry that is
unregistered in the OSGi service registry. We must remove this instance
from our internal set of listeners.
@param ref Reference to an unregistered com.ibm.websphere.security.UserRegistry | [
"Method",
"will",
"be",
"called",
"for",
"each",
"com",
".",
"ibm",
".",
"websphere",
".",
"security",
".",
"UserRegistry",
"that",
"is",
"unregistered",
"in",
"the",
"OSGi",
"service",
"registry",
".",
"We",
"must",
"remove",
"this",
"instance",
"from",
"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.registry/src/com/ibm/ws/security/registry/internal/CustomUserRegistryFactory.java#L79-L86 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java | RegisterUtils.getLocalVariableEndRange | public static int getLocalVariableEndRange(LocalVariableTable lvt, int reg, int curPC) {
int endRange = Integer.MAX_VALUE;
if (lvt != null) {
LocalVariable lv = lvt.getLocalVariable(reg, curPC);
if (lv != null) {
endRange = lv.getStartPC() + lv.getLength();
... | java | public static int getLocalVariableEndRange(LocalVariableTable lvt, int reg, int curPC) {
int endRange = Integer.MAX_VALUE;
if (lvt != null) {
LocalVariable lv = lvt.getLocalVariable(reg, curPC);
if (lv != null) {
endRange = lv.getStartPC() + lv.getLength();
... | [
"public",
"static",
"int",
"getLocalVariableEndRange",
"(",
"LocalVariableTable",
"lvt",
",",
"int",
"reg",
",",
"int",
"curPC",
")",
"{",
"int",
"endRange",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"if",
"(",
"lvt",
"!=",
"null",
")",
"{",
"LocalVariable",
... | returns the end pc of the visible range of this register at this pc
@param lvt
the local variable table for this method
@param reg
the register to examine
@param curPC
the pc of the current instruction
@return the endpc | [
"returns",
"the",
"end",
"pc",
"of",
"the",
"visible",
"range",
"of",
"this",
"register",
"at",
"this",
"pc"
] | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/utils/RegisterUtils.java#L144-L153 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/MathUtils.java | MathUtils.lerp | static double lerp(double start_, double end_, double t) {
// When end == start, we want result to be equal to start, for all t
// values. At the same time, when end != start, we want the result to be
// equal to start for t==0 and end for t == 1.0
// The regular formula end_ * t + (1.0 - t) * start_, when end_... | java | static double lerp(double start_, double end_, double t) {
// When end == start, we want result to be equal to start, for all t
// values. At the same time, when end != start, we want the result to be
// equal to start for t==0 and end for t == 1.0
// The regular formula end_ * t + (1.0 - t) * start_, when end_... | [
"static",
"double",
"lerp",
"(",
"double",
"start_",
",",
"double",
"end_",
",",
"double",
"t",
")",
"{",
"// When end == start, we want result to be equal to start, for all t",
"// values. At the same time, when end != start, we want the result to be",
"// equal to start for t==0 an... | Computes interpolation between two values, using the interpolation factor t.
The interpolation formula is (end - start) * t + start.
However, the computation ensures that t = 0 produces exactly start, and t = 1, produces exactly end.
It also guarantees that for 0 <= t <= 1, the interpolated value v is between start and... | [
"Computes",
"interpolation",
"between",
"two",
"values",
"using",
"the",
"interpolation",
"factor",
"t",
".",
"The",
"interpolation",
"formula",
"is",
"(",
"end",
"-",
"start",
")",
"*",
"t",
"+",
"start",
".",
"However",
"the",
"computation",
"ensures",
"th... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MathUtils.java#L174-L188 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java | CodepointHelper.verify | public static void verify (@Nullable final String sStr, @Nonnull final ECodepointProfile eProfile)
{
if (sStr != null)
verify (new CodepointIteratorCharSequence (sStr), eProfile);
} | java | public static void verify (@Nullable final String sStr, @Nonnull final ECodepointProfile eProfile)
{
if (sStr != null)
verify (new CodepointIteratorCharSequence (sStr), eProfile);
} | [
"public",
"static",
"void",
"verify",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nonnull",
"final",
"ECodepointProfile",
"eProfile",
")",
"{",
"if",
"(",
"sStr",
"!=",
"null",
")",
"verify",
"(",
"new",
"CodepointIteratorCharSequence",
"(",
... | Verifies a sequence of codepoints using the specified profile
@param sStr
String
@param eProfile
profile to use | [
"Verifies",
"a",
"sequence",
"of",
"codepoints",
"using",
"the",
"specified",
"profile"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/text/codepoint/CodepointHelper.java#L789-L793 |
groovy/groovy-core | src/main/groovy/lang/Script.java | Script.invokeMethod | public Object invokeMethod(String name, Object args) {
try {
return super.invokeMethod(name, args);
}
// if the method was not found in the current scope (the script's methods)
// let's try to see if there's a method closure with the same name in the binding
catch (Mi... | java | public Object invokeMethod(String name, Object args) {
try {
return super.invokeMethod(name, args);
}
// if the method was not found in the current scope (the script's methods)
// let's try to see if there's a method closure with the same name in the binding
catch (Mi... | [
"public",
"Object",
"invokeMethod",
"(",
"String",
"name",
",",
"Object",
"args",
")",
"{",
"try",
"{",
"return",
"super",
".",
"invokeMethod",
"(",
"name",
",",
"args",
")",
";",
"}",
"// if the method was not found in the current scope (the script's methods)",
"//... | Invoke a method (or closure in the binding) defined.
@param name method to call
@param args arguments to pass to the method
@return value | [
"Invoke",
"a",
"method",
"(",
"or",
"closure",
"in",
"the",
"binding",
")",
"defined",
"."
] | train | https://github.com/groovy/groovy-core/blob/01309f9d4be34ddf93c4a9943b5a97843bff6181/src/main/groovy/lang/Script.java#L79-L101 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java | WebConfigParamUtils.getStringInitParameter | public static String getStringInitParameter(ExternalContext context, String[] names)
{
return getStringInitParameter(context, names, null);
} | java | public static String getStringInitParameter(ExternalContext context, String[] names)
{
return getStringInitParameter(context, names, null);
} | [
"public",
"static",
"String",
"getStringInitParameter",
"(",
"ExternalContext",
"context",
",",
"String",
"[",
"]",
"names",
")",
"{",
"return",
"getStringInitParameter",
"(",
"context",
",",
"names",
",",
"null",
")",
";",
"}"
] | Gets the String init parameter value from the specified context. If the parameter is an
empty String or a String
containing only white space, this method returns <code>null</code>
@param context
the application's external context
@param names
the init parameter's names, the first one is scanned first. Usually used whe... | [
"Gets",
"the",
"String",
"init",
"parameter",
"value",
"from",
"the",
"specified",
"context",
".",
"If",
"the",
"parameter",
"is",
"an",
"empty",
"String",
"or",
"a",
"String",
"containing",
"only",
"white",
"space",
"this",
"method",
"returns",
"<code",
">"... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/util/WebConfigParamUtils.java#L108-L111 |
belaban/JGroups | src/org/jgroups/Message.java | Message.setBuffer | public Message setBuffer(byte[] b, int offset, int length) {
buf=b;
if(buf != null) {
if(offset < 0 || offset > buf.length)
throw new ArrayIndexOutOfBoundsException(offset);
if((offset + length) > buf.length)
throw new ArrayIndexOutOfBoundsExceptio... | java | public Message setBuffer(byte[] b, int offset, int length) {
buf=b;
if(buf != null) {
if(offset < 0 || offset > buf.length)
throw new ArrayIndexOutOfBoundsException(offset);
if((offset + length) > buf.length)
throw new ArrayIndexOutOfBoundsExceptio... | [
"public",
"Message",
"setBuffer",
"(",
"byte",
"[",
"]",
"b",
",",
"int",
"offset",
",",
"int",
"length",
")",
"{",
"buf",
"=",
"b",
";",
"if",
"(",
"buf",
"!=",
"null",
")",
"{",
"if",
"(",
"offset",
"<",
"0",
"||",
"offset",
">",
"buf",
".",
... | Sets the internal buffer to point to a subset of a given buffer.<p/>
<em>
Note that the byte[] buffer passed as argument must not be modified. Reason: if we retransmit the
message, it would still have a ref to the original byte[] buffer passed in as argument, and so we would
retransmit a changed byte[] buffer !
</em>
... | [
"Sets",
"the",
"internal",
"buffer",
"to",
"point",
"to",
"a",
"subset",
"of",
"a",
"given",
"buffer",
".",
"<p",
"/",
">",
"<em",
">",
"Note",
"that",
"the",
"byte",
"[]",
"buffer",
"passed",
"as",
"argument",
"must",
"not",
"be",
"modified",
".",
"... | train | https://github.com/belaban/JGroups/blob/bd3ca786aa57fed41dfbc10a94b1281e388be03b/src/org/jgroups/Message.java#L245-L258 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java | SeaGlassSynthPainterImpl.paintSeparatorForeground | public void paintSeparatorForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
paintForeground(context, g, x, y, w, h, orientation);
} | java | public void paintSeparatorForeground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
paintForeground(context, g, x, y, w, h, orientation);
} | [
"public",
"void",
"paintSeparatorForeground",
"(",
"SynthContext",
"context",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
",",
"int",
"orientation",
")",
"{",
"paintForeground",
"(",
"context",
",",
"g",
",",... | Paints the foreground of a separator.
@param context SynthContext identifying the <code>JComponent</code>
and <code>Region</code> to paint to
@param g <code>Graphics</code> to paint to
@param x X coordinate of the area to paint to
@param y Y coordinate of the area to paint to
@param w... | [
"Paints",
"the",
"foreground",
"of",
"a",
"separator",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L1598-L1600 |
alkacon/opencms-core | src/org/opencms/gwt/CmsVfsService.java | CmsVfsService.getNoPreviewReason | public static String getNoPreviewReason(CmsObject cms, CmsResource resource) {
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
String noPreviewReason = null;
if (resource.getState().isDeleted() && !(resource instanceof I_CmsHistoryResource)) {
noPreviewReason ... | java | public static String getNoPreviewReason(CmsObject cms, CmsResource resource) {
Locale locale = OpenCms.getWorkplaceManager().getWorkplaceLocale(cms);
String noPreviewReason = null;
if (resource.getState().isDeleted() && !(resource instanceof I_CmsHistoryResource)) {
noPreviewReason ... | [
"public",
"static",
"String",
"getNoPreviewReason",
"(",
"CmsObject",
"cms",
",",
"CmsResource",
"resource",
")",
"{",
"Locale",
"locale",
"=",
"OpenCms",
".",
"getWorkplaceManager",
"(",
")",
".",
"getWorkplaceLocale",
"(",
"cms",
")",
";",
"String",
"noPreview... | Returns the no preview reason if there is any.<p>
@param cms the current cms context
@param resource the resource to check
@return the no preview reason if there is any | [
"Returns",
"the",
"no",
"preview",
"reason",
"if",
"there",
"is",
"any",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/gwt/CmsVfsService.java#L234-L255 |
orbisgis/h2gis | postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java | JtsBinaryParser.parseMultiLineString | private MultiLineString parseMultiLineString(ValueGetter data, int srid) {
int count = data.getInt();
LineString[] strings = new LineString[count];
this.parseGeometryArray(data, strings, srid);
return JtsGeometry.geofac.createMultiLineString(strings);
} | java | private MultiLineString parseMultiLineString(ValueGetter data, int srid) {
int count = data.getInt();
LineString[] strings = new LineString[count];
this.parseGeometryArray(data, strings, srid);
return JtsGeometry.geofac.createMultiLineString(strings);
} | [
"private",
"MultiLineString",
"parseMultiLineString",
"(",
"ValueGetter",
"data",
",",
"int",
"srid",
")",
"{",
"int",
"count",
"=",
"data",
".",
"getInt",
"(",
")",
";",
"LineString",
"[",
"]",
"strings",
"=",
"new",
"LineString",
"[",
"count",
"]",
";",
... | Parse the given {@link org.postgis.binary.ValueGetter} into a JTS
{@link org.locationtech.jts.geom.MultiLineString}.
@param data {@link org.postgis.binary.ValueGetter} to parse.
@param srid SRID of the parsed geometries.
@return The parsed {@link org.locationtech.jts.geom.MultiLineString}. | [
"Parse",
"the",
"given",
"{",
"@link",
"org",
".",
"postgis",
".",
"binary",
".",
"ValueGetter",
"}",
"into",
"a",
"JTS",
"{",
"@link",
"org",
".",
"locationtech",
".",
"jts",
".",
"geom",
".",
"MultiLineString",
"}",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/postgis-jts/src/main/java/org/h2gis/postgis_jts/JtsBinaryParser.java#L305-L310 |
nakamura5akihito/six-util | src/main/java/jp/go/aist/six/util/core/web/spring/SpringHttpClientImpl.java | SpringHttpClientImpl.postByRead | public String postByRead(
final String url,
final Reader input,
final String media_type
)
{
String location = _execute( url, HttpMethod.POST,
new ReaderRequestCallback( input, MediaType.parseMediaType( m... | java | public String postByRead(
final String url,
final Reader input,
final String media_type
)
{
String location = _execute( url, HttpMethod.POST,
new ReaderRequestCallback( input, MediaType.parseMediaType( m... | [
"public",
"String",
"postByRead",
"(",
"final",
"String",
"url",
",",
"final",
"Reader",
"input",
",",
"final",
"String",
"media_type",
")",
"{",
"String",
"location",
"=",
"_execute",
"(",
"url",
",",
"HttpMethod",
".",
"POST",
",",
"new",
"ReaderRequestCal... | HTTP POST: Reads the contents from the specified reader and sends them to the URL.
@return
the location, as an URI, where the resource is created.
@throws HttpException
when an exceptional condition occurred during the HTTP method execution. | [
"HTTP",
"POST",
":",
"Reads",
"the",
"contents",
"from",
"the",
"specified",
"reader",
"and",
"sends",
"them",
"to",
"the",
"URL",
"."
] | train | https://github.com/nakamura5akihito/six-util/blob/a6db388a345e220cea2b1fa6324d15c80c6278b6/src/main/java/jp/go/aist/six/util/core/web/spring/SpringHttpClientImpl.java#L404-L415 |
spotify/docker-client | src/main/java/com/spotify/docker/client/DefaultDockerClient.java | DefaultDockerClient.urlEncodeFilters | private String urlEncodeFilters(final Map<String, List<String>> filters) throws DockerException {
try {
final String unencodedFilters = objectMapper().writeValueAsString(filters);
if (!unencodedFilters.isEmpty()) {
return urlEncode(unencodedFilters);
}
} catch (IOException e) {
t... | java | private String urlEncodeFilters(final Map<String, List<String>> filters) throws DockerException {
try {
final String unencodedFilters = objectMapper().writeValueAsString(filters);
if (!unencodedFilters.isEmpty()) {
return urlEncode(unencodedFilters);
}
} catch (IOException e) {
t... | [
"private",
"String",
"urlEncodeFilters",
"(",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"filters",
")",
"throws",
"DockerException",
"{",
"try",
"{",
"final",
"String",
"unencodedFilters",
"=",
"objectMapper",
"(",
")",
".",
"write... | Takes a map of filters and URL-encodes them. If the map is empty or an exception occurs, return
null.
@param filters A map of filters.
@return String
@throws DockerException if there's an IOException | [
"Takes",
"a",
"map",
"of",
"filters",
"and",
"URL",
"-",
"encodes",
"them",
".",
"If",
"the",
"map",
"is",
"empty",
"or",
"an",
"exception",
"occurs",
"return",
"null",
"."
] | train | https://github.com/spotify/docker-client/blob/f297361891f3bb6a2980b08057eede628d681791/src/main/java/com/spotify/docker/client/DefaultDockerClient.java#L698-L708 |
joniles/mpxj | src/main/java/net/sf/mpxj/ResourceAssignment.java | ResourceAssignment.setDuration | public void setDuration(int index, Duration value)
{
set(selectField(AssignmentFieldLists.CUSTOM_DURATION, index), value);
} | java | public void setDuration(int index, Duration value)
{
set(selectField(AssignmentFieldLists.CUSTOM_DURATION, index), value);
} | [
"public",
"void",
"setDuration",
"(",
"int",
"index",
",",
"Duration",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"AssignmentFieldLists",
".",
"CUSTOM_DURATION",
",",
"index",
")",
",",
"value",
")",
";",
"}"
] | Set a duration value.
@param index duration index (1-10)
@param value duration value | [
"Set",
"a",
"duration",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/ResourceAssignment.java#L1628-L1631 |
apereo/cas | core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/PolicyBasedAuthenticationManager.java | PolicyBasedAuthenticationManager.handleAuthenticationException | protected void handleAuthenticationException(final Throwable ex, final String name, final AuthenticationBuilder builder) {
var e = ex;
if (ex instanceof UndeclaredThrowableException) {
e = ((UndeclaredThrowableException) ex).getUndeclaredThrowable();
}
LOGGER.trace(e.getMess... | java | protected void handleAuthenticationException(final Throwable ex, final String name, final AuthenticationBuilder builder) {
var e = ex;
if (ex instanceof UndeclaredThrowableException) {
e = ((UndeclaredThrowableException) ex).getUndeclaredThrowable();
}
LOGGER.trace(e.getMess... | [
"protected",
"void",
"handleAuthenticationException",
"(",
"final",
"Throwable",
"ex",
",",
"final",
"String",
"name",
",",
"final",
"AuthenticationBuilder",
"builder",
")",
"{",
"var",
"e",
"=",
"ex",
";",
"if",
"(",
"ex",
"instanceof",
"UndeclaredThrowableExcept... | Handle authentication exception.
@param ex the exception
@param name the name
@param builder the builder | [
"Handle",
"authentication",
"exception",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-authentication-api/src/main/java/org/apereo/cas/authentication/PolicyBasedAuthenticationManager.java#L406-L425 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/sampling/ReservoirLongsSketch.java | ReservoirLongsSketch.getInstance | static ReservoirLongsSketch getInstance(final long[] data, final long itemsSeen,
final ResizeFactor rf, final int k) {
return new ReservoirLongsSketch(data, itemsSeen, rf, k);
} | java | static ReservoirLongsSketch getInstance(final long[] data, final long itemsSeen,
final ResizeFactor rf, final int k) {
return new ReservoirLongsSketch(data, itemsSeen, rf, k);
} | [
"static",
"ReservoirLongsSketch",
"getInstance",
"(",
"final",
"long",
"[",
"]",
"data",
",",
"final",
"long",
"itemsSeen",
",",
"final",
"ResizeFactor",
"rf",
",",
"final",
"int",
"k",
")",
"{",
"return",
"new",
"ReservoirLongsSketch",
"(",
"data",
",",
"it... | Thin wrapper around private constructor
@param data Reservoir items as long[]
@param itemsSeen Number of items presented to the sketch so far
@param rf <a href="{@docRoot}/resources/dictionary.html#resizeFactor">See Resize Factor</a>
@param k Maximum reservoir size
@return New sketch built with the provided inputs | [
"Thin",
"wrapper",
"around",
"private",
"constructor"
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/sampling/ReservoirLongsSketch.java#L241-L244 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java | XFactory.getExactXField | public static XField getExactXField(@SlashedClassName String className, String name, String signature, boolean isStatic) {
FieldDescriptor fieldDesc = DescriptorFactory.instance().getFieldDescriptor(ClassName.toSlashedClassName(className),
name, signature, isStatic);
return getExactXFiel... | java | public static XField getExactXField(@SlashedClassName String className, String name, String signature, boolean isStatic) {
FieldDescriptor fieldDesc = DescriptorFactory.instance().getFieldDescriptor(ClassName.toSlashedClassName(className),
name, signature, isStatic);
return getExactXFiel... | [
"public",
"static",
"XField",
"getExactXField",
"(",
"@",
"SlashedClassName",
"String",
"className",
",",
"String",
"name",
",",
"String",
"signature",
",",
"boolean",
"isStatic",
")",
"{",
"FieldDescriptor",
"fieldDesc",
"=",
"DescriptorFactory",
".",
"instance",
... | Get an XField object exactly matching given class, name, and signature.
May return an unresolved object (if the class can't be found, or does not
directly declare named field).
@param className
name of class containing the field
@param name
name of field
@param signature
field signature
@param isStatic
field access fl... | [
"Get",
"an",
"XField",
"object",
"exactly",
"matching",
"given",
"class",
"name",
"and",
"signature",
".",
"May",
"return",
"an",
"unresolved",
"object",
"(",
"if",
"the",
"class",
"can",
"t",
"be",
"found",
"or",
"does",
"not",
"directly",
"declare",
"nam... | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/XFactory.java#L534-L538 |
wg/lettuce | src/main/java/com/lambdaworks/redis/RedisConnection.java | RedisConnection.evalsha | @SuppressWarnings("unchecked")
public <T> T evalsha(String digest, ScriptOutputType type, K... keys) {
return (T) await(c.evalsha(digest, type, keys, (V[]) new Object[0]));
} | java | @SuppressWarnings("unchecked")
public <T> T evalsha(String digest, ScriptOutputType type, K... keys) {
return (T) await(c.evalsha(digest, type, keys, (V[]) new Object[0]));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"evalsha",
"(",
"String",
"digest",
",",
"ScriptOutputType",
"type",
",",
"K",
"...",
"keys",
")",
"{",
"return",
"(",
"T",
")",
"await",
"(",
"c",
".",
"evalsha",
"(",
... | Eval a pre-loaded script identified by its SHA-1 digest, which must result
in the requested {@link ScriptOutputType type}.
@param digest Lowercase hex string of script's SHA-1 digest.
@param type Script output type.
@param keys Redis keys to pass to script.
@param <T> Expected return type.
@return... | [
"Eval",
"a",
"pre",
"-",
"loaded",
"script",
"identified",
"by",
"its",
"SHA",
"-",
"1",
"digest",
"which",
"must",
"result",
"in",
"the",
"requested",
"{",
"@link",
"ScriptOutputType",
"type",
"}",
"."
] | train | https://github.com/wg/lettuce/blob/5141640dc8289ff3af07b44a87020cef719c5f4a/src/main/java/com/lambdaworks/redis/RedisConnection.java#L203-L206 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java | AppsImpl.importMethodAsync | public Observable<UUID> importMethodAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) {
return importMethodWithServiceResponseAsync(luisApp, importMethodOptionalParameter).map(new Func1<ServiceResponse<UUID>, UUID>() {
@Override
public UUID call(Serv... | java | public Observable<UUID> importMethodAsync(LuisApp luisApp, ImportMethodAppsOptionalParameter importMethodOptionalParameter) {
return importMethodWithServiceResponseAsync(luisApp, importMethodOptionalParameter).map(new Func1<ServiceResponse<UUID>, UUID>() {
@Override
public UUID call(Serv... | [
"public",
"Observable",
"<",
"UUID",
">",
"importMethodAsync",
"(",
"LuisApp",
"luisApp",
",",
"ImportMethodAppsOptionalParameter",
"importMethodOptionalParameter",
")",
"{",
"return",
"importMethodWithServiceResponseAsync",
"(",
"luisApp",
",",
"importMethodOptionalParameter",... | Imports an application to LUIS, the application's structure should be included in in the request body.
@param luisApp A LUIS application structure.
@param importMethodOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameter... | [
"Imports",
"an",
"application",
"to",
"LUIS",
"the",
"application",
"s",
"structure",
"should",
"be",
"included",
"in",
"in",
"the",
"request",
"body",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/AppsImpl.java#L424-L431 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java | CoinbaseMarketDataServiceRaw.getCoinbaseBuyPrice | public CoinbasePrice getCoinbaseBuyPrice(Currency base, Currency counter) throws IOException {
return coinbase.getBuyPrice(Coinbase.CB_VERSION_VALUE, base + "-" + counter).getData();
} | java | public CoinbasePrice getCoinbaseBuyPrice(Currency base, Currency counter) throws IOException {
return coinbase.getBuyPrice(Coinbase.CB_VERSION_VALUE, base + "-" + counter).getData();
} | [
"public",
"CoinbasePrice",
"getCoinbaseBuyPrice",
"(",
"Currency",
"base",
",",
"Currency",
"counter",
")",
"throws",
"IOException",
"{",
"return",
"coinbase",
".",
"getBuyPrice",
"(",
"Coinbase",
".",
"CB_VERSION_VALUE",
",",
"base",
"+",
"\"-\"",
"+",
"counter",... | Unauthenticated resource that tells you the price to buy one unit.
@param pair The currency pair.
@return The price in the desired {@code currency} to buy one unit.
@throws IOException
@see <a
href="https://developers.coinbase.com/api/v2#get-buy-price">developers.coinbase.com/api/v2#get-buy-price</a> | [
"Unauthenticated",
"resource",
"that",
"tells",
"you",
"the",
"price",
"to",
"buy",
"one",
"unit",
"."
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseMarketDataServiceRaw.java#L44-L47 |
netscaler/sdx_nitro | src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_resource.java | xen_health_resource.get_nitro_bulk_response | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_resource_responses result = (xen_health_resource_responses) service.get_payload_formatter().string_to_resource(xen_health_resource_responses.class, response);
if(result.errorcode != 0)
{
... | java | protected base_resource[] get_nitro_bulk_response(nitro_service service, String response) throws Exception
{
xen_health_resource_responses result = (xen_health_resource_responses) service.get_payload_formatter().string_to_resource(xen_health_resource_responses.class, response);
if(result.errorcode != 0)
{
... | [
"protected",
"base_resource",
"[",
"]",
"get_nitro_bulk_response",
"(",
"nitro_service",
"service",
",",
"String",
"response",
")",
"throws",
"Exception",
"{",
"xen_health_resource_responses",
"result",
"=",
"(",
"xen_health_resource_responses",
")",
"service",
".",
"ge... | <pre>
Converts API response of bulk operation into object and returns the object array in case of get request.
</pre> | [
"<pre",
">",
"Converts",
"API",
"response",
"of",
"bulk",
"operation",
"into",
"object",
"and",
"returns",
"the",
"object",
"array",
"in",
"case",
"of",
"get",
"request",
".",
"<",
"/",
"pre",
">"
] | train | https://github.com/netscaler/sdx_nitro/blob/c840919f1a8f7c0a5634c0f23d34fa14d1765ff1/src/main/java/com/citrix/sdx/nitro/resource/config/xen/xen_health_resource.java#L313-L330 |
apache/flink | flink-core/src/main/java/org/apache/flink/types/parser/BooleanParser.java | BooleanParser.byteArrayEquals | private static boolean byteArrayEquals(byte[] source, int start, int length, byte[] other) {
if (length != other.length) {
return false;
}
for (int i = 0; i < other.length; i++) {
if (Character.toLowerCase(source[i + start]) != other[i]) {
return false;
}
}
return true;
} | java | private static boolean byteArrayEquals(byte[] source, int start, int length, byte[] other) {
if (length != other.length) {
return false;
}
for (int i = 0; i < other.length; i++) {
if (Character.toLowerCase(source[i + start]) != other[i]) {
return false;
}
}
return true;
} | [
"private",
"static",
"boolean",
"byteArrayEquals",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"start",
",",
"int",
"length",
",",
"byte",
"[",
"]",
"other",
")",
"{",
"if",
"(",
"length",
"!=",
"other",
".",
"length",
")",
"{",
"return",
"false",
"... | Checks if a part of a byte array matches another byte array with chars (case-insensitive).
@param source The source byte array.
@param start The offset into the source byte array.
@param length The length of the match.
@param other The byte array which is fully compared to the part of the source array.
@return true if ... | [
"Checks",
"if",
"a",
"part",
"of",
"a",
"byte",
"array",
"matches",
"another",
"byte",
"array",
"with",
"chars",
"(",
"case",
"-",
"insensitive",
")",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/types/parser/BooleanParser.java#L84-L94 |
wanglinsong/testharness | src/main/java/com/tascape/qa/th/Utils.java | Utils.cmd | public static List<String> cmd(String[] command) throws IOException, InterruptedException {
return cmd(command, null, null, 300000L, null);
} | java | public static List<String> cmd(String[] command) throws IOException, InterruptedException {
return cmd(command, null, null, 300000L, null);
} | [
"public",
"static",
"List",
"<",
"String",
">",
"cmd",
"(",
"String",
"[",
"]",
"command",
")",
"throws",
"IOException",
",",
"InterruptedException",
"{",
"return",
"cmd",
"(",
"command",
",",
"null",
",",
"null",
",",
"300000L",
",",
"null",
")",
";",
... | Executes command, and waits for the expected phrase in console printout.
@param command command line
@return console output as a list of strings
@throws IOException for command error
@throws InterruptedException when interrupted | [
"Executes",
"command",
"and",
"waits",
"for",
"the",
"expected",
"phrase",
"in",
"console",
"printout",
"."
] | train | https://github.com/wanglinsong/testharness/blob/76f3e4546648e0720f6f87a58cb91a09cd36dfca/src/main/java/com/tascape/qa/th/Utils.java#L126-L128 |
eclipse/xtext-lib | org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IntegerExtensions.java | IntegerExtensions.operator_upTo | @Pure
@Inline(value="new $3($1, $2)", imported=IntegerRange.class, statementExpression=false)
public static IntegerRange operator_upTo(final int a, final int b) {
return new IntegerRange(a, b);
} | java | @Pure
@Inline(value="new $3($1, $2)", imported=IntegerRange.class, statementExpression=false)
public static IntegerRange operator_upTo(final int a, final int b) {
return new IntegerRange(a, b);
} | [
"@",
"Pure",
"@",
"Inline",
"(",
"value",
"=",
"\"new $3($1, $2)\"",
",",
"imported",
"=",
"IntegerRange",
".",
"class",
",",
"statementExpression",
"=",
"false",
")",
"public",
"static",
"IntegerRange",
"operator_upTo",
"(",
"final",
"int",
"a",
",",
"final",... | The <code>..</code> operator yields an {@link IntegerRange}.
@param a the start of the range.
@param b the end of the range.
@return an {@link IntegerRange}. Never <code>null</code>.
@since 2.3 | [
"The",
"<code",
">",
"..",
"<",
"/",
"code",
">",
"operator",
"yields",
"an",
"{",
"@link",
"IntegerRange",
"}",
"."
] | train | https://github.com/eclipse/xtext-lib/blob/7063572e1f1bd713a3aa53bdf3a8dc60e25c169a/org.eclipse.xtext.xbase.lib/src/org/eclipse/xtext/xbase/lib/IntegerExtensions.java#L31-L35 |
h2oai/h2o-3 | h2o-core/src/main/java/water/util/VecUtils.java | VecUtils.stringToNumeric | public static Vec stringToNumeric(Vec src) {
if(!src.isString()) throw new H2OIllegalArgumentException("stringToNumeric conversion only works on string columns");
Vec res = new MRTask() {
@Override public void map(Chunk chk, NewChunk newChk){
if (chk instanceof C0DChunk) { // all NAs
for... | java | public static Vec stringToNumeric(Vec src) {
if(!src.isString()) throw new H2OIllegalArgumentException("stringToNumeric conversion only works on string columns");
Vec res = new MRTask() {
@Override public void map(Chunk chk, NewChunk newChk){
if (chk instanceof C0DChunk) { // all NAs
for... | [
"public",
"static",
"Vec",
"stringToNumeric",
"(",
"Vec",
"src",
")",
"{",
"if",
"(",
"!",
"src",
".",
"isString",
"(",
")",
")",
"throw",
"new",
"H2OIllegalArgumentException",
"(",
"\"stringToNumeric conversion only works on string columns\"",
")",
";",
"Vec",
"r... | Create a new {@link Vec} of numeric values from a string {@link Vec}. Any rows that cannot be
converted to a number are set to NA.
Currently only does basic numeric formats. No exponents, or hex values. Doesn't
even like commas or spaces. :( Needs love. Handling more numeric
representations is PUBDEV-2209
@param src... | [
"Create",
"a",
"new",
"{",
"@link",
"Vec",
"}",
"of",
"numeric",
"values",
"from",
"a",
"string",
"{",
"@link",
"Vec",
"}",
".",
"Any",
"rows",
"that",
"cannot",
"be",
"converted",
"to",
"a",
"number",
"are",
"set",
"to",
"NA",
"."
] | train | https://github.com/h2oai/h2o-3/blob/845eb49dfeaadf638b6e2f779d82fac996391fad/h2o-core/src/main/java/water/util/VecUtils.java#L193-L222 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/alias/AliasFactory.java | AliasFactory.createAliasForVariable | @SuppressWarnings("unchecked")
public <A> A createAliasForVariable(Class<A> cl, String var) {
try {
Expression<?> path = pathCache.get(Pair.<Class<?>, String>of(cl, var));
return (A) proxyCache.get(Pair.<Class<?>, Expression<?>>of(cl, path));
} catch (ExecutionException e) {
... | java | @SuppressWarnings("unchecked")
public <A> A createAliasForVariable(Class<A> cl, String var) {
try {
Expression<?> path = pathCache.get(Pair.<Class<?>, String>of(cl, var));
return (A) proxyCache.get(Pair.<Class<?>, Expression<?>>of(cl, path));
} catch (ExecutionException e) {
... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"A",
">",
"A",
"createAliasForVariable",
"(",
"Class",
"<",
"A",
">",
"cl",
",",
"String",
"var",
")",
"{",
"try",
"{",
"Expression",
"<",
"?",
">",
"path",
"=",
"pathCache",
".",
"get"... | Create an alias instance for the given class and variable name
@param <A>
@param cl type for alias
@param var variable name for the underlying expression
@return alias instance | [
"Create",
"an",
"alias",
"instance",
"for",
"the",
"given",
"class",
"and",
"variable",
"name"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/alias/AliasFactory.java#L108-L116 |
lettuce-io/lettuce-core | src/main/java/io/lettuce/core/cluster/topology/Connections.java | Connections.addConnection | public void addConnection(RedisURI redisURI, StatefulRedisConnection<String, String> connection) {
if (this.closed) { // fastpath
connection.closeAsync();
return;
}
synchronized (this.connections) {
if (this.closed) {
connection.closeAsync()... | java | public void addConnection(RedisURI redisURI, StatefulRedisConnection<String, String> connection) {
if (this.closed) { // fastpath
connection.closeAsync();
return;
}
synchronized (this.connections) {
if (this.closed) {
connection.closeAsync()... | [
"public",
"void",
"addConnection",
"(",
"RedisURI",
"redisURI",
",",
"StatefulRedisConnection",
"<",
"String",
",",
"String",
">",
"connection",
")",
"{",
"if",
"(",
"this",
".",
"closed",
")",
"{",
"// fastpath",
"connection",
".",
"closeAsync",
"(",
")",
"... | Add a connection for a {@link RedisURI}
@param redisURI
@param connection | [
"Add",
"a",
"connection",
"for",
"a",
"{",
"@link",
"RedisURI",
"}"
] | train | https://github.com/lettuce-io/lettuce-core/blob/b6de74e384dea112e3656684ca3f50cdfd6c8e0d/src/main/java/io/lettuce/core/cluster/topology/Connections.java#L54-L70 |
nostra13/Android-Universal-Image-Loader | library/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java | LruMemoryCache.put | @Override
public final boolean put(String key, Bitmap value) {
if (key == null || value == null) {
throw new NullPointerException("key == null || value == null");
}
synchronized (this) {
size += sizeOf(key, value);
Bitmap previous = map.put(key, value);
if (previous != null) {
size -= sizeOf(key... | java | @Override
public final boolean put(String key, Bitmap value) {
if (key == null || value == null) {
throw new NullPointerException("key == null || value == null");
}
synchronized (this) {
size += sizeOf(key, value);
Bitmap previous = map.put(key, value);
if (previous != null) {
size -= sizeOf(key... | [
"@",
"Override",
"public",
"final",
"boolean",
"put",
"(",
"String",
"key",
",",
"Bitmap",
"value",
")",
"{",
"if",
"(",
"key",
"==",
"null",
"||",
"value",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
"\"key == null || value == null\... | Caches {@code Bitmap} for {@code key}. The Bitmap is moved to the head of the queue. | [
"Caches",
"{"
] | train | https://github.com/nostra13/Android-Universal-Image-Loader/blob/fc3c5f6779bb4f702e233653b61bd9d559e345cc/library/src/main/java/com/nostra13/universalimageloader/cache/memory/impl/LruMemoryCache.java#L55-L71 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java | SignatureFileVerifier.verifyTimestamp | private void verifyTimestamp(TimestampToken token, byte[] signature)
throws NoSuchAlgorithmException, SignatureException {
MessageDigest md =
MessageDigest.getInstance(token.getHashAlgorithm().getName());
if (!Arrays.equals(token.getHashedMessage(), md.digest(signature))) {
... | java | private void verifyTimestamp(TimestampToken token, byte[] signature)
throws NoSuchAlgorithmException, SignatureException {
MessageDigest md =
MessageDigest.getInstance(token.getHashAlgorithm().getName());
if (!Arrays.equals(token.getHashedMessage(), md.digest(signature))) {
... | [
"private",
"void",
"verifyTimestamp",
"(",
"TimestampToken",
"token",
",",
"byte",
"[",
"]",
"signature",
")",
"throws",
"NoSuchAlgorithmException",
",",
"SignatureException",
"{",
"MessageDigest",
"md",
"=",
"MessageDigest",
".",
"getInstance",
"(",
"token",
".",
... | /*
Check that the signature timestamp applies to this signature.
Match the hash present in the signature timestamp token against the hash
of this signature. | [
"/",
"*",
"Check",
"that",
"the",
"signature",
"timestamp",
"applies",
"to",
"this",
"signature",
".",
"Match",
"the",
"hash",
"present",
"in",
"the",
"signature",
"timestamp",
"token",
"against",
"the",
"hash",
"of",
"this",
"signature",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/security/util/SignatureFileVerifier.java#L566-L584 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildConstantSummaries | public void buildConstantSummaries(XMLNode node, Content contentTree) {
printedPackageHeaders = new HashSet<>();
Content summariesTree = writer.getConstantSummaries();
for (PackageDoc aPackage : configuration.packages) {
if (hasConstantField(aPackage)) {
currentPackag... | java | public void buildConstantSummaries(XMLNode node, Content contentTree) {
printedPackageHeaders = new HashSet<>();
Content summariesTree = writer.getConstantSummaries();
for (PackageDoc aPackage : configuration.packages) {
if (hasConstantField(aPackage)) {
currentPackag... | [
"public",
"void",
"buildConstantSummaries",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"printedPackageHeaders",
"=",
"new",
"HashSet",
"<>",
"(",
")",
";",
"Content",
"summariesTree",
"=",
"writer",
".",
"getConstantSummaries",
"(",
")",
";... | Build the summary for each documented package.
@param node the XML element that specifies which components to document
@param contentTree the tree to which the summaries will be added | [
"Build",
"the",
"summary",
"for",
"each",
"documented",
"package",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java#L177-L189 |
google/closure-templates | java/src/com/google/template/soy/jssrc/dsl/CodeChunkUtils.java | CodeChunkUtils.checkId | static void checkId(String id) {
if (!ID.matcher(id).matches()) {
throw new IllegalArgumentException(String.format("not a valid js identifier: %s", id));
}
} | java | static void checkId(String id) {
if (!ID.matcher(id).matches()) {
throw new IllegalArgumentException(String.format("not a valid js identifier: %s", id));
}
} | [
"static",
"void",
"checkId",
"(",
"String",
"id",
")",
"{",
"if",
"(",
"!",
"ID",
".",
"matcher",
"(",
"id",
")",
".",
"matches",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"String",
".",
"format",
"(",
"\"not a valid js identif... | Validates that the given string is a valid javascript identifier. | [
"Validates",
"that",
"the",
"given",
"string",
"is",
"a",
"valid",
"javascript",
"identifier",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/CodeChunkUtils.java#L44-L48 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/syncer/Syncer.java | Syncer.getFieldIndexes | private int getFieldIndexes(ISyncHandler<?, ? extends ISyncableData> handler, String... syncNames)
{
int indexes = 0;
for (String str : syncNames)
{
ObjectData od = handler.getObjectData(str);
if (od != null)
indexes |= 1 << od.getIndex();
}
return indexes;
} | java | private int getFieldIndexes(ISyncHandler<?, ? extends ISyncableData> handler, String... syncNames)
{
int indexes = 0;
for (String str : syncNames)
{
ObjectData od = handler.getObjectData(str);
if (od != null)
indexes |= 1 << od.getIndex();
}
return indexes;
} | [
"private",
"int",
"getFieldIndexes",
"(",
"ISyncHandler",
"<",
"?",
",",
"?",
"extends",
"ISyncableData",
">",
"handler",
",",
"String",
"...",
"syncNames",
")",
"{",
"int",
"indexes",
"=",
"0",
";",
"for",
"(",
"String",
"str",
":",
"syncNames",
")",
"{... | Gets the indexes of the sync fields into a single integer.
@param handler the handler
@param syncNames the sync names
@return the field indexes | [
"Gets",
"the",
"indexes",
"of",
"the",
"sync",
"fields",
"into",
"a",
"single",
"integer",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/syncer/Syncer.java#L253-L263 |
Netflix/Hystrix | hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesStrategy.java | HystrixPropertiesStrategy.getCollapserProperties | public HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey, HystrixCollapserProperties.Setter builder) {
return new HystrixPropertiesCollapserDefault(collapserKey, builder);
} | java | public HystrixCollapserProperties getCollapserProperties(HystrixCollapserKey collapserKey, HystrixCollapserProperties.Setter builder) {
return new HystrixPropertiesCollapserDefault(collapserKey, builder);
} | [
"public",
"HystrixCollapserProperties",
"getCollapserProperties",
"(",
"HystrixCollapserKey",
"collapserKey",
",",
"HystrixCollapserProperties",
".",
"Setter",
"builder",
")",
"{",
"return",
"new",
"HystrixPropertiesCollapserDefault",
"(",
"collapserKey",
",",
"builder",
")",... | Construct an implementation of {@link HystrixCollapserProperties} for {@link HystrixCollapser} instances with {@link HystrixCollapserKey}.
<p>
<b>Default Implementation</b>
<p>
Constructs instance of {@link HystrixPropertiesCollapserDefault}.
@param collapserKey
{@link HystrixCollapserKey} representing the name or typ... | [
"Construct",
"an",
"implementation",
"of",
"{",
"@link",
"HystrixCollapserProperties",
"}",
"for",
"{",
"@link",
"HystrixCollapser",
"}",
"instances",
"with",
"{",
"@link",
"HystrixCollapserKey",
"}",
".",
"<p",
">",
"<b",
">",
"Default",
"Implementation<",
"/",
... | train | https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/strategy/properties/HystrixPropertiesStrategy.java#L131-L133 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ObjectUtils.java | ObjectUtils.isNullOrEqualTo | @NullSafe
public static boolean isNullOrEqualTo(Object obj1, Object obj2) {
return obj1 == null || obj1.equals(obj2);
} | java | @NullSafe
public static boolean isNullOrEqualTo(Object obj1, Object obj2) {
return obj1 == null || obj1.equals(obj2);
} | [
"@",
"NullSafe",
"public",
"static",
"boolean",
"isNullOrEqualTo",
"(",
"Object",
"obj1",
",",
"Object",
"obj2",
")",
"{",
"return",
"obj1",
"==",
"null",
"||",
"obj1",
".",
"equals",
"(",
"obj2",
")",
";",
"}"
] | Determines whether {@code obj1} is {@literal null} or equal to {@code obj2}.
@param obj1 {@link Object} being evaluated in the equality comparison.
@param obj2 {@link Object} to compare for equality with {@code obj1} if {@code obj1} is not {@literal null}.
@return a boolean value indicating whether {@code obj1} is {@l... | [
"Determines",
"whether",
"{",
"@code",
"obj1",
"}",
"is",
"{",
"@literal",
"null",
"}",
"or",
"equal",
"to",
"{",
"@code",
"obj2",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ObjectUtils.java#L281-L284 |
ical4j/ical4j | src/main/java/net/fortuna/ical4j/util/Dates.java | Dates.getInstance | public static Date getInstance(final java.util.Date date, final Value type) {
if (Value.DATE.equals(type)) {
return new Date(date);
}
return new DateTime(date);
} | java | public static Date getInstance(final java.util.Date date, final Value type) {
if (Value.DATE.equals(type)) {
return new Date(date);
}
return new DateTime(date);
} | [
"public",
"static",
"Date",
"getInstance",
"(",
"final",
"java",
".",
"util",
".",
"Date",
"date",
",",
"final",
"Value",
"type",
")",
"{",
"if",
"(",
"Value",
".",
"DATE",
".",
"equals",
"(",
"type",
")",
")",
"{",
"return",
"new",
"Date",
"(",
"d... | Returns a new date instance of the specified type. If no type is
specified a DateTime instance is returned.
@param date a seed Java date instance
@param type the type of date instance
@return an instance of <code>net.fortuna.ical4j.model.Date</code> | [
"Returns",
"a",
"new",
"date",
"instance",
"of",
"the",
"specified",
"type",
".",
"If",
"no",
"type",
"is",
"specified",
"a",
"DateTime",
"instance",
"is",
"returned",
"."
] | train | https://github.com/ical4j/ical4j/blob/7ac4bd1ce2bb2e0a2906fb69a56fbd2d9d974156/src/main/java/net/fortuna/ical4j/util/Dates.java#L220-L225 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.