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 |
|---|---|---|---|---|---|---|---|---|---|---|
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Interval.java | Interval.withStartTime | public Interval withStartTime(LocalTime time) {
"""
Returns a new interval based on this interval but with a different start
time.
@param time the new start time
@return a new interval
"""
requireNonNull(time);
return new Interval(startDate, time, endDate, endTime, zoneId);
} | java | public Interval withStartTime(LocalTime time) {
requireNonNull(time);
return new Interval(startDate, time, endDate, endTime, zoneId);
} | [
"public",
"Interval",
"withStartTime",
"(",
"LocalTime",
"time",
")",
"{",
"requireNonNull",
"(",
"time",
")",
";",
"return",
"new",
"Interval",
"(",
"startDate",
",",
"time",
",",
"endDate",
",",
"endTime",
",",
"zoneId",
")",
";",
"}"
] | Returns a new interval based on this interval but with a different start
time.
@param time the new start time
@return a new interval | [
"Returns",
"a",
"new",
"interval",
"based",
"on",
"this",
"interval",
"but",
"with",
"a",
"different",
"start",
"time",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Interval.java#L343-L346 |
jankotek/mapdb | src/main/java/org/mapdb/io/DataIO.java | DataIO.packLong | static public void packLong(OutputStream out, long value) throws IOException {
"""
Pack long into output.
It will occupy 1-10 bytes depending on value (lower values occupy smaller space)
@param out OutputStream to put value into
@param value to be serialized, must be non-negative
@throws java.io.IOExceptio... | java | static public void packLong(OutputStream out, long value) throws IOException {
//$DELAY$
int shift = 63-Long.numberOfLeadingZeros(value);
shift -= shift%7; // round down to nearest multiple of 7
while(shift!=0){
out.write((int) ((value>>>shift) & 0x7F));
//$DELAY$... | [
"static",
"public",
"void",
"packLong",
"(",
"OutputStream",
"out",
",",
"long",
"value",
")",
"throws",
"IOException",
"{",
"//$DELAY$",
"int",
"shift",
"=",
"63",
"-",
"Long",
".",
"numberOfLeadingZeros",
"(",
"value",
")",
";",
"shift",
"-=",
"shift",
"... | Pack long into output.
It will occupy 1-10 bytes depending on value (lower values occupy smaller space)
@param out OutputStream to put value into
@param value to be serialized, must be non-negative
@throws java.io.IOException in case of IO error | [
"Pack",
"long",
"into",
"output",
".",
"It",
"will",
"occupy",
"1",
"-",
"10",
"bytes",
"depending",
"on",
"value",
"(",
"lower",
"values",
"occupy",
"smaller",
"space",
")"
] | train | https://github.com/jankotek/mapdb/blob/dfd873b2b9cc4e299228839c100adf93a98f1903/src/main/java/org/mapdb/io/DataIO.java#L133-L143 |
google/closure-templates | java/src/com/google/template/soy/shared/SoyAstCache.java | SoyAstCache.put | public synchronized void put(String fileName, VersionedFile versionedFile) {
"""
Stores a cached version of the AST.
<p>Please treat this as superpackage-private for Soy internals.
@param fileName The name of the file.
@param versionedFile The compiled AST at the particular version. The node is defensively
... | java | public synchronized void put(String fileName, VersionedFile versionedFile) {
cache.put(fileName, versionedFile.copy());
} | [
"public",
"synchronized",
"void",
"put",
"(",
"String",
"fileName",
",",
"VersionedFile",
"versionedFile",
")",
"{",
"cache",
".",
"put",
"(",
"fileName",
",",
"versionedFile",
".",
"copy",
"(",
")",
")",
";",
"}"
] | Stores a cached version of the AST.
<p>Please treat this as superpackage-private for Soy internals.
@param fileName The name of the file.
@param versionedFile The compiled AST at the particular version. The node is defensively
copied; the caller is free to modify it. | [
"Stores",
"a",
"cached",
"version",
"of",
"the",
"AST",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/shared/SoyAstCache.java#L80-L82 |
stephanenicolas/robospice | robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java | SpiceManager.addListenerIfPending | public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) {
"""
Add listener to a pending request if it exists. If no such request
exists, this method calls onRequestNotFound on the listener. If a request
identified by clazz and requ... | java | public <T> void addListenerIfPending(final Class<T> clazz, final Object requestCacheKey, final PendingRequestListener<T> requestListener) {
addListenerIfPending(clazz, requestCacheKey, (RequestListener<T>) requestListener);
} | [
"public",
"<",
"T",
">",
"void",
"addListenerIfPending",
"(",
"final",
"Class",
"<",
"T",
">",
"clazz",
",",
"final",
"Object",
"requestCacheKey",
",",
"final",
"PendingRequestListener",
"<",
"T",
">",
"requestListener",
")",
"{",
"addListenerIfPending",
"(",
... | Add listener to a pending request if it exists. If no such request
exists, this method calls onRequestNotFound on the listener. If a request
identified by clazz and requestCacheKey, it will receive an additional
listener.
@param clazz
the class of the result of the pending request to look for.
@param requestCacheKey
th... | [
"Add",
"listener",
"to",
"a",
"pending",
"request",
"if",
"it",
"exists",
".",
"If",
"no",
"such",
"request",
"exists",
"this",
"method",
"calls",
"onRequestNotFound",
"on",
"the",
"listener",
".",
"If",
"a",
"request",
"identified",
"by",
"clazz",
"and",
... | train | https://github.com/stephanenicolas/robospice/blob/8bffde88b3534a961a13cab72a8f07a755f0a0fe/robospice-core-parent/robospice/src/main/java/com/octo/android/robospice/SpiceManager.java#L429-L431 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonthDay.java | YearMonthDay.withDayOfMonth | public YearMonthDay withDayOfMonth(int dayOfMonth) {
"""
Returns a copy of this date with the day of month field updated.
<p>
YearMonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
day of month changed.
@param dayOfMonth the day of month to set... | java | public YearMonthDay withDayOfMonth(int dayOfMonth) {
int[] newValues = getValues();
newValues = getChronology().dayOfMonth().set(this, DAY_OF_MONTH, newValues, dayOfMonth);
return new YearMonthDay(this, newValues);
} | [
"public",
"YearMonthDay",
"withDayOfMonth",
"(",
"int",
"dayOfMonth",
")",
"{",
"int",
"[",
"]",
"newValues",
"=",
"getValues",
"(",
")",
";",
"newValues",
"=",
"getChronology",
"(",
")",
".",
"dayOfMonth",
"(",
")",
".",
"set",
"(",
"this",
",",
"DAY_OF... | Returns a copy of this date with the day of month field updated.
<p>
YearMonthDay is immutable, so there are no set methods.
Instead, this method returns a new instance with the value of
day of month changed.
@param dayOfMonth the day of month to set
@return a copy of this object with the field set
@throws IllegalArg... | [
"Returns",
"a",
"copy",
"of",
"this",
"date",
"with",
"the",
"day",
"of",
"month",
"field",
"updated",
".",
"<p",
">",
"YearMonthDay",
"is",
"immutable",
"so",
"there",
"are",
"no",
"set",
"methods",
".",
"Instead",
"this",
"method",
"returns",
"a",
"new... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonthDay.java#L878-L882 |
nwillc/almost-functional | src/main/java/almost/functional/Stream.java | Stream.reduce | public <R> R reduce(final R initial, final BiFunction<R, ? super T, R> accumulator) {
"""
Performs a reduction on the elements of this stream, using the provided initial value and accumulation functions.
@param initial the initial value
@param accumulator the acummulation function
@param <R> retur... | java | public <R> R reduce(final R initial, final BiFunction<R, ? super T, R> accumulator) {
R returnValue = initial;
while (iterator.hasNext()) {
returnValue = accumulator.apply(returnValue, iterator.next());
}
return returnValue;
} | [
"public",
"<",
"R",
">",
"R",
"reduce",
"(",
"final",
"R",
"initial",
",",
"final",
"BiFunction",
"<",
"R",
",",
"?",
"super",
"T",
",",
"R",
">",
"accumulator",
")",
"{",
"R",
"returnValue",
"=",
"initial",
";",
"while",
"(",
"iterator",
".",
"has... | Performs a reduction on the elements of this stream, using the provided initial value and accumulation functions.
@param initial the initial value
@param accumulator the acummulation function
@param <R> return type
@return the result of the reduction | [
"Performs",
"a",
"reduction",
"on",
"the",
"elements",
"of",
"this",
"stream",
"using",
"the",
"provided",
"initial",
"value",
"and",
"accumulation",
"functions",
"."
] | train | https://github.com/nwillc/almost-functional/blob/a6cc7c73b2be475ed1bce5128c24b2eb9c27d666/src/main/java/almost/functional/Stream.java#L117-L123 |
jamesagnew/hapi-fhir | hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StopWatch.java | StopWatch.getThroughput | public double getThroughput(int theNumOperations, TimeUnit theUnit) {
"""
Determine the current throughput per unit of time (specified in theUnit)
assuming that theNumOperations operations have happened.
<p>
For example, if this stopwatch has 2 seconds elapsed, and this method is
called for theNumOperations=30... | java | public double getThroughput(int theNumOperations, TimeUnit theUnit) {
if (theNumOperations <= 0) {
return 0.0f;
}
long millisElapsed = Math.max(1, getMillis());
long periodMillis = theUnit.toMillis(1);
double numerator = theNumOperations;
double denominator = ((double) millisElapsed) / ((double) period... | [
"public",
"double",
"getThroughput",
"(",
"int",
"theNumOperations",
",",
"TimeUnit",
"theUnit",
")",
"{",
"if",
"(",
"theNumOperations",
"<=",
"0",
")",
"{",
"return",
"0.0f",
";",
"}",
"long",
"millisElapsed",
"=",
"Math",
".",
"max",
"(",
"1",
",",
"g... | Determine the current throughput per unit of time (specified in theUnit)
assuming that theNumOperations operations have happened.
<p>
For example, if this stopwatch has 2 seconds elapsed, and this method is
called for theNumOperations=30 and TimeUnit=SECONDS,
this method will return 15
</p>
@see #formatThroughput(int,... | [
"Determine",
"the",
"current",
"throughput",
"per",
"unit",
"of",
"time",
"(",
"specified",
"in",
"theUnit",
")",
"assuming",
"that",
"theNumOperations",
"operations",
"have",
"happened",
".",
"<p",
">",
"For",
"example",
"if",
"this",
"stopwatch",
"has",
"2",... | train | https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/util/StopWatch.java#L224-L236 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPreferences.java | CmsPreferences.buildSelectSite | public String buildSelectSite(String htmlAttributes) {
"""
Builds the html for the workplace start site select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace start site select box
"""
SelectOptions selectOptions = getSiteSelect... | java | public String buildSelectSite(String htmlAttributes) {
SelectOptions selectOptions = getSiteSelectOptions();
return buildSelect(htmlAttributes, selectOptions);
} | [
"public",
"String",
"buildSelectSite",
"(",
"String",
"htmlAttributes",
")",
"{",
"SelectOptions",
"selectOptions",
"=",
"getSiteSelectOptions",
"(",
")",
";",
"return",
"buildSelect",
"(",
"htmlAttributes",
",",
"selectOptions",
")",
";",
"}"
] | Builds the html for the workplace start site select box.<p>
@param htmlAttributes optional html attributes for the &lgt;select> tag
@return the html for the workplace start site select box | [
"Builds",
"the",
"html",
"for",
"the",
"workplace",
"start",
"site",
"select",
"box",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPreferences.java#L848-L853 |
alkacon/opencms-core | src-gwt/org/opencms/gwt/client/property/CmsPropertySubmitHandler.java | CmsPropertySubmitHandler.getReloadMode | private CmsReloadMode getReloadMode(Map<String, String> fieldValues, Set<String> editedFields) {
"""
Returns the reload mode to use for the given changes.<p>
@param fieldValues the field values
@param editedFields the set of edited fields
@return the reload mode
"""
for (String fieldName : edit... | java | private CmsReloadMode getReloadMode(Map<String, String> fieldValues, Set<String> editedFields) {
for (String fieldName : editedFields) {
if (checkContains(fieldName, CmsClientProperty.PROPERTY_DEFAULTFILE, CmsClientProperty.PROPERTY_NAVPOS)) {
return CmsReloadMode.reloadParent;
... | [
"private",
"CmsReloadMode",
"getReloadMode",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"fieldValues",
",",
"Set",
"<",
"String",
">",
"editedFields",
")",
"{",
"for",
"(",
"String",
"fieldName",
":",
"editedFields",
")",
"{",
"if",
"(",
"checkContains",... | Returns the reload mode to use for the given changes.<p>
@param fieldValues the field values
@param editedFields the set of edited fields
@return the reload mode | [
"Returns",
"the",
"reload",
"mode",
"to",
"use",
"for",
"the",
"given",
"changes",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/property/CmsPropertySubmitHandler.java#L200-L209 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java | ZipUtil.getZipOutputStream | private static ZipOutputStream getZipOutputStream(File zipFile, Charset charset) {
"""
获得 {@link ZipOutputStream}
@param zipFile 压缩文件
@param charset 编码
@return {@link ZipOutputStream}
"""
return getZipOutputStream(FileUtil.getOutputStream(zipFile), charset);
} | java | private static ZipOutputStream getZipOutputStream(File zipFile, Charset charset) {
return getZipOutputStream(FileUtil.getOutputStream(zipFile), charset);
} | [
"private",
"static",
"ZipOutputStream",
"getZipOutputStream",
"(",
"File",
"zipFile",
",",
"Charset",
"charset",
")",
"{",
"return",
"getZipOutputStream",
"(",
"FileUtil",
".",
"getOutputStream",
"(",
"zipFile",
")",
",",
"charset",
")",
";",
"}"
] | 获得 {@link ZipOutputStream}
@param zipFile 压缩文件
@param charset 编码
@return {@link ZipOutputStream} | [
"获得",
"{",
"@link",
"ZipOutputStream",
"}"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/ZipUtil.java#L746-L748 |
finmath/finmath-lib | src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java | DiscountCurveInterpolation.createDiscountCurveFromZeroRates | public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(
String name, Date referenceDate,
double[] times, double[] givenZeroRates, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
"""
Creat... | java | public static DiscountCurveInterpolation createDiscountCurveFromZeroRates(
String name, Date referenceDate,
double[] times, double[] givenZeroRates, boolean[] isParameter,
InterpolationMethod interpolationMethod, ExtrapolationMethod extrapolationMethod, InterpolationEntity interpolationEntity) {
return crea... | [
"public",
"static",
"DiscountCurveInterpolation",
"createDiscountCurveFromZeroRates",
"(",
"String",
"name",
",",
"Date",
"referenceDate",
",",
"double",
"[",
"]",
"times",
",",
"double",
"[",
"]",
"givenZeroRates",
",",
"boolean",
"[",
"]",
"isParameter",
",",
"I... | Create a discount curve from given times and given zero rates using given interpolation and extrapolation methods.
The discount factor is determined by
<code>
givenDiscountFactors[timeIndex] = Math.exp(- givenZeroRates[timeIndex] * times[timeIndex]);
</code>
@param name The name of this discount curve.
@param referenc... | [
"Create",
"a",
"discount",
"curve",
"from",
"given",
"times",
"and",
"given",
"zero",
"rates",
"using",
"given",
"interpolation",
"and",
"extrapolation",
"methods",
".",
"The",
"discount",
"factor",
"is",
"determined",
"by",
"<code",
">",
"givenDiscountFactors",
... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/marketdata/model/curves/DiscountCurveInterpolation.java#L214-L220 |
Azure/azure-sdk-for-java | datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java | StorageAccountsInner.addAsync | public Observable<Void> addAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) {
"""
Updates the specified Data Lake Analytics account to add an Azure Storage account.
@param resourceGroupName The name of the Azure resource group.
@param accoun... | java | public Observable<Void> addAsync(String resourceGroupName, String accountName, String storageAccountName, AddStorageAccountParameters parameters) {
return addWithServiceResponseAsync(resourceGroupName, accountName, storageAccountName, parameters).map(new Func1<ServiceResponse<Void>, Void>() {
@Overr... | [
"public",
"Observable",
"<",
"Void",
">",
"addAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
",",
"String",
"storageAccountName",
",",
"AddStorageAccountParameters",
"parameters",
")",
"{",
"return",
"addWithServiceResponseAsync",
"(",
"resour... | Updates the specified Data Lake Analytics account to add an Azure Storage account.
@param resourceGroupName The name of the Azure resource group.
@param accountName The name of the Data Lake Analytics account.
@param storageAccountName The name of the Azure Storage account to add
@param parameters The parameters conta... | [
"Updates",
"the",
"specified",
"Data",
"Lake",
"Analytics",
"account",
"to",
"add",
"an",
"Azure",
"Storage",
"account",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/datalakeanalytics/resource-manager/v2016_11_01/src/main/java/com/microsoft/azure/management/datalakeanalytics/v2016_11_01/implementation/StorageAccountsInner.java#L429-L436 |
OpenLiberty/open-liberty | dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/DropinMonitor.java | DropinMonitor.getAppMessageHelper | private AppMessageHelper getAppMessageHelper(String type, String fileName) {
"""
Returns the message helper for the specified application handler type.
@param type application handler type
@param fileName file name from which type can be inferred if not specified
@return the message helper for the specified a... | java | private AppMessageHelper getAppMessageHelper(String type, String fileName) {
if (type == null && fileName != null) {
String[] parts = fileName.split("[\\\\/]");
if (parts.length > 0) {
String last = parts[parts.length - 1];
int dot = last.indexOf('.');
... | [
"private",
"AppMessageHelper",
"getAppMessageHelper",
"(",
"String",
"type",
",",
"String",
"fileName",
")",
"{",
"if",
"(",
"type",
"==",
"null",
"&&",
"fileName",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"parts",
"=",
"fileName",
".",
"split",
"(",
... | Returns the message helper for the specified application handler type.
@param type application handler type
@param fileName file name from which type can be inferred if not specified
@return the message helper for the specified application handler type. | [
"Returns",
"the",
"message",
"helper",
"for",
"the",
"specified",
"application",
"handler",
"type",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.app.manager/src/com/ibm/ws/app/manager/internal/monitor/DropinMonitor.java#L354-L381 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java | CPDefinitionPersistenceImpl.findByCPTaxCategoryId | @Override
public List<CPDefinition> findByCPTaxCategoryId(long CPTaxCategoryId,
int start, int end) {
"""
Returns a range of all the cp definitions where CPTaxCategoryId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</co... | java | @Override
public List<CPDefinition> findByCPTaxCategoryId(long CPTaxCategoryId,
int start, int end) {
return findByCPTaxCategoryId(CPTaxCategoryId, start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPDefinition",
">",
"findByCPTaxCategoryId",
"(",
"long",
"CPTaxCategoryId",
",",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findByCPTaxCategoryId",
"(",
"CPTaxCategoryId",
",",
"start",
",",
"end",
",",
"n... | Returns a range of all the cp definitions where CPTaxCategoryId = ?.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the ... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"cp",
"definitions",
"where",
"CPTaxCategoryId",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPDefinitionPersistenceImpl.java#L2537-L2541 |
strator-dev/greenpepper | greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/AbstractJarMojo.java | AbstractJarMojo.createArchive | public File createArchive()
throws MojoExecutionException {
"""
Generates the JAR.
@return a {@link java.io.File} object.
@throws org.apache.maven.plugin.MojoExecutionException if any.
"""
File jarFile = getJarFile( outputDirectory, finalName, getClassifier() );
MavenArchiver archi... | java | public File createArchive()
throws MojoExecutionException
{
File jarFile = getJarFile( outputDirectory, finalName, getClassifier() );
MavenArchiver archiver = new MavenArchiver();
archiver.setArchiver( jarArchiver );
archiver.setOutputFile( jarFile );
archive.setF... | [
"public",
"File",
"createArchive",
"(",
")",
"throws",
"MojoExecutionException",
"{",
"File",
"jarFile",
"=",
"getJarFile",
"(",
"outputDirectory",
",",
"finalName",
",",
"getClassifier",
"(",
")",
")",
";",
"MavenArchiver",
"archiver",
"=",
"new",
"MavenArchiver"... | Generates the JAR.
@return a {@link java.io.File} object.
@throws org.apache.maven.plugin.MojoExecutionException if any. | [
"Generates",
"the",
"JAR",
"."
] | train | https://github.com/strator-dev/greenpepper/blob/2a61e6c179b74085babcc559d677490b0cad2d30/greenpepper-maven-plugin/src/main/java/com/greenpepper/maven/AbstractJarMojo.java#L158-L191 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/lss/LssClient.java | LssClient.createNotification | public CreateNotificationResponse createNotification(CreateNotificationRequest request) {
"""
Create a live notification in the live stream service.
@param request The request object containing all options for creating live notification.
@return the response
"""
checkNotNull(request, "The parameter... | java | public CreateNotificationResponse createNotification(CreateNotificationRequest request) {
checkNotNull(request, "The parameter request should NOT be null.");
checkStringNotEmpty(request.getName(),
"The parameter name should NOT be null or empty string.");
checkStringNotEmpty(req... | [
"public",
"CreateNotificationResponse",
"createNotification",
"(",
"CreateNotificationRequest",
"request",
")",
"{",
"checkNotNull",
"(",
"request",
",",
"\"The parameter request should NOT be null.\"",
")",
";",
"checkStringNotEmpty",
"(",
"request",
".",
"getName",
"(",
"... | Create a live notification in the live stream service.
@param request The request object containing all options for creating live notification.
@return the response | [
"Create",
"a",
"live",
"notification",
"in",
"the",
"live",
"stream",
"service",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/lss/LssClient.java#L1226-L1236 |
pravega/pravega | controller/src/main/java/io/pravega/controller/server/rpc/auth/StrongPasswordProcessor.java | StrongPasswordProcessor.encryptPassword | public String encryptPassword(String userPassword) throws NoSuchAlgorithmException, InvalidKeySpecException {
"""
/*
@param userPassword The password to be encrypted.
@return The encrypted string digest.
@throws NoSuchAlgorithmException encryption exceptions.
@throws InvalidKeySpecException encryption exceptio... | java | public String encryptPassword(String userPassword) throws NoSuchAlgorithmException, InvalidKeySpecException {
char[] chars = userPassword.toCharArray();
byte[] salt = getSalt();
PBEKeySpec spec = new PBEKeySpec(chars, salt, iterations, keyLength);
SecretKeyFactory skf = SecretKeyFactory... | [
"public",
"String",
"encryptPassword",
"(",
"String",
"userPassword",
")",
"throws",
"NoSuchAlgorithmException",
",",
"InvalidKeySpecException",
"{",
"char",
"[",
"]",
"chars",
"=",
"userPassword",
".",
"toCharArray",
"(",
")",
";",
"byte",
"[",
"]",
"salt",
"="... | /*
@param userPassword The password to be encrypted.
@return The encrypted string digest.
@throws NoSuchAlgorithmException encryption exceptions.
@throws InvalidKeySpecException encryption exceptions. | [
"/",
"*"
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/controller/src/main/java/io/pravega/controller/server/rpc/auth/StrongPasswordProcessor.java#L81-L89 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/math.java | math.getRandomInteger | public static int getRandomInteger(int min, int max) {
"""
Returns a random integer between MIN inclusive and MAX inclusive.
@param min
value inclusive
@param max
value inclusive
@return an int between MIN inclusive and MAX exclusive.
"""
Random r = new Random();
return r.nextInt(max - min + 1) + ... | java | public static int getRandomInteger(int min, int max) {
Random r = new Random();
return r.nextInt(max - min + 1) + min;
} | [
"public",
"static",
"int",
"getRandomInteger",
"(",
"int",
"min",
",",
"int",
"max",
")",
"{",
"Random",
"r",
"=",
"new",
"Random",
"(",
")",
";",
"return",
"r",
".",
"nextInt",
"(",
"max",
"-",
"min",
"+",
"1",
")",
"+",
"min",
";",
"}"
] | Returns a random integer between MIN inclusive and MAX inclusive.
@param min
value inclusive
@param max
value inclusive
@return an int between MIN inclusive and MAX exclusive. | [
"Returns",
"a",
"random",
"integer",
"between",
"MIN",
"inclusive",
"and",
"MAX",
"inclusive",
"."
] | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/math.java#L98-L101 |
aws/aws-sdk-java | aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/StartRestoreJobRequest.java | StartRestoreJobRequest.withMetadata | public StartRestoreJobRequest withMetadata(java.util.Map<String, String> metadata) {
"""
<p>
A set of metadata key-value pairs. Lists the metadata that the recovery point was created with.
</p>
@param metadata
A set of metadata key-value pairs. Lists the metadata that the recovery point was created with.
@r... | java | public StartRestoreJobRequest withMetadata(java.util.Map<String, String> metadata) {
setMetadata(metadata);
return this;
} | [
"public",
"StartRestoreJobRequest",
"withMetadata",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"metadata",
")",
"{",
"setMetadata",
"(",
"metadata",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A set of metadata key-value pairs. Lists the metadata that the recovery point was created with.
</p>
@param metadata
A set of metadata key-value pairs. Lists the metadata that the recovery point was created with.
@return Returns a reference to this object so that method calls can be chained together. | [
"<p",
">",
"A",
"set",
"of",
"metadata",
"key",
"-",
"value",
"pairs",
".",
"Lists",
"the",
"metadata",
"that",
"the",
"recovery",
"point",
"was",
"created",
"with",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-backup/src/main/java/com/amazonaws/services/backup/model/StartRestoreJobRequest.java#L173-L176 |
knowm/XChange | xchange-campbx/src/main/java/org/knowm/xchange/campbx/CampBXAdapters.java | CampBXAdapters.adaptTicker | public static Ticker adaptTicker(CampBXTicker campbxTicker, CurrencyPair currencyPair) {
"""
Adapts a CampBXTicker to a Ticker Object
@param campbxTicker
@param currencyPair (e.g. BTC/USD)
@return
"""
BigDecimal last = campbxTicker.getLast();
BigDecimal bid = campbxTicker.getBid();
BigDecimal... | java | public static Ticker adaptTicker(CampBXTicker campbxTicker, CurrencyPair currencyPair) {
BigDecimal last = campbxTicker.getLast();
BigDecimal bid = campbxTicker.getBid();
BigDecimal ask = campbxTicker.getAsk();
return new Ticker.Builder().currencyPair(currencyPair).last(last).bid(bid).ask(ask).build()... | [
"public",
"static",
"Ticker",
"adaptTicker",
"(",
"CampBXTicker",
"campbxTicker",
",",
"CurrencyPair",
"currencyPair",
")",
"{",
"BigDecimal",
"last",
"=",
"campbxTicker",
".",
"getLast",
"(",
")",
";",
"BigDecimal",
"bid",
"=",
"campbxTicker",
".",
"getBid",
"(... | Adapts a CampBXTicker to a Ticker Object
@param campbxTicker
@param currencyPair (e.g. BTC/USD)
@return | [
"Adapts",
"a",
"CampBXTicker",
"to",
"a",
"Ticker",
"Object"
] | train | https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-campbx/src/main/java/org/knowm/xchange/campbx/CampBXAdapters.java#L65-L72 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/broker/DefaultBrokerCache.java | DefaultBrokerCache.getAutoScoped | @SuppressWarnings(value = "unchecked")
<T, K extends SharedResourceKey> T getAutoScoped(final SharedResourceFactory<T, K, S> factory, final K key,
final SharedResourcesBrokerImpl<S> broker)
throws ExecutionException {
"""
Get an object for the specified factory, key, and broker at the scope selected ... | java | @SuppressWarnings(value = "unchecked")
<T, K extends SharedResourceKey> T getAutoScoped(final SharedResourceFactory<T, K, S> factory, final K key,
final SharedResourcesBrokerImpl<S> broker)
throws ExecutionException {
// figure out auto scope
RawJobBrokerKey autoscopeCacheKey = new RawJobBrokerKe... | [
"@",
"SuppressWarnings",
"(",
"value",
"=",
"\"unchecked\"",
")",
"<",
"T",
",",
"K",
"extends",
"SharedResourceKey",
">",
"T",
"getAutoScoped",
"(",
"final",
"SharedResourceFactory",
"<",
"T",
",",
"K",
",",
"S",
">",
"factory",
",",
"final",
"K",
"key",
... | Get an object for the specified factory, key, and broker at the scope selected by the factory. {@link DefaultBrokerCache}
guarantees that calling this method from brokers with the same leaf scope will return the same object. | [
"Get",
"an",
"object",
"for",
"the",
"specified",
"factory",
"key",
"and",
"broker",
"at",
"the",
"scope",
"selected",
"by",
"the",
"factory",
".",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/broker/DefaultBrokerCache.java#L87-L103 |
Indoqa/indoqa-boot | src/main/java/com/indoqa/boot/resources/error/RestResourceErrorMapper.java | RestResourceErrorMapper.registerException | public void registerException(Class<? extends Exception> exceptionType, Function<Exception, RestResourceErrorInfo> errorProvider) {
"""
Map from an exception type to a {@link RestResourceErrorInfo}. The list is sorted in the way that more specific exceptions
will match first.
@param exceptionType The exception... | java | public void registerException(Class<? extends Exception> exceptionType, Function<Exception, RestResourceErrorInfo> errorProvider) {
Pair<Class<? extends Exception>, Function<Exception, RestResourceErrorInfo>> currentMapping = Pair.of(exceptionType,
errorProvider
);
Pair<Class<? exte... | [
"public",
"void",
"registerException",
"(",
"Class",
"<",
"?",
"extends",
"Exception",
">",
"exceptionType",
",",
"Function",
"<",
"Exception",
",",
"RestResourceErrorInfo",
">",
"errorProvider",
")",
"{",
"Pair",
"<",
"Class",
"<",
"?",
"extends",
"Exception",
... | Map from an exception type to a {@link RestResourceErrorInfo}. The list is sorted in the way that more specific exceptions
will match first.
@param exceptionType The exception to be checked.
@param errorProvider The function that should be applied with an exception. | [
"Map",
"from",
"an",
"exception",
"type",
"to",
"a",
"{",
"@link",
"RestResourceErrorInfo",
"}",
".",
"The",
"list",
"is",
"sorted",
"in",
"the",
"way",
"that",
"more",
"specific",
"exceptions",
"will",
"match",
"first",
"."
] | train | https://github.com/Indoqa/indoqa-boot/blob/a4c6a6517308f5fc6f1eb4e4f5b9994122c268e6/src/main/java/com/indoqa/boot/resources/error/RestResourceErrorMapper.java#L73-L106 |
EsotericSoftware/kryo | src/com/esotericsoftware/kryo/io/Input.java | Input.readString | public String readString () {
"""
Reads the length and string of UTF8 characters, or null. This can read strings written by
{@link Output#writeString(String)} and {@link Output#writeAscii(String)}.
@return May be null.
"""
if (!readVarIntFlag()) return readAsciiString(); // ASCII.
// Null, empty, or UT... | java | public String readString () {
if (!readVarIntFlag()) return readAsciiString(); // ASCII.
// Null, empty, or UTF8.
int charCount = readVarIntFlag(true);
switch (charCount) {
case 0:
return null;
case 1:
return "";
}
charCount--;
readUtf8Chars(charCount);
return new String(chars, 0, ... | [
"public",
"String",
"readString",
"(",
")",
"{",
"if",
"(",
"!",
"readVarIntFlag",
"(",
")",
")",
"return",
"readAsciiString",
"(",
")",
";",
"// ASCII.\r",
"// Null, empty, or UTF8.\r",
"int",
"charCount",
"=",
"readVarIntFlag",
"(",
"true",
")",
";",
"switch... | Reads the length and string of UTF8 characters, or null. This can read strings written by
{@link Output#writeString(String)} and {@link Output#writeAscii(String)}.
@return May be null. | [
"Reads",
"the",
"length",
"and",
"string",
"of",
"UTF8",
"characters",
"or",
"null",
".",
"This",
"can",
"read",
"strings",
"written",
"by",
"{"
] | train | https://github.com/EsotericSoftware/kryo/blob/a8be1ab26f347f299a3c3f7171d6447dd5390845/src/com/esotericsoftware/kryo/io/Input.java#L774-L787 |
UrielCh/ovh-java-sdk | ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java | ApiOvhIp.ip_firewall_POST | public OvhFirewallIp ip_firewall_POST(String ip, String ipOnFirewall) throws IOException {
"""
AntiDDOS option. Add new IP on firewall
REST: POST /ip/{ip}/firewall
@param ipOnFirewall [required]
@param ip [required]
"""
String qPath = "/ip/{ip}/firewall";
StringBuilder sb = path(qPath, ip);
HashMap<... | java | public OvhFirewallIp ip_firewall_POST(String ip, String ipOnFirewall) throws IOException {
String qPath = "/ip/{ip}/firewall";
StringBuilder sb = path(qPath, ip);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "ipOnFirewall", ipOnFirewall);
String resp = exec(qPath, "POST", sb.toString()... | [
"public",
"OvhFirewallIp",
"ip_firewall_POST",
"(",
"String",
"ip",
",",
"String",
"ipOnFirewall",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/ip/{ip}/firewall\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
",",
"ip",
")",
";",
"... | AntiDDOS option. Add new IP on firewall
REST: POST /ip/{ip}/firewall
@param ipOnFirewall [required]
@param ip [required] | [
"AntiDDOS",
"option",
".",
"Add",
"new",
"IP",
"on",
"firewall"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-ip/src/main/java/net/minidev/ovh/api/ApiOvhIp.java#L989-L996 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java | ComponentCollision.removePoint | private void removePoint(Point point, Collidable collidable) {
"""
Remove point. Remove list of no more collidable.
@param point The point to remove.
@param collidable The associated collidable.
"""
final Integer group = collidable.getGroup();
if (collidables.containsKey(group))
{
... | java | private void removePoint(Point point, Collidable collidable)
{
final Integer group = collidable.getGroup();
if (collidables.containsKey(group))
{
final Map<Point, Set<Collidable>> elements = collidables.get(group);
if (elements.containsKey(point))
{
... | [
"private",
"void",
"removePoint",
"(",
"Point",
"point",
",",
"Collidable",
"collidable",
")",
"{",
"final",
"Integer",
"group",
"=",
"collidable",
".",
"getGroup",
"(",
")",
";",
"if",
"(",
"collidables",
".",
"containsKey",
"(",
"group",
")",
")",
"{",
... | Remove point. Remove list of no more collidable.
@param point The point to remove.
@param collidable The associated collidable. | [
"Remove",
"point",
".",
"Remove",
"list",
"of",
"no",
"more",
"collidable",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/collidable/ComponentCollision.java#L67-L78 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java | CoverageDataCore.valueToPixelValue | private double valueToPixelValue(GriddedTile griddedTile, double value) {
"""
Convert integer coverage typed coverage data value to a pixel value
through offsets and scales
@param griddedTile
gridded tile
@param value
coverage data value
@return pixel value
"""
double pixelValue = value;
if (grid... | java | private double valueToPixelValue(GriddedTile griddedTile, double value) {
double pixelValue = value;
if (griddedCoverage != null
&& griddedCoverage.getDataType() == GriddedCoverageDataType.INTEGER) {
pixelValue -= griddedCoverage.getOffset();
pixelValue /= griddedCoverage.getScale();
if (griddedTile... | [
"private",
"double",
"valueToPixelValue",
"(",
"GriddedTile",
"griddedTile",
",",
"double",
"value",
")",
"{",
"double",
"pixelValue",
"=",
"value",
";",
"if",
"(",
"griddedCoverage",
"!=",
"null",
"&&",
"griddedCoverage",
".",
"getDataType",
"(",
")",
"==",
"... | Convert integer coverage typed coverage data value to a pixel value
through offsets and scales
@param griddedTile
gridded tile
@param value
coverage data value
@return pixel value | [
"Convert",
"integer",
"coverage",
"typed",
"coverage",
"data",
"value",
"to",
"a",
"pixel",
"value",
"through",
"offsets",
"and",
"scales"
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/coverage/CoverageDataCore.java#L1570-L1587 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/labeled/label/LabeledMultiLineLabelPanel.java | LabeledMultiLineLabelPanel.newMultiLineLabelLabel | protected MultiLineLabel newMultiLineLabelLabel(final String id, final IModel<T> model) {
"""
Factory method for create a new {@link MultiLineLabel}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link MultiLineLabel}.
... | java | protected MultiLineLabel newMultiLineLabelLabel(final String id, final IModel<T> model)
{
final IModel<T> viewableLabelModel = new PropertyModel<>(model.getObject(), this.getId());
return ComponentFactory.newMultiLineLabel(id, viewableLabelModel);
} | [
"protected",
"MultiLineLabel",
"newMultiLineLabelLabel",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"T",
">",
"model",
")",
"{",
"final",
"IModel",
"<",
"T",
">",
"viewableLabelModel",
"=",
"new",
"PropertyModel",
"<>",
"(",
"model",
".",
"ge... | Factory method for create a new {@link MultiLineLabel}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link MultiLineLabel}.
@param id
the id
@param model
the model
@return the new {@link MultiLineLabel} | [
"Factory",
"method",
"for",
"create",
"a",
"new",
"{",
"@link",
"MultiLineLabel",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"provide",... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/labeled/label/LabeledMultiLineLabelPanel.java#L96-L100 |
yanzhenjie/AndServer | api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java | StandardMultipartResolver.parseRequest | private MultipartParsingResult parseRequest(HttpRequest request) throws MultipartException {
"""
Parse the given request, resolving its multipart elements.
@param request the request to parse.
@return the parsing result.
@throws MultipartException if multipart resolution failed.
"""
String enc... | java | private MultipartParsingResult parseRequest(HttpRequest request) throws MultipartException {
String encoding = determineEncoding(request);
FileUpload fileUpload = prepareFileUpload(encoding);
try {
RequestBody body = request.getBody();
Assert.notNull(body, "The body canno... | [
"private",
"MultipartParsingResult",
"parseRequest",
"(",
"HttpRequest",
"request",
")",
"throws",
"MultipartException",
"{",
"String",
"encoding",
"=",
"determineEncoding",
"(",
"request",
")",
";",
"FileUpload",
"fileUpload",
"=",
"prepareFileUpload",
"(",
"encoding",... | Parse the given request, resolving its multipart elements.
@param request the request to parse.
@return the parsing result.
@throws MultipartException if multipart resolution failed. | [
"Parse",
"the",
"given",
"request",
"resolving",
"its",
"multipart",
"elements",
"."
] | train | https://github.com/yanzhenjie/AndServer/blob/f95f316cdfa5755d6a3fec3c6a1b5df783b81517/api/src/main/java/com/yanzhenjie/andserver/http/multipart/StandardMultipartResolver.java#L152-L167 |
jbundle/jbundle | thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java | BaseApplet.initTask | public void initTask(App application, Map<String, Object> properties) {
"""
If this task object was created from a class name, call init(xxx) for the task.
You may want to put logic in here that checks to make sure this object was not already inited.
Typically, you init a Task object and pass it to the job sched... | java | public void initTask(App application, Map<String, Object> properties)
{
if (m_application != null)
return; // No, already inited!
m_application = (Application)application;
if (properties != null)
{
if (m_properties != null)
m_properties.put... | [
"public",
"void",
"initTask",
"(",
"App",
"application",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"properties",
")",
"{",
"if",
"(",
"m_application",
"!=",
"null",
")",
"return",
";",
"// No, already inited!",
"m_application",
"=",
"(",
"Application",
... | If this task object was created from a class name, call init(xxx) for the task.
You may want to put logic in here that checks to make sure this object was not already inited.
Typically, you init a Task object and pass it to the job scheduler. The job scheduler
will check to see if this task is owned by an application..... | [
"If",
"this",
"task",
"object",
"was",
"created",
"from",
"a",
"class",
"name",
"call",
"init",
"(",
"xxx",
")",
"for",
"the",
"task",
".",
"You",
"may",
"want",
"to",
"put",
"logic",
"in",
"here",
"that",
"checks",
"to",
"make",
"sure",
"this",
"obj... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/BaseApplet.java#L1198-L1211 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/repository/jdbc/util/JdbcUtil.java | JdbcUtil.executeSql | public static boolean executeSql(final String sql, final List<Object> paramList, final Connection connection, final boolean isDebug) throws SQLException {
"""
Executes the specified SQL with the specified params and connection...
@param sql the specified SQL
@param paramList the specified params
@para... | java | public static boolean executeSql(final String sql, final List<Object> paramList, final Connection connection, final boolean isDebug) throws SQLException {
if (isDebug || LOGGER.isTraceEnabled()) {
LOGGER.log(Level.INFO, "Executing SQL [" + sql + "]");
}
final PreparedStatement prepa... | [
"public",
"static",
"boolean",
"executeSql",
"(",
"final",
"String",
"sql",
",",
"final",
"List",
"<",
"Object",
">",
"paramList",
",",
"final",
"Connection",
"connection",
",",
"final",
"boolean",
"isDebug",
")",
"throws",
"SQLException",
"{",
"if",
"(",
"i... | Executes the specified SQL with the specified params and connection...
@param sql the specified SQL
@param paramList the specified params
@param connection the specified connection
@param isDebug the specified debug flag
@return {@code true} if success, returns {@false} otherwise
@throws SQLException SQLExc... | [
"Executes",
"the",
"specified",
"SQL",
"with",
"the",
"specified",
"params",
"and",
"connection",
"..."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/repository/jdbc/util/JdbcUtil.java#L82-L95 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java | ExpressRouteCrossConnectionsInner.listRoutesTableAsync | public Observable<ExpressRouteCircuitsRoutesTableListResultInner> listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
"""
Gets the currently advertised routes table associated with the express route cross connection in a resource group.
@param reso... | java | public Observable<ExpressRouteCircuitsRoutesTableListResultInner> listRoutesTableAsync(String resourceGroupName, String crossConnectionName, String peeringName, String devicePath) {
return listRoutesTableWithServiceResponseAsync(resourceGroupName, crossConnectionName, peeringName, devicePath).map(new Func1<Serv... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitsRoutesTableListResultInner",
">",
"listRoutesTableAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"crossConnectionName",
",",
"String",
"peeringName",
",",
"String",
"devicePath",
")",
"{",
"return",
"listRoutesTa... | Gets the currently advertised routes table associated with the express route cross connection in a resource group.
@param resourceGroupName The name of the resource group.
@param crossConnectionName The name of the ExpressRouteCrossConnection.
@param peeringName The name of the peering.
@param devicePath The path of t... | [
"Gets",
"the",
"currently",
"advertised",
"routes",
"table",
"associated",
"with",
"the",
"express",
"route",
"cross",
"connection",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCrossConnectionsInner.java#L1315-L1322 |
querydsl/querydsl | querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java | BeanPath.createSet | @SuppressWarnings("unchecked")
protected <A, E extends SimpleExpression<? super A>> SetPath<A, E> createSet(String property, Class<? super A> type, Class<? super E> queryType, PathInits inits) {
"""
Create a new Set typed path
@param <A>
@param property property name
@param type property type
@return pro... | java | @SuppressWarnings("unchecked")
protected <A, E extends SimpleExpression<? super A>> SetPath<A, E> createSet(String property, Class<? super A> type, Class<? super E> queryType, PathInits inits) {
return add(new SetPath<A, E>(type, (Class) queryType, forProperty(property), inits));
} | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"protected",
"<",
"A",
",",
"E",
"extends",
"SimpleExpression",
"<",
"?",
"super",
"A",
">",
">",
"SetPath",
"<",
"A",
",",
"E",
">",
"createSet",
"(",
"String",
"property",
",",
"Class",
"<",
"?",
"s... | Create a new Set typed path
@param <A>
@param property property name
@param type property type
@return property path | [
"Create",
"a",
"new",
"Set",
"typed",
"path"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/types/dsl/BeanPath.java#L259-L262 |
mgm-tp/jfunk | jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java | ResourceLoader.getInputStream | public static InputStream getInputStream(final String baseDir, final String resource) throws IOException {
"""
Loads a resource as {@link InputStream}.
@param baseDir
If not {@code null}, the directory relative to which resources are loaded.
@param resource
The resource to be loaded. If {@code baseDir} is no... | java | public static InputStream getInputStream(final String baseDir, final String resource) throws IOException {
return getInputStream(new File(baseDir), resource);
} | [
"public",
"static",
"InputStream",
"getInputStream",
"(",
"final",
"String",
"baseDir",
",",
"final",
"String",
"resource",
")",
"throws",
"IOException",
"{",
"return",
"getInputStream",
"(",
"new",
"File",
"(",
"baseDir",
")",
",",
"resource",
")",
";",
"}"
] | Loads a resource as {@link InputStream}.
@param baseDir
If not {@code null}, the directory relative to which resources are loaded.
@param resource
The resource to be loaded. If {@code baseDir} is not {@code null}, it is loaded
relative to {@code baseDir}.
@return The stream | [
"Loads",
"a",
"resource",
"as",
"{",
"@link",
"InputStream",
"}",
"."
] | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-common/src/main/java/com/mgmtp/jfunk/common/util/ResourceLoader.java#L259-L261 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpx/TaskModel.java | TaskModel.isFieldPopulated | @SuppressWarnings("unchecked") private boolean isFieldPopulated(Task task, TaskField field) {
"""
Determine if a task field contains data.
@param task task instance
@param field target field
@return true if the field contains data
"""
boolean result = false;
if (field != null)
{
... | java | @SuppressWarnings("unchecked") private boolean isFieldPopulated(Task task, TaskField field)
{
boolean result = false;
if (field != null)
{
Object value = task.getCachedValue(field);
switch (field)
{
case PREDECESSORS:
case SUCCESSORS:
{... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"boolean",
"isFieldPopulated",
"(",
"Task",
"task",
",",
"TaskField",
"field",
")",
"{",
"boolean",
"result",
"=",
"false",
";",
"if",
"(",
"field",
"!=",
"null",
")",
"{",
"Object",
"value",
"... | Determine if a task field contains data.
@param task task instance
@param field target field
@return true if the field contains data | [
"Determine",
"if",
"a",
"task",
"field",
"contains",
"data",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpx/TaskModel.java#L175-L198 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/PersianCalendar.java | PersianCalendar.handleComputeMonthStart | @Deprecated
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
"""
Return JD of start of given month/year
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android
"""
// If the month is out of range, adjust it into range,... | java | @Deprecated
protected int handleComputeMonthStart(int eyear, int month, boolean useMonth) {
// If the month is out of range, adjust it into range, and
// modify the extended year value accordingly.
if (month < 0 || month > 11) {
int[] rem = new int[1];
eyear += floorD... | [
"@",
"Deprecated",
"protected",
"int",
"handleComputeMonthStart",
"(",
"int",
"eyear",
",",
"int",
"month",
",",
"boolean",
"useMonth",
")",
"{",
"// If the month is out of range, adjust it into range, and",
"// modify the extended year value accordingly.",
"if",
"(",
"month"... | Return JD of start of given month/year
@deprecated This API is ICU internal only.
@hide draft / provisional / internal are hidden on Android | [
"Return",
"JD",
"of",
"start",
"of",
"given",
"month",
"/",
"year"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/util/PersianCalendar.java#L367-L382 |
javers/javers | javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java | QueryBuilder.byValueObjectId | public static QueryBuilder byValueObjectId(Object ownerLocalId, Class ownerEntityClass, String path) {
"""
Query for selecting changes (or snapshots) made on a concrete ValueObject
(so a ValueObject owned by a concrete Entity instance).
<br/><br/>
<b>Path parameter</b> is a relative path from owning Entity in... | java | public static QueryBuilder byValueObjectId(Object ownerLocalId, Class ownerEntityClass, String path){
Validate.argumentsAreNotNull(ownerEntityClass, ownerLocalId, path);
return new QueryBuilder(new IdFilterDefinition(ValueObjectIdDTO.valueObjectId(ownerLocalId, ownerEntityClass, path)));
} | [
"public",
"static",
"QueryBuilder",
"byValueObjectId",
"(",
"Object",
"ownerLocalId",
",",
"Class",
"ownerEntityClass",
",",
"String",
"path",
")",
"{",
"Validate",
".",
"argumentsAreNotNull",
"(",
"ownerEntityClass",
",",
"ownerLocalId",
",",
"path",
")",
";",
"r... | Query for selecting changes (or snapshots) made on a concrete ValueObject
(so a ValueObject owned by a concrete Entity instance).
<br/><br/>
<b>Path parameter</b> is a relative path from owning Entity instance to ValueObject that you are looking for.
<br/><br/>
When ValueObject is just <b>a property</b>, use property... | [
"Query",
"for",
"selecting",
"changes",
"(",
"or",
"snapshots",
")",
"made",
"on",
"a",
"concrete",
"ValueObject",
"(",
"so",
"a",
"ValueObject",
"owned",
"by",
"a",
"concrete",
"Entity",
"instance",
")",
".",
"<br",
"/",
">",
"<br",
"/",
">"
] | train | https://github.com/javers/javers/blob/a51511be7d8bcee3e1812db8b7e69a45330b4e14/javers-core/src/main/java/org/javers/repository/jql/QueryBuilder.java#L174-L177 |
attribyte/wpdb | src/main/java/org/attribyte/wp/db/DB.java | DB.updatePostTitle | public boolean updatePostTitle(long postId, final String title) throws SQLException {
"""
Updates the title for a post.
@param postId The post to update.
@param title The new title.
@return Was the post modified?
@throws SQLException on database error or missing post id.
"""
Connection conn = null;
... | java | public boolean updatePostTitle(long postId, final String title) throws SQLException {
Connection conn = null;
PreparedStatement stmt = null;
Timer.Context ctx = metrics.updatePostTimer.time();
try {
conn = connectionSupplier.getConnection();
stmt = conn.prepareStatement(updateP... | [
"public",
"boolean",
"updatePostTitle",
"(",
"long",
"postId",
",",
"final",
"String",
"title",
")",
"throws",
"SQLException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"PreparedStatement",
"stmt",
"=",
"null",
";",
"Timer",
".",
"Context",
"ctx",
"=",
"m... | Updates the title for a post.
@param postId The post to update.
@param title The new title.
@return Was the post modified?
@throws SQLException on database error or missing post id. | [
"Updates",
"the",
"title",
"for",
"a",
"post",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/db/DB.java#L1575-L1589 |
eFaps/eFaps-Kernel | src/main/java/org/efaps/db/AbstractPrintQuery.java | AbstractPrintQuery.addAttributeSet | public AbstractPrintQuery addAttributeSet(final AttributeSet _set)
throws EFapsException {
"""
Add an AttributeSet to the PrintQuery. It is used to get editable values
from the eFaps DataBase. The AttributeSet is internally transformed into
an linkfrom query.
@param _set AttributeSet to add
@return t... | java | public AbstractPrintQuery addAttributeSet(final AttributeSet _set)
throws EFapsException
{
final String key = "linkfrom[" + _set.getName() + "#" + _set.getAttributeName() + "]";
final OneSelect oneselect = new OneSelect(this, key);
this.allSelects.add(oneselect);
this.attr2On... | [
"public",
"AbstractPrintQuery",
"addAttributeSet",
"(",
"final",
"AttributeSet",
"_set",
")",
"throws",
"EFapsException",
"{",
"final",
"String",
"key",
"=",
"\"linkfrom[\"",
"+",
"_set",
".",
"getName",
"(",
")",
"+",
"\"#\"",
"+",
"_set",
".",
"getAttributeNam... | Add an AttributeSet to the PrintQuery. It is used to get editable values
from the eFaps DataBase. The AttributeSet is internally transformed into
an linkfrom query.
@param _set AttributeSet to add
@return this PrintQuery
@throws EFapsException on error | [
"Add",
"an",
"AttributeSet",
"to",
"the",
"PrintQuery",
".",
"It",
"is",
"used",
"to",
"get",
"editable",
"values",
"from",
"the",
"eFaps",
"DataBase",
".",
"The",
"AttributeSet",
"is",
"internally",
"transformed",
"into",
"an",
"linkfrom",
"query",
"."
] | train | https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/db/AbstractPrintQuery.java#L305-L320 |
arquillian/arquillian-cube | docker/reporter/src/main/java/org/arquillian/cube/docker/impl/client/reporter/TakeDockerEnvironment.java | TakeDockerEnvironment.captureStats | public void captureStats(DockerClientExecutor executor, CubeRegistry cubeRegistry, String when, Boolean decimal) throws IOException {
"""
private TableRowEntry addRowsForNetwork(Map<String, Long> before, Map<String, Long> after, Boolean decimal, String adapter) {
TableRowEntry tableRowEntry = new TableRowEntry(... | java | public void captureStats(DockerClientExecutor executor, CubeRegistry cubeRegistry, String when, Boolean decimal) throws IOException {
/**if (executor != null) {
List<Cube<?>> containers = cubeRegistry.getCubes();
for (Cube<?> container : containers) {
String name = contai... | [
"public",
"void",
"captureStats",
"(",
"DockerClientExecutor",
"executor",
",",
"CubeRegistry",
"cubeRegistry",
",",
"String",
"when",
",",
"Boolean",
"decimal",
")",
"throws",
"IOException",
"{",
"/**if (executor != null) {\n List<Cube<?>> containers = cubeRegistry.... | private TableRowEntry addRowsForNetwork(Map<String, Long> before, Map<String, Long> after, Boolean decimal, String adapter) {
TableRowEntry tableRowEntry = new TableRowEntry();
tableRowEntry.addCell(new TableCellEntry(adapter));
addCells(tableRowEntry, before.get("rx_bytes"), after.get("rx_bytes"), decimal);
addCells... | [
"private",
"TableRowEntry",
"addRowsForNetwork",
"(",
"Map<String",
"Long",
">",
"before",
"Map<String",
"Long",
">",
"after",
"Boolean",
"decimal",
"String",
"adapter",
")",
"{"
] | train | https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/docker/reporter/src/main/java/org/arquillian/cube/docker/impl/client/reporter/TakeDockerEnvironment.java#L187-L202 |
deeplearning4j/deeplearning4j | datavec/datavec-spark/src/main/java/org/datavec/spark/transform/DataFrames.java | DataFrames.toDataFrameSequence | public static DataRowsFacade toDataFrameSequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
"""
Convert the given sequence data set to a DataFrame.<br>
<b>Note</b>: The resulting DataFrame has two additional columns added to it:<br>
- Column 0: Sequence UUID (name: {@link #SEQUENCE_UUID_COLUMN}) - a UU... | java | public static DataRowsFacade toDataFrameSequence(Schema schema, JavaRDD<List<List<Writable>>> data) {
JavaSparkContext sc = new JavaSparkContext(data.context());
SQLContext sqlContext = new SQLContext(sc);
JavaRDD<Row> rows = data.flatMap(new SequenceToRows(schema));
return dataRows(sql... | [
"public",
"static",
"DataRowsFacade",
"toDataFrameSequence",
"(",
"Schema",
"schema",
",",
"JavaRDD",
"<",
"List",
"<",
"List",
"<",
"Writable",
">",
">",
">",
"data",
")",
"{",
"JavaSparkContext",
"sc",
"=",
"new",
"JavaSparkContext",
"(",
"data",
".",
"con... | Convert the given sequence data set to a DataFrame.<br>
<b>Note</b>: The resulting DataFrame has two additional columns added to it:<br>
- Column 0: Sequence UUID (name: {@link #SEQUENCE_UUID_COLUMN}) - a UUID for the original sequence<br>
- Column 1: Sequence index (name: {@link #SEQUENCE_INDEX_COLUMN} - an index (int... | [
"Convert",
"the",
"given",
"sequence",
"data",
"set",
"to",
"a",
"DataFrame",
".",
"<br",
">",
"<b",
">",
"Note<",
"/",
"b",
">",
":",
"The",
"resulting",
"DataFrame",
"has",
"two",
"additional",
"columns",
"added",
"to",
"it",
":",
"<br",
">",
"-",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/datavec/datavec-spark/src/main/java/org/datavec/spark/transform/DataFrames.java#L342-L348 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/background/Parallax.java | Parallax.renderLine | private void renderLine(Graphic g, int numLine, int lineY) {
"""
Render parallax line.
@param g The graphic output.
@param numLine The current line number.
@param lineY The line y position.
"""
final int lineWidth = surface.getLineWidth(numLine);
for (int j = -amplitude; j < amplitude; j++... | java | private void renderLine(Graphic g, int numLine, int lineY)
{
final int lineWidth = surface.getLineWidth(numLine);
for (int j = -amplitude; j < amplitude; j++)
{
final int lx = (int) (-offsetX + offsetX * j - x[numLine] - x2[numLine] + numLine * (2.56 * factH) * j);
if... | [
"private",
"void",
"renderLine",
"(",
"Graphic",
"g",
",",
"int",
"numLine",
",",
"int",
"lineY",
")",
"{",
"final",
"int",
"lineWidth",
"=",
"surface",
".",
"getLineWidth",
"(",
"numLine",
")",
";",
"for",
"(",
"int",
"j",
"=",
"-",
"amplitude",
";",
... | Render parallax line.
@param g The graphic output.
@param numLine The current line number.
@param lineY The line y position. | [
"Render",
"parallax",
"line",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/background/Parallax.java#L125-L136 |
vnesek/nmote-xr | src/main/java/com/nmote/xr/EndpointBuilder.java | EndpointBuilder.get | @SuppressWarnings("unchecked")
public T get() {
"""
Returns either a client proxy or {@link HTTPServerEndpoint} instance.
@return building result
"""
T result;
if (uri != null) {
if (classLoader == null) {
classLoader = clazz.getClassLoader();
}
Endpoint clientEndpoint = new HTTPClientEn... | java | @SuppressWarnings("unchecked")
public T get() {
T result;
if (uri != null) {
if (classLoader == null) {
classLoader = clazz.getClassLoader();
}
Endpoint clientEndpoint = new HTTPClientEndpoint(uri);
if (logger != null) {
clientEndpoint = new LoggerEndpoint(clientEndpoint, logger);
}
re... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"T",
"get",
"(",
")",
"{",
"T",
"result",
";",
"if",
"(",
"uri",
"!=",
"null",
")",
"{",
"if",
"(",
"classLoader",
"==",
"null",
")",
"{",
"classLoader",
"=",
"clazz",
".",
"getClassLoader",... | Returns either a client proxy or {@link HTTPServerEndpoint} instance.
@return building result | [
"Returns",
"either",
"a",
"client",
"proxy",
"or",
"{",
"@link",
"HTTPServerEndpoint",
"}",
"instance",
"."
] | train | https://github.com/vnesek/nmote-xr/blob/6c584142a38a9dbc6401c75614d8d207f64f658d/src/main/java/com/nmote/xr/EndpointBuilder.java#L181-L211 |
apache/flink | flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java | MetricConfig.getDouble | public double getDouble(String key, double defaultValue) {
"""
Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the p... | java | public double getDouble(String key, double defaultValue) {
String argument = getProperty(key, null);
return argument == null
? defaultValue
: Double.parseDouble(argument);
} | [
"public",
"double",
"getDouble",
"(",
"String",
"key",
",",
"double",
"defaultValue",
")",
"{",
"String",
"argument",
"=",
"getProperty",
"(",
"key",
",",
"null",
")",
";",
"return",
"argument",
"==",
"null",
"?",
"defaultValue",
":",
"Double",
".",
"parse... | Searches for the property with the specified key in this property list.
If the key is not found in this property list, the default property list,
and its defaults, recursively, are then checked. The method returns the
default value argument if the property is not found.
@param key the hashtable key.
@param de... | [
"Searches",
"for",
"the",
"property",
"with",
"the",
"specified",
"key",
"in",
"this",
"property",
"list",
".",
"If",
"the",
"key",
"is",
"not",
"found",
"in",
"this",
"property",
"list",
"the",
"default",
"property",
"list",
"and",
"its",
"defaults",
"rec... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-metrics/flink-metrics-core/src/main/java/org/apache/flink/metrics/MetricConfig.java#L93-L98 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsSolrHandler.java | OpenCmsSolrHandler.doGet | @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
"""
OpenCms servlet main request handling method.<p>
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
"""
handle(req, res, HA... | java | @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException {
handle(req, res, HANDLER_NAMES.SolrSelect.toString());
} | [
"@",
"Override",
"public",
"void",
"doGet",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
"{",
"handle",
"(",
"req",
",",
"res",
",",
"HANDLER_NAMES",
".",
"SolrSelect",
".",
"toString",
"(",
")",
")",
";"... | OpenCms servlet main request handling method.<p>
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) | [
"OpenCms",
"servlet",
"main",
"request",
"handling",
"method",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsSolrHandler.java#L124-L128 |
spring-projects/spring-hateoas | src/main/java/org/springframework/hateoas/Link.java | Link.andAffordance | public Link andAffordance(HttpMethod httpMethod, Class<?> inputType, List<QueryParameter> queryMethodParameters,
Class<?> outputType) {
"""
Convenience method when chaining an existing {@link Link}. Defaults the name of the affordance to verb + classname,
e.g. {@literal <httpMethod=HttpMethod.PUT, inputType=Em... | java | public Link andAffordance(HttpMethod httpMethod, Class<?> inputType, List<QueryParameter> queryMethodParameters,
Class<?> outputType) {
return andAffordance(httpMethod, ResolvableType.forClass(inputType), queryMethodParameters,
ResolvableType.forClass(outputType));
} | [
"public",
"Link",
"andAffordance",
"(",
"HttpMethod",
"httpMethod",
",",
"Class",
"<",
"?",
">",
"inputType",
",",
"List",
"<",
"QueryParameter",
">",
"queryMethodParameters",
",",
"Class",
"<",
"?",
">",
"outputType",
")",
"{",
"return",
"andAffordance",
"(",... | Convenience method when chaining an existing {@link Link}. Defaults the name of the affordance to verb + classname,
e.g. {@literal <httpMethod=HttpMethod.PUT, inputType=Employee>} produces {@literal <name=putEmployee>}.
@param httpMethod
@param inputType
@param queryMethodParameters
@param outputType
@return | [
"Convenience",
"method",
"when",
"chaining",
"an",
"existing",
"{",
"@link",
"Link",
"}",
".",
"Defaults",
"the",
"name",
"of",
"the",
"affordance",
"to",
"verb",
"+",
"classname",
"e",
".",
"g",
".",
"{",
"@literal",
"<httpMethod",
"=",
"HttpMethod",
".",... | train | https://github.com/spring-projects/spring-hateoas/blob/70ebff9309f086cd8d6a97daf67e0dc215c87d9c/src/main/java/org/springframework/hateoas/Link.java#L262-L266 |
real-logic/simple-binary-encoding | sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java | JavaUtil.generateTypeJavadoc | public static String generateTypeJavadoc(final String indent, final Token typeToken) {
"""
Generate the Javadoc comment header for a type.
@param indent level for the comment.
@param typeToken for the type.
@return a string representation of the Javadoc comment.
"""
final String description = t... | java | public static String generateTypeJavadoc(final String indent, final Token typeToken)
{
final String description = typeToken.description();
if (null == description || description.isEmpty())
{
return "";
}
return
indent + "/**\n" +
indent + ... | [
"public",
"static",
"String",
"generateTypeJavadoc",
"(",
"final",
"String",
"indent",
",",
"final",
"Token",
"typeToken",
")",
"{",
"final",
"String",
"description",
"=",
"typeToken",
".",
"description",
"(",
")",
";",
"if",
"(",
"null",
"==",
"description",
... | Generate the Javadoc comment header for a type.
@param indent level for the comment.
@param typeToken for the type.
@return a string representation of the Javadoc comment. | [
"Generate",
"the",
"Javadoc",
"comment",
"header",
"for",
"a",
"type",
"."
] | train | https://github.com/real-logic/simple-binary-encoding/blob/9a7be490c86d98f0e430e4189bc6c8c4fbef658b/sbe-tool/src/main/java/uk/co/real_logic/sbe/generation/java/JavaUtil.java#L259-L271 |
Waikato/moa | moa/src/main/java/moa/clusterers/clustree/Entry.java | Entry.initializeEntry | protected void initializeEntry(Entry other, long currentTime) {
"""
When this entry is empty, give it it's first values. It makes sense to
have this operation separated from the aggregation, because the
aggregation first weights the values in <code>data</code> and
<code>Kernel</code>, which makes no sense in an... | java | protected void initializeEntry(Entry other, long currentTime) {
assert (this.isEmpty());
assert (other.getBuffer().isEmpty());
this.data.add(other.data);
this.timestamp = currentTime;
this.child = other.child;
if (child!=null){
for (Entry e : child.getEntries()){... | [
"protected",
"void",
"initializeEntry",
"(",
"Entry",
"other",
",",
"long",
"currentTime",
")",
"{",
"assert",
"(",
"this",
".",
"isEmpty",
"(",
")",
")",
";",
"assert",
"(",
"other",
".",
"getBuffer",
"(",
")",
".",
"isEmpty",
"(",
")",
")",
";",
"t... | When this entry is empty, give it it's first values. It makes sense to
have this operation separated from the aggregation, because the
aggregation first weights the values in <code>data</code> and
<code>Kernel</code>, which makes no sense in an empty entry.
@param other The entry with the information to be used to init... | [
"When",
"this",
"entry",
"is",
"empty",
"give",
"it",
"it",
"s",
"first",
"values",
".",
"It",
"makes",
"sense",
"to",
"have",
"this",
"operation",
"separated",
"from",
"the",
"aggregation",
"because",
"the",
"aggregation",
"first",
"weights",
"the",
"values... | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/clusterers/clustree/Entry.java#L222-L233 |
cycorp/api-suite | core-api/src/main/java/com/cyc/kb/wrapper/KbFunctionWrapper.java | KbFunctionWrapper.findOrCreateFunctionalTerm | @Override
public <O extends KbObject> O findOrCreateFunctionalTerm(Class<O> retType, Object... args)
throws KbTypeException, CreateException {
"""
====| Public methods |==================================================================//
"""
return wrapped().findOrCreateFunctionalTerm(re... | java | @Override
public <O extends KbObject> O findOrCreateFunctionalTerm(Class<O> retType, Object... args)
throws KbTypeException, CreateException {
return wrapped().findOrCreateFunctionalTerm(retType, args);
} | [
"@",
"Override",
"public",
"<",
"O",
"extends",
"KbObject",
">",
"O",
"findOrCreateFunctionalTerm",
"(",
"Class",
"<",
"O",
">",
"retType",
",",
"Object",
"...",
"args",
")",
"throws",
"KbTypeException",
",",
"CreateException",
"{",
"return",
"wrapped",
"(",
... | ====| Public methods |==================================================================// | [
"====",
"|",
"Public",
"methods",
"|",
"==================================================================",
"//"
] | train | https://github.com/cycorp/api-suite/blob/1d52affabc4635e3715a059e38741712cbdbf2d5/core-api/src/main/java/com/cyc/kb/wrapper/KbFunctionWrapper.java#L47-L51 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWSelectList.java | AbstractWSelectList.getDesc | public String getDesc(final Object option, final int index) {
"""
Retrieves the description for the given option. Intended for use by Renderers.
@param option the option to retrieve the description for.
@param index the option index.
@return the description for the given option.
"""
String desc = "";
... | java | public String getDesc(final Object option, final int index) {
String desc = "";
if (option instanceof Option) {
String optDesc = ((Option) option).getDesc();
if (optDesc != null) {
desc = optDesc;
}
} else {
String tableDesc = APPLICATION_LOOKUP_TABLE.getDescription(getLookupTable(), option);
... | [
"public",
"String",
"getDesc",
"(",
"final",
"Object",
"option",
",",
"final",
"int",
"index",
")",
"{",
"String",
"desc",
"=",
"\"\"",
";",
"if",
"(",
"option",
"instanceof",
"Option",
")",
"{",
"String",
"optDesc",
"=",
"(",
"(",
"Option",
")",
"opti... | Retrieves the description for the given option. Intended for use by Renderers.
@param option the option to retrieve the description for.
@param index the option index.
@return the description for the given option. | [
"Retrieves",
"the",
"description",
"for",
"the",
"given",
"option",
".",
"Intended",
"for",
"use",
"by",
"Renderers",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/AbstractWSelectList.java#L432-L452 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/effect/SeaGlassInternalShadowEffect.java | SeaGlassInternalShadowEffect.getRoundedShadowGradient | public Paint getRoundedShadowGradient(Shape s) {
"""
Create the gradient for a rounded shadow.
@param s the shape of the gradient. This is only used for its bounds.
@return the gradient.
"""
Rectangle r = s.getBounds();
int x = r.x + r.width / 2;
int y1 = r.y;... | java | public Paint getRoundedShadowGradient(Shape s) {
Rectangle r = s.getBounds();
int x = r.x + r.width / 2;
int y1 = r.y;
float frac = 1.0f / r.height;
int y2 = r.y + r.height;
return new LinearGradientPaint(x, y1, x, y2, (new float[] { 0f, f... | [
"public",
"Paint",
"getRoundedShadowGradient",
"(",
"Shape",
"s",
")",
"{",
"Rectangle",
"r",
"=",
"s",
".",
"getBounds",
"(",
")",
";",
"int",
"x",
"=",
"r",
".",
"x",
"+",
"r",
".",
"width",
"/",
"2",
";",
"int",
"y1",
"=",
"r",
".",
"y",
";"... | Create the gradient for a rounded shadow.
@param s the shape of the gradient. This is only used for its bounds.
@return the gradient. | [
"Create",
"the",
"gradient",
"for",
"a",
"rounded",
"shadow",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/effect/SeaGlassInternalShadowEffect.java#L122-L131 |
craterdog/java-general-utilities | src/main/java/craterdog/utils/ByteUtils.java | ByteUtils.bytesToBigInteger | static public BigInteger bytesToBigInteger(byte[] buffer, int index) {
"""
This function converts the bytes in a byte array at the specified index to its
corresponding big integer value.
@param buffer The byte array containing the big integer.
@param index The index for the first byte in the byte array.
@ret... | java | static public BigInteger bytesToBigInteger(byte[] buffer, int index) {
int length = bytesToInt(buffer, index); // pull out the length of the big integer
index += 4;
byte[] bytes = new byte[length];
System.arraycopy(buffer, index, bytes, 0, length); // pull out the bytes for the big int... | [
"static",
"public",
"BigInteger",
"bytesToBigInteger",
"(",
"byte",
"[",
"]",
"buffer",
",",
"int",
"index",
")",
"{",
"int",
"length",
"=",
"bytesToInt",
"(",
"buffer",
",",
"index",
")",
";",
"// pull out the length of the big integer",
"index",
"+=",
"4",
"... | This function converts the bytes in a byte array at the specified index to its
corresponding big integer value.
@param buffer The byte array containing the big integer.
@param index The index for the first byte in the byte array.
@return The corresponding big integer value. | [
"This",
"function",
"converts",
"the",
"bytes",
"in",
"a",
"byte",
"array",
"at",
"the",
"specified",
"index",
"to",
"its",
"corresponding",
"big",
"integer",
"value",
"."
] | train | https://github.com/craterdog/java-general-utilities/blob/a3ff45eaa00c2b8ed5c53efe9fe5166065fc1f57/src/main/java/craterdog/utils/ByteUtils.java#L383-L389 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/io/Text.java | Text.writeStringOpt | public static void writeStringOpt(DataOutput out, String str)
throws IOException {
"""
Writes the string to the output, if possible
the encoding part is optimized.
"""
if (str == null) {
WritableUtils.writeVInt(out, NULL_STRING_LENGTH);
return;
}
final int len = str.length();
... | java | public static void writeStringOpt(DataOutput out, String str)
throws IOException{
if (str == null) {
WritableUtils.writeVInt(out, NULL_STRING_LENGTH);
return;
}
final int len = str.length();
TempArrays ta = UTF8.getArrays(len);
byte[] rawBytes = ta.byteArray;
char[] charArray ... | [
"public",
"static",
"void",
"writeStringOpt",
"(",
"DataOutput",
"out",
",",
"String",
"str",
")",
"throws",
"IOException",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"WritableUtils",
".",
"writeVInt",
"(",
"out",
",",
"NULL_STRING_LENGTH",
")",
";",
"... | Writes the string to the output, if possible
the encoding part is optimized. | [
"Writes",
"the",
"string",
"to",
"the",
"output",
"if",
"possible",
"the",
"encoding",
"part",
"is",
"optimized",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/io/Text.java#L448-L474 |
facebookarchive/hadoop-20 | src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java | PoolManager.incRunningTasks | public void incRunningTasks(String poolName, TaskType type, int inc) {
"""
Set the number of running tasks in a pool
@param poolName name of the pool
@param type type of task to be set
@param runningTasks number of current running tasks
"""
Map<String, Integer> runningMap = (type == TaskType.MAP ?
... | java | public void incRunningTasks(String poolName, TaskType type, int inc) {
Map<String, Integer> runningMap = (type == TaskType.MAP ?
poolRunningMaps : poolRunningReduces);
if (!runningMap.containsKey(poolName)) {
runningMap.put(poolName, 0);
}
int runningTasks = ... | [
"public",
"void",
"incRunningTasks",
"(",
"String",
"poolName",
",",
"TaskType",
"type",
",",
"int",
"inc",
")",
"{",
"Map",
"<",
"String",
",",
"Integer",
">",
"runningMap",
"=",
"(",
"type",
"==",
"TaskType",
".",
"MAP",
"?",
"poolRunningMaps",
":",
"p... | Set the number of running tasks in a pool
@param poolName name of the pool
@param type type of task to be set
@param runningTasks number of current running tasks | [
"Set",
"the",
"number",
"of",
"running",
"tasks",
"in",
"a",
"pool"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/fairscheduler/src/java/org/apache/hadoop/mapred/PoolManager.java#L725-L733 |
alkacon/opencms-core | src/org/opencms/ugc/CmsUgcSession.java | CmsUgcSession.updateUploadResource | private void updateUploadResource(String fieldName, CmsResource upload) {
"""
Stores the upload resource and deletes previously uploaded resources for the same form field.<p>
@param fieldName the field name
@param upload the uploaded resource
"""
CmsResource prevUploadResource = m_uploadResourcesB... | java | private void updateUploadResource(String fieldName, CmsResource upload) {
CmsResource prevUploadResource = m_uploadResourcesByField.get(fieldName);
if (prevUploadResource != null) {
try {
m_cms.deleteResource(m_cms.getSitePath(prevUploadResource), CmsResource.DELETE_PRESERVE... | [
"private",
"void",
"updateUploadResource",
"(",
"String",
"fieldName",
",",
"CmsResource",
"upload",
")",
"{",
"CmsResource",
"prevUploadResource",
"=",
"m_uploadResourcesByField",
".",
"get",
"(",
"fieldName",
")",
";",
"if",
"(",
"prevUploadResource",
"!=",
"null"... | Stores the upload resource and deletes previously uploaded resources for the same form field.<p>
@param fieldName the field name
@param upload the uploaded resource | [
"Stores",
"the",
"upload",
"resource",
"and",
"deletes",
"previously",
"uploaded",
"resources",
"for",
"the",
"same",
"form",
"field",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ugc/CmsUgcSession.java#L843-L854 |
jbundle/jbundle | base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java | TableSession.doMove | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException {
"""
Move the current position and read the record (optionally read several records).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Records to read.
@return If I read 1 record, this... | java | public Object doMove(int iRelPosition, int iRecordCount) throws DBException, RemoteException
{
try {
Utility.getLogger().info("EJB Move");
if (iRecordCount == 1)
{
return this.doMoveOne(iRelPosition);
}
else
{
... | [
"public",
"Object",
"doMove",
"(",
"int",
"iRelPosition",
",",
"int",
"iRecordCount",
")",
"throws",
"DBException",
",",
"RemoteException",
"{",
"try",
"{",
"Utility",
".",
"getLogger",
"(",
")",
".",
"info",
"(",
"\"EJB Move\"",
")",
";",
"if",
"(",
"iRec... | Move the current position and read the record (optionally read several records).
@param iRelPosition relative Position to read the next record.
@param iRecordCount Records to read.
@return If I read 1 record, this is the record's data.
@return If I read several records, this is a vector of the returned records.
@return... | [
"Move",
"the",
"current",
"position",
"and",
"read",
"the",
"record",
"(",
"optionally",
"read",
"several",
"records",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/remote/src/main/java/org/jbundle/base/remote/db/TableSession.java#L423-L450 |
apache/incubator-zipkin | zipkin/src/main/java/zipkin2/internal/HexCodec.java | HexCodec.lowerHexToUnsignedLong | public static long lowerHexToUnsignedLong(String lowerHex, int index) {
"""
Parses a 16 character lower-hex string with no prefix into an unsigned long, starting at the
spe index.
"""
long result = 0;
for (int endIndex = Math.min(index + 16, lowerHex.length()); index < endIndex; index++) {
char ... | java | public static long lowerHexToUnsignedLong(String lowerHex, int index) {
long result = 0;
for (int endIndex = Math.min(index + 16, lowerHex.length()); index < endIndex; index++) {
char c = lowerHex.charAt(index);
result <<= 4;
if (c >= '0' && c <= '9') {
result |= c - '0';
} else ... | [
"public",
"static",
"long",
"lowerHexToUnsignedLong",
"(",
"String",
"lowerHex",
",",
"int",
"index",
")",
"{",
"long",
"result",
"=",
"0",
";",
"for",
"(",
"int",
"endIndex",
"=",
"Math",
".",
"min",
"(",
"index",
"+",
"16",
",",
"lowerHex",
".",
"len... | Parses a 16 character lower-hex string with no prefix into an unsigned long, starting at the
spe index. | [
"Parses",
"a",
"16",
"character",
"lower",
"-",
"hex",
"string",
"with",
"no",
"prefix",
"into",
"an",
"unsigned",
"long",
"starting",
"at",
"the",
"spe",
"index",
"."
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin/src/main/java/zipkin2/internal/HexCodec.java#L39-L53 |
apache/groovy | subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java | NioGroovyMethods.eachFile | public static void eachFile(final Path self, final Closure closure) throws IOException {
"""
Invokes the closure for each 'child' file in this 'parent' folder/directory.
Both regular files and subfolders/subdirectories are processed.
@param self a Path (that happens to be a folder/directory)
@param closure... | java | public static void eachFile(final Path self, final Closure closure) throws IOException { // throws FileNotFoundException, IllegalArgumentException {
eachFile(self, FileType.ANY, closure);
} | [
"public",
"static",
"void",
"eachFile",
"(",
"final",
"Path",
"self",
",",
"final",
"Closure",
"closure",
")",
"throws",
"IOException",
"{",
"// throws FileNotFoundException, IllegalArgumentException {",
"eachFile",
"(",
"self",
",",
"FileType",
".",
"ANY",
",",
"cl... | Invokes the closure for each 'child' file in this 'parent' folder/directory.
Both regular files and subfolders/subdirectories are processed.
@param self a Path (that happens to be a folder/directory)
@param closure a closure (the parameter is the Path for the 'child' file)
@throws java.io.FileNotFoundException if t... | [
"Invokes",
"the",
"closure",
"for",
"each",
"child",
"file",
"in",
"this",
"parent",
"folder",
"/",
"directory",
".",
"Both",
"regular",
"files",
"and",
"subfolders",
"/",
"subdirectories",
"are",
"processed",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/subprojects/groovy-nio/src/main/java/org/codehaus/groovy/runtime/NioGroovyMethods.java#L886-L888 |
lucee/Lucee | core/src/main/java/lucee/runtime/converter/JSONConverter.java | JSONConverter._serializeComponent | private void _serializeComponent(PageContext pc, Set test, Component component, StringBuilder sb, boolean serializeQueryByColumns, Set<Object> done) throws ConverterException {
"""
serialize a Component
@param component Component to serialize
@param sb
@param serializeQueryByColumns
@param done
@throws Conv... | java | private void _serializeComponent(PageContext pc, Set test, Component component, StringBuilder sb, boolean serializeQueryByColumns, Set<Object> done) throws ConverterException {
ComponentSpecificAccess cw = ComponentSpecificAccess.toComponentSpecificAccess(Component.ACCESS_PRIVATE, component);
_serializeStruct(pc, tes... | [
"private",
"void",
"_serializeComponent",
"(",
"PageContext",
"pc",
",",
"Set",
"test",
",",
"Component",
"component",
",",
"StringBuilder",
"sb",
",",
"boolean",
"serializeQueryByColumns",
",",
"Set",
"<",
"Object",
">",
"done",
")",
"throws",
"ConverterException... | serialize a Component
@param component Component to serialize
@param sb
@param serializeQueryByColumns
@param done
@throws ConverterException | [
"serialize",
"a",
"Component"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/converter/JSONConverter.java#L372-L375 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PluginAdapterUtility.java | PluginAdapterUtility.mapDescribedProperties | public static Map<String, Object> mapDescribedProperties(final PropertyResolver resolver,
final Description description, final PropertyScope defaultPropertyScope) {
"""
Retrieve the Description's Properties mapped to resolved values given the resolver, with a default property
scope
@param resolver pr... | java | public static Map<String, Object> mapDescribedProperties(final PropertyResolver resolver,
final Description description, final PropertyScope defaultPropertyScope) {
final List<Property> properties = description.getProperties();
return mapProperties(resolver, properties, defaultPropertyScope)... | [
"public",
"static",
"Map",
"<",
"String",
",",
"Object",
">",
"mapDescribedProperties",
"(",
"final",
"PropertyResolver",
"resolver",
",",
"final",
"Description",
"description",
",",
"final",
"PropertyScope",
"defaultPropertyScope",
")",
"{",
"final",
"List",
"<",
... | Retrieve the Description's Properties mapped to resolved values given the resolver, with a default property
scope
@param resolver property resolver
@param description plugin description
@param defaultPropertyScope default scope for unspecified property scopes
@return All mapped properties by name and value. | [
"Retrieve",
"the",
"Description",
"s",
"Properties",
"mapped",
"to",
"resolved",
"values",
"given",
"the",
"resolver",
"with",
"a",
"default",
"property",
"scope",
"@param",
"resolver",
"property",
"resolver",
"@param",
"description",
"plugin",
"description",
"@para... | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/plugins/configuration/PluginAdapterUtility.java#L453-L457 |
thinkaurelius/titan | titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/thriftpool/CTConnectionPool.java | CTConnectionPool.returnObjectUnsafe | public void returnObjectUnsafe(String keyspace, CTConnection conn) {
"""
If {@code conn} is non-null and is still open, then call
{@link GenericKeyedObjectPool#returnObject(String, CTConnection),
catching and logging and Exception that method might generate.
This method does not emit any exceptions.
@param k... | java | public void returnObjectUnsafe(String keyspace, CTConnection conn) {
if (conn != null && conn.isOpen()) {
try {
returnObject(keyspace, conn);
} catch (Exception e) {
log.warn("Failed to return Cassandra connection to pool", e);
log.warn(
... | [
"public",
"void",
"returnObjectUnsafe",
"(",
"String",
"keyspace",
",",
"CTConnection",
"conn",
")",
"{",
"if",
"(",
"conn",
"!=",
"null",
"&&",
"conn",
".",
"isOpen",
"(",
")",
")",
"{",
"try",
"{",
"returnObject",
"(",
"keyspace",
",",
"conn",
")",
"... | If {@code conn} is non-null and is still open, then call
{@link GenericKeyedObjectPool#returnObject(String, CTConnection),
catching and logging and Exception that method might generate.
This method does not emit any exceptions.
@param keyspace The key of the pooled object being returned
@param conn The pooled object b... | [
"If",
"{",
"@code",
"conn",
"}",
"is",
"non",
"-",
"null",
"and",
"is",
"still",
"open",
"then",
"call",
"{",
"@link",
"GenericKeyedObjectPool#returnObject",
"(",
"String",
"CTConnection",
")",
"catching",
"and",
"logging",
"and",
"Exception",
"that",
"method"... | train | https://github.com/thinkaurelius/titan/blob/ee226e52415b8bf43b700afac75fa5b9767993a5/titan-cassandra/src/main/java/com/thinkaurelius/titan/diskstorage/cassandra/thrift/thriftpool/CTConnectionPool.java#L51-L62 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java | KeyVaultClientCustomImpl.listCertificateIssuers | public PagedList<CertificateIssuerItem> listCertificateIssuers(final String vaultBaseUrl,
final Integer maxresults) {
"""
List certificate issuers for the specified vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param maxresults
Maximum number of results to retur... | java | public PagedList<CertificateIssuerItem> listCertificateIssuers(final String vaultBaseUrl,
final Integer maxresults) {
return getCertificateIssuers(vaultBaseUrl, maxresults);
} | [
"public",
"PagedList",
"<",
"CertificateIssuerItem",
">",
"listCertificateIssuers",
"(",
"final",
"String",
"vaultBaseUrl",
",",
"final",
"Integer",
"maxresults",
")",
"{",
"return",
"getCertificateIssuers",
"(",
"vaultBaseUrl",
",",
"maxresults",
")",
";",
"}"
] | List certificate issuers for the specified vault.
@param vaultBaseUrl
The vault name, e.g. https://myvault.vault.azure.net
@param maxresults
Maximum number of results to return in a page. If not specified
the service will return up to 25 results.
@return the PagedList<CertificateIssuerItem> if successful. | [
"List",
"certificate",
"issuers",
"for",
"the",
"specified",
"vault",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientCustomImpl.java#L1381-L1384 |
Comcast/jrugged | jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanServerAdapter.java | WebMBeanServerAdapter.createWebMBeanAdapter | public WebMBeanAdapter createWebMBeanAdapter(String mBeanName, String encoding)
throws JMException, UnsupportedEncodingException {
"""
Create a WebMBeanAdaptor for a specified MBean name.
@param mBeanName the MBean name (can be URL-encoded).
@param encoding the string encoding to be used (i.e. UTF-8)... | java | public WebMBeanAdapter createWebMBeanAdapter(String mBeanName, String encoding)
throws JMException, UnsupportedEncodingException {
return new WebMBeanAdapter(mBeanServer, mBeanName, encoding);
} | [
"public",
"WebMBeanAdapter",
"createWebMBeanAdapter",
"(",
"String",
"mBeanName",
",",
"String",
"encoding",
")",
"throws",
"JMException",
",",
"UnsupportedEncodingException",
"{",
"return",
"new",
"WebMBeanAdapter",
"(",
"mBeanServer",
",",
"mBeanName",
",",
"encoding"... | Create a WebMBeanAdaptor for a specified MBean name.
@param mBeanName the MBean name (can be URL-encoded).
@param encoding the string encoding to be used (i.e. UTF-8)
@return the created WebMBeanAdaptor.
@throws JMException Java Management Exception
@throws UnsupportedEncodingException if the encoding is not supported. | [
"Create",
"a",
"WebMBeanAdaptor",
"for",
"a",
"specified",
"MBean",
"name",
"."
] | train | https://github.com/Comcast/jrugged/blob/b6a5147c68ee733faf5616d49800abcbba67afe9/jrugged-spring/src/main/java/org/fishwife/jrugged/spring/jmx/WebMBeanServerAdapter.java#L71-L74 |
atomix/atomix | protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionSequencer.java | RaftSessionSequencer.sequenceEvent | public void sequenceEvent(PublishRequest request, Runnable callback) {
"""
Sequences an event.
<p>
This method relies on the session event protocol to ensure that events are applied in sequential order.
When an event is received, if no operations are outstanding, the event is immediately completed since
the ev... | java | public void sequenceEvent(PublishRequest request, Runnable callback) {
if (requestSequence == responseSequence) {
log.trace("Completing {}", request);
callback.run();
eventIndex = request.eventIndex();
} else {
eventCallbacks.add(new EventCallback(request, callback));
completeRespo... | [
"public",
"void",
"sequenceEvent",
"(",
"PublishRequest",
"request",
",",
"Runnable",
"callback",
")",
"{",
"if",
"(",
"requestSequence",
"==",
"responseSequence",
")",
"{",
"log",
".",
"trace",
"(",
"\"Completing {}\"",
",",
"request",
")",
";",
"callback",
"... | Sequences an event.
<p>
This method relies on the session event protocol to ensure that events are applied in sequential order.
When an event is received, if no operations are outstanding, the event is immediately completed since
the event could not have occurred concurrently with any other operation. Otherwise, the ev... | [
"Sequences",
"an",
"event",
".",
"<p",
">",
"This",
"method",
"relies",
"on",
"the",
"session",
"event",
"protocol",
"to",
"ensure",
"that",
"events",
"are",
"applied",
"in",
"sequential",
"order",
".",
"When",
"an",
"event",
"is",
"received",
"if",
"no",
... | train | https://github.com/atomix/atomix/blob/3a94b7c80576d762dd0d396d4645df07a0b37c31/protocols/raft/src/main/java/io/atomix/protocols/raft/session/impl/RaftSessionSequencer.java#L102-L111 |
hap-java/HAP-Java | src/main/java/io/github/hapjava/HomekitServer.java | HomekitServer.createStandaloneAccessory | public HomekitStandaloneAccessoryServer createStandaloneAccessory(
HomekitAuthInfo authInfo, HomekitAccessory accessory) throws IOException {
"""
Creates a single (non-bridge) accessory
@param authInfo authentication information for this accessory. These values should be persisted
and re-supplied on re-s... | java | public HomekitStandaloneAccessoryServer createStandaloneAccessory(
HomekitAuthInfo authInfo, HomekitAccessory accessory) throws IOException {
return new HomekitStandaloneAccessoryServer(accessory, http, localAddress, authInfo);
} | [
"public",
"HomekitStandaloneAccessoryServer",
"createStandaloneAccessory",
"(",
"HomekitAuthInfo",
"authInfo",
",",
"HomekitAccessory",
"accessory",
")",
"throws",
"IOException",
"{",
"return",
"new",
"HomekitStandaloneAccessoryServer",
"(",
"accessory",
",",
"http",
",",
"... | Creates a single (non-bridge) accessory
@param authInfo authentication information for this accessory. These values should be persisted
and re-supplied on re-start of your application.
@param accessory accessory implementation. This will usually be an implementation of an
interface in {#link io.github.hapjava.accessor... | [
"Creates",
"a",
"single",
"(",
"non",
"-",
"bridge",
")",
"accessory"
] | train | https://github.com/hap-java/HAP-Java/blob/d2b2f4f1579580a2b5958af3a192128345843db9/src/main/java/io/github/hapjava/HomekitServer.java#L83-L86 |
foundation-runtime/service-directory | 1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/HeartbeatDirectoryRegistrationService.java | HeartbeatDirectoryRegistrationService.registerCachedServiceInstance | private void registerCachedServiceInstance(ProvidedServiceInstance instance, ServiceInstanceHealth registryHealth) {
"""
Register a ProvidedServiceInstance to the Cache.
Add/update the ProvidedServiceInstance in the cache.
It is thread safe.
@param instance
the ProvidedServiceInstance.
@param registryHe... | java | private void registerCachedServiceInstance(ProvidedServiceInstance instance, ServiceInstanceHealth registryHealth) {
try {
write.lock();
ServiceInstanceId id = new ServiceInstanceId(instance.getServiceName(),
instance.getProviderId());
CachedProviderServic... | [
"private",
"void",
"registerCachedServiceInstance",
"(",
"ProvidedServiceInstance",
"instance",
",",
"ServiceInstanceHealth",
"registryHealth",
")",
"{",
"try",
"{",
"write",
".",
"lock",
"(",
")",
";",
"ServiceInstanceId",
"id",
"=",
"new",
"ServiceInstanceId",
"(",
... | Register a ProvidedServiceInstance to the Cache.
Add/update the ProvidedServiceInstance in the cache.
It is thread safe.
@param instance
the ProvidedServiceInstance.
@param registryHealth
the ServiceInstanceHealth callback. | [
"Register",
"a",
"ProvidedServiceInstance",
"to",
"the",
"Cache",
"."
] | train | https://github.com/foundation-runtime/service-directory/blob/a7bdefe173dc99e75eff4a24e07e6407e62f2ed4/1.1/sd-api/src/main/java/com/cisco/oss/foundation/directory/impl/HeartbeatDirectoryRegistrationService.java#L290-L310 |
raydac/java-binary-block-parser | jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java | JBBPOut.Bool | public JBBPOut Bool(final boolean value, final JBBPBitOrder bitOrder) throws IOException {
"""
Write a boolean value into the session stream as a byte.
@param value a boolean value to be written, true is 1, false is 0
@param bitOrder bit outOrder for saving data
@return the DSL session
@throws IOException... | java | public JBBPOut Bool(final boolean value, final JBBPBitOrder bitOrder) throws IOException {
assertNotEnded();
if (this.processCommands) {
this.outStream.write(value ? bitOrder == JBBPBitOrder.MSB0 ? 0x80 : 1 : 0);
}
return this;
} | [
"public",
"JBBPOut",
"Bool",
"(",
"final",
"boolean",
"value",
",",
"final",
"JBBPBitOrder",
"bitOrder",
")",
"throws",
"IOException",
"{",
"assertNotEnded",
"(",
")",
";",
"if",
"(",
"this",
".",
"processCommands",
")",
"{",
"this",
".",
"outStream",
".",
... | Write a boolean value into the session stream as a byte.
@param value a boolean value to be written, true is 1, false is 0
@param bitOrder bit outOrder for saving data
@return the DSL session
@throws IOException it will be thrown for transport errors
@since 1.1 | [
"Write",
"a",
"boolean",
"value",
"into",
"the",
"session",
"stream",
"as",
"a",
"byte",
"."
] | train | https://github.com/raydac/java-binary-block-parser/blob/6d98abcab01e0c72d525ebcc9e7b694f9ce49f5b/jbbp/src/main/java/com/igormaznitsa/jbbp/io/JBBPOut.java#L605-L611 |
LAW-Unimi/BUbiNG | src/it/unimi/di/law/warc/records/WarcHeader.java | WarcHeader.addIfNotPresent | public static void addIfNotPresent(final HeaderGroup headers, final WarcHeader.Name name, final String value) {
"""
Adds the given header, if not present (otherwise does nothing).
@param headers the headers where to add the new one.
@param name the name of the header to add.
@param value the value of the head... | java | public static void addIfNotPresent(final HeaderGroup headers, final WarcHeader.Name name, final String value) {
if (! headers.containsHeader(name.value)) headers.addHeader(new WarcHeader(name, value));
} | [
"public",
"static",
"void",
"addIfNotPresent",
"(",
"final",
"HeaderGroup",
"headers",
",",
"final",
"WarcHeader",
".",
"Name",
"name",
",",
"final",
"String",
"value",
")",
"{",
"if",
"(",
"!",
"headers",
".",
"containsHeader",
"(",
"name",
".",
"value",
... | Adds the given header, if not present (otherwise does nothing).
@param headers the headers where to add the new one.
@param name the name of the header to add.
@param value the value of the header to add. | [
"Adds",
"the",
"given",
"header",
"if",
"not",
"present",
"(",
"otherwise",
"does",
"nothing",
")",
"."
] | train | https://github.com/LAW-Unimi/BUbiNG/blob/e148acc90031a4f3967422705a9fb07ddaf155e4/src/it/unimi/di/law/warc/records/WarcHeader.java#L112-L114 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java | SARLFormatter.formatCommaSeparatedList | protected void formatCommaSeparatedList(Collection<? extends EObject> elements, IFormattableDocument document) {
"""
Format a list of comma separated elements.
<p>This function does not considerer opening and closing delimiters, as
{@link #formatCommaSeparatedList(Collection, ISemanticRegion, ISemanticRegion, ... | java | protected void formatCommaSeparatedList(Collection<? extends EObject> elements, IFormattableDocument document) {
for (final EObject element : elements) {
document.format(element);
final ISemanticRegionFinder immediatelyFollowing = this.textRegionExtensions.immediatelyFollowing(element);
final ISemanticRegion... | [
"protected",
"void",
"formatCommaSeparatedList",
"(",
"Collection",
"<",
"?",
"extends",
"EObject",
">",
"elements",
",",
"IFormattableDocument",
"document",
")",
"{",
"for",
"(",
"final",
"EObject",
"element",
":",
"elements",
")",
"{",
"document",
".",
"format... | Format a list of comma separated elements.
<p>This function does not considerer opening and closing delimiters, as
{@link #formatCommaSeparatedList(Collection, ISemanticRegion, ISemanticRegion, IFormattableDocument)}.
@param elements the elements to format.
@param document the document. | [
"Format",
"a",
"list",
"of",
"comma",
"separated",
"elements",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L594-L602 |
hexagonframework/spring-data-ebean | src/main/java/org/springframework/data/ebean/repository/query/NamedEbeanQuery.java | NamedEbeanQuery.lookupFrom | public static RepositoryQuery lookupFrom(EbeanQueryMethod method, EbeanServer ebeanServer) {
"""
Looks up a named query for the given {@link org.springframework.data.repository.query.QueryMethod}.
@param method
@return
"""
final String queryName = method.getNamedQueryName();
LOG.debug("... | java | public static RepositoryQuery lookupFrom(EbeanQueryMethod method, EbeanServer ebeanServer) {
final String queryName = method.getNamedQueryName();
LOG.debug("Looking up named query {}", queryName);
try {
Query query = ebeanServer.createNamedQuery(method.getEntityInformation().... | [
"public",
"static",
"RepositoryQuery",
"lookupFrom",
"(",
"EbeanQueryMethod",
"method",
",",
"EbeanServer",
"ebeanServer",
")",
"{",
"final",
"String",
"queryName",
"=",
"method",
".",
"getNamedQueryName",
"(",
")",
";",
"LOG",
".",
"debug",
"(",
"\"Looking up nam... | Looks up a named query for the given {@link org.springframework.data.repository.query.QueryMethod}.
@param method
@return | [
"Looks",
"up",
"a",
"named",
"query",
"for",
"the",
"given",
"{",
"@link",
"org",
".",
"springframework",
".",
"data",
".",
"repository",
".",
"query",
".",
"QueryMethod",
"}",
"."
] | train | https://github.com/hexagonframework/spring-data-ebean/blob/dd11b97654982403b50dd1d5369cadad71fce410/src/main/java/org/springframework/data/ebean/repository/query/NamedEbeanQuery.java#L58-L70 |
baratine/baratine | core/src/main/java/com/caucho/v5/loader/EnvLoader.java | EnvLoader.getAttribute | public static Object getAttribute(String name, ClassLoader loader) {
"""
Gets a local variable for the current environment.
@param name the attribute name
@param loader the context loader
@return the attribute value
"""
for (; loader != null; loader = loader.getParent()) {
if (loader instanceo... | java | public static Object getAttribute(String name, ClassLoader loader)
{
for (; loader != null; loader = loader.getParent()) {
if (loader instanceof EnvironmentClassLoader) {
Object value = ((EnvironmentClassLoader) loader).getAttribute(name);
if (value != null)
return value;
}
... | [
"public",
"static",
"Object",
"getAttribute",
"(",
"String",
"name",
",",
"ClassLoader",
"loader",
")",
"{",
"for",
"(",
";",
"loader",
"!=",
"null",
";",
"loader",
"=",
"loader",
".",
"getParent",
"(",
")",
")",
"{",
"if",
"(",
"loader",
"instanceof",
... | Gets a local variable for the current environment.
@param name the attribute name
@param loader the context loader
@return the attribute value | [
"Gets",
"a",
"local",
"variable",
"for",
"the",
"current",
"environment",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/core/src/main/java/com/caucho/v5/loader/EnvLoader.java#L571-L588 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java | Subscriber.newBuilder | public static Builder newBuilder(ProjectSubscriptionName subscription, MessageReceiver receiver) {
"""
Constructs a new {@link Builder}.
@param subscription Cloud Pub/Sub subscription to bind the subscriber to
@param receiver an implementation of {@link MessageReceiver} used to process the received
messages
... | java | public static Builder newBuilder(ProjectSubscriptionName subscription, MessageReceiver receiver) {
return newBuilder(subscription.toString(), receiver);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"ProjectSubscriptionName",
"subscription",
",",
"MessageReceiver",
"receiver",
")",
"{",
"return",
"newBuilder",
"(",
"subscription",
".",
"toString",
"(",
")",
",",
"receiver",
")",
";",
"}"
] | Constructs a new {@link Builder}.
@param subscription Cloud Pub/Sub subscription to bind the subscriber to
@param receiver an implementation of {@link MessageReceiver} used to process the received
messages | [
"Constructs",
"a",
"new",
"{",
"@link",
"Builder",
"}",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-pubsub/src/main/java/com/google/cloud/pubsub/v1/Subscriber.java#L199-L201 |
encircled/Joiner | joiner-core/src/main/java/cz/encircled/joiner/core/Joiner.java | Joiner.applyPredicates | private <T, R> void applyPredicates(JoinerQuery<T, R> request, JPAQuery query, Set<Path<?>> usedAliases, List<JoinDescription> joins) {
"""
Apply "where", "groupBy" and "having"
@param request
@param query
@param usedAliases
@param joins
@param <T>
@param <R>
"""
if (request.getWhere() != null)... | java | private <T, R> void applyPredicates(JoinerQuery<T, R> request, JPAQuery query, Set<Path<?>> usedAliases, List<JoinDescription> joins) {
if (request.getWhere() != null) {
Predicate where = predicateAliasResolver.resolvePredicate(request.getWhere(), joins, usedAliases);
checkAliasesArePres... | [
"private",
"<",
"T",
",",
"R",
">",
"void",
"applyPredicates",
"(",
"JoinerQuery",
"<",
"T",
",",
"R",
">",
"request",
",",
"JPAQuery",
"query",
",",
"Set",
"<",
"Path",
"<",
"?",
">",
">",
"usedAliases",
",",
"List",
"<",
"JoinDescription",
">",
"jo... | Apply "where", "groupBy" and "having"
@param request
@param query
@param usedAliases
@param joins
@param <T>
@param <R> | [
"Apply",
"where",
"groupBy",
"and",
"having"
] | train | https://github.com/encircled/Joiner/blob/7b9117db05d8b89feeeb9ef7ce944256330d405c/joiner-core/src/main/java/cz/encircled/joiner/core/Joiner.java#L164-L182 |
apache/groovy | src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java | ResourceGroovyMethods.withInputStream | public static Object withInputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure closure) throws IOException {
"""
Create a new InputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@param f... | java | public static Object withInputStream(File file, @ClosureParams(value = SimpleType.class, options = "java.io.InputStream") Closure closure) throws IOException {
return IOGroovyMethods.withStream(newInputStream(file), closure);
} | [
"public",
"static",
"Object",
"withInputStream",
"(",
"File",
"file",
",",
"@",
"ClosureParams",
"(",
"value",
"=",
"SimpleType",
".",
"class",
",",
"options",
"=",
"\"java.io.InputStream\"",
")",
"Closure",
"closure",
")",
"throws",
"IOException",
"{",
"return"... | Create a new InputStream for this file and passes it into the closure.
This method ensures the stream is closed after the closure returns.
@param file a File
@param closure a closure
@return the value returned by the closure
@throws IOException if an IOException occurs.
@see IOGroovyMethods#withStream(java.io.Input... | [
"Create",
"a",
"new",
"InputStream",
"for",
"this",
"file",
"and",
"passes",
"it",
"into",
"the",
"closure",
".",
"This",
"method",
"ensures",
"the",
"stream",
"is",
"closed",
"after",
"the",
"closure",
"returns",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/ResourceGroovyMethods.java#L1842-L1844 |
avarabyeu/jashing | extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVcsModule.java | AbstractVcsModule.loadConfiguration | @Provides
public VCSConfiguration loadConfiguration(Gson gson) {
"""
Loads VCS configuration
@param gson GSON for deserialization
@return Loaded configuration
"""
try {
URL resource = ResourceUtils.getResourceAsURL(VCS_CONFIG_JSON);
if (null == resource) {
... | java | @Provides
public VCSConfiguration loadConfiguration(Gson gson) {
try {
URL resource = ResourceUtils.getResourceAsURL(VCS_CONFIG_JSON);
if (null == resource) {
throw new IncorrectConfigurationException("Unable to find VCS configuration");
}
retu... | [
"@",
"Provides",
"public",
"VCSConfiguration",
"loadConfiguration",
"(",
"Gson",
"gson",
")",
"{",
"try",
"{",
"URL",
"resource",
"=",
"ResourceUtils",
".",
"getResourceAsURL",
"(",
"VCS_CONFIG_JSON",
")",
";",
"if",
"(",
"null",
"==",
"resource",
")",
"{",
... | Loads VCS configuration
@param gson GSON for deserialization
@return Loaded configuration | [
"Loads",
"VCS",
"configuration"
] | train | https://github.com/avarabyeu/jashing/blob/fcc6ec67e2663eb1dde8cbacff5e660ca717cbc8/extensions/jashing-cvs/src/main/java/com/github/avarabyeu/jashing/integration/vcs/AbstractVcsModule.java#L52-L64 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java | LogFilePatternReceiver.convertTimestamp | private String convertTimestamp() {
"""
Helper method that will convert timestamp format to a pattern
@return string
"""
//some locales (for example, French) generate timestamp text with characters not included in \w -
// now using \S (all non-whitespace characters) instead of /w
String resul... | java | private String convertTimestamp() {
//some locales (for example, French) generate timestamp text with characters not included in \w -
// now using \S (all non-whitespace characters) instead of /w
String result = timestampFormat.replaceAll(VALID_DATEFORMAT_CHAR_PATTERN + "+", "\\\\S+");
//make sure dots... | [
"private",
"String",
"convertTimestamp",
"(",
")",
"{",
"//some locales (for example, French) generate timestamp text with characters not included in \\w -",
"// now using \\S (all non-whitespace characters) instead of /w ",
"String",
"result",
"=",
"timestampFormat",
".",
"replaceAll",
... | Helper method that will convert timestamp format to a pattern
@return string | [
"Helper",
"method",
"that",
"will",
"convert",
"timestamp",
"format",
"to",
"a",
"pattern"
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/receivers/varia/LogFilePatternReceiver.java#L582-L589 |
Jasig/uPortal | uPortal-core/src/main/java/org/apereo/portal/properties/PropertiesManager.java | PropertiesManager.getPropertyAsDouble | public static double getPropertyAsDouble(String name)
throws MissingPropertyException, BadPropertyException {
"""
Returns the value of a property for a given name as a <code>long</code>
@param name the name of the requested property
@return value the property's value as a <code>double</code>
@thro... | java | public static double getPropertyAsDouble(String name)
throws MissingPropertyException, BadPropertyException {
if (PropertiesManager.props == null) loadProps();
try {
return Double.parseDouble(getProperty(name));
} catch (NumberFormatException nfe) {
throw new ... | [
"public",
"static",
"double",
"getPropertyAsDouble",
"(",
"String",
"name",
")",
"throws",
"MissingPropertyException",
",",
"BadPropertyException",
"{",
"if",
"(",
"PropertiesManager",
".",
"props",
"==",
"null",
")",
"loadProps",
"(",
")",
";",
"try",
"{",
"ret... | Returns the value of a property for a given name as a <code>long</code>
@param name the name of the requested property
@return value the property's value as a <code>double</code>
@throws MissingPropertyException - if the property has not been set
@throws BadPropertyException - if the property cannot be parsed as a dou... | [
"Returns",
"the",
"value",
"of",
"a",
"property",
"for",
"a",
"given",
"name",
"as",
"a",
"<code",
">",
"long<",
"/",
"code",
">"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-core/src/main/java/org/apereo/portal/properties/PropertiesManager.java#L291-L299 |
baasbox/Android-SDK | library/src/main/java/com/baasbox/android/json/JsonArray.java | JsonArray.getLong | public long getLong(int index, long otherwise) {
"""
Returns the <code>long</code> at index or otherwise if not found.
@param index
@return the value at index or null if not found
@throws java.lang.IndexOutOfBoundsException if the index is out of the array bounds
"""
Long l = getLong(index);
... | java | public long getLong(int index, long otherwise) {
Long l = getLong(index);
return l == null ? otherwise : l;
} | [
"public",
"long",
"getLong",
"(",
"int",
"index",
",",
"long",
"otherwise",
")",
"{",
"Long",
"l",
"=",
"getLong",
"(",
"index",
")",
";",
"return",
"l",
"==",
"null",
"?",
"otherwise",
":",
"l",
";",
"}"
] | Returns the <code>long</code> at index or otherwise if not found.
@param index
@return the value at index or null if not found
@throws java.lang.IndexOutOfBoundsException if the index is out of the array bounds | [
"Returns",
"the",
"<code",
">",
"long<",
"/",
"code",
">",
"at",
"index",
"or",
"otherwise",
"if",
"not",
"found",
"."
] | train | https://github.com/baasbox/Android-SDK/blob/6bb2203246b885b2ad63a7bfaf37c83caf15e0d8/library/src/main/java/com/baasbox/android/json/JsonArray.java#L540-L543 |
VoltDB/voltdb | src/frontend/org/voltdb/utils/VoltTrace.java | VoltTrace.endDuration | public static TraceEvent endDuration(Object... args) {
"""
Creates an end duration trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event.
"""
return new TraceEvent(TraceEventType.DURATION_END, null, null, args);
} | java | public static TraceEvent endDuration(Object... args) {
return new TraceEvent(TraceEventType.DURATION_END, null, null, args);
} | [
"public",
"static",
"TraceEvent",
"endDuration",
"(",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"TraceEvent",
"(",
"TraceEventType",
".",
"DURATION_END",
",",
"null",
",",
"null",
",",
"args",
")",
";",
"}"
] | Creates an end duration trace event. This method does not queue the
event. Call {@link TraceEventBatch#add(Supplier)} to queue the event. | [
"Creates",
"an",
"end",
"duration",
"trace",
"event",
".",
"This",
"method",
"does",
"not",
"queue",
"the",
"event",
".",
"Call",
"{"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/utils/VoltTrace.java#L481-L483 |
pravega/pravega | common/src/main/java/io/pravega/common/util/BitConverter.java | BitConverter.writeInt | public static int writeInt(OutputStream target, int value) throws IOException {
"""
Writes the given 32-bit Integer to the given OutputStream.
@param target The OutputStream to write to.
@param value The value to write.
@return The number of bytes written.
@throws IOException If an exception got thrown.
... | java | public static int writeInt(OutputStream target, int value) throws IOException {
target.write(value >>> 24);
target.write(value >>> 16);
target.write(value >>> 8);
target.write(value);
return Integer.BYTES;
} | [
"public",
"static",
"int",
"writeInt",
"(",
"OutputStream",
"target",
",",
"int",
"value",
")",
"throws",
"IOException",
"{",
"target",
".",
"write",
"(",
"value",
">>>",
"24",
")",
";",
"target",
".",
"write",
"(",
"value",
">>>",
"16",
")",
";",
"tar... | Writes the given 32-bit Integer to the given OutputStream.
@param target The OutputStream to write to.
@param value The value to write.
@return The number of bytes written.
@throws IOException If an exception got thrown. | [
"Writes",
"the",
"given",
"32",
"-",
"bit",
"Integer",
"to",
"the",
"given",
"OutputStream",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/util/BitConverter.java#L84-L90 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java | Camera.checkHorizontalLimit | private void checkHorizontalLimit(double extrp, double vx) {
"""
Check horizontal limit on move.
@param extrp The extrapolation value.
@param vx The horizontal movement.
"""
// Inside interval
if (mover.getX() >= limitLeft
&& mover.getX() <= limitRight
&& limitLeft !... | java | private void checkHorizontalLimit(double extrp, double vx)
{
// Inside interval
if (mover.getX() >= limitLeft
&& mover.getX() <= limitRight
&& limitLeft != Integer.MIN_VALUE
&& limitRight != Integer.MAX_VALUE)
{
offset.moveLocation(extrp, vx, 0... | [
"private",
"void",
"checkHorizontalLimit",
"(",
"double",
"extrp",
",",
"double",
"vx",
")",
"{",
"// Inside interval",
"if",
"(",
"mover",
".",
"getX",
"(",
")",
">=",
"limitLeft",
"&&",
"mover",
".",
"getX",
"(",
")",
"<=",
"limitRight",
"&&",
"limitLeft... | Check horizontal limit on move.
@param extrp The extrapolation value.
@param vx The horizontal movement. | [
"Check",
"horizontal",
"limit",
"on",
"move",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/Camera.java#L315-L341 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/io/file/FileHelper.java | FileHelper.isParentDirectory | @SuppressFBWarnings ("IL_INFINITE_LOOP")
public static boolean isParentDirectory (@Nonnull final File aSearchDirectory, @Nonnull final File aStartDirectory) {
"""
Check if the searched directory is a parent object of the start directory
@param aSearchDirectory
The directory to be searched. May not be <code>n... | java | @SuppressFBWarnings ("IL_INFINITE_LOOP")
public static boolean isParentDirectory (@Nonnull final File aSearchDirectory, @Nonnull final File aStartDirectory)
{
ValueEnforcer.notNull (aSearchDirectory, "SearchDirectory");
ValueEnforcer.notNull (aStartDirectory, "StartDirectory");
File aRealSearchDirector... | [
"@",
"SuppressFBWarnings",
"(",
"\"IL_INFINITE_LOOP\"",
")",
"public",
"static",
"boolean",
"isParentDirectory",
"(",
"@",
"Nonnull",
"final",
"File",
"aSearchDirectory",
",",
"@",
"Nonnull",
"final",
"File",
"aStartDirectory",
")",
"{",
"ValueEnforcer",
".",
"notNu... | Check if the searched directory is a parent object of the start directory
@param aSearchDirectory
The directory to be searched. May not be <code>null</code>.
@param aStartDirectory
The directory where the search starts. May not be <code>null</code>.
@return <code>true</code> if the search directory is a parent of the ... | [
"Check",
"if",
"the",
"searched",
"directory",
"is",
"a",
"parent",
"object",
"of",
"the",
"start",
"directory"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/FileHelper.java#L264-L292 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/ops/executioner/CudaGridExecutioner.java | CudaGridExecutioner.isMatchingZXY | protected boolean isMatchingZXY(Op opA, Op opB) {
"""
This method is additional check, basically it qualifies possibility of InvertedPredicate MetaOp
@param opA
@param opB
@return
"""
if (opA.z() == opB.x() || opA.z() == opB.y())
return true;
return false;
} | java | protected boolean isMatchingZXY(Op opA, Op opB) {
if (opA.z() == opB.x() || opA.z() == opB.y())
return true;
return false;
} | [
"protected",
"boolean",
"isMatchingZXY",
"(",
"Op",
"opA",
",",
"Op",
"opB",
")",
"{",
"if",
"(",
"opA",
".",
"z",
"(",
")",
"==",
"opB",
".",
"x",
"(",
")",
"||",
"opA",
".",
"z",
"(",
")",
"==",
"opB",
".",
"y",
"(",
")",
")",
"return",
"... | This method is additional check, basically it qualifies possibility of InvertedPredicate MetaOp
@param opA
@param opB
@return | [
"This",
"method",
"is",
"additional",
"check",
"basically",
"it",
"qualifies",
"possibility",
"of",
"InvertedPredicate",
"MetaOp"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/linalg/jcublas/ops/executioner/CudaGridExecutioner.java#L487-L492 |
casbin/jcasbin | src/main/java/org/casbin/jcasbin/util/Util.java | Util.logPrintf | public static void logPrintf(String format, String... v) {
"""
logPrintf prints the log with the format.
@param format the format of the log.
@param v the log.
"""
if (enableLog) {
String tmp = String.format(format, (Object[]) v);
logger.log(Level.INFO, tmp);
}
} | java | public static void logPrintf(String format, String... v) {
if (enableLog) {
String tmp = String.format(format, (Object[]) v);
logger.log(Level.INFO, tmp);
}
} | [
"public",
"static",
"void",
"logPrintf",
"(",
"String",
"format",
",",
"String",
"...",
"v",
")",
"{",
"if",
"(",
"enableLog",
")",
"{",
"String",
"tmp",
"=",
"String",
".",
"format",
"(",
"format",
",",
"(",
"Object",
"[",
"]",
")",
"v",
")",
";",... | logPrintf prints the log with the format.
@param format the format of the log.
@param v the log. | [
"logPrintf",
"prints",
"the",
"log",
"with",
"the",
"format",
"."
] | train | https://github.com/casbin/jcasbin/blob/b46d7a756b6c39cdb17e0600607e5fcdc66edd11/src/main/java/org/casbin/jcasbin/util/Util.java#L47-L52 |
OpenTSDB/opentsdb | src/tools/ArgP.java | ArgP.get | public String get(final String name, final String defaultv) {
"""
Returns the value of the given option, or a default value.
@param name The name of the option to recognize (e.g. {@code --foo}).
@param defaultv The default value to return if the option wasn't given.
@throws IllegalArgumentException if this opti... | java | public String get(final String name, final String defaultv) {
final String value = get(name);
return value == null ? defaultv : value;
} | [
"public",
"String",
"get",
"(",
"final",
"String",
"name",
",",
"final",
"String",
"defaultv",
")",
"{",
"final",
"String",
"value",
"=",
"get",
"(",
"name",
")",
";",
"return",
"value",
"==",
"null",
"?",
"defaultv",
":",
"value",
";",
"}"
] | Returns the value of the given option, or a default value.
@param name The name of the option to recognize (e.g. {@code --foo}).
@param defaultv The default value to return if the option wasn't given.
@throws IllegalArgumentException if this option wasn't registered with
{@link #addOption}.
@throws IllegalStateExceptio... | [
"Returns",
"the",
"value",
"of",
"the",
"given",
"option",
"or",
"a",
"default",
"value",
"."
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/tools/ArgP.java#L199-L202 |
wildfly/wildfly-core | protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java | AbstractMessageHandler.registerActiveOperation | protected <T, A> ActiveOperation<T, A> registerActiveOperation(A attachment, ActiveOperation.CompletedCallback<T> callback) {
"""
Register an active operation. The operation-id will be generated.
@param attachment the shared attachment
@param callback the completed callback
@return the active operation
""... | java | protected <T, A> ActiveOperation<T, A> registerActiveOperation(A attachment, ActiveOperation.CompletedCallback<T> callback) {
return registerActiveOperation(null, attachment, callback);
} | [
"protected",
"<",
"T",
",",
"A",
">",
"ActiveOperation",
"<",
"T",
",",
"A",
">",
"registerActiveOperation",
"(",
"A",
"attachment",
",",
"ActiveOperation",
".",
"CompletedCallback",
"<",
"T",
">",
"callback",
")",
"{",
"return",
"registerActiveOperation",
"("... | Register an active operation. The operation-id will be generated.
@param attachment the shared attachment
@param callback the completed callback
@return the active operation | [
"Register",
"an",
"active",
"operation",
".",
"The",
"operation",
"-",
"id",
"will",
"be",
"generated",
"."
] | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/protocol/src/main/java/org/jboss/as/protocol/mgmt/AbstractMessageHandler.java#L352-L354 |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java | HibernateLayer.getBoundsLocal | private Envelope getBoundsLocal(Filter filter) throws LayerException {
"""
Bounds are calculated locally, can use any filter, but slower than native.
@param filter
filter which needs to be applied
@return the bounds of the specified features
@throws LayerException
oops
"""
try {
Session session = g... | java | private Envelope getBoundsLocal(Filter filter) throws LayerException {
try {
Session session = getSessionFactory().getCurrentSession();
Criteria criteria = session.createCriteria(getFeatureInfo().getDataSourceName());
CriteriaVisitor visitor = new CriteriaVisitor((HibernateFeatureModel) getFeatureModel(), da... | [
"private",
"Envelope",
"getBoundsLocal",
"(",
"Filter",
"filter",
")",
"throws",
"LayerException",
"{",
"try",
"{",
"Session",
"session",
"=",
"getSessionFactory",
"(",
")",
".",
"getCurrentSession",
"(",
")",
";",
"Criteria",
"criteria",
"=",
"session",
".",
... | Bounds are calculated locally, can use any filter, but slower than native.
@param filter
filter which needs to be applied
@return the bounds of the specified features
@throws LayerException
oops | [
"Bounds",
"are",
"calculated",
"locally",
"can",
"use",
"any",
"filter",
"but",
"slower",
"than",
"native",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayer.java#L484-L507 |
alibaba/jstorm | jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormUtils.java | JStormUtils.launchProcess | public static String launchProcess(final String command,
final Map<String, String> environment, boolean backend) throws IOException {
"""
it should use DefaultExecutor to start a process,
but some little problem have been found,
such as exitCode/output string so still use t... | java | public static String launchProcess(final String command,
final Map<String, String> environment, boolean backend) throws IOException {
String[] cmds = command.split(" ");
ArrayList<String> cmdList = new ArrayList<>();
for (String tok : cmds) {
i... | [
"public",
"static",
"String",
"launchProcess",
"(",
"final",
"String",
"command",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"environment",
",",
"boolean",
"backend",
")",
"throws",
"IOException",
"{",
"String",
"[",
"]",
"cmds",
"=",
"command",... | it should use DefaultExecutor to start a process,
but some little problem have been found,
such as exitCode/output string so still use the old method to start process
@param command command to be executed
@param environment env vars
@param backend whether the command is executed at backend
@return outputString... | [
"it",
"should",
"use",
"DefaultExecutor",
"to",
"start",
"a",
"process",
"but",
"some",
"little",
"problem",
"have",
"been",
"found",
"such",
"as",
"exitCode",
"/",
"output",
"string",
"so",
"still",
"use",
"the",
"old",
"method",
"to",
"start",
"process"
] | train | https://github.com/alibaba/jstorm/blob/5d6cde22dbca7df3d6e6830bf94f98a6639ab559/jstorm-core/src/main/java/com/alibaba/jstorm/utils/JStormUtils.java#L764-L776 |
davidmarquis/fluent-interface-proxy | src/main/java/com/fluentinterface/beans/ObjectWrapper.java | ObjectWrapper.setMappedValue | public void setMappedValue(String propertyName, Object key, Object value) {
"""
Sets the value of the specified mapped property in the wrapped object.
@param propertyName the name of the mapped property whose value is to be extracted, cannot be {@code null}
@param key the mapped key of the property va... | java | public void setMappedValue(String propertyName, Object key, Object value) {
setMappedValue(object, getPropertyOrThrow(bean, propertyName), key, value, this);
} | [
"public",
"void",
"setMappedValue",
"(",
"String",
"propertyName",
",",
"Object",
"key",
",",
"Object",
"value",
")",
"{",
"setMappedValue",
"(",
"object",
",",
"getPropertyOrThrow",
"(",
"bean",
",",
"propertyName",
")",
",",
"key",
",",
"value",
",",
"this... | Sets the value of the specified mapped property in the wrapped object.
@param propertyName the name of the mapped property whose value is to be extracted, cannot be {@code null}
@param key the mapped key of the property value to be set
@param value the property value to set, can be {@code null}
@throws... | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"mapped",
"property",
"in",
"the",
"wrapped",
"object",
"."
] | train | https://github.com/davidmarquis/fluent-interface-proxy/blob/8e72fff6cd1f496c76a01773269caead994fea65/src/main/java/com/fluentinterface/beans/ObjectWrapper.java#L376-L378 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java | FeaturesImpl.updatePhraseList | public OperationStatus updatePhraseList(UUID appId, String versionId, int phraselistId, UpdatePhraseListOptionalParameter updatePhraseListOptionalParameter) {
"""
Updates the phrases, the state and the name of the phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phr... | java | public OperationStatus updatePhraseList(UUID appId, String versionId, int phraselistId, UpdatePhraseListOptionalParameter updatePhraseListOptionalParameter) {
return updatePhraseListWithServiceResponseAsync(appId, versionId, phraselistId, updatePhraseListOptionalParameter).toBlocking().single().body();
} | [
"public",
"OperationStatus",
"updatePhraseList",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"int",
"phraselistId",
",",
"UpdatePhraseListOptionalParameter",
"updatePhraseListOptionalParameter",
")",
"{",
"return",
"updatePhraseListWithServiceResponseAsync",
"(",
"... | Updates the phrases, the state and the name of the phraselist feature.
@param appId The application ID.
@param versionId The version ID.
@param phraselistId The ID of the feature to be updated.
@param updatePhraseListOptionalParameter the object representing the optional parameters to be set before calling this API
@t... | [
"Updates",
"the",
"phrases",
"the",
"state",
"and",
"the",
"name",
"of",
"the",
"phraselist",
"feature",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/FeaturesImpl.java#L646-L648 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/LegacyJobLockFactoryManager.java | LegacyJobLockFactoryManager.getJobLock | public static JobLock getJobLock(Properties properties, JobLockEventListener jobLockEventListener)
throws JobLockException {
"""
Gets an instance of {@link JobLock}.
@param properties the properties used to determine which instance of {@link JobLock} to create and the
relevant settings
@param jobLoc... | java | public static JobLock getJobLock(Properties properties, JobLockEventListener jobLockEventListener)
throws JobLockException {
Preconditions.checkNotNull(properties);
Preconditions.checkNotNull(jobLockEventListener);
JobLock jobLock;
if (properties.containsKey(ConfigurationKeys.JOB_LOCK_TYPE)) {... | [
"public",
"static",
"JobLock",
"getJobLock",
"(",
"Properties",
"properties",
",",
"JobLockEventListener",
"jobLockEventListener",
")",
"throws",
"JobLockException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"properties",
")",
";",
"Preconditions",
".",
"checkNotN... | Gets an instance of {@link JobLock}.
@param properties the properties used to determine which instance of {@link JobLock} to create and the
relevant settings
@param jobLockEventListener the {@link JobLock} event listener
@return an instance of {@link JobLock}
@throws JobLockException throw when the {@link JobLock} fai... | [
"Gets",
"an",
"instance",
"of",
"{",
"@link",
"JobLock",
"}",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/locks/LegacyJobLockFactoryManager.java#L46-L67 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/CharTrieIndex.java | CharTrieIndex.indexWords | public static CharTrie indexWords(Collection<String> documents, int maxLevels, int minWeight) {
"""
Index words char trie.
@param documents the documents
@param maxLevels the max levels
@param minWeight the min weight
@return the char trie
"""
return create(documents, maxLevels, minWeight, true);
} | java | public static CharTrie indexWords(Collection<String> documents, int maxLevels, int minWeight) {
return create(documents, maxLevels, minWeight, true);
} | [
"public",
"static",
"CharTrie",
"indexWords",
"(",
"Collection",
"<",
"String",
">",
"documents",
",",
"int",
"maxLevels",
",",
"int",
"minWeight",
")",
"{",
"return",
"create",
"(",
"documents",
",",
"maxLevels",
",",
"minWeight",
",",
"true",
")",
";",
"... | Index words char trie.
@param documents the documents
@param maxLevels the max levels
@param minWeight the min weight
@return the char trie | [
"Index",
"words",
"char",
"trie",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/CharTrieIndex.java#L77-L79 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java | CreateMapProcessor.saveSvgFile | public static void saveSvgFile(final SVGGraphics2D graphics2d, final File path) throws IOException {
"""
Save a SVG graphic to the given path.
@param graphics2d The SVG graphic to save.
@param path The file.
"""
try (FileOutputStream fs = new FileOutputStream(path);
OutputStreamWriter ... | java | public static void saveSvgFile(final SVGGraphics2D graphics2d, final File path) throws IOException {
try (FileOutputStream fs = new FileOutputStream(path);
OutputStreamWriter outputStreamWriter = new OutputStreamWriter(fs, StandardCharsets.UTF_8);
Writer osw = new BufferedWriter(output... | [
"public",
"static",
"void",
"saveSvgFile",
"(",
"final",
"SVGGraphics2D",
"graphics2d",
",",
"final",
"File",
"path",
")",
"throws",
"IOException",
"{",
"try",
"(",
"FileOutputStream",
"fs",
"=",
"new",
"FileOutputStream",
"(",
"path",
")",
";",
"OutputStreamWri... | Save a SVG graphic to the given path.
@param graphics2d The SVG graphic to save.
@param path The file. | [
"Save",
"a",
"SVG",
"graphic",
"to",
"the",
"given",
"path",
"."
] | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/processor/map/CreateMapProcessor.java#L211-L218 |
petergeneric/stdlib | stdlib/src/main/java/com/peterphi/std/types/Version.java | Version.overlapping | public static boolean overlapping(Version min1, Version max1, Version min2, Version max2) {
"""
Determines if 2 version ranges have any overlap
@param min1
Version The 1st range
@param max1
Version The 1st range
@param min2
Version The 2nd range
@param max2
Version The 2nd range
@return boolean True i... | java | public static boolean overlapping(Version min1, Version max1, Version min2, Version max2)
{
// Versions overlap if:
// - either Min or Max values are identical (fast test for real scenarios)
// - Min1|Max1 are within the range Min2-Max2
// - Min2|Max2 are within the range Min1-Max1
return min1.equals(min2) ... | [
"public",
"static",
"boolean",
"overlapping",
"(",
"Version",
"min1",
",",
"Version",
"max1",
",",
"Version",
"min2",
",",
"Version",
"max2",
")",
"{",
"// Versions overlap if:",
"// - either Min or Max values are identical (fast test for real scenarios)",
"// - Min1|Max1 are... | Determines if 2 version ranges have any overlap
@param min1
Version The 1st range
@param max1
Version The 1st range
@param min2
Version The 2nd range
@param max2
Version The 2nd range
@return boolean True if the version ranges overlap | [
"Determines",
"if",
"2",
"version",
"ranges",
"have",
"any",
"overlap"
] | train | https://github.com/petergeneric/stdlib/blob/d4025d2f881bc0542b1e004c5f65a1ccaf895836/stdlib/src/main/java/com/peterphi/std/types/Version.java#L210-L219 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java | LogUtils.getLogger | public static Logger getLogger(Class<?> cls, String resourcename) {
"""
Get a Logger with an associated resource bundle.
@param cls the Class to contain the Logger
@param resourcename the resource name
@return an appropriate Logger
"""
//Liberty Change for CXF Begin
return createLogger(cls... | java | public static Logger getLogger(Class<?> cls, String resourcename) {
//Liberty Change for CXF Begin
return createLogger(cls, resourcename, cls.getName() + cls.getClassLoader());
//Liberty Change for CXF End
} | [
"public",
"static",
"Logger",
"getLogger",
"(",
"Class",
"<",
"?",
">",
"cls",
",",
"String",
"resourcename",
")",
"{",
"//Liberty Change for CXF Begin",
"return",
"createLogger",
"(",
"cls",
",",
"resourcename",
",",
"cls",
".",
"getName",
"(",
")",
"+",
"c... | Get a Logger with an associated resource bundle.
@param cls the Class to contain the Logger
@param resourcename the resource name
@return an appropriate Logger | [
"Get",
"a",
"Logger",
"with",
"an",
"associated",
"resource",
"bundle",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jaxrs.2.0.common/src/org/apache/cxf/common/logging/LogUtils.java#L175-L179 |
apache/groovy | src/main/groovy/groovy/lang/BenchmarkInterceptor.java | BenchmarkInterceptor.afterInvoke | public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {
"""
This code is executed after the method is called.
@param object receiver object for the called method
@param methodName name of the called method
@param arguments arguments to the called method
@p... | java | public Object afterInvoke(Object object, String methodName, Object[] arguments, Object result) {
((List) calls.get(methodName)).add(System.currentTimeMillis());
return result;
} | [
"public",
"Object",
"afterInvoke",
"(",
"Object",
"object",
",",
"String",
"methodName",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"result",
")",
"{",
"(",
"(",
"List",
")",
"calls",
".",
"get",
"(",
"methodName",
")",
")",
".",
"add",
"(",
... | This code is executed after the method is called.
@param object receiver object for the called method
@param methodName name of the called method
@param arguments arguments to the called method
@param result result of the executed method call or result of beforeInvoke if method was not called
@retu... | [
"This",
"code",
"is",
"executed",
"after",
"the",
"method",
"is",
"called",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/lang/BenchmarkInterceptor.java#L89-L92 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/query/Index.java | Index.dropPrimaryIndex | public static UsingPath dropPrimaryIndex(String namespace, String keyspace) {
"""
Drop the primary index of the given namespace:keyspace.
@param namespace the namespace prefix (will be escaped).
@param keyspace the keyspace (bucket, will be escaped).
@see #dropNamedPrimaryIndex(String, String, String) if the ... | java | public static UsingPath dropPrimaryIndex(String namespace, String keyspace) {
return new DefaultDropPath().dropPrimary(namespace, keyspace);
} | [
"public",
"static",
"UsingPath",
"dropPrimaryIndex",
"(",
"String",
"namespace",
",",
"String",
"keyspace",
")",
"{",
"return",
"new",
"DefaultDropPath",
"(",
")",
".",
"dropPrimary",
"(",
"namespace",
",",
"keyspace",
")",
";",
"}"
] | Drop the primary index of the given namespace:keyspace.
@param namespace the namespace prefix (will be escaped).
@param keyspace the keyspace (bucket, will be escaped).
@see #dropNamedPrimaryIndex(String, String, String) if the primary index name has been customized. | [
"Drop",
"the",
"primary",
"index",
"of",
"the",
"given",
"namespace",
":",
"keyspace",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/query/Index.java#L106-L108 |
attribyte/wpdb | src/main/java/org/attribyte/wp/model/Post.java | Post.withTaxonomyTerms | public final Post withTaxonomyTerms(final Map<String, List<TaxonomyTerm>> taxonomyTerms) {
"""
Adds taxonomy terms to a post.
@param taxonomyTerms The taxonomy terms.
@return The post with taxonomy terms added.
"""
ImmutableMap.Builder<String, ImmutableList<TaxonomyTerm>> builder = ImmutableMap.builder... | java | public final Post withTaxonomyTerms(final Map<String, List<TaxonomyTerm>> taxonomyTerms) {
ImmutableMap.Builder<String, ImmutableList<TaxonomyTerm>> builder = ImmutableMap.builder();
if(taxonomyTerms != null && taxonomyTerms.size() > 0) {
taxonomyTerms.entrySet().forEach(kv -> builder.put(kv.getKey... | [
"public",
"final",
"Post",
"withTaxonomyTerms",
"(",
"final",
"Map",
"<",
"String",
",",
"List",
"<",
"TaxonomyTerm",
">",
">",
"taxonomyTerms",
")",
"{",
"ImmutableMap",
".",
"Builder",
"<",
"String",
",",
"ImmutableList",
"<",
"TaxonomyTerm",
">",
">",
"bu... | Adds taxonomy terms to a post.
@param taxonomyTerms The taxonomy terms.
@return The post with taxonomy terms added. | [
"Adds",
"taxonomy",
"terms",
"to",
"a",
"post",
"."
] | train | https://github.com/attribyte/wpdb/blob/b9adf6131dfb67899ebff770c9bfeb001cc42f30/src/main/java/org/attribyte/wp/model/Post.java#L740-L748 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/SchemaRepositoryParser.java | SchemaRepositoryParser.registerXmlSchemaRepository | private void registerXmlSchemaRepository(Element element, ParserContext parserContext) {
"""
Registers a XsdSchemaRepository definition in the parser context
@param element The element to be converted into a XmlSchemaRepository definition
@param parserContext The parser context to add the definitions to
"""
... | java | private void registerXmlSchemaRepository(Element element, ParserContext parserContext) {
BeanDefinitionBuilder builder = BeanDefinitionBuilder.genericBeanDefinition(XsdSchemaRepository.class);
BeanDefinitionParserUtils.setPropertyReference(builder, element.getAttribute("schema-mapping-strategy"), "schem... | [
"private",
"void",
"registerXmlSchemaRepository",
"(",
"Element",
"element",
",",
"ParserContext",
"parserContext",
")",
"{",
"BeanDefinitionBuilder",
"builder",
"=",
"BeanDefinitionBuilder",
".",
"genericBeanDefinition",
"(",
"XsdSchemaRepository",
".",
"class",
")",
";"... | Registers a XsdSchemaRepository definition in the parser context
@param element The element to be converted into a XmlSchemaRepository definition
@param parserContext The parser context to add the definitions to | [
"Registers",
"a",
"XsdSchemaRepository",
"definition",
"in",
"the",
"parser",
"context"
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/SchemaRepositoryParser.java#L81-L87 |
iig-uni-freiburg/SEWOL | ext/org/deckfour/xes/extension/std/XCostExtension.java | XCostExtension.assignCurrencyPrivate | private void assignCurrencyPrivate(XAttributable element, String currency) {
"""
/*
Assigns any element its cost currency, as defined by this extension's
currency attribute.
@param element Element to assign cost currency to.
@param total The currency to be assigned.
"""
if (currency != null && curre... | java | private void assignCurrencyPrivate(XAttributable element, String currency) {
if (currency != null && currency.trim().length() > 0) {
XAttributeLiteral attr = (XAttributeLiteral) ATTR_CURRENCY.clone();
attr.setValue(currency);
element.getAttributes().put(KEY_CURRENCY, attr);
}
} | [
"private",
"void",
"assignCurrencyPrivate",
"(",
"XAttributable",
"element",
",",
"String",
"currency",
")",
"{",
"if",
"(",
"currency",
"!=",
"null",
"&&",
"currency",
".",
"trim",
"(",
")",
".",
"length",
"(",
")",
">",
"0",
")",
"{",
"XAttributeLiteral"... | /*
Assigns any element its cost currency, as defined by this extension's
currency attribute.
@param element Element to assign cost currency to.
@param total The currency to be assigned. | [
"/",
"*",
"Assigns",
"any",
"element",
"its",
"cost",
"currency",
"as",
"defined",
"by",
"this",
"extension",
"s",
"currency",
"attribute",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/ext/org/deckfour/xes/extension/std/XCostExtension.java#L325-L331 |
loldevs/riotapi | rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsGameInvitationService.java | LcdsGameInvitationService.createArrangedBotTeamLobby | public LobbyStatus createArrangedBotTeamLobby(long queueId, BotDifficulty difficulty) {
"""
Create a premade team lobby for bot games
@param queueId The target queue
@param difficulty The difficulty of the bots
@return The lobby status
"""
return client.sendRpcAndWait(SERVICE, "createArrangedBotTeam... | java | public LobbyStatus createArrangedBotTeamLobby(long queueId, BotDifficulty difficulty) {
return client.sendRpcAndWait(SERVICE, "createArrangedBotTeamLobby", queueId, difficulty);
} | [
"public",
"LobbyStatus",
"createArrangedBotTeamLobby",
"(",
"long",
"queueId",
",",
"BotDifficulty",
"difficulty",
")",
"{",
"return",
"client",
".",
"sendRpcAndWait",
"(",
"SERVICE",
",",
"\"createArrangedBotTeamLobby\"",
",",
"queueId",
",",
"difficulty",
")",
";",
... | Create a premade team lobby for bot games
@param queueId The target queue
@param difficulty The difficulty of the bots
@return The lobby status | [
"Create",
"a",
"premade",
"team",
"lobby",
"for",
"bot",
"games"
] | train | https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/rtmp/src/main/java/net/boreeas/riotapi/rtmp/services/LcdsGameInvitationService.java#L71-L73 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.