repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
netty/netty | codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java | HttpHeaders.removeHeader | @Deprecated
public static void removeHeader(HttpMessage message, String name) {
"""
@deprecated Use {@link #remove(CharSequence)} instead.
@see #removeHeader(HttpMessage, CharSequence)
"""
message.headers().remove(name);
} | java | @Deprecated
public static void removeHeader(HttpMessage message, String name) {
message.headers().remove(name);
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"removeHeader",
"(",
"HttpMessage",
"message",
",",
"String",
"name",
")",
"{",
"message",
".",
"headers",
"(",
")",
".",
"remove",
"(",
"name",
")",
";",
"}"
] | @deprecated Use {@link #remove(CharSequence)} instead.
@see #removeHeader(HttpMessage, CharSequence) | [
"@deprecated",
"Use",
"{",
"@link",
"#remove",
"(",
"CharSequence",
")",
"}",
"instead",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http/src/main/java/io/netty/handler/codec/http/HttpHeaders.java#L679-L682 |
52inc/android-52Kit | library/src/main/java/com/ftinc/kit/util/FileUtils.java | FileUtils.getVideoThumbnail | public static void getVideoThumbnail(String videoPath, final VideoThumbnailCallback cb) {
"""
Get the thumbnail of a video asynchronously
@param videoPath the path to the video
@param cb the callback
"""
new AsyncTask<String, Void, Bitmap>(){
@Override
protect... | java | public static void getVideoThumbnail(String videoPath, final VideoThumbnailCallback cb){
new AsyncTask<String, Void, Bitmap>(){
@Override
protected Bitmap doInBackground(String... params) {
if(params.length > 0) {
String path = params[0];
... | [
"public",
"static",
"void",
"getVideoThumbnail",
"(",
"String",
"videoPath",
",",
"final",
"VideoThumbnailCallback",
"cb",
")",
"{",
"new",
"AsyncTask",
"<",
"String",
",",
"Void",
",",
"Bitmap",
">",
"(",
")",
"{",
"@",
"Override",
"protected",
"Bitmap",
"d... | Get the thumbnail of a video asynchronously
@param videoPath the path to the video
@param cb the callback | [
"Get",
"the",
"thumbnail",
"of",
"a",
"video",
"asynchronously"
] | train | https://github.com/52inc/android-52Kit/blob/8644fab0f633477b1bb1dddd8147a9ef8bc03516/library/src/main/java/com/ftinc/kit/util/FileUtils.java#L314-L332 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/caching/provider/ConcurrentMapCache.java | ConcurrentMapCache.putIfPresent | @Override
public VALUE putIfPresent(KEY key, VALUE newValue) {
"""
Puts the {@link VALUE value} in this {@link Cache} mapped to the given {@link KEY key} iff an entry
with the given {@link KEY key} already exists in this {@link Cache}.
@param key {@link KEY key} used to map the {@link VALUE new value} in thi... | java | @Override
public VALUE putIfPresent(KEY key, VALUE newValue) {
Assert.notNull(newValue, "Value is required");
if (key != null) {
AtomicReference<VALUE> oldValueRef = new AtomicReference<>(null);
return newValue.equals(this.map.computeIfPresent(key, (theKey, oldValue) -> {
oldValueRef.s... | [
"@",
"Override",
"public",
"VALUE",
"putIfPresent",
"(",
"KEY",
"key",
",",
"VALUE",
"newValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"newValue",
",",
"\"Value is required\"",
")",
";",
"if",
"(",
"key",
"!=",
"null",
")",
"{",
"AtomicReference",
"<",
... | Puts the {@link VALUE value} in this {@link Cache} mapped to the given {@link KEY key} iff an entry
with the given {@link KEY key} already exists in this {@link Cache}.
@param key {@link KEY key} used to map the {@link VALUE new value} in this {@link Cache}.
@param newValue {@link VALUE new value} replacing the existi... | [
"Puts",
"the",
"{",
"@link",
"VALUE",
"value",
"}",
"in",
"this",
"{",
"@link",
"Cache",
"}",
"mapped",
"to",
"the",
"given",
"{",
"@link",
"KEY",
"key",
"}",
"iff",
"an",
"entry",
"with",
"the",
"given",
"{",
"@link",
"KEY",
"key",
"}",
"already",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/caching/provider/ConcurrentMapCache.java#L206-L222 |
lessthanoptimal/BoofCV | main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java | KltTracker.isFullyOutside | public boolean isFullyOutside(float x, float y) {
"""
Returns true if the features is entirely outside of the image. A region is entirely outside if not
an entire pixel is contained inside the image. So if only 0.999 of a pixel is inside then the whole
region is considered to be outside. Can't interpolate no... | java | public boolean isFullyOutside(float x, float y) {
if (x < outsideLeft || x > outsideRight)
return true;
if (y < outsideTop || y > outsideBottom)
return true;
return false;
} | [
"public",
"boolean",
"isFullyOutside",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"x",
"<",
"outsideLeft",
"||",
"x",
">",
"outsideRight",
")",
"return",
"true",
";",
"if",
"(",
"y",
"<",
"outsideTop",
"||",
"y",
">",
"outsideBottom",
... | Returns true if the features is entirely outside of the image. A region is entirely outside if not
an entire pixel is contained inside the image. So if only 0.999 of a pixel is inside then the whole
region is considered to be outside. Can't interpolate nothing... | [
"Returns",
"true",
"if",
"the",
"features",
"is",
"entirely",
"outside",
"of",
"the",
"image",
".",
"A",
"region",
"is",
"entirely",
"outside",
"if",
"not",
"an",
"entire",
"pixel",
"is",
"contained",
"inside",
"the",
"image",
".",
"So",
"if",
"only",
"0... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-feature/src/main/java/boofcv/alg/tracker/klt/KltTracker.java#L488-L495 |
netty/netty | codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponseEncoder.java | DatagramDnsResponseEncoder.encodeHeader | private static void encodeHeader(DnsResponse response, ByteBuf buf) {
"""
Encodes the header that is always 12 bytes long.
@param response the response header being encoded
@param buf the buffer the encoded data should be written to
"""
buf.writeShort(response.id());
int flags = 32768;... | java | private static void encodeHeader(DnsResponse response, ByteBuf buf) {
buf.writeShort(response.id());
int flags = 32768;
flags |= (response.opCode().byteValue() & 0xFF) << 11;
if (response.isAuthoritativeAnswer()) {
flags |= 1 << 10;
}
if (response.isTruncated(... | [
"private",
"static",
"void",
"encodeHeader",
"(",
"DnsResponse",
"response",
",",
"ByteBuf",
"buf",
")",
"{",
"buf",
".",
"writeShort",
"(",
"response",
".",
"id",
"(",
")",
")",
";",
"int",
"flags",
"=",
"32768",
";",
"flags",
"|=",
"(",
"response",
"... | Encodes the header that is always 12 bytes long.
@param response the response header being encoded
@param buf the buffer the encoded data should be written to | [
"Encodes",
"the",
"header",
"that",
"is",
"always",
"12",
"bytes",
"long",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-dns/src/main/java/io/netty/handler/codec/dns/DatagramDnsResponseEncoder.java#L97-L120 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.executeGraphPathRequestAsync | @Deprecated
public static RequestAsyncTask executeGraphPathRequestAsync(Session session, String graphPath, Callback callback) {
"""
Starts a new Request configured to retrieve a particular graph path.
<p/>
This should only be called from the UI thread.
This method is deprecated. Prefer to call Request.new... | java | @Deprecated
public static RequestAsyncTask executeGraphPathRequestAsync(Session session, String graphPath, Callback callback) {
return newGraphPathRequest(session, graphPath, callback).executeAsync();
} | [
"@",
"Deprecated",
"public",
"static",
"RequestAsyncTask",
"executeGraphPathRequestAsync",
"(",
"Session",
"session",
",",
"String",
"graphPath",
",",
"Callback",
"callback",
")",
"{",
"return",
"newGraphPathRequest",
"(",
"session",
",",
"graphPath",
",",
"callback",... | Starts a new Request configured to retrieve a particular graph path.
<p/>
This should only be called from the UI thread.
This method is deprecated. Prefer to call Request.newGraphPathRequest(...).executeAsync();
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param gra... | [
"Starts",
"a",
"new",
"Request",
"configured",
"to",
"retrieve",
"a",
"particular",
"graph",
"path",
".",
"<p",
"/",
">",
"This",
"should",
"only",
"be",
"called",
"from",
"the",
"UI",
"thread",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L1192-L1195 |
jcuda/jcusparse | JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java | JCusparse.cusparseXcsr2bsrNnz | public static int cusparseXcsr2bsrNnz(
cusparseHandle handle,
int dirA,
int m,
int n,
cusparseMatDescr descrA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
int blockDim,
cusparseMatDescr descrC,
Pointer bsrSortedRo... | java | public static int cusparseXcsr2bsrNnz(
cusparseHandle handle,
int dirA,
int m,
int n,
cusparseMatDescr descrA,
Pointer csrSortedRowPtrA,
Pointer csrSortedColIndA,
int blockDim,
cusparseMatDescr descrC,
Pointer bsrSortedRo... | [
"public",
"static",
"int",
"cusparseXcsr2bsrNnz",
"(",
"cusparseHandle",
"handle",
",",
"int",
"dirA",
",",
"int",
"m",
",",
"int",
"n",
",",
"cusparseMatDescr",
"descrA",
",",
"Pointer",
"csrSortedRowPtrA",
",",
"Pointer",
"csrSortedColIndA",
",",
"int",
"block... | Description: This routine converts a sparse matrix in CSR storage format
to a sparse matrix in block-CSR storage format. | [
"Description",
":",
"This",
"routine",
"converts",
"a",
"sparse",
"matrix",
"in",
"CSR",
"storage",
"format",
"to",
"a",
"sparse",
"matrix",
"in",
"block",
"-",
"CSR",
"storage",
"format",
"."
] | train | https://github.com/jcuda/jcusparse/blob/7687a62a4ef6b76cb91cf7da93d4cf5ade96a791/JCusparseJava/src/main/java/jcuda/jcusparse/JCusparse.java#L12363-L12377 |
apache/incubator-gobblin | gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java | GobblinEncryptionProvider.buildKeyToStringCodec | private KeyToStringCodec buildKeyToStringCodec(Map<String, Object> parameters) {
"""
Build a KeyToStringCodec based on parameters. To reduce complexity we don't build these
through a ServiceLocator since hopefully the # of key encodings is small.
@param parameters Config parameters used to build the codec
""... | java | private KeyToStringCodec buildKeyToStringCodec(Map<String, Object> parameters) {
String encodingName = EncryptionConfigParser.getKeystoreEncoding(parameters);
switch (encodingName) {
case HexKeyToStringCodec.TAG:
return new HexKeyToStringCodec();
case Base64KeyToStringCodec.TAG:
retu... | [
"private",
"KeyToStringCodec",
"buildKeyToStringCodec",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"String",
"encodingName",
"=",
"EncryptionConfigParser",
".",
"getKeystoreEncoding",
"(",
"parameters",
")",
";",
"switch",
"(",
"encodingN... | Build a KeyToStringCodec based on parameters. To reduce complexity we don't build these
through a ServiceLocator since hopefully the # of key encodings is small.
@param parameters Config parameters used to build the codec | [
"Build",
"a",
"KeyToStringCodec",
"based",
"on",
"parameters",
".",
"To",
"reduce",
"complexity",
"we",
"don",
"t",
"build",
"these",
"through",
"a",
"ServiceLocator",
"since",
"hopefully",
"the",
"#",
"of",
"key",
"encodings",
"is",
"small",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-modules/gobblin-crypto-provider/src/main/java/org/apache/gobblin/crypto/GobblinEncryptionProvider.java#L138-L148 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java | DefaultGroovyMethods.withIndex | public static <E> List<Tuple2<E, Integer>> withIndex(Iterable<E> self) {
"""
Zips an Iterable with indices in (value, index) order.
<p/>
Example usage:
<pre class="groovyTestCase">
assert [["a", 0], ["b", 1]] == ["a", "b"].withIndex()
assert ["0: a", "1: b"] == ["a", "b"].withIndex().collect { str, idx {@code... | java | public static <E> List<Tuple2<E, Integer>> withIndex(Iterable<E> self) {
return withIndex(self, 0);
} | [
"public",
"static",
"<",
"E",
">",
"List",
"<",
"Tuple2",
"<",
"E",
",",
"Integer",
">",
">",
"withIndex",
"(",
"Iterable",
"<",
"E",
">",
"self",
")",
"{",
"return",
"withIndex",
"(",
"self",
",",
"0",
")",
";",
"}"
] | Zips an Iterable with indices in (value, index) order.
<p/>
Example usage:
<pre class="groovyTestCase">
assert [["a", 0], ["b", 1]] == ["a", "b"].withIndex()
assert ["0: a", "1: b"] == ["a", "b"].withIndex().collect { str, idx {@code ->} "$idx: $str" }
</pre>
@param self an Iterable
@return a zipped list with indices
... | [
"Zips",
"an",
"Iterable",
"with",
"indices",
"in",
"(",
"value",
"index",
")",
"order",
".",
"<p",
"/",
">",
"Example",
"usage",
":",
"<pre",
"class",
"=",
"groovyTestCase",
">",
"assert",
"[[",
"a",
"0",
"]",
"[",
"b",
"1",
"]]",
"==",
"[",
"a",
... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L8739-L8741 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbUtils.java | RocksDbUtils.buildWriteOptions | public static WriteOptions buildWriteOptions(boolean sync, boolean disableWAL) {
"""
Builds RocksDb {@link WriteOptions}.
@param sync
As of RocksDB v3.10.1, no data lost if process crashes even if sync==false. Data
lost only when server/OS crashes. So it's relatively safe to set sync=false for
fast write
@p... | java | public static WriteOptions buildWriteOptions(boolean sync, boolean disableWAL) {
WriteOptions writeOptions = new WriteOptions();
writeOptions.setSync(sync).setDisableWAL(disableWAL);
return writeOptions;
} | [
"public",
"static",
"WriteOptions",
"buildWriteOptions",
"(",
"boolean",
"sync",
",",
"boolean",
"disableWAL",
")",
"{",
"WriteOptions",
"writeOptions",
"=",
"new",
"WriteOptions",
"(",
")",
";",
"writeOptions",
".",
"setSync",
"(",
"sync",
")",
".",
"setDisable... | Builds RocksDb {@link WriteOptions}.
@param sync
As of RocksDB v3.10.1, no data lost if process crashes even if sync==false. Data
lost only when server/OS crashes. So it's relatively safe to set sync=false for
fast write
@param disableWAL
@return | [
"Builds",
"RocksDb",
"{",
"@link",
"WriteOptions",
"}",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/rocksdb/RocksDbUtils.java#L128-L132 |
teatrove/teatrove | tea/src/main/java/org/teatrove/tea/compiler/Parser.java | Parser.parseAssignmentStatement | private AssignmentStatement parseAssignmentStatement(Token token)
throws IOException {
"""
When this is called, the identifier token has already been read.
"""
// TODO: allow lvalue to support dot notations
// ie: field = x (store local variable)
// obj.field = x (obj.setFi... | java | private AssignmentStatement parseAssignmentStatement(Token token)
throws IOException {
// TODO: allow lvalue to support dot notations
// ie: field = x (store local variable)
// obj.field = x (obj.setField)
// obj.field.field = x (obj.getField().setField)
// a... | [
"private",
"AssignmentStatement",
"parseAssignmentStatement",
"(",
"Token",
"token",
")",
"throws",
"IOException",
"{",
"// TODO: allow lvalue to support dot notations",
"// ie: field = x (store local variable)",
"// obj.field = x (obj.setField)",
"// obj.field.field = x (obj.getFi... | When this is called, the identifier token has already been read. | [
"When",
"this",
"is",
"called",
"the",
"identifier",
"token",
"has",
"already",
"been",
"read",
"."
] | train | https://github.com/teatrove/teatrove/blob/7039bdd4da6817ff8c737f7e4e07bac7e3ad8bea/tea/src/main/java/org/teatrove/tea/compiler/Parser.java#L728-L763 |
webmetrics/browsermob-proxy | src/main/java/cz/mallat/uasparser/UASparser.java | UASparser.processRobot | private boolean processRobot(String useragent, UserAgentInfo retObj) {
"""
Checks if the useragent comes from a robot. if yes copies all the data to the result object
@param useragent
@param retObj
@return true if the useragent belongs to a robot, else false
"""
try {
lock.lock();
... | java | private boolean processRobot(String useragent, UserAgentInfo retObj) {
try {
lock.lock();
if (robotsMap.containsKey(useragent)) {
retObj.setTyp("Robot");
RobotEntry robotEntry = robotsMap.get(useragent);
robotEntry.copyTo(retObj);
... | [
"private",
"boolean",
"processRobot",
"(",
"String",
"useragent",
",",
"UserAgentInfo",
"retObj",
")",
"{",
"try",
"{",
"lock",
".",
"lock",
"(",
")",
";",
"if",
"(",
"robotsMap",
".",
"containsKey",
"(",
"useragent",
")",
")",
"{",
"retObj",
".",
"setTy... | Checks if the useragent comes from a robot. if yes copies all the data to the result object
@param useragent
@param retObj
@return true if the useragent belongs to a robot, else false | [
"Checks",
"if",
"the",
"useragent",
"comes",
"from",
"a",
"robot",
".",
"if",
"yes",
"copies",
"all",
"the",
"data",
"to",
"the",
"result",
"object"
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/cz/mallat/uasparser/UASparser.java#L208-L228 |
nulab/backlog4j | src/main/java/com/nulabinc/backlog4j/api/option/CreateIssueParams.java | CreateIssueParams.actualHours | public CreateIssueParams actualHours(BigDecimal actualHours) {
"""
Sets the issue actual hours.
@param actualHours the issue actual hours
@return CreateIssueParams instance
"""
if (actualHours == null) {
parameters.add(new NameValuePair("actualHours", ""));
} else {
... | java | public CreateIssueParams actualHours(BigDecimal actualHours) {
if (actualHours == null) {
parameters.add(new NameValuePair("actualHours", ""));
} else {
parameters.add(new NameValuePair("actualHours", actualHours.setScale(2, BigDecimal.ROUND_HALF_UP).toPlainString()));
}
... | [
"public",
"CreateIssueParams",
"actualHours",
"(",
"BigDecimal",
"actualHours",
")",
"{",
"if",
"(",
"actualHours",
"==",
"null",
")",
"{",
"parameters",
".",
"add",
"(",
"new",
"NameValuePair",
"(",
"\"actualHours\"",
",",
"\"\"",
")",
")",
";",
"}",
"else"... | Sets the issue actual hours.
@param actualHours the issue actual hours
@return CreateIssueParams instance | [
"Sets",
"the",
"issue",
"actual",
"hours",
"."
] | train | https://github.com/nulab/backlog4j/blob/862ae0586ad808b2ec413f665b8dfc0c9a107b4e/src/main/java/com/nulabinc/backlog4j/api/option/CreateIssueParams.java#L121-L128 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/search/aggregate/DBEntitySequenceFactory.java | DBEntitySequenceFactory.initializeScalarFields | void initializeScalarFields(DBEntity caller, List<String> scalarFields, DBEntitySequenceOptions options) {
"""
Fetches the scalar values of the specified entity.
Also fetches the scalar values of other entities to be returned by the iterators of the same category
Uses {@link #multiget_slice(List, ColumnParent, S... | java | void initializeScalarFields(DBEntity caller, List<String> scalarFields, DBEntitySequenceOptions options) {
TableDefinition tableDef = caller.getTableDef();
String category = toEntityCategory(tableDef.getTableName(), scalarFields);
LRUCache<ObjectID, Map<String, String>> cache = getScalarCache(category);
S... | [
"void",
"initializeScalarFields",
"(",
"DBEntity",
"caller",
",",
"List",
"<",
"String",
">",
"scalarFields",
",",
"DBEntitySequenceOptions",
"options",
")",
"{",
"TableDefinition",
"tableDef",
"=",
"caller",
".",
"getTableDef",
"(",
")",
";",
"String",
"category"... | Fetches the scalar values of the specified entity.
Also fetches the scalar values of other entities to be returned by the iterators of the same category
Uses {@link #multiget_slice(List, ColumnParent, SlicePredicate)} method with the 'slice list' parameter to perform bulk fetch
@param tableDef entity type
@param c... | [
"Fetches",
"the",
"scalar",
"values",
"of",
"the",
"specified",
"entity",
".",
"Also",
"fetches",
"the",
"scalar",
"values",
"of",
"other",
"entities",
"to",
"be",
"returned",
"by",
"the",
"iterators",
"of",
"the",
"same",
"category",
"Uses",
"{",
"@link",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/search/aggregate/DBEntitySequenceFactory.java#L130-L159 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_partitionName_quota_uid_GET | public OvhQuota serviceName_partition_partitionName_quota_uid_GET(String serviceName, String partitionName, Long uid) throws IOException {
"""
Get this object properties
REST: GET /dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}
@param serviceName [required] The internal name of your storage
... | java | public OvhQuota serviceName_partition_partitionName_quota_uid_GET(String serviceName, String partitionName, Long uid) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}";
StringBuilder sb = path(qPath, serviceName, partitionName, uid);
String resp = exec(qPath,... | [
"public",
"OvhQuota",
"serviceName_partition_partitionName_quota_uid_GET",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"Long",
"uid",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition/{partitionName}/quot... | Get this object properties
REST: GET /dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition
@param uid [required] the uid to set quota on | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L237-L242 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java | DefaultElementProducer.makeImageTranslucent | public static BufferedImage makeImageTranslucent(BufferedImage source, float opacity) {
"""
returns a transparent image when opacity < 1
@param source
@param opacity
@return
"""
if (opacity == 1) {
return source;
}
BufferedImage translucent = new BufferedImage(source.getWidth... | java | public static BufferedImage makeImageTranslucent(BufferedImage source, float opacity) {
if (opacity == 1) {
return source;
}
BufferedImage translucent = new BufferedImage(source.getWidth(), source.getHeight(), BufferedImage.TRANSLUCENT);
Graphics2D g = translucent.createGraphics();
... | [
"public",
"static",
"BufferedImage",
"makeImageTranslucent",
"(",
"BufferedImage",
"source",
",",
"float",
"opacity",
")",
"{",
"if",
"(",
"opacity",
"==",
"1",
")",
"{",
"return",
"source",
";",
"}",
"BufferedImage",
"translucent",
"=",
"new",
"BufferedImage",
... | returns a transparent image when opacity < 1
@param source
@param opacity
@return | [
"returns",
"a",
"transparent",
"image",
"when",
"opacity",
"<",
";",
"1"
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/DefaultElementProducer.java#L426-L436 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.newDeleteObjectRequest | public static Request newDeleteObjectRequest(Session session, String id, Callback callback) {
"""
Creates a new Request configured to delete a resource through the Graph API.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param id
the id of the object to dele... | java | public static Request newDeleteObjectRequest(Session session, String id, Callback callback) {
return new Request(session, id, null, HttpMethod.DELETE, callback);
} | [
"public",
"static",
"Request",
"newDeleteObjectRequest",
"(",
"Session",
"session",
",",
"String",
"id",
",",
"Callback",
"callback",
")",
"{",
"return",
"new",
"Request",
"(",
"session",
",",
"id",
",",
"null",
",",
"HttpMethod",
".",
"DELETE",
",",
"callba... | Creates a new Request configured to delete a resource through the Graph API.
@param session
the Session to use, or null; if non-null, the session must be in an opened state
@param id
the id of the object to delete
@param callback
a callback that will be called when the request is completed to handle success or error c... | [
"Creates",
"a",
"new",
"Request",
"configured",
"to",
"delete",
"a",
"resource",
"through",
"the",
"Graph",
"API",
"."
] | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L766-L768 |
apache/flink | flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/messages/MessageSerializer.java | MessageSerializer.serializeResponse | public static <RESP extends MessageBody> ByteBuf serializeResponse(
final ByteBufAllocator alloc,
final long requestId,
final RESP response) {
"""
Serializes the response sent to the
{@link org.apache.flink.queryablestate.network.Client}.
@param alloc The {@link ByteBufAllocator} used to allocate th... | java | public static <RESP extends MessageBody> ByteBuf serializeResponse(
final ByteBufAllocator alloc,
final long requestId,
final RESP response) {
Preconditions.checkNotNull(response);
return writePayload(alloc, requestId, MessageType.REQUEST_RESULT, response.serialize());
} | [
"public",
"static",
"<",
"RESP",
"extends",
"MessageBody",
">",
"ByteBuf",
"serializeResponse",
"(",
"final",
"ByteBufAllocator",
"alloc",
",",
"final",
"long",
"requestId",
",",
"final",
"RESP",
"response",
")",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"... | Serializes the response sent to the
{@link org.apache.flink.queryablestate.network.Client}.
@param alloc The {@link ByteBufAllocator} used to allocate the buffer to serialize the message into.
@param requestId The id of the request to which the message refers to.
@param response The response to be serialized.
@ret... | [
"Serializes",
"the",
"response",
"sent",
"to",
"the",
"{",
"@link",
"org",
".",
"apache",
".",
"flink",
".",
"queryablestate",
".",
"network",
".",
"Client",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-queryable-state/flink-queryable-state-client-java/src/main/java/org/apache/flink/queryablestate/network/messages/MessageSerializer.java#L108-L114 |
demidenko05/beigesoft-orm | src/main/java/org/beigesoft/orm/service/ASrvOrm.java | ASrvOrm.retrieveList | @Override
public final <T> List<T> retrieveList(
final Map<String, Object> pAddParam,
final Class<T> pEntityClass) throws Exception {
"""
<p>Retrieve a list of all entities.</p>
@param <T> - type of business object,
@param pAddParam additional param, e.g. already retrieved TableSql
@param pEntityCla... | java | @Override
public final <T> List<T> retrieveList(
final Map<String, Object> pAddParam,
final Class<T> pEntityClass) throws Exception {
String query = evalSqlSelect(pAddParam, pEntityClass) + ";\n";
return retrieveListByQuery(pAddParam, pEntityClass, query);
} | [
"@",
"Override",
"public",
"final",
"<",
"T",
">",
"List",
"<",
"T",
">",
"retrieveList",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"pAddParam",
",",
"final",
"Class",
"<",
"T",
">",
"pEntityClass",
")",
"throws",
"Exception",
"{",
"Strin... | <p>Retrieve a list of all entities.</p>
@param <T> - type of business object,
@param pAddParam additional param, e.g. already retrieved TableSql
@param pEntityClass entity class
@return list of all business objects or empty list, not null
@throws Exception - an exception | [
"<p",
">",
"Retrieve",
"a",
"list",
"of",
"all",
"entities",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/demidenko05/beigesoft-orm/blob/f1b2c70701a111741a436911ca24ef9d38eba0b9/src/main/java/org/beigesoft/orm/service/ASrvOrm.java#L338-L344 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/lang/Validator.java | Validator.validateIpv4 | public static <T extends CharSequence> T validateIpv4(T value, String errorMsg) throws ValidateException {
"""
验证是否为IPV4地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常
"""
if (false == isIpv4(value)) {
throw new ValidateException(errorMsg);
... | java | public static <T extends CharSequence> T validateIpv4(T value, String errorMsg) throws ValidateException {
if (false == isIpv4(value)) {
throw new ValidateException(errorMsg);
}
return value;
} | [
"public",
"static",
"<",
"T",
"extends",
"CharSequence",
">",
"T",
"validateIpv4",
"(",
"T",
"value",
",",
"String",
"errorMsg",
")",
"throws",
"ValidateException",
"{",
"if",
"(",
"false",
"==",
"isIpv4",
"(",
"value",
")",
")",
"{",
"throw",
"new",
"Va... | 验证是否为IPV4地址
@param <T> 字符串类型
@param value 值
@param errorMsg 验证错误的信息
@return 验证后的值
@throws ValidateException 验证异常 | [
"验证是否为IPV4地址"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Validator.java#L809-L814 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/VoronoiDraw.java | VoronoiDraw.drawFakeVoronoi | public static SVGPath drawFakeVoronoi(Projection2D proj, List<double[]> means) {
"""
Fake Voronoi diagram. For two means only
@param proj Projection
@param means Mean vectors
@return SVG path
"""
CanvasSize viewport = proj.estimateViewport();
final SVGPath path = new SVGPath();
// Difference
... | java | public static SVGPath drawFakeVoronoi(Projection2D proj, List<double[]> means) {
CanvasSize viewport = proj.estimateViewport();
final SVGPath path = new SVGPath();
// Difference
final double[] dirv = VMath.minus(means.get(1), means.get(0));
VMath.rotate90Equals(dirv);
double[] dir = proj.fastPro... | [
"public",
"static",
"SVGPath",
"drawFakeVoronoi",
"(",
"Projection2D",
"proj",
",",
"List",
"<",
"double",
"[",
"]",
">",
"means",
")",
"{",
"CanvasSize",
"viewport",
"=",
"proj",
".",
"estimateViewport",
"(",
")",
";",
"final",
"SVGPath",
"path",
"=",
"ne... | Fake Voronoi diagram. For two means only
@param proj Projection
@param means Mean vectors
@return SVG path | [
"Fake",
"Voronoi",
"diagram",
".",
"For",
"two",
"means",
"only"
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/svg/VoronoiDraw.java#L150-L170 |
OpenLiberty/open-liberty | dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/DataModelSerializer.java | DataModelSerializer.serializeAsJson | public static JsonValue serializeAsJson(Object o) throws IOException {
"""
Convert a POJO into a serialized JsonValue object
@param o the POJO to serialize
@return
"""
try {
return findFieldsToSerialize(o).mainObject;
} catch (IllegalStateException ise) {
// the refl... | java | public static JsonValue serializeAsJson(Object o) throws IOException {
try {
return findFieldsToSerialize(o).mainObject;
} catch (IllegalStateException ise) {
// the reflective attempt to build the object failed.
throw new IOException("Unable to build JSON for Object"... | [
"public",
"static",
"JsonValue",
"serializeAsJson",
"(",
"Object",
"o",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"findFieldsToSerialize",
"(",
"o",
")",
".",
"mainObject",
";",
"}",
"catch",
"(",
"IllegalStateException",
"ise",
")",
"{",
"// th... | Convert a POJO into a serialized JsonValue object
@param o the POJO to serialize
@return | [
"Convert",
"a",
"POJO",
"into",
"a",
"serialized",
"JsonValue",
"object"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.repository/src/com/ibm/ws/repository/transport/client/DataModelSerializer.java#L349-L358 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerHttpClient.java | CircuitBreakerHttpClient.newDecorator | public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategy strategy) {
"""
Creates a new decorator with the specified {@link CircuitBreakerMapping} and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreaker}... | java | public static Function<Client<HttpRequest, HttpResponse>, CircuitBreakerHttpClient>
newDecorator(CircuitBreakerMapping mapping, CircuitBreakerStrategy strategy) {
return delegate -> new CircuitBreakerHttpClient(delegate, mapping, strategy);
} | [
"public",
"static",
"Function",
"<",
"Client",
"<",
"HttpRequest",
",",
"HttpResponse",
">",
",",
"CircuitBreakerHttpClient",
">",
"newDecorator",
"(",
"CircuitBreakerMapping",
"mapping",
",",
"CircuitBreakerStrategy",
"strategy",
")",
"{",
"return",
"delegate",
"->",... | Creates a new decorator with the specified {@link CircuitBreakerMapping} and
{@link CircuitBreakerStrategy}.
<p>Since {@link CircuitBreaker} is a unit of failure detection, don't reuse the same instance for
unrelated services. | [
"Creates",
"a",
"new",
"decorator",
"with",
"the",
"specified",
"{",
"@link",
"CircuitBreakerMapping",
"}",
"and",
"{",
"@link",
"CircuitBreakerStrategy",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/circuitbreaker/CircuitBreakerHttpClient.java#L53-L56 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/PersistenceDelegator.java | PersistenceDelegator.findById | public <E> E findById(final Class<E> entityClass, final Object primaryKey) {
"""
Find object based on primary key either form persistence cache or from
database
@param entityClass
@param primaryKey
@return
"""
E e = find(entityClass, primaryKey);
if (e == null)
{
retur... | java | public <E> E findById(final Class<E> entityClass, final Object primaryKey)
{
E e = find(entityClass, primaryKey);
if (e == null)
{
return null;
}
// Return a copy of this entity
return (E) (e);
} | [
"public",
"<",
"E",
">",
"E",
"findById",
"(",
"final",
"Class",
"<",
"E",
">",
"entityClass",
",",
"final",
"Object",
"primaryKey",
")",
"{",
"E",
"e",
"=",
"find",
"(",
"entityClass",
",",
"primaryKey",
")",
";",
"if",
"(",
"e",
"==",
"null",
")"... | Find object based on primary key either form persistence cache or from
database
@param entityClass
@param primaryKey
@return | [
"Find",
"object",
"based",
"on",
"primary",
"key",
"either",
"form",
"persistence",
"cache",
"or",
"from",
"database"
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/persistence/PersistenceDelegator.java#L172-L182 |
openengsb/openengsb | ports/jms/src/main/java/org/openengsb/ports/jms/DestinationUrl.java | DestinationUrl.createDestinationUrl | public static DestinationUrl createDestinationUrl(String destination) {
"""
Creates an instance of an connection URL based on an destination string. In case that the destination string does
not match the form HOST?QUEUE||TOPIC an IllegalArgumentException is thrown.
"""
String[] split = splitDestinatio... | java | public static DestinationUrl createDestinationUrl(String destination) {
String[] split = splitDestination(destination);
String host = split[0].trim();
String jmsDestination = split[1].trim();
return new DestinationUrl(host, jmsDestination);
} | [
"public",
"static",
"DestinationUrl",
"createDestinationUrl",
"(",
"String",
"destination",
")",
"{",
"String",
"[",
"]",
"split",
"=",
"splitDestination",
"(",
"destination",
")",
";",
"String",
"host",
"=",
"split",
"[",
"0",
"]",
".",
"trim",
"(",
")",
... | Creates an instance of an connection URL based on an destination string. In case that the destination string does
not match the form HOST?QUEUE||TOPIC an IllegalArgumentException is thrown. | [
"Creates",
"an",
"instance",
"of",
"an",
"connection",
"URL",
"based",
"on",
"an",
"destination",
"string",
".",
"In",
"case",
"that",
"the",
"destination",
"string",
"does",
"not",
"match",
"the",
"form",
"HOST?QUEUE||TOPIC",
"an",
"IllegalArgumentException",
"... | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/ports/jms/src/main/java/org/openengsb/ports/jms/DestinationUrl.java#L34-L39 |
Azure/azure-sdk-for-java | recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupEnginesInner.java | BackupEnginesInner.listAsync | public Observable<Page<BackupEngineBaseResourceInner>> listAsync(final String vaultName, final String resourceGroupName) {
"""
Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers.
@param vaultName The name of the recovery services vault.
@param resourceGroupName ... | java | public Observable<Page<BackupEngineBaseResourceInner>> listAsync(final String vaultName, final String resourceGroupName) {
return listWithServiceResponseAsync(vaultName, resourceGroupName)
.map(new Func1<ServiceResponse<Page<BackupEngineBaseResourceInner>>, Page<BackupEngineBaseResourceInner>>() {
... | [
"public",
"Observable",
"<",
"Page",
"<",
"BackupEngineBaseResourceInner",
">",
">",
"listAsync",
"(",
"final",
"String",
"vaultName",
",",
"final",
"String",
"resourceGroupName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"vaultName",
",",
"resourceGrou... | Backup management servers registered to Recovery Services Vault. Returns a pageable list of servers.
@param vaultName The name of the recovery services vault.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@throws IllegalArgumentException thrown if parameters fail... | [
"Backup",
"management",
"servers",
"registered",
"to",
"Recovery",
"Services",
"Vault",
".",
"Returns",
"a",
"pageable",
"list",
"of",
"servers",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices.backup/resource-manager/v2017_07_01/src/main/java/com/microsoft/azure/management/recoveryservices/backup/v2017_07_01/implementation/BackupEnginesInner.java#L123-L131 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java | ApiOvhDedicatednas.serviceName_partition_partitionName_quota_uid_DELETE | public OvhTask serviceName_partition_partitionName_quota_uid_DELETE(String serviceName, String partitionName, Long uid) throws IOException {
"""
Delete a given quota
REST: DELETE /dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}
@param serviceName [required] The internal name of your storage
... | java | public OvhTask serviceName_partition_partitionName_quota_uid_DELETE(String serviceName, String partitionName, Long uid) throws IOException {
String qPath = "/dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}";
StringBuilder sb = path(qPath, serviceName, partitionName, uid);
String resp = exec(qPat... | [
"public",
"OvhTask",
"serviceName_partition_partitionName_quota_uid_DELETE",
"(",
"String",
"serviceName",
",",
"String",
"partitionName",
",",
"Long",
"uid",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/nas/{serviceName}/partition/{partitionName}/qu... | Delete a given quota
REST: DELETE /dedicated/nas/{serviceName}/partition/{partitionName}/quota/{uid}
@param serviceName [required] The internal name of your storage
@param partitionName [required] the given name of partition
@param uid [required] the uid to set quota on | [
"Delete",
"a",
"given",
"quota"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatednas/src/main/java/net/minidev/ovh/api/ApiOvhDedicatednas.java#L252-L257 |
phax/ph-javacc-maven-plugin | src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java | JJDocMojo.executeReport | @Override
public void executeReport (final Locale locale) throws MavenReportException {
"""
Run the actual report.
@param locale
The locale to use for this report.
@throws MavenReportException
If the report generation failed.
"""
final Sink sink = getSink ();
createReportHeader (getBundle (loc... | java | @Override
public void executeReport (final Locale locale) throws MavenReportException
{
final Sink sink = getSink ();
createReportHeader (getBundle (locale), sink);
final File [] sourceDirs = getSourceDirectories ();
for (final File sourceDir : sourceDirs)
{
final GrammarInfo [] grammarI... | [
"@",
"Override",
"public",
"void",
"executeReport",
"(",
"final",
"Locale",
"locale",
")",
"throws",
"MavenReportException",
"{",
"final",
"Sink",
"sink",
"=",
"getSink",
"(",
")",
";",
"createReportHeader",
"(",
"getBundle",
"(",
"locale",
")",
",",
"sink",
... | Run the actual report.
@param locale
The locale to use for this report.
@throws MavenReportException
If the report generation failed. | [
"Run",
"the",
"actual",
"report",
"."
] | train | https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JJDocMojo.java#L337-L386 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/ConnectApi.java | ConnectApi.listUsers | public IntegratedUserInfoList listUsers(String accountId, String connectId) throws ApiException {
"""
Returns users from the configured Connect service.
Returns users from the configured Connect service.
@param accountId The external account number (int) or account ID Guid. (required)
@param connectId The ID of... | java | public IntegratedUserInfoList listUsers(String accountId, String connectId) throws ApiException {
return listUsers(accountId, connectId, null);
} | [
"public",
"IntegratedUserInfoList",
"listUsers",
"(",
"String",
"accountId",
",",
"String",
"connectId",
")",
"throws",
"ApiException",
"{",
"return",
"listUsers",
"(",
"accountId",
",",
"connectId",
",",
"null",
")",
";",
"}"
] | Returns users from the configured Connect service.
Returns users from the configured Connect service.
@param accountId The external account number (int) or account ID Guid. (required)
@param connectId The ID of the custom Connect configuration being accessed. (required)
@return IntegratedUserInfoList | [
"Returns",
"users",
"from",
"the",
"configured",
"Connect",
"service",
".",
"Returns",
"users",
"from",
"the",
"configured",
"Connect",
"service",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/ConnectApi.java#L698-L700 |
alkacon/opencms-core | src/org/opencms/db/CmsDriverManager.java | CmsDriverManager.addResourceToOrgUnit | public void addResourceToOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource)
throws CmsException {
"""
Adds a resource to the given organizational unit.<p>
@param dbc the current db context
@param orgUnit the organizational unit to add the resource to
@param resource the resourc... | java | public void addResourceToOrgUnit(CmsDbContext dbc, CmsOrganizationalUnit orgUnit, CmsResource resource)
throws CmsException {
m_monitor.flushCache(CmsMemoryMonitor.CacheType.HAS_ROLE, CmsMemoryMonitor.CacheType.ROLE_LIST);
getUserDriver(dbc).addResourceToOrganizationalUnit(dbc, orgUnit, resource);
... | [
"public",
"void",
"addResourceToOrgUnit",
"(",
"CmsDbContext",
"dbc",
",",
"CmsOrganizationalUnit",
"orgUnit",
",",
"CmsResource",
"resource",
")",
"throws",
"CmsException",
"{",
"m_monitor",
".",
"flushCache",
"(",
"CmsMemoryMonitor",
".",
"CacheType",
".",
"HAS_ROLE... | Adds a resource to the given organizational unit.<p>
@param dbc the current db context
@param orgUnit the organizational unit to add the resource to
@param resource the resource that is to be added to the organizational unit
@throws CmsException if something goes wrong
@see org.opencms.security.CmsOrgUnitManager#add... | [
"Adds",
"a",
"resource",
"to",
"the",
"given",
"organizational",
"unit",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsDriverManager.java#L621-L626 |
Dempsy/dempsy | dempsy-framework.impl/src/main/java/net/dempsy/transport/blockingqueue/BlockingQueueReceiver.java | BlockingQueueReceiver.start | @SuppressWarnings( {
"""
A BlockingQueueAdaptor requires a MessageTransportListener to be set in order to adapt a client side.
@param listener
is the MessageTransportListener to push messages to when they come in.
""" "rawtypes", "unchecked" })
@Override
public synchronized void start(final Listene... | java | @SuppressWarnings({ "rawtypes", "unchecked" })
@Override
public synchronized void start(final Listener listener, final Infrastructure infra) {
if (listener == null)
throw new IllegalArgumentException("Cannot pass null to " + BlockingQueueReceiver.class.getSimpleName() + ".setListener");
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"@",
"Override",
"public",
"synchronized",
"void",
"start",
"(",
"final",
"Listener",
"listener",
",",
"final",
"Infrastructure",
"infra",
")",
"{",
"if",
"(",
"listener",
"==",... | A BlockingQueueAdaptor requires a MessageTransportListener to be set in order to adapt a client side.
@param listener
is the MessageTransportListener to push messages to when they come in. | [
"A",
"BlockingQueueAdaptor",
"requires",
"a",
"MessageTransportListener",
"to",
"be",
"set",
"in",
"order",
"to",
"adapt",
"a",
"client",
"side",
"."
] | train | https://github.com/Dempsy/dempsy/blob/cd3415b51b6787a6a9d9589b15f00ce674b6f113/dempsy-framework.impl/src/main/java/net/dempsy/transport/blockingqueue/BlockingQueueReceiver.java#L120-L131 |
EdwardRaff/JSAT | JSAT/src/jsat/DataSet.java | DataSet.setNumericName | public boolean setNumericName(String name, int i) {
"""
Sets the unique name associated with the <tt>i</tt>'th numeric attribute. All strings will be converted to lower case first.
@param name the name to use
@param i the <tt>i</tt>th attribute.
@return <tt>true</tt> if the value was set, <tt>false</tt> if it... | java | public boolean setNumericName(String name, int i)
{
if(i < getNumNumericalVars() && i >= 0)
numericalVariableNames.put(i, name);
else
return false;
return true;
} | [
"public",
"boolean",
"setNumericName",
"(",
"String",
"name",
",",
"int",
"i",
")",
"{",
"if",
"(",
"i",
"<",
"getNumNumericalVars",
"(",
")",
"&&",
"i",
">=",
"0",
")",
"numericalVariableNames",
".",
"put",
"(",
"i",
",",
"name",
")",
";",
"else",
"... | Sets the unique name associated with the <tt>i</tt>'th numeric attribute. All strings will be converted to lower case first.
@param name the name to use
@param i the <tt>i</tt>th attribute.
@return <tt>true</tt> if the value was set, <tt>false</tt> if it was not set because an invalid index was given . | [
"Sets",
"the",
"unique",
"name",
"associated",
"with",
"the",
"<tt",
">",
"i<",
"/",
"tt",
">",
"th",
"numeric",
"attribute",
".",
"All",
"strings",
"will",
"be",
"converted",
"to",
"lower",
"case",
"first",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/DataSet.java#L133-L141 |
brettonw/Bag | src/main/java/com/brettonw/bag/Bag.java | Bag.getInteger | public Integer getInteger (String key, Supplier<Integer> notFound) {
"""
Retrieve a mapped element and return it as an Integer.
@param key A string value used to index the element.
@param notFound A function to create a new Integer if the requested key was not found
@return The element as an Integer, or notFo... | java | public Integer getInteger (String key, Supplier<Integer> notFound) {
return getParsed (key, Integer::new, notFound);
} | [
"public",
"Integer",
"getInteger",
"(",
"String",
"key",
",",
"Supplier",
"<",
"Integer",
">",
"notFound",
")",
"{",
"return",
"getParsed",
"(",
"key",
",",
"Integer",
"::",
"new",
",",
"notFound",
")",
";",
"}"
] | Retrieve a mapped element and return it as an Integer.
@param key A string value used to index the element.
@param notFound A function to create a new Integer if the requested key was not found
@return The element as an Integer, or notFound if the element is not found. | [
"Retrieve",
"a",
"mapped",
"element",
"and",
"return",
"it",
"as",
"an",
"Integer",
"."
] | train | https://github.com/brettonw/Bag/blob/25c0ff74893b6c9a2c61bf0f97189ab82e0b2f56/src/main/java/com/brettonw/bag/Bag.java#L208-L210 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/SocketOutputStream.java | SocketOutputStream.socketWrite | private void socketWrite(byte b[], int off, int len) throws IOException {
"""
Writes to the socket with appropriate locking of the
FileDescriptor.
@param b the data to be written
@param off the start offset in the data
@param len the number of bytes that are written
@exception IOException If an I/O error has ... | java | private void socketWrite(byte b[], int off, int len) throws IOException {
if (len <= 0 || off < 0 || off + len > b.length) {
if (len == 0) {
return;
}
throw new ArrayIndexOutOfBoundsException();
}
Object traceContext = IoTrace.socketWriteBegi... | [
"private",
"void",
"socketWrite",
"(",
"byte",
"b",
"[",
"]",
",",
"int",
"off",
",",
"int",
"len",
")",
"throws",
"IOException",
"{",
"if",
"(",
"len",
"<=",
"0",
"||",
"off",
"<",
"0",
"||",
"off",
"+",
"len",
">",
"b",
".",
"length",
")",
"{... | Writes to the socket with appropriate locking of the
FileDescriptor.
@param b the data to be written
@param off the start offset in the data
@param len the number of bytes that are written
@exception IOException If an I/O error has occurred. | [
"Writes",
"to",
"the",
"socket",
"with",
"appropriate",
"locking",
"of",
"the",
"FileDescriptor",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/net/SocketOutputStream.java#L98-L127 |
bcecchinato/spring-postinitialize | src/main/java/fr/zebasto/spring/post/initialize/PostInitializeProcessor.java | PostInitializeProcessor.initializeAnnotations | private void initializeAnnotations() {
"""
Bean processor for methods annotated with {@link PostInitialize}
@since 1.0.0
"""
this.applicationContext.getBeansOfType(null, false, false).values()
.stream()
.filter(Objects::nonNull)
.forEach(bean -> Reflec... | java | private void initializeAnnotations() {
this.applicationContext.getBeansOfType(null, false, false).values()
.stream()
.filter(Objects::nonNull)
.forEach(bean -> ReflectionUtils.doWithMethods(bean.getClass(), method -> {
int order = AnnotationUti... | [
"private",
"void",
"initializeAnnotations",
"(",
")",
"{",
"this",
".",
"applicationContext",
".",
"getBeansOfType",
"(",
"null",
",",
"false",
",",
"false",
")",
".",
"values",
"(",
")",
".",
"stream",
"(",
")",
".",
"filter",
"(",
"Objects",
"::",
"non... | Bean processor for methods annotated with {@link PostInitialize}
@since 1.0.0 | [
"Bean",
"processor",
"for",
"methods",
"annotated",
"with",
"{",
"@link",
"PostInitialize",
"}"
] | train | https://github.com/bcecchinato/spring-postinitialize/blob/5acd221a6aac8f03cbad63205e3157b0aeaf4bba/src/main/java/fr/zebasto/spring/post/initialize/PostInitializeProcessor.java#L71-L79 |
roboconf/roboconf-platform | core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/UserDataHelper.java | UserDataHelper.findParametersFromUrl | public AgentProperties findParametersFromUrl( String url, Logger logger ) {
"""
Retrieve the agent's configuration from an URL.
@param logger a logger
@return the agent's data, or null if they could not be parsed
"""
logger.info( "User data are being retrieved from URL: " + url );
AgentProperties result... | java | public AgentProperties findParametersFromUrl( String url, Logger logger ) {
logger.info( "User data are being retrieved from URL: " + url );
AgentProperties result = null;
try {
URI uri = UriUtils.urlToUri( url );
Properties props = new Properties();
InputStream in = null;
try {
in = uri.toURL().... | [
"public",
"AgentProperties",
"findParametersFromUrl",
"(",
"String",
"url",
",",
"Logger",
"logger",
")",
"{",
"logger",
".",
"info",
"(",
"\"User data are being retrieved from URL: \"",
"+",
"url",
")",
";",
"AgentProperties",
"result",
"=",
"null",
";",
"try",
"... | Retrieve the agent's configuration from an URL.
@param logger a logger
@return the agent's data, or null if they could not be parsed | [
"Retrieve",
"the",
"agent",
"s",
"configuration",
"from",
"an",
"URL",
"."
] | train | https://github.com/roboconf/roboconf-platform/blob/add54eead479effb138d0ff53a2d637902b82702/core/roboconf-agent/src/main/java/net/roboconf/agent/internal/misc/UserDataHelper.java#L213-L237 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.cart_cartId_PUT | public OvhCart cart_cartId_PUT(String cartId, String description, Date expire) throws IOException {
"""
Modify information about a specific cart
REST: PUT /order/cart/{cartId}
@param cartId [required] Cart identifier
@param description [required] Description of your cart
@param expire [required] Time of expi... | java | public OvhCart cart_cartId_PUT(String cartId, String description, Date expire) throws IOException {
String qPath = "/order/cart/{cartId}";
StringBuilder sb = path(qPath, cartId);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description);
addBody(o, "expire", expire);
S... | [
"public",
"OvhCart",
"cart_cartId_PUT",
"(",
"String",
"cartId",
",",
"String",
"description",
",",
"Date",
"expire",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/cart/{cartId}\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",... | Modify information about a specific cart
REST: PUT /order/cart/{cartId}
@param cartId [required] Cart identifier
@param description [required] Description of your cart
@param expire [required] Time of expiration of the cart | [
"Modify",
"information",
"about",
"a",
"specific",
"cart"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L8856-L8864 |
google/closure-compiler | src/com/google/javascript/jscomp/DataFlowAnalysis.java | DataFlowAnalysis.computeEscaped | static void computeEscaped(
final Scope jsScope,
final Set<Var> escaped,
AbstractCompiler compiler,
Es6SyntacticScopeCreator scopeCreator) {
"""
Compute set of escaped variables. When a variable is escaped in a dataflow analysis, it can be
referenced outside of the code that we are analyzi... | java | static void computeEscaped(
final Scope jsScope,
final Set<Var> escaped,
AbstractCompiler compiler,
Es6SyntacticScopeCreator scopeCreator) {
checkArgument(jsScope.isFunctionScope());
AbstractPostOrderCallback finder =
new AbstractPostOrderCallback() {
@Override
... | [
"static",
"void",
"computeEscaped",
"(",
"final",
"Scope",
"jsScope",
",",
"final",
"Set",
"<",
"Var",
">",
"escaped",
",",
"AbstractCompiler",
"compiler",
",",
"Es6SyntacticScopeCreator",
"scopeCreator",
")",
"{",
"checkArgument",
"(",
"jsScope",
".",
"isFunction... | Compute set of escaped variables. When a variable is escaped in a dataflow analysis, it can be
referenced outside of the code that we are analyzing. A variable is escaped if any of the
following is true:
1. Exported variables as they can be needed after the script terminates.
2. Names of named functions because in Jav... | [
"Compute",
"set",
"of",
"escaped",
"variables",
".",
"When",
"a",
"variable",
"is",
"escaped",
"in",
"a",
"dataflow",
"analysis",
"it",
"can",
"be",
"referenced",
"outside",
"of",
"the",
"code",
"that",
"we",
"are",
"analyzing",
".",
"A",
"variable",
"is",... | train | https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/DataFlowAnalysis.java#L535-L580 |
segmentio/analytics-android | analytics/src/main/java/com/segment/analytics/ValueMap.java | ValueMap.getFloat | public float getFloat(String key, float defaultValue) {
"""
Returns the value mapped by {@code key} if it exists and is a float or can be coerced to a
float. Returns {@code defaultValue} otherwise.
"""
Object value = get(key);
return Utils.coerceToFloat(value, defaultValue);
} | java | public float getFloat(String key, float defaultValue) {
Object value = get(key);
return Utils.coerceToFloat(value, defaultValue);
} | [
"public",
"float",
"getFloat",
"(",
"String",
"key",
",",
"float",
"defaultValue",
")",
"{",
"Object",
"value",
"=",
"get",
"(",
"key",
")",
";",
"return",
"Utils",
".",
"coerceToFloat",
"(",
"value",
",",
"defaultValue",
")",
";",
"}"
] | Returns the value mapped by {@code key} if it exists and is a float or can be coerced to a
float. Returns {@code defaultValue} otherwise. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{"
] | train | https://github.com/segmentio/analytics-android/blob/93c7d5bb09b593440a2347a6089db3e9f74012da/analytics/src/main/java/com/segment/analytics/ValueMap.java#L215-L218 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Streams.java | Streams.composeWithExceptions | static Runnable composeWithExceptions(Runnable a, Runnable b) {
"""
Given two Runnables, return a Runnable that executes both in sequence,
even if the first throws an exception, and if both throw exceptions, add
any exceptions thrown by the second as suppressed exceptions of the first.
"""
return new... | java | static Runnable composeWithExceptions(Runnable a, Runnable b) {
return new Runnable() {
@Override
public void run() {
try {
a.run();
}
catch (Throwable e1) {
try {
b.run();
... | [
"static",
"Runnable",
"composeWithExceptions",
"(",
"Runnable",
"a",
",",
"Runnable",
"b",
")",
"{",
"return",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"public",
"void",
"run",
"(",
")",
"{",
"try",
"{",
"a",
".",
"run",
"(",
")",
";",
"}",... | Given two Runnables, return a Runnable that executes both in sequence,
even if the first throws an exception, and if both throw exceptions, add
any exceptions thrown by the second as suppressed exceptions of the first. | [
"Given",
"two",
"Runnables",
"return",
"a",
"Runnable",
"that",
"executes",
"both",
"in",
"sequence",
"even",
"if",
"the",
"first",
"throws",
"an",
"exception",
"and",
"if",
"both",
"throw",
"exceptions",
"add",
"any",
"exceptions",
"thrown",
"by",
"the",
"s... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/stream/Streams.java#L845-L866 |
Azure/azure-sdk-for-java | datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java | VirtualNetworkRulesInner.createOrUpdate | public VirtualNetworkRuleInner createOrUpdate(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) {
"""
Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be repl... | java | public VirtualNetworkRuleInner createOrUpdate(String resourceGroupName, String accountName, String virtualNetworkRuleName, CreateOrUpdateVirtualNetworkRuleParameters parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, accountName, virtualNetworkRuleName, parameters).toBlocking().singl... | [
"public",
"VirtualNetworkRuleInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"virtualNetworkRuleName",
",",
"CreateOrUpdateVirtualNetworkRuleParameters",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceRespons... | Creates or updates the specified virtual network rule. During update, the virtual network rule with the specified name will be replaced with this new virtual network rule.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Store account.
@param virtualNetworkRul... | [
"Creates",
"or",
"updates",
"the",
"specified",
"virtual",
"network",
"rule",
".",
"During",
"update",
"the",
"virtual",
"network",
"rule",
"with",
"the",
"specified",
"name",
"will",
"be",
"replaced",
"with",
"this",
"new",
"virtual",
"network",
"rule",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakestore/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakestore/v2016_11_01/implementation/VirtualNetworkRulesInner.java#L228-L230 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.mp.jwt_fat_tck/fat/src/org/eclipse/microprofile/jwt/tck/util/TokenUtils.java | TokenUtils.generateTokenString | public static String generateTokenString(String jsonResName, Set<InvalidClaims> invalidClaims) throws Exception {
"""
Utility method to generate a JWT string from a JSON resource file that is signed by the privateKey.pem
test resource key, possibly with invalid fields.
@param jsonResName - name of test resourc... | java | public static String generateTokenString(String jsonResName, Set<InvalidClaims> invalidClaims) throws Exception {
return generateTokenString(jsonResName, invalidClaims, null);
} | [
"public",
"static",
"String",
"generateTokenString",
"(",
"String",
"jsonResName",
",",
"Set",
"<",
"InvalidClaims",
">",
"invalidClaims",
")",
"throws",
"Exception",
"{",
"return",
"generateTokenString",
"(",
"jsonResName",
",",
"invalidClaims",
",",
"null",
")",
... | Utility method to generate a JWT string from a JSON resource file that is signed by the privateKey.pem
test resource key, possibly with invalid fields.
@param jsonResName - name of test resources file
@param invalidClaims - the set of claims that should be added with invalid values to test failure modes
@return the JW... | [
"Utility",
"method",
"to",
"generate",
"a",
"JWT",
"string",
"from",
"a",
"JSON",
"resource",
"file",
"that",
"is",
"signed",
"by",
"the",
"privateKey",
".",
"pem",
"test",
"resource",
"key",
"possibly",
"with",
"invalid",
"fields",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.mp.jwt_fat_tck/fat/src/org/eclipse/microprofile/jwt/tck/util/TokenUtils.java#L81-L83 |
cerner/beadledom | jackson/src/main/java/com/cerner/beadledom/jackson/filter/FieldFilter.java | FieldFilter.writeJson | public void writeJson(JsonParser parser, JsonGenerator jgen) throws IOException {
"""
Writes the json from the parser onto the generator, using the filters to only write the objects
specified.
@param parser JsonParser that is created from a Jackson utility (i.e. ObjectMapper)
@param jgen JsonGenerator that is... | java | public void writeJson(JsonParser parser, JsonGenerator jgen) throws IOException {
checkNotNull(parser, "JsonParser cannot be null for writeJson.");
checkNotNull(jgen, "JsonGenerator cannot be null for writeJson.");
JsonToken curToken = parser.nextToken();
while (curToken != null) {
curToken = proc... | [
"public",
"void",
"writeJson",
"(",
"JsonParser",
"parser",
",",
"JsonGenerator",
"jgen",
")",
"throws",
"IOException",
"{",
"checkNotNull",
"(",
"parser",
",",
"\"JsonParser cannot be null for writeJson.\"",
")",
";",
"checkNotNull",
"(",
"jgen",
",",
"\"JsonGenerato... | Writes the json from the parser onto the generator, using the filters to only write the objects
specified.
@param parser JsonParser that is created from a Jackson utility (i.e. ObjectMapper)
@param jgen JsonGenerator that is used for writing json onto an underlying stream
@throws JsonGenerationException exception if J... | [
"Writes",
"the",
"json",
"from",
"the",
"parser",
"onto",
"the",
"generator",
"using",
"the",
"filters",
"to",
"only",
"write",
"the",
"objects",
"specified",
"."
] | train | https://github.com/cerner/beadledom/blob/75435bced5187d5455b46518fadf85c93cf32014/jackson/src/main/java/com/cerner/beadledom/jackson/filter/FieldFilter.java#L145-L153 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/Request.java | Request.executePlacesSearchRequestAsync | @Deprecated
public static RequestAsyncTask executePlacesSearchRequestAsync(Session session, Location location,
int radiusInMeters, int resultsLimit, String searchText, GraphPlaceListCallback callback) {
"""
Starts a new Request that is configured to perform a search for places near a specified loca... | java | @Deprecated
public static RequestAsyncTask executePlacesSearchRequestAsync(Session session, Location location,
int radiusInMeters, int resultsLimit, String searchText, GraphPlaceListCallback callback) {
return newPlacesSearchRequest(session, location, radiusInMeters, resultsLimit, searchText, ca... | [
"@",
"Deprecated",
"public",
"static",
"RequestAsyncTask",
"executePlacesSearchRequestAsync",
"(",
"Session",
"session",
",",
"Location",
"location",
",",
"int",
"radiusInMeters",
",",
"int",
"resultsLimit",
",",
"String",
"searchText",
",",
"GraphPlaceListCallback",
"c... | Starts a new Request that is configured to perform a search for places near a specified location via the Graph
API.
<p/>
This should only be called from the UI thread.
This method is deprecated. Prefer to call Request.newPlacesSearchRequest(...).executeAsync();
@param session
the Session to use, or null; if non-null,... | [
"Starts",
"a",
"new",
"Request",
"that",
"is",
"configured",
"to",
"perform",
"a",
"search",
"for",
"places",
"near",
"a",
"specified",
"location",
"via",
"the",
"Graph",
"API",
".",
"<p",
"/",
">",
"This",
"should",
"only",
"be",
"called",
"from",
"the"... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/Request.java#L1222-L1227 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java | TypeQualifierApplications.getInheritedTypeQualifierAnnotation | public static @CheckForNull
TypeQualifierAnnotation getInheritedTypeQualifierAnnotation(XMethod xmethod, int parameter,
TypeQualifierValue<?> typeQualifierValue) {
"""
Get the effective inherited TypeQualifierAnnotation on the given instance
method parameter.
@param xmethod
an instance method
... | java | public static @CheckForNull
TypeQualifierAnnotation getInheritedTypeQualifierAnnotation(XMethod xmethod, int parameter,
TypeQualifierValue<?> typeQualifierValue) {
assert !xmethod.isStatic();
ParameterAnnotationAccumulator accumulator = new ParameterAnnotationAccumulator(typeQualifierVa... | [
"public",
"static",
"@",
"CheckForNull",
"TypeQualifierAnnotation",
"getInheritedTypeQualifierAnnotation",
"(",
"XMethod",
"xmethod",
",",
"int",
"parameter",
",",
"TypeQualifierValue",
"<",
"?",
">",
"typeQualifierValue",
")",
"{",
"assert",
"!",
"xmethod",
".",
"isS... | Get the effective inherited TypeQualifierAnnotation on the given instance
method parameter.
@param xmethod
an instance method
@param parameter
a parameter (0 == first parameter)
@param typeQualifierValue
the kind of TypeQualifierValue we are looking for
@return effective inherited TypeQualifierAnnotation on the parame... | [
"Get",
"the",
"effective",
"inherited",
"TypeQualifierAnnotation",
"on",
"the",
"given",
"instance",
"method",
"parameter",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/jsr305/TypeQualifierApplications.java#L952-L969 |
allcolor/YaHP-Converter | YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java | CClassLoader.createMemoryURL | public static URL createMemoryURL(final String entryName, final byte[] entry) {
"""
Creates and allocates a memory URL
@param entryName
name of the entry
@param entry
byte array of the entry
@return the created URL or null if an error occurs.
"""
try {
final Class c = ClassLoader.getSystemClassLoad... | java | public static URL createMemoryURL(final String entryName, final byte[] entry) {
try {
final Class c = ClassLoader.getSystemClassLoader().loadClass(
"org.allcolor.yahp.converter.CMemoryURLHandler");
final Method m = c.getDeclaredMethod("createMemoryURL",
new Class[] { String.class, byte[].class });
... | [
"public",
"static",
"URL",
"createMemoryURL",
"(",
"final",
"String",
"entryName",
",",
"final",
"byte",
"[",
"]",
"entry",
")",
"{",
"try",
"{",
"final",
"Class",
"c",
"=",
"ClassLoader",
".",
"getSystemClassLoader",
"(",
")",
".",
"loadClass",
"(",
"\"or... | Creates and allocates a memory URL
@param entryName
name of the entry
@param entry
byte array of the entry
@return the created URL or null if an error occurs. | [
"Creates",
"and",
"allocates",
"a",
"memory",
"URL"
] | train | https://github.com/allcolor/YaHP-Converter/blob/d72745281766a784a6b319f3787aa1d8de7cd0fe/YaHPConverter/src/org/allcolor/yahp/converter/CClassLoader.java#L143-L155 |
Waikato/moa | moa/src/main/java/moa/clusterers/kmeanspm/ClusteringFeature.java | ClusteringFeature.calcKMeansCosts | public double calcKMeansCosts(double[] center, double[] point) {
"""
Calculates the k-means costs of the ClusteringFeature and a point too a
center.
@param center
the center too calculate the costs
@param point
the point too calculate the costs
@return the costs
"""
assert (this.sumPoints.length == c... | java | public double calcKMeansCosts(double[] center, double[] point) {
assert (this.sumPoints.length == center.length &&
this.sumPoints.length == point.length);
return (this.sumSquaredLength + Metric.distanceSquared(point)) - 2
* Metric.dotProductWithAddition(this.sumPoints, point, center)
+ (this.numPoints +... | [
"public",
"double",
"calcKMeansCosts",
"(",
"double",
"[",
"]",
"center",
",",
"double",
"[",
"]",
"point",
")",
"{",
"assert",
"(",
"this",
".",
"sumPoints",
".",
"length",
"==",
"center",
".",
"length",
"&&",
"this",
".",
"sumPoints",
".",
"length",
... | Calculates the k-means costs of the ClusteringFeature and a point too a
center.
@param center
the center too calculate the costs
@param point
the point too calculate the costs
@return the costs | [
"Calculates",
"the",
"k",
"-",
"means",
"costs",
"of",
"the",
"ClusteringFeature",
"and",
"a",
"point",
"too",
"a",
"center",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/kmeanspm/ClusteringFeature.java#L279-L285 |
Azure/azure-sdk-for-java | locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java | ManagementLocksInner.listAtResourceLevelAsync | public Observable<Page<ManagementLockObjectInner>> listAtResourceLevelAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
"""
Gets all the management locks for a resource or any l... | java | public Observable<Page<ManagementLockObjectInner>> listAtResourceLevelAsync(final String resourceGroupName, final String resourceProviderNamespace, final String parentResourcePath, final String resourceType, final String resourceName, final String filter) {
return listAtResourceLevelWithServiceResponseAsync(res... | [
"public",
"Observable",
"<",
"Page",
"<",
"ManagementLockObjectInner",
">",
">",
"listAtResourceLevelAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"resourceProviderNamespace",
",",
"final",
"String",
"parentResourcePath",
",",
"final",
"St... | Gets all the management locks for a resource or any level below resource.
@param resourceGroupName The name of the resource group containing the locked resource. The name is case insensitive.
@param resourceProviderNamespace The namespace of the resource provider.
@param parentResourcePath The parent resource identity... | [
"Gets",
"all",
"the",
"management",
"locks",
"for",
"a",
"resource",
"or",
"any",
"level",
"below",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/locks/resource-manager/v2016_09_01/src/main/java/com/microsoft/azure/management/locks/v2016_09_01/implementation/ManagementLocksInner.java#L1717-L1725 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.listCompositeEntitiesAsync | public Observable<List<CompositeEntityExtractor>> listCompositeEntitiesAsync(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) {
"""
Gets information about the composite entity models.
@param appId The application ID.
@param versionId The version ID.
... | java | public Observable<List<CompositeEntityExtractor>> listCompositeEntitiesAsync(UUID appId, String versionId, ListCompositeEntitiesOptionalParameter listCompositeEntitiesOptionalParameter) {
return listCompositeEntitiesWithServiceResponseAsync(appId, versionId, listCompositeEntitiesOptionalParameter).map(new Func1... | [
"public",
"Observable",
"<",
"List",
"<",
"CompositeEntityExtractor",
">",
">",
"listCompositeEntitiesAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"ListCompositeEntitiesOptionalParameter",
"listCompositeEntitiesOptionalParameter",
")",
"{",
"return",
"list... | Gets information about the composite entity models.
@param appId The application ID.
@param versionId The version ID.
@param listCompositeEntitiesOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters fail the validation... | [
"Gets",
"information",
"about",
"the",
"composite",
"entity",
"models",
"."
] | 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/ModelsImpl.java#L1670-L1677 |
UrielCh/ovh-java-sdk | ovh-java-sdk-caascontainers/src/main/java/net/minidev/ovh/api/ApiOvhCaascontainers.java | ApiOvhCaascontainers.serviceName_ssl_PUT | public OvhCustomSslMessage serviceName_ssl_PUT(String serviceName, OvhInputCustomSsl body) throws IOException {
"""
Update the custom SSL certificate and private
REST: PUT /caas/containers/{serviceName}/ssl
@param body [required] A custom SSL certificate associated to a Docker PaaS environment
@param serviceN... | java | public OvhCustomSslMessage serviceName_ssl_PUT(String serviceName, OvhInputCustomSsl body) throws IOException {
String qPath = "/caas/containers/{serviceName}/ssl";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "PUT", sb.toString(), body);
return convertTo(resp, OvhCustomSslMessage.clas... | [
"public",
"OvhCustomSslMessage",
"serviceName_ssl_PUT",
"(",
"String",
"serviceName",
",",
"OvhInputCustomSsl",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/caas/containers/{serviceName}/ssl\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qP... | Update the custom SSL certificate and private
REST: PUT /caas/containers/{serviceName}/ssl
@param body [required] A custom SSL certificate associated to a Docker PaaS environment
@param serviceName [required] service name
API beta | [
"Update",
"the",
"custom",
"SSL",
"certificate",
"and",
"private"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-caascontainers/src/main/java/net/minidev/ovh/api/ApiOvhCaascontainers.java#L55-L60 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java | JBBPTextWriter.Obj | public JBBPTextWriter Obj(final int objId, final Object... obj) throws IOException {
"""
Print objects.
@param objId object id which will be provided to a converter as extra info
@param obj objects to be converted and printed, must not be null
@return the context
@throws IOException it will be thrown for t... | java | public JBBPTextWriter Obj(final int objId, final Object... obj) throws IOException {
if (this.extras.isEmpty()) {
throw new IllegalStateException("There is not any registered extras");
}
for (final Object c : obj) {
String str = null;
for (final Extra e : this.extras) {
str = e.do... | [
"public",
"JBBPTextWriter",
"Obj",
"(",
"final",
"int",
"objId",
",",
"final",
"Object",
"...",
"obj",
")",
"throws",
"IOException",
"{",
"if",
"(",
"this",
".",
"extras",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
... | Print objects.
@param objId object id which will be provided to a converter as extra info
@param obj objects to be converted and printed, must not be null
@return the context
@throws IOException it will be thrown for transport errors | [
"Print",
"objects",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPTextWriter.java#L1273-L1293 |
Wikidata/Wikidata-Toolkit | wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java | Datamodel.makePropertyIdValue | public static PropertyIdValue makePropertyIdValue(String id, String siteIri) {
"""
Creates a {@link PropertyIdValue}.
@param id
a string of the form Pn... where n... is the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI o... | java | public static PropertyIdValue makePropertyIdValue(String id, String siteIri) {
return factory.getPropertyIdValue(id, siteIri);
} | [
"public",
"static",
"PropertyIdValue",
"makePropertyIdValue",
"(",
"String",
"id",
",",
"String",
"siteIri",
")",
"{",
"return",
"factory",
".",
"getPropertyIdValue",
"(",
"id",
",",
"siteIri",
")",
";",
"}"
] | Creates a {@link PropertyIdValue}.
@param id
a string of the form Pn... where n... is the string
representation of a positive integer number
@param siteIri
IRI to identify the site, usually the first part of the entity
IRI of the site this belongs to, e.g.,
"http://www.wikidata.org/entity/"
@return a {@link PropertyId... | [
"Creates",
"a",
"{",
"@link",
"PropertyIdValue",
"}",
"."
] | train | https://github.com/Wikidata/Wikidata-Toolkit/blob/7732851dda47e1febff406fba27bfec023f4786e/wdtk-datamodel/src/main/java/org/wikidata/wdtk/datamodel/helpers/Datamodel.java#L86-L88 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildFieldSerializationOverview | public void buildFieldSerializationOverview(TypeElement typeElement, Content classContentTree) {
"""
Build the serialization overview for the given class.
@param typeElement the class to print the overview for.
@param classContentTree content tree to which the documentation will be added
"""
if (ut... | java | public void buildFieldSerializationOverview(TypeElement typeElement, Content classContentTree) {
if (utils.definesSerializableFields(typeElement)) {
VariableElement ve = utils.serializableFields(typeElement).first();
// Check to see if there are inline comments, tags or deprecation
... | [
"public",
"void",
"buildFieldSerializationOverview",
"(",
"TypeElement",
"typeElement",
",",
"Content",
"classContentTree",
")",
"{",
"if",
"(",
"utils",
".",
"definesSerializableFields",
"(",
"typeElement",
")",
")",
"{",
"VariableElement",
"ve",
"=",
"utils",
".",... | Build the serialization overview for the given class.
@param typeElement the class to print the overview for.
@param classContentTree content tree to which the documentation will be added | [
"Build",
"the",
"serialization",
"overview",
"for",
"the",
"given",
"class",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java#L398-L417 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkProfilesInner.java | NetworkProfilesInner.createOrUpdateAsync | public Observable<NetworkProfileInner> createOrUpdateAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) {
"""
Creates or updates a network profile.
@param resourceGroupName The name of the resource group.
@param networkProfileName The name of the network profile.
@param... | java | public Observable<NetworkProfileInner> createOrUpdateAsync(String resourceGroupName, String networkProfileName, NetworkProfileInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkProfileName, parameters).map(new Func1<ServiceResponse<NetworkProfileInner>, NetworkProfileInn... | [
"public",
"Observable",
"<",
"NetworkProfileInner",
">",
"createOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkProfileName",
",",
"NetworkProfileInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroup... | Creates or updates a network profile.
@param resourceGroupName The name of the resource group.
@param networkProfileName The name of the network profile.
@param parameters Parameters supplied to the create or update network profile operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@r... | [
"Creates",
"or",
"updates",
"a",
"network",
"profile",
"."
] | 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/NetworkProfilesInner.java#L374-L381 |
citrusframework/citrus | modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessageUtils.java | HttpMessageUtils.copy | public static void copy(Message from, HttpMessage to) {
"""
Apply message settings to target http message.
@param from
@param to
"""
HttpMessage source;
if (from instanceof HttpMessage) {
source = (HttpMessage) from;
} else {
source = new HttpMessage(from);
... | java | public static void copy(Message from, HttpMessage to) {
HttpMessage source;
if (from instanceof HttpMessage) {
source = (HttpMessage) from;
} else {
source = new HttpMessage(from);
}
copy(source, to);
} | [
"public",
"static",
"void",
"copy",
"(",
"Message",
"from",
",",
"HttpMessage",
"to",
")",
"{",
"HttpMessage",
"source",
";",
"if",
"(",
"from",
"instanceof",
"HttpMessage",
")",
"{",
"source",
"=",
"(",
"HttpMessage",
")",
"from",
";",
"}",
"else",
"{",... | Apply message settings to target http message.
@param from
@param to | [
"Apply",
"message",
"settings",
"to",
"target",
"http",
"message",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-http/src/main/java/com/consol/citrus/http/message/HttpMessageUtils.java#L40-L49 |
elastic/elasticsearch-metrics-reporter-java | src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java | ElasticsearchReporter.writeJsonMetric | private void writeJsonMetric(JsonMetric jsonMetric, ObjectWriter writer, OutputStream out) throws IOException {
"""
serialize a JSON metric over the outputstream in a bulk request
"""
writer.writeValue(out, new BulkIndexOperationHeader(currentIndexName, jsonMetric.type()));
out.write("\n".getBy... | java | private void writeJsonMetric(JsonMetric jsonMetric, ObjectWriter writer, OutputStream out) throws IOException {
writer.writeValue(out, new BulkIndexOperationHeader(currentIndexName, jsonMetric.type()));
out.write("\n".getBytes());
writer.writeValue(out, jsonMetric);
out.write("\n".getByt... | [
"private",
"void",
"writeJsonMetric",
"(",
"JsonMetric",
"jsonMetric",
",",
"ObjectWriter",
"writer",
",",
"OutputStream",
"out",
")",
"throws",
"IOException",
"{",
"writer",
".",
"writeValue",
"(",
"out",
",",
"new",
"BulkIndexOperationHeader",
"(",
"currentIndexNa... | serialize a JSON metric over the outputstream in a bulk request | [
"serialize",
"a",
"JSON",
"metric",
"over",
"the",
"outputstream",
"in",
"a",
"bulk",
"request"
] | train | https://github.com/elastic/elasticsearch-metrics-reporter-java/blob/4018eaef6fc7721312f7440b2bf5a19699a6cb56/src/main/java/org/elasticsearch/metrics/ElasticsearchReporter.java#L424-L431 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java | StreamingEndpointsInner.updateAsync | public Observable<StreamingEndpointInner> updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) {
"""
Update StreamingEndpoint.
Updates a existing StreamingEndpoint.
@param resourceGroupName The name of the resource group within the Azure sub... | java | public Observable<StreamingEndpointInner> updateAsync(String resourceGroupName, String accountName, String streamingEndpointName, StreamingEndpointInner parameters) {
return updateWithServiceResponseAsync(resourceGroupName, accountName, streamingEndpointName, parameters).map(new Func1<ServiceResponse<StreamingE... | [
"public",
"Observable",
"<",
"StreamingEndpointInner",
">",
"updateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"streamingEndpointName",
",",
"StreamingEndpointInner",
"parameters",
")",
"{",
"return",
"updateWithServiceResponseAs... | Update StreamingEndpoint.
Updates a existing StreamingEndpoint.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param streamingEndpointName The name of the StreamingEndpoint.
@param parameters StreamingEndpoint properties neede... | [
"Update",
"StreamingEndpoint",
".",
"Updates",
"a",
"existing",
"StreamingEndpoint",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/mediaservices/v2018_07_01/implementation/StreamingEndpointsInner.java#L788-L795 |
jbundle/jbundle | app/program/script/src/main/java/org/jbundle/app/program/script/screen/ScriptScreen.java | ScriptScreen.doCommand | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions) {
"""
Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't pr... | java | public boolean doCommand(String strCommand, ScreenField sourceSField, int iCommandOptions)
{
if (ScriptScreen.GO.equalsIgnoreCase(strCommand))
{
Record record = this.getMainRecord();
if (record.getEditMode() == DBConstants.EDIT_IN_PROGRESS)
{
try {... | [
"public",
"boolean",
"doCommand",
"(",
"String",
"strCommand",
",",
"ScreenField",
"sourceSField",
",",
"int",
"iCommandOptions",
")",
"{",
"if",
"(",
"ScriptScreen",
".",
"GO",
".",
"equalsIgnoreCase",
"(",
"strCommand",
")",
")",
"{",
"Record",
"record",
"="... | Process the command.
<br />Step 1 - Process the command if possible and return true if processed.
<br />Step 2 - If I can't process, pass to all children (with me as the source).
<br />Step 3 - If children didn't process, pass to parent (with me as the source).
<br />Note: Never pass to a parent or child that matches t... | [
"Process",
"the",
"command",
".",
"<br",
"/",
">",
"Step",
"1",
"-",
"Process",
"the",
"command",
"if",
"possible",
"and",
"return",
"true",
"if",
"processed",
".",
"<br",
"/",
">",
"Step",
"2",
"-",
"If",
"I",
"can",
"t",
"process",
"pass",
"to",
... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/app/program/script/src/main/java/org/jbundle/app/program/script/screen/ScriptScreen.java#L118-L142 |
mlhartme/sushi | src/main/java/net/oneandone/sushi/fs/http/Proxy.java | Proxy.forEnvOpt | private static Proxy forEnvOpt(String proxy, String noProxy) {
"""
Turn Java proxy properties for http_proxy and no_proxy environment variables into the
respective Java properties. See
- http://wiki.intranet.1and1.com/bin/view/UE/HttpProxy
- http://info4tech.wordpress.com/2007/05/04/java-http-proxy-settings/
-... | java | private static Proxy forEnvOpt(String proxy, String noProxy) {
URI uri;
int port;
Proxy result;
if (proxy == null) {
return null;
}
try {
uri = new URI(proxy);
} catch (URISyntaxException e) {
throw new IllegalArgumentException... | [
"private",
"static",
"Proxy",
"forEnvOpt",
"(",
"String",
"proxy",
",",
"String",
"noProxy",
")",
"{",
"URI",
"uri",
";",
"int",
"port",
";",
"Proxy",
"result",
";",
"if",
"(",
"proxy",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"try",
"{",
... | Turn Java proxy properties for http_proxy and no_proxy environment variables into the
respective Java properties. See
- http://wiki.intranet.1and1.com/bin/view/UE/HttpProxy
- http://info4tech.wordpress.com/2007/05/04/java-http-proxy-settings/
- http://download.oracle.com/javase/6/docs/technotes/guides/net/proxies.html
... | [
"Turn",
"Java",
"proxy",
"properties",
"for",
"http_proxy",
"and",
"no_proxy",
"environment",
"variables",
"into",
"the",
"respective",
"Java",
"properties",
".",
"See",
"-",
"http",
":",
"//",
"wiki",
".",
"intranet",
".",
"1and1",
".",
"com",
"/",
"bin",
... | train | https://github.com/mlhartme/sushi/blob/4af33414b04bd58584d4febe5cc63ef6c7346a75/src/main/java/net/oneandone/sushi/fs/http/Proxy.java#L63-L88 |
square/okhttp | okhttp/src/main/java/okhttp3/internal/http2/Http2Connection.java | Http2Connection.pushDataLater | void pushDataLater(final int streamId, final BufferedSource source, final int byteCount,
final boolean inFinished) throws IOException {
"""
Eagerly reads {@code byteCount} bytes from the source before launching a background task to
process the data. This avoids corrupting the stream.
"""
final Buff... | java | void pushDataLater(final int streamId, final BufferedSource source, final int byteCount,
final boolean inFinished) throws IOException {
final Buffer buffer = new Buffer();
source.require(byteCount); // Eagerly read the frame before firing client thread.
source.read(buffer, byteCount);
if (buffer.s... | [
"void",
"pushDataLater",
"(",
"final",
"int",
"streamId",
",",
"final",
"BufferedSource",
"source",
",",
"final",
"int",
"byteCount",
",",
"final",
"boolean",
"inFinished",
")",
"throws",
"IOException",
"{",
"final",
"Buffer",
"buffer",
"=",
"new",
"Buffer",
"... | Eagerly reads {@code byteCount} bytes from the source before launching a background task to
process the data. This avoids corrupting the stream. | [
"Eagerly",
"reads",
"{"
] | train | https://github.com/square/okhttp/blob/a8c65a822dd6cadd2de7d115bf94adf312e67868/okhttp/src/main/java/okhttp3/internal/http2/Http2Connection.java#L878-L898 |
haraldk/TwelveMonkeys | sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java | NetUtil.getInputStreamHttp | public static InputStream getInputStreamHttp(URL pURL, int pTimeout) throws IOException {
"""
Gets the InputStream from a given URL, with the given timeout.
The timeout must be > 0. A timeout of zero is interpreted as an
infinite timeout.
<P/>
<SMALL>Implementation note: If the timeout parameter is greater tha... | java | public static InputStream getInputStreamHttp(URL pURL, int pTimeout) throws IOException {
return getInputStreamHttp(pURL, null, true, pTimeout);
} | [
"public",
"static",
"InputStream",
"getInputStreamHttp",
"(",
"URL",
"pURL",
",",
"int",
"pTimeout",
")",
"throws",
"IOException",
"{",
"return",
"getInputStreamHttp",
"(",
"pURL",
",",
"null",
",",
"true",
",",
"pTimeout",
")",
";",
"}"
] | Gets the InputStream from a given URL, with the given timeout.
The timeout must be > 0. A timeout of zero is interpreted as an
infinite timeout.
<P/>
<SMALL>Implementation note: If the timeout parameter is greater than 0,
this method uses my own implementation of
java.net.HttpURLConnection, that uses plain sockets, to ... | [
"Gets",
"the",
"InputStream",
"from",
"a",
"given",
"URL",
"with",
"the",
"given",
"timeout",
".",
"The",
"timeout",
"must",
"be",
">",
"0",
".",
"A",
"timeout",
"of",
"zero",
"is",
"interpreted",
"as",
"an",
"infinite",
"timeout",
".",
"<P",
"/",
">",... | train | https://github.com/haraldk/TwelveMonkeys/blob/7fad4d5cd8cb3a6728c7fd3f28a7b84d8ce0101d/sandbox/sandbox-common/src/main/java/com/twelvemonkeys/net/NetUtil.java#L666-L668 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.refund_GET | public ArrayList<String> refund_GET(Date date_from, Date date_to, Long orderId) throws IOException {
"""
List of all the refunds the logged account has
REST: GET /me/refund
@param date_from [required] Filter the value of date property (>=)
@param date_to [required] Filter the value of date property (<=)
@par... | java | public ArrayList<String> refund_GET(Date date_from, Date date_to, Long orderId) throws IOException {
String qPath = "/me/refund";
StringBuilder sb = path(qPath);
query(sb, "date.from", date_from);
query(sb, "date.to", date_to);
query(sb, "orderId", orderId);
String resp = exec(qPath, "GET", sb.toString(), n... | [
"public",
"ArrayList",
"<",
"String",
">",
"refund_GET",
"(",
"Date",
"date_from",
",",
"Date",
"date_to",
",",
"Long",
"orderId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/refund\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPa... | List of all the refunds the logged account has
REST: GET /me/refund
@param date_from [required] Filter the value of date property (>=)
@param date_to [required] Filter the value of date property (<=)
@param orderId [required] Filter the value of orderId property (=) | [
"List",
"of",
"all",
"the",
"refunds",
"the",
"logged",
"account",
"has"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L1451-L1459 |
mygreen/xlsmapper | src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java | CellPosition.of | public static CellPosition of(final Point point) {
"""
CellAddressのインスタンスを作成する。
@param point セルの座標
@return {@link CellPosition}のインスタンス
@throws IllegalArgumentException {@literal point == null.}
"""
ArgUtils.notNull(point, "point");
return of(point.y, point.x);
} | java | public static CellPosition of(final Point point) {
ArgUtils.notNull(point, "point");
return of(point.y, point.x);
} | [
"public",
"static",
"CellPosition",
"of",
"(",
"final",
"Point",
"point",
")",
"{",
"ArgUtils",
".",
"notNull",
"(",
"point",
",",
"\"point\"",
")",
";",
"return",
"of",
"(",
"point",
".",
"y",
",",
"point",
".",
"x",
")",
";",
"}"
] | CellAddressのインスタンスを作成する。
@param point セルの座標
@return {@link CellPosition}のインスタンス
@throws IllegalArgumentException {@literal point == null.} | [
"CellAddressのインスタンスを作成する。"
] | train | https://github.com/mygreen/xlsmapper/blob/a0c6b25c622e5f3a50b199ef685d2ee46ad5483c/src/main/java/com/gh/mygreen/xlsmapper/util/CellPosition.java#L134-L137 |
beangle/beangle3 | commons/model/src/main/java/org/beangle/commons/entity/util/HierarchyEntityUtils.java | HierarchyEntityUtils.addParent | public static <T extends HierarchyEntity<T, ?>> void addParent(Collection<T> nodes, T toRoot) {
"""
<p>
addParent.
</p>
@param nodes a {@link java.util.Collection} object.
@param toRoot a T object.
@param <T> a T object.
"""
Set<T> parents = CollectUtils.newHashSet();
for (T node : nodes) {
... | java | public static <T extends HierarchyEntity<T, ?>> void addParent(Collection<T> nodes, T toRoot) {
Set<T> parents = CollectUtils.newHashSet();
for (T node : nodes) {
while (null != node.getParent() && !parents.contains(node.getParent())
&& !Objects.equals(node.getParent(), toRoot)) {
parent... | [
"public",
"static",
"<",
"T",
"extends",
"HierarchyEntity",
"<",
"T",
",",
"?",
">",
">",
"void",
"addParent",
"(",
"Collection",
"<",
"T",
">",
"nodes",
",",
"T",
"toRoot",
")",
"{",
"Set",
"<",
"T",
">",
"parents",
"=",
"CollectUtils",
".",
"newHas... | <p>
addParent.
</p>
@param nodes a {@link java.util.Collection} object.
@param toRoot a T object.
@param <T> a T object. | [
"<p",
">",
"addParent",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/entity/util/HierarchyEntityUtils.java#L209-L219 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/LogManager.java | LogManager.addLogger | public boolean addLogger(Logger logger) {
"""
Add a named logger. This does nothing and returns false if a logger
with the same name is already registered.
<p>
The Logger factory methods call this method to register each
newly created Logger.
<p>
The application should retain its own reference to the Logger... | java | public boolean addLogger(Logger logger) {
final String name = logger.getName();
if (name == null) {
throw new NullPointerException();
}
drainLoggerRefQueueBounded();
LoggerContext cx = getUserContext();
if (cx.addLocalLogger(logger, this)) {
// Do ... | [
"public",
"boolean",
"addLogger",
"(",
"Logger",
"logger",
")",
"{",
"final",
"String",
"name",
"=",
"logger",
".",
"getName",
"(",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{",
"throw",
"new",
"NullPointerException",
"(",
")",
";",
"}",
"drainL... | Add a named logger. This does nothing and returns false if a logger
with the same name is already registered.
<p>
The Logger factory methods call this method to register each
newly created Logger.
<p>
The application should retain its own reference to the Logger
object to avoid it being garbage collected. The LogMana... | [
"Add",
"a",
"named",
"logger",
".",
"This",
"does",
"nothing",
"and",
"returns",
"false",
"if",
"a",
"logger",
"with",
"the",
"same",
"name",
"is",
"already",
"registered",
".",
"<p",
">",
"The",
"Logger",
"factory",
"methods",
"call",
"this",
"method",
... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/logging/LogManager.java#L983-L998 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java | ChunkListener.isValidPostListener | public boolean isValidPostListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState) {
"""
Checks if the listener {@link BlockPos} has a {@link IBlockListener.Pre} component and if the modified {@code BlockPos} is in range.
@param chunk the chunk
@param listener the... | java | public boolean isValidPostListener(Chunk chunk, BlockPos listener, BlockPos modified, IBlockState oldState, IBlockState newState)
{
if (listener.equals(modified))
return false;
IBlockListener.Post bl = IComponent.getComponent(IBlockListener.Post.class, chunk.getWorld().getBlockState(listener).getBlock());
if ... | [
"public",
"boolean",
"isValidPostListener",
"(",
"Chunk",
"chunk",
",",
"BlockPos",
"listener",
",",
"BlockPos",
"modified",
",",
"IBlockState",
"oldState",
",",
"IBlockState",
"newState",
")",
"{",
"if",
"(",
"listener",
".",
"equals",
"(",
"modified",
")",
"... | Checks if the listener {@link BlockPos} has a {@link IBlockListener.Pre} component and if the modified {@code BlockPos} is in range.
@param chunk the chunk
@param listener the listener
@param modified the modified
@param oldState the old state
@param newState the new state
@return true, if is valid post listener | [
"Checks",
"if",
"the",
"listener",
"{",
"@link",
"BlockPos",
"}",
"has",
"a",
"{",
"@link",
"IBlockListener",
".",
"Pre",
"}",
"component",
"and",
"if",
"the",
"modified",
"{",
"@code",
"BlockPos",
"}",
"is",
"in",
"range",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/util/chunklistener/ChunkListener.java#L126-L135 |
jhy/jsoup | src/main/java/org/jsoup/nodes/Attribute.java | Attribute.createFromEncoded | public static Attribute createFromEncoded(String unencodedKey, String encodedValue) {
"""
Create a new Attribute from an unencoded key and a HTML attribute encoded value.
@param unencodedKey assumes the key is not encoded, as can be only run of simple \w chars.
@param encodedValue HTML attribute encoded value
@... | java | public static Attribute createFromEncoded(String unencodedKey, String encodedValue) {
String value = Entities.unescape(encodedValue, true);
return new Attribute(unencodedKey, value, null); // parent will get set when Put
} | [
"public",
"static",
"Attribute",
"createFromEncoded",
"(",
"String",
"unencodedKey",
",",
"String",
"encodedValue",
")",
"{",
"String",
"value",
"=",
"Entities",
".",
"unescape",
"(",
"encodedValue",
",",
"true",
")",
";",
"return",
"new",
"Attribute",
"(",
"u... | Create a new Attribute from an unencoded key and a HTML attribute encoded value.
@param unencodedKey assumes the key is not encoded, as can be only run of simple \w chars.
@param encodedValue HTML attribute encoded value
@return attribute | [
"Create",
"a",
"new",
"Attribute",
"from",
"an",
"unencoded",
"key",
"and",
"a",
"HTML",
"attribute",
"encoded",
"value",
"."
] | train | https://github.com/jhy/jsoup/blob/68ff8cbe7ad847059737a09c567a501a7f1d251f/src/main/java/org/jsoup/nodes/Attribute.java#L142-L145 |
Pi4J/pi4j | pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java | MicrochipPotentiometerDeviceController.setValue | public void setValue(final DeviceControllerChannel channel, final int value,
final boolean nonVolatile) throws IOException {
"""
Sets the wiper's value in the device.
@param channel Which wiper
@param value The wiper's value
@param nonVolatile volatile or non-volatile value
@throws IOException Thrown if c... | java | public void setValue(final DeviceControllerChannel channel, final int value,
final boolean nonVolatile) throws IOException {
if (channel == null) {
throw new RuntimeException("null-channel is not allowed. For devices "
+ "knowing just one wiper Channel.A is mandatory for "
+ "parameter 'channel'");
... | [
"public",
"void",
"setValue",
"(",
"final",
"DeviceControllerChannel",
"channel",
",",
"final",
"int",
"value",
",",
"final",
"boolean",
"nonVolatile",
")",
"throws",
"IOException",
"{",
"if",
"(",
"channel",
"==",
"null",
")",
"{",
"throw",
"new",
"RuntimeExc... | Sets the wiper's value in the device.
@param channel Which wiper
@param value The wiper's value
@param nonVolatile volatile or non-volatile value
@throws IOException Thrown if communication fails or device returned a malformed result | [
"Sets",
"the",
"wiper",
"s",
"value",
"in",
"the",
"device",
"."
] | train | https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-device/src/main/java/com/pi4j/component/potentiometer/microchip/impl/MicrochipPotentiometerDeviceController.java#L234-L256 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryApi.java | RepositoryApi.deleteTag | public void deleteTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
"""
Deletes the tag from a project with the specified tag name.
<pre><code>GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), S... | java | public void deleteTag(Object projectIdOrPath, String tagName) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, null, "projects", getProjectIdOrPath(projectIdOrPath), "repository", "tags", ... | [
"public",
"void",
"deleteTag",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"tagName",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"?",
"Response",
".",
... | Deletes the tag from a project with the specified tag name.
<pre><code>GitLab Endpoint: DELETE /projects/:id/repository/tags/:tag_name</code></pre>
@param projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance
@param tagName The name of the tag to delete
@throws GitLabApiExceptio... | [
"Deletes",
"the",
"tag",
"from",
"a",
"project",
"with",
"the",
"specified",
"tag",
"name",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryApi.java#L319-L322 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/DateTimeField.java | DateTimeField.setupDefaultView | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) {
"""
Set up the default screen control for this field (SEditText with a DateConverter followed by a SCannedBox).
@param itsLocation Location of th... | java | public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties)
{
if (!(converter instanceof DateConverter))
converter = new DateConverter((Converter)converter, DBConstants.HYBRID_DATE_TIME_FOR... | [
"public",
"ScreenComponent",
"setupDefaultView",
"(",
"ScreenLoc",
"itsLocation",
",",
"ComponentParent",
"targetScreen",
",",
"Convert",
"converter",
",",
"int",
"iDisplayFieldDesc",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"("... | Set up the default screen control for this field (SEditText with a DateConverter followed by a SCannedBox).
@param itsLocation Location of this component on screen (ie., GridBagConstraint).
@param targetScreen Where to place this component (ie., Parent screen or GridBagLayout).
@param converter The converter to set the... | [
"Set",
"up",
"the",
"default",
"screen",
"control",
"for",
"this",
"field",
"(",
"SEditText",
"with",
"a",
"DateConverter",
"followed",
"by",
"a",
"SCannedBox",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/DateTimeField.java#L373-L414 |
jbundle/jbundle | base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBasePanel.java | XBasePanel.printDataStartForm | public void printDataStartForm(PrintWriter out, int iPrintOptions) {
"""
Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes.
"""
String strRecordName = "norecord";
Record record = this.getMainRecord();
if (record != nul... | java | public void printDataStartForm(PrintWriter out, int iPrintOptions)
{
String strRecordName = "norecord";
Record record = this.getMainRecord();
if (record != null)
strRecordName = record.getTableNames(false);
if ((iPrintOptions & HtmlConstants.MAIN_HEADING_SCREEN) == HtmlCo... | [
"public",
"void",
"printDataStartForm",
"(",
"PrintWriter",
"out",
",",
"int",
"iPrintOptions",
")",
"{",
"String",
"strRecordName",
"=",
"\"norecord\"",
";",
"Record",
"record",
"=",
"this",
".",
"getMainRecord",
"(",
")",
";",
"if",
"(",
"record",
"!=",
"n... | Display the start form in input format.
@param out The out stream.
@param iPrintOptions The view specific attributes. | [
"Display",
"the",
"start",
"form",
"in",
"input",
"format",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/xml/src/main/java/org/jbundle/base/screen/view/xml/XBasePanel.java#L462-L482 |
alexruiz/fest-reflect | src/main/java/org/fest/reflect/util/Types.java | Types.castSafely | public static <T> T castSafely(@Nullable Object o, @NotNull Class<T> type) {
"""
Casts the given object to the given type. This method handles primitive types properly.
@param o the object to cast.
@param type the type to cast the given object to.
@return the given object casted to the given type.
"""
... | java | public static <T> T castSafely(@Nullable Object o, @NotNull Class<T> type) {
checkNotNull(type);
if (type.isPrimitive()) {
return getWrapperType(type).cast(o);
}
return type.cast(o);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"castSafely",
"(",
"@",
"Nullable",
"Object",
"o",
",",
"@",
"NotNull",
"Class",
"<",
"T",
">",
"type",
")",
"{",
"checkNotNull",
"(",
"type",
")",
";",
"if",
"(",
"type",
".",
"isPrimitive",
"(",
")",
")",
... | Casts the given object to the given type. This method handles primitive types properly.
@param o the object to cast.
@param type the type to cast the given object to.
@return the given object casted to the given type. | [
"Casts",
"the",
"given",
"object",
"to",
"the",
"given",
"type",
".",
"This",
"method",
"handles",
"primitive",
"types",
"properly",
"."
] | train | https://github.com/alexruiz/fest-reflect/blob/6db30716808633ef880e439b3dc6602ecb3f1b08/src/main/java/org/fest/reflect/util/Types.java#L54-L60 |
JRebirth/JRebirth | org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ObjectUtility.java | ObjectUtility.checkAllMethodReturnTrue | public static boolean checkAllMethodReturnTrue(final Object instance, final List<Method> methods) {
"""
Check if all given methods return true or if the list is empty.
@param instance the context object
@param methods the list of method to check
@return true if all method return true or if the list is empty... | java | public static boolean checkAllMethodReturnTrue(final Object instance, final List<Method> methods) {
boolean res = true;
if (!methods.isEmpty()) {
for (final Method method : methods) {
Object returnValue;
try {
returnValue = method.i... | [
"public",
"static",
"boolean",
"checkAllMethodReturnTrue",
"(",
"final",
"Object",
"instance",
",",
"final",
"List",
"<",
"Method",
">",
"methods",
")",
"{",
"boolean",
"res",
"=",
"true",
";",
"if",
"(",
"!",
"methods",
".",
"isEmpty",
"(",
")",
")",
"{... | Check if all given methods return true or if the list is empty.
@param instance the context object
@param methods the list of method to check
@return true if all method return true or if the list is empty | [
"Check",
"if",
"all",
"given",
"methods",
"return",
"true",
"or",
"if",
"the",
"list",
"is",
"empty",
"."
] | train | https://github.com/JRebirth/JRebirth/blob/93f4fc087b83c73db540333b9686e97b4cec694d/org.jrebirth.af/core/src/main/java/org/jrebirth/af/core/util/ObjectUtility.java#L95-L110 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java | NormOps_DDRM.elementP | public static double elementP(DMatrix1Row A , double p ) {
"""
<p>
Element wise p-norm:<br>
<br>
norm = {∑<sub>i=1:m</sub> ∑<sub>j=1:n</sub> { |a<sub>ij</sub>|<sup>p</sup>}}<sup>1/p</sup>
</p>
<p>
This is not the same as the induced p-norm used on matrices, but is the same as the vector p-norm.
</... | java | public static double elementP(DMatrix1Row A , double p ) {
if( p == 1 ) {
return CommonOps_DDRM.elementSumAbs(A);
} if( p == 2 ) {
return normF(A);
} else {
double max = CommonOps_DDRM.elementMaxAbs(A);
if( max == 0.0 )
return 0.0;... | [
"public",
"static",
"double",
"elementP",
"(",
"DMatrix1Row",
"A",
",",
"double",
"p",
")",
"{",
"if",
"(",
"p",
"==",
"1",
")",
"{",
"return",
"CommonOps_DDRM",
".",
"elementSumAbs",
"(",
"A",
")",
";",
"}",
"if",
"(",
"p",
"==",
"2",
")",
"{",
... | <p>
Element wise p-norm:<br>
<br>
norm = {∑<sub>i=1:m</sub> ∑<sub>j=1:n</sub> { |a<sub>ij</sub>|<sup>p</sup>}}<sup>1/p</sup>
</p>
<p>
This is not the same as the induced p-norm used on matrices, but is the same as the vector p-norm.
</p>
@param A Matrix. Not modified.
@param p p value.
@return The norm's valu... | [
"<p",
">",
"Element",
"wise",
"p",
"-",
"norm",
":",
"<br",
">",
"<br",
">",
"norm",
"=",
"{",
"&sum",
";",
"<sub",
">",
"i",
"=",
"1",
":",
"m<",
"/",
"sub",
">",
"&sum",
";",
"<sub",
">",
"j",
"=",
"1",
":",
"n<",
"/",
"sub",
">",
"{",
... | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/row/NormOps_DDRM.java#L227-L250 |
Netflix/eureka | eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java | InstanceResource.updateMetadata | @PUT
@Path("metadata")
public Response updateMetadata(@Context UriInfo uriInfo) {
"""
Updates user-specific metadata information. If the key is already available, its value will be overwritten.
If not, it will be added.
@param uriInfo - URI information generated by jersey.
@return response indicating wh... | java | @PUT
@Path("metadata")
public Response updateMetadata(@Context UriInfo uriInfo) {
try {
InstanceInfo instanceInfo = registry.getInstanceByAppAndId(app.getName(), id);
// ReplicationInstance information is not found, generate an error
if (instanceInfo == null) {
... | [
"@",
"PUT",
"@",
"Path",
"(",
"\"metadata\"",
")",
"public",
"Response",
"updateMetadata",
"(",
"@",
"Context",
"UriInfo",
"uriInfo",
")",
"{",
"try",
"{",
"InstanceInfo",
"instanceInfo",
"=",
"registry",
".",
"getInstanceByAppAndId",
"(",
"app",
".",
"getName... | Updates user-specific metadata information. If the key is already available, its value will be overwritten.
If not, it will be added.
@param uriInfo - URI information generated by jersey.
@return response indicating whether the operation was a success or
failure. | [
"Updates",
"user",
"-",
"specific",
"metadata",
"information",
".",
"If",
"the",
"key",
"is",
"already",
"available",
"its",
"value",
"will",
"be",
"overwritten",
".",
"If",
"not",
"it",
"will",
"be",
"added",
"."
] | train | https://github.com/Netflix/eureka/blob/48446d956be09df6650a3c00b7ebd7e2d1e1544f/eureka-core/src/main/java/com/netflix/eureka/resources/InstanceResource.java#L235-L266 |
lucee/Lucee | core/src/main/java/lucee/commons/io/IOUtil.java | IOUtil.merge | public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException {
"""
copy a inputstream to a outputstream
@param in
@param out
@param closeIS
@param closeOS
@throws IOException
"""
try {
merge(in1, in2, out... | java | public static final void merge(InputStream in1, InputStream in2, OutputStream out, boolean closeIS1, boolean closeIS2, boolean closeOS) throws IOException {
try {
merge(in1, in2, out, 0xffff);
}
finally {
if (closeIS1) closeEL(in1);
if (closeIS2) closeEL(in2);
if (closeOS) closeEL(out);
}
} | [
"public",
"static",
"final",
"void",
"merge",
"(",
"InputStream",
"in1",
",",
"InputStream",
"in2",
",",
"OutputStream",
"out",
",",
"boolean",
"closeIS1",
",",
"boolean",
"closeIS2",
",",
"boolean",
"closeOS",
")",
"throws",
"IOException",
"{",
"try",
"{",
... | copy a inputstream to a outputstream
@param in
@param out
@param closeIS
@param closeOS
@throws IOException | [
"copy",
"a",
"inputstream",
"to",
"a",
"outputstream"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/IOUtil.java#L93-L102 |
JadiraOrg/jadira | jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java | BatchedJmsTemplate.receiveSelectedBatch | public List<Message> receiveSelectedBatch(String messageSelector, int batchSize) throws JmsException {
"""
Receive a batch of up to batchSize for default destination and given message selector. Other than batching this method is the same as {@link JmsTemplate#receiveSelected(String)}
@return A list of {@link Mess... | java | public List<Message> receiveSelectedBatch(String messageSelector, int batchSize) throws JmsException {
Destination defaultDestination = getDefaultDestination();
if (defaultDestination != null) {
return receiveSelectedBatch(defaultDestination, messageSelector, batchSize);
} else {
... | [
"public",
"List",
"<",
"Message",
">",
"receiveSelectedBatch",
"(",
"String",
"messageSelector",
",",
"int",
"batchSize",
")",
"throws",
"JmsException",
"{",
"Destination",
"defaultDestination",
"=",
"getDefaultDestination",
"(",
")",
";",
"if",
"(",
"defaultDestina... | Receive a batch of up to batchSize for default destination and given message selector. Other than batching this method is the same as {@link JmsTemplate#receiveSelected(String)}
@return A list of {@link Message}
@param messageSelector The Selector
@param batchSize The batch size
@throws JmsException The {@link JmsExcep... | [
"Receive",
"a",
"batch",
"of",
"up",
"to",
"batchSize",
"for",
"default",
"destination",
"and",
"given",
"message",
"selector",
".",
"Other",
"than",
"batching",
"this",
"method",
"is",
"the",
"same",
"as",
"{"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java#L200-L207 |
kejunxia/AndroidMvc | library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/MvcFragment.java | MvcFragment.onViewCreated | @Override
final public void onViewCreated(final View view, final Bundle savedInstanceState) {
"""
This Android lifecycle callback is sealed. Use {@link #onViewReady(View, Bundle, Reason)}
instead, which provides a flag to indicate why the view is created.
@param view View of this fragment
@p... | java | @Override
final public void onViewCreated(final View view, final Bundle savedInstanceState) {
fragmentComesBackFromBackground = false;
eventRegister.registerEventBuses();
onPreViewReady(view, savedInstanceState);
final boolean restoring = savedInstanceState != null;
if (res... | [
"@",
"Override",
"final",
"public",
"void",
"onViewCreated",
"(",
"final",
"View",
"view",
",",
"final",
"Bundle",
"savedInstanceState",
")",
"{",
"fragmentComesBackFromBackground",
"=",
"false",
";",
"eventRegister",
".",
"registerEventBuses",
"(",
")",
";",
"onP... | This Android lifecycle callback is sealed. Use {@link #onViewReady(View, Bundle, Reason)}
instead, which provides a flag to indicate why the view is created.
@param view View of this fragment
@param savedInstanceState The savedInstanceState: Null when the view is newly created,
otherwise the state to res... | [
"This",
"Android",
"lifecycle",
"callback",
"is",
"sealed",
".",
"Use",
"{",
"@link",
"#onViewReady",
"(",
"View",
"Bundle",
"Reason",
")",
"}",
"instead",
"which",
"provides",
"a",
"flag",
"to",
"indicate",
"why",
"the",
"view",
"is",
"created",
"."
] | train | https://github.com/kejunxia/AndroidMvc/blob/c7893f0a13119d64297b9eb2988f7323b7da5bbc/library/android-mvc/src/main/java/com/shipdream/lib/android/mvc/MvcFragment.java#L215-L233 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/code/Types.java | Types.makeFunctionalInterfaceClass | public ClassSymbol makeFunctionalInterfaceClass(Env<AttrContext> env, Name name, List<Type> targets, long cflags) {
"""
Create a symbol for a class that implements a given functional interface
and overrides its functional descriptor. This routine is used for two
main purposes: (i) checking well-formedness of a f... | java | public ClassSymbol makeFunctionalInterfaceClass(Env<AttrContext> env, Name name, List<Type> targets, long cflags) {
if (targets.isEmpty()) {
return null;
}
Symbol descSym = findDescriptorSymbol(targets.head.tsym);
Type descType = findDescriptorType(targets.head);
Clas... | [
"public",
"ClassSymbol",
"makeFunctionalInterfaceClass",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Name",
"name",
",",
"List",
"<",
"Type",
">",
"targets",
",",
"long",
"cflags",
")",
"{",
"if",
"(",
"targets",
".",
"isEmpty",
"(",
")",
")",
"{",... | Create a symbol for a class that implements a given functional interface
and overrides its functional descriptor. This routine is used for two
main purposes: (i) checking well-formedness of a functional interface;
(ii) perform functional interface bridge calculation. | [
"Create",
"a",
"symbol",
"for",
"a",
"class",
"that",
"implements",
"a",
"given",
"functional",
"interface",
"and",
"overrides",
"its",
"functional",
"descriptor",
".",
"This",
"routine",
"is",
"used",
"for",
"two",
"main",
"purposes",
":",
"(",
"i",
")",
... | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/code/Types.java#L634-L651 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java | AccountsInner.updateStorageAccount | public void updateStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) {
"""
Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix.
@param resourceGroupName The name o... | java | public void updateStorageAccount(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) {
updateStorageAccountWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).toBlocking().single().body();
} | [
"public",
"void",
"updateStorageAccount",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"storageAccountName",
",",
"AddStorageAccountParameters",
"parameters",
")",
"{",
"updateStorageAccountWithServiceResponseAsync",
"(",
"resourceGroupName",... | Updates the Data Lake Analytics account to replace Azure Storage blob account details, such as the access key and/or suffix.
@param resourceGroupName The name of the Azure resource group that contains the Data Lake Analytics account.
@param accountName The name of the Data Lake Analytics account to modify storage acco... | [
"Updates",
"the",
"Data",
"Lake",
"Analytics",
"account",
"to",
"replace",
"Azure",
"Storage",
"blob",
"account",
"details",
"such",
"as",
"the",
"access",
"key",
"and",
"/",
"or",
"suffix",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2015_10_01_preview/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2015_10_01_preview/implementation/AccountsInner.java#L377-L379 |
Azure/azure-sdk-for-java | mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java | LiveOutputsInner.beginDelete | public void beginDelete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) {
"""
Delete Live Output.
Deletes a Live Output.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param... | java | public void beginDelete(String resourceGroupName, String accountName, String liveEventName, String liveOutputName) {
beginDeleteWithServiceResponseAsync(resourceGroupName, accountName, liveEventName, liveOutputName).toBlocking().single().body();
} | [
"public",
"void",
"beginDelete",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"liveEventName",
",",
"String",
"liveOutputName",
")",
"{",
"beginDeleteWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
",",
"liveE... | Delete Live Output.
Deletes a Live Output.
@param resourceGroupName The name of the resource group within the Azure subscription.
@param accountName The Media Services account name.
@param liveEventName The name of the Live Event.
@param liveOutputName The name of the Live Output.
@throws IllegalArgumentException thro... | [
"Delete",
"Live",
"Output",
".",
"Deletes",
"a",
"Live",
"Output",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mediaservices/resource-manager/v2018_03_30_preview/src/main/java/com/microsoft/azure/management/mediaservices/v2018_03_30_preview/implementation/LiveOutputsInner.java#L641-L643 |
sonyxperiadev/gerrit-events | src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java | GerritJsonEventFactory.getString | public static String getString(JSONObject json, String key) {
"""
Returns the value of a JSON property as a String if it exists otherwise returns null.
Same as calling {@link #getString(net.sf.json.JSONObject, java.lang.String, java.lang.String) }
with null as defaultValue.
@param json the JSONObject to check.
... | java | public static String getString(JSONObject json, String key) {
return getString(json, key, null);
} | [
"public",
"static",
"String",
"getString",
"(",
"JSONObject",
"json",
",",
"String",
"key",
")",
"{",
"return",
"getString",
"(",
"json",
",",
"key",
",",
"null",
")",
";",
"}"
] | Returns the value of a JSON property as a String if it exists otherwise returns null.
Same as calling {@link #getString(net.sf.json.JSONObject, java.lang.String, java.lang.String) }
with null as defaultValue.
@param json the JSONObject to check.
@param key the key.
@return the value for the key as a string. | [
"Returns",
"the",
"value",
"of",
"a",
"JSON",
"property",
"as",
"a",
"String",
"if",
"it",
"exists",
"otherwise",
"returns",
"null",
".",
"Same",
"as",
"calling",
"{"
] | train | https://github.com/sonyxperiadev/gerrit-events/blob/9a443d13dded85cc4709136ac33989f2bbb34fe2/src/main/java/com/sonymobile/tools/gerrit/gerritevents/GerritJsonEventFactory.java#L221-L223 |
i-net-software/jlessc | src/com/inet/lib/less/ColorUtils.java | ColorUtils.rgb | static double rgb( int r, int g, int b ) {
"""
Create an color value.
@param r
red in range from 0 to 255
@param g
green in range from 0 to 255
@param b
blue in range from 0 to 255
@return color value as long
"""
return Double.longBitsToDouble( Expression.ALPHA_1 | (colorLargeDigit(r) << 32) |... | java | static double rgb( int r, int g, int b ) {
return Double.longBitsToDouble( Expression.ALPHA_1 | (colorLargeDigit(r) << 32) | (colorLargeDigit(g) << 16) | colorLargeDigit(b) );
} | [
"static",
"double",
"rgb",
"(",
"int",
"r",
",",
"int",
"g",
",",
"int",
"b",
")",
"{",
"return",
"Double",
".",
"longBitsToDouble",
"(",
"Expression",
".",
"ALPHA_1",
"|",
"(",
"colorLargeDigit",
"(",
"r",
")",
"<<",
"32",
")",
"|",
"(",
"colorLarge... | Create an color value.
@param r
red in range from 0 to 255
@param g
green in range from 0 to 255
@param b
blue in range from 0 to 255
@return color value as long | [
"Create",
"an",
"color",
"value",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/ColorUtils.java#L130-L132 |
apache/flink | flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java | Types.POJO | public static <T> TypeInformation<T> POJO(Class<T> pojoClass, Map<String, TypeInformation<?>> fields) {
"""
Returns type information for a POJO (Plain Old Java Object) and allows to specify all fields manually.
<p>A POJO class is public and standalone (no non-static inner class). It has a public no-argument
co... | java | public static <T> TypeInformation<T> POJO(Class<T> pojoClass, Map<String, TypeInformation<?>> fields) {
final List<PojoField> pojoFields = new ArrayList<>(fields.size());
for (Map.Entry<String, TypeInformation<?>> field : fields.entrySet()) {
final Field f = TypeExtractor.getDeclaredField(pojoClass, field.getKey... | [
"public",
"static",
"<",
"T",
">",
"TypeInformation",
"<",
"T",
">",
"POJO",
"(",
"Class",
"<",
"T",
">",
"pojoClass",
",",
"Map",
"<",
"String",
",",
"TypeInformation",
"<",
"?",
">",
">",
"fields",
")",
"{",
"final",
"List",
"<",
"PojoField",
">",
... | Returns type information for a POJO (Plain Old Java Object) and allows to specify all fields manually.
<p>A POJO class is public and standalone (no non-static inner class). It has a public no-argument
constructor. All non-static, non-transient fields in the class (and all superclasses) are either public
(and non-final... | [
"Returns",
"type",
"information",
"for",
"a",
"POJO",
"(",
"Plain",
"Old",
"Java",
"Object",
")",
"and",
"allows",
"to",
"specify",
"all",
"fields",
"manually",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/common/typeinfo/Types.java#L312-L323 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgArc.java | DwgArc.readDwgArcV15 | public void readDwgArcV15(int[] data, int offset) throws Exception {
"""
Read an Arc in the DWG format Version 15
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG f... | java | public void readDwgArcV15(int[] data, int offset) throws Exception {
//System.out.println("readDwgArc() executed ...");
int bitPos = offset;
bitPos = readObjectHeaderV15(data, bitPos);
Vector v = DwgUtil.getBitDouble(data, bitPos);
bitPos = ((Integer)v.get(0)).intValue();
double x = ((Double)v.get(1)).doubl... | [
"public",
"void",
"readDwgArcV15",
"(",
"int",
"[",
"]",
"data",
",",
"int",
"offset",
")",
"throws",
"Exception",
"{",
"//System.out.println(\"readDwgArc() executed ...\");",
"int",
"bitPos",
"=",
"offset",
";",
"bitPos",
"=",
"readObjectHeaderV15",
"(",
"data",
... | Read an Arc in the DWG format Version 15
@param data Array of unsigned bytes obtained from the DWG binary file
@param offset The current bit offset where the value begins
@throws Exception If an unexpected bit value is found in the DWG file. Occurs
when we are looking for LwPolylines. | [
"Read",
"an",
"Arc",
"in",
"the",
"DWG",
"format",
"Version",
"15"
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/io/dxfdwg/libs/dwg/objects/DwgArc.java#L47-L105 |
googleads/googleads-java-lib | examples/admanager_axis/src/main/java/admanager/axis/v201811/exchangerateservice/CreateExchangeRates.java | CreateExchangeRates.runExample | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
"""
Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws ... | java | public static void runExample(AdManagerServices adManagerServices, AdManagerSession session)
throws RemoteException {
// Get the ExchangeRateService.
ExchangeRateServiceInterface exchangeRateService =
adManagerServices.get(session, ExchangeRateServiceInterface.class);
// Create an exchange ra... | [
"public",
"static",
"void",
"runExample",
"(",
"AdManagerServices",
"adManagerServices",
",",
"AdManagerSession",
"session",
")",
"throws",
"RemoteException",
"{",
"// Get the ExchangeRateService.",
"ExchangeRateServiceInterface",
"exchangeRateService",
"=",
"adManagerServices",
... | Runs the example.
@param adManagerServices the services factory.
@param session the session.
@throws ApiException if the API request failed with one or more service errors.
@throws RemoteException if the API request failed due to other errors. | [
"Runs",
"the",
"example",
"."
] | train | https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/examples/admanager_axis/src/main/java/admanager/axis/v201811/exchangerateservice/CreateExchangeRates.java#L52-L86 |
nyla-solutions/nyla | nyla.solutions.core/src/main/java/nyla/solutions/core/util/JavaBean.java | JavaBean.setProperty | public static void setProperty(Object bean, String propertyName, Object value) {
"""
Set property
@param bean the bean
@param propertyName the property name
@param value the value to set
"""
setProperty(bean,propertyName,value,true);
} | java | public static void setProperty(Object bean, String propertyName, Object value)
{
setProperty(bean,propertyName,value,true);
} | [
"public",
"static",
"void",
"setProperty",
"(",
"Object",
"bean",
",",
"String",
"propertyName",
",",
"Object",
"value",
")",
"{",
"setProperty",
"(",
"bean",
",",
"propertyName",
",",
"value",
",",
"true",
")",
";",
"}"
] | Set property
@param bean the bean
@param propertyName the property name
@param value the value to set | [
"Set",
"property"
] | train | https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/JavaBean.java#L184-L187 |
pravega/pravega | controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java | StreamMetadataTasks.updateStream | public CompletableFuture<UpdateStreamStatus.Status> updateStream(String scope, String stream, StreamConfiguration newConfig,
OperationContext contextOpt) {
"""
Update stream's configuration.
@param scope scope.
@param stream stream n... | java | public CompletableFuture<UpdateStreamStatus.Status> updateStream(String scope, String stream, StreamConfiguration newConfig,
OperationContext contextOpt) {
final OperationContext context = contextOpt == null ? streamMetadataStore.createContext... | [
"public",
"CompletableFuture",
"<",
"UpdateStreamStatus",
".",
"Status",
">",
"updateStream",
"(",
"String",
"scope",
",",
"String",
"stream",
",",
"StreamConfiguration",
"newConfig",
",",
"OperationContext",
"contextOpt",
")",
"{",
"final",
"OperationContext",
"conte... | Update stream's configuration.
@param scope scope.
@param stream stream name.
@param newConfig modified stream configuration.
@param contextOpt optional context
@return update status. | [
"Update",
"stream",
"s",
"configuration",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/task/Stream/StreamMetadataTasks.java#L172-L201 |
Netflix/servo | servo-core/src/main/java/com/netflix/servo/tag/BasicTagList.java | BasicTagList.concat | public static BasicTagList concat(TagList t1, Tag... t2) {
"""
Returns a tag list containing the union of {@code t1} and {@code t2}.
If there is a conflict with tag keys, the tag from {@code t2} will be
used.
"""
return new BasicTagList(Iterables.concat(t1, Arrays.asList(t2)));
} | java | public static BasicTagList concat(TagList t1, Tag... t2) {
return new BasicTagList(Iterables.concat(t1, Arrays.asList(t2)));
} | [
"public",
"static",
"BasicTagList",
"concat",
"(",
"TagList",
"t1",
",",
"Tag",
"...",
"t2",
")",
"{",
"return",
"new",
"BasicTagList",
"(",
"Iterables",
".",
"concat",
"(",
"t1",
",",
"Arrays",
".",
"asList",
"(",
"t2",
")",
")",
")",
";",
"}"
] | Returns a tag list containing the union of {@code t1} and {@code t2}.
If there is a conflict with tag keys, the tag from {@code t2} will be
used. | [
"Returns",
"a",
"tag",
"list",
"containing",
"the",
"union",
"of",
"{"
] | train | https://github.com/Netflix/servo/blob/d67b5afce8c50bd9e9e31c288dbf4b78fb2ac815/servo-core/src/main/java/com/netflix/servo/tag/BasicTagList.java#L175-L177 |
VoltDB/voltdb | src/frontend/org/voltcore/agreement/AgreementSite.java | AgreementSite.requestJoin | public CountDownLatch requestJoin(final long joiningSite) throws Exception {
"""
/*
Construct a ZK transaction that will add the initiator to the cluster
"""
final CountDownLatch cdl = new CountDownLatch(1);
final Runnable r = new Runnable() {
@Override
public void run(... | java | public CountDownLatch requestJoin(final long joiningSite) throws Exception {
final CountDownLatch cdl = new CountDownLatch(1);
final Runnable r = new Runnable() {
@Override
public void run() {
try {
final long txnId = m_idManager.getNextUniqueT... | [
"public",
"CountDownLatch",
"requestJoin",
"(",
"final",
"long",
"joiningSite",
")",
"throws",
"Exception",
"{",
"final",
"CountDownLatch",
"cdl",
"=",
"new",
"CountDownLatch",
"(",
"1",
")",
";",
"final",
"Runnable",
"r",
"=",
"new",
"Runnable",
"(",
")",
"... | /*
Construct a ZK transaction that will add the initiator to the cluster | [
"/",
"*",
"Construct",
"a",
"ZK",
"transaction",
"that",
"will",
"add",
"the",
"initiator",
"to",
"the",
"cluster"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltcore/agreement/AgreementSite.java#L785-L827 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/geom/GeomUtil.java | GeomUtil.onPath | private boolean onPath(Shape path, float x, float y) {
"""
Check if the given point is on the path
@param path The path to check
@param x The x coordinate of the point to check
@param y The y coordiante of teh point to check
@return True if the point is on the path
"""
for (int i=0;i<path.getPointCoun... | java | private boolean onPath(Shape path, float x, float y) {
for (int i=0;i<path.getPointCount()+1;i++) {
int n = rationalPoint(path, i+1);
Line line = getLine(path, rationalPoint(path, i), n);
if (line.distance(new Vector2f(x,y)) < EPSILON*100) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"onPath",
"(",
"Shape",
"path",
",",
"float",
"x",
",",
"float",
"y",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"path",
".",
"getPointCount",
"(",
")",
"+",
"1",
";",
"i",
"++",
")",
"{",
"int",
"n",
"="... | Check if the given point is on the path
@param path The path to check
@param x The x coordinate of the point to check
@param y The y coordiante of teh point to check
@return True if the point is on the path | [
"Check",
"if",
"the",
"given",
"point",
"is",
"on",
"the",
"path"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/geom/GeomUtil.java#L79-L89 |
srikalyc/Sql4D | Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/Util.java | Util.applyKVToBean | public static void applyKVToBean(Object bean, String key, Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
"""
More granular(sets the property of a bean based on a key value).
@param bean
@param key
@param value
@throws NoSuchMethodExce... | java | public static void applyKVToBean(Object bean, String key, Object value) throws NoSuchMethodException, IllegalAccessException, IllegalArgumentException, InvocationTargetException {
Method getterMethod = bean.getClass().getMethod(Util.getterMethodName(key));
Method setterMethod = bean.getClass().getMethod... | [
"public",
"static",
"void",
"applyKVToBean",
"(",
"Object",
"bean",
",",
"String",
"key",
",",
"Object",
"value",
")",
"throws",
"NoSuchMethodException",
",",
"IllegalAccessException",
",",
"IllegalArgumentException",
",",
"InvocationTargetException",
"{",
"Method",
"... | More granular(sets the property of a bean based on a key value).
@param bean
@param key
@param value
@throws NoSuchMethodException
@throws IllegalAccessException
@throws IllegalArgumentException
@throws InvocationTargetException | [
"More",
"granular",
"(",
"sets",
"the",
"property",
"of",
"a",
"bean",
"based",
"on",
"a",
"key",
"value",
")",
"."
] | train | https://github.com/srikalyc/Sql4D/blob/2c052fe60ead5a16277c798a3440de7d4f6f24f6/Sql4Ddriver/src/main/java/com/yahoo/sql4d/sql4ddriver/Util.java#L252-L256 |
derari/cthul | objects/src/main/java/org/cthul/objects/reflection/Signatures.java | Signatures.bestMatch | public static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException {
"""
Selects the best match in signatures for the given argument types.
@param signatures
@param varArgs
@param argTypes
@return index of best signature, -1 if nothing matched
... | java | public static int bestMatch(Class<?>[][] signatures, boolean[] varArgs, Class<?>[] argTypes) throws AmbiguousSignatureMatchException {
return bestMatch(signatures, varArgs, new JavaSignatureComparator(argTypes));
} | [
"public",
"static",
"int",
"bestMatch",
"(",
"Class",
"<",
"?",
">",
"[",
"]",
"[",
"]",
"signatures",
",",
"boolean",
"[",
"]",
"varArgs",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"argTypes",
")",
"throws",
"AmbiguousSignatureMatchException",
"{",
"return... | Selects the best match in signatures for the given argument types.
@param signatures
@param varArgs
@param argTypes
@return index of best signature, -1 if nothing matched
@throws AmbiguousSignatureMatchException if two signatures matched equally | [
"Selects",
"the",
"best",
"match",
"in",
"signatures",
"for",
"the",
"given",
"argument",
"types",
"."
] | train | https://github.com/derari/cthul/blob/74a31e3cb6a94f5f25cc5253d1dbd42e19a17ebc/objects/src/main/java/org/cthul/objects/reflection/Signatures.java#L421-L423 |
dwdyer/uncommons-maths | core/src/java/main/org/uncommons/maths/binary/BitString.java | BitString.setBit | public void setBit(int index, boolean set) {
"""
Sets the bit at the specified index.
@param index The index of the bit to set (0 is the least-significant bit).
@param set A boolean indicating whether the bit should be set or not.
@throws IndexOutOfBoundsException If the specified index is not a bit
position i... | java | public void setBit(int index, boolean set)
{
assertValidIndex(index);
int word = index / WORD_LENGTH;
int offset = index % WORD_LENGTH;
if (set)
{
data[word] |= (1 << offset);
}
else // Unset the bit.
{
data[word] &= ~(1 << offs... | [
"public",
"void",
"setBit",
"(",
"int",
"index",
",",
"boolean",
"set",
")",
"{",
"assertValidIndex",
"(",
"index",
")",
";",
"int",
"word",
"=",
"index",
"/",
"WORD_LENGTH",
";",
"int",
"offset",
"=",
"index",
"%",
"WORD_LENGTH",
";",
"if",
"(",
"set"... | Sets the bit at the specified index.
@param index The index of the bit to set (0 is the least-significant bit).
@param set A boolean indicating whether the bit should be set or not.
@throws IndexOutOfBoundsException If the specified index is not a bit
position in this bit string. | [
"Sets",
"the",
"bit",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BitString.java#L145-L158 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateRouteResponseResult.java | CreateRouteResponseResult.withResponseModels | public CreateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
"""
<p>
Represents the response models of a route response.
</p>
@param responseModels
Represents the response models of a route response.
@return Returns a reference to this object so that method calls can b... | java | public CreateRouteResponseResult withResponseModels(java.util.Map<String, String> responseModels) {
setResponseModels(responseModels);
return this;
} | [
"public",
"CreateRouteResponseResult",
"withResponseModels",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseModels",
")",
"{",
"setResponseModels",
"(",
"responseModels",
")",
";",
"return",
"this",
";",
"}"
] | <p>
Represents the response models of a route response.
</p>
@param responseModels
Represents the response models of a route response.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"Represents",
"the",
"response",
"models",
"of",
"a",
"route",
"response",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/CreateRouteResponseResult.java#L127-L130 |
ops4j/org.ops4j.pax.logging | pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java | LoggerRegistry.getLogger | public T getLogger(final String name, final MessageFactory messageFactory) {
"""
Returns an ExtendedLogger.
@param name The name of the Logger to return.
@param messageFactory The message factory is used only when creating a logger, subsequent use does not change
the logger but will log a warning if mismatched.... | java | public T getLogger(final String name, final MessageFactory messageFactory) {
return getOrCreateInnerMap(factoryKey(messageFactory)).get(name);
} | [
"public",
"T",
"getLogger",
"(",
"final",
"String",
"name",
",",
"final",
"MessageFactory",
"messageFactory",
")",
"{",
"return",
"getOrCreateInnerMap",
"(",
"factoryKey",
"(",
"messageFactory",
")",
")",
".",
"get",
"(",
"name",
")",
";",
"}"
] | Returns an ExtendedLogger.
@param name The name of the Logger to return.
@param messageFactory The message factory is used only when creating a logger, subsequent use does not change
the logger but will log a warning if mismatched.
@return The logger with the specified name. | [
"Returns",
"an",
"ExtendedLogger",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-api/src/main/java/org/apache/logging/log4j/spi/LoggerRegistry.java#L124-L126 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/util/BitMaskUtil.java | BitMaskUtil.isBitOn | public static boolean isBitOn(int value, int bitNumber) {
"""
Check if the bit is set to '1'
@param value integer to check bit
@param number of bit to check (right first bit starting at 1)
"""
ensureBitRange(bitNumber);
return ((value & MASKS[bitNumber - 1]) == MASKS[bitNumber - 1]);
} | java | public static boolean isBitOn(int value, int bitNumber) {
ensureBitRange(bitNumber);
return ((value & MASKS[bitNumber - 1]) == MASKS[bitNumber - 1]);
} | [
"public",
"static",
"boolean",
"isBitOn",
"(",
"int",
"value",
",",
"int",
"bitNumber",
")",
"{",
"ensureBitRange",
"(",
"bitNumber",
")",
";",
"return",
"(",
"(",
"value",
"&",
"MASKS",
"[",
"bitNumber",
"-",
"1",
"]",
")",
"==",
"MASKS",
"[",
"bitNum... | Check if the bit is set to '1'
@param value integer to check bit
@param number of bit to check (right first bit starting at 1) | [
"Check",
"if",
"the",
"bit",
"is",
"set",
"to",
"1"
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/util/BitMaskUtil.java#L73-L76 |
joestelmach/natty | src/main/java/com/joestelmach/natty/WalkerState.java | WalkerState.seekBySpan | public void seekBySpan(String direction, String seekAmount, String span) {
"""
seeks by a span of time (weeks, months, etc)
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekAmount the amount to seek. Must be guaranteed to parse as an integer
@param spa... | java | public void seekBySpan(String direction, String seekAmount, String span) {
if(span.startsWith(SEEK_PREFIX)) span = span.substring(3);
int seekAmountInt = Integer.parseInt(seekAmount);
assert(direction.equals(DIR_LEFT) || direction.equals(DIR_RIGHT));
assert(span.equals(DAY) || span.equals(WEEK) || span.... | [
"public",
"void",
"seekBySpan",
"(",
"String",
"direction",
",",
"String",
"seekAmount",
",",
"String",
"span",
")",
"{",
"if",
"(",
"span",
".",
"startsWith",
"(",
"SEEK_PREFIX",
")",
")",
"span",
"=",
"span",
".",
"substring",
"(",
"3",
")",
";",
"in... | seeks by a span of time (weeks, months, etc)
@param direction the direction to seek: two possibilities
'<' go backward
'>' go forward
@param seekAmount the amount to seek. Must be guaranteed to parse as an integer
@param span | [
"seeks",
"by",
"a",
"span",
"of",
"time",
"(",
"weeks",
"months",
"etc",
")"
] | train | https://github.com/joestelmach/natty/blob/74389feb4c9372e51cd51eb0800a0177fec3e5a0/src/main/java/com/joestelmach/natty/WalkerState.java#L207-L236 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java | EntityManagerFactory.createEntityManager | public EntityManager createEntityManager(String projectId, InputStream jsonCredentialsStream) {
"""
Creates and return a new {@link EntityManager} using the provided JSON formatted credentials.
@param projectId
the project ID
@param jsonCredentialsStream
the JSON formatted credentials for the target Cloud ... | java | public EntityManager createEntityManager(String projectId, InputStream jsonCredentialsStream) {
return createEntityManager(projectId, jsonCredentialsStream, null);
} | [
"public",
"EntityManager",
"createEntityManager",
"(",
"String",
"projectId",
",",
"InputStream",
"jsonCredentialsStream",
")",
"{",
"return",
"createEntityManager",
"(",
"projectId",
",",
"jsonCredentialsStream",
",",
"null",
")",
";",
"}"
] | Creates and return a new {@link EntityManager} using the provided JSON formatted credentials.
@param projectId
the project ID
@param jsonCredentialsStream
the JSON formatted credentials for the target Cloud project.
@return a new {@link EntityManager} | [
"Creates",
"and",
"return",
"a",
"new",
"{",
"@link",
"EntityManager",
"}",
"using",
"the",
"provided",
"JSON",
"formatted",
"credentials",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/EntityManagerFactory.java#L116-L118 |
lucee/Lucee | core/src/main/java/lucee/runtime/tag/Mail.java | Mail.setTo | public void setTo(Object to) throws ApplicationException {
"""
set the value to The name of the e-mail message recipient.
@param strTo value to set
@throws ApplicationException
"""
if (StringUtil.isEmpty(to)) return;
try {
smtp.addTo(to);
}
catch (Exception e) {
throw new ApplicationException... | java | public void setTo(Object to) throws ApplicationException {
if (StringUtil.isEmpty(to)) return;
try {
smtp.addTo(to);
}
catch (Exception e) {
throw new ApplicationException("attribute [to] of the tag [mail] is invalid", e.getMessage());
}
} | [
"public",
"void",
"setTo",
"(",
"Object",
"to",
")",
"throws",
"ApplicationException",
"{",
"if",
"(",
"StringUtil",
".",
"isEmpty",
"(",
"to",
")",
")",
"return",
";",
"try",
"{",
"smtp",
".",
"addTo",
"(",
"to",
")",
";",
"}",
"catch",
"(",
"Except... | set the value to The name of the e-mail message recipient.
@param strTo value to set
@throws ApplicationException | [
"set",
"the",
"value",
"to",
"The",
"name",
"of",
"the",
"e",
"-",
"mail",
"message",
"recipient",
"."
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/tag/Mail.java#L201-L209 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.