repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
amaembo/streamex | src/main/java/one/util/streamex/LongStreamEx.java | LongStreamEx.pairMap | public LongStreamEx pairMap(LongBinaryOperator mapper) {
"""
Returns a stream consisting of the results of applying the given function
to the every adjacent pair of elements of this stream.
<p>
This is a <a href="package-summary.html#StreamOps">quasi-intermediate
operation</a>.
<p>
The output stream will... | java | public LongStreamEx pairMap(LongBinaryOperator mapper) {
return delegate(new PairSpliterator.PSOfLong(mapper, null, spliterator(), PairSpliterator.MODE_PAIRS));
} | [
"public",
"LongStreamEx",
"pairMap",
"(",
"LongBinaryOperator",
"mapper",
")",
"{",
"return",
"delegate",
"(",
"new",
"PairSpliterator",
".",
"PSOfLong",
"(",
"mapper",
",",
"null",
",",
"spliterator",
"(",
")",
",",
"PairSpliterator",
".",
"MODE_PAIRS",
")",
... | Returns a stream consisting of the results of applying the given function
to the every adjacent pair of elements of this stream.
<p>
This is a <a href="package-summary.html#StreamOps">quasi-intermediate
operation</a>.
<p>
The output stream will contain one element less than this stream. If this
stream contains zero o... | [
"Returns",
"a",
"stream",
"consisting",
"of",
"the",
"results",
"of",
"applying",
"the",
"given",
"function",
"to",
"the",
"every",
"adjacent",
"pair",
"of",
"elements",
"of",
"this",
"stream",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/LongStreamEx.java#L1383-L1385 |
nguillaumin/slick2d-maven | slick2d-core/src/main/java/org/newdawn/slick/Graphics.java | Graphics.scale | public void scale(float sx, float sy) {
"""
Apply a scaling factor to everything drawn on the graphics context
@param sx
The scaling factor to apply to the x axis
@param sy
The scaling factor to apply to the y axis
"""
this.sx = this.sx * sx;
this.sy = this.sy * sy;
checkPush();
predraw... | java | public void scale(float sx, float sy) {
this.sx = this.sx * sx;
this.sy = this.sy * sy;
checkPush();
predraw();
GL.glScalef(sx, sy, 1);
postdraw();
} | [
"public",
"void",
"scale",
"(",
"float",
"sx",
",",
"float",
"sy",
")",
"{",
"this",
".",
"sx",
"=",
"this",
".",
"sx",
"*",
"sx",
";",
"this",
".",
"sy",
"=",
"this",
".",
"sy",
"*",
"sy",
";",
"checkPush",
"(",
")",
";",
"predraw",
"(",
")"... | Apply a scaling factor to everything drawn on the graphics context
@param sx
The scaling factor to apply to the x axis
@param sy
The scaling factor to apply to the y axis | [
"Apply",
"a",
"scaling",
"factor",
"to",
"everything",
"drawn",
"on",
"the",
"graphics",
"context"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-core/src/main/java/org/newdawn/slick/Graphics.java#L350-L359 |
OpenLiberty/open-liberty | dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/app/deploy/ManifestClassPathUtils.java | ManifestClassPathUtils.addCompleteJarEntryUrls | public static void addCompleteJarEntryUrls(List<ContainerInfo> containers, Entry jarEntry, Collection<String> resolved) throws UnableToAdaptException {
"""
Add the jar entry URLs and its class path URLs.
We need deal with all the thrown exceptions so that it won't interrupt the caller's processing.
@param urls... | java | public static void addCompleteJarEntryUrls(List<ContainerInfo> containers, Entry jarEntry, Collection<String> resolved) throws UnableToAdaptException {
String entryIdentity = createEntryIdentity(jarEntry);
if (!entryIdentity.isEmpty() && !resolved.contains(entryIdentity)) {
resolved.add(entr... | [
"public",
"static",
"void",
"addCompleteJarEntryUrls",
"(",
"List",
"<",
"ContainerInfo",
">",
"containers",
",",
"Entry",
"jarEntry",
",",
"Collection",
"<",
"String",
">",
"resolved",
")",
"throws",
"UnableToAdaptException",
"{",
"String",
"entryIdentity",
"=",
... | Add the jar entry URLs and its class path URLs.
We need deal with all the thrown exceptions so that it won't interrupt the caller's processing.
@param urls
@param jarEntry | [
"Add",
"the",
"jar",
"entry",
"URLs",
"and",
"its",
"class",
"path",
"URLs",
".",
"We",
"need",
"deal",
"with",
"all",
"the",
"thrown",
"exceptions",
"so",
"that",
"it",
"won",
"t",
"interrupt",
"the",
"caller",
"s",
"processing",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.container.service/src/com/ibm/ws/container/service/app/deploy/ManifestClassPathUtils.java#L177-L183 |
ologolo/streamline-engine | src/org/daisy/streamline/engine/PathTools.java | PathTools.deleteRecursive | public static void deleteRecursive(Path start, boolean deleteStart) throws IOException {
"""
Deletes files and folders at the specified path.
@param start the path
@param deleteStart true if the start path should also be deleted, false if only the contents should be deleted
@throws IOException if an I/O error o... | java | public static void deleteRecursive(Path start, boolean deleteStart) throws IOException {
Files.walkFileTree(start, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Files.delete(file);
return FileVisitResult.CONTINUE;
... | [
"public",
"static",
"void",
"deleteRecursive",
"(",
"Path",
"start",
",",
"boolean",
"deleteStart",
")",
"throws",
"IOException",
"{",
"Files",
".",
"walkFileTree",
"(",
"start",
",",
"new",
"SimpleFileVisitor",
"<",
"Path",
">",
"(",
")",
"{",
"@",
"Overrid... | Deletes files and folders at the specified path.
@param start the path
@param deleteStart true if the start path should also be deleted, false if only the contents should be deleted
@throws IOException if an I/O error occurs | [
"Deletes",
"files",
"and",
"folders",
"at",
"the",
"specified",
"path",
"."
] | train | https://github.com/ologolo/streamline-engine/blob/04b7adc85d84d91dc5f0eaaa401d2738f9401b17/src/org/daisy/streamline/engine/PathTools.java#L70-L90 |
OpenLiberty/open-liberty | dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/LogQueryBean.java | LogQueryBean.setLevels | public void setLevels(Level minLevel, Level maxLevel) throws IllegalArgumentException {
"""
sets the current value for the minimum and maximum levels
@param minLevel minimum level
@throws IllegalArgumentException if minLevel is bigger than maxLevel
"""
if (minLevel != null && maxLevel != null && mi... | java | public void setLevels(Level minLevel, Level maxLevel) throws IllegalArgumentException {
if (minLevel != null && maxLevel != null && minLevel.intValue() > maxLevel.intValue()) {
throw new IllegalArgumentException("Value of the minLevel parameter should specify level not larger than the value of the m... | [
"public",
"void",
"setLevels",
"(",
"Level",
"minLevel",
",",
"Level",
"maxLevel",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"minLevel",
"!=",
"null",
"&&",
"maxLevel",
"!=",
"null",
"&&",
"minLevel",
".",
"intValue",
"(",
")",
">",
"maxLeve... | sets the current value for the minimum and maximum levels
@param minLevel minimum level
@throws IllegalArgumentException if minLevel is bigger than maxLevel | [
"sets",
"the",
"current",
"value",
"for",
"the",
"minimum",
"and",
"maximum",
"levels"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.logging.hpel/src/com/ibm/websphere/logging/hpel/reader/LogQueryBean.java#L102-L108 |
Ordinastie/MalisisCore | src/main/java/net/malisis/core/asm/AsmUtils.java | AsmUtils.insnEqual | public static boolean insnEqual(AbstractInsnNode node1, AbstractInsnNode node2) {
"""
Checks if two {@link AbstractInsnNode} are equals.
@param node1 the node1
@param node2 the node2
@return true, if equal
"""
if (node1 == null || node2 == null || node1.getOpcode() != node2.getOpcode())
return false;... | java | public static boolean insnEqual(AbstractInsnNode node1, AbstractInsnNode node2)
{
if (node1 == null || node2 == null || node1.getOpcode() != node2.getOpcode())
return false;
switch (node2.getType())
{
case VAR_INSN:
return varInsnEqual((VarInsnNode) node1, (VarInsnNode) node2);
case TYPE_INSN:
... | [
"public",
"static",
"boolean",
"insnEqual",
"(",
"AbstractInsnNode",
"node1",
",",
"AbstractInsnNode",
"node2",
")",
"{",
"if",
"(",
"node1",
"==",
"null",
"||",
"node2",
"==",
"null",
"||",
"node1",
".",
"getOpcode",
"(",
")",
"!=",
"node2",
".",
"getOpco... | Checks if two {@link AbstractInsnNode} are equals.
@param node1 the node1
@param node2 the node2
@return true, if equal | [
"Checks",
"if",
"two",
"{",
"@link",
"AbstractInsnNode",
"}",
"are",
"equals",
"."
] | train | https://github.com/Ordinastie/MalisisCore/blob/4f8e1fa462d5c372fc23414482ba9f429881cc54/src/main/java/net/malisis/core/asm/AsmUtils.java#L147-L171 |
ecclesia/kipeto | kipeto-tools/src/main/java/de/ecclesia/kipeto/tools/blueprint/BlueprintFactory.java | BlueprintFactory.fromDir | public Blueprint fromDir(String programId, String description, File rootDir) {
"""
Erstellt einen Blueprint aus dem übergebenen RootDir. Blobs und Directorys werden sofort im übergebenen
Repository gespeichert. Der Blueprint selbst wird <b>nicht</b> von gepeichert.<br/>
<br/>
Alle Dateien werden GZIP komprimier... | java | public Blueprint fromDir(String programId, String description, File rootDir) {
return new Blueprint(programId, description, processDir(rootDir), null);
} | [
"public",
"Blueprint",
"fromDir",
"(",
"String",
"programId",
",",
"String",
"description",
",",
"File",
"rootDir",
")",
"{",
"return",
"new",
"Blueprint",
"(",
"programId",
",",
"description",
",",
"processDir",
"(",
"rootDir",
")",
",",
"null",
")",
";",
... | Erstellt einen Blueprint aus dem übergebenen RootDir. Blobs und Directorys werden sofort im übergebenen
Repository gespeichert. Der Blueprint selbst wird <b>nicht</b> von gepeichert.<br/>
<br/>
Alle Dateien werden GZIP komprimiert
@param programId
Name
@param description
Beschreibung
@param rootDir
Einstiegsverzeichni... | [
"Erstellt",
"einen",
"Blueprint",
"aus",
"dem",
"übergebenen",
"RootDir",
".",
"Blobs",
"und",
"Directorys",
"werden",
"sofort",
"im",
"übergebenen",
"Repository",
"gespeichert",
".",
"Der",
"Blueprint",
"selbst",
"wird",
"<b",
">",
"nicht<",
"/",
"b",
">",
"v... | train | https://github.com/ecclesia/kipeto/blob/ea39a10ae4eaa550f71a856ab2f2845270a64913/kipeto-tools/src/main/java/de/ecclesia/kipeto/tools/blueprint/BlueprintFactory.java#L71-L73 |
deeplearning4j/deeplearning4j | nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java | Rational.toFString | public String toFString(int digits) {
"""
Return a string in floating point format.
@param digits The precision (number of digits)
@return The human-readable version in base 10.
"""
if (b.compareTo(BigInteger.ONE) != 0) {
MathContext mc = new MathContext(digits, RoundingMode.DOWN);
... | java | public String toFString(int digits) {
if (b.compareTo(BigInteger.ONE) != 0) {
MathContext mc = new MathContext(digits, RoundingMode.DOWN);
BigDecimal f = (new BigDecimal(a)).divide(new BigDecimal(b), mc);
return (f.toString());
} else {
return a.toString()... | [
"public",
"String",
"toFString",
"(",
"int",
"digits",
")",
"{",
"if",
"(",
"b",
".",
"compareTo",
"(",
"BigInteger",
".",
"ONE",
")",
"!=",
"0",
")",
"{",
"MathContext",
"mc",
"=",
"new",
"MathContext",
"(",
"digits",
",",
"RoundingMode",
".",
"DOWN",... | Return a string in floating point format.
@param digits The precision (number of digits)
@return The human-readable version in base 10. | [
"Return",
"a",
"string",
"in",
"floating",
"point",
"format",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-common/src/main/java/org/nd4j/linalg/util/Rational.java#L510-L518 |
Alluxio/alluxio | job/server/src/main/java/alluxio/worker/JobWorkerIdRegistry.java | JobWorkerIdRegistry.registerWorker | public static void registerWorker(JobMasterClient jobMasterClient, WorkerNetAddress workerAddress)
throws IOException, ConnectionFailedException {
"""
Registers with {@link JobMaster} to get a new job worker id.
@param jobMasterClient the job master client to be used for RPC
@param workerAddress current ... | java | public static void registerWorker(JobMasterClient jobMasterClient, WorkerNetAddress workerAddress)
throws IOException, ConnectionFailedException {
sWorkerId.set(jobMasterClient.registerWorker(workerAddress));
} | [
"public",
"static",
"void",
"registerWorker",
"(",
"JobMasterClient",
"jobMasterClient",
",",
"WorkerNetAddress",
"workerAddress",
")",
"throws",
"IOException",
",",
"ConnectionFailedException",
"{",
"sWorkerId",
".",
"set",
"(",
"jobMasterClient",
".",
"registerWorker",
... | Registers with {@link JobMaster} to get a new job worker id.
@param jobMasterClient the job master client to be used for RPC
@param workerAddress current worker address
@throws IOException when fails to get a new worker id
@throws ConnectionFailedException if network connection failed | [
"Registers",
"with",
"{",
"@link",
"JobMaster",
"}",
"to",
"get",
"a",
"new",
"job",
"worker",
"id",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/worker/JobWorkerIdRegistry.java#L48-L51 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/EntityMetadata.java | EntityMetadata.updateMasterPropertyMetadataMap | public void updateMasterPropertyMetadataMap(String mappedName, String qualifiedName) {
"""
Updates the master property metadata map with the given property metadata.
@param mappedName
the mapped name (or property name in the datastore)
@param qualifiedName
the qualified name of the field
@throws EntityMan... | java | public void updateMasterPropertyMetadataMap(String mappedName, String qualifiedName) {
String old = masterPropertyMetadataMap.put(mappedName, qualifiedName);
if (old != null) {
String message = "Duplicate property %s in entity %s. Check fields %s and %s";
throw new EntityManagerException(
... | [
"public",
"void",
"updateMasterPropertyMetadataMap",
"(",
"String",
"mappedName",
",",
"String",
"qualifiedName",
")",
"{",
"String",
"old",
"=",
"masterPropertyMetadataMap",
".",
"put",
"(",
"mappedName",
",",
"qualifiedName",
")",
";",
"if",
"(",
"old",
"!=",
... | Updates the master property metadata map with the given property metadata.
@param mappedName
the mapped name (or property name in the datastore)
@param qualifiedName
the qualified name of the field
@throws EntityManagerException
if a property with the same mapped name already exists. | [
"Updates",
"the",
"master",
"property",
"metadata",
"map",
"with",
"the",
"given",
"property",
"metadata",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/EntityMetadata.java#L352-L360 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java | Blob.copyTo | public CopyWriter copyTo(String targetBucket, BlobSourceOption... options) {
"""
Sends a copy request for the current blob to the target bucket, preserving its name. Possibly
copying also some of the metadata (e.g. content-type).
<p>Example of copying the blob to a different bucket, keeping the original name.
... | java | public CopyWriter copyTo(String targetBucket, BlobSourceOption... options) {
return copyTo(targetBucket, getName(), options);
} | [
"public",
"CopyWriter",
"copyTo",
"(",
"String",
"targetBucket",
",",
"BlobSourceOption",
"...",
"options",
")",
"{",
"return",
"copyTo",
"(",
"targetBucket",
",",
"getName",
"(",
")",
",",
"options",
")",
";",
"}"
] | Sends a copy request for the current blob to the target bucket, preserving its name. Possibly
copying also some of the metadata (e.g. content-type).
<p>Example of copying the blob to a different bucket, keeping the original name.
<pre>{@code
String bucketName = "my_unique_bucket";
CopyWriter copyWriter = blob.copyTo(... | [
"Sends",
"a",
"copy",
"request",
"for",
"the",
"current",
"blob",
"to",
"the",
"target",
"bucket",
"preserving",
"its",
"name",
".",
"Possibly",
"copying",
"also",
"some",
"of",
"the",
"metadata",
"(",
"e",
".",
"g",
".",
"content",
"-",
"type",
")",
"... | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-storage/src/main/java/com/google/cloud/storage/Blob.java#L606-L608 |
groupon/odo | client/src/main/java/com/groupon/odo/client/Client.java | Client.exportConfigurationAndProfile | public JSONObject exportConfigurationAndProfile(String oldExport) {
"""
Export the odo overrides setup and odo configuration
@param oldExport Whether this is a backup from scratch or backing up because user will upload after (matches API)
@return The odo configuration and overrides in JSON format, can be writt... | java | public JSONObject exportConfigurationAndProfile(String oldExport) {
try {
BasicNameValuePair[] params = {
new BasicNameValuePair("oldExport", oldExport)
};
String url = BASE_BACKUP_PROFILE + "/" + uriEncode(this._profileName) + "/" + this._clientId;
... | [
"public",
"JSONObject",
"exportConfigurationAndProfile",
"(",
"String",
"oldExport",
")",
"{",
"try",
"{",
"BasicNameValuePair",
"[",
"]",
"params",
"=",
"{",
"new",
"BasicNameValuePair",
"(",
"\"oldExport\"",
",",
"oldExport",
")",
"}",
";",
"String",
"url",
"=... | Export the odo overrides setup and odo configuration
@param oldExport Whether this is a backup from scratch or backing up because user will upload after (matches API)
@return The odo configuration and overrides in JSON format, can be written to a file after | [
"Export",
"the",
"odo",
"overrides",
"setup",
"and",
"odo",
"configuration"
] | train | https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/client/src/main/java/com/groupon/odo/client/Client.java#L1372-L1382 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Currency.java | Currency.getName | public String getName(ULocale locale, int nameStyle, boolean[] isChoiceFormat) {
"""
Returns the display name for the given currency in the
given locale. For example, the display name for the USD
currency object in the en_US locale is "$".
@param locale locale in which to display currency
@param nameStyle sel... | java | public String getName(ULocale locale, int nameStyle, boolean[] isChoiceFormat) {
if (!(nameStyle == SYMBOL_NAME || nameStyle == LONG_NAME)) {
throw new IllegalArgumentException("bad name style: " + nameStyle);
}
// We no longer support choice format data in names. Data should not c... | [
"public",
"String",
"getName",
"(",
"ULocale",
"locale",
",",
"int",
"nameStyle",
",",
"boolean",
"[",
"]",
"isChoiceFormat",
")",
"{",
"if",
"(",
"!",
"(",
"nameStyle",
"==",
"SYMBOL_NAME",
"||",
"nameStyle",
"==",
"LONG_NAME",
")",
")",
"{",
"throw",
"... | Returns the display name for the given currency in the
given locale. For example, the display name for the USD
currency object in the en_US locale is "$".
@param locale locale in which to display currency
@param nameStyle selector for which kind of name to return.
The nameStyle should be either SYMBOL_NAME or
LONG_NAM... | [
"Returns",
"the",
"display",
"name",
"for",
"the",
"given",
"currency",
"in",
"the",
"given",
"locale",
".",
"For",
"example",
"the",
"display",
"name",
"for",
"the",
"USD",
"currency",
"object",
"in",
"the",
"en_US",
"locale",
"is",
"$",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/Currency.java#L528-L541 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java | BootstrapConfig.addMissingProperties | protected void addMissingProperties(Properties source, Map<String, String> target) {
"""
Add properties from source to target if the target map does not
already contain a property with that value. When a new attribute
is discovered, System properties are checked to see if an override
has been specified. If the ... | java | protected void addMissingProperties(Properties source, Map<String, String> target) {
if (source == null || source.isEmpty() || target == null)
return;
// only add "new" properties (first value wins)
for (String key : source.stringPropertyNames()) {
if (!target.containsKe... | [
"protected",
"void",
"addMissingProperties",
"(",
"Properties",
"source",
",",
"Map",
"<",
"String",
",",
"String",
">",
"target",
")",
"{",
"if",
"(",
"source",
"==",
"null",
"||",
"source",
".",
"isEmpty",
"(",
")",
"||",
"target",
"==",
"null",
")",
... | Add properties from source to target if the target map does not
already contain a property with that value. When a new attribute
is discovered, System properties are checked to see if an override
has been specified. If the property is present as a System property
(from the command line or jvm.options), that value is us... | [
"Add",
"properties",
"from",
"source",
"to",
"target",
"if",
"the",
"target",
"map",
"does",
"not",
"already",
"contain",
"a",
"property",
"with",
"that",
"value",
".",
"When",
"a",
"new",
"attribute",
"is",
"discovered",
"System",
"properties",
"are",
"chec... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/boot/BootstrapConfig.java#L706-L722 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java | ContextManager.destroySubcontext | public void destroySubcontext(String name) throws EntityHasDescendantsException, EntityNotFoundException, WIMSystemException {
"""
Delete the given name from the LDAP tree.
@param name The distinguished name to delete.
@throws EntityHasDescendantsException The context being destroyed is not empty.
@throws Ent... | java | public void destroySubcontext(String name) throws EntityHasDescendantsException, EntityNotFoundException, WIMSystemException {
TimedDirContext ctx = getDirContext();
// checkWritePermission(ctx); // TODO Why are we not checking permissions here?
try {
try {
ctx.destro... | [
"public",
"void",
"destroySubcontext",
"(",
"String",
"name",
")",
"throws",
"EntityHasDescendantsException",
",",
"EntityNotFoundException",
",",
"WIMSystemException",
"{",
"TimedDirContext",
"ctx",
"=",
"getDirContext",
"(",
")",
";",
"// checkWritePermission(ctx); // TOD... | Delete the given name from the LDAP tree.
@param name The distinguished name to delete.
@throws EntityHasDescendantsException The context being destroyed is not empty.
@throws EntityNotFoundException If part of the name cannot be found to destroy the entity.
@throws WIMSystemException If any other {@link NamingExcepti... | [
"Delete",
"the",
"given",
"name",
"from",
"the",
"LDAP",
"tree",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/context/ContextManager.java#L579-L604 |
zandero/rest.vertx | src/main/java/com/zandero/rest/RestBuilder.java | RestBuilder.addProvider | public <T> RestBuilder addProvider(Class<T> clazz, Class<? extends ContextProvider<T>> provider) {
"""
Creates a provider that delivers type when needed
@param provider to be executed when needed
@param <T> provided object as argument
@return builder
"""
Assert.notNull(clazz, "Missing provided class type... | java | public <T> RestBuilder addProvider(Class<T> clazz, Class<? extends ContextProvider<T>> provider) {
Assert.notNull(clazz, "Missing provided class type!");
Assert.notNull(provider, "Missing context provider!");
registeredProviders.put(clazz, provider);
return this;
} | [
"public",
"<",
"T",
">",
"RestBuilder",
"addProvider",
"(",
"Class",
"<",
"T",
">",
"clazz",
",",
"Class",
"<",
"?",
"extends",
"ContextProvider",
"<",
"T",
">",
">",
"provider",
")",
"{",
"Assert",
".",
"notNull",
"(",
"clazz",
",",
"\"Missing provided ... | Creates a provider that delivers type when needed
@param provider to be executed when needed
@param <T> provided object as argument
@return builder | [
"Creates",
"a",
"provider",
"that",
"delivers",
"type",
"when",
"needed"
] | train | https://github.com/zandero/rest.vertx/blob/ba458720cf59e076953eab9dac7227eeaf9e58ce/src/main/java/com/zandero/rest/RestBuilder.java#L353-L359 |
meltmedia/cadmium | email/src/main/java/com/meltmedia/cadmium/email/EmailUtil.java | EmailUtil.newHtmlAttachmentBodyPart | public static MimeBodyPart newHtmlAttachmentBodyPart( URL contentUrl, String contentId )
throws MessagingException {
"""
Creates a body part for an attachment that is used by an html body part.
"""
MimeBodyPart mimeBodyPart = new MimeBodyPart();
mimeBodyPart.setDataHandler(new DataHandler(contentUr... | java | public static MimeBodyPart newHtmlAttachmentBodyPart( URL contentUrl, String contentId )
throws MessagingException
{
MimeBodyPart mimeBodyPart = new MimeBodyPart();
mimeBodyPart.setDataHandler(new DataHandler(contentUrl));
if( contentId != null ) {
mimeBodyPart.setHeader("Content-ID", contentId)... | [
"public",
"static",
"MimeBodyPart",
"newHtmlAttachmentBodyPart",
"(",
"URL",
"contentUrl",
",",
"String",
"contentId",
")",
"throws",
"MessagingException",
"{",
"MimeBodyPart",
"mimeBodyPart",
"=",
"new",
"MimeBodyPart",
"(",
")",
";",
"mimeBodyPart",
".",
"setDataHan... | Creates a body part for an attachment that is used by an html body part. | [
"Creates",
"a",
"body",
"part",
"for",
"an",
"attachment",
"that",
"is",
"used",
"by",
"an",
"html",
"body",
"part",
"."
] | train | https://github.com/meltmedia/cadmium/blob/bca585030e141803a73b58abb128d130157b6ddf/email/src/main/java/com/meltmedia/cadmium/email/EmailUtil.java#L102-L111 |
rampo/UpdateChecker | library/src/main/java/com/rampo/updatechecker/Comparator.java | Comparator.isVersionDownloadableNewer | public static boolean isVersionDownloadableNewer(Activity mActivity, String versionDownloadable) {
"""
Compare the string versionDownloadable to the version installed of the app.
@param versionDownloadable String to compare to the version installed of the app.
"""
String versionInstalled = null;
... | java | public static boolean isVersionDownloadableNewer(Activity mActivity, String versionDownloadable) {
String versionInstalled = null;
try {
versionInstalled = mActivity.getPackageManager().getPackageInfo(mActivity.getPackageName(), 0).versionName;
} catch (PackageManager.NameNotFoundExc... | [
"public",
"static",
"boolean",
"isVersionDownloadableNewer",
"(",
"Activity",
"mActivity",
",",
"String",
"versionDownloadable",
")",
"{",
"String",
"versionInstalled",
"=",
"null",
";",
"try",
"{",
"versionInstalled",
"=",
"mActivity",
".",
"getPackageManager",
"(",
... | Compare the string versionDownloadable to the version installed of the app.
@param versionDownloadable String to compare to the version installed of the app. | [
"Compare",
"the",
"string",
"versionDownloadable",
"to",
"the",
"version",
"installed",
"of",
"the",
"app",
"."
] | train | https://github.com/rampo/UpdateChecker/blob/738da234d46396b6396e15e7261f38b0cabf9913/library/src/main/java/com/rampo/updatechecker/Comparator.java#L27-L38 |
aws/aws-sdk-java | aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/Rule.java | Rule.withParameters | public Rule withParameters(java.util.Map<String, String> parameters) {
"""
<p>
The minimum and maximum parameters that are associated with the rule.
</p>
@param parameters
The minimum and maximum parameters that are associated with the rule.
@return Returns a reference to this object so that method calls ca... | java | public Rule withParameters(java.util.Map<String, String> parameters) {
setParameters(parameters);
return this;
} | [
"public",
"Rule",
"withParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
")",
"{",
"setParameters",
"(",
"parameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
The minimum and maximum parameters that are associated with the rule.
</p>
@param parameters
The minimum and maximum parameters that are associated with the rule.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"The",
"minimum",
"and",
"maximum",
"parameters",
"that",
"are",
"associated",
"with",
"the",
"rule",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-clouddirectory/src/main/java/com/amazonaws/services/clouddirectory/model/Rule.java#L152-L155 |
OpenLiberty/open-liberty | dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java | LdapConnection.invalidateAttributes | public void invalidateAttributes(String DN, String extId, String uniqueName) {
"""
Method to invalidate the specified entry from the attributes cache. One or all
parameters can be set in a single call. If all parameters are null, then this
operation no-ops.
@param DN The distinguished name of the entity to in... | java | public void invalidateAttributes(String DN, String extId, String uniqueName) {
final String METHODNAME = "invalidateAttributes(String, String, String)";
if (getAttributesCache() != null) {
if (DN != null) {
getAttributesCache().invalidate(toKey(DN));
}
... | [
"public",
"void",
"invalidateAttributes",
"(",
"String",
"DN",
",",
"String",
"extId",
",",
"String",
"uniqueName",
")",
"{",
"final",
"String",
"METHODNAME",
"=",
"\"invalidateAttributes(String, String, String)\"",
";",
"if",
"(",
"getAttributesCache",
"(",
")",
"!... | Method to invalidate the specified entry from the attributes cache. One or all
parameters can be set in a single call. If all parameters are null, then this
operation no-ops.
@param DN The distinguished name of the entity to invalidate attributes on.
@param extId The external ID of the entity to invalidate attributes ... | [
"Method",
"to",
"invalidate",
"the",
"specified",
"entry",
"from",
"the",
"attributes",
"cache",
".",
"One",
"or",
"all",
"parameters",
"can",
"be",
"set",
"in",
"a",
"single",
"call",
".",
"If",
"all",
"parameters",
"are",
"null",
"then",
"this",
"operati... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.security.wim.adapter.ldap/src/com/ibm/ws/security/wim/adapter/ldap/LdapConnection.java#L683-L703 |
TheHortonMachine/hortonmachine | gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java | StringUtilities.joinStrings | public static String joinStrings( String separator, String... strings ) {
"""
Join strings through {@link StringBuilder}.
@param separator separator to use or <code>null</code>.
@param strings strings to join.
@return the joined string.
"""
if (separator == null) {
separator = "";
... | java | public static String joinStrings( String separator, String... strings ) {
if (separator == null) {
separator = "";
}
StringBuilder sb = new StringBuilder();
for( int i = 0; i < strings.length; i++ ) {
sb.append(strings[i]);
if (i < strings.length - 1) ... | [
"public",
"static",
"String",
"joinStrings",
"(",
"String",
"separator",
",",
"String",
"...",
"strings",
")",
"{",
"if",
"(",
"separator",
"==",
"null",
")",
"{",
"separator",
"=",
"\"\"",
";",
"}",
"StringBuilder",
"sb",
"=",
"new",
"StringBuilder",
"(",... | Join strings through {@link StringBuilder}.
@param separator separator to use or <code>null</code>.
@param strings strings to join.
@return the joined string. | [
"Join",
"strings",
"through",
"{",
"@link",
"StringBuilder",
"}",
"."
] | train | https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/org/hortonmachine/gears/utils/StringUtilities.java#L77-L89 |
Samsung/GearVRf | GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java | AiMaterial.setDefault | public void setDefault(PropertyKey key, Object defaultValue) {
"""
Sets a default value.<p>
The passed in Object must match the type of the key as returned by
the corresponding <code>getXXX()</code> method.
@param key the key
@param defaultValue the new default, may not be null
@throws IllegalArgumentExce... | java | public void setDefault(PropertyKey key, Object defaultValue) {
if (null == defaultValue) {
throw new IllegalArgumentException("defaultValue may not be null");
}
if (key.m_type != defaultValue.getClass()) {
throw new IllegalArgumentException(
"defaultVa... | [
"public",
"void",
"setDefault",
"(",
"PropertyKey",
"key",
",",
"Object",
"defaultValue",
")",
"{",
"if",
"(",
"null",
"==",
"defaultValue",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"defaultValue may not be null\"",
")",
";",
"}",
"if",
"(",
... | Sets a default value.<p>
The passed in Object must match the type of the key as returned by
the corresponding <code>getXXX()</code> method.
@param key the key
@param defaultValue the new default, may not be null
@throws IllegalArgumentException if defaultValue is null or has a wrong
type | [
"Sets",
"a",
"default",
"value",
".",
"<p",
">"
] | train | https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Framework/framework/src/main/java/org/gearvrf/jassimp/AiMaterial.java#L521-L533 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/crypto/CredentialStoreFactory.java | CredentialStoreFactory.buildCredentialStore | @Synchronized
public static CredentialStore buildCredentialStore(Map<String, Object> parameters) {
"""
Build a CredentialStore with the given config parameters. The type will be extracted from the parameters.
See {@link EncryptionConfigParser} for a set of standard configuration parameters, although
each encry... | java | @Synchronized
public static CredentialStore buildCredentialStore(Map<String, Object> parameters) {
String credType = EncryptionConfigParser.getKeystoreType(parameters);
for (CredentialStoreProvider provider : credentialStoreProviderLoader) {
log.debug("Looking for cred store type {} in provider {}", cr... | [
"@",
"Synchronized",
"public",
"static",
"CredentialStore",
"buildCredentialStore",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"String",
"credType",
"=",
"EncryptionConfigParser",
".",
"getKeystoreType",
"(",
"parameters",
")",
";",
"fo... | Build a CredentialStore with the given config parameters. The type will be extracted from the parameters.
See {@link EncryptionConfigParser} for a set of standard configuration parameters, although
each encryption provider may have its own arbitrary set.
@return A CredentialStore for the given parameters
@throws Illega... | [
"Build",
"a",
"CredentialStore",
"with",
"the",
"given",
"config",
"parameters",
".",
"The",
"type",
"will",
"be",
"extracted",
"from",
"the",
"parameters",
".",
"See",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/crypto/CredentialStoreFactory.java#L45-L59 |
tvesalainen/util | util/src/main/java/org/vesalainen/math/AbstractLine.java | AbstractLine.crossPoint | public static Point crossPoint(Line l1, Line l2) {
"""
Returns the crosspoint of lines l1 and l2. If lines don't cross returns null.
<p>Note returns null if lines are parallel and also when lines ate equal.!
@param l1
@param l2
@return
"""
return crossPoint(l1, l2, null);
} | java | public static Point crossPoint(Line l1, Line l2)
{
return crossPoint(l1, l2, null);
} | [
"public",
"static",
"Point",
"crossPoint",
"(",
"Line",
"l1",
",",
"Line",
"l2",
")",
"{",
"return",
"crossPoint",
"(",
"l1",
",",
"l2",
",",
"null",
")",
";",
"}"
] | Returns the crosspoint of lines l1 and l2. If lines don't cross returns null.
<p>Note returns null if lines are parallel and also when lines ate equal.!
@param l1
@param l2
@return | [
"Returns",
"the",
"crosspoint",
"of",
"lines",
"l1",
"and",
"l2",
".",
"If",
"lines",
"don",
"t",
"cross",
"returns",
"null",
"."
] | train | https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/AbstractLine.java#L157-L160 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_mitigationProfiles_ipMitigationProfile_PUT | public void ip_mitigationProfiles_ipMitigationProfile_PUT(String ip, String ipMitigationProfile, OvhMitigationProfile body) throws IOException {
"""
Alter this object properties
REST: PUT /ip/{ip}/mitigationProfiles/{ipMitigationProfile}
@param body [required] New object properties
@param ip [required]
@para... | java | public void ip_mitigationProfiles_ipMitigationProfile_PUT(String ip, String ipMitigationProfile, OvhMitigationProfile body) throws IOException {
String qPath = "/ip/{ip}/mitigationProfiles/{ipMitigationProfile}";
StringBuilder sb = path(qPath, ip, ipMitigationProfile);
exec(qPath, "PUT", sb.toString(), body);
} | [
"public",
"void",
"ip_mitigationProfiles_ipMitigationProfile_PUT",
"(",
"String",
"ip",
",",
"String",
"ipMitigationProfile",
",",
"OvhMitigationProfile",
"body",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/mitigationProfiles/{ipMitigationProfile}\"",... | Alter this object properties
REST: PUT /ip/{ip}/mitigationProfiles/{ipMitigationProfile}
@param body [required] New object properties
@param ip [required]
@param ipMitigationProfile [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L915-L919 |
xm-online/xm-commons | xm-commons-logging/src/main/java/com/icthh/xm/commons/logging/util/LogObjectPrinter.java | LogObjectPrinter.joinUrlPaths | @SafeVarargs
public static <T> String joinUrlPaths(final T[] arr, final T... arr2) {
"""
Join URL path into one string.
@param arr first url paths
@param arr2 other url paths
@param <T> url part path type
@return URL representation string
"""
try {
T[] url = ArrayUtils.addAll(ar... | java | @SafeVarargs
public static <T> String joinUrlPaths(final T[] arr, final T... arr2) {
try {
T[] url = ArrayUtils.addAll(arr, arr2);
String res = StringUtils.join(url);
return (res == null) ? "" : res;
} catch (IndexOutOfBoundsException | IllegalArgumentException | ... | [
"@",
"SafeVarargs",
"public",
"static",
"<",
"T",
">",
"String",
"joinUrlPaths",
"(",
"final",
"T",
"[",
"]",
"arr",
",",
"final",
"T",
"...",
"arr2",
")",
"{",
"try",
"{",
"T",
"[",
"]",
"url",
"=",
"ArrayUtils",
".",
"addAll",
"(",
"arr",
",",
... | Join URL path into one string.
@param arr first url paths
@param arr2 other url paths
@param <T> url part path type
@return URL representation string | [
"Join",
"URL",
"path",
"into",
"one",
"string",
"."
] | train | https://github.com/xm-online/xm-commons/blob/43eb2273adb96f40830d7b905ee3a767b8715caf/xm-commons-logging/src/main/java/com/icthh/xm/commons/logging/util/LogObjectPrinter.java#L110-L120 |
Alluxio/alluxio | shell/src/main/java/alluxio/cli/fs/command/CpCommand.java | CpCommand.copyFileToLocal | private void copyFileToLocal(AlluxioURI srcPath, AlluxioURI dstPath)
throws AlluxioException, IOException {
"""
Copies a file specified by argv from the filesystem to the local filesystem. This is the
utility function.
@param srcPath The source {@link AlluxioURI} (has to be a file)
@param dstPath The {@... | java | private void copyFileToLocal(AlluxioURI srcPath, AlluxioURI dstPath)
throws AlluxioException, IOException {
File dstFile = new File(dstPath.getPath());
String randomSuffix =
String.format(".%s_copyToLocal_", RandomStringUtils.randomAlphanumeric(8));
File outputFile;
if (dstFile.isDirectory... | [
"private",
"void",
"copyFileToLocal",
"(",
"AlluxioURI",
"srcPath",
",",
"AlluxioURI",
"dstPath",
")",
"throws",
"AlluxioException",
",",
"IOException",
"{",
"File",
"dstFile",
"=",
"new",
"File",
"(",
"dstPath",
".",
"getPath",
"(",
")",
")",
";",
"String",
... | Copies a file specified by argv from the filesystem to the local filesystem. This is the
utility function.
@param srcPath The source {@link AlluxioURI} (has to be a file)
@param dstPath The {@link AlluxioURI} of the destination in the local filesystem | [
"Copies",
"a",
"file",
"specified",
"by",
"argv",
"from",
"the",
"filesystem",
"to",
"the",
"local",
"filesystem",
".",
"This",
"is",
"the",
"utility",
"function",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fs/command/CpCommand.java#L756-L786 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.dedicatedCloud_serviceName_additionalBandwidth_duration_POST | public OvhOrder dedicatedCloud_serviceName_additionalBandwidth_duration_POST(String serviceName, String duration, OvhAdditionalBandwidthEnum bandwidth) throws IOException {
"""
Create order
REST: POST /order/dedicatedCloud/{serviceName}/additionalBandwidth/{duration}
@param bandwidth [required] How much additi... | java | public OvhOrder dedicatedCloud_serviceName_additionalBandwidth_duration_POST(String serviceName, String duration, OvhAdditionalBandwidthEnum bandwidth) throws IOException {
String qPath = "/order/dedicatedCloud/{serviceName}/additionalBandwidth/{duration}";
StringBuilder sb = path(qPath, serviceName, duration);
H... | [
"public",
"OvhOrder",
"dedicatedCloud_serviceName_additionalBandwidth_duration_POST",
"(",
"String",
"serviceName",
",",
"String",
"duration",
",",
"OvhAdditionalBandwidthEnum",
"bandwidth",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/dedicatedCloud/{se... | Create order
REST: POST /order/dedicatedCloud/{serviceName}/additionalBandwidth/{duration}
@param bandwidth [required] How much additional bandwidth do you want ?
@param serviceName [required]
@param duration [required] Duration | [
"Create",
"order"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L5702-L5709 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/reader/impl/BasicModelUtils.java | BasicModelUtils.wordsNearestSum | @Override
public Collection<String> wordsNearestSum(Collection<String> positive, Collection<String> negative, int top) {
"""
Words nearest based on positive and negative words
@param positive the positive words
@param negative the negative words
@param top the top n words
@return the words nearest the mean... | java | @Override
public Collection<String> wordsNearestSum(Collection<String> positive, Collection<String> negative, int top) {
INDArray words = Nd4j.create(lookupTable.layerSize());
// Set<String> union = SetUtils.union(new HashSet<>(positive), new HashSet<>(negative));
for (String s : positive... | [
"@",
"Override",
"public",
"Collection",
"<",
"String",
">",
"wordsNearestSum",
"(",
"Collection",
"<",
"String",
">",
"positive",
",",
"Collection",
"<",
"String",
">",
"negative",
",",
"int",
"top",
")",
"{",
"INDArray",
"words",
"=",
"Nd4j",
".",
"creat... | Words nearest based on positive and negative words
@param positive the positive words
@param negative the negative words
@param top the top n words
@return the words nearest the mean of the words | [
"Words",
"nearest",
"based",
"on",
"positive",
"and",
"negative",
"words"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/reader/impl/BasicModelUtils.java#L379-L391 |
morfologik/morfologik-stemming | morfologik-stemming/src/main/java/morfologik/stemming/DictionaryLookup.java | DictionaryLookup.applyReplacements | public static String applyReplacements(CharSequence word, LinkedHashMap<String, String> replacements) {
"""
Apply partial string replacements from a given map.
Useful if the word needs to be normalized somehow (i.e., ligatures,
apostrophes and such).
@param word The word to apply replacements to.
@param re... | java | public static String applyReplacements(CharSequence word, LinkedHashMap<String, String> replacements) {
// quite horrible from performance point of view; this should really be a transducer.
StringBuilder sb = new StringBuilder(word);
for (final Map.Entry<String, String> e : replacements.entrySet()) {
... | [
"public",
"static",
"String",
"applyReplacements",
"(",
"CharSequence",
"word",
",",
"LinkedHashMap",
"<",
"String",
",",
"String",
">",
"replacements",
")",
"{",
"// quite horrible from performance point of view; this should really be a transducer.\r",
"StringBuilder",
"sb",
... | Apply partial string replacements from a given map.
Useful if the word needs to be normalized somehow (i.e., ligatures,
apostrophes and such).
@param word The word to apply replacements to.
@param replacements A map of replacements (from->to).
@return new string with all replacements applied. | [
"Apply",
"partial",
"string",
"replacements",
"from",
"a",
"given",
"map",
"."
] | train | https://github.com/morfologik/morfologik-stemming/blob/9d9099cc5ec4155a0eb8dfecdc23d01cbd734f6e/morfologik-stemming/src/main/java/morfologik/stemming/DictionaryLookup.java#L259-L271 |
camunda/camunda-bpm-platform | engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/behavior/AbstractBpmnActivityBehavior.java | AbstractBpmnActivityBehavior.propagateException | protected void propagateException(ActivityExecution execution, Exception ex) throws Exception {
"""
Decides how to propagate the exception properly, e.g. as bpmn error or "normal" error.
@param execution the current execution
@param ex the exception to propagate
@throws Exception if no error handler could be fo... | java | protected void propagateException(ActivityExecution execution, Exception ex) throws Exception {
BpmnError bpmnError = checkIfCauseOfExceptionIsBpmnError(ex);
if (bpmnError != null) {
propagateBpmnError(bpmnError, execution);
} else {
propagateExceptionAsError(ex, execution);
}
} | [
"protected",
"void",
"propagateException",
"(",
"ActivityExecution",
"execution",
",",
"Exception",
"ex",
")",
"throws",
"Exception",
"{",
"BpmnError",
"bpmnError",
"=",
"checkIfCauseOfExceptionIsBpmnError",
"(",
"ex",
")",
";",
"if",
"(",
"bpmnError",
"!=",
"null",... | Decides how to propagate the exception properly, e.g. as bpmn error or "normal" error.
@param execution the current execution
@param ex the exception to propagate
@throws Exception if no error handler could be found | [
"Decides",
"how",
"to",
"propagate",
"the",
"exception",
"properly",
"e",
".",
"g",
".",
"as",
"bpmn",
"error",
"or",
"normal",
"error",
"."
] | train | https://github.com/camunda/camunda-bpm-platform/blob/1a464fc887ef3760e53d6f91b9e5b871a0d77cc0/engine/src/main/java/org/camunda/bpm/engine/impl/bpmn/behavior/AbstractBpmnActivityBehavior.java#L138-L145 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java | ThreadedServer.newServerSocket | protected ServerSocket newServerSocket(InetAddrPort address, int acceptQueueSize)
throws java.io.IOException {
"""
New server socket. Creates a new servers socket. May be overriden by derived class to create
specialist serversockets (eg SSL).
@param address Address and port
@param acceptQueueSize ... | java | protected ServerSocket newServerSocket(InetAddrPort address, int acceptQueueSize)
throws java.io.IOException
{
if (address == null) return new ServerSocket(0, acceptQueueSize);
return new ServerSocket(address.getPort(), acceptQueueSize, address.getInetAddress());
} | [
"protected",
"ServerSocket",
"newServerSocket",
"(",
"InetAddrPort",
"address",
",",
"int",
"acceptQueueSize",
")",
"throws",
"java",
".",
"io",
".",
"IOException",
"{",
"if",
"(",
"address",
"==",
"null",
")",
"return",
"new",
"ServerSocket",
"(",
"0",
",",
... | New server socket. Creates a new servers socket. May be overriden by derived class to create
specialist serversockets (eg SSL).
@param address Address and port
@param acceptQueueSize Accept queue size
@return The new ServerSocket
@exception java.io.IOException | [
"New",
"server",
"socket",
".",
"Creates",
"a",
"new",
"servers",
"socket",
".",
"May",
"be",
"overriden",
"by",
"derived",
"class",
"to",
"create",
"specialist",
"serversockets",
"(",
"eg",
"SSL",
")",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/util/ThreadedServer.java#L386-L392 |
vkostyukov/la4j | src/main/java/org/la4j/Matrices.java | Matrices.asMulFunction | public static MatrixFunction asMulFunction(final double arg) {
"""
Creates a mul function that multiplies given {@code value} by it's argument.
@param arg a value to be multiplied by function's argument
@return a closure that does {@code _ * _}
"""
return new MatrixFunction() {
@Overr... | java | public static MatrixFunction asMulFunction(final double arg) {
return new MatrixFunction() {
@Override
public double evaluate(int i, int j, double value) {
return value * arg;
}
};
} | [
"public",
"static",
"MatrixFunction",
"asMulFunction",
"(",
"final",
"double",
"arg",
")",
"{",
"return",
"new",
"MatrixFunction",
"(",
")",
"{",
"@",
"Override",
"public",
"double",
"evaluate",
"(",
"int",
"i",
",",
"int",
"j",
",",
"double",
"value",
")"... | Creates a mul function that multiplies given {@code value} by it's argument.
@param arg a value to be multiplied by function's argument
@return a closure that does {@code _ * _} | [
"Creates",
"a",
"mul",
"function",
"that",
"multiplies",
"given",
"{",
"@code",
"value",
"}",
"by",
"it",
"s",
"argument",
"."
] | train | https://github.com/vkostyukov/la4j/blob/dd1b917caf9606399a49afa6b0d738934cd3a7b3/src/main/java/org/la4j/Matrices.java#L471-L478 |
soi-toolkit/soi-toolkit-mule | commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/monitor/MonitorEndpointHelper.java | MonitorEndpointHelper.pingJmsEndpoint | public static String pingJmsEndpoint(MuleContext muleContext, String queueName) {
"""
Verify access to a JMS endpoint by browsing a specified queue for messages.
"""
return pingJmsEndpoint(muleContext, DEFAULT_MULE_JMS_CONNECTOR, queueName);
} | java | public static String pingJmsEndpoint(MuleContext muleContext, String queueName) {
return pingJmsEndpoint(muleContext, DEFAULT_MULE_JMS_CONNECTOR, queueName);
} | [
"public",
"static",
"String",
"pingJmsEndpoint",
"(",
"MuleContext",
"muleContext",
",",
"String",
"queueName",
")",
"{",
"return",
"pingJmsEndpoint",
"(",
"muleContext",
",",
"DEFAULT_MULE_JMS_CONNECTOR",
",",
"queueName",
")",
";",
"}"
] | Verify access to a JMS endpoint by browsing a specified queue for messages. | [
"Verify",
"access",
"to",
"a",
"JMS",
"endpoint",
"by",
"browsing",
"a",
"specified",
"queue",
"for",
"messages",
"."
] | train | https://github.com/soi-toolkit/soi-toolkit-mule/blob/e891350dbf55e6307be94d193d056bdb785b37d3/commons/components/commons-mule/src/main/java/org/soitoolkit/commons/mule/monitor/MonitorEndpointHelper.java#L117-L119 |
pushtorefresh/storio | storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/operations/put/PutResult.java | PutResult.newInsertResult | @NonNull
public static PutResult newInsertResult(
long insertedId,
@NonNull String affectedTable,
@Nullable Collection<String> affectedTags
) {
"""
Creates {@link PutResult} of insert.
@param insertedId id of new row.
@param affectedTable table that was affected.
... | java | @NonNull
public static PutResult newInsertResult(
long insertedId,
@NonNull String affectedTable,
@Nullable Collection<String> affectedTags
) {
checkNotNull(affectedTable, "Please specify affected table");
return new PutResult(insertedId, null, singleton(affec... | [
"@",
"NonNull",
"public",
"static",
"PutResult",
"newInsertResult",
"(",
"long",
"insertedId",
",",
"@",
"NonNull",
"String",
"affectedTable",
",",
"@",
"Nullable",
"Collection",
"<",
"String",
">",
"affectedTags",
")",
"{",
"checkNotNull",
"(",
"affectedTable",
... | Creates {@link PutResult} of insert.
@param insertedId id of new row.
@param affectedTable table that was affected.
@param affectedTags notification tags that were affected.
@return new {@link PutResult} instance. | [
"Creates",
"{",
"@link",
"PutResult",
"}",
"of",
"insert",
"."
] | train | https://github.com/pushtorefresh/storio/blob/58f53d81bcc7b069c8bb271c46a90e37775abe8d/storio-sqlite/src/main/java/com/pushtorefresh/storio3/sqlite/operations/put/PutResult.java#L106-L114 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java | ImportScope.finalizeScope | public void finalizeScope() {
"""
Finalize the content of the ImportScope to speed-up future lookups.
No further changes to class hierarchy or class content will be reflected.
"""
for (List<Scope> scopes = this.subScopes; scopes.nonEmpty(); scopes = scopes.tail) {
Scope impScope = ... | java | public void finalizeScope() {
for (List<Scope> scopes = this.subScopes; scopes.nonEmpty(); scopes = scopes.tail) {
Scope impScope = scopes.head;
if (impScope instanceof FilterImportScope && impScope.owner.kind == Kind.TYP) {
WriteableScope finalized = Wri... | [
"public",
"void",
"finalizeScope",
"(",
")",
"{",
"for",
"(",
"List",
"<",
"Scope",
">",
"scopes",
"=",
"this",
".",
"subScopes",
";",
"scopes",
".",
"nonEmpty",
"(",
")",
";",
"scopes",
"=",
"scopes",
".",
"tail",
")",
"{",
"Scope",
"impScope",
"=",... | Finalize the content of the ImportScope to speed-up future lookups.
No further changes to class hierarchy or class content will be reflected. | [
"Finalize",
"the",
"content",
"of",
"the",
"ImportScope",
"to",
"speed",
"-",
"up",
"future",
"lookups",
".",
"No",
"further",
"changes",
"to",
"class",
"hierarchy",
"or",
"class",
"content",
"will",
"be",
"reflected",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Scope.java#L742-L768 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.getChar | private static char getChar(final String signature, int pos) {
"""
Returns the signature car at the given index.
@param signature
a signature.
@param pos
an index in signature.
@return the character at the given index, or 0 if there is no such
character.
"""
return pos < signature.length() ? si... | java | private static char getChar(final String signature, int pos) {
return pos < signature.length() ? signature.charAt(pos) : (char) 0;
} | [
"private",
"static",
"char",
"getChar",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"return",
"pos",
"<",
"signature",
".",
"length",
"(",
")",
"?",
"signature",
".",
"charAt",
"(",
"pos",
")",
":",
"(",
"char",
")",
"0",
";",
... | Returns the signature car at the given index.
@param signature
a signature.
@param pos
an index in signature.
@return the character at the given index, or 0 if there is no such
character. | [
"Returns",
"the",
"signature",
"car",
"at",
"the",
"given",
"index",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L1006-L1008 |
VoltDB/voltdb | src/frontend/org/voltdb/client/ClientConfig.java | ClientConfig.setTrustStoreConfigFromPropertyFile | public void setTrustStoreConfigFromPropertyFile(String propFN) {
"""
Configure trust store
@param propFN property file name containing trust store properties:
<ul>
<li>{@code trustStore} trust store file specification
<li>{@code trustStorePassword} trust store password
</ul>
"""
File propFD = ne... | java | public void setTrustStoreConfigFromPropertyFile(String propFN) {
File propFD = new File(propFN != null && !propFN.trim().isEmpty() ? propFN : "");
if (!propFD.exists() || !propFD.isFile() || !propFD.canRead()) {
throw new IllegalArgumentException("Properties file " + propFN + " is not a read... | [
"public",
"void",
"setTrustStoreConfigFromPropertyFile",
"(",
"String",
"propFN",
")",
"{",
"File",
"propFD",
"=",
"new",
"File",
"(",
"propFN",
"!=",
"null",
"&&",
"!",
"propFN",
".",
"trim",
"(",
")",
".",
"isEmpty",
"(",
")",
"?",
"propFN",
":",
"\"\"... | Configure trust store
@param propFN property file name containing trust store properties:
<ul>
<li>{@code trustStore} trust store file specification
<li>{@code trustStorePassword} trust store password
</ul> | [
"Configure",
"trust",
"store"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/client/ClientConfig.java#L484-L499 |
pressgang-ccms/PressGangCCMSBuilder | src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java | BuildDatabase.getAllSpecNodes | public List<SpecNode> getAllSpecNodes() {
"""
Get a List of all the SpecNodes in the Database.
@return A list of Level objects.
"""
final ArrayList<SpecNode> retValue = new ArrayList<SpecNode>();
// Add all the levels
retValue.addAll(levels);
// Add all the topics
f... | java | public List<SpecNode> getAllSpecNodes() {
final ArrayList<SpecNode> retValue = new ArrayList<SpecNode>();
// Add all the levels
retValue.addAll(levels);
// Add all the topics
for (final Entry<Integer, List<ITopicNode>> topicEntry : topics.entrySet()) {
for (final IT... | [
"public",
"List",
"<",
"SpecNode",
">",
"getAllSpecNodes",
"(",
")",
"{",
"final",
"ArrayList",
"<",
"SpecNode",
">",
"retValue",
"=",
"new",
"ArrayList",
"<",
"SpecNode",
">",
"(",
")",
";",
"// Add all the levels",
"retValue",
".",
"addAll",
"(",
"levels",... | Get a List of all the SpecNodes in the Database.
@return A list of Level objects. | [
"Get",
"a",
"List",
"of",
"all",
"the",
"SpecNodes",
"in",
"the",
"Database",
"."
] | train | https://github.com/pressgang-ccms/PressGangCCMSBuilder/blob/5436d36ba1b3c5baa246b270e5fc350e6778bce8/src/main/java/org/jboss/pressgang/ccms/contentspec/builder/structures/BuildDatabase.java#L186-L202 |
VoltDB/voltdb | src/frontend/org/voltdb/iv2/MpProcedureTask.java | MpProcedureTask.updateMasters | public void updateMasters(List<Long> masters, Map<Integer, Long> partitionMasters) {
"""
Update the list of partition masters in the event of a failure/promotion.
Currently only thread-"safe" by virtue of only calling this on
MpProcedureTasks which are not at the head of the MPI's TransactionTaskQueue.
"""
... | java | public void updateMasters(List<Long> masters, Map<Integer, Long> partitionMasters)
{
m_initiatorHSIds.clear();
m_initiatorHSIds.addAll(masters);
((MpTransactionState)getTransactionState()).updateMasters(masters, partitionMasters);
} | [
"public",
"void",
"updateMasters",
"(",
"List",
"<",
"Long",
">",
"masters",
",",
"Map",
"<",
"Integer",
",",
"Long",
">",
"partitionMasters",
")",
"{",
"m_initiatorHSIds",
".",
"clear",
"(",
")",
";",
"m_initiatorHSIds",
".",
"addAll",
"(",
"masters",
")"... | Update the list of partition masters in the event of a failure/promotion.
Currently only thread-"safe" by virtue of only calling this on
MpProcedureTasks which are not at the head of the MPI's TransactionTaskQueue. | [
"Update",
"the",
"list",
"of",
"partition",
"masters",
"in",
"the",
"event",
"of",
"a",
"failure",
"/",
"promotion",
".",
"Currently",
"only",
"thread",
"-",
"safe",
"by",
"virtue",
"of",
"only",
"calling",
"this",
"on",
"MpProcedureTasks",
"which",
"are",
... | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/iv2/MpProcedureTask.java#L85-L90 |
Whiley/WhileyCompiler | src/main/java/wyil/check/FlowTypeCheck.java | FlowTypeCheck.extractElementType | public SemanticType extractElementType(SemanticType.Array type, SyntacticItem item) {
"""
Extract the element type from an array. The array type can be null if some
earlier part of type checking generated an error message and we are just
continuing after that.
@param type
@param item
@return
"""
if (t... | java | public SemanticType extractElementType(SemanticType.Array type, SyntacticItem item) {
if (type == null) {
return null;
} else {
return type.getElement();
}
} | [
"public",
"SemanticType",
"extractElementType",
"(",
"SemanticType",
".",
"Array",
"type",
",",
"SyntacticItem",
"item",
")",
"{",
"if",
"(",
"type",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"else",
"{",
"return",
"type",
".",
"getElement",
"(",... | Extract the element type from an array. The array type can be null if some
earlier part of type checking generated an error message and we are just
continuing after that.
@param type
@param item
@return | [
"Extract",
"the",
"element",
"type",
"from",
"an",
"array",
".",
"The",
"array",
"type",
"can",
"be",
"null",
"if",
"some",
"earlier",
"part",
"of",
"type",
"checking",
"generated",
"an",
"error",
"message",
"and",
"we",
"are",
"just",
"continuing",
"after... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/check/FlowTypeCheck.java#L1896-L1902 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_voicemail_serviceName_directories_id_move_POST | public void billingAccount_voicemail_serviceName_directories_id_move_POST(String billingAccount, String serviceName, Long id, OvhVoicemailMessageFolderDirectoryEnum dir) throws IOException {
"""
Move the message to another directory
REST: POST /telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}... | java | public void billingAccount_voicemail_serviceName_directories_id_move_POST(String billingAccount, String serviceName, Long id, OvhVoicemailMessageFolderDirectoryEnum dir) throws IOException {
String qPath = "/telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}/move";
StringBuilder sb = path(qPath, bi... | [
"public",
"void",
"billingAccount_voicemail_serviceName_directories_id_move_POST",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
",",
"OvhVoicemailMessageFolderDirectoryEnum",
"dir",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"... | Move the message to another directory
REST: POST /telephony/{billingAccount}/voicemail/{serviceName}/directories/{id}/move
@param dir [required] Greeting voicemail directory
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Move",
"the",
"message",
"to",
"another",
"directory"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L7909-L7915 |
intendia-oss/rxjava-gwt | src/main/modified/io/reactivex/super/io/reactivex/Flowable.java | Flowable.onBackpressureBuffer | @CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> onBackpressureBuffer(int capacity, boolean delayError, boolean unbounded) {
"""
Instructs a Publisher that is emitting items faster than its Subscriber can consume them to ... | java | @CheckReturnValue
@BackpressureSupport(BackpressureKind.SPECIAL)
@SchedulerSupport(SchedulerSupport.NONE)
public final Flowable<T> onBackpressureBuffer(int capacity, boolean delayError, boolean unbounded) {
ObjectHelper.verifyPositive(capacity, "bufferSize");
return RxJavaPlugins.onAssembly(... | [
"@",
"CheckReturnValue",
"@",
"BackpressureSupport",
"(",
"BackpressureKind",
".",
"SPECIAL",
")",
"@",
"SchedulerSupport",
"(",
"SchedulerSupport",
".",
"NONE",
")",
"public",
"final",
"Flowable",
"<",
"T",
">",
"onBackpressureBuffer",
"(",
"int",
"capacity",
","... | Instructs a Publisher that is emitting items faster than its Subscriber can consume them to buffer up to
a given amount of items until they can be emitted. The resulting Publisher will signal
a {@code BufferOverflowException} via {@code onError} as soon as the buffer's capacity is exceeded, dropping all undelivered
ite... | [
"Instructs",
"a",
"Publisher",
"that",
"is",
"emitting",
"items",
"faster",
"than",
"its",
"Subscriber",
"can",
"consume",
"them",
"to",
"buffer",
"up",
"to",
"a",
"given",
"amount",
"of",
"items",
"until",
"they",
"can",
"be",
"emitted",
".",
"The",
"resu... | train | https://github.com/intendia-oss/rxjava-gwt/blob/8d5635b12ce40da99e76b59dc6bfe6fc2fffc1fa/src/main/modified/io/reactivex/super/io/reactivex/Flowable.java#L11461-L11467 |
JadiraOrg/jadira | cloning/src/main/java/org/jadira/reflection/cloning/implementor/AbstractCloneStrategy.java | AbstractCloneStrategy.performCloneForCloneableMethod | protected <T> T performCloneForCloneableMethod(T object, CloneDriver context) {
"""
Helper method for performing cloning for objects of classes implementing java.lang.Cloneable
@param object The object to be cloned.
@param context The CloneDriver to be used
@param <T> The type being copied
@return The cloned o... | java | protected <T> T performCloneForCloneableMethod(T object, CloneDriver context) {
Class<?> clazz = object.getClass();
final T result;
try {
MethodHandle handle = context.getCloneMethod(clazz);
result = (T) handle.invoke(object);
} catch (Throwable e) {
throw new IllegalStateException("Could not invoke ... | [
"protected",
"<",
"T",
">",
"T",
"performCloneForCloneableMethod",
"(",
"T",
"object",
",",
"CloneDriver",
"context",
")",
"{",
"Class",
"<",
"?",
">",
"clazz",
"=",
"object",
".",
"getClass",
"(",
")",
";",
"final",
"T",
"result",
";",
"try",
"{",
"Me... | Helper method for performing cloning for objects of classes implementing java.lang.Cloneable
@param object The object to be cloned.
@param context The CloneDriver to be used
@param <T> The type being copied
@return The cloned object | [
"Helper",
"method",
"for",
"performing",
"cloning",
"for",
"objects",
"of",
"classes",
"implementing",
"java",
".",
"lang",
".",
"Cloneable"
] | train | https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/cloning/src/main/java/org/jadira/reflection/cloning/implementor/AbstractCloneStrategy.java#L271-L283 |
kiegroup/drools | drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSource.java | LeftTupleSource.addTupleSink | public void addTupleSink(final LeftTupleSink tupleSink, final BuildContext context) {
"""
Adds the <code>TupleSink</code> so that it may receive
<code>Tuples</code> propagated from this <code>TupleSource</code>.
@param tupleSink
The <code>TupleSink</code> to receive propagated
<code>Tuples</code>.
"""
... | java | public void addTupleSink(final LeftTupleSink tupleSink, final BuildContext context) {
this.sink = addTupleSink(this.sink, tupleSink, context);
} | [
"public",
"void",
"addTupleSink",
"(",
"final",
"LeftTupleSink",
"tupleSink",
",",
"final",
"BuildContext",
"context",
")",
"{",
"this",
".",
"sink",
"=",
"addTupleSink",
"(",
"this",
".",
"sink",
",",
"tupleSink",
",",
"context",
")",
";",
"}"
] | Adds the <code>TupleSink</code> so that it may receive
<code>Tuples</code> propagated from this <code>TupleSource</code>.
@param tupleSink
The <code>TupleSink</code> to receive propagated
<code>Tuples</code>. | [
"Adds",
"the",
"<code",
">",
"TupleSink<",
"/",
"code",
">",
"so",
"that",
"it",
"may",
"receive",
"<code",
">",
"Tuples<",
"/",
"code",
">",
"propagated",
"from",
"this",
"<code",
">",
"TupleSource<",
"/",
"code",
">",
"."
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSource.java#L146-L148 |
UrielCh/ovh-java-sdk | ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java | ApiOvhPrice.xdsl_offers_offersName_GET | public OvhPrice xdsl_offers_offersName_GET(net.minidev.ovh.api.price.xdsl.OvhOffersEnum offersName) throws IOException {
"""
Get the price of xdsl offers
REST: GET /price/xdsl/offers/{offersName}
@param offersName [required] The name of the offer
"""
String qPath = "/price/xdsl/offers/{offersName}";
St... | java | public OvhPrice xdsl_offers_offersName_GET(net.minidev.ovh.api.price.xdsl.OvhOffersEnum offersName) throws IOException {
String qPath = "/price/xdsl/offers/{offersName}";
StringBuilder sb = path(qPath, offersName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhPrice.class);
} | [
"public",
"OvhPrice",
"xdsl_offers_offersName_GET",
"(",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"price",
".",
"xdsl",
".",
"OvhOffersEnum",
"offersName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/price/xdsl/offers/{offersName}\"",
... | Get the price of xdsl offers
REST: GET /price/xdsl/offers/{offersName}
@param offersName [required] The name of the offer | [
"Get",
"the",
"price",
"of",
"xdsl",
"offers"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-price/src/main/java/net/minidev/ovh/api/ApiOvhPrice.java#L24-L29 |
windup/windup | decompiler/api/src/main/java/org/jboss/windup/decompiler/decompiler/AbstractDecompiler.java | AbstractDecompiler.decompileArchive | @Override
public DecompilationResult decompileArchive(Path archive, Path outputDir, DecompilationListener listener) throws DecompilationException {
"""
Decompiles all .class files and nested archives in the given archive.
<p>
Nested archives will be decompiled into directories matching the name of the archiv... | java | @Override
public DecompilationResult decompileArchive(Path archive, Path outputDir, DecompilationListener listener) throws DecompilationException
{
return decompileArchive(archive, outputDir, null, listener);
} | [
"@",
"Override",
"public",
"DecompilationResult",
"decompileArchive",
"(",
"Path",
"archive",
",",
"Path",
"outputDir",
",",
"DecompilationListener",
"listener",
")",
"throws",
"DecompilationException",
"{",
"return",
"decompileArchive",
"(",
"archive",
",",
"outputDir"... | Decompiles all .class files and nested archives in the given archive.
<p>
Nested archives will be decompiled into directories matching the name of the archive, e.g.
<code>foo.ear/bar.jar/src/com/foo/bar/Baz.java</code>.
<p>
Required directories will be created as needed.
@param archive The archive containing source fi... | [
"Decompiles",
"all",
".",
"class",
"files",
"and",
"nested",
"archives",
"in",
"the",
"given",
"archive",
".",
"<p",
">",
"Nested",
"archives",
"will",
"be",
"decompiled",
"into",
"directories",
"matching",
"the",
"name",
"of",
"the",
"archive",
"e",
".",
... | train | https://github.com/windup/windup/blob/6668f09e7f012d24a0b4212ada8809417225b2ad/decompiler/api/src/main/java/org/jboss/windup/decompiler/decompiler/AbstractDecompiler.java#L149-L153 |
artikcloud/artikcloud-java | src/main/java/cloud/artik/api/DevicesManagementApi.java | DevicesManagementApi.createTasksAsync | public com.squareup.okhttp.Call createTasksAsync(TaskRequest taskPayload, final ApiCallback<TaskEnvelope> callback) throws ApiException {
"""
Create a new task for one or more devices (asynchronously)
Create a new task for one or more devices
@param taskPayload Task object to be created (required)
@param callba... | java | public com.squareup.okhttp.Call createTasksAsync(TaskRequest taskPayload, final ApiCallback<TaskEnvelope> callback) throws ApiException {
ProgressResponseBody.ProgressListener progressListener = null;
ProgressRequestBody.ProgressRequestListener progressRequestListener = null;
if (callback != n... | [
"public",
"com",
".",
"squareup",
".",
"okhttp",
".",
"Call",
"createTasksAsync",
"(",
"TaskRequest",
"taskPayload",
",",
"final",
"ApiCallback",
"<",
"TaskEnvelope",
">",
"callback",
")",
"throws",
"ApiException",
"{",
"ProgressResponseBody",
".",
"ProgressListener... | Create a new task for one or more devices (asynchronously)
Create a new task for one or more devices
@param taskPayload Task object to be created (required)
@param callback The callback to be executed when the API call finishes
@return The request call
@throws ApiException If fail to process the API call, e.g. serializ... | [
"Create",
"a",
"new",
"task",
"for",
"one",
"or",
"more",
"devices",
"(",
"asynchronously",
")",
"Create",
"a",
"new",
"task",
"for",
"one",
"or",
"more",
"devices"
] | train | https://github.com/artikcloud/artikcloud-java/blob/412f447573e7796ab4f685c0bdd5eb76185a365c/src/main/java/cloud/artik/api/DevicesManagementApi.java#L163-L188 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java | CoordinatesUtils.contains3D | public static boolean contains3D(Coordinate[] coords, Coordinate coord) {
"""
Check if a coordinate array contains a specific coordinate.
The equality is done in 3D (z values ARE checked).
@param coords
@param coord
@return
"""
for (Coordinate coordinate : coords) {
... | java | public static boolean contains3D(Coordinate[] coords, Coordinate coord) {
for (Coordinate coordinate : coords) {
if (coordinate.equals3D(coord)) {
return true;
}
}
return false;
} | [
"public",
"static",
"boolean",
"contains3D",
"(",
"Coordinate",
"[",
"]",
"coords",
",",
"Coordinate",
"coord",
")",
"{",
"for",
"(",
"Coordinate",
"coordinate",
":",
"coords",
")",
"{",
"if",
"(",
"coordinate",
".",
"equals3D",
"(",
"coord",
")",
")",
"... | Check if a coordinate array contains a specific coordinate.
The equality is done in 3D (z values ARE checked).
@param coords
@param coord
@return | [
"Check",
"if",
"a",
"coordinate",
"array",
"contains",
"a",
"specific",
"coordinate",
"."
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/io/utility/CoordinatesUtils.java#L89-L96 |
xwiki/xwiki-commons | xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java | BcStoreUtils.getCertificateProvider | public static CertificateProvider getCertificateProvider(ComponentManager manager, Store store,
CertificateProvider certificateProvider) throws GeneralSecurityException {
"""
Get a certificate provider for a given store and an additional certificate provider.
@param manager the component manager.
@para... | java | public static CertificateProvider getCertificateProvider(ComponentManager manager, Store store,
CertificateProvider certificateProvider) throws GeneralSecurityException
{
CertificateProvider provider = newCertificateProvider(manager, store);
if (certificateProvider == null) {
re... | [
"public",
"static",
"CertificateProvider",
"getCertificateProvider",
"(",
"ComponentManager",
"manager",
",",
"Store",
"store",
",",
"CertificateProvider",
"certificateProvider",
")",
"throws",
"GeneralSecurityException",
"{",
"CertificateProvider",
"provider",
"=",
"newCerti... | Get a certificate provider for a given store and an additional certificate provider.
@param manager the component manager.
@param store the store to wrap.
@param certificateProvider provider of additional certificate to proceed to the verification.
@return a certificate provider wrapping the store.
@throws GeneralSecu... | [
"Get",
"a",
"certificate",
"provider",
"for",
"a",
"given",
"store",
"and",
"an",
"additional",
"certificate",
"provider",
"."
] | train | https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-core/xwiki-commons-crypto/xwiki-commons-crypto-pkix/src/main/java/org/xwiki/crypto/signer/internal/cms/BcStoreUtils.java#L67-L77 |
actorapp/actor-platform | actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java | Messenger.bindRawUploadFile | @ObjectiveCName("bindRawUploadFileWithRid:withCallback:")
public void bindRawUploadFile(long rid, UploadFileCallback callback) {
"""
Raw Bind Upload File
@param rid randomId of uploading file
@param callback file state callback
"""
modules.getFilesModule().bindUploadFile(rid, callback);
... | java | @ObjectiveCName("bindRawUploadFileWithRid:withCallback:")
public void bindRawUploadFile(long rid, UploadFileCallback callback) {
modules.getFilesModule().bindUploadFile(rid, callback);
} | [
"@",
"ObjectiveCName",
"(",
"\"bindRawUploadFileWithRid:withCallback:\"",
")",
"public",
"void",
"bindRawUploadFile",
"(",
"long",
"rid",
",",
"UploadFileCallback",
"callback",
")",
"{",
"modules",
".",
"getFilesModule",
"(",
")",
".",
"bindUploadFile",
"(",
"rid",
... | Raw Bind Upload File
@param rid randomId of uploading file
@param callback file state callback | [
"Raw",
"Bind",
"Upload",
"File"
] | train | https://github.com/actorapp/actor-platform/blob/5123c1584757c6eeea0ed2a0e7e043629871a0c6/actor-sdk/sdk-core/core/core-shared/src/main/java/im/actor/core/Messenger.java#L1953-L1956 |
liferay/com-liferay-commerce | commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java | CommercePaymentMethodGroupRelPersistenceImpl.fetchByG_E | @Override
public CommercePaymentMethodGroupRel fetchByG_E(long groupId,
String engineKey) {
"""
Returns the commerce payment method group rel where groupId = ? and engineKey = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param engineKey... | java | @Override
public CommercePaymentMethodGroupRel fetchByG_E(long groupId,
String engineKey) {
return fetchByG_E(groupId, engineKey, true);
} | [
"@",
"Override",
"public",
"CommercePaymentMethodGroupRel",
"fetchByG_E",
"(",
"long",
"groupId",
",",
"String",
"engineKey",
")",
"{",
"return",
"fetchByG_E",
"(",
"groupId",
",",
"engineKey",
",",
"true",
")",
";",
"}"
] | Returns the commerce payment method group rel where groupId = ? and engineKey = ? or returns <code>null</code> if it could not be found. Uses the finder cache.
@param groupId the group ID
@param engineKey the engine key
@return the matching commerce payment method group rel, or <code>null</code> if a matching ... | [
"Returns",
"the",
"commerce",
"payment",
"method",
"group",
"rel",
"where",
"groupId",
"=",
"?",
";",
"and",
"engineKey",
"=",
"?",
";",
"or",
"returns",
"<code",
">",
"null<",
"/",
"code",
">",
"if",
"it",
"could",
"not",
"be",
"found",
".",
"Us... | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-payment-service/src/main/java/com/liferay/commerce/payment/service/persistence/impl/CommercePaymentMethodGroupRelPersistenceImpl.java#L670-L674 |
auth0/auth0-java | src/main/java/com/auth0/client/auth/AuthAPI.java | AuthAPI.renewAuth | public AuthRequest renewAuth(String refreshToken) {
"""
Creates a request to renew the authentication and get fresh new credentials using a valid Refresh Token and the 'refresh_token' grant.
<pre>
{@code
AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfk... | java | public AuthRequest renewAuth(String refreshToken) {
Asserts.assertNotNull(refreshToken, "refresh token");
String url = baseUrl
.newBuilder()
.addPathSegment(PATH_OAUTH)
.addPathSegment(PATH_TOKEN)
.build()
.toString();
... | [
"public",
"AuthRequest",
"renewAuth",
"(",
"String",
"refreshToken",
")",
"{",
"Asserts",
".",
"assertNotNull",
"(",
"refreshToken",
",",
"\"refresh token\"",
")",
";",
"String",
"url",
"=",
"baseUrl",
".",
"newBuilder",
"(",
")",
".",
"addPathSegment",
"(",
"... | Creates a request to renew the authentication and get fresh new credentials using a valid Refresh Token and the 'refresh_token' grant.
<pre>
{@code
AuthAPI auth = new AuthAPI("me.auth0.com", "B3c6RYhk1v9SbIJcRIOwu62gIUGsnze", "2679NfkaBn62e6w5E8zNEzjr-yWfkaBne");
try {
TokenHolder result = auth.renewAuth("ej2E8zNEzjrcS... | [
"Creates",
"a",
"request",
"to",
"renew",
"the",
"authentication",
"and",
"get",
"fresh",
"new",
"credentials",
"using",
"a",
"valid",
"Refresh",
"Token",
"and",
"the",
"refresh_token",
"grant",
".",
"<pre",
">",
"{",
"@code",
"AuthAPI",
"auth",
"=",
"new",
... | train | https://github.com/auth0/auth0-java/blob/b7bc099ee9c6cde5a87c4ecfebc6d811aeb1027c/src/main/java/com/auth0/client/auth/AuthAPI.java#L472-L487 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/AnimationConfig.java | AnimationConfig.createAnimation | public static Animation createAnimation(XmlReader node) {
"""
Create animation data from node.
@param node The animation node (must not be <code>null</code>).
@return The animation instance.
@throws LionEngineException If error when reading animation data.
"""
Check.notNull(node);
fina... | java | public static Animation createAnimation(XmlReader node)
{
Check.notNull(node);
final String name = node.readString(ANIMATION_NAME);
final int start = node.readInteger(ANIMATION_START);
final int end = node.readInteger(ANIMATION_END);
final double speed = node.readDoub... | [
"public",
"static",
"Animation",
"createAnimation",
"(",
"XmlReader",
"node",
")",
"{",
"Check",
".",
"notNull",
"(",
"node",
")",
";",
"final",
"String",
"name",
"=",
"node",
".",
"readString",
"(",
"ANIMATION_NAME",
")",
";",
"final",
"int",
"start",
"="... | Create animation data from node.
@param node The animation node (must not be <code>null</code>).
@return The animation instance.
@throws LionEngineException If error when reading animation data. | [
"Create",
"animation",
"data",
"from",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/AnimationConfig.java#L103-L115 |
cojen/Cojen | src/main/java/org/cojen/util/QuickConstructorGenerator.java | QuickConstructorGenerator.getInstance | @SuppressWarnings("unchecked")
public static synchronized <F> F getInstance(final Class<?> objectType,
final Class<F> factory) {
"""
Returns a factory instance for one type of object. Each method in the
interface defines a constructor via its parameters. Any ch... | java | @SuppressWarnings("unchecked")
public static synchronized <F> F getInstance(final Class<?> objectType,
final Class<F> factory)
{
Cache<Class<?>, Object> innerCache = cCache.get(factory);
if (innerCache == null) {
innerCache = new SoftV... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"static",
"synchronized",
"<",
"F",
">",
"F",
"getInstance",
"(",
"final",
"Class",
"<",
"?",
">",
"objectType",
",",
"final",
"Class",
"<",
"F",
">",
"factory",
")",
"{",
"Cache",
"<",
"Class... | Returns a factory instance for one type of object. Each method in the
interface defines a constructor via its parameters. Any checked
exceptions declared thrown by the constructor must also be declared by
the method. The method return types can be the same type as the
constructed object or a supertype.
<p>Here is a co... | [
"Returns",
"a",
"factory",
"instance",
"for",
"one",
"type",
"of",
"object",
".",
"Each",
"method",
"in",
"the",
"interface",
"defines",
"a",
"constructor",
"via",
"its",
"parameters",
".",
"Any",
"checked",
"exceptions",
"declared",
"thrown",
"by",
"the",
"... | train | https://github.com/cojen/Cojen/blob/ddee9a0fde83870b97e0ed04c58270aa665f3a62/src/main/java/org/cojen/util/QuickConstructorGenerator.java#L104-L134 |
hsiafan/requests | src/main/java/net/dongliu/requests/utils/Cookies.java | Cookies.isDomainSuffix | public static boolean isDomainSuffix(String domain, String domainSuffix) {
"""
If domainSuffix is suffix of domain
@param domain start with "."
@param domainSuffix not start with "."
"""
if (domain.length() < domainSuffix.length()) {
return false;
}
if (domain.leng... | java | public static boolean isDomainSuffix(String domain, String domainSuffix) {
if (domain.length() < domainSuffix.length()) {
return false;
}
if (domain.length() == domainSuffix.length()) {
return domain.equals(domainSuffix);
}
return domain.endsWith(domainSu... | [
"public",
"static",
"boolean",
"isDomainSuffix",
"(",
"String",
"domain",
",",
"String",
"domainSuffix",
")",
"{",
"if",
"(",
"domain",
".",
"length",
"(",
")",
"<",
"domainSuffix",
".",
"length",
"(",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
... | If domainSuffix is suffix of domain
@param domain start with "."
@param domainSuffix not start with "." | [
"If",
"domainSuffix",
"is",
"suffix",
"of",
"domain"
] | train | https://github.com/hsiafan/requests/blob/a6cc6f8293e808cc937d3789aec2616a8383dee0/src/main/java/net/dongliu/requests/utils/Cookies.java#L95-L104 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONSerializer.java | JSONSerializer.toJSON | private static JSON toJSON( JSONString string, JsonConfig jsonConfig ) {
"""
Creates a JSONObject, JSONArray or a JSONNull from a JSONString.
@throws JSONException if the string is not a valid JSON string
"""
return toJSON( string.toJSONString(), jsonConfig );
} | java | private static JSON toJSON( JSONString string, JsonConfig jsonConfig ) {
return toJSON( string.toJSONString(), jsonConfig );
} | [
"private",
"static",
"JSON",
"toJSON",
"(",
"JSONString",
"string",
",",
"JsonConfig",
"jsonConfig",
")",
"{",
"return",
"toJSON",
"(",
"string",
".",
"toJSONString",
"(",
")",
",",
"jsonConfig",
")",
";",
"}"
] | Creates a JSONObject, JSONArray or a JSONNull from a JSONString.
@throws JSONException if the string is not a valid JSON string | [
"Creates",
"a",
"JSONObject",
"JSONArray",
"or",
"a",
"JSONNull",
"from",
"a",
"JSONString",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONSerializer.java#L125-L127 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.trimStartAndEnd | @Nullable
@CheckReturnValue
public static String trimStartAndEnd (@Nullable final String sSrc, final char cLead, final char cTail) {
"""
Trim the passed lead and tail from the source value. If the source value does
not start with the passed lead and does not end with the passed tail, nothing
happens.
@par... | java | @Nullable
@CheckReturnValue
public static String trimStartAndEnd (@Nullable final String sSrc, final char cLead, final char cTail)
{
final String sInbetween = trimStart (sSrc, cLead);
return trimEnd (sInbetween, cTail);
} | [
"@",
"Nullable",
"@",
"CheckReturnValue",
"public",
"static",
"String",
"trimStartAndEnd",
"(",
"@",
"Nullable",
"final",
"String",
"sSrc",
",",
"final",
"char",
"cLead",
",",
"final",
"char",
"cTail",
")",
"{",
"final",
"String",
"sInbetween",
"=",
"trimStart... | Trim the passed lead and tail from the source value. If the source value does
not start with the passed lead and does not end with the passed tail, nothing
happens.
@param sSrc
The input source string
@param cLead
The char to be trimmed of the beginning
@param cTail
The char to be trimmed of the end
@return The trimme... | [
"Trim",
"the",
"passed",
"lead",
"and",
"tail",
"from",
"the",
"source",
"value",
".",
"If",
"the",
"source",
"value",
"does",
"not",
"start",
"with",
"the",
"passed",
"lead",
"and",
"does",
"not",
"end",
"with",
"the",
"passed",
"tail",
"nothing",
"happ... | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L3540-L3546 |
apache/incubator-heron | heron/spi/src/java/org/apache/heron/spi/common/TokenSub.java | TokenSub.substituteURL | private static String substituteURL(Config config, String pathString) {
"""
Given a static config map, substitute occurrences of ${HERON_*} variables
in the provided URL
@param config a static map config object of key value pairs
@param pathString string representing a path including ${HERON_*} variables
@re... | java | private static String substituteURL(Config config, String pathString) {
Matcher m = URL_PATTERN.matcher(pathString);
if (m.matches()) {
return String.format("%s://%s", m.group(1), substitute(config, m.group(2)));
}
return pathString;
} | [
"private",
"static",
"String",
"substituteURL",
"(",
"Config",
"config",
",",
"String",
"pathString",
")",
"{",
"Matcher",
"m",
"=",
"URL_PATTERN",
".",
"matcher",
"(",
"pathString",
")",
";",
"if",
"(",
"m",
".",
"matches",
"(",
")",
")",
"{",
"return",... | Given a static config map, substitute occurrences of ${HERON_*} variables
in the provided URL
@param config a static map config object of key value pairs
@param pathString string representing a path including ${HERON_*} variables
@return String string that represents the modified path | [
"Given",
"a",
"static",
"config",
"map",
"substitute",
"occurrences",
"of",
"$",
"{",
"HERON_",
"*",
"}",
"variables",
"in",
"the",
"provided",
"URL"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/heron/spi/src/java/org/apache/heron/spi/common/TokenSub.java#L128-L134 |
javalite/activejdbc | activejdbc/src/main/java/org/javalite/activejdbc/Model.java | Model.beforeClosingTag | public void beforeClosingTag(StringBuilder sb, boolean pretty, String indent, String... attributeNames) {
"""
Override in a subclass to inject custom content onto XML just before the closing tag.
<p>To keep the formatting, it is recommended to implement this method as the example below.
<blockquote><pre>
if... | java | public void beforeClosingTag(StringBuilder sb, boolean pretty, String indent, String... attributeNames) {
StringWriter writer = new StringWriter();
beforeClosingTag(indent.length(), writer, attributeNames);
sb.append(writer.toString());
} | [
"public",
"void",
"beforeClosingTag",
"(",
"StringBuilder",
"sb",
",",
"boolean",
"pretty",
",",
"String",
"indent",
",",
"String",
"...",
"attributeNames",
")",
"{",
"StringWriter",
"writer",
"=",
"new",
"StringWriter",
"(",
")",
";",
"beforeClosingTag",
"(",
... | Override in a subclass to inject custom content onto XML just before the closing tag.
<p>To keep the formatting, it is recommended to implement this method as the example below.
<blockquote><pre>
if (pretty) { sb.append(ident); }
sb.append("<test>...</test>");
if (pretty) { sb.append('\n'); }
</pre></bloc... | [
"Override",
"in",
"a",
"subclass",
"to",
"inject",
"custom",
"content",
"onto",
"XML",
"just",
"before",
"the",
"closing",
"tag",
"."
] | train | https://github.com/javalite/activejdbc/blob/ffcf5457cace19622a8f71e856cbbbe9e7dd5fcc/activejdbc/src/main/java/org/javalite/activejdbc/Model.java#L1042-L1046 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_reach.java | DZcs_reach.cs_reach | public static int cs_reach(DZcs G, DZcs B, int k, int[] xi, int[] pinv) {
"""
Finds a nonzero pattern of x=L\b for sparse L and b.
@param G
graph to search (G.p modified, then restored)
@param B
right hand side, b = B(:,k)
@param k
use kth column of B
@param xi
size 2*n, output in xi[top..n-1]
@param pi... | java | public static int cs_reach(DZcs G, DZcs B, int k, int[] xi, int[] pinv)
{
int p, n, top, Bp[], Bi[], Gp[] ;
if (!CS_CSC (G) || !CS_CSC (B) || xi == null)
return (-1) ; /* check inputs */
n = G.n ; Bp = B.p ; Bi = B.i ; Gp = G.p ;
top = n ;
for (p = Bp [k] ; p < Bp [k+1] ; p++)
{
if (!CS_MARK... | [
"public",
"static",
"int",
"cs_reach",
"(",
"DZcs",
"G",
",",
"DZcs",
"B",
",",
"int",
"k",
",",
"int",
"[",
"]",
"xi",
",",
"int",
"[",
"]",
"pinv",
")",
"{",
"int",
"p",
",",
"n",
",",
"top",
",",
"Bp",
"[",
"]",
",",
"Bi",
"[",
"]",
",... | Finds a nonzero pattern of x=L\b for sparse L and b.
@param G
graph to search (G.p modified, then restored)
@param B
right hand side, b = B(:,k)
@param k
use kth column of B
@param xi
size 2*n, output in xi[top..n-1]
@param pinv
mapping of rows to columns of G, ignored if null
@return top, -1 on error | [
"Finds",
"a",
"nonzero",
"pattern",
"of",
"x",
"=",
"L",
"\\",
"b",
"for",
"sparse",
"L",
"and",
"b",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tdcomplex/DZcs_reach.java#L59-L75 |
OpenTSDB/opentsdb | src/meta/TSMeta.java | TSMeta.parseFromColumn | public static Deferred<TSMeta> parseFromColumn(final TSDB tsdb,
final KeyValue column, final boolean load_uidmetas) {
"""
Parses a TSMeta object from the given column, optionally loading the
UIDMeta objects
@param tsdb The TSDB to use for storage access
@param column The KeyValue column to parse
@param ... | java | public static Deferred<TSMeta> parseFromColumn(final TSDB tsdb,
final KeyValue column, final boolean load_uidmetas) {
if (column.value() == null || column.value().length < 1) {
throw new IllegalArgumentException("Empty column value");
}
final TSMeta parsed_meta = JSON.parseToObject(column.valu... | [
"public",
"static",
"Deferred",
"<",
"TSMeta",
">",
"parseFromColumn",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"KeyValue",
"column",
",",
"final",
"boolean",
"load_uidmetas",
")",
"{",
"if",
"(",
"column",
".",
"value",
"(",
")",
"==",
"null",
"||",
... | Parses a TSMeta object from the given column, optionally loading the
UIDMeta objects
@param tsdb The TSDB to use for storage access
@param column The KeyValue column to parse
@param load_uidmetas Whether or not UIDmeta objects should be loaded
@return A TSMeta if parsed successfully
@throws NoSuchUniqueName if one of t... | [
"Parses",
"a",
"TSMeta",
"object",
"from",
"the",
"given",
"column",
"optionally",
"loading",
"the",
"UIDMeta",
"objects"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/TSMeta.java#L404-L424 |
UrielCh/ovh-java-sdk | ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhCore.java | ApiOvhCore.setLoginInfo | public void setLoginInfo(String nic, String password, int timeInSec) {
"""
Store password based credential for an automatic certificate generation
@param nic
@param password
@param timeInSec
"""
nic = nic.toLowerCase();
this.nic = nic;
this.password = password;
this.timeInSec = timeInSec;
} | java | public void setLoginInfo(String nic, String password, int timeInSec) {
nic = nic.toLowerCase();
this.nic = nic;
this.password = password;
this.timeInSec = timeInSec;
} | [
"public",
"void",
"setLoginInfo",
"(",
"String",
"nic",
",",
"String",
"password",
",",
"int",
"timeInSec",
")",
"{",
"nic",
"=",
"nic",
".",
"toLowerCase",
"(",
")",
";",
"this",
".",
"nic",
"=",
"nic",
";",
"this",
".",
"password",
"=",
"password",
... | Store password based credential for an automatic certificate generation
@param nic
@param password
@param timeInSec | [
"Store",
"password",
"based",
"credential",
"for",
"an",
"automatic",
"certificate",
"generation"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/core/ApiOvhCore.java#L334-L339 |
nmorel/gwt-jackson | gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java | AbstractCreator.methodCallCodeWithJMapperTypeParameters | private CodeBlock methodCallCodeWithJMapperTypeParameters( MapperInstance instance, ImmutableList<? extends JMapperType> parameters ) {
"""
Build the code to create a mapper.
@param instance the class to call
@param parameters the parameters of the method
@return the code to create the mapper
"""
... | java | private CodeBlock methodCallCodeWithJMapperTypeParameters( MapperInstance instance, ImmutableList<? extends JMapperType> parameters ) {
CodeBlock.Builder builder = initMethodCallCode( instance );
return methodCallCodeWithJMapperTypeParameters( builder, parameters );
} | [
"private",
"CodeBlock",
"methodCallCodeWithJMapperTypeParameters",
"(",
"MapperInstance",
"instance",
",",
"ImmutableList",
"<",
"?",
"extends",
"JMapperType",
">",
"parameters",
")",
"{",
"CodeBlock",
".",
"Builder",
"builder",
"=",
"initMethodCallCode",
"(",
"instance... | Build the code to create a mapper.
@param instance the class to call
@param parameters the parameters of the method
@return the code to create the mapper | [
"Build",
"the",
"code",
"to",
"create",
"a",
"mapper",
"."
] | train | https://github.com/nmorel/gwt-jackson/blob/3fdc4350a27a9b64fc437d5fe516bf9191b74824/gwt-jackson/src/main/java/com/github/nmorel/gwtjackson/rebind/AbstractCreator.java#L917-L920 |
cdk/cdk | storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java | MDLV2000Writer.formatMDLString | protected static String formatMDLString(String s, int le) {
"""
Formats a String to fit into the connectiontable.
@param s The String to be formated
@param le The length of the String
@return The String to be written in the connectiontable
"""
s = s.trim();
if (s.length() > le) return s.s... | java | protected static String formatMDLString(String s, int le) {
s = s.trim();
if (s.length() > le) return s.substring(0, le);
int l;
l = le - s.length();
for (int f = 0; f < l; f++)
s += " ";
return s;
} | [
"protected",
"static",
"String",
"formatMDLString",
"(",
"String",
"s",
",",
"int",
"le",
")",
"{",
"s",
"=",
"s",
".",
"trim",
"(",
")",
";",
"if",
"(",
"s",
".",
"length",
"(",
")",
">",
"le",
")",
"return",
"s",
".",
"substring",
"(",
"0",
"... | Formats a String to fit into the connectiontable.
@param s The String to be formated
@param le The length of the String
@return The String to be written in the connectiontable | [
"Formats",
"a",
"String",
"to",
"fit",
"into",
"the",
"connectiontable",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/storage/ctab/src/main/java/org/openscience/cdk/io/MDLV2000Writer.java#L1158-L1166 |
Red5/red5-io | src/main/java/org/red5/io/utils/IOUtils.java | IOUtils.writeExtendedMediumInt | public final static void writeExtendedMediumInt(IoBuffer out, int value) {
"""
Writes extended medium integer (equivalent to a regular integer whose most significant byte has been moved to its end, past its least significant byte)
@param out
Output buffer
@param value
Integer to write
"""
value =... | java | public final static void writeExtendedMediumInt(IoBuffer out, int value) {
value = ((value & 0xff000000) >> 24) | (value << 8);
out.putInt(value);
} | [
"public",
"final",
"static",
"void",
"writeExtendedMediumInt",
"(",
"IoBuffer",
"out",
",",
"int",
"value",
")",
"{",
"value",
"=",
"(",
"(",
"value",
"&",
"0xff000000",
")",
">>",
"24",
")",
"|",
"(",
"value",
"<<",
"8",
")",
";",
"out",
".",
"putIn... | Writes extended medium integer (equivalent to a regular integer whose most significant byte has been moved to its end, past its least significant byte)
@param out
Output buffer
@param value
Integer to write | [
"Writes",
"extended",
"medium",
"integer",
"(",
"equivalent",
"to",
"a",
"regular",
"integer",
"whose",
"most",
"significant",
"byte",
"has",
"been",
"moved",
"to",
"its",
"end",
"past",
"its",
"least",
"significant",
"byte",
")"
] | train | https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/utils/IOUtils.java#L89-L92 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java | ComputerVisionImpl.describeImageInStream | public ImageDescription describeImageInStream(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter) {
"""
This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which ar... | java | public ImageDescription describeImageInStream(byte[] image, DescribeImageInStreamOptionalParameter describeImageInStreamOptionalParameter) {
return describeImageInStreamWithServiceResponseAsync(image, describeImageInStreamOptionalParameter).toBlocking().single().body();
} | [
"public",
"ImageDescription",
"describeImageInStream",
"(",
"byte",
"[",
"]",
"image",
",",
"DescribeImageInStreamOptionalParameter",
"describeImageInStreamOptionalParameter",
")",
"{",
"return",
"describeImageInStreamWithServiceResponseAsync",
"(",
"image",
",",
"describeImageIn... | This operation generates a description of an image in human readable language with complete sentences. The description is based on a collection of content tags, which are also returned by the operation. More than one description can be generated for each image. Descriptions are ordered by their confidence score. All ... | [
"This",
"operation",
"generates",
"a",
"description",
"of",
"an",
"image",
"in",
"human",
"readable",
"language",
"with",
"complete",
"sentences",
".",
"The",
"description",
"is",
"based",
"on",
"a",
"collection",
"of",
"content",
"tags",
"which",
"are",
"also... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L578-L580 |
looly/hutool | hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java | BeetlUtil.getClassPathTemplate | public static Template getClassPathTemplate(String path, String templateFileName) {
"""
获得ClassPath模板
@param path ClassPath路径
@param templateFileName 模板内容
@return 模板
@since 3.2.0
"""
return getTemplate(createClassPathGroupTemplate(path), templateFileName);
} | java | public static Template getClassPathTemplate(String path, String templateFileName) {
return getTemplate(createClassPathGroupTemplate(path), templateFileName);
} | [
"public",
"static",
"Template",
"getClassPathTemplate",
"(",
"String",
"path",
",",
"String",
"templateFileName",
")",
"{",
"return",
"getTemplate",
"(",
"createClassPathGroupTemplate",
"(",
"path",
")",
",",
"templateFileName",
")",
";",
"}"
] | 获得ClassPath模板
@param path ClassPath路径
@param templateFileName 模板内容
@return 模板
@since 3.2.0 | [
"获得ClassPath模板"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-extra/src/main/java/cn/hutool/extra/template/engine/beetl/BeetlUtil.java#L157-L159 |
rwl/CSparseJ | src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_gaxpy.java | Scs_gaxpy.cs_gaxpy | public static boolean cs_gaxpy(Scs A, float[] x, float[] y) {
"""
Sparse matrix times dense column vector, y = A*x+y.
@param A
column-compressed matrix
@param x
size n, vector x
@param y
size m, vector y
@return true if successful, false on error
"""
int p, j, n, Ap[], Ai[];
float Ax... | java | public static boolean cs_gaxpy(Scs A, float[] x, float[] y) {
int p, j, n, Ap[], Ai[];
float Ax[];
if (!Scs_util.CS_CSC(A) || x == null || y == null)
return (false); /* check inputs */
n = A.n;
Ap = A.p;
Ai = A.i;
Ax = A.x;
for (j = 0;... | [
"public",
"static",
"boolean",
"cs_gaxpy",
"(",
"Scs",
"A",
",",
"float",
"[",
"]",
"x",
",",
"float",
"[",
"]",
"y",
")",
"{",
"int",
"p",
",",
"j",
",",
"n",
",",
"Ap",
"[",
"]",
",",
"Ai",
"[",
"]",
";",
"float",
"Ax",
"[",
"]",
";",
"... | Sparse matrix times dense column vector, y = A*x+y.
@param A
column-compressed matrix
@param x
size n, vector x
@param y
size m, vector y
@return true if successful, false on error | [
"Sparse",
"matrix",
"times",
"dense",
"column",
"vector",
"y",
"=",
"A",
"*",
"x",
"+",
"y",
"."
] | train | https://github.com/rwl/CSparseJ/blob/6a6f66bccce1558156a961494358952603b0ac84/src/main/java/edu/emory/mathcs/csparsej/tfloat/Scs_gaxpy.java#L48-L63 |
weld/core | impl/src/main/java/org/jboss/weld/event/FastEvent.java | FastEvent.of | public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers) {
"""
Constructs a new FastEvent instance
@param type the event type
@param manager the bean manager
@param notifier the notifier to be used for observer method resolution
@param quali... | java | public static <T> FastEvent<T> of(Class<T> type, BeanManagerImpl manager, ObserverNotifier notifier, Annotation... qualifiers) {
ResolvedObservers<T> resolvedObserverMethods = notifier.<T> resolveObserverMethods(type, qualifiers);
if (resolvedObserverMethods.isMetadataRequired()) {
EventMeta... | [
"public",
"static",
"<",
"T",
">",
"FastEvent",
"<",
"T",
">",
"of",
"(",
"Class",
"<",
"T",
">",
"type",
",",
"BeanManagerImpl",
"manager",
",",
"ObserverNotifier",
"notifier",
",",
"Annotation",
"...",
"qualifiers",
")",
"{",
"ResolvedObservers",
"<",
"T... | Constructs a new FastEvent instance
@param type the event type
@param manager the bean manager
@param notifier the notifier to be used for observer method resolution
@param qualifiers the event qualifiers
@return | [
"Constructs",
"a",
"new",
"FastEvent",
"instance"
] | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/event/FastEvent.java#L75-L84 |
grails/gorm-hibernate5 | grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java | AbstractHibernateCriteriaBuilder.sizeEq | public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) {
"""
Creates a Criterion that contrains a collection property by size
@param propertyName The property name
@param size The size to constrain by
@return A Criterion instance
"""
if (!validateSimpleExpre... | java | public org.grails.datastore.mapping.query.api.Criteria sizeEq(String propertyName, int size) {
if (!validateSimpleExpression()) {
throwRuntimeException(new IllegalArgumentException("Call to [sizeEq] with propertyName [" +
propertyName + "] and size [" + size + "] not allowed here... | [
"public",
"org",
".",
"grails",
".",
"datastore",
".",
"mapping",
".",
"query",
".",
"api",
".",
"Criteria",
"sizeEq",
"(",
"String",
"propertyName",
",",
"int",
"size",
")",
"{",
"if",
"(",
"!",
"validateSimpleExpression",
"(",
")",
")",
"{",
"throwRunt... | Creates a Criterion that contrains a collection property by size
@param propertyName The property name
@param size The size to constrain by
@return A Criterion instance | [
"Creates",
"a",
"Criterion",
"that",
"contrains",
"a",
"collection",
"property",
"by",
"size"
] | train | https://github.com/grails/gorm-hibernate5/blob/0ebb80cd769ef2bea955723d4543828a3e9542ef/grails-datastore-gorm-hibernate5/src/main/groovy/org/grails/orm/hibernate/query/AbstractHibernateCriteriaBuilder.java#L1414-L1423 |
spring-projects/spring-ldap | core/src/main/java/org/springframework/ldap/core/LdapTemplate.java | LdapTemplate.deleteRecursively | protected void deleteRecursively(DirContext ctx, Name name) {
"""
Delete all subcontexts including the current one recursively.
@param ctx The context to use for deleting.
@param name The starting point to delete recursively.
@throws NamingException if any error occurs
"""
NamingEnumeration enumeration... | java | protected void deleteRecursively(DirContext ctx, Name name) {
NamingEnumeration enumeration = null;
try {
enumeration = ctx.listBindings(name);
while (enumeration.hasMore()) {
Binding binding = (Binding) enumeration.next();
LdapName childName = LdapUtils.newLdapName(binding.getName());
childName.... | [
"protected",
"void",
"deleteRecursively",
"(",
"DirContext",
"ctx",
",",
"Name",
"name",
")",
"{",
"NamingEnumeration",
"enumeration",
"=",
"null",
";",
"try",
"{",
"enumeration",
"=",
"ctx",
".",
"listBindings",
"(",
"name",
")",
";",
"while",
"(",
"enumera... | Delete all subcontexts including the current one recursively.
@param ctx The context to use for deleting.
@param name The starting point to delete recursively.
@throws NamingException if any error occurs | [
"Delete",
"all",
"subcontexts",
"including",
"the",
"current",
"one",
"recursively",
"."
] | train | https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/core/LdapTemplate.java#L1096-L1123 |
NordicSemiconductor/Android-DFU-Library | dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java | DfuBaseService.terminateConnection | protected void terminateConnection(@NonNull final BluetoothGatt gatt, final int error) {
"""
Disconnects from the device and cleans local variables in case of error.
This method is SYNCHRONOUS and wait until the disconnecting process will be completed.
@param gatt the GATT device to be disconnected.
@param e... | java | protected void terminateConnection(@NonNull final BluetoothGatt gatt, final int error) {
if (mConnectionState != STATE_DISCONNECTED) {
// Disconnect from the device
disconnect(gatt);
}
// Close the device
refreshDeviceCache(gatt, false); // This should be set to true when DFU Version is 0.5 or lower
cl... | [
"protected",
"void",
"terminateConnection",
"(",
"@",
"NonNull",
"final",
"BluetoothGatt",
"gatt",
",",
"final",
"int",
"error",
")",
"{",
"if",
"(",
"mConnectionState",
"!=",
"STATE_DISCONNECTED",
")",
"{",
"// Disconnect from the device",
"disconnect",
"(",
"gatt"... | Disconnects from the device and cleans local variables in case of error.
This method is SYNCHRONOUS and wait until the disconnecting process will be completed.
@param gatt the GATT device to be disconnected.
@param error error number. | [
"Disconnects",
"from",
"the",
"device",
"and",
"cleans",
"local",
"variables",
"in",
"case",
"of",
"error",
".",
"This",
"method",
"is",
"SYNCHRONOUS",
"and",
"wait",
"until",
"the",
"disconnecting",
"process",
"will",
"be",
"completed",
"."
] | train | https://github.com/NordicSemiconductor/Android-DFU-Library/blob/ec14c8c522bebe801a9a4c3dfbbeb1f53262c03f/dfu/src/main/java/no/nordicsemi/android/dfu/DfuBaseService.java#L1519-L1531 |
wcm-io/wcm-io-handler | url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java | SuffixParser.getPage | public @Nullable Page getPage(@Nullable Predicate<Page> filter, @Nullable Page basePage) {
"""
Get the first item returned by {@link #getPages(Predicate, Page)} or null if list is empty
@param filter the resource filter
@param basePage the suffix path is relative to this page path (null for current page)
@retur... | java | public @Nullable Page getPage(@Nullable Predicate<Page> filter, @Nullable Page basePage) {
List<Page> suffixPages = getPages(filter, basePage);
if (suffixPages.isEmpty()) {
return null;
}
else {
return suffixPages.get(0);
}
} | [
"public",
"@",
"Nullable",
"Page",
"getPage",
"(",
"@",
"Nullable",
"Predicate",
"<",
"Page",
">",
"filter",
",",
"@",
"Nullable",
"Page",
"basePage",
")",
"{",
"List",
"<",
"Page",
">",
"suffixPages",
"=",
"getPages",
"(",
"filter",
",",
"basePage",
")"... | Get the first item returned by {@link #getPages(Predicate, Page)} or null if list is empty
@param filter the resource filter
@param basePage the suffix path is relative to this page path (null for current page)
@return the first {@link Page} or null | [
"Get",
"the",
"first",
"item",
"returned",
"by",
"{"
] | train | https://github.com/wcm-io/wcm-io-handler/blob/b0fc1c11a3ceb89efb73826dcfd480d6a00c19af/url/src/main/java/io/wcm/handler/url/suffix/SuffixParser.java#L312-L320 |
m-m-m/util | reflect/src/main/java/net/sf/mmm/util/reflect/base/ManifestLoader.java | ManifestLoader.completeManifest | private static void completeManifest(Manifest manifest, URL url) {
"""
This method adds dynamic attributes to the given {@code manifest}.
@param manifest is the {@link Manifest} to modify.
@param url is the {@link URL} with the source of the manifest.
"""
String path = url.getPath();
int start ... | java | private static void completeManifest(Manifest manifest, URL url) {
String path = url.getPath();
int start = 0;
int end = path.length();
if (path.endsWith(JAR_SUFFIX)) {
// 4 for ".jar"
end = end - JAR_SUFFIX.length() + 4;
start = path.lastIndexOf('/', end) + 1;
}
Str... | [
"private",
"static",
"void",
"completeManifest",
"(",
"Manifest",
"manifest",
",",
"URL",
"url",
")",
"{",
"String",
"path",
"=",
"url",
".",
"getPath",
"(",
")",
";",
"int",
"start",
"=",
"0",
";",
"int",
"end",
"=",
"path",
".",
"length",
"(",
")",... | This method adds dynamic attributes to the given {@code manifest}.
@param manifest is the {@link Manifest} to modify.
@param url is the {@link URL} with the source of the manifest. | [
"This",
"method",
"adds",
"dynamic",
"attributes",
"to",
"the",
"given",
"{",
"@code",
"manifest",
"}",
"."
] | train | https://github.com/m-m-m/util/blob/f0e4e084448f8dfc83ca682a9e1618034a094ce6/reflect/src/main/java/net/sf/mmm/util/reflect/base/ManifestLoader.java#L88-L100 |
JamesIry/jADT | jADT-core/src/main/java/com/pogofish/jadt/JADT.java | JADT.createDummyJADT | public static JADT createDummyJADT(List<SyntaxError> syntaxErrors, List<SemanticError> semanticErrors, String testSrcInfo, SinkFactoryFactory factory) {
"""
Create a dummy configged jADT based on the provided syntaxErrors, semanticErrors, testSrcInfo, and sink factory
Useful for testing
"""
final Sour... | java | public static JADT createDummyJADT(List<SyntaxError> syntaxErrors, List<SemanticError> semanticErrors, String testSrcInfo, SinkFactoryFactory factory) {
final SourceFactory sourceFactory = new StringSourceFactory(TEST_STRING);
final Doc doc = new Doc(TEST_SRC_INFO, Pkg._Pkg(NO_COMMENTS, "pkg"), Util.<Im... | [
"public",
"static",
"JADT",
"createDummyJADT",
"(",
"List",
"<",
"SyntaxError",
">",
"syntaxErrors",
",",
"List",
"<",
"SemanticError",
">",
"semanticErrors",
",",
"String",
"testSrcInfo",
",",
"SinkFactoryFactory",
"factory",
")",
"{",
"final",
"SourceFactory",
"... | Create a dummy configged jADT based on the provided syntaxErrors, semanticErrors, testSrcInfo, and sink factory
Useful for testing | [
"Create",
"a",
"dummy",
"configged",
"jADT",
"based",
"on",
"the",
"provided",
"syntaxErrors",
"semanticErrors",
"testSrcInfo",
"and",
"sink",
"factory",
"Useful",
"for",
"testing"
] | train | https://github.com/JamesIry/jADT/blob/92ee94b6624cd673851497d78c218837dcf02b8a/jADT-core/src/main/java/com/pogofish/jadt/JADT.java#L177-L186 |
wellner/jcarafe | jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java | ObjectArrayList.removeFromTo | public void removeFromTo(int from, int to) {
"""
Removes from the receiver all elements whose index is between
<code>from</code>, inclusive and <code>to</code>, inclusive. Shifts any succeeding
elements to the left (reduces their index).
This call shortens the list by <tt>(to - from + 1)</tt> elements.
@par... | java | public void removeFromTo(int from, int to) {
checkRangeFromTo(from, to, size);
int numMoved = size - to - 1;
if (numMoved >= 0) {
System.arraycopy(elements, to+1, elements, from, numMoved);
fillFromToWith(from+numMoved, size-1, null); //delta
}
int width = to-from+1;
if (width>0) size -= width;
} | [
"public",
"void",
"removeFromTo",
"(",
"int",
"from",
",",
"int",
"to",
")",
"{",
"checkRangeFromTo",
"(",
"from",
",",
"to",
",",
"size",
")",
";",
"int",
"numMoved",
"=",
"size",
"-",
"to",
"-",
"1",
";",
"if",
"(",
"numMoved",
">=",
"0",
")",
... | Removes from the receiver all elements whose index is between
<code>from</code>, inclusive and <code>to</code>, inclusive. Shifts any succeeding
elements to the left (reduces their index).
This call shortens the list by <tt>(to - from + 1)</tt> elements.
@param from index of first element to be removed.
@param to ind... | [
"Removes",
"from",
"the",
"receiver",
"all",
"elements",
"whose",
"index",
"is",
"between",
"<code",
">",
"from<",
"/",
"code",
">",
"inclusive",
"and",
"<code",
">",
"to<",
"/",
"code",
">",
"inclusive",
".",
"Shifts",
"any",
"succeeding",
"elements",
"to... | train | https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/ObjectArrayList.java#L665-L674 |
jhunters/jprotobuf | v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/FieldUtils.java | FieldUtils.findField | public static Field findField(Class clazz, String name, Class type) {
"""
Attempt to find a {@link Field field} on the supplied {@link Class} with
the supplied <code>name</code> and/or {@link Class type}. Searches all
superclasses up to {@link Object}.
@param clazz
the class to introspect
@param name
the n... | java | public static Field findField(Class clazz, String name, Class type) {
if (clazz == null) {
throw new IllegalArgumentException("Class must not be null");
}
if (name == null && type == null) {
throw new IllegalArgumentException(
"Either name or typ... | [
"public",
"static",
"Field",
"findField",
"(",
"Class",
"clazz",
",",
"String",
"name",
",",
"Class",
"type",
")",
"{",
"if",
"(",
"clazz",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Class must not be null\"",
")",
";",
"}",
... | Attempt to find a {@link Field field} on the supplied {@link Class} with
the supplied <code>name</code> and/or {@link Class type}. Searches all
superclasses up to {@link Object}.
@param clazz
the class to introspect
@param name
the name of the field (may be <code>null</code> if type is
specified)
@param type
the type ... | [
"Attempt",
"to",
"find",
"a",
"{",
"@link",
"Field",
"field",
"}",
"on",
"the",
"supplied",
"{",
"@link",
"Class",
"}",
"with",
"the",
"supplied",
"<code",
">",
"name<",
"/",
"code",
">",
"and",
"/",
"or",
"{",
"@link",
"Class",
"type",
"}",
".",
"... | train | https://github.com/jhunters/jprotobuf/blob/55832c9b4792afb128e5b35139d8a3891561d8a3/v3/src/main/java/com/baidu/bjf/remoting/protobuf/utils/FieldUtils.java#L155-L176 |
exoplatform/jcr | exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java | PutCommand.createVersion | private void createVersion(Node fileNode, InputStream inputStream, List<String> mixins) throws RepositoryException {
"""
Creates the new version of file.
@param fileNode file node
@param inputStream input stream that contains the content of file
@param mixins list of mixins
@throws RepositoryException {@link... | java | private void createVersion(Node fileNode, InputStream inputStream, List<String> mixins) throws RepositoryException
{
if (!fileNode.isCheckedOut())
{
fileNode.checkout();
fileNode.getSession().save();
}
updateContent(fileNode, inputStream, mixins);
fileNode.... | [
"private",
"void",
"createVersion",
"(",
"Node",
"fileNode",
",",
"InputStream",
"inputStream",
",",
"List",
"<",
"String",
">",
"mixins",
")",
"throws",
"RepositoryException",
"{",
"if",
"(",
"!",
"fileNode",
".",
"isCheckedOut",
"(",
")",
")",
"{",
"fileNo... | Creates the new version of file.
@param fileNode file node
@param inputStream input stream that contains the content of file
@param mixins list of mixins
@throws RepositoryException {@link RepositoryException} | [
"Creates",
"the",
"new",
"version",
"of",
"file",
"."
] | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.webdav/src/main/java/org/exoplatform/services/jcr/webdav/command/PutCommand.java#L360-L373 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.computeLowestRoot | private static float computeLowestRoot(float a, float b, float c, float maxR) {
"""
Compute the lowest root for <code>t</code> in the quadratic equation <code>a*t*t + b*t + c = 0</code>.
<p>
This is a helper method for {@link #intersectSweptSphereTriangle}
@param a
the quadratic factor
@param b
the linear ... | java | private static float computeLowestRoot(float a, float b, float c, float maxR) {
float determinant = b * b - 4.0f * a * c;
if (determinant < 0.0f)
return Float.POSITIVE_INFINITY;
float sqrtD = (float) Math.sqrt(determinant);
float r1 = (-b - sqrtD) / (2.0f * a);
float ... | [
"private",
"static",
"float",
"computeLowestRoot",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"c",
",",
"float",
"maxR",
")",
"{",
"float",
"determinant",
"=",
"b",
"*",
"b",
"-",
"4.0f",
"*",
"a",
"*",
"c",
";",
"if",
"(",
"determinant",
... | Compute the lowest root for <code>t</code> in the quadratic equation <code>a*t*t + b*t + c = 0</code>.
<p>
This is a helper method for {@link #intersectSweptSphereTriangle}
@param a
the quadratic factor
@param b
the linear factor
@param c
the constant
@param maxR
the maximum expected root
@return the lowest of the two... | [
"Compute",
"the",
"lowest",
"root",
"for",
"<code",
">",
"t<",
"/",
"code",
">",
"in",
"the",
"quadratic",
"equation",
"<code",
">",
"a",
"*",
"t",
"*",
"t",
"+",
"b",
"*",
"t",
"+",
"c",
"=",
"0<",
"/",
"code",
">",
".",
"<p",
">",
"This",
"... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L1959-L1978 |
micronaut-projects/micronaut-core | inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java | GenericUtils.interfaceGenericTypeFor | protected TypeMirror interfaceGenericTypeFor(TypeElement element, String interfaceName) {
"""
Finds the generic type for the given interface for the given class element.
<p>
For example, for <code>class AProvider implements Provider<A></code>
element = AProvider
interfaceName = interface javax.inject.Pro... | java | protected TypeMirror interfaceGenericTypeFor(TypeElement element, String interfaceName) {
List<? extends TypeMirror> typeMirrors = interfaceGenericTypesFor(element, interfaceName);
return typeMirrors.isEmpty() ? null : typeMirrors.get(0);
} | [
"protected",
"TypeMirror",
"interfaceGenericTypeFor",
"(",
"TypeElement",
"element",
",",
"String",
"interfaceName",
")",
"{",
"List",
"<",
"?",
"extends",
"TypeMirror",
">",
"typeMirrors",
"=",
"interfaceGenericTypesFor",
"(",
"element",
",",
"interfaceName",
")",
... | Finds the generic type for the given interface for the given class element.
<p>
For example, for <code>class AProvider implements Provider<A></code>
element = AProvider
interfaceName = interface javax.inject.Provider
return A
@param element The class element
@param interfaceName The interface
@return The g... | [
"Finds",
"the",
"generic",
"type",
"for",
"the",
"given",
"interface",
"for",
"the",
"given",
"class",
"element",
".",
"<p",
">",
"For",
"example",
"for",
"<code",
">",
"class",
"AProvider",
"implements",
"Provider<",
";",
"A>",
";",
"<",
"/",
"code",
... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject-java/src/main/java/io/micronaut/annotation/processing/GenericUtils.java#L96-L99 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java | JsUtils.runJavascriptFunction | public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) {
"""
Call via jsni any arbitrary function present in a Javascript object.
It's thought for avoiding to create jsni methods to call external functions and
facilitate the writing of js wrappers.
Example
<pre>
// Crea... | java | public static <T> T runJavascriptFunction(JavaScriptObject o, String meth, Object... args) {
return runJavascriptFunctionImpl(o, meth, JsObjectArray.create().add(args).<JsArrayMixed>cast());
} | [
"public",
"static",
"<",
"T",
">",
"T",
"runJavascriptFunction",
"(",
"JavaScriptObject",
"o",
",",
"String",
"meth",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"runJavascriptFunctionImpl",
"(",
"o",
",",
"meth",
",",
"JsObjectArray",
".",
"create",
"... | Call via jsni any arbitrary function present in a Javascript object.
It's thought for avoiding to create jsni methods to call external functions and
facilitate the writing of js wrappers.
Example
<pre>
// Create a svg node in our document.
Element svg = runJavascriptFunction(document, "createElementNS", "http://www.w... | [
"Call",
"via",
"jsni",
"any",
"arbitrary",
"function",
"present",
"in",
"a",
"Javascript",
"object",
"."
] | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/js/JsUtils.java#L593-L595 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/frames/FrameData.java | FrameData.buildFrameArrayForWrite | public WsByteBuffer[] buildFrameArrayForWrite() {
"""
Builds an array of buffers representing this http2 data frame
output[0] = http2 frame header data
output[1] = payload data
output[2] ?= padding
@return WsByteBuffer[]
"""
WsByteBuffer[] output;
int headerSize = SIZE_FRAME_BEFORE_PAYLO... | java | public WsByteBuffer[] buildFrameArrayForWrite() {
WsByteBuffer[] output;
int headerSize = SIZE_FRAME_BEFORE_PAYLOAD;
if (PADDED_FLAG) {
headerSize = SIZE_FRAME_BEFORE_PAYLOAD + 1;
}
WsByteBuffer frameHeaders = getBuffer(headerSize);
byte[] frame;
if (... | [
"public",
"WsByteBuffer",
"[",
"]",
"buildFrameArrayForWrite",
"(",
")",
"{",
"WsByteBuffer",
"[",
"]",
"output",
";",
"int",
"headerSize",
"=",
"SIZE_FRAME_BEFORE_PAYLOAD",
";",
"if",
"(",
"PADDED_FLAG",
")",
"{",
"headerSize",
"=",
"SIZE_FRAME_BEFORE_PAYLOAD",
"... | Builds an array of buffers representing this http2 data frame
output[0] = http2 frame header data
output[1] = payload data
output[2] ?= padding
@return WsByteBuffer[] | [
"Builds",
"an",
"array",
"of",
"buffers",
"representing",
"this",
"http2",
"data",
"frame",
"output",
"[",
"0",
"]",
"=",
"http2",
"frame",
"header",
"data",
"output",
"[",
"1",
"]",
"=",
"payload",
"data",
"output",
"[",
"2",
"]",
"?",
"=",
"padding"
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/h2internal/frames/FrameData.java#L173-L221 |
Azure/azure-sdk-for-java | datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java | ServicesInner.getByResourceGroup | public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) {
"""
Get DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance.
@param groupName Name of the resou... | java | public DataMigrationServiceInner getByResourceGroup(String groupName, String serviceName) {
return getByResourceGroupWithServiceResponseAsync(groupName, serviceName).toBlocking().single().body();
} | [
"public",
"DataMigrationServiceInner",
"getByResourceGroup",
"(",
"String",
"groupName",
",",
"String",
"serviceName",
")",
"{",
"return",
"getByResourceGroupWithServiceResponseAsync",
"(",
"groupName",
",",
"serviceName",
")",
".",
"toBlocking",
"(",
")",
".",
"single"... | Get DMS Service Instance.
The services resource is the top-level resource that represents the Data Migration Service. The GET method retrieves information about a service instance.
@param groupName Name of the resource group
@param serviceName Name of the service
@throws IllegalArgumentException thrown if parameters f... | [
"Get",
"DMS",
"Service",
"Instance",
".",
"The",
"services",
"resource",
"is",
"the",
"top",
"-",
"level",
"resource",
"that",
"represents",
"the",
"Data",
"Migration",
"Service",
".",
"The",
"GET",
"method",
"retrieves",
"information",
"about",
"a",
"service"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datamigration/resource-manager/v2017_11_15_preview/src/main/java/com/microsoft/azure/management/datamigration/v2017_11_15_preview/implementation/ServicesInner.java#L344-L346 |
apache/incubator-gobblin | gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java | Partitioner.getPartitions | @Deprecated
public HashMap<Long, Long> getPartitions(long previousWatermark) {
"""
Get partitions with low and high water marks
@param previousWatermark previous water mark from metadata
@return map of partition intervals.
map's key is interval begin time (in format {@link Partitioner#WATERMARKTIMEFORMAT})
... | java | @Deprecated
public HashMap<Long, Long> getPartitions(long previousWatermark) {
HashMap<Long, Long> defaultPartition = Maps.newHashMap();
if (!isWatermarkExists()) {
defaultPartition.put(ConfigurationKeys.DEFAULT_WATERMARK_VALUE, ConfigurationKeys.DEFAULT_WATERMARK_VALUE);
LOG.info("Watermark colum... | [
"@",
"Deprecated",
"public",
"HashMap",
"<",
"Long",
",",
"Long",
">",
"getPartitions",
"(",
"long",
"previousWatermark",
")",
"{",
"HashMap",
"<",
"Long",
",",
"Long",
">",
"defaultPartition",
"=",
"Maps",
".",
"newHashMap",
"(",
")",
";",
"if",
"(",
"!... | Get partitions with low and high water marks
@param previousWatermark previous water mark from metadata
@return map of partition intervals.
map's key is interval begin time (in format {@link Partitioner#WATERMARKTIMEFORMAT})
map's value is interval end time (in format {@link Partitioner#WATERMARKTIMEFORMAT}) | [
"Get",
"partitions",
"with",
"low",
"and",
"high",
"water",
"marks"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/source/extractor/partition/Partitioner.java#L118-L159 |
mojohaus/webstart | webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/dependency/task/UpdateManifestTask.java | UpdateManifestTask.createManifest | private Manifest createManifest( File jar, Map<String, String> manifestentries )
throws MojoExecutionException {
"""
Create the new manifest from the existing jar file and the new entries.
@param jar
@param manifestentries
@return Manifest
@throws MojoExecutionException
"""
JarFile ja... | java | private Manifest createManifest( File jar, Map<String, String> manifestentries )
throws MojoExecutionException
{
JarFile jarFile = null;
try
{
jarFile = new JarFile( jar );
// read manifest from jar
Manifest manifest = jarFile.getManifest();
... | [
"private",
"Manifest",
"createManifest",
"(",
"File",
"jar",
",",
"Map",
"<",
"String",
",",
"String",
">",
"manifestentries",
")",
"throws",
"MojoExecutionException",
"{",
"JarFile",
"jarFile",
"=",
"null",
";",
"try",
"{",
"jarFile",
"=",
"new",
"JarFile",
... | Create the new manifest from the existing jar file and the new entries.
@param jar
@param manifestentries
@return Manifest
@throws MojoExecutionException | [
"Create",
"the",
"new",
"manifest",
"from",
"the",
"existing",
"jar",
"file",
"and",
"the",
"new",
"entries",
"."
] | train | https://github.com/mojohaus/webstart/blob/38fdd1d21f063f21716cfcd61ebeabd963487576/webstart-maven-plugin/src/main/java/org/codehaus/mojo/webstart/dependency/task/UpdateManifestTask.java#L172-L206 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java | TasksImpl.listWithServiceResponseAsync | public Observable<ServiceResponseWithHeaders<Page<CloudTask>, TaskListHeaders>> listWithServiceResponseAsync(final String jobId, final TaskListOptions taskListOptions) {
"""
Lists all of the tasks that are associated with the specified job.
For multi-instance tasks, information such as affinityId, executionInfo a... | java | public Observable<ServiceResponseWithHeaders<Page<CloudTask>, TaskListHeaders>> listWithServiceResponseAsync(final String jobId, final TaskListOptions taskListOptions) {
return listSinglePageAsync(jobId, taskListOptions)
.concatMap(new Func1<ServiceResponseWithHeaders<Page<CloudTask>, TaskListHeader... | [
"public",
"Observable",
"<",
"ServiceResponseWithHeaders",
"<",
"Page",
"<",
"CloudTask",
">",
",",
"TaskListHeaders",
">",
">",
"listWithServiceResponseAsync",
"(",
"final",
"String",
"jobId",
",",
"final",
"TaskListOptions",
"taskListOptions",
")",
"{",
"return",
... | Lists all of the tasks that are associated with the specified job.
For multi-instance tasks, information such as affinityId, executionInfo and nodeInfo refer to the primary task. Use the list subtasks API to retrieve information about subtasks.
@param jobId The ID of the job.
@param taskListOptions Additional paramete... | [
"Lists",
"all",
"of",
"the",
"tasks",
"that",
"are",
"associated",
"with",
"the",
"specified",
"job",
".",
"For",
"multi",
"-",
"instance",
"tasks",
"information",
"such",
"as",
"affinityId",
"executionInfo",
"and",
"nodeInfo",
"refer",
"to",
"the",
"primary",... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/TasksImpl.java#L556-L575 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java | PathMetadataFactory.forArrayAccess | public static PathMetadata forArrayAccess(Path<?> parent, @Nonnegative int index) {
"""
Create a new PathMetadata instance for indexed array access
@param parent parent path
@param index index of element
@return array access path
"""
return new PathMetadata(parent, index, PathType.ARRAYVALUE_CONST... | java | public static PathMetadata forArrayAccess(Path<?> parent, @Nonnegative int index) {
return new PathMetadata(parent, index, PathType.ARRAYVALUE_CONSTANT);
} | [
"public",
"static",
"PathMetadata",
"forArrayAccess",
"(",
"Path",
"<",
"?",
">",
"parent",
",",
"@",
"Nonnegative",
"int",
"index",
")",
"{",
"return",
"new",
"PathMetadata",
"(",
"parent",
",",
"index",
",",
"PathType",
".",
"ARRAYVALUE_CONSTANT",
")",
";"... | Create a new PathMetadata instance for indexed array access
@param parent parent path
@param index index of element
@return array access path | [
"Create",
"a",
"new",
"PathMetadata",
"instance",
"for",
"indexed",
"array",
"access"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/PathMetadataFactory.java#L44-L46 |
Alluxio/alluxio | job/server/src/main/java/alluxio/worker/job/task/TaskExecutorManager.java | TaskExecutorManager.notifyTaskCancellation | public synchronized void notifyTaskCancellation(long jobId, int taskId) {
"""
Notifies the cancellation of the task.
@param jobId the job id
@param taskId the task id
"""
Pair<Long, Integer> id = new Pair<>(jobId, taskId);
TaskInfo.Builder taskInfo = mUnfinishedTasks.get(id);
taskInfo.setStatus... | java | public synchronized void notifyTaskCancellation(long jobId, int taskId) {
Pair<Long, Integer> id = new Pair<>(jobId, taskId);
TaskInfo.Builder taskInfo = mUnfinishedTasks.get(id);
taskInfo.setStatus(Status.CANCELED);
finishTask(id);
LOG.info("Task {} for job {} canceled", taskId, jobId);
} | [
"public",
"synchronized",
"void",
"notifyTaskCancellation",
"(",
"long",
"jobId",
",",
"int",
"taskId",
")",
"{",
"Pair",
"<",
"Long",
",",
"Integer",
">",
"id",
"=",
"new",
"Pair",
"<>",
"(",
"jobId",
",",
"taskId",
")",
";",
"TaskInfo",
".",
"Builder",... | Notifies the cancellation of the task.
@param jobId the job id
@param taskId the task id | [
"Notifies",
"the",
"cancellation",
"of",
"the",
"task",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/job/server/src/main/java/alluxio/worker/job/task/TaskExecutorManager.java#L111-L117 |
Harium/keel | src/main/java/com/harium/keel/catalano/math/ComplexNumber.java | ComplexNumber.Swap | public static void Swap(ComplexNumber[][] z) {
"""
Swap values between real and imaginary.
@param z Complex number.
"""
for (int i = 0; i < z.length; i++) {
for (int j = 0; j < z[0].length; j++) {
z[i][j] = new ComplexNumber(z[i][j].imaginary, z[i][j].real);
... | java | public static void Swap(ComplexNumber[][] z) {
for (int i = 0; i < z.length; i++) {
for (int j = 0; j < z[0].length; j++) {
z[i][j] = new ComplexNumber(z[i][j].imaginary, z[i][j].real);
}
}
} | [
"public",
"static",
"void",
"Swap",
"(",
"ComplexNumber",
"[",
"]",
"[",
"]",
"z",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"z",
".",
"length",
";",
"i",
"++",
")",
"{",
"for",
"(",
"int",
"j",
"=",
"0",
";",
"j",
"<",
"... | Swap values between real and imaginary.
@param z Complex number. | [
"Swap",
"values",
"between",
"real",
"and",
"imaginary",
"."
] | train | https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/math/ComplexNumber.java#L185-L191 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java | ExpressionUtils.predicateTemplate | public static PredicateTemplate predicateTemplate(Template template, Object... args) {
"""
Create a new Template expression
@param template template
@param args template parameters
@return template expression
"""
return predicateTemplate(template, ImmutableList.copyOf(args));
} | java | public static PredicateTemplate predicateTemplate(Template template, Object... args) {
return predicateTemplate(template, ImmutableList.copyOf(args));
} | [
"public",
"static",
"PredicateTemplate",
"predicateTemplate",
"(",
"Template",
"template",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"predicateTemplate",
"(",
"template",
",",
"ImmutableList",
".",
"copyOf",
"(",
"args",
")",
")",
";",
"}"
] | Create a new Template expression
@param template template
@param args template parameters
@return template expression | [
"Create",
"a",
"new",
"Template",
"expression"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/ExpressionUtils.java#L176-L178 |
UrielCh/ovh-java-sdk | ovh-java-sdk-core/src/main/java/net/minidev/ovh/api/ApiOvhAuth.java | ApiOvhAuth.credential_POST | public net.minidev.ovh.api.auth.OvhCredential credential_POST(OvhAccessRule[] accessRules, String redirection) throws IOException {
"""
Request a new credential for your application
REST: POST /auth/credential
@param accessRules [required] Access required for your application
@param redirection [required] Whe... | java | public net.minidev.ovh.api.auth.OvhCredential credential_POST(OvhAccessRule[] accessRules, String redirection) throws IOException {
String qPath = "/auth/credential";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "accessRules", accessRules);
addBody(o, "r... | [
"public",
"net",
".",
"minidev",
".",
"ovh",
".",
"api",
".",
"auth",
".",
"OvhCredential",
"credential_POST",
"(",
"OvhAccessRule",
"[",
"]",
"accessRules",
",",
"String",
"redirection",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/auth/cred... | Request a new credential for your application
REST: POST /auth/credential
@param accessRules [required] Access required for your application
@param redirection [required] Where you want to redirect the user after sucessfull authentication | [
"Request",
"a",
"new",
"credential",
"for",
"your",
"application"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-core/src/main/java/net/minidev/ovh/api/ApiOvhAuth.java#L62-L70 |
fozziethebeat/S-Space | src/main/java/edu/ucla/sspace/tools/BigramExtractor.java | BigramExtractor.getScore | private double getScore(int[] contingencyTable, SignificanceTest test) {
"""
Returns the score of the contingency table using the specified
significance test
@param contingencyTable a contingency table specified as four {@code int}
values
@param test the significance test to use in evaluating the table
"... | java | private double getScore(int[] contingencyTable, SignificanceTest test) {
switch (test) {
case PMI:
return pmi(contingencyTable);
case CHI_SQUARED:
return chiSq(contingencyTable);
case LOG_LIKELIHOOD:
return logLikelihood(contingencyTable);
defa... | [
"private",
"double",
"getScore",
"(",
"int",
"[",
"]",
"contingencyTable",
",",
"SignificanceTest",
"test",
")",
"{",
"switch",
"(",
"test",
")",
"{",
"case",
"PMI",
":",
"return",
"pmi",
"(",
"contingencyTable",
")",
";",
"case",
"CHI_SQUARED",
":",
"retu... | Returns the score of the contingency table using the specified
significance test
@param contingencyTable a contingency table specified as four {@code int}
values
@param test the significance test to use in evaluating the table | [
"Returns",
"the",
"score",
"of",
"the",
"contingency",
"table",
"using",
"the",
"specified",
"significance",
"test"
] | train | https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/tools/BigramExtractor.java#L332-L343 |
hal/core | gui/src/main/java/org/jboss/as/console/client/widgets/CollapsibleSplitLayoutPanel.java | CollapsibleSplitLayoutPanel.setWidgetSnapClosedSize | public void setWidgetSnapClosedSize(Widget child, int snapClosedSize) {
"""
Sets a size below which the slider will close completely. This can be used
in conjunction with {@link #setWidgetMinSize} to provide a speed-bump
effect where the slider will stick to a preferred minimum size before
closing completely.
... | java | public void setWidgetSnapClosedSize(Widget child, int snapClosedSize) {
assertIsChild(child);
Splitter splitter = getAssociatedSplitter(child);
// The splitter is null for the center element.
if (splitter != null) {
splitter.setSnapClosedSize(snapClosedSize);
}
} | [
"public",
"void",
"setWidgetSnapClosedSize",
"(",
"Widget",
"child",
",",
"int",
"snapClosedSize",
")",
"{",
"assertIsChild",
"(",
"child",
")",
";",
"Splitter",
"splitter",
"=",
"getAssociatedSplitter",
"(",
"child",
")",
";",
"// The splitter is null for the center ... | Sets a size below which the slider will close completely. This can be used
in conjunction with {@link #setWidgetMinSize} to provide a speed-bump
effect where the slider will stick to a preferred minimum size before
closing completely.
<p>
This method has no effect for the {@link DockLayoutPanel.Direction#CENTER}
widge... | [
"Sets",
"a",
"size",
"below",
"which",
"the",
"slider",
"will",
"close",
"completely",
".",
"This",
"can",
"be",
"used",
"in",
"conjunction",
"with",
"{",
"@link",
"#setWidgetMinSize",
"}",
"to",
"provide",
"a",
"speed",
"-",
"bump",
"effect",
"where",
"th... | train | https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/CollapsibleSplitLayoutPanel.java#L440-L447 |
droidpl/android-json-viewer | android-json-viewer/src/main/java/com/github/droidpl/android/jsonviewer/JSONViewerActivity.java | JSONViewerActivity.startActivity | public static void startActivity(@NonNull Context context, @Nullable JSONObject jsonObject) {
"""
Starts the activity with a json object.
@param context The context to start the activity.
@param jsonObject The json object.
"""
Intent intent = new Intent(context, JSONViewerActivity.class);
... | java | public static void startActivity(@NonNull Context context, @Nullable JSONObject jsonObject) {
Intent intent = new Intent(context, JSONViewerActivity.class);
Bundle bundle = new Bundle();
if (jsonObject != null) {
bundle.putString(JSON_OBJECT_STATE, jsonObject.toString());
}
... | [
"public",
"static",
"void",
"startActivity",
"(",
"@",
"NonNull",
"Context",
"context",
",",
"@",
"Nullable",
"JSONObject",
"jsonObject",
")",
"{",
"Intent",
"intent",
"=",
"new",
"Intent",
"(",
"context",
",",
"JSONViewerActivity",
".",
"class",
")",
";",
"... | Starts the activity with a json object.
@param context The context to start the activity.
@param jsonObject The json object. | [
"Starts",
"the",
"activity",
"with",
"a",
"json",
"object",
"."
] | train | https://github.com/droidpl/android-json-viewer/blob/7345a7a0e6636399015a03fad8243a47f5fcdd8f/android-json-viewer/src/main/java/com/github/droidpl/android/jsonviewer/JSONViewerActivity.java#L42-L50 |
knowm/XChange | xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseTradeServiceRaw.java | CoinbaseTradeServiceRaw.quote | public CoinbaseSell quote(String accountId, BigDecimal total, Currency currency)
throws IOException {
"""
Authenticated resource that lets you convert Bitcoin crediting your primary bank account on
Coinbase. (You must link and verify your bank account through the website before this API call
will work).
... | java | public CoinbaseSell quote(String accountId, BigDecimal total, Currency currency)
throws IOException {
return sellInternal(accountId, new SellPayload(total, currency.getCurrencyCode(), false, true));
} | [
"public",
"CoinbaseSell",
"quote",
"(",
"String",
"accountId",
",",
"BigDecimal",
"total",
",",
"Currency",
"currency",
")",
"throws",
"IOException",
"{",
"return",
"sellInternal",
"(",
"accountId",
",",
"new",
"SellPayload",
"(",
"total",
",",
"currency",
".",
... | Authenticated resource that lets you convert Bitcoin crediting your primary bank account on
Coinbase. (You must link and verify your bank account through the website before this API call
will work).
@see <a
href="https://developers.coinbase.com/api/v2#place-sell-order">developers.coinbase.com/api/v2#place-sell-order</... | [
"Authenticated",
"resource",
"that",
"lets",
"you",
"convert",
"Bitcoin",
"crediting",
"your",
"primary",
"bank",
"account",
"on",
"Coinbase",
".",
"(",
"You",
"must",
"link",
"and",
"verify",
"your",
"bank",
"account",
"through",
"the",
"website",
"before",
"... | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-coinbase/src/main/java/org/knowm/xchange/coinbase/v2/service/CoinbaseTradeServiceRaw.java#L76-L80 |
james-hu/jabb-core | src/main/java/net/sf/jabb/spring/service/AbstractThreadPoolService.java | AbstractThreadPoolService.setConfigurations | protected void setConfigurations(String commonPrefix, PropertySourcesPropertyResolver resolver) {
"""
Set configurations. This methods sets/overrides both the default configurations and the per-pool configurations.
@param commonPrefix the common prefix in the keys, for example, "threadPools."
@param resolver th... | java | protected void setConfigurations(String commonPrefix, PropertySourcesPropertyResolver resolver){
setConfigurationsCommonPrefix(commonPrefix);
setConfigurations(resolver);
setDefaultCoreSize(resolver.getProperty(commonPrefix + "defaultCoreSize", Integer.class, defaultCoreSize));
setDefaultMaxSize(resolver.get... | [
"protected",
"void",
"setConfigurations",
"(",
"String",
"commonPrefix",
",",
"PropertySourcesPropertyResolver",
"resolver",
")",
"{",
"setConfigurationsCommonPrefix",
"(",
"commonPrefix",
")",
";",
"setConfigurations",
"(",
"resolver",
")",
";",
"setDefaultCoreSize",
"("... | Set configurations. This methods sets/overrides both the default configurations and the per-pool configurations.
@param commonPrefix the common prefix in the keys, for example, "threadPools."
@param resolver the configuration properties resolver | [
"Set",
"configurations",
".",
"This",
"methods",
"sets",
"/",
"overrides",
"both",
"the",
"default",
"configurations",
"and",
"the",
"per",
"-",
"pool",
"configurations",
"."
] | train | https://github.com/james-hu/jabb-core/blob/bceed441595c5e5195a7418795f03b69fa7b61e4/src/main/java/net/sf/jabb/spring/service/AbstractThreadPoolService.java#L165-L175 |
JOML-CI/JOML | src/org/joml/Vector4d.java | Vector4d.set | public Vector4d set(int index, DoubleBuffer buffer) {
"""
Read this vector from the supplied {@link DoubleBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given DoubleBuffer.
@param index
the absolute position into the DoubleBuffer
@pa... | java | public Vector4d set(int index, DoubleBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector4d",
"set",
"(",
"int",
"index",
",",
"DoubleBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link DoubleBuffer} starting at the specified
absolute buffer position/index.
<p>
This method will not increment the position of the given DoubleBuffer.
@param index
the absolute position into the DoubleBuffer
@param buffer
values will be read in <code>x, y, z, w</code> order
@retur... | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"DoubleBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4d.java#L538-L541 |
eclipse/xtext-core | org.eclipse.xtext/src/org/eclipse/xtext/formatting2/AbstractFormatter2.java | AbstractFormatter2._format | protected void _format(XtextResource resource, IFormattableDocument document) {
"""
For {@link XtextResource resources}, assume we want to format the first EObject from the contents list only.
Because that's where the parser puts the semantic model.
"""
List<EObject> contents = resource.getContents();
if ... | java | protected void _format(XtextResource resource, IFormattableDocument document) {
List<EObject> contents = resource.getContents();
if (!contents.isEmpty()) {
EObject model = contents.get(0);
document.format(model);
}
} | [
"protected",
"void",
"_format",
"(",
"XtextResource",
"resource",
",",
"IFormattableDocument",
"document",
")",
"{",
"List",
"<",
"EObject",
">",
"contents",
"=",
"resource",
".",
"getContents",
"(",
")",
";",
"if",
"(",
"!",
"contents",
".",
"isEmpty",
"(",... | For {@link XtextResource resources}, assume we want to format the first EObject from the contents list only.
Because that's where the parser puts the semantic model. | [
"For",
"{"
] | train | https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext/src/org/eclipse/xtext/formatting2/AbstractFormatter2.java#L204-L210 |
datumbox/datumbox-framework | datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/AbstractFileStorageEngine.java | AbstractFileStorageEngine.deleteIfExistsRecursively | protected boolean deleteIfExistsRecursively(Path path) throws IOException {
"""
Deletes the file or directory recursively if it exists.
@param path
@return
@throws IOException
"""
try {
return Files.deleteIfExists(path);
}
catch (DirectoryNotEmptyException ex) {
... | java | protected boolean deleteIfExistsRecursively(Path path) throws IOException {
try {
return Files.deleteIfExists(path);
}
catch (DirectoryNotEmptyException ex) {
//do recursive delete
Files.walkFileTree(path, new SimpleFileVisitor<Path>() {
@Overr... | [
"protected",
"boolean",
"deleteIfExistsRecursively",
"(",
"Path",
"path",
")",
"throws",
"IOException",
"{",
"try",
"{",
"return",
"Files",
".",
"deleteIfExists",
"(",
"path",
")",
";",
"}",
"catch",
"(",
"DirectoryNotEmptyException",
"ex",
")",
"{",
"//do recur... | Deletes the file or directory recursively if it exists.
@param path
@return
@throws IOException | [
"Deletes",
"the",
"file",
"or",
"directory",
"recursively",
"if",
"it",
"exists",
"."
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-common/src/main/java/com/datumbox/framework/common/storage/abstracts/AbstractFileStorageEngine.java#L75-L96 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.