repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 192 | func_name stringlengths 5 108 | whole_func_string stringlengths 75 3.91k | language stringclasses 1
value | func_code_string stringlengths 75 3.91k | func_code_tokens listlengths 21 629 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 111 306 |
|---|---|---|---|---|---|---|---|---|---|---|
Whiley/WhileyCompiler | src/main/java/wyc/io/WhileyFileParser.java | WhileyFileParser.parseLambdaExpression | private Expr parseLambdaExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(Ampersand);
if (tryAndMatch(terminated, LeftBrace, LeftSquare, LeftAngle) != null) {
index = start; // backtrack
return parseLambdaInitialiser(scope, terminated);
} else {
index = start; // backtrack... | java | private Expr parseLambdaExpression(EnclosingScope scope, boolean terminated) {
int start = index;
match(Ampersand);
if (tryAndMatch(terminated, LeftBrace, LeftSquare, LeftAngle) != null) {
index = start; // backtrack
return parseLambdaInitialiser(scope, terminated);
} else {
index = start; // backtrack... | [
"private",
"Expr",
"parseLambdaExpression",
"(",
"EnclosingScope",
"scope",
",",
"boolean",
"terminated",
")",
"{",
"int",
"start",
"=",
"index",
";",
"match",
"(",
"Ampersand",
")",
";",
"if",
"(",
"tryAndMatch",
"(",
"terminated",
",",
"LeftBrace",
",",
"L... | Parse a lambda or address expression, which have the form:
<pre>
TermExpr::= ...
| '&' [ '[' [ Lifetime (',' Lifetime )* ] ']' ]
[ '<' [ Identifier (',' Identifier)* ] '>' ]
'(' [Type Identifier (',' Type Identifier)*] '->' Expr ')'
| '&' Identifier [ '(' Type (',' Type)* ')']
</pre>
Disambiguating these two forms... | [
"Parse",
"a",
"lambda",
"or",
"address",
"expression",
"which",
"have",
"the",
"form",
":"
] | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyc/io/WhileyFileParser.java#L3131-L3141 |
docusign/docusign-java-client | src/main/java/com/docusign/esign/api/EnvelopesApi.java | EnvelopesApi.getDocumentPageImage | public byte[] getDocumentPageImage(String accountId, String envelopeId, String documentId, String pageNumber) throws ApiException {
return getDocumentPageImage(accountId, envelopeId, documentId, pageNumber, null);
} | java | public byte[] getDocumentPageImage(String accountId, String envelopeId, String documentId, String pageNumber) throws ApiException {
return getDocumentPageImage(accountId, envelopeId, documentId, pageNumber, null);
} | [
"public",
"byte",
"[",
"]",
"getDocumentPageImage",
"(",
"String",
"accountId",
",",
"String",
"envelopeId",
",",
"String",
"documentId",
",",
"String",
"pageNumber",
")",
"throws",
"ApiException",
"{",
"return",
"getDocumentPageImage",
"(",
"accountId",
",",
"env... | Gets a page image from an envelope for display.
Retrieves a page image for display from the specified envelope.
@param accountId The external account number (int) or account ID Guid. (required)
@param envelopeId The envelopeId Guid of the envelope being accessed. (required)
@param documentId The ID of the document bein... | [
"Gets",
"a",
"page",
"image",
"from",
"an",
"envelope",
"for",
"display",
".",
"Retrieves",
"a",
"page",
"image",
"for",
"display",
"from",
"the",
"specified",
"envelope",
"."
] | train | https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/EnvelopesApi.java#L2346-L2348 |
apache/spark | sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java | MetadataOperation.convertPattern | private String convertPattern(final String pattern, boolean datanucleusFormat) {
String wStr;
if (datanucleusFormat) {
wStr = "*";
} else {
wStr = ".*";
}
return pattern
.replaceAll("([^\\\\])%", "$1" + wStr).replaceAll("\\\\%", "%").replaceAll("^%", wStr)
.replaceAll("([... | java | private String convertPattern(final String pattern, boolean datanucleusFormat) {
String wStr;
if (datanucleusFormat) {
wStr = "*";
} else {
wStr = ".*";
}
return pattern
.replaceAll("([^\\\\])%", "$1" + wStr).replaceAll("\\\\%", "%").replaceAll("^%", wStr)
.replaceAll("([... | [
"private",
"String",
"convertPattern",
"(",
"final",
"String",
"pattern",
",",
"boolean",
"datanucleusFormat",
")",
"{",
"String",
"wStr",
";",
"if",
"(",
"datanucleusFormat",
")",
"{",
"wStr",
"=",
"\"*\"",
";",
"}",
"else",
"{",
"wStr",
"=",
"\".*\"",
";... | Convert a pattern containing JDBC catalog search wildcards into
Java regex patterns.
@param pattern input which may contain '%' or '_' wildcard characters, or
these characters escaped using {@link #getSearchStringEscape()}.
@return replace %/_ with regex search characters, also handle escaped
characters.
The datanucl... | [
"Convert",
"a",
"pattern",
"containing",
"JDBC",
"catalog",
"search",
"wildcards",
"into",
"Java",
"regex",
"patterns",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/hive-thriftserver/src/main/java/org/apache/hive/service/cli/operation/MetadataOperation.java#L97-L107 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCacheBase.java | DCacheBase.increaseCacheSizeInBytes | public void increaseCacheSizeInBytes(long size, String msg) {
if (this.memoryCacheSizeInMBEnabled) {
this.currentMemoryCacheSizeInBytes += size;
if (tc.isDebugEnabled()) {
Tr.debug(tc, "increaseCacheSizeInBytes() cacheName=" + cacheName + " " + msg + " size=" + size + " c... | java | public void increaseCacheSizeInBytes(long size, String msg) {
if (this.memoryCacheSizeInMBEnabled) {
this.currentMemoryCacheSizeInBytes += size;
if (tc.isDebugEnabled()) {
Tr.debug(tc, "increaseCacheSizeInBytes() cacheName=" + cacheName + " " + msg + " size=" + size + " c... | [
"public",
"void",
"increaseCacheSizeInBytes",
"(",
"long",
"size",
",",
"String",
"msg",
")",
"{",
"if",
"(",
"this",
".",
"memoryCacheSizeInMBEnabled",
")",
"{",
"this",
".",
"currentMemoryCacheSizeInBytes",
"+=",
"size",
";",
"if",
"(",
"tc",
".",
"isDebugEn... | Increase cache size in bytes to the total count
@param size
The size to be increased | [
"Increase",
"cache",
"size",
"in",
"bytes",
"to",
"the",
"total",
"count"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/DCacheBase.java#L288-L296 |
ops4j/org.ops4j.pax.wicket | service/src/main/java/org/ops4j/pax/wicket/internal/PaxWicketAppFactoryTracker.java | PaxWicketAppFactoryTracker.addingService | public void addingService(ServiceReference<WebApplicationFactory<?>> reference, WebApplicationFactory<?> service) {
PaxWicketApplicationFactory internalFactory =
PaxWicketApplicationFactory.createPaxWicketApplicationFactory(context, service, reference);
addApplication(reference, internalFact... | java | public void addingService(ServiceReference<WebApplicationFactory<?>> reference, WebApplicationFactory<?> service) {
PaxWicketApplicationFactory internalFactory =
PaxWicketApplicationFactory.createPaxWicketApplicationFactory(context, service, reference);
addApplication(reference, internalFact... | [
"public",
"void",
"addingService",
"(",
"ServiceReference",
"<",
"WebApplicationFactory",
"<",
"?",
">",
">",
"reference",
",",
"WebApplicationFactory",
"<",
"?",
">",
"service",
")",
"{",
"PaxWicketApplicationFactory",
"internalFactory",
"=",
"PaxWicketApplicationFacto... | <p>addingService.</p>
@param reference a {@link org.osgi.framework.ServiceReference} object.
@param service a {@link org.ops4j.pax.wicket.api.WebApplicationFactory} object. | [
"<p",
">",
"addingService",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ops4j/org.ops4j.pax.wicket/blob/ef7cb4bdf918e9e61ec69789b9c690567616faa9/service/src/main/java/org/ops4j/pax/wicket/internal/PaxWicketAppFactoryTracker.java#L64-L68 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.completeMultipartUpload | public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST);
internalRequest.addParameter("uploadId", request.get... | java | public CompleteMultipartUploadResponse completeMultipartUpload(CompleteMultipartUploadRequest request) {
checkNotNull(request, "request should not be null.");
InternalRequest internalRequest = this.createRequest(request, HttpMethodName.POST);
internalRequest.addParameter("uploadId", request.get... | [
"public",
"CompleteMultipartUploadResponse",
"completeMultipartUpload",
"(",
"CompleteMultipartUploadRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"request should not be null.\"",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"this",
".",
"creat... | Completes a multipart upload by assembling previously uploaded parts.
@param request The CompleteMultipartUploadRequest object that specifies all the parameters of this operation.
@return A CompleteMultipartUploadResponse from Bos containing the ETag for
the new object composed of the individual parts. | [
"Completes",
"a",
"multipart",
"upload",
"by",
"assembling",
"previously",
"uploaded",
"parts",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L1253-L1297 |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java | MultiObserverImpl.unimplemented | private <TEvent> void unimplemented(final long identifier, final TEvent event) {
LOG.log(Level.SEVERE, "Unimplemented event: [{0}]: {1}", new Object[] {identifier, event});
throw new RuntimeException("Event not supported: " + event);
} | java | private <TEvent> void unimplemented(final long identifier, final TEvent event) {
LOG.log(Level.SEVERE, "Unimplemented event: [{0}]: {1}", new Object[] {identifier, event});
throw new RuntimeException("Event not supported: " + event);
} | [
"private",
"<",
"TEvent",
">",
"void",
"unimplemented",
"(",
"final",
"long",
"identifier",
",",
"final",
"TEvent",
"event",
")",
"{",
"LOG",
".",
"log",
"(",
"Level",
".",
"SEVERE",
",",
"\"Unimplemented event: [{0}]: {1}\"",
",",
"new",
"Object",
"[",
"]",... | Called when an event is received that does not have an onNext method definition
in TSubCls. Override in TSubClas to handle the error.
@param event A reference to an object which is an event not handled by TSubCls.
@param <TEvent> The type of the event being processed. | [
"Called",
"when",
"an",
"event",
"is",
"received",
"that",
"does",
"not",
"have",
"an",
"onNext",
"method",
"definition",
"in",
"TSubCls",
".",
"Override",
"in",
"TSubClas",
"to",
"handle",
"the",
"error",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/impl/MultiObserverImpl.java#L65-L68 |
elki-project/elki | elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java | LevenshteinDistanceFunction.levenshteinDistance | public static int levenshteinDistance(String o1, String o2) {
// Let o1 be the shorter one:
if(o1.length() > o2.length()) {
return levenshteinDistance(o2, o1);
}
final int l1 = o1.length(), l2 = o2.length();
// Exploit that Java caches the hash code of strings:
if(l1 == l2 && o1.hashCode()... | java | public static int levenshteinDistance(String o1, String o2) {
// Let o1 be the shorter one:
if(o1.length() > o2.length()) {
return levenshteinDistance(o2, o1);
}
final int l1 = o1.length(), l2 = o2.length();
// Exploit that Java caches the hash code of strings:
if(l1 == l2 && o1.hashCode()... | [
"public",
"static",
"int",
"levenshteinDistance",
"(",
"String",
"o1",
",",
"String",
"o2",
")",
"{",
"// Let o1 be the shorter one:",
"if",
"(",
"o1",
".",
"length",
"(",
")",
">",
"o2",
".",
"length",
"(",
")",
")",
"{",
"return",
"levenshteinDistance",
... | Levenshtein distance for two strings.
@param o1 First string
@param o2 Second string
@return Levenshtein distance | [
"Levenshtein",
"distance",
"for",
"two",
"strings",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-distance/src/main/java/de/lmu/ifi/dbs/elki/distance/distancefunction/strings/LevenshteinDistanceFunction.java#L84-L106 |
salesforce/Argus | ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java | DashboardDto.transformToDto | public static DashboardDto transformToDto(Dashboard dashboard) {
if (dashboard == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
DashboardDto result = createDtoObject(DashboardDto.class, dashboard);... | java | public static DashboardDto transformToDto(Dashboard dashboard) {
if (dashboard == null) {
throw new WebApplicationException("Null entity object cannot be converted to Dto object.", Status.INTERNAL_SERVER_ERROR);
}
DashboardDto result = createDtoObject(DashboardDto.class, dashboard);... | [
"public",
"static",
"DashboardDto",
"transformToDto",
"(",
"Dashboard",
"dashboard",
")",
"{",
"if",
"(",
"dashboard",
"==",
"null",
")",
"{",
"throw",
"new",
"WebApplicationException",
"(",
"\"Null entity object cannot be converted to Dto object.\"",
",",
"Status",
"."... | Converts dashboard entity to dashboardDto.
@param dashboard The dashboard object. Cannot be null.
@return DashboardDto object.
@throws WebApplicationException If an error occurs. | [
"Converts",
"dashboard",
"entity",
"to",
"dashboardDto",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/DashboardDto.java#L77-L86 |
cdk/cdk | base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java | GeometryUtil.translate2DCenterTo | public static void translate2DCenterTo(IAtomContainer container, Point2d p) {
Point2d com = get2DCenter(container);
Vector2d translation = new Vector2d(p.x - com.x, p.y - com.y);
for (IAtom atom : container.atoms()) {
if (atom.getPoint2d() != null) {
atom.getPoint2d()... | java | public static void translate2DCenterTo(IAtomContainer container, Point2d p) {
Point2d com = get2DCenter(container);
Vector2d translation = new Vector2d(p.x - com.x, p.y - com.y);
for (IAtom atom : container.atoms()) {
if (atom.getPoint2d() != null) {
atom.getPoint2d()... | [
"public",
"static",
"void",
"translate2DCenterTo",
"(",
"IAtomContainer",
"container",
",",
"Point2d",
"p",
")",
"{",
"Point2d",
"com",
"=",
"get2DCenter",
"(",
"container",
")",
";",
"Vector2d",
"translation",
"=",
"new",
"Vector2d",
"(",
"p",
".",
"x",
"-"... | Translates the geometric 2DCenter of the given AtomContainer container to the specified
Point2d p.
@param container AtomContainer which should be translated.
@param p New Location of the geometric 2D Center.
@see #get2DCenter
@see #translate2DCentreOfMassTo | [
"Translates",
"the",
"geometric",
"2DCenter",
"of",
"the",
"given",
"AtomContainer",
"container",
"to",
"the",
"specified",
"Point2d",
"p",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/standard/src/main/java/org/openscience/cdk/geometry/GeometryUtil.java#L521-L529 |
revelytix/spark | spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java | XMLResultsParser.getBase | static private String getBase(String oldBase, XMLStreamReader rdr) {
String newBase = resolve(oldBase, rdr.getAttributeValue(XML_NS, BASE));
if (newBase != oldBase) {
logger.debug("xml:base is now {}", newBase);
}
return newBase;
} | java | static private String getBase(String oldBase, XMLStreamReader rdr) {
String newBase = resolve(oldBase, rdr.getAttributeValue(XML_NS, BASE));
if (newBase != oldBase) {
logger.debug("xml:base is now {}", newBase);
}
return newBase;
} | [
"static",
"private",
"String",
"getBase",
"(",
"String",
"oldBase",
",",
"XMLStreamReader",
"rdr",
")",
"{",
"String",
"newBase",
"=",
"resolve",
"(",
"oldBase",
",",
"rdr",
".",
"getAttributeValue",
"(",
"XML_NS",
",",
"BASE",
")",
")",
";",
"if",
"(",
... | Returns the new base URI, based on the old base URI and the xml:base value in the current element. | [
"Returns",
"the",
"new",
"base",
"URI",
"based",
"on",
"the",
"old",
"base",
"URI",
"and",
"the",
"xml",
":",
"base",
"value",
"in",
"the",
"current",
"element",
"."
] | train | https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/parser/XMLResultsParser.java#L222-L228 |
onepf/OpenIAB | library/src/main/java/org/onepf/oms/SkuManager.java | SkuManager.mapSku | @NotNull
public SkuManager mapSku(String sku, @Nullable Map<String, String> storeSkus) {
if (storeSkus == null) {
throw new SkuMappingException("Store skus map can't be null.");
}
for (Map.Entry<String, String> entry : storeSkus.entrySet()) {
mapSku(sku, entry.getKey... | java | @NotNull
public SkuManager mapSku(String sku, @Nullable Map<String, String> storeSkus) {
if (storeSkus == null) {
throw new SkuMappingException("Store skus map can't be null.");
}
for (Map.Entry<String, String> entry : storeSkus.entrySet()) {
mapSku(sku, entry.getKey... | [
"@",
"NotNull",
"public",
"SkuManager",
"mapSku",
"(",
"String",
"sku",
",",
"@",
"Nullable",
"Map",
"<",
"String",
",",
"String",
">",
"storeSkus",
")",
"{",
"if",
"(",
"storeSkus",
"==",
"null",
")",
"{",
"throw",
"new",
"SkuMappingException",
"(",
"\"... | Maps a base internal SKU to a store-specific SKU.
The best approach is to use SKU like <code>com.companyname.application.item</code>.
Such SKU fits most of stores so it doesn't need to be mapped.
If this approach is not applicable, use application internal SKU in the code (usually it is a SKU for Google Play)
and map S... | [
"Maps",
"a",
"base",
"internal",
"SKU",
"to",
"a",
"store",
"-",
"specific",
"SKU",
".",
"The",
"best",
"approach",
"is",
"to",
"use",
"SKU",
"like",
"<code",
">",
"com",
".",
"companyname",
".",
"application",
".",
"item<",
"/",
"code",
">",
".",
"S... | train | https://github.com/onepf/OpenIAB/blob/90552d53c5303b322940d96a0c4b7cb797d78760/library/src/main/java/org/onepf/oms/SkuManager.java#L139-L149 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java | PersonGroupPersonsImpl.updateAsync | public Observable<Void> updateAsync(String personGroupId, UUID personId, UpdatePersonGroupPersonsOptionalParameter updateOptionalParameter) {
return updateWithServiceResponseAsync(personGroupId, personId, updateOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
p... | java | public Observable<Void> updateAsync(String personGroupId, UUID personId, UpdatePersonGroupPersonsOptionalParameter updateOptionalParameter) {
return updateWithServiceResponseAsync(personGroupId, personId, updateOptionalParameter).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
p... | [
"public",
"Observable",
"<",
"Void",
">",
"updateAsync",
"(",
"String",
"personGroupId",
",",
"UUID",
"personId",
",",
"UpdatePersonGroupPersonsOptionalParameter",
"updateOptionalParameter",
")",
"{",
"return",
"updateWithServiceResponseAsync",
"(",
"personGroupId",
",",
... | Update name or userData of a person.
@param personGroupId Id referencing a particular person group.
@param personId Id referencing a particular person.
@param updateOptionalParameter the object representing the optional parameters to be set before calling this API
@throws IllegalArgumentException thrown if parameters ... | [
"Update",
"name",
"or",
"userData",
"of",
"a",
"person",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/faceapi/src/main/java/com/microsoft/azure/cognitiveservices/vision/faceapi/implementation/PersonGroupPersonsImpl.java#L647-L654 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java | ConstantsSummaryBuilder.buildConstantSummaries | public void buildConstantSummaries(XMLNode node, Content contentTree) {
PackageDoc[] packages = configuration.packages;
printedPackageHeaders = new HashSet<String>();
Content summariesTree = writer.getConstantSummaries();
for (int i = 0; i < packages.length; i++) {
if (hasCon... | java | public void buildConstantSummaries(XMLNode node, Content contentTree) {
PackageDoc[] packages = configuration.packages;
printedPackageHeaders = new HashSet<String>();
Content summariesTree = writer.getConstantSummaries();
for (int i = 0; i < packages.length; i++) {
if (hasCon... | [
"public",
"void",
"buildConstantSummaries",
"(",
"XMLNode",
"node",
",",
"Content",
"contentTree",
")",
"{",
"PackageDoc",
"[",
"]",
"packages",
"=",
"configuration",
".",
"packages",
";",
"printedPackageHeaders",
"=",
"new",
"HashSet",
"<",
"String",
">",
"(",
... | Build the summary for each documented package.
@param node the XML element that specifies which components to document
@param contentTree the tree to which the summaries will be added | [
"Build",
"the",
"summary",
"for",
"each",
"documented",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java#L172-L184 |
fuinorg/utils4swing | src/main/java/org/fuin/utils4swing/common/Utils4Swing.java | Utils4Swing.loadIcon | public static ImageIcon loadIcon(final Class clasz, final String name) {
final URL url = Utils4J.getResource(clasz, name);
return new ImageIcon(url);
} | java | public static ImageIcon loadIcon(final Class clasz, final String name) {
final URL url = Utils4J.getResource(clasz, name);
return new ImageIcon(url);
} | [
"public",
"static",
"ImageIcon",
"loadIcon",
"(",
"final",
"Class",
"clasz",
",",
"final",
"String",
"name",
")",
"{",
"final",
"URL",
"url",
"=",
"Utils4J",
".",
"getResource",
"(",
"clasz",
",",
"name",
")",
";",
"return",
"new",
"ImageIcon",
"(",
"url... | Load an icon located in the same package as a given class.
@param clasz
Class with the same package where the icon is located.
@param name
Filename of the icon.
@return New icon instance. | [
"Load",
"an",
"icon",
"located",
"in",
"the",
"same",
"package",
"as",
"a",
"given",
"class",
"."
] | train | https://github.com/fuinorg/utils4swing/blob/560fb69eac182e3473de9679c3c15433e524ef6b/src/main/java/org/fuin/utils4swing/common/Utils4Swing.java#L124-L127 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsSliderMap.java | CmsSliderMap.setSliderPosition | public void setSliderPosition(float x, float y) {
if (x > 255) {
x = 255;
}
if (x < 0) {
x = 0;
}
if (y > 255) {
y = 255;
}
if (y < 0) {
y = 0;
}
x -= 7;
y -= 7;
m_sli... | java | public void setSliderPosition(float x, float y) {
if (x > 255) {
x = 255;
}
if (x < 0) {
x = 0;
}
if (y > 255) {
y = 255;
}
if (y < 0) {
y = 0;
}
x -= 7;
y -= 7;
m_sli... | [
"public",
"void",
"setSliderPosition",
"(",
"float",
"x",
",",
"float",
"y",
")",
"{",
"if",
"(",
"x",
">",
"255",
")",
"{",
"x",
"=",
"255",
";",
"}",
"if",
"(",
"x",
"<",
"0",
")",
"{",
"x",
"=",
"0",
";",
"}",
"if",
"(",
"y",
">",
"255... | Sets the slider's position along the x-axis and y-axis.<p>
@param x position along the x-axis [0-256]
@param y position along the y-axis [0-256] | [
"Sets",
"the",
"slider",
"s",
"position",
"along",
"the",
"x",
"-",
"axis",
"and",
"y",
"-",
"axis",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/colorpicker/CmsSliderMap.java#L229-L247 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java | FhirTerser.getValues | public <T> List<T> getValues(IBaseResource theResource, String thePath, Class<T> theWantedClass, boolean theCreate) {
RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource);
List<String> parts = parsePath(def, thePath);
return getValues(def, theResource, parts, theWantedClass, theCreate, fal... | java | public <T> List<T> getValues(IBaseResource theResource, String thePath, Class<T> theWantedClass, boolean theCreate) {
RuntimeResourceDefinition def = myContext.getResourceDefinition(theResource);
List<String> parts = parsePath(def, thePath);
return getValues(def, theResource, parts, theWantedClass, theCreate, fal... | [
"public",
"<",
"T",
">",
"List",
"<",
"T",
">",
"getValues",
"(",
"IBaseResource",
"theResource",
",",
"String",
"thePath",
",",
"Class",
"<",
"T",
">",
"theWantedClass",
",",
"boolean",
"theCreate",
")",
"{",
"RuntimeResourceDefinition",
"def",
"=",
"myCont... | Returns values stored in an element identified by its path. The list of values is of
type <code>theWantedClass</code>.
@param theResource The resource instance to be accessed. Must not be null.
@param thePath The path for the element to be accessed.
@param theWantedClass The desired class to be returned in a... | [
"Returns",
"values",
"stored",
"in",
"an",
"element",
"identified",
"by",
"its",
"path",
".",
"The",
"list",
"of",
"values",
"is",
"of",
"type",
"<code",
">",
"theWantedClass<",
"/",
"code",
">",
"."
] | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/FhirTerser.java#L549-L553 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java | DocTreeScanner.visitSerialData | @Override
public R visitSerialData(SerialDataTree node, P p) {
return scan(node.getDescription(), p);
} | java | @Override
public R visitSerialData(SerialDataTree node, P p) {
return scan(node.getDescription(), p);
} | [
"@",
"Override",
"public",
"R",
"visitSerialData",
"(",
"SerialDataTree",
"node",
",",
"P",
"p",
")",
"{",
"return",
"scan",
"(",
"node",
".",
"getDescription",
"(",
")",
",",
"p",
")",
";",
"}"
] | {@inheritDoc} This implementation scans the children in left to right order.
@param node {@inheritDoc}
@param p {@inheritDoc}
@return the result of scanning | [
"{",
"@inheritDoc",
"}",
"This",
"implementation",
"scans",
"the",
"children",
"in",
"left",
"to",
"right",
"order",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/DocTreeScanner.java#L396-L399 |
undertow-io/undertow | core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java | NodePingUtil.pingNode | static void pingNode(final Node node, final HttpServerExchange exchange, final PingCallback callback) {
if (node == null) {
callback.failed();
return;
}
final int timeout = node.getNodeConfig().getPing();
exchange.dispatch(exchange.isInIoThread() ? SameThreadExec... | java | static void pingNode(final Node node, final HttpServerExchange exchange, final PingCallback callback) {
if (node == null) {
callback.failed();
return;
}
final int timeout = node.getNodeConfig().getPing();
exchange.dispatch(exchange.isInIoThread() ? SameThreadExec... | [
"static",
"void",
"pingNode",
"(",
"final",
"Node",
"node",
",",
"final",
"HttpServerExchange",
"exchange",
",",
"final",
"PingCallback",
"callback",
")",
"{",
"if",
"(",
"node",
"==",
"null",
")",
"{",
"callback",
".",
"failed",
"(",
")",
";",
"return",
... | Try to ping a node using it's connection pool.
@param node the node
@param exchange the http servers exchange
@param callback the ping callback | [
"Try",
"to",
"ping",
"a",
"node",
"using",
"it",
"s",
"connection",
"pool",
"."
] | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/core/src/main/java/io/undertow/server/handlers/proxy/mod_cluster/NodePingUtil.java#L120-L157 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.deleteAll | @SafeVarargs
public static <T> T[] deleteAll(final T[] a, int... indices) {
N.checkArgNotNull(a, "a");
if (N.isNullOrEmpty(indices)) {
return a.clone();
} else if (indices.length == 1) {
return delete(a, indices[0]);
}
indices = indices.clo... | java | @SafeVarargs
public static <T> T[] deleteAll(final T[] a, int... indices) {
N.checkArgNotNull(a, "a");
if (N.isNullOrEmpty(indices)) {
return a.clone();
} else if (indices.length == 1) {
return delete(a, indices[0]);
}
indices = indices.clo... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"T",
"[",
"]",
"deleteAll",
"(",
"final",
"T",
"[",
"]",
"a",
",",
"int",
"...",
"indices",
")",
"{",
"N",
".",
"checkArgNotNull",
"(",
"a",
",",
"\"a\"",
")",
";",
"if",
"(",
"N",
".",
"is... | <p>
Removes the elements at the specified positions from the specified array.
All remaining elements are shifted to the left.
</p>
<p>
This method returns a new array with the same elements of the input array
except those at the specified positions. The component type of the
returned array is always the same as that o... | [
"<p",
">",
"Removes",
"the",
"elements",
"at",
"the",
"specified",
"positions",
"from",
"the",
"specified",
"array",
".",
"All",
"remaining",
"elements",
"are",
"shifted",
"to",
"the",
"left",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L22367-L22380 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java | EllipsesIntoClusters.axisAdjustedDistanceSq | static double axisAdjustedDistanceSq(EllipseRotated_F64 a , EllipseRotated_F64 b ) {
double dx = b.center.x - a.center.x;
double dy = b.center.y - a.center.y;
double c = Math.cos(a.phi);
double s = Math.sin(a.phi);
// rotate into ellipse's coordinate frame
// scale by ratio of major/minor axis
double x ... | java | static double axisAdjustedDistanceSq(EllipseRotated_F64 a , EllipseRotated_F64 b ) {
double dx = b.center.x - a.center.x;
double dy = b.center.y - a.center.y;
double c = Math.cos(a.phi);
double s = Math.sin(a.phi);
// rotate into ellipse's coordinate frame
// scale by ratio of major/minor axis
double x ... | [
"static",
"double",
"axisAdjustedDistanceSq",
"(",
"EllipseRotated_F64",
"a",
",",
"EllipseRotated_F64",
"b",
")",
"{",
"double",
"dx",
"=",
"b",
".",
"center",
".",
"x",
"-",
"a",
".",
"center",
".",
"x",
";",
"double",
"dy",
"=",
"b",
".",
"center",
... | Compute a new distance that two ellipses are apart using major/minor axis size. If the axises are the
same size then there is no change. If the minor axis is much smaller and ellipse b lies along that
axis then the returned distance will be greater. | [
"Compute",
"a",
"new",
"distance",
"that",
"two",
"ellipses",
"are",
"apart",
"using",
"major",
"/",
"minor",
"axis",
"size",
".",
"If",
"the",
"axises",
"are",
"the",
"same",
"size",
"then",
"there",
"is",
"no",
"change",
".",
"If",
"the",
"minor",
"a... | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/calib/circle/EllipsesIntoClusters.java#L272-L285 |
tvesalainen/util | util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java | ChannelHelper.traceableChannel | public static final SeekableByteChannel traceableChannel(SeekableByteChannel channel, Consumer<ByteBuffer> tracer)
{
return new TraceableSeekableByteChannel(channel, tracer);
} | java | public static final SeekableByteChannel traceableChannel(SeekableByteChannel channel, Consumer<ByteBuffer> tracer)
{
return new TraceableSeekableByteChannel(channel, tracer);
} | [
"public",
"static",
"final",
"SeekableByteChannel",
"traceableChannel",
"(",
"SeekableByteChannel",
"channel",
",",
"Consumer",
"<",
"ByteBuffer",
">",
"tracer",
")",
"{",
"return",
"new",
"TraceableSeekableByteChannel",
"(",
"channel",
",",
"tracer",
")",
";",
"}"
... | Returns a SeeekableByteChannel having feature that for every read/write method the
tracer function is called with read/write data between position and limit.
<p>
This is planned to support calculating digestives.
@param channel
@param tracer
@return | [
"Returns",
"a",
"SeeekableByteChannel",
"having",
"feature",
"that",
"for",
"every",
"read",
"/",
"write",
"method",
"the",
"tracer",
"function",
"is",
"called",
"with",
"read",
"/",
"write",
"data",
"between",
"position",
"and",
"limit",
".",
"<p",
">",
"Th... | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/nio/channels/ChannelHelper.java#L627-L630 |
korpling/ANNIS | annis-libgui/src/main/java/annis/libgui/Background.java | Background.runWithCallback | public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback)
{
final UI ui = UI.getCurrent();
ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
ListenableFuture<T> future = exec.submit(job);
if(callback != null)
... | java | public static <T> void runWithCallback(Callable<T> job, final FutureCallback<T> callback)
{
final UI ui = UI.getCurrent();
ListeningExecutorService exec = MoreExecutors.listeningDecorator(Executors.newSingleThreadExecutor());
ListenableFuture<T> future = exec.submit(job);
if(callback != null)
... | [
"public",
"static",
"<",
"T",
">",
"void",
"runWithCallback",
"(",
"Callable",
"<",
"T",
">",
"job",
",",
"final",
"FutureCallback",
"<",
"T",
">",
"callback",
")",
"{",
"final",
"UI",
"ui",
"=",
"UI",
".",
"getCurrent",
"(",
")",
";",
"ListeningExecut... | Execute the job in the background and provide a callback which is called
when the job is finished.
It is guarantied that the callback is executed inside of the UI thread.
@param <T>
@param job
@param callback | [
"Execute",
"the",
"job",
"in",
"the",
"background",
"and",
"provide",
"a",
"callback",
"which",
"is",
"called",
"when",
"the",
"job",
"is",
"finished",
"."
] | train | https://github.com/korpling/ANNIS/blob/152a2e34832e015f73ac8ce8a7d4c32641641324/annis-libgui/src/main/java/annis/libgui/Background.java#L54-L94 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java | TldVarianceFilter.computeVarianceSafe | protected double computeVarianceSafe(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_zero(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_zero(integral, x0 - 1, ... | java | protected double computeVarianceSafe(int x0, int y0, int x1, int y1) {
// can use unsafe operations here since x0 > 0 and y0 > 0
double square = GIntegralImageOps.block_zero(integralSq, x0 - 1, y0 - 1, x1 - 1, y1 - 1);
double area = (x1-x0)*(y1-y0);
double mean = GIntegralImageOps.block_zero(integral, x0 - 1, ... | [
"protected",
"double",
"computeVarianceSafe",
"(",
"int",
"x0",
",",
"int",
"y0",
",",
"int",
"x1",
",",
"int",
"y1",
")",
"{",
"// can use unsafe operations here since x0 > 0 and y0 > 0",
"double",
"square",
"=",
"GIntegralImageOps",
".",
"block_zero",
"(",
"integr... | Computes the variance inside the specified rectangle.
@return variance | [
"Computes",
"the",
"variance",
"inside",
"the",
"specified",
"rectangle",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/tracker/tld/TldVarianceFilter.java#L120-L128 |
maestrano/maestrano-java | src/main/java/com/maestrano/net/ConnecClient.java | ConnecClient.getInstanceUrl | public String getInstanceUrl(String entityName, String groupId, String id) {
return connec.getHost() + getInstanceEndpoint(entityName, groupId, id);
} | java | public String getInstanceUrl(String entityName, String groupId, String id) {
return connec.getHost() + getInstanceEndpoint(entityName, groupId, id);
} | [
"public",
"String",
"getInstanceUrl",
"(",
"String",
"entityName",
",",
"String",
"groupId",
",",
"String",
"id",
")",
"{",
"return",
"connec",
".",
"getHost",
"(",
")",
"+",
"getInstanceEndpoint",
"(",
"entityName",
",",
"groupId",
",",
"id",
")",
";",
"}... | Return the url to the instance endpoint
@param entity
name
@param customer
group id
@param entity
id
@return instance url | [
"Return",
"the",
"url",
"to",
"the",
"instance",
"endpoint"
] | train | https://github.com/maestrano/maestrano-java/blob/e71c6d3172d7645529d678d1cb3ea9e0a59de314/src/main/java/com/maestrano/net/ConnecClient.java#L114-L116 |
dodie/scott | scott/src/main/java/hu/advancedweb/scott/instrumentation/transformation/ScopeExtractorMethodVisitor.java | ScopeExtractorMethodVisitor.calculateScope | private LocalVariableScope calculateScope(LocalVariableScopeData scope) {
final TryCatchBlockLabels enclosingTry = getEnclosingTry(scope);
final Label start = scope.labels.start;
final Label end = getTryFixedEndLabel(scope, enclosingTry);
int startIndex = getIndex(start);
int endIndex = getIndex(end);
... | java | private LocalVariableScope calculateScope(LocalVariableScopeData scope) {
final TryCatchBlockLabels enclosingTry = getEnclosingTry(scope);
final Label start = scope.labels.start;
final Label end = getTryFixedEndLabel(scope, enclosingTry);
int startIndex = getIndex(start);
int endIndex = getIndex(end);
... | [
"private",
"LocalVariableScope",
"calculateScope",
"(",
"LocalVariableScopeData",
"scope",
")",
"{",
"final",
"TryCatchBlockLabels",
"enclosingTry",
"=",
"getEnclosingTry",
"(",
"scope",
")",
";",
"final",
"Label",
"start",
"=",
"scope",
".",
"labels",
".",
"start",... | Calculate the start and end line numbers for variable scopes. If the
LocalVariableScope start line is 0, then it is an input parameter, as
it's scope start label appeared before the method body. | [
"Calculate",
"the",
"start",
"and",
"end",
"line",
"numbers",
"for",
"variable",
"scopes",
".",
"If",
"the",
"LocalVariableScope",
"start",
"line",
"is",
"0",
"then",
"it",
"is",
"an",
"input",
"parameter",
"as",
"it",
"s",
"scope",
"start",
"label",
"appe... | train | https://github.com/dodie/scott/blob/fd6b492584d3ae7e072871ff2b094cce6041fc99/scott/src/main/java/hu/advancedweb/scott/instrumentation/transformation/ScopeExtractorMethodVisitor.java#L149-L160 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java | DataLabelingServiceClient.getExample | public final Example getExample(String name, String filter) {
EXAMPLE_PATH_TEMPLATE.validate(name, "getExample");
GetExampleRequest request =
GetExampleRequest.newBuilder().setName(name).setFilter(filter).build();
return getExample(request);
} | java | public final Example getExample(String name, String filter) {
EXAMPLE_PATH_TEMPLATE.validate(name, "getExample");
GetExampleRequest request =
GetExampleRequest.newBuilder().setName(name).setFilter(filter).build();
return getExample(request);
} | [
"public",
"final",
"Example",
"getExample",
"(",
"String",
"name",
",",
"String",
"filter",
")",
"{",
"EXAMPLE_PATH_TEMPLATE",
".",
"validate",
"(",
"name",
",",
"\"getExample\"",
")",
";",
"GetExampleRequest",
"request",
"=",
"GetExampleRequest",
".",
"newBuilder... | Gets an example by resource name, including both data and annotation.
<p>Sample code:
<pre><code>
try (DataLabelingServiceClient dataLabelingServiceClient = DataLabelingServiceClient.create()) {
String formattedName = DataLabelingServiceClient.formatExampleName("[PROJECT]", "[DATASET]", "[ANNOTATED_DATASET]", "[EXAMP... | [
"Gets",
"an",
"example",
"by",
"resource",
"name",
"including",
"both",
"data",
"and",
"annotation",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-datalabeling/src/main/java/com/google/cloud/datalabeling/v1beta1/DataLabelingServiceClient.java#L1916-L1921 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/CheckSumUtils.java | CheckSumUtils.getMD5Checksum | public static String getMD5Checksum(String str, Charset charset) throws IOException {
InputStream is = new ByteArrayInputStream(str.getBytes(charset.name()));
return getMD5Checksum(is);
} | java | public static String getMD5Checksum(String str, Charset charset) throws IOException {
InputStream is = new ByteArrayInputStream(str.getBytes(charset.name()));
return getMD5Checksum(is);
} | [
"public",
"static",
"String",
"getMD5Checksum",
"(",
"String",
"str",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"InputStream",
"is",
"=",
"new",
"ByteArrayInputStream",
"(",
"str",
".",
"getBytes",
"(",
"charset",
".",
"name",
"(",
")",
"... | Returns the MD5 Checksum of the string passed in parameter
@param str
the string content
@param charset
the content charset
@return the Checksum of the input stream
@throws IOException
if an IO exception occurs | [
"Returns",
"the",
"MD5",
"Checksum",
"of",
"the",
"string",
"passed",
"in",
"parameter"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/CheckSumUtils.java#L188-L192 |
alkacon/opencms-core | src/org/opencms/webdav/CmsWebdavServlet.java | CmsWebdavServlet.addLockElement | private void addLockElement(CmsRepositoryLockInfo lock, Element parent, String lockToken) {
Element activeLockElem = addElement(parent, TAG_ACTIVELOCK);
addElement(addElement(activeLockElem, TAG_LOCKTYPE), lock.getType());
addElement(addElement(activeLockElem, TAG_LOCKSCOPE), lock.getScope());
... | java | private void addLockElement(CmsRepositoryLockInfo lock, Element parent, String lockToken) {
Element activeLockElem = addElement(parent, TAG_ACTIVELOCK);
addElement(addElement(activeLockElem, TAG_LOCKTYPE), lock.getType());
addElement(addElement(activeLockElem, TAG_LOCKSCOPE), lock.getScope());
... | [
"private",
"void",
"addLockElement",
"(",
"CmsRepositoryLockInfo",
"lock",
",",
"Element",
"parent",
",",
"String",
"lockToken",
")",
"{",
"Element",
"activeLockElem",
"=",
"addElement",
"(",
"parent",
",",
"TAG_ACTIVELOCK",
")",
";",
"addElement",
"(",
"addElemen... | Generate a dom element from the given information with all needed subelements to
add to the parent.<p>
@param lock the lock with the information to create the subelements
@param parent the parent element where to add the created element
@param lockToken the lock token to use | [
"Generate",
"a",
"dom",
"element",
"from",
"the",
"given",
"information",
"with",
"all",
"needed",
"subelements",
"to",
"add",
"to",
"the",
"parent",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/webdav/CmsWebdavServlet.java#L2906-L2930 |
torakiki/event-studio | src/main/java/org/sejda/eventstudio/util/ReflectionUtils.java | ReflectionUtils.inferParameterClass | @SuppressWarnings("rawtypes")
public static Class inferParameterClass(Class clazz, String methodName) {
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.getName().equals(methodName) && !method.isBridge()) {
Type[] types = method.getGeneric... | java | @SuppressWarnings("rawtypes")
public static Class inferParameterClass(Class clazz, String methodName) {
Method[] methods = clazz.getMethods();
for (Method method : methods) {
if (method.getName().equals(methodName) && !method.isBridge()) {
Type[] types = method.getGeneric... | [
"@",
"SuppressWarnings",
"(",
"\"rawtypes\"",
")",
"public",
"static",
"Class",
"inferParameterClass",
"(",
"Class",
"clazz",
",",
"String",
"methodName",
")",
"{",
"Method",
"[",
"]",
"methods",
"=",
"clazz",
".",
"getMethods",
"(",
")",
";",
"for",
"(",
... | Given a concrete class and a method name, it tries to infer the Class of the first parameter of the method
@param clazz
@param methodName
@return the class or null if nothing found | [
"Given",
"a",
"concrete",
"class",
"and",
"a",
"method",
"name",
"it",
"tries",
"to",
"infer",
"the",
"Class",
"of",
"the",
"first",
"parameter",
"of",
"the",
"method"
] | train | https://github.com/torakiki/event-studio/blob/2937b7ed28bb185a79b9cfb98c4de2eb37690a4a/src/main/java/org/sejda/eventstudio/util/ReflectionUtils.java#L42-L56 |
xhsun/gw2wrapper | src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java | AsynchronousRequest.getWvWUpgradeInfo | public void getWvWUpgradeInfo(int[] ids, Callback<List<WvWUpgrade>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getWvWUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | java | public void getWvWUpgradeInfo(int[] ids, Callback<List<WvWUpgrade>> callback) throws GuildWars2Exception, NullPointerException {
isParamValid(new ParamChecker(ids));
gw2API.getWvWUpgradeInfo(processIds(ids), GuildWars2.lang.getValue()).enqueue(callback);
} | [
"public",
"void",
"getWvWUpgradeInfo",
"(",
"int",
"[",
"]",
"ids",
",",
"Callback",
"<",
"List",
"<",
"WvWUpgrade",
">",
">",
"callback",
")",
"throws",
"GuildWars2Exception",
",",
"NullPointerException",
"{",
"isParamValid",
"(",
"new",
"ParamChecker",
"(",
... | For more info on WvW upgrades API go <a href="https://wiki.guildwars2.com/wiki/API:2/wvw/upgrades">here</a><br/>
Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions
@param ids list of WvW upgrade id
@param callback cal... | [
"For",
"more",
"info",
"on",
"WvW",
"upgrades",
"API",
"go",
"<a",
"href",
"=",
"https",
":",
"//",
"wiki",
".",
"guildwars2",
".",
"com",
"/",
"wiki",
"/",
"API",
":",
"2",
"/",
"wvw",
"/",
"upgrades",
">",
"here<",
"/",
"a",
">",
"<br",
"/",
... | train | https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L2795-L2798 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/net/NetworkUtils.java | NetworkUtils.newSocketAddress | public static SocketAddress newSocketAddress(String host, int port) {
return Optional.ofNullable(host).map(hostname -> new InetSocketAddress(host, port))
.orElseGet(() -> new InetSocketAddress(port));
} | java | public static SocketAddress newSocketAddress(String host, int port) {
return Optional.ofNullable(host).map(hostname -> new InetSocketAddress(host, port))
.orElseGet(() -> new InetSocketAddress(port));
} | [
"public",
"static",
"SocketAddress",
"newSocketAddress",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"Optional",
".",
"ofNullable",
"(",
"host",
")",
".",
"map",
"(",
"hostname",
"->",
"new",
"InetSocketAddress",
"(",
"host",
",",
"port",
... | Constructs a new instance of {@link SocketAddress} bound to the given {@link String host} and {@link Integer port}.
@param host {@link String} containing the name of the host to whichthe {@link SocketAddress} will be bound.
@param port {@link Integer} specifying the port number to which the {@link SocketAddress} will ... | [
"Constructs",
"a",
"new",
"instance",
"of",
"{",
"@link",
"SocketAddress",
"}",
"bound",
"to",
"the",
"given",
"{",
"@link",
"String",
"host",
"}",
"and",
"{",
"@link",
"Integer",
"port",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/net/NetworkUtils.java#L203-L206 |
jferard/fastods | fastods/src/main/java/com/github/jferard/fastods/odselement/SettingsElement.java | SettingsElement.setViewSetting | public void setViewSetting(final String viewId, final String item, final String value) {
this.settings.setViewSetting(viewId, item, value);
} | java | public void setViewSetting(final String viewId, final String item, final String value) {
this.settings.setViewSetting(viewId, item, value);
} | [
"public",
"void",
"setViewSetting",
"(",
"final",
"String",
"viewId",
",",
"final",
"String",
"item",
",",
"final",
"String",
"value",
")",
"{",
"this",
".",
"settings",
".",
"setViewSetting",
"(",
"viewId",
",",
"item",
",",
"value",
")",
";",
"}"
] | Set a view setting
@param viewId the view id
@param item the item name
@param value the item value | [
"Set",
"a",
"view",
"setting"
] | train | https://github.com/jferard/fastods/blob/a034d173083ffa602dc525699b97f753082eaef9/fastods/src/main/java/com/github/jferard/fastods/odselement/SettingsElement.java#L132-L134 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/util/StreamUtil.java | StreamUtil.toUtf8StringOrHex | public static String toUtf8StringOrHex(ByteArrayOutputStream byteStream, int maxLen) {
if (maxLen == -1) {
maxLen = Integer.MAX_VALUE;
}
String result;
try {
result = byteStream.toString("UTF-8");
} catch (Exception notUtf8) {
result = Hex.enc... | java | public static String toUtf8StringOrHex(ByteArrayOutputStream byteStream, int maxLen) {
if (maxLen == -1) {
maxLen = Integer.MAX_VALUE;
}
String result;
try {
result = byteStream.toString("UTF-8");
} catch (Exception notUtf8) {
result = Hex.enc... | [
"public",
"static",
"String",
"toUtf8StringOrHex",
"(",
"ByteArrayOutputStream",
"byteStream",
",",
"int",
"maxLen",
")",
"{",
"if",
"(",
"maxLen",
"==",
"-",
"1",
")",
"{",
"maxLen",
"=",
"Integer",
".",
"MAX_VALUE",
";",
"}",
"String",
"result",
";",
"tr... | generate a String of UTF-8 characters (or hex-digits if byteStream isn't UTF-8 chars) from byteStream,
truncating to maxLen (with "..." added if the result is truncated)
@param byteStream the source of bytes to be converted to a UTF-8 String
@param maxLen the point at which to truncate the string (-1 means don't tr... | [
"generate",
"a",
"String",
"of",
"UTF",
"-",
"8",
"characters",
"(",
"or",
"hex",
"-",
"digits",
"if",
"byteStream",
"isn",
"t",
"UTF",
"-",
"8",
"chars",
")",
"from",
"byteStream",
"truncating",
"to",
"maxLen",
"(",
"with",
"...",
"added",
"if",
"the"... | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/util/StreamUtil.java#L130-L145 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java | CPDefinitionOptionValueRelPersistenceImpl.findByGroupId | @Override
public List<CPDefinitionOptionValueRel> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPDefinitionOptionValueRel> findByGroupId(long groupId) {
return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinitionOptionValueRel",
">",
"findByGroupId",
"(",
"long",
"groupId",
")",
"{",
"return",
"findByGroupId",
"(",
"groupId",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
... | Returns all the cp definition option value rels where groupId = ?.
@param groupId the group ID
@return the matching cp definition option value rels | [
"Returns",
"all",
"the",
"cp",
"definition",
"option",
"value",
"rels",
"where",
"groupId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionOptionValueRelPersistenceImpl.java#L1537-L1540 |
lucee/Lucee | core/src/main/java/lucee/commons/io/res/type/cache/CacheResourceProvider.java | CacheResourceProvider.getCore | CacheResourceCore getCore(String path, String name) {
Object obj = getCache().getValue(toKey(path, name), null);
if (obj instanceof CacheResourceCore) return (CacheResourceCore) obj;
return null;
} | java | CacheResourceCore getCore(String path, String name) {
Object obj = getCache().getValue(toKey(path, name), null);
if (obj instanceof CacheResourceCore) return (CacheResourceCore) obj;
return null;
} | [
"CacheResourceCore",
"getCore",
"(",
"String",
"path",
",",
"String",
"name",
")",
"{",
"Object",
"obj",
"=",
"getCache",
"(",
")",
".",
"getValue",
"(",
"toKey",
"(",
"path",
",",
"name",
")",
",",
"null",
")",
";",
"if",
"(",
"obj",
"instanceof",
"... | returns core for this path if exists, otherwise return null
@param path
@return core or null | [
"returns",
"core",
"for",
"this",
"path",
"if",
"exists",
"otherwise",
"return",
"null"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/commons/io/res/type/cache/CacheResourceProvider.java#L107-L111 |
Devskiller/jfairy | src/main/java/com/devskiller/jfairy/producer/util/ZhFairyUtil.java | ZhFairyUtil.getRandomNumStr | public static String getRandomNumStr(BaseProducer baseProducer, int max, int paddingSize) {
int rndNum = baseProducer.randomBetween(1, max);
String numStr = "" + rndNum;
while (numStr.length() < paddingSize) {
numStr = "0" + numStr;
}
return numStr;
} | java | public static String getRandomNumStr(BaseProducer baseProducer, int max, int paddingSize) {
int rndNum = baseProducer.randomBetween(1, max);
String numStr = "" + rndNum;
while (numStr.length() < paddingSize) {
numStr = "0" + numStr;
}
return numStr;
} | [
"public",
"static",
"String",
"getRandomNumStr",
"(",
"BaseProducer",
"baseProducer",
",",
"int",
"max",
",",
"int",
"paddingSize",
")",
"{",
"int",
"rndNum",
"=",
"baseProducer",
".",
"randomBetween",
"(",
"1",
",",
"max",
")",
";",
"String",
"numStr",
"=",... | Get random number from 1 to max in 0 leading string format.
@param baseProducer BaseProducer
@param max upper bound of number
@param paddingSize padding size
@return A number smaller than #max with #paddingSize digits in string format | [
"Get",
"random",
"number",
"from",
"1",
"to",
"max",
"in",
"0",
"leading",
"string",
"format",
"."
] | train | https://github.com/Devskiller/jfairy/blob/126d1c8b1545f725afd10f969b9d27005ac520b7/src/main/java/com/devskiller/jfairy/producer/util/ZhFairyUtil.java#L71-L78 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.ge | public QueryExpression ge(String propertyName,String value)
{
return new SimpleQueryExpression(propertyName, ComparisonOperator.GREATER_THAN_OR_EQUAL,wrap(value));
} | java | public QueryExpression ge(String propertyName,String value)
{
return new SimpleQueryExpression(propertyName, ComparisonOperator.GREATER_THAN_OR_EQUAL,wrap(value));
} | [
"public",
"QueryExpression",
"ge",
"(",
"String",
"propertyName",
",",
"String",
"value",
")",
"{",
"return",
"new",
"SimpleQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"GREATER_THAN_OR_EQUAL",
",",
"wrap",
"(",
"value",
")",
")",
";",
... | Create a greater than or equals expression
@param propertyName The propery name
@param value The value
@return The query expression | [
"Create",
"a",
"greater",
"than",
"or",
"equals",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L268-L271 |
Samsung/GearVRf | GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java | JSONHelpers.optPointF | public static <P extends Enum<P>> PointF optPointF(final JSONObject json, P e) {
return optPointF(json, e, null);
} | java | public static <P extends Enum<P>> PointF optPointF(final JSONObject json, P e) {
return optPointF(json, e, null);
} | [
"public",
"static",
"<",
"P",
"extends",
"Enum",
"<",
"P",
">",
">",
"PointF",
"optPointF",
"(",
"final",
"JSONObject",
"json",
",",
"P",
"e",
")",
"{",
"return",
"optPointF",
"(",
"json",
",",
"e",
",",
"null",
")",
";",
"}"
] | Return the value mapped by enum if it exists and is a {@link JSONObject} by mapping "x" and
"y" members into a {@link PointF}.
@param json {@code JSONObject} to get data from
@param e {@link Enum} labeling the data to get
@return An instance of {@code PointF} or {@code null} if there is no object mapping for
{@code... | [
"Return",
"the",
"value",
"mapped",
"by",
"enum",
"if",
"it",
"exists",
"and",
"is",
"a",
"{",
"@link",
"JSONObject",
"}",
"by",
"mapping",
"x",
"and",
"y",
"members",
"into",
"a",
"{",
"@link",
"PointF",
"}",
"."
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/properties/JSONHelpers.java#L563-L565 |
raphw/byte-buddy | byte-buddy-dep/src/main/java/net/bytebuddy/implementation/InvocationHandlerAdapter.java | InvocationHandlerAdapter.toField | public static InvocationHandlerAdapter toField(String name) {
return toField(name, FieldLocator.ForClassHierarchy.Factory.INSTANCE);
} | java | public static InvocationHandlerAdapter toField(String name) {
return toField(name, FieldLocator.ForClassHierarchy.Factory.INSTANCE);
} | [
"public",
"static",
"InvocationHandlerAdapter",
"toField",
"(",
"String",
"name",
")",
"{",
"return",
"toField",
"(",
"name",
",",
"FieldLocator",
".",
"ForClassHierarchy",
".",
"Factory",
".",
"INSTANCE",
")",
";",
"}"
] | Creates an implementation for any {@link java.lang.reflect.InvocationHandler} that delegates
all method interceptions to a field with the given name. This field has to be of a subtype of invocation
handler and needs to be set before any invocations are intercepted. Otherwise, a {@link java.lang.NullPointerException}
wi... | [
"Creates",
"an",
"implementation",
"for",
"any",
"{",
"@link",
"java",
".",
"lang",
".",
"reflect",
".",
"InvocationHandler",
"}",
"that",
"delegates",
"all",
"method",
"interceptions",
"to",
"a",
"field",
"with",
"the",
"given",
"name",
".",
"This",
"field"... | train | https://github.com/raphw/byte-buddy/blob/4d2dac80efb6bed89367567260f6811c2f712d12/byte-buddy-dep/src/main/java/net/bytebuddy/implementation/InvocationHandlerAdapter.java#L147-L149 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataMinCardinalityImpl_CustomFieldSerializer.java | OWLDataMinCardinalityImpl_CustomFieldSerializer.deserializeInstance | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataMinCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | java | @Override
public void deserializeInstance(SerializationStreamReader streamReader, OWLDataMinCardinalityImpl instance) throws SerializationException {
deserialize(streamReader, instance);
} | [
"@",
"Override",
"public",
"void",
"deserializeInstance",
"(",
"SerializationStreamReader",
"streamReader",
",",
"OWLDataMinCardinalityImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"deserialize",
"(",
"streamReader",
",",
"instance",
")",
";",
"}"
] | Deserializes the content of the object from the
{@link com.google.gwt.user.client.rpc.SerializationStreamReader}.
@param streamReader the {@link com.google.gwt.user.client.rpc.SerializationStreamReader} to read the
object's content from
@param instance the object instance to deserialize
@throws com.google.gwt.user... | [
"Deserializes",
"the",
"content",
"of",
"the",
"object",
"from",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamReader",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLDataMinCardinalityImpl_CustomFieldSerializer.java#L96-L99 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/util/MD5FileUtils.java | MD5FileUtils.readStoredMd5ForFile | public static MD5Hash readStoredMd5ForFile(File dataFile) throws IOException {
File md5File = getDigestFileForFile(dataFile);
String md5Line;
if (!md5File.exists()) {
return null;
}
BufferedReader reader =
new BufferedReader(new FileReader(md5File));
try {
md5Line = ... | java | public static MD5Hash readStoredMd5ForFile(File dataFile) throws IOException {
File md5File = getDigestFileForFile(dataFile);
String md5Line;
if (!md5File.exists()) {
return null;
}
BufferedReader reader =
new BufferedReader(new FileReader(md5File));
try {
md5Line = ... | [
"public",
"static",
"MD5Hash",
"readStoredMd5ForFile",
"(",
"File",
"dataFile",
")",
"throws",
"IOException",
"{",
"File",
"md5File",
"=",
"getDigestFileForFile",
"(",
"dataFile",
")",
";",
"String",
"md5Line",
";",
"if",
"(",
"!",
"md5File",
".",
"exists",
"(... | Read the md5 checksum stored alongside the given file, or null
if no md5 is stored.
@param dataFile the file containing data
@return the checksum stored in dataFile.md5 | [
"Read",
"the",
"md5",
"checksum",
"stored",
"alongside",
"the",
"given",
"file",
"or",
"null",
"if",
"no",
"md5",
"is",
"stored",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/util/MD5FileUtils.java#L71-L109 |
pac4j/pac4j | pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java | CommonHelper.addParameter | public static String addParameter(final String url, final String name, final String value) {
if (url != null) {
final StringBuilder sb = new StringBuilder();
sb.append(url);
if (name != null) {
if (url.indexOf("?") >= 0) {
sb.append("&");
... | java | public static String addParameter(final String url, final String name, final String value) {
if (url != null) {
final StringBuilder sb = new StringBuilder();
sb.append(url);
if (name != null) {
if (url.indexOf("?") >= 0) {
sb.append("&");
... | [
"public",
"static",
"String",
"addParameter",
"(",
"final",
"String",
"url",
",",
"final",
"String",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"url",
"!=",
"null",
")",
"{",
"final",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
... | Add a new parameter to an url.
@param url url
@param name name of the parameter
@param value value of the parameter
@return the new url with the parameter appended | [
"Add",
"a",
"new",
"parameter",
"to",
"an",
"url",
"."
] | train | https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/util/CommonHelper.java#L165-L184 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java | SeleniumHelper.executeJavascript | public Object executeJavascript(String statementPattern, Object... parameters) {
Object result;
String script = String.format(statementPattern, parameters);
if (statementPattern.contains("arguments")) {
result = executeScript(script, parameters);
} else {
result =... | java | public Object executeJavascript(String statementPattern, Object... parameters) {
Object result;
String script = String.format(statementPattern, parameters);
if (statementPattern.contains("arguments")) {
result = executeScript(script, parameters);
} else {
result =... | [
"public",
"Object",
"executeJavascript",
"(",
"String",
"statementPattern",
",",
"Object",
"...",
"parameters",
")",
"{",
"Object",
"result",
";",
"String",
"script",
"=",
"String",
".",
"format",
"(",
"statementPattern",
",",
"parameters",
")",
";",
"if",
"("... | Executes Javascript in browser. If statementPattern contains the magic variable 'arguments'
the parameters will also be passed to the statement. In the latter case the parameters
must be a number, a boolean, a String, WebElement, or a List of any combination of the above.
@link http://selenium.googlecode.com/git/docs/a... | [
"Executes",
"Javascript",
"in",
"browser",
".",
"If",
"statementPattern",
"contains",
"the",
"magic",
"variable",
"arguments",
"the",
"parameters",
"will",
"also",
"be",
"passed",
"to",
"the",
"statement",
".",
"In",
"the",
"latter",
"case",
"the",
"parameters",... | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java#L435-L444 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java | FastDateFormat.getTimeInstance | public static FastDateFormat getTimeInstance(final int style, final Locale locale) {
return cache.getTimeInstance(style, null, locale);
} | java | public static FastDateFormat getTimeInstance(final int style, final Locale locale) {
return cache.getTimeInstance(style, null, locale);
} | [
"public",
"static",
"FastDateFormat",
"getTimeInstance",
"(",
"final",
"int",
"style",
",",
"final",
"Locale",
"locale",
")",
"{",
"return",
"cache",
".",
"getTimeInstance",
"(",
"style",
",",
"null",
",",
"locale",
")",
";",
"}"
] | 获得 {@link FastDateFormat} 实例<br>
支持缓存
@param style time style: FULL, LONG, MEDIUM, or SHORT
@param locale {@link Locale} 日期地理位置
@return 本地化 {@link FastDateFormat} | [
"获得",
"{",
"@link",
"FastDateFormat",
"}",
"实例<br",
">",
"支持缓存"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/date/format/FastDateFormat.java#L182-L184 |
baratine/baratine | web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java | EnvironmentLogger.isParentLoader | private boolean isParentLoader(ClassLoader parent, ClassLoader child)
{
for (; child != null; child = child.getParent()) {
if (child == parent)
return true;
}
return false;
} | java | private boolean isParentLoader(ClassLoader parent, ClassLoader child)
{
for (; child != null; child = child.getParent()) {
if (child == parent)
return true;
}
return false;
} | [
"private",
"boolean",
"isParentLoader",
"(",
"ClassLoader",
"parent",
",",
"ClassLoader",
"child",
")",
"{",
"for",
"(",
";",
"child",
"!=",
"null",
";",
"child",
"=",
"child",
".",
"getParent",
"(",
")",
")",
"{",
"if",
"(",
"child",
"==",
"parent",
"... | Returns true if 'parent' is a parent classloader of 'child'.
@param parent the classloader to test as a parent.
@param child the classloader to test as a child. | [
"Returns",
"true",
"if",
"parent",
"is",
"a",
"parent",
"classloader",
"of",
"child",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/log/impl/EnvironmentLogger.java#L453-L461 |
OpenHFT/Chronicle-Map | src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java | BigSegmentHeader.tryUpgradeUpdateToWriteLockMillis | private static boolean tryUpgradeUpdateToWriteLockMillis(
long address, long timeInMillis, boolean interruptible) throws InterruptedException {
long lastTime = System.currentTimeMillis();
registerWait(address);
try {
do {
if (tryUpgradeUpdateToWriteLockAnd... | java | private static boolean tryUpgradeUpdateToWriteLockMillis(
long address, long timeInMillis, boolean interruptible) throws InterruptedException {
long lastTime = System.currentTimeMillis();
registerWait(address);
try {
do {
if (tryUpgradeUpdateToWriteLockAnd... | [
"private",
"static",
"boolean",
"tryUpgradeUpdateToWriteLockMillis",
"(",
"long",
"address",
",",
"long",
"timeInMillis",
",",
"boolean",
"interruptible",
")",
"throws",
"InterruptedException",
"{",
"long",
"lastTime",
"=",
"System",
".",
"currentTimeMillis",
"(",
")"... | Use a timer which is more insensitive to jumps in time like GCs and context switches. | [
"Use",
"a",
"timer",
"which",
"is",
"more",
"insensitive",
"to",
"jumps",
"in",
"time",
"like",
"GCs",
"and",
"context",
"switches",
"."
] | train | https://github.com/OpenHFT/Chronicle-Map/blob/0b09733cc96302f96be4394a261699eeb021fe37/src/main/java/net/openhft/chronicle/hash/impl/BigSegmentHeader.java#L315-L336 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.keyDefault | public String keyDefault(String keyName, String defaultValue) {
return getMessages().keyDefault(keyName, defaultValue);
} | java | public String keyDefault(String keyName, String defaultValue) {
return getMessages().keyDefault(keyName, defaultValue);
} | [
"public",
"String",
"keyDefault",
"(",
"String",
"keyName",
",",
"String",
"defaultValue",
")",
"{",
"return",
"getMessages",
"(",
")",
".",
"keyDefault",
"(",
"keyName",
",",
"defaultValue",
")",
";",
"}"
] | Returns the localized resource string for the given message key,
checking the workplace default resources and all module bundles.<p>
If the key was not found, the provided default value
is returned.<p>
@param keyName the key for the desired string
@param defaultValue the default value in case the key does not exist i... | [
"Returns",
"the",
"localized",
"resource",
"string",
"for",
"the",
"given",
"message",
"key",
"checking",
"the",
"workplace",
"default",
"resources",
"and",
"all",
"module",
"bundles",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1916-L1919 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxRetentionPolicyAssignment.java | BoxRetentionPolicyAssignment.createAssignmentToEnterprise | public static BoxRetentionPolicyAssignment.Info createAssignmentToEnterprise(BoxAPIConnection api,
String policyID) {
return createAssignment(api, policyID, new JsonObject().add("type", TYPE_ENTERPRISE), null);
} | java | public static BoxRetentionPolicyAssignment.Info createAssignmentToEnterprise(BoxAPIConnection api,
String policyID) {
return createAssignment(api, policyID, new JsonObject().add("type", TYPE_ENTERPRISE), null);
} | [
"public",
"static",
"BoxRetentionPolicyAssignment",
".",
"Info",
"createAssignmentToEnterprise",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"policyID",
")",
"{",
"return",
"createAssignment",
"(",
"api",
",",
"policyID",
",",
"new",
"JsonObject",
"(",
")",
".",
... | Assigns retention policy with givenID to the enterprise.
@param api the API connection to be used by the created assignment.
@param policyID id of the assigned retention policy.
@return info about created assignment. | [
"Assigns",
"retention",
"policy",
"with",
"givenID",
"to",
"the",
"enterprise",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxRetentionPolicyAssignment.java#L65-L68 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java | JBBPUtils.ensureMinTextLength | public static String ensureMinTextLength(final String text, final int neededLen, final char ch, final int mode) {
final int number = neededLen - text.length();
if (number <= 0) {
return text;
}
final StringBuilder result = new StringBuilder(neededLen);
switch (mode) {
case 0: {
... | java | public static String ensureMinTextLength(final String text, final int neededLen, final char ch, final int mode) {
final int number = neededLen - text.length();
if (number <= 0) {
return text;
}
final StringBuilder result = new StringBuilder(neededLen);
switch (mode) {
case 0: {
... | [
"public",
"static",
"String",
"ensureMinTextLength",
"(",
"final",
"String",
"text",
",",
"final",
"int",
"neededLen",
",",
"final",
"char",
"ch",
",",
"final",
"int",
"mode",
")",
"{",
"final",
"int",
"number",
"=",
"neededLen",
"-",
"text",
".",
"length"... | Extend text by chars to needed length.
@param text text to be extended, must not be null.
@param neededLen needed length for text
@param ch char to be used for extending
@param mode 0 to extend left, 1 to extend right, otherwise extends both
sides
@return text extended by chars up to needed length, or... | [
"Extend",
"text",
"by",
"chars",
"to",
"needed",
"length",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/utils/JBBPUtils.java#L814-L850 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/util/LineReader.java | LineReader.readLine | public int readLine(Text str, int maxLineLength) throws IOException {
return readLine(str, maxLineLength, Integer.MAX_VALUE);
} | java | public int readLine(Text str, int maxLineLength) throws IOException {
return readLine(str, maxLineLength, Integer.MAX_VALUE);
} | [
"public",
"int",
"readLine",
"(",
"Text",
"str",
",",
"int",
"maxLineLength",
")",
"throws",
"IOException",
"{",
"return",
"readLine",
"(",
"str",
",",
"maxLineLength",
",",
"Integer",
".",
"MAX_VALUE",
")",
";",
"}"
] | Read from the InputStream into the given Text.
@param str the object to store the given line
@param maxLineLength the maximum number of bytes to store into str.
@return the number of bytes read including the newline
@throws IOException if the underlying stream throws | [
"Read",
"from",
"the",
"InputStream",
"into",
"the",
"given",
"Text",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/util/LineReader.java#L301-L303 |
jbundle/jbundle | base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java | HBasePanel.printHtmlTrailer | public void printHtmlTrailer(PrintWriter out, ResourceBundle reg)
throws DBException
{
char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.TRAILERS), 'H');
if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMainMenu())
chMenubar = 'Y';
if (ch... | java | public void printHtmlTrailer(PrintWriter out, ResourceBundle reg)
throws DBException
{
char chMenubar = HBasePanel.getFirstToUpper(this.getProperty(DBParams.TRAILERS), 'H');
if (chMenubar == 'H') if (((BasePanel)this.getScreenField()).isMainMenu())
chMenubar = 'Y';
if (ch... | [
"public",
"void",
"printHtmlTrailer",
"(",
"PrintWriter",
"out",
",",
"ResourceBundle",
"reg",
")",
"throws",
"DBException",
"{",
"char",
"chMenubar",
"=",
"HBasePanel",
".",
"getFirstToUpper",
"(",
"this",
".",
"getProperty",
"(",
"DBParams",
".",
"TRAILERS",
"... | Print the top nav menu.
@param out The html out stream.
@param reg The resources object.
@exception DBException File exception. | [
"Print",
"the",
"top",
"nav",
"menu",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/view/html/src/main/java/org/jbundle/base/screen/view/html/HBasePanel.java#L295-L310 |
ManfredTremmel/gwt-bean-validators | gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java | StringUtils.trimTrailingCharacter | public static String trimTrailingCharacter(final String str, final char trailingCharacter) {
if (!StringUtils.hasLength(str)) {
return str;
}
final StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && sb.charAt(sb.length() - 1) == trailingCharacter) {
sb.deleteCharAt(sb.leng... | java | public static String trimTrailingCharacter(final String str, final char trailingCharacter) {
if (!StringUtils.hasLength(str)) {
return str;
}
final StringBuilder sb = new StringBuilder(str);
while (sb.length() > 0 && sb.charAt(sb.length() - 1) == trailingCharacter) {
sb.deleteCharAt(sb.leng... | [
"public",
"static",
"String",
"trimTrailingCharacter",
"(",
"final",
"String",
"str",
",",
"final",
"char",
"trailingCharacter",
")",
"{",
"if",
"(",
"!",
"StringUtils",
".",
"hasLength",
"(",
"str",
")",
")",
"{",
"return",
"str",
";",
"}",
"final",
"Stri... | Trim all occurrences of the supplied trailing character from the given {@code String}.
@param str the {@code String} to check
@param trailingCharacter the trailing character to be trimmed
@return the trimmed {@code String} | [
"Trim",
"all",
"occurrences",
"of",
"the",
"supplied",
"trailing",
"character",
"from",
"the",
"given",
"{",
"@code",
"String",
"}",
"."
] | train | https://github.com/ManfredTremmel/gwt-bean-validators/blob/cff7a2c3d68c2d17bf9d3cc57c79cc16fa8b4d5c/gwtp-spring-integration/src/main/super/de/knightsoftnet/gwtp/spring/supersource/org/springframework/util/StringUtils.java#L330-L340 |
osiam/connector4java | src/main/java/org/osiam/client/OsiamUserService.java | OsiamUserService.updateUser | @Deprecated
User updateUser(String id, UpdateUser updateUser, AccessToken accessToken) {
if (updateUser == null) {
throw new IllegalArgumentException("The given updateUser can't be null.");
}
return updateResource(id, updateUser.getScimConformUpdateUser(), accessToken);
} | java | @Deprecated
User updateUser(String id, UpdateUser updateUser, AccessToken accessToken) {
if (updateUser == null) {
throw new IllegalArgumentException("The given updateUser can't be null.");
}
return updateResource(id, updateUser.getScimConformUpdateUser(), accessToken);
} | [
"@",
"Deprecated",
"User",
"updateUser",
"(",
"String",
"id",
",",
"UpdateUser",
"updateUser",
",",
"AccessToken",
"accessToken",
")",
"{",
"if",
"(",
"updateUser",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"The given updateUser ca... | See {@link OsiamConnector#updateUser(String, UpdateUser, AccessToken)}
@deprecated Updating with PATCH has been removed in OSIAM 3.0. This method is going to go away with version 1.12 or 2.0. | [
"See",
"{",
"@link",
"OsiamConnector#updateUser",
"(",
"String",
"UpdateUser",
"AccessToken",
")",
"}"
] | train | https://github.com/osiam/connector4java/blob/a5e6ae1e706f4889d662a069fe2f3bf8e3848d12/src/main/java/org/osiam/client/OsiamUserService.java#L148-L154 |
aws/aws-sdk-java | aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/AwsSecurityFinding.java | AwsSecurityFinding.withUserDefinedFields | public AwsSecurityFinding withUserDefinedFields(java.util.Map<String, String> userDefinedFields) {
setUserDefinedFields(userDefinedFields);
return this;
} | java | public AwsSecurityFinding withUserDefinedFields(java.util.Map<String, String> userDefinedFields) {
setUserDefinedFields(userDefinedFields);
return this;
} | [
"public",
"AwsSecurityFinding",
"withUserDefinedFields",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"userDefinedFields",
")",
"{",
"setUserDefinedFields",
"(",
"userDefinedFields",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A list of name/value string pairs associated with the finding. These are custom, user-defined fields added to a
finding.
</p>
@param userDefinedFields
A list of name/value string pairs associated with the finding. These are custom, user-defined fields added
to a finding.
@return Returns a reference to this object ... | [
"<p",
">",
"A",
"list",
"of",
"name",
"/",
"value",
"string",
"pairs",
"associated",
"with",
"the",
"finding",
".",
"These",
"are",
"custom",
"user",
"-",
"defined",
"fields",
"added",
"to",
"a",
"finding",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-securityhub/src/main/java/com/amazonaws/services/securityhub/model/AwsSecurityFinding.java#L1201-L1204 |
openengsb/openengsb | components/util/src/main/java/org/openengsb/core/util/DefaultOsgiUtilsService.java | DefaultOsgiUtilsService.waitForServiceFromTracker | private static Object waitForServiceFromTracker(ServiceTracker tracker, long timeout)
throws OsgiServiceNotAvailableException {
synchronized (tracker) {
tracker.open();
try {
return tracker.waitForService(timeout);
} catch (InterruptedException e) {
... | java | private static Object waitForServiceFromTracker(ServiceTracker tracker, long timeout)
throws OsgiServiceNotAvailableException {
synchronized (tracker) {
tracker.open();
try {
return tracker.waitForService(timeout);
} catch (InterruptedException e) {
... | [
"private",
"static",
"Object",
"waitForServiceFromTracker",
"(",
"ServiceTracker",
"tracker",
",",
"long",
"timeout",
")",
"throws",
"OsgiServiceNotAvailableException",
"{",
"synchronized",
"(",
"tracker",
")",
"{",
"tracker",
".",
"open",
"(",
")",
";",
"try",
"{... | tries to retrieve the service from the given service-tracker for the amount of milliseconds provided by the given
timeout.
@throws OsgiServiceNotAvailableException if the service could not be found within the given timeout | [
"tries",
"to",
"retrieve",
"the",
"service",
"from",
"the",
"given",
"service",
"-",
"tracker",
"for",
"the",
"amount",
"of",
"milliseconds",
"provided",
"by",
"the",
"given",
"timeout",
"."
] | train | https://github.com/openengsb/openengsb/blob/d39058000707f617cd405629f9bc7f17da7b414a/components/util/src/main/java/org/openengsb/core/util/DefaultOsgiUtilsService.java#L261-L273 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java | LocalDateTime.withNano | public LocalDateTime withNano(int nanoOfSecond) {
LocalTime newTime = time.withNano(nanoOfSecond);
return with(date, newTime);
} | java | public LocalDateTime withNano(int nanoOfSecond) {
LocalTime newTime = time.withNano(nanoOfSecond);
return with(date, newTime);
} | [
"public",
"LocalDateTime",
"withNano",
"(",
"int",
"nanoOfSecond",
")",
"{",
"LocalTime",
"newTime",
"=",
"time",
".",
"withNano",
"(",
"nanoOfSecond",
")",
";",
"return",
"with",
"(",
"date",
",",
"newTime",
")",
";",
"}"
] | Returns a copy of this {@code LocalDateTime} with the nano-of-second altered.
<p>
This instance is immutable and unaffected by this method call.
@param nanoOfSecond the nano-of-second to set in the result, from 0 to 999,999,999
@return a {@code LocalDateTime} based on this date-time with the requested nanosecond, not... | [
"Returns",
"a",
"copy",
"of",
"this",
"{",
"@code",
"LocalDateTime",
"}",
"with",
"the",
"nano",
"-",
"of",
"-",
"second",
"altered",
".",
"<p",
">",
"This",
"instance",
"is",
"immutable",
"and",
"unaffected",
"by",
"this",
"method",
"call",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/time/LocalDateTime.java#L1088-L1091 |
brunocvcunha/inutils4j | src/main/java/org/brunocvcunha/inutils4j/MyImageUtils.java | MyImageUtils.resizeToWidth | public static BufferedImage resizeToWidth(BufferedImage originalImage, int widthOut) {
int width = originalImage.getWidth();
int height = originalImage.getHeight();
int widthPercent = (widthOut * 100) / width;
int newHeight = (height * widthPercent) / 100;
BufferedImage resi... | java | public static BufferedImage resizeToWidth(BufferedImage originalImage, int widthOut) {
int width = originalImage.getWidth();
int height = originalImage.getHeight();
int widthPercent = (widthOut * 100) / width;
int newHeight = (height * widthPercent) / 100;
BufferedImage resi... | [
"public",
"static",
"BufferedImage",
"resizeToWidth",
"(",
"BufferedImage",
"originalImage",
",",
"int",
"widthOut",
")",
"{",
"int",
"width",
"=",
"originalImage",
".",
"getWidth",
"(",
")",
";",
"int",
"height",
"=",
"originalImage",
".",
"getHeight",
"(",
"... | Resizes an image to the specified width, changing width in the same proportion
@param originalImage Image in memory
@param widthOut The width to resize
@return New Image in memory | [
"Resizes",
"an",
"image",
"to",
"the",
"specified",
"width",
"changing",
"width",
"in",
"the",
"same",
"proportion"
] | train | https://github.com/brunocvcunha/inutils4j/blob/223c4443c2cee662576ce644e552588fa114aa94/src/main/java/org/brunocvcunha/inutils4j/MyImageUtils.java#L190-L207 |
hellosign/hellosign-java-sdk | src/main/java/com/hellosign/sdk/http/AbstractHttpRequest.java | AbstractHttpRequest.getProxiedConnection | protected static HttpURLConnection getProxiedConnection(String url) throws MalformedURLException, IOException {
HttpURLConnection conn = null;
Proxy proxy = null;
String proxyUrlStr = System.getProperty("hellosign.proxy.url");
String proxyPortStr = System.getProperty("hellosign.proxy.por... | java | protected static HttpURLConnection getProxiedConnection(String url) throws MalformedURLException, IOException {
HttpURLConnection conn = null;
Proxy proxy = null;
String proxyUrlStr = System.getProperty("hellosign.proxy.url");
String proxyPortStr = System.getProperty("hellosign.proxy.por... | [
"protected",
"static",
"HttpURLConnection",
"getProxiedConnection",
"(",
"String",
"url",
")",
"throws",
"MalformedURLException",
",",
"IOException",
"{",
"HttpURLConnection",
"conn",
"=",
"null",
";",
"Proxy",
"proxy",
"=",
"null",
";",
"String",
"proxyUrlStr",
"="... | Creates an HTTP connection.
Optionally checks for proxy parameters and creates a proxied connection
using the system properties: "hellosign.proxy.url" - the URL of the HTTP
proxy "hellosign.proxy.port" - the port of the HTTP proxy
@param url String URL to connect to
@return HttpUrlConnection the (proxied) connection ... | [
"Creates",
"an",
"HTTP",
"connection",
"."
] | train | https://github.com/hellosign/hellosign-java-sdk/blob/08fa7aeb3b0c68ddb6c7ea797d114d55d36d36b1/src/main/java/com/hellosign/sdk/http/AbstractHttpRequest.java#L171-L189 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/ProjectApi.java | ProjectApi.deleteIssue | @Deprecated
public void deleteIssue(Object projectIdOrPath, Integer issueId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, getDefaultPerPageParam(), "projects", getProjectIdOrPath(p... | java | @Deprecated
public void deleteIssue(Object projectIdOrPath, Integer issueId) throws GitLabApiException {
Response.Status expectedStatus = (isApiVersion(ApiVersion.V3) ? Response.Status.OK : Response.Status.NO_CONTENT);
delete(expectedStatus, getDefaultPerPageParam(), "projects", getProjectIdOrPath(p... | [
"@",
"Deprecated",
"public",
"void",
"deleteIssue",
"(",
"Object",
"projectIdOrPath",
",",
"Integer",
"issueId",
")",
"throws",
"GitLabApiException",
"{",
"Response",
".",
"Status",
"expectedStatus",
"=",
"(",
"isApiVersion",
"(",
"ApiVersion",
".",
"V3",
")",
"... | Delete a project issue.
<pre><code>DELETE /projects/:id/issues/:issue_iid</code></pre>
@param projectIdOrPath projectIdOrPath the project in the form of an Integer(ID), String(path), or Project instance, required
@param issueId the internal ID of a project's issue
@throws GitLabApiException if any exception occurs
@d... | [
"Delete",
"a",
"project",
"issue",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/ProjectApi.java#L1874-L1878 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setSasDefinition | public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) {
return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, vali... | java | public SasDefinitionBundle setSasDefinition(String vaultBaseUrl, String storageAccountName, String sasDefinitionName, String templateUri, SasTokenType sasType, String validityPeriod) {
return setSasDefinitionWithServiceResponseAsync(vaultBaseUrl, storageAccountName, sasDefinitionName, templateUri, sasType, vali... | [
"public",
"SasDefinitionBundle",
"setSasDefinition",
"(",
"String",
"vaultBaseUrl",
",",
"String",
"storageAccountName",
",",
"String",
"sasDefinitionName",
",",
"String",
"templateUri",
",",
"SasTokenType",
"sasType",
",",
"String",
"validityPeriod",
")",
"{",
"return"... | Creates or updates a new SAS definition for the specified storage account. This operation requires the storage/setsas permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param storageAccountName The name of the storage account.
@param sasDefinitionName The name of the SAS defi... | [
"Creates",
"or",
"updates",
"a",
"new",
"SAS",
"definition",
"for",
"the",
"specified",
"storage",
"account",
".",
"This",
"operation",
"requires",
"the",
"storage",
"/",
"setsas",
"permission",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L11254-L11256 |
carewebframework/carewebframework-core | org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/Command.java | Command.setCommandTarget | private void setCommandTarget(BaseComponent component, BaseComponent commandTarget) {
if (commandTarget == null) {
commandTarget = (BaseComponent) component.removeAttribute(getTargetAttributeName());
if (commandTarget != null && commandTarget.hasAttribute(ATTR_DUMMY)) {
... | java | private void setCommandTarget(BaseComponent component, BaseComponent commandTarget) {
if (commandTarget == null) {
commandTarget = (BaseComponent) component.removeAttribute(getTargetAttributeName());
if (commandTarget != null && commandTarget.hasAttribute(ATTR_DUMMY)) {
... | [
"private",
"void",
"setCommandTarget",
"(",
"BaseComponent",
"component",
",",
"BaseComponent",
"commandTarget",
")",
"{",
"if",
"(",
"commandTarget",
"==",
"null",
")",
"{",
"commandTarget",
"=",
"(",
"BaseComponent",
")",
"component",
".",
"removeAttribute",
"("... | Sets or removes the command target for the specified component.
@param component The bound component whose command target is being modified.
@param commandTarget If null, any associated command target is removed. Otherwise, this value
is set as the command target. | [
"Sets",
"or",
"removes",
"the",
"command",
"target",
"for",
"the",
"specified",
"component",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.ui-parent/org.carewebframework.ui.core/src/main/java/org/carewebframework/ui/command/Command.java#L250-L260 |
UrielCh/ovh-java-sdk | ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java | ApiOvhVps.serviceName_secondaryDnsDomains_domain_GET | public OvhSecondaryDNS serviceName_secondaryDnsDomains_domain_GET(String serviceName, String domain) throws IOException {
String qPath = "/vps/{serviceName}/secondaryDnsDomains/{domain}";
StringBuilder sb = path(qPath, serviceName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo... | java | public OvhSecondaryDNS serviceName_secondaryDnsDomains_domain_GET(String serviceName, String domain) throws IOException {
String qPath = "/vps/{serviceName}/secondaryDnsDomains/{domain}";
StringBuilder sb = path(qPath, serviceName, domain);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo... | [
"public",
"OvhSecondaryDNS",
"serviceName_secondaryDnsDomains_domain_GET",
"(",
"String",
"serviceName",
",",
"String",
"domain",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/vps/{serviceName}/secondaryDnsDomains/{domain}\"",
";",
"StringBuilder",
"sb",
"=",... | Get this object properties
REST: GET /vps/{serviceName}/secondaryDnsDomains/{domain}
@param serviceName [required] The internal name of your VPS offer
@param domain [required] domain on slave server | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-vps/src/main/java/net/minidev/ovh/api/ApiOvhVps.java#L223-L228 |
aoindustries/aocode-public | src/main/java/com/aoindustries/util/StringUtility.java | StringUtility.splitString | public static <C extends Collection<String>> C splitString(String line, char delim, C words) {
return splitString(line, 0, line.length(), delim, words);
} | java | public static <C extends Collection<String>> C splitString(String line, char delim, C words) {
return splitString(line, 0, line.length(), delim, words);
} | [
"public",
"static",
"<",
"C",
"extends",
"Collection",
"<",
"String",
">",
">",
"C",
"splitString",
"(",
"String",
"line",
",",
"char",
"delim",
",",
"C",
"words",
")",
"{",
"return",
"splitString",
"(",
"line",
",",
"0",
",",
"line",
".",
"length",
... | Splits a string on the given delimiter.
Does include all empty elements on the split.
@param words the words will be added to this collection.
@return the collection provided in words parameter | [
"Splits",
"a",
"string",
"on",
"the",
"given",
"delimiter",
".",
"Does",
"include",
"all",
"empty",
"elements",
"on",
"the",
"split",
"."
] | train | https://github.com/aoindustries/aocode-public/blob/c7bc1d08aee1d02dfaeeb1421fad21aca1aad4c3/src/main/java/com/aoindustries/util/StringUtility.java#L923-L925 |
Nordstrom/JUnit-Foundation | src/main/java/com/nordstrom/automation/junit/RunReflectiveCall.java | RunReflectiveCall.fireAfterInvocation | private static boolean fireAfterInvocation(Object runner, Object target, FrameworkMethod method, Throwable thrown) {
if ((runner != null) && (method != null)) {
DepthGauge depthGauge = LifecycleHooks.computeIfAbsent(methodDepth.get(), methodHash(runner, method), newInstance);
if (0 ==... | java | private static boolean fireAfterInvocation(Object runner, Object target, FrameworkMethod method, Throwable thrown) {
if ((runner != null) && (method != null)) {
DepthGauge depthGauge = LifecycleHooks.computeIfAbsent(methodDepth.get(), methodHash(runner, method), newInstance);
if (0 ==... | [
"private",
"static",
"boolean",
"fireAfterInvocation",
"(",
"Object",
"runner",
",",
"Object",
"target",
",",
"FrameworkMethod",
"method",
",",
"Throwable",
"thrown",
")",
"{",
"if",
"(",
"(",
"runner",
"!=",
"null",
")",
"&&",
"(",
"method",
"!=",
"null",
... | Fire the {@link MethodWatcher#afterInvocation(Object, Object, FrameworkMethod, Throwable) event.
<p>
If the {@code afterInvocation} event for the specified method has already been fired, do nothing.
@param runner JUnit test runner
@param target "enhanced" object upon which the method was invoked
@param method {@link F... | [
"Fire",
"the",
"{",
"@link",
"MethodWatcher#afterInvocation",
"(",
"Object",
"Object",
"FrameworkMethod",
"Throwable",
")",
"event",
".",
"<p",
">",
"If",
"the",
"{",
"@code",
"afterInvocation",
"}",
"event",
"for",
"the",
"specified",
"method",
"has",
"already"... | train | https://github.com/Nordstrom/JUnit-Foundation/blob/f24d91f8677d262c27d18ef29ed633eaac717be5/src/main/java/com/nordstrom/automation/junit/RunReflectiveCall.java#L192-L208 |
pryzach/midao | midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java | TypeHandlerUtils.convertJavaClassToSqlType | public static String convertJavaClassToSqlType(String simpleClassName) throws SQLException {
if ("String".equals(simpleClassName) == true) {
return "VARCHAR";
}
throw new SQLException(String.format("Could not convert java class %s", simpleClassName));
} | java | public static String convertJavaClassToSqlType(String simpleClassName) throws SQLException {
if ("String".equals(simpleClassName) == true) {
return "VARCHAR";
}
throw new SQLException(String.format("Could not convert java class %s", simpleClassName));
} | [
"public",
"static",
"String",
"convertJavaClassToSqlType",
"(",
"String",
"simpleClassName",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"\"String\"",
".",
"equals",
"(",
"simpleClassName",
")",
"==",
"true",
")",
"{",
"return",
"\"VARCHAR\"",
";",
"}",
"thro... | Converts Java Class name into SQL Type name
@param simpleClassName Java Class name
@return SQL Type name
@throws SQLException | [
"Converts",
"Java",
"Class",
"name",
"into",
"SQL",
"Type",
"name"
] | train | https://github.com/pryzach/midao/blob/ed9048ed2c792a4794a2116a25779dfb84cd9447/midao-jdbc-core/src/main/java/org/midao/jdbc/core/handlers/type/TypeHandlerUtils.java#L272-L278 |
TheHolyWaffle/League-of-Legends-XMPP-Chat-Library | src/main/java/com/github/theholywaffle/lolchatapi/LolChat.java | LolChat.getFriends | public List<Friend> getFriends(Filter<Friend> filter) {
final ArrayList<Friend> friends = new ArrayList<>();
for (final RosterEntry e : connection.getRoster().getEntries()) {
final Friend f = new Friend(this, connection, e);
if (filter.accept(f)) {
friends.add(f);
}
}
return friends;
} | java | public List<Friend> getFriends(Filter<Friend> filter) {
final ArrayList<Friend> friends = new ArrayList<>();
for (final RosterEntry e : connection.getRoster().getEntries()) {
final Friend f = new Friend(this, connection, e);
if (filter.accept(f)) {
friends.add(f);
}
}
return friends;
} | [
"public",
"List",
"<",
"Friend",
">",
"getFriends",
"(",
"Filter",
"<",
"Friend",
">",
"filter",
")",
"{",
"final",
"ArrayList",
"<",
"Friend",
">",
"friends",
"=",
"new",
"ArrayList",
"<>",
"(",
")",
";",
"for",
"(",
"final",
"RosterEntry",
"e",
":",
... | Gets a list of your friends based on a given filter.
@param filter
The filter defines conditions that your Friends must meet.
@return A List of your Friends that meet the condition of your Filter | [
"Gets",
"a",
"list",
"of",
"your",
"friends",
"based",
"on",
"a",
"given",
"filter",
"."
] | train | https://github.com/TheHolyWaffle/League-of-Legends-XMPP-Chat-Library/blob/5e4d87d0c054ff2f6510545b0e9f838338695c70/src/main/java/com/github/theholywaffle/lolchatapi/LolChat.java#L553-L562 |
wildfly/wildfly-core | deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java | PathUtil.createTempDirectory | public static Path createTempDirectory(Path dir, String prefix) throws IOException {
try {
return Files.createTempDirectory(dir, prefix);
} catch (UnsupportedOperationException ex) {
}
return Files.createTempDirectory(dir, prefix);
} | java | public static Path createTempDirectory(Path dir, String prefix) throws IOException {
try {
return Files.createTempDirectory(dir, prefix);
} catch (UnsupportedOperationException ex) {
}
return Files.createTempDirectory(dir, prefix);
} | [
"public",
"static",
"Path",
"createTempDirectory",
"(",
"Path",
"dir",
",",
"String",
"prefix",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"Files",
".",
"createTempDirectory",
"(",
"dir",
",",
"prefix",
")",
";",
"}",
"catch",
"(",
"Unsupported... | Create a temporary directory with the same attributes as its parent directory.
@param dir
the path to directory in which to create the directory
@param prefix
the prefix string to be used in generating the directory's name;
may be {@code null}
@return the path to the newly created directory that did not exist befo... | [
"Create",
"a",
"temporary",
"directory",
"with",
"the",
"same",
"attributes",
"as",
"its",
"parent",
"directory",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/deployment-repository/src/main/java/org/jboss/as/repository/PathUtil.java#L297-L303 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/data/conversion/provider/SimpleConversionService.java | SimpleConversionService.setDefaultValue | public <T> void setDefaultValue(Class<T> type, T defaultValue) {
Assert.notNull(type, "Class type is required");
this.defaultValues.put(type, defaultValue);
} | java | public <T> void setDefaultValue(Class<T> type, T defaultValue) {
Assert.notNull(type, "Class type is required");
this.defaultValues.put(type, defaultValue);
} | [
"public",
"<",
"T",
">",
"void",
"setDefaultValue",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"T",
"defaultValue",
")",
"{",
"Assert",
".",
"notNull",
"(",
"type",
",",
"\"Class type is required\"",
")",
";",
"this",
".",
"defaultValues",
".",
"put",
"("... | Sets the {@link Object default value} for the specified {@link Class type}.
@param <T> {@link Class classification/type} of objects which may have {@link Object default values}.
@param type {@link Class} type to define the {@link Object default value} for.
@param defaultValue {@link Object default value} to use for th... | [
"Sets",
"the",
"{",
"@link",
"Object",
"default",
"value",
"}",
"for",
"the",
"specified",
"{",
"@link",
"Class",
"type",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/data/conversion/provider/SimpleConversionService.java#L300-L303 |
fabric8io/fabric8-forge | addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java | CamelXmlHelper.dumpModelAsXml | public static String dumpModelAsXml(Object definition, ClassLoader classLoader, boolean includeEndTag, int indent) throws JAXBException, XMLStreamException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
StringWriter buffer = new StringWriter();
// we d... | java | public static String dumpModelAsXml(Object definition, ClassLoader classLoader, boolean includeEndTag, int indent) throws JAXBException, XMLStreamException {
JAXBContext jaxbContext = JAXBContext.newInstance(JAXB_CONTEXT_PACKAGES, classLoader);
StringWriter buffer = new StringWriter();
// we d... | [
"public",
"static",
"String",
"dumpModelAsXml",
"(",
"Object",
"definition",
",",
"ClassLoader",
"classLoader",
",",
"boolean",
"includeEndTag",
",",
"int",
"indent",
")",
"throws",
"JAXBException",
",",
"XMLStreamException",
"{",
"JAXBContext",
"jaxbContext",
"=",
... | Dumps the definition as XML
@param definition the definition, such as a {@link org.apache.camel.NamedNode}
@param classLoader the class loader
@return the output in XML (is formatted)
@throws JAXBException is throw if error marshalling to XML | [
"Dumps",
"the",
"definition",
"as",
"XML"
] | train | https://github.com/fabric8io/fabric8-forge/blob/a59871bae4d5c5d3ece10f1e8758e73663087f19/addons/camel/src/main/java/io/fabric8/forge/camel/commands/project/helper/CamelXmlHelper.java#L434-L475 |
Red5/red5-io | src/main/java/org/red5/io/utils/IOUtils.java | IOUtils.writeReverseInt | public final static void writeReverseInt(IoBuffer out, int value) {
out.putInt((int) ((value & 0xFF) << 24 | ((value >> 8) & 0x00FF) << 16 | ((value >>> 16) & 0x000000FF) << 8 | ((value >>> 24) & 0x000000FF)));
} | java | public final static void writeReverseInt(IoBuffer out, int value) {
out.putInt((int) ((value & 0xFF) << 24 | ((value >> 8) & 0x00FF) << 16 | ((value >>> 16) & 0x000000FF) << 8 | ((value >>> 24) & 0x000000FF)));
} | [
"public",
"final",
"static",
"void",
"writeReverseInt",
"(",
"IoBuffer",
"out",
",",
"int",
"value",
")",
"{",
"out",
".",
"putInt",
"(",
"(",
"int",
")",
"(",
"(",
"value",
"&",
"0xFF",
")",
"<<",
"24",
"|",
"(",
"(",
"value",
">>",
"8",
")",
"&... | Writes integer in reverse order
@param out
Data buffer to fill
@param value
Integer | [
"Writes",
"integer",
"in",
"reverse",
"order"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/utils/IOUtils.java#L47-L49 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/db/shared/FakeRecordOwner.java | FakeRecordOwner.getTask | public Task getTask()
{
Task task = super.getTask();
if (task == null)
task = m_taskFake;
if (task == null)
task = m_taskFake = new FakeTask(new FakeApplication(null, null, null), null, null);
return task;
} | java | public Task getTask()
{
Task task = super.getTask();
if (task == null)
task = m_taskFake;
if (task == null)
task = m_taskFake = new FakeTask(new FakeApplication(null, null, null), null, null);
return task;
} | [
"public",
"Task",
"getTask",
"(",
")",
"{",
"Task",
"task",
"=",
"super",
".",
"getTask",
"(",
")",
";",
"if",
"(",
"task",
"==",
"null",
")",
"task",
"=",
"m_taskFake",
";",
"if",
"(",
"task",
"==",
"null",
")",
"task",
"=",
"m_taskFake",
"=",
"... | Get the environment to use for this record owner.
@return Record owner's environment, or null to use the default enviroment. | [
"Get",
"the",
"environment",
"to",
"use",
"for",
"this",
"record",
"owner",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/db/shared/FakeRecordOwner.java#L145-L153 |
cdk/cdk | legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java | GeometryTools.getAngle | public static double getAngle(double xDiff, double yDiff) {
double angle = 0;
// logger.debug("getAngle->xDiff: " + xDiff);
// logger.debug("getAngle->yDiff: " + yDiff);
if (xDiff >= 0 && yDiff >= 0) {
angle = Math.atan(yDiff / xDiff);
} else if (xDiff < 0 && yDiff ... | java | public static double getAngle(double xDiff, double yDiff) {
double angle = 0;
// logger.debug("getAngle->xDiff: " + xDiff);
// logger.debug("getAngle->yDiff: " + yDiff);
if (xDiff >= 0 && yDiff >= 0) {
angle = Math.atan(yDiff / xDiff);
} else if (xDiff < 0 && yDiff ... | [
"public",
"static",
"double",
"getAngle",
"(",
"double",
"xDiff",
",",
"double",
"yDiff",
")",
"{",
"double",
"angle",
"=",
"0",
";",
"//\t\tlogger.debug(\"getAngle->xDiff: \" + xDiff);",
"//\t\tlogger.debug(\"getAngle->yDiff: \" + yDiff);",
"if",
"(",
"xDiff",
">=",
"0... | Gets the angle attribute of the GeometryTools class.
@param xDiff Description of the Parameter
@param yDiff Description of the Parameter
@return The angle value | [
"Gets",
"the",
"angle",
"attribute",
"of",
"the",
"GeometryTools",
"class",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/legacy/src/main/java/org/openscience/cdk/geometry/GeometryTools.java#L584-L598 |
att/AAF | authz/authz-defOrg/src/main/java/com/osaaf/defOrg/DefaultOrg.java | DefaultOrg.whenToValidate | @Override
public Date whenToValidate(Notify type, Date lastValidated) {
switch(type) {
case Approval:
case PasswordExpiration:
return null;
default:
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(lastValidated);
gc.add(GregorianCalendar.MONTH, 6); // 6 month policy
return gc... | java | @Override
public Date whenToValidate(Notify type, Date lastValidated) {
switch(type) {
case Approval:
case PasswordExpiration:
return null;
default:
GregorianCalendar gc = new GregorianCalendar();
gc.setTime(lastValidated);
gc.add(GregorianCalendar.MONTH, 6); // 6 month policy
return gc... | [
"@",
"Override",
"public",
"Date",
"whenToValidate",
"(",
"Notify",
"type",
",",
"Date",
"lastValidated",
")",
"{",
"switch",
"(",
"type",
")",
"{",
"case",
"Approval",
":",
"case",
"PasswordExpiration",
":",
"return",
"null",
";",
"default",
":",
"Gregorian... | Default Policy is to set to 6 Months for Notification Types.
add others/change as required | [
"Default",
"Policy",
"is",
"to",
"set",
"to",
"6",
"Months",
"for",
"Notification",
"Types",
".",
"add",
"others",
"/",
"change",
"as",
"required"
] | train | https://github.com/att/AAF/blob/090562e956c0035db972aafba844dc6d3fc948ee/authz/authz-defOrg/src/main/java/com/osaaf/defOrg/DefaultOrg.java#L407-L419 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/ParseUtil.java | ParseUtil.match | private static boolean match(char c, long lowMask, long highMask) {
if (c < 64)
return ((1L << c) & lowMask) != 0;
if (c < 128)
return ((1L << (c - 64)) & highMask) != 0;
return false;
} | java | private static boolean match(char c, long lowMask, long highMask) {
if (c < 64)
return ((1L << c) & lowMask) != 0;
if (c < 128)
return ((1L << (c - 64)) & highMask) != 0;
return false;
} | [
"private",
"static",
"boolean",
"match",
"(",
"char",
"c",
",",
"long",
"lowMask",
",",
"long",
"highMask",
")",
"{",
"if",
"(",
"c",
"<",
"64",
")",
"return",
"(",
"(",
"1L",
"<<",
"c",
")",
"&",
"lowMask",
")",
"!=",
"0",
";",
"if",
"(",
"c",... | Tell whether the given character is permitted by the given mask pair | [
"Tell",
"whether",
"the",
"given",
"character",
"is",
"permitted",
"by",
"the",
"given",
"mask",
"pair"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/sun/net/www/ParseUtil.java#L519-L525 |
jmeetsma/Iglu-Common | src/main/java/org/ijsberg/iglu/database/RecordMapper.java | RecordMapper.setField | protected void setField(Field field, Object object) throws IllegalAccessException {
dataObject.setField(field, object);
} | java | protected void setField(Field field, Object object) throws IllegalAccessException {
dataObject.setField(field, object);
} | [
"protected",
"void",
"setField",
"(",
"Field",
"field",
",",
"Object",
"object",
")",
"throws",
"IllegalAccessException",
"{",
"dataObject",
".",
"setField",
"(",
"field",
",",
"object",
")",
";",
"}"
] | Implement in inner class in domain class decorator to ensure access to private and protected fields
@param field
@param object
@throws IllegalAccessException | [
"Implement",
"in",
"inner",
"class",
"in",
"domain",
"class",
"decorator",
"to",
"ensure",
"access",
"to",
"private",
"and",
"protected",
"fields"
] | train | https://github.com/jmeetsma/Iglu-Common/blob/0fb0885775b576209ff1b5a0f67e3c25a99a6420/src/main/java/org/ijsberg/iglu/database/RecordMapper.java#L133-L135 |
alkacon/opencms-core | src-gwt/org/opencms/ade/galleries/client/preview/CmsImagePreviewHandler.java | CmsImagePreviewHandler.getImageAttributes | public void getImageAttributes(I_CmsSimpleCallback<Map<String, String>> callback) {
Map<String, String> result = new HashMap<String, String>();
result.put(Attribute.hash.name(), String.valueOf(getImageIdHash()));
m_formatHandler.getImageAttributes(result);
m_previewDialog.getImageAttrib... | java | public void getImageAttributes(I_CmsSimpleCallback<Map<String, String>> callback) {
Map<String, String> result = new HashMap<String, String>();
result.put(Attribute.hash.name(), String.valueOf(getImageIdHash()));
m_formatHandler.getImageAttributes(result);
m_previewDialog.getImageAttrib... | [
"public",
"void",
"getImageAttributes",
"(",
"I_CmsSimpleCallback",
"<",
"Map",
"<",
"String",
",",
"String",
">",
">",
"callback",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"result",
"=",
"new",
"HashMap",
"<",
"String",
",",
"String",
">",
"(... | Returns image tag attributes to set for editor plugins.<p>
@param callback the callback to execute | [
"Returns",
"image",
"tag",
"attributes",
"to",
"set",
"for",
"editor",
"plugins",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/galleries/client/preview/CmsImagePreviewHandler.java#L204-L210 |
Alluxio/alluxio | core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDir.java | StorageDir.removeTempBlockMeta | public void removeTempBlockMeta(TempBlockMeta tempBlockMeta) throws BlockDoesNotExistException {
Preconditions.checkNotNull(tempBlockMeta, "tempBlockMeta");
final long blockId = tempBlockMeta.getBlockId();
final long sessionId = tempBlockMeta.getSessionId();
TempBlockMeta deletedTempBlockMeta = mBlockId... | java | public void removeTempBlockMeta(TempBlockMeta tempBlockMeta) throws BlockDoesNotExistException {
Preconditions.checkNotNull(tempBlockMeta, "tempBlockMeta");
final long blockId = tempBlockMeta.getBlockId();
final long sessionId = tempBlockMeta.getSessionId();
TempBlockMeta deletedTempBlockMeta = mBlockId... | [
"public",
"void",
"removeTempBlockMeta",
"(",
"TempBlockMeta",
"tempBlockMeta",
")",
"throws",
"BlockDoesNotExistException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"tempBlockMeta",
",",
"\"tempBlockMeta\"",
")",
";",
"final",
"long",
"blockId",
"=",
"tempBlockM... | Removes a temp block from this storage dir.
@param tempBlockMeta the metadata of the temp block to remove
@throws BlockDoesNotExistException if no temp block is found | [
"Removes",
"a",
"temp",
"block",
"from",
"this",
"storage",
"dir",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/server/worker/src/main/java/alluxio/worker/block/meta/StorageDir.java#L345-L363 |
JoeKerouac/utils | src/main/java/com/joe/utils/common/DateUtil.java | DateUtil.calc | public static long calc(String arg0, String arg1, String format, DateUnit dateUnit) {
try {
return calc(getTime(format, arg0), getTime(format, arg1), dateUnit);
} catch (Exception e) {
logger.error("日期计算出错", e);
return -1;
}
} | java | public static long calc(String arg0, String arg1, String format, DateUnit dateUnit) {
try {
return calc(getTime(format, arg0), getTime(format, arg1), dateUnit);
} catch (Exception e) {
logger.error("日期计算出错", e);
return -1;
}
} | [
"public",
"static",
"long",
"calc",
"(",
"String",
"arg0",
",",
"String",
"arg1",
",",
"String",
"format",
",",
"DateUnit",
"dateUnit",
")",
"{",
"try",
"{",
"return",
"calc",
"(",
"getTime",
"(",
"format",
",",
"arg0",
")",
",",
"getTime",
"(",
"forma... | 计算arg0-arg1的时间差
@param arg0 日期字符串
@param arg1 日期字符串
@param format 日期字符串的格式
@param dateUnit 返回结果的单位
@return arg0-arg1的时间差,精确到指定的单位(field),出错时返回-1 | [
"计算arg0",
"-",
"arg1的时间差"
] | train | https://github.com/JoeKerouac/utils/blob/45e1b2dc4d736956674fc4dcbe6cf84eaee69278/src/main/java/com/joe/utils/common/DateUtil.java#L117-L124 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java | ReviewsImpl.createReviewsAsync | public Observable<List<String>> createReviewsAsync(String teamName, String urlContentType, List<CreateReviewBodyItem> createReviewBody, CreateReviewsOptionalParameter createReviewsOptionalParameter) {
return createReviewsWithServiceResponseAsync(teamName, urlContentType, createReviewBody, createReviewsOptionalP... | java | public Observable<List<String>> createReviewsAsync(String teamName, String urlContentType, List<CreateReviewBodyItem> createReviewBody, CreateReviewsOptionalParameter createReviewsOptionalParameter) {
return createReviewsWithServiceResponseAsync(teamName, urlContentType, createReviewBody, createReviewsOptionalP... | [
"public",
"Observable",
"<",
"List",
"<",
"String",
">",
">",
"createReviewsAsync",
"(",
"String",
"teamName",
",",
"String",
"urlContentType",
",",
"List",
"<",
"CreateReviewBodyItem",
">",
"createReviewBody",
",",
"CreateReviewsOptionalParameter",
"createReviewsOption... | The reviews created would show up for Reviewers on your team. As Reviewers complete reviewing, results of the Review would be POSTED (i.e. HTTP POST) on the specified CallBackEndpoint.
<h3>CallBack Schemas </h3>
<h4>Review Completion CallBack Sample</h4>
<p>
{<br/>
"ReviewId": "<R... | [
"The",
"reviews",
"created",
"would",
"show",
"up",
"for",
"Reviewers",
"on",
"your",
"team",
".",
"As",
"Reviewers",
"complete",
"reviewing",
"results",
"of",
"the",
"Review",
"would",
"be",
"POSTED",
"(",
"i",
".",
"e",
".",
"HTTP",
"POST",
")",
"on",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/contentmoderator/src/main/java/com/microsoft/azure/cognitiveservices/vision/contentmoderator/implementation/ReviewsImpl.java#L404-L411 |
threerings/nenya | core/src/main/java/com/threerings/media/tile/TileSet.java | TileSet.getTile | public Tile getTile (int tileIndex, Colorization[] zations)
{
Tile tile = null;
// first look in the active set; if it's in use by anyone or in the cache, it will be in
// the active set
synchronized (_atiles) {
_key.tileSet = this;
_key.tileIndex = tileIndex... | java | public Tile getTile (int tileIndex, Colorization[] zations)
{
Tile tile = null;
// first look in the active set; if it's in use by anyone or in the cache, it will be in
// the active set
synchronized (_atiles) {
_key.tileSet = this;
_key.tileIndex = tileIndex... | [
"public",
"Tile",
"getTile",
"(",
"int",
"tileIndex",
",",
"Colorization",
"[",
"]",
"zations",
")",
"{",
"Tile",
"tile",
"=",
"null",
";",
"// first look in the active set; if it's in use by anyone or in the cache, it will be in",
"// the active set",
"synchronized",
"(",
... | Creates a {@link Tile} object from this tileset corresponding to the specified tile id and
returns that tile. A null tile will never be returned, but one with an error image may be
returned if a problem occurs loading the underlying tileset image.
@param tileIndex the index of the tile in the tileset. Tile indexes sta... | [
"Creates",
"a",
"{",
"@link",
"Tile",
"}",
"object",
"from",
"this",
"tileset",
"corresponding",
"to",
"the",
"specified",
"tile",
"id",
"and",
"returns",
"that",
"tile",
".",
"A",
"null",
"tile",
"will",
"never",
"be",
"returned",
"but",
"one",
"with",
... | train | https://github.com/threerings/nenya/blob/3165a012fd859009db3367f87bd2a5b820cc760a/core/src/main/java/com/threerings/media/tile/TileSet.java#L202-L232 |
craterdog/java-security-framework | java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java | CertificateManager.decodeKeyStore | public final KeyStore decodeKeyStore(String base64String, char[] password) {
logger.entry();
byte[] bytes = Base64Utils.decode(base64String);
try (ByteArrayInputStream in = new ByteArrayInputStream(bytes)) {
KeyStore keyStore = KeyStore.getInstance(KEY_STORE_FORMAT);
... | java | public final KeyStore decodeKeyStore(String base64String, char[] password) {
logger.entry();
byte[] bytes = Base64Utils.decode(base64String);
try (ByteArrayInputStream in = new ByteArrayInputStream(bytes)) {
KeyStore keyStore = KeyStore.getInstance(KEY_STORE_FORMAT);
... | [
"public",
"final",
"KeyStore",
"decodeKeyStore",
"(",
"String",
"base64String",
",",
"char",
"[",
"]",
"password",
")",
"{",
"logger",
".",
"entry",
"(",
")",
";",
"byte",
"[",
"]",
"bytes",
"=",
"Base64Utils",
".",
"decode",
"(",
"base64String",
")",
";... | This method decodes a PKCS12 format key store from its encrypted byte stream.
@param base64String The base 64 encoded, password encrypted PKCS12 byte stream.
@param password The password that was used to encrypt the byte stream.
@return The PKCS12 format key store. | [
"This",
"method",
"decodes",
"a",
"PKCS12",
"format",
"key",
"store",
"from",
"its",
"encrypted",
"byte",
"stream",
"."
] | train | https://github.com/craterdog/java-security-framework/blob/a5634c19812d473b608bc11060f5cbb4b4b0b5da/java-certificate-management-api/src/main/java/craterdog/security/CertificateManager.java#L247-L260 |
phax/ph-oton | ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java | UserDataManager.getURL | @Nonnull
@Nonempty
public static SimpleURL getURL (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
@Nonnull final IUserDataObject aUDO)
{
return new SimpleURL (getURLPath (aRequestScope, aUDO));
} | java | @Nonnull
@Nonempty
public static SimpleURL getURL (@Nonnull final IRequestWebScopeWithoutResponse aRequestScope,
@Nonnull final IUserDataObject aUDO)
{
return new SimpleURL (getURLPath (aRequestScope, aUDO));
} | [
"@",
"Nonnull",
"@",
"Nonempty",
"public",
"static",
"SimpleURL",
"getURL",
"(",
"@",
"Nonnull",
"final",
"IRequestWebScopeWithoutResponse",
"aRequestScope",
",",
"@",
"Nonnull",
"final",
"IUserDataObject",
"aUDO",
")",
"{",
"return",
"new",
"SimpleURL",
"(",
"get... | Get the URL to the passed UDO object.
@param aRequestScope
The request web scope to be used. Required for cookie-less handling.
May not be <code>null</code>.
@param aUDO
The UDO object to get the URL from.
@return The URL to the user data object, including the context path. Always
starting with a "/". E.g. <code>/cont... | [
"Get",
"the",
"URL",
"to",
"the",
"passed",
"UDO",
"object",
"."
] | train | https://github.com/phax/ph-oton/blob/f3aaacbbc02a9f3e4f32fe8db8e4adf7b9c1d3ef/ph-oton-core/src/main/java/com/helger/photon/core/userdata/UserDataManager.java#L135-L141 |
apereo/cas | support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientNavigationController.java | DelegatedClientNavigationController.redirectToProvider | @GetMapping(ENDPOINT_REDIRECT)
public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) {
var clientName = request.getParameter(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER);
if (StringUtils.isBlank(clientName)) {
clientName = (String) request.... | java | @GetMapping(ENDPOINT_REDIRECT)
public View redirectToProvider(final HttpServletRequest request, final HttpServletResponse response) {
var clientName = request.getParameter(Pac4jConstants.DEFAULT_CLIENT_NAME_PARAMETER);
if (StringUtils.isBlank(clientName)) {
clientName = (String) request.... | [
"@",
"GetMapping",
"(",
"ENDPOINT_REDIRECT",
")",
"public",
"View",
"redirectToProvider",
"(",
"final",
"HttpServletRequest",
"request",
",",
"final",
"HttpServletResponse",
"response",
")",
"{",
"var",
"clientName",
"=",
"request",
".",
"getParameter",
"(",
"Pac4jC... | Redirect to provider. Receive the client name from the request and then try to determine and build the endpoint url
for the redirection. The redirection data/url must contain a delegated client ticket id so that the request be can
restored on the trip back. SAML clients use the relay-state session attribute while other... | [
"Redirect",
"to",
"provider",
".",
"Receive",
"the",
"client",
"name",
"from",
"the",
"request",
"and",
"then",
"try",
"to",
"determine",
"and",
"build",
"the",
"endpoint",
"url",
"for",
"the",
"redirection",
".",
"The",
"redirection",
"data",
"/",
"url",
... | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-pac4j-webflow/src/main/java/org/apereo/cas/web/DelegatedClientNavigationController.java#L70-L95 |
avarabyeu/restendpoint | src/main/java/com/github/avarabyeu/restendpoint/http/HttpClientRestEndpoint.java | HttpClientRestEndpoint.executeRequest | @Override
public final <RQ, RS> Maybe<Response<RS>> executeRequest(RestCommand<RQ, RS> command)
throws RestEndpointIOException {
URI uri = spliceUrl(command.getUri());
HttpUriRequest rq;
Serializer serializer;
switch (command.getHttpMethod()) {
case GET:
... | java | @Override
public final <RQ, RS> Maybe<Response<RS>> executeRequest(RestCommand<RQ, RS> command)
throws RestEndpointIOException {
URI uri = spliceUrl(command.getUri());
HttpUriRequest rq;
Serializer serializer;
switch (command.getHttpMethod()) {
case GET:
... | [
"@",
"Override",
"public",
"final",
"<",
"RQ",
",",
"RS",
">",
"Maybe",
"<",
"Response",
"<",
"RS",
">",
">",
"executeRequest",
"(",
"RestCommand",
"<",
"RQ",
",",
"RS",
">",
"command",
")",
"throws",
"RestEndpointIOException",
"{",
"URI",
"uri",
"=",
... | Executes request command
@param command REST request representation
@return Future wrapper of REST response
@throws RestEndpointIOException In case of error
@see Maybe | [
"Executes",
"request",
"command"
] | train | https://github.com/avarabyeu/restendpoint/blob/e11fc0813ea4cefbe4d8bca292cd48b40abf185d/src/main/java/com/github/avarabyeu/restendpoint/http/HttpClientRestEndpoint.java#L399-L442 |
pravega/pravega | segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java | StreamSegmentReadIndex.createFutureRead | private ReadResultEntryBase createFutureRead(long streamSegmentOffset, int maxLength) {
FutureReadResultEntry entry = new FutureReadResultEntry(streamSegmentOffset, maxLength);
this.futureReads.add(entry);
return entry;
} | java | private ReadResultEntryBase createFutureRead(long streamSegmentOffset, int maxLength) {
FutureReadResultEntry entry = new FutureReadResultEntry(streamSegmentOffset, maxLength);
this.futureReads.add(entry);
return entry;
} | [
"private",
"ReadResultEntryBase",
"createFutureRead",
"(",
"long",
"streamSegmentOffset",
",",
"int",
"maxLength",
")",
"{",
"FutureReadResultEntry",
"entry",
"=",
"new",
"FutureReadResultEntry",
"(",
"streamSegmentOffset",
",",
"maxLength",
")",
";",
"this",
".",
"fu... | Creates a ReadResultEntry that is a placeholder for data that is not in memory, or in storage, which has
a starting offset beyond the length of the StreamSegment.
@param streamSegmentOffset The Offset in the StreamSegment where to the ReadResultEntry starts at.
@param maxLength The maximum length of the Read... | [
"Creates",
"a",
"ReadResultEntry",
"that",
"is",
"a",
"placeholder",
"for",
"data",
"that",
"is",
"not",
"in",
"memory",
"or",
"in",
"storage",
"which",
"has",
"a",
"starting",
"offset",
"beyond",
"the",
"length",
"of",
"the",
"StreamSegment",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/segmentstore/server/src/main/java/io/pravega/segmentstore/server/reading/StreamSegmentReadIndex.java#L1043-L1047 |
Azure/azure-sdk-for-java | containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java | ManagedClustersInner.beginCreateOrUpdate | public ManagedClusterInner beginCreateOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body();
} | java | public ManagedClusterInner beginCreateOrUpdate(String resourceGroupName, String resourceName, ManagedClusterInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, resourceName, parameters).toBlocking().single().body();
} | [
"public",
"ManagedClusterInner",
"beginCreateOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"ManagedClusterInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",... | Creates or updates a managed cluster.
Creates or updates a managed cluster with the specified configuration for agents and Kubernetes version.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the managed cluster resource.
@param parameters Parameters supplied to the Create or Up... | [
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
".",
"Creates",
"or",
"updates",
"a",
"managed",
"cluster",
"with",
"the",
"specified",
"configuration",
"for",
"agents",
"and",
"Kubernetes",
"version",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerservice/resource-manager/v2017_08_31/src/main/java/com/microsoft/azure/management/containerservice/v2017_08_31/implementation/ManagedClustersInner.java#L715-L717 |
spotify/async-google-pubsub-client | src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java | Pubsub.modifyAckDeadline | public PubsubFuture<Void> modifyAckDeadline(final String canonicalSubscriptionName, final int ackDeadlineSeconds,
final List<String> ackIds) {
final String path = canonicalSubscriptionName + ":modifyAckDeadline";
final ModifyAckDeadlineRequest req = ModifyAckDeadlin... | java | public PubsubFuture<Void> modifyAckDeadline(final String canonicalSubscriptionName, final int ackDeadlineSeconds,
final List<String> ackIds) {
final String path = canonicalSubscriptionName + ":modifyAckDeadline";
final ModifyAckDeadlineRequest req = ModifyAckDeadlin... | [
"public",
"PubsubFuture",
"<",
"Void",
">",
"modifyAckDeadline",
"(",
"final",
"String",
"canonicalSubscriptionName",
",",
"final",
"int",
"ackDeadlineSeconds",
",",
"final",
"List",
"<",
"String",
">",
"ackIds",
")",
"{",
"final",
"String",
"path",
"=",
"canoni... | Modify the ack deadline for a list of received messages.
@param canonicalSubscriptionName The canonical (including project name) subscription of the received message to
modify the ack deadline on.
@param ackDeadlineSeconds The new ack deadline.
@param ackIds List of message ID's to modify the... | [
"Modify",
"the",
"ack",
"deadline",
"for",
"a",
"list",
"of",
"received",
"messages",
"."
] | train | https://github.com/spotify/async-google-pubsub-client/blob/7d021528fa5bc29be458e6f210fa62f59b71d004/src/main/java/com/spotify/google/cloud/pubsub/client/Pubsub.java#L701-L709 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/process/CoreLabelTokenFactory.java | CoreLabelTokenFactory.makeToken | public CoreLabel makeToken(String tokenText, int begin, int length) {
return makeToken(tokenText, tokenText, begin, length);
} | java | public CoreLabel makeToken(String tokenText, int begin, int length) {
return makeToken(tokenText, tokenText, begin, length);
} | [
"public",
"CoreLabel",
"makeToken",
"(",
"String",
"tokenText",
",",
"int",
"begin",
",",
"int",
"length",
")",
"{",
"return",
"makeToken",
"(",
"tokenText",
",",
"tokenText",
",",
"begin",
",",
"length",
")",
";",
"}"
] | Constructs a CoreLabel as a String with a corresponding BEGIN and END position.
(Does not take substring). | [
"Constructs",
"a",
"CoreLabel",
"as",
"a",
"String",
"with",
"a",
"corresponding",
"BEGIN",
"and",
"END",
"position",
".",
"(",
"Does",
"not",
"take",
"substring",
")",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/process/CoreLabelTokenFactory.java#L50-L52 |
alkacon/opencms-core | src/org/opencms/file/types/A_CmsResourceType.java | A_CmsResourceType.addCopyResource | public void addCopyResource(String source, String target, String type) throws CmsConfigurationException {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_ADD_COPY_RESOURCE_4,
new Object[] {this, source, targ... | java | public void addCopyResource(String source, String target, String type) throws CmsConfigurationException {
if (LOG.isDebugEnabled()) {
LOG.debug(
Messages.get().getBundle().key(
Messages.LOG_ADD_COPY_RESOURCE_4,
new Object[] {this, source, targ... | [
"public",
"void",
"addCopyResource",
"(",
"String",
"source",
",",
"String",
"target",
",",
"String",
"type",
")",
"throws",
"CmsConfigurationException",
"{",
"if",
"(",
"LOG",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOG",
".",
"debug",
"(",
"Messages",
... | Adds a new "copy resource" to this resource type,
allowed only during the configuration phase.<p>
The "copy resources" are copied to the specified location after
a new resource of this type is created. Usually this feature is used to
populate a newly created folder with some default resources.<p>
If target is <code>n... | [
"Adds",
"a",
"new",
"copy",
"resource",
"to",
"this",
"resource",
"type",
"allowed",
"only",
"during",
"the",
"configuration",
"phase",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/types/A_CmsResourceType.java#L202-L224 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java | GoogleMapShapeConverter.toMultiLineString | public MultiLineString toMultiLineString(List<Polyline> polylineList,
boolean hasZ, boolean hasM) {
MultiLineString multiLineString = new MultiLineString(hasZ, hasM);
for (Polyline polyline : polylineList) {
LineString lineString = toLineString(... | java | public MultiLineString toMultiLineString(List<Polyline> polylineList,
boolean hasZ, boolean hasM) {
MultiLineString multiLineString = new MultiLineString(hasZ, hasM);
for (Polyline polyline : polylineList) {
LineString lineString = toLineString(... | [
"public",
"MultiLineString",
"toMultiLineString",
"(",
"List",
"<",
"Polyline",
">",
"polylineList",
",",
"boolean",
"hasZ",
",",
"boolean",
"hasM",
")",
"{",
"MultiLineString",
"multiLineString",
"=",
"new",
"MultiLineString",
"(",
"hasZ",
",",
"hasM",
")",
";"... | Convert a list of {@link Polyline} to a {@link MultiLineString}
@param polylineList polyline list
@param hasZ has z flag
@param hasM has m flag
@return multi line string | [
"Convert",
"a",
"list",
"of",
"{",
"@link",
"Polyline",
"}",
"to",
"a",
"{",
"@link",
"MultiLineString",
"}"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/geom/GoogleMapShapeConverter.java#L840-L851 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_instance_instanceId_applicationAccess_POST | public OvhApplicationAccess project_serviceName_instance_instanceId_applicationAccess_POST(String serviceName, String instanceId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/applicationAccess";
StringBuilder sb = path(qPath, serviceName, instanceId);
String resp = exec(... | java | public OvhApplicationAccess project_serviceName_instance_instanceId_applicationAccess_POST(String serviceName, String instanceId) throws IOException {
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/applicationAccess";
StringBuilder sb = path(qPath, serviceName, instanceId);
String resp = exec(... | [
"public",
"OvhApplicationAccess",
"project_serviceName_instance_instanceId_applicationAccess_POST",
"(",
"String",
"serviceName",
",",
"String",
"instanceId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/instance/{instanceId}/applicationA... | Return initial credentials of applications installed from public image
REST: POST /cloud/project/{serviceName}/instance/{instanceId}/applicationAccess
@param instanceId [required] Instance id
@param serviceName [required] Project id | [
"Return",
"initial",
"credentials",
"of",
"applications",
"installed",
"from",
"public",
"image"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L1894-L1899 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java | OutboundTcpConnectionPool.reset | public void reset(InetAddress remoteEP)
{
SystemKeyspace.updatePreferredIP(id, remoteEP);
resetEndpoint = remoteEP;
for (OutboundTcpConnection conn : new OutboundTcpConnection[] { cmdCon, ackCon })
conn.softCloseSocket();
// release previous metrics and create new one wi... | java | public void reset(InetAddress remoteEP)
{
SystemKeyspace.updatePreferredIP(id, remoteEP);
resetEndpoint = remoteEP;
for (OutboundTcpConnection conn : new OutboundTcpConnection[] { cmdCon, ackCon })
conn.softCloseSocket();
// release previous metrics and create new one wi... | [
"public",
"void",
"reset",
"(",
"InetAddress",
"remoteEP",
")",
"{",
"SystemKeyspace",
".",
"updatePreferredIP",
"(",
"id",
",",
"remoteEP",
")",
";",
"resetEndpoint",
"=",
"remoteEP",
";",
"for",
"(",
"OutboundTcpConnection",
"conn",
":",
"new",
"OutboundTcpCon... | reconnect to @param remoteEP (after the current message backlog is exhausted).
Used by Ec2MultiRegionSnitch to force nodes in the same region to communicate over their private IPs.
@param remoteEP | [
"reconnect",
"to"
] | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/net/OutboundTcpConnectionPool.java#L90-L100 |
craterdog/java-primitive-types | src/main/java/craterdog/primitives/Probability.java | Probability.sans | static public Probability sans(Probability probability1, Probability probability2) {
double p1 = probability1.value;
double p2 = probability2.value;
return new Probability(p1 * (1.0d - p2));
} | java | static public Probability sans(Probability probability1, Probability probability2) {
double p1 = probability1.value;
double p2 = probability2.value;
return new Probability(p1 * (1.0d - p2));
} | [
"static",
"public",
"Probability",
"sans",
"(",
"Probability",
"probability1",
",",
"Probability",
"probability2",
")",
"{",
"double",
"p1",
"=",
"probability1",
".",
"value",
";",
"double",
"p2",
"=",
"probability2",
".",
"value",
";",
"return",
"new",
"Proba... | This function returns the material nonimplication of the specified probabilities. The value
of the material nonimplication of two probabilities is P and not(Q).
@param probability1 The first probability.
@param probability2 The second probability.
@return The material nonimplication of the two probabilities. | [
"This",
"function",
"returns",
"the",
"material",
"nonimplication",
"of",
"the",
"specified",
"probabilities",
".",
"The",
"value",
"of",
"the",
"material",
"nonimplication",
"of",
"two",
"probabilities",
"is",
"P",
"and",
"not",
"(",
"Q",
")",
"."
] | train | https://github.com/craterdog/java-primitive-types/blob/730f9bceacfac69f99b094464a7da5747c07a59e/src/main/java/craterdog/primitives/Probability.java#L163-L167 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DefaultLocalJSONDataProvider.java | DefaultLocalJSONDataProvider.calculateFacetList | private FacetList calculateFacetList(AbstractDataTable table, String[] facetFields) {
if(facetFields == null || facetFields.length == 0){
throw new NullPointerException("Facet field list empty");
}
FacetList facetList = new FacetList();
for (String facetField : facetFields) ... | java | private FacetList calculateFacetList(AbstractDataTable table, String[] facetFields) {
if(facetFields == null || facetFields.length == 0){
throw new NullPointerException("Facet field list empty");
}
FacetList facetList = new FacetList();
for (String facetField : facetFields) ... | [
"private",
"FacetList",
"calculateFacetList",
"(",
"AbstractDataTable",
"table",
",",
"String",
"[",
"]",
"facetFields",
")",
"{",
"if",
"(",
"facetFields",
"==",
"null",
"||",
"facetFields",
".",
"length",
"==",
"0",
")",
"{",
"throw",
"new",
"NullPointerExce... | facet field -> list of facet field values
@param table gwt datatable as internal table data source
@param facetFields list of field to calculate facet values for | [
"facet",
"field",
"-",
">",
"list",
"of",
"facet",
"field",
"values"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/DefaultLocalJSONDataProvider.java#L304-L314 |
geomajas/geomajas-project-client-gwt | plugin/widget-layer/layer-gwt/src/main/java/org/geomajas/widget/layer/client/presenter/CreateClientWmsPresenterImpl.java | CreateClientWmsPresenterImpl.createClientWmsLayerInfo | public ClientWmsLayerInfo createClientWmsLayerInfo(WmsSelectedLayerInfo wmsSelectedLayerInfo, MapWidget mapWidget) {
WmsLayerConfiguration wmsConfig = new WmsLayerConfiguration();
wmsConfig.setFormat("image/png");
wmsConfig.setLayers(wmsSelectedLayerInfo.getWmsLayerInfo().getName());
wmsConfig.setVersion(wmsSel... | java | public ClientWmsLayerInfo createClientWmsLayerInfo(WmsSelectedLayerInfo wmsSelectedLayerInfo, MapWidget mapWidget) {
WmsLayerConfiguration wmsConfig = new WmsLayerConfiguration();
wmsConfig.setFormat("image/png");
wmsConfig.setLayers(wmsSelectedLayerInfo.getWmsLayerInfo().getName());
wmsConfig.setVersion(wmsSel... | [
"public",
"ClientWmsLayerInfo",
"createClientWmsLayerInfo",
"(",
"WmsSelectedLayerInfo",
"wmsSelectedLayerInfo",
",",
"MapWidget",
"mapWidget",
")",
"{",
"WmsLayerConfiguration",
"wmsConfig",
"=",
"new",
"WmsLayerConfiguration",
"(",
")",
";",
"wmsConfig",
".",
"setFormat",... | Factory method for {@link ClientWmsLayerInfo} from
{@link org.geomajas.widget.layer.client.presenter.WmsSelectedLayerInfo} and {@link MapWidget}.
Could be a static method in a util class.
@param wmsSelectedLayerInfo
@param mapWidget
@return | [
"Factory",
"method",
"for",
"{",
"@link",
"ClientWmsLayerInfo",
"}",
"from",
"{",
"@link",
"org",
".",
"geomajas",
".",
"widget",
".",
"layer",
".",
"client",
".",
"presenter",
".",
"WmsSelectedLayerInfo",
"}",
"and",
"{",
"@link",
"MapWidget",
"}",
".",
"... | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/plugin/widget-layer/layer-gwt/src/main/java/org/geomajas/widget/layer/client/presenter/CreateClientWmsPresenterImpl.java#L223-L246 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java | XMLConfigAdmin.updateUpdate | public void updateUpdate(String type, String location) throws SecurityException {
checkWriteAccess();
if (!(config instanceof ConfigServer)) {
throw new SecurityException("can't change update setting from this context, access is denied");
}
Element update = _getRootElement("update");
update.setAttribute("typ... | java | public void updateUpdate(String type, String location) throws SecurityException {
checkWriteAccess();
if (!(config instanceof ConfigServer)) {
throw new SecurityException("can't change update setting from this context, access is denied");
}
Element update = _getRootElement("update");
update.setAttribute("typ... | [
"public",
"void",
"updateUpdate",
"(",
"String",
"type",
",",
"String",
"location",
")",
"throws",
"SecurityException",
"{",
"checkWriteAccess",
"(",
")",
";",
"if",
"(",
"!",
"(",
"config",
"instanceof",
"ConfigServer",
")",
")",
"{",
"throw",
"new",
"Secur... | updates update settingd for Lucee
@param type
@param location
@throws SecurityException | [
"updates",
"update",
"settingd",
"for",
"Lucee"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigAdmin.java#L3442-L3457 |
ehcache/ehcache3 | impl/src/main/java/org/ehcache/impl/internal/util/ThreadFactoryUtil.java | ThreadFactoryUtil.threadFactory | public static ThreadFactory threadFactory(final String alias) {
return new ThreadFactory() {
private final ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
private final AtomicInteger threadCount = new AtomicInteger();
private final String poolAlias = (alias == null ? "_default_"... | java | public static ThreadFactory threadFactory(final String alias) {
return new ThreadFactory() {
private final ThreadGroup threadGroup = Thread.currentThread().getThreadGroup();
private final AtomicInteger threadCount = new AtomicInteger();
private final String poolAlias = (alias == null ? "_default_"... | [
"public",
"static",
"ThreadFactory",
"threadFactory",
"(",
"final",
"String",
"alias",
")",
"{",
"return",
"new",
"ThreadFactory",
"(",
")",
"{",
"private",
"final",
"ThreadGroup",
"threadGroup",
"=",
"Thread",
".",
"currentThread",
"(",
")",
".",
"getThreadGrou... | Return a {@code ThreadFactory} that will generate threads named "Ehcache [alias]-incrementingNumber"
@param alias the alias to use in the name. If null, the alias used will be "_default_"
@return the new thread factory | [
"Return",
"a",
"{",
"@code",
"ThreadFactory",
"}",
"that",
"will",
"generate",
"threads",
"named",
"Ehcache",
"[",
"alias",
"]",
"-",
"incrementingNumber"
] | train | https://github.com/ehcache/ehcache3/blob/3cceda57185e522f8d241ddb75146d67ee2af898/impl/src/main/java/org/ehcache/impl/internal/util/ThreadFactoryUtil.java#L42-L57 |
GenesysPureEngage/provisioning-client-java | src/main/java/com/genesys/provisioning/UsersApi.java | UsersApi.updateUser | public void updateUser(String userDBID, User user) throws ProvisioningApiException {
try {
ApiSuccessResponse resp = usersApi.updateUser(userDBID, new UpdateUserData().data(Converters.convertUserToUpdateUserDataData(user)));
if (!resp.getStatus().getCode().equals(0)) {
throw new ProvisioningApiExcepti... | java | public void updateUser(String userDBID, User user) throws ProvisioningApiException {
try {
ApiSuccessResponse resp = usersApi.updateUser(userDBID, new UpdateUserData().data(Converters.convertUserToUpdateUserDataData(user)));
if (!resp.getStatus().getCode().equals(0)) {
throw new ProvisioningApiExcepti... | [
"public",
"void",
"updateUser",
"(",
"String",
"userDBID",
",",
"User",
"user",
")",
"throws",
"ProvisioningApiException",
"{",
"try",
"{",
"ApiSuccessResponse",
"resp",
"=",
"usersApi",
".",
"updateUser",
"(",
"userDBID",
",",
"new",
"UpdateUserData",
"(",
")",... | Updates the attributes of a user with the given DBID.
@param userDBID the DBID of the user to be updated. (required)
@param user the new attributes of the user. (required)
@throws ProvisioningApiException if the call is unsuccessful. | [
"Updates",
"the",
"attributes",
"of",
"a",
"user",
"with",
"the",
"given",
"DBID",
"."
] | train | https://github.com/GenesysPureEngage/provisioning-client-java/blob/1ad594c3767cec83052168e350994f922a26f75e/src/main/java/com/genesys/provisioning/UsersApi.java#L70-L80 |
moparisthebest/beehive | beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java | PageFlowManagedObjectException.sendError | public void sendError( ServletRequest request, ServletResponse response )
throws IOException
{
InternalUtils.sendError( _messageKeyPrefix, getMessageArgs(), request, response, null,
InternalUtils.avoidDirectResponseOutput( request ) );
} | java | public void sendError( ServletRequest request, ServletResponse response )
throws IOException
{
InternalUtils.sendError( _messageKeyPrefix, getMessageArgs(), request, response, null,
InternalUtils.avoidDirectResponseOutput( request ) );
} | [
"public",
"void",
"sendError",
"(",
"ServletRequest",
"request",
",",
"ServletResponse",
"response",
")",
"throws",
"IOException",
"{",
"InternalUtils",
".",
"sendError",
"(",
"_messageKeyPrefix",
",",
"getMessageArgs",
"(",
")",
",",
"request",
",",
"response",
"... | Handle the error by writing a message to the response.
@param request the current HttpServletRequest
@param response the current HttpServletResponse | [
"Handle",
"the",
"error",
"by",
"writing",
"a",
"message",
"to",
"the",
"response",
"."
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-netui-core/src/main/java/org/apache/beehive/netui/pageflow/PageFlowManagedObjectException.java#L107-L112 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.