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 |
|---|---|---|---|---|---|---|---|---|---|---|
kaazing/java.client | ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java | WrappedByteBuffer.putBufferAt | public WrappedByteBuffer putBufferAt(int index, WrappedByteBuffer v) {
"""
Puts a buffer into the buffer at the specified index.
@param index the index
@param v the WrappedByteBuffer
@return the buffer
"""
// TODO: I believe this method incorrectly moves the position!
// Can't change it ... | java | public WrappedByteBuffer putBufferAt(int index, WrappedByteBuffer v) {
// TODO: I believe this method incorrectly moves the position!
// Can't change it without a code analysis - and this is a public API!
int pos = _buf.position();
_buf.position(index);
_buf.put(v._buf);
... | [
"public",
"WrappedByteBuffer",
"putBufferAt",
"(",
"int",
"index",
",",
"WrappedByteBuffer",
"v",
")",
"{",
"// TODO: I believe this method incorrectly moves the position!",
"// Can't change it without a code analysis - and this is a public API!",
"int",
"pos",
"=",
"_buf",
".",
... | Puts a buffer into the buffer at the specified index.
@param index the index
@param v the WrappedByteBuffer
@return the buffer | [
"Puts",
"a",
"buffer",
"into",
"the",
"buffer",
"at",
"the",
"specified",
"index",
"."
] | train | https://github.com/kaazing/java.client/blob/25ad2ae5bb24aa9d6b79400fce649b518dcfbe26/ws/ws/src/main/java/org/kaazing/gateway/client/util/WrappedByteBuffer.java#L665-L673 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.getAsync | public Observable<SyncMemberInner> getAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
"""
Gets a sync member.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resour... | java | public Observable<SyncMemberInner> getAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).map(new Func1<ServiceResponse<SyncMemberInne... | [
"public",
"Observable",
"<",
"SyncMemberInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
")",
"{",
"return",
"getWithServiceRespons... | Gets a sync member.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hosted.
@param syncGroup... | [
"Gets",
"a",
"sync",
"member",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L164-L171 |
baratine/baratine | framework/src/main/java/com/caucho/v5/util/QDate.java | QDate.formatLocal | public synchronized static String formatLocal(long gmtTime, String format) {
"""
Formats a time in the local time zone.
@param time in milliseconds, GMT, from the epoch.
@param format formatting string.
"""
_localDate.setGMTTime(gmtTime);
return _localDate.format(new CharBuffer(), format).toString... | java | public synchronized static String formatLocal(long gmtTime, String format)
{
_localDate.setGMTTime(gmtTime);
return _localDate.format(new CharBuffer(), format).toString();
} | [
"public",
"synchronized",
"static",
"String",
"formatLocal",
"(",
"long",
"gmtTime",
",",
"String",
"format",
")",
"{",
"_localDate",
".",
"setGMTTime",
"(",
"gmtTime",
")",
";",
"return",
"_localDate",
".",
"format",
"(",
"new",
"CharBuffer",
"(",
")",
",",... | Formats a time in the local time zone.
@param time in milliseconds, GMT, from the epoch.
@param format formatting string. | [
"Formats",
"a",
"time",
"in",
"the",
"local",
"time",
"zone",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/util/QDate.java#L945-L950 |
spring-cloud/spring-cloud-config | spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/encryption/EnvironmentPrefixHelper.java | EnvironmentPrefixHelper.addPrefix | public String addPrefix(Map<String, String> keys, String input) {
"""
Add a prefix to the input text (usually a cipher) consisting of the
<code>{name:value}</code> pairs. The "name" and "profiles" keys are special in that
they are stripped since that information is always available when deriving the keys
in {@l... | java | public String addPrefix(Map<String, String> keys, String input) {
keys.remove(NAME);
keys.remove(PROFILES);
StringBuilder builder = new StringBuilder();
for (String key : keys.keySet()) {
builder.append("{").append(key).append(":").append(keys.get(key)).append("}");
}
builder.append(input);
return buil... | [
"public",
"String",
"addPrefix",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"keys",
",",
"String",
"input",
")",
"{",
"keys",
".",
"remove",
"(",
"NAME",
")",
";",
"keys",
".",
"remove",
"(",
"PROFILES",
")",
";",
"StringBuilder",
"builder",
"=",
... | Add a prefix to the input text (usually a cipher) consisting of the
<code>{name:value}</code> pairs. The "name" and "profiles" keys are special in that
they are stripped since that information is always available when deriving the keys
in {@link #getEncryptorKeys(String, String, String)}.
@param keys name, value pairs
... | [
"Add",
"a",
"prefix",
"to",
"the",
"input",
"text",
"(",
"usually",
"a",
"cipher",
")",
"consisting",
"of",
"the",
"<code",
">",
"{",
"name",
":",
"value",
"}",
"<",
"/",
"code",
">",
"pairs",
".",
"The",
"name",
"and",
"profiles",
"keys",
"are",
"... | train | https://github.com/spring-cloud/spring-cloud-config/blob/6b99631f78bac4e1b521d2cc126c8b2da45d1f1f/spring-cloud-config-server/src/main/java/org/springframework/cloud/config/server/encryption/EnvironmentPrefixHelper.java#L110-L119 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java | ContinuousDistributions.gammaCdf | public static double gammaCdf(double x, double a, double b) {
"""
Calculates the probability from 0 to X under Gamma Distribution
@param x
@param a
@param b
@return
"""
if(a<=0 || b<=0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
... | java | public static double gammaCdf(double x, double a, double b) {
if(a<=0 || b<=0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
double GammaCdf = ContinuousDistributions.gammaCdf(x/b, a);
return GammaCdf;
} | [
"public",
"static",
"double",
"gammaCdf",
"(",
"double",
"x",
",",
"double",
"a",
",",
"double",
"b",
")",
"{",
"if",
"(",
"a",
"<=",
"0",
"||",
"b",
"<=",
"0",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"All the parameters must be positi... | Calculates the probability from 0 to X under Gamma Distribution
@param x
@param a
@param b
@return | [
"Calculates",
"the",
"probability",
"from",
"0",
"to",
"X",
"under",
"Gamma",
"Distribution"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/ContinuousDistributions.java#L356-L364 |
ios-driver/ios-driver | server/src/main/java/org/uiautomation/ios/utils/ZipUtils.java | ZipUtils.extractAppFromURL | public static File extractAppFromURL(URL url) throws IOException {
"""
Downloads zip from from url, extracts it into tmp dir and returns path to
extracted directory
@param url
url to zipped .app or .ipa
@return .app or .ipa file
"""
String fileName = url.toExternalForm().substring(url.toExternalForm(... | java | public static File extractAppFromURL(URL url) throws IOException {
String fileName = url.toExternalForm().substring(url.toExternalForm().lastIndexOf('/') + 1);
File tmpDir = createTmpDir("iosd");
log.fine("tmpDir: " + tmpDir.getAbsolutePath());
File downloadedFile = new File(tmpDir, fileName);
Fil... | [
"public",
"static",
"File",
"extractAppFromURL",
"(",
"URL",
"url",
")",
"throws",
"IOException",
"{",
"String",
"fileName",
"=",
"url",
".",
"toExternalForm",
"(",
")",
".",
"substring",
"(",
"url",
".",
"toExternalForm",
"(",
")",
".",
"lastIndexOf",
"(",
... | Downloads zip from from url, extracts it into tmp dir and returns path to
extracted directory
@param url
url to zipped .app or .ipa
@return .app or .ipa file | [
"Downloads",
"zip",
"from",
"from",
"url",
"extracts",
"it",
"into",
"tmp",
"dir",
"and",
"returns",
"path",
"to",
"extracted",
"directory"
] | train | https://github.com/ios-driver/ios-driver/blob/a9744419508d970fbb1ce18e4326cc624b237c8b/server/src/main/java/org/uiautomation/ios/utils/ZipUtils.java#L40-L61 |
ujmp/universal-java-matrix-package | ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java | Ginv.swapPivot | public static void swapPivot(double[][] source, int diag, double[][] s, double[][] t) {
"""
Swap the matrices so that the largest value is on the pivot
@param source
the matrix to modify
@param diag
the position on the diagonal
@param s
the matrix s
@param t
the matrix t
"""
// get swap row and col... | java | public static void swapPivot(double[][] source, int diag, double[][] s, double[][] t) {
// get swap row and col
int swapRow = diag;
int swapCol = diag;
double maxValue = Math.abs(source[diag][diag]);
int rows = source.length;
int cols = source[0].length;
double abs = 0;
double[] r = null;
for (int row... | [
"public",
"static",
"void",
"swapPivot",
"(",
"double",
"[",
"]",
"[",
"]",
"source",
",",
"int",
"diag",
",",
"double",
"[",
"]",
"[",
"]",
"s",
",",
"double",
"[",
"]",
"[",
"]",
"t",
")",
"{",
"// get swap row and col",
"int",
"swapRow",
"=",
"d... | Swap the matrices so that the largest value is on the pivot
@param source
the matrix to modify
@param diag
the position on the diagonal
@param s
the matrix s
@param t
the matrix t | [
"Swap",
"the",
"matrices",
"so",
"that",
"the",
"largest",
"value",
"is",
"on",
"the",
"pivot"
] | train | https://github.com/ujmp/universal-java-matrix-package/blob/b7e1d293adeadaf35d208ffe8884028d6c06b63b/ujmp-core/src/main/java/org/ujmp/core/doublematrix/calculation/general/decomposition/Ginv.java#L818-L848 |
nguillaumin/slick2d-maven | slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/ControlPanel.java | ControlPanel.addMinMax | protected void addMinMax(String name, MinMaxPanel minMax) {
"""
Add a configurable range panel to the mapping table
@param name The name of the control
@param minMax The panel used to set the range in the emitter
"""
named.put(name, minMax);
minMax.setBounds(0,10+yPos,280,minMax.getOffset());
... | java | protected void addMinMax(String name, MinMaxPanel minMax) {
named.put(name, minMax);
minMax.setBounds(0,10+yPos,280,minMax.getOffset());
minMax.addListener(this);
add(minMax);
yPos+=minMax.getOffset();
} | [
"protected",
"void",
"addMinMax",
"(",
"String",
"name",
",",
"MinMaxPanel",
"minMax",
")",
"{",
"named",
".",
"put",
"(",
"name",
",",
"minMax",
")",
";",
"minMax",
".",
"setBounds",
"(",
"0",
",",
"10",
"+",
"yPos",
",",
"280",
",",
"minMax",
".",
... | Add a configurable range panel to the mapping table
@param name The name of the control
@param minMax The panel used to set the range in the emitter | [
"Add",
"a",
"configurable",
"range",
"panel",
"to",
"the",
"mapping",
"table"
] | train | https://github.com/nguillaumin/slick2d-maven/blob/8251f88a0ed6a70e726d2468842455cd1f80893f/slick2d-peditor/src/main/java/org/newdawn/slick/tools/peditor/ControlPanel.java#L57-L65 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java | VirtualMachinesInner.createOrUpdate | public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
"""
The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters sup... | java | public VirtualMachineInner createOrUpdate(String resourceGroupName, String vmName, VirtualMachineInner parameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().last().body();
} | [
"public",
"VirtualMachineInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineInner",
"parameters",
")",
"{",
"return",
"createOrUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
",",
"parameters"... | The operation to create or update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Create Virtual Machine operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws C... | [
"The",
"operation",
"to",
"create",
"or",
"update",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachinesInner.java#L550-L552 |
hypercube1024/firefly | firefly-common/src/main/java/com/firefly/utils/codec/Base64.java | Base64.encodeBase64 | public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked,
final boolean urlSafe, final int maxResultSize) {
"""
Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
@param binaryData Array con... | java | public static byte[] encodeBase64(final byte[] binaryData, final boolean isChunked,
final boolean urlSafe, final int maxResultSize) {
if (binaryData == null || binaryData.length == 0) {
return binaryData;
}
// Create this so can use the su... | [
"public",
"static",
"byte",
"[",
"]",
"encodeBase64",
"(",
"final",
"byte",
"[",
"]",
"binaryData",
",",
"final",
"boolean",
"isChunked",
",",
"final",
"boolean",
"urlSafe",
",",
"final",
"int",
"maxResultSize",
")",
"{",
"if",
"(",
"binaryData",
"==",
"nu... | Encodes binary data using the base64 algorithm, optionally chunking the output into 76 character blocks.
@param binaryData Array containing binary data to encode.
@param isChunked if <code>true</code> this encoder will chunk the base64 output into 76 character blocks
@param urlSafe if <code>true</code> th... | [
"Encodes",
"binary",
"data",
"using",
"the",
"base64",
"algorithm",
"optionally",
"chunking",
"the",
"output",
"into",
"76",
"character",
"blocks",
"."
] | train | https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly-common/src/main/java/com/firefly/utils/codec/Base64.java#L627-L645 |
morimekta/utils | android-util/src/main/java/android/util/Base64.java | Base64.encodeToString | public static String encodeToString(byte[] source, int off, int len, int options) {
"""
Encodes a byte array into Base64 notation.
@param source The data to convert
@param off Offset in array where conversion should begin
@param len Length of data to convert
@param options Specified options
@return The Base... | java | public static String encodeToString(byte[] source, int off, int len, int options) {
byte[] encoded = encode(source, off, len, options);
return new String(encoded, UTF_8);
} | [
"public",
"static",
"String",
"encodeToString",
"(",
"byte",
"[",
"]",
"source",
",",
"int",
"off",
",",
"int",
"len",
",",
"int",
"options",
")",
"{",
"byte",
"[",
"]",
"encoded",
"=",
"encode",
"(",
"source",
",",
"off",
",",
"len",
",",
"options",... | Encodes a byte array into Base64 notation.
@param source The data to convert
@param off Offset in array where conversion should begin
@param len Length of data to convert
@param options Specified options
@return The Base64-encoded data as a String
@see Base64#NO_WRAP
@throws NullPointerException if source array is nul... | [
"Encodes",
"a",
"byte",
"array",
"into",
"Base64",
"notation",
"."
] | train | https://github.com/morimekta/utils/blob/dc987485902f1a7d58169c89c61db97425a6226d/android-util/src/main/java/android/util/Base64.java#L348-L351 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/detect/StreamResourceTracker.java | StreamResourceTracker.addStreamEscape | public void addStreamEscape(Stream source, Location target) {
"""
Indicate that a stream escapes at the given target Location.
@param source
the Stream that is escaping
@param target
the target Location (where the stream escapes)
"""
StreamEscape streamEscape = new StreamEscape(source, target);
... | java | public void addStreamEscape(Stream source, Location target) {
StreamEscape streamEscape = new StreamEscape(source, target);
streamEscapeSet.add(streamEscape);
if (FindOpenStream.DEBUG) {
System.out.println("Adding potential stream escape " + streamEscape);
}
} | [
"public",
"void",
"addStreamEscape",
"(",
"Stream",
"source",
",",
"Location",
"target",
")",
"{",
"StreamEscape",
"streamEscape",
"=",
"new",
"StreamEscape",
"(",
"source",
",",
"target",
")",
";",
"streamEscapeSet",
".",
"add",
"(",
"streamEscape",
")",
";",... | Indicate that a stream escapes at the given target Location.
@param source
the Stream that is escaping
@param target
the target Location (where the stream escapes) | [
"Indicate",
"that",
"a",
"stream",
"escapes",
"at",
"the",
"given",
"target",
"Location",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/detect/StreamResourceTracker.java#L118-L124 |
JodaOrg/joda-time | src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java | BasicMonthOfYearDateTimeField.addWrapField | public long addWrapField(long instant, int months) {
"""
Add to the Month component of the specified time instant
wrapping around within that component if necessary.
@see org.joda.time.DateTimeField#addWrapField
@param instant the time instant in millis to update.
@param months the months to add (can be ne... | java | public long addWrapField(long instant, int months) {
return set(instant, FieldUtils.getWrappedValue(get(instant), months, MIN, iMax));
} | [
"public",
"long",
"addWrapField",
"(",
"long",
"instant",
",",
"int",
"months",
")",
"{",
"return",
"set",
"(",
"instant",
",",
"FieldUtils",
".",
"getWrappedValue",
"(",
"get",
"(",
"instant",
")",
",",
"months",
",",
"MIN",
",",
"iMax",
")",
")",
";"... | Add to the Month component of the specified time instant
wrapping around within that component if necessary.
@see org.joda.time.DateTimeField#addWrapField
@param instant the time instant in millis to update.
@param months the months to add (can be negative).
@return the updated time instant. | [
"Add",
"to",
"the",
"Month",
"component",
"of",
"the",
"specified",
"time",
"instant",
"wrapping",
"around",
"within",
"that",
"component",
"if",
"necessary",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/chrono/BasicMonthOfYearDateTimeField.java#L248-L250 |
UrielCh/ovh-java-sdk | ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java | ApiOvhOrder.vps_serviceName_upgrade_GET | public ArrayList<String> vps_serviceName_upgrade_GET(String serviceName, String model) throws IOException {
"""
Get allowed durations for 'upgrade' option
REST: GET /order/vps/{serviceName}/upgrade
@param model [required] Model
@param serviceName [required] The internal name of your VPS offer
"""
String... | java | public ArrayList<String> vps_serviceName_upgrade_GET(String serviceName, String model) throws IOException {
String qPath = "/order/vps/{serviceName}/upgrade";
StringBuilder sb = path(qPath, serviceName);
query(sb, "model", model);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t... | [
"public",
"ArrayList",
"<",
"String",
">",
"vps_serviceName_upgrade_GET",
"(",
"String",
"serviceName",
",",
"String",
"model",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/order/vps/{serviceName}/upgrade\"",
";",
"StringBuilder",
"sb",
"=",
"path",
... | Get allowed durations for 'upgrade' option
REST: GET /order/vps/{serviceName}/upgrade
@param model [required] Model
@param serviceName [required] The internal name of your VPS offer | [
"Get",
"allowed",
"durations",
"for",
"upgrade",
"option"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L3453-L3459 |
Azure/azure-sdk-for-java | sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java | DatabasesInner.listByRecommendedElasticPoolAsync | public Observable<List<DatabaseInner>> listByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName) {
"""
Returns a list of databases inside a recommented elastic pool.
@param resourceGroupName The name of the resource group that contains the resource. You ca... | java | public Observable<List<DatabaseInner>> listByRecommendedElasticPoolAsync(String resourceGroupName, String serverName, String recommendedElasticPoolName) {
return listByRecommendedElasticPoolWithServiceResponseAsync(resourceGroupName, serverName, recommendedElasticPoolName).map(new Func1<ServiceResponse<List<Dat... | [
"public",
"Observable",
"<",
"List",
"<",
"DatabaseInner",
">",
">",
"listByRecommendedElasticPoolAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"recommendedElasticPoolName",
")",
"{",
"return",
"listByRecommendedElasticPoolWithServi... | Returns a list of databases inside a recommented elastic pool.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param recommendedElasticPoolName The name of the rec... | [
"Returns",
"a",
"list",
"of",
"databases",
"inside",
"a",
"recommented",
"elastic",
"pool",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/DatabasesInner.java#L1666-L1673 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/util/PropertyUtils.java | PropertyUtils.setProperty | public static void setProperty(Object bean, String name, Object value)
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
"""
Set the value of the specified simple property of the specified bean,
with no type conversions.
@param bean
Bean whose property is to be modified
@pa... | java | public static void setProperty(Object bean, String name, Object value)
throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {
if (bean == null) {
throw new IllegalArgumentException("No bean specified");
}
if (name == null) {
throw new IllegalArgumentException("No name specifie... | [
"public",
"static",
"void",
"setProperty",
"(",
"Object",
"bean",
",",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"IllegalAccessException",
",",
"InvocationTargetException",
",",
"NoSuchMethodException",
"{",
"if",
"(",
"bean",
"==",
"null",
")",
"... | Set the value of the specified simple property of the specified bean,
with no type conversions.
@param bean
Bean whose property is to be modified
@param name
Name of the property to be modified
@param value
Value to which the property should be set
@exception IllegalAccessException
if the caller does not have access ... | [
"Set",
"the",
"value",
"of",
"the",
"specified",
"simple",
"property",
"of",
"the",
"specified",
"bean",
"with",
"no",
"type",
"conversions",
"."
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/util/PropertyUtils.java#L191-L217 |
ngageoint/geopackage-android-map | geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java | StyleUtils.setFeatureStyle | public static boolean setFeatureStyle(MarkerOptions markerOptions, GeoPackage geoPackage, FeatureRow featureRow, float density, IconCache iconCache) {
"""
Set the feature row style (icon or style) into the marker options
@param markerOptions marker options
@param geoPackage GeoPackage
@param featureRow ... | java | public static boolean setFeatureStyle(MarkerOptions markerOptions, GeoPackage geoPackage, FeatureRow featureRow, float density, IconCache iconCache) {
FeatureStyleExtension featureStyleExtension = new FeatureStyleExtension(geoPackage);
return setFeatureStyle(markerOptions, featureStyleExtension, featu... | [
"public",
"static",
"boolean",
"setFeatureStyle",
"(",
"MarkerOptions",
"markerOptions",
",",
"GeoPackage",
"geoPackage",
",",
"FeatureRow",
"featureRow",
",",
"float",
"density",
",",
"IconCache",
"iconCache",
")",
"{",
"FeatureStyleExtension",
"featureStyleExtension",
... | Set the feature row style (icon or style) into the marker options
@param markerOptions marker options
@param geoPackage GeoPackage
@param featureRow feature row
@param density display density: {@link android.util.DisplayMetrics#density}
@param iconCache icon cache
@return true if icon or style was set ... | [
"Set",
"the",
"feature",
"row",
"style",
"(",
"icon",
"or",
"style",
")",
"into",
"the",
"marker",
"options"
] | train | https://github.com/ngageoint/geopackage-android-map/blob/634d78468a5c52d2bc98791cc7ff03981ebf573b/geopackage-map/src/main/java/mil/nga/geopackage/map/features/StyleUtils.java#L79-L84 |
forge/core | maven/impl-projects/src/main/java/org/jboss/forge/addon/maven/projects/MavenFacetImpl.java | MavenFacetImpl.doExecuteMavenEmbedded | private boolean doExecuteMavenEmbedded(final PrintStream out, final PrintStream err, final List<String> list) {
"""
The embedded maven CLI uses the java logging API to output the log. <br/>
Since we never write the log to the console, we need register a logging handler.
@author <a href="ggastald@redhat.com">Ge... | java | private boolean doExecuteMavenEmbedded(final PrintStream out, final PrintStream err, final List<String> list)
{
// Have we asked for quiet mode?
final boolean quiet = list.contains("-q") || list.contains("--quiet");
final String[] params = list.toArray(new String[list.size()]);
// Get root lo... | [
"private",
"boolean",
"doExecuteMavenEmbedded",
"(",
"final",
"PrintStream",
"out",
",",
"final",
"PrintStream",
"err",
",",
"final",
"List",
"<",
"String",
">",
"list",
")",
"{",
"// Have we asked for quiet mode?",
"final",
"boolean",
"quiet",
"=",
"list",
".",
... | The embedded maven CLI uses the java logging API to output the log. <br/>
Since we never write the log to the console, we need register a logging handler.
@author <a href="ggastald@redhat.com">George Gastaldi</a> | [
"The",
"embedded",
"maven",
"CLI",
"uses",
"the",
"java",
"logging",
"API",
"to",
"output",
"the",
"log",
".",
"<br",
"/",
">",
"Since",
"we",
"never",
"write",
"the",
"log",
"to",
"the",
"console",
"we",
"need",
"register",
"a",
"logging",
"handler",
... | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/impl-projects/src/main/java/org/jboss/forge/addon/maven/projects/MavenFacetImpl.java#L276-L307 |
j-a-w-r/jawr | jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/mapper/AbstractResourceMapper.java | AbstractResourceMapper.addBundleToMap | protected final void addBundleToMap(String bundleId, String mapping) throws DuplicateBundlePathException {
"""
Add a bundle and its mapping to the resulting Map.
@param bundleId
the bundle Id
@param mapping
the mapping
@throws DuplicateBundlePathException
if we try to add a bundle with a name, which alread... | java | protected final void addBundleToMap(String bundleId, String mapping) throws DuplicateBundlePathException {
for (JoinableResourceBundle bundle : currentBundles) {
if (bundleId.equals(bundle.getId()) || this.bundleMapping.containsKey(bundleId)) {
Marker fatal = MarkerFactory.getMarker("FATAL");
LOGGER.error... | [
"protected",
"final",
"void",
"addBundleToMap",
"(",
"String",
"bundleId",
",",
"String",
"mapping",
")",
"throws",
"DuplicateBundlePathException",
"{",
"for",
"(",
"JoinableResourceBundle",
"bundle",
":",
"currentBundles",
")",
"{",
"if",
"(",
"bundleId",
".",
"e... | Add a bundle and its mapping to the resulting Map.
@param bundleId
the bundle Id
@param mapping
the mapping
@throws DuplicateBundlePathException
if we try to add a bundle with a name, which already exists. | [
"Add",
"a",
"bundle",
"and",
"its",
"mapping",
"to",
"the",
"resulting",
"Map",
"."
] | train | https://github.com/j-a-w-r/jawr/blob/1fa7cd46ebcd36908bd90b298ca316fa5b0c1b0d/jawr-core/src/main/java/net/jawr/web/resource/bundle/factory/mapper/AbstractResourceMapper.java#L107-L118 |
cdk/cdk | tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaRangeManipulator.java | MolecularFormulaRangeManipulator.getMaximalFormula | public static IMolecularFormula getMaximalFormula(MolecularFormulaRange mfRange, IChemObjectBuilder builder) {
"""
Returns the maximal occurrence of the IIsotope into IMolecularFormula
from this MolelecularFormulaRange.
@param mfRange The MolecularFormulaRange to analyze
@return A IMolecularFormula contain... | java | public static IMolecularFormula getMaximalFormula(MolecularFormulaRange mfRange, IChemObjectBuilder builder) {
IMolecularFormula formula = builder.newInstance(IMolecularFormula.class);
for (IIsotope isotope : mfRange.isotopes()) {
formula.addIsotope(isotope, mfRange.getIsotopeCountMax(isoto... | [
"public",
"static",
"IMolecularFormula",
"getMaximalFormula",
"(",
"MolecularFormulaRange",
"mfRange",
",",
"IChemObjectBuilder",
"builder",
")",
"{",
"IMolecularFormula",
"formula",
"=",
"builder",
".",
"newInstance",
"(",
"IMolecularFormula",
".",
"class",
")",
";",
... | Returns the maximal occurrence of the IIsotope into IMolecularFormula
from this MolelecularFormulaRange.
@param mfRange The MolecularFormulaRange to analyze
@return A IMolecularFormula containing the maximal occurrence of each isotope | [
"Returns",
"the",
"maximal",
"occurrence",
"of",
"the",
"IIsotope",
"into",
"IMolecularFormula",
"from",
"this",
"MolelecularFormulaRange",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/formula/src/main/java/org/openscience/cdk/tools/manipulator/MolecularFormulaRangeManipulator.java#L91-L99 |
google/error-prone-javac | src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java | MethodBuilder.buildMethodComments | public void buildMethodComments(XMLNode node, Content methodDocTree) {
"""
Build the comments for the method. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation ... | java | public void buildMethodComments(XMLNode node, Content methodDocTree) {
if (!configuration.nocomment) {
ExecutableElement method = currentMethod;
if (utils.getFullBody(currentMethod).isEmpty()) {
DocFinder.Output docs = DocFinder.search(configuration,
... | [
"public",
"void",
"buildMethodComments",
"(",
"XMLNode",
"node",
",",
"Content",
"methodDocTree",
")",
"{",
"if",
"(",
"!",
"configuration",
".",
"nocomment",
")",
"{",
"ExecutableElement",
"method",
"=",
"currentMethod",
";",
"if",
"(",
"utils",
".",
"getFull... | Build the comments for the method. Do nothing if
{@link Configuration#nocomment} is set to true.
@param node the XML element that specifies which components to document
@param methodDocTree the content tree to which the documentation will be added | [
"Build",
"the",
"comments",
"for",
"the",
"method",
".",
"Do",
"nothing",
"if",
"{",
"@link",
"Configuration#nocomment",
"}",
"is",
"set",
"to",
"true",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java#L186-L198 |
beihaifeiwu/dolphin | dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java | AnnotationUtils.findAnnotationDeclaringClass | public static Class<?> findAnnotationDeclaringClass(Class<? extends Annotation> annotationType, Class<?> clazz) {
"""
Find the first {@link Class} in the inheritance hierarchy of the specified {@code clazz}
(including the specified {@code clazz} itself) which declares an annotation for the
specified {@code annot... | java | public static Class<?> findAnnotationDeclaringClass(Class<? extends Annotation> annotationType, Class<?> clazz) {
Assert.notNull(annotationType, "Annotation type must not be null");
if (clazz == null || clazz.equals(Object.class)) {
return null;
}
if (isAnnotationDeclaredLocally(annotationType, clazz)) {
... | [
"public",
"static",
"Class",
"<",
"?",
">",
"findAnnotationDeclaringClass",
"(",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotationType",
",",
"Class",
"<",
"?",
">",
"clazz",
")",
"{",
"Assert",
".",
"notNull",
"(",
"annotationType",
",",
"\"Annot... | Find the first {@link Class} in the inheritance hierarchy of the specified {@code clazz}
(including the specified {@code clazz} itself) which declares an annotation for the
specified {@code annotationType}, or {@code null} if not found. If the supplied
{@code clazz} is {@code null}, {@code null} will be returned.
<p>If... | [
"Find",
"the",
"first",
"{"
] | train | https://github.com/beihaifeiwu/dolphin/blob/b100579cc6986dce5eba5593ebb5fbae7bad9d1a/dolphin-common/src/main/java/com/freetmp/common/annotation/AnnotationUtils.java#L406-L415 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/XMLSerializer.java | XMLSerializer.writeCharacters | public void writeCharacters(final char[] ch, final int start, final int length) throws SAXException {
"""
Write characters.
@param ch character data array
@param start start index
@param length length data to write
@throws SAXException if processing the event failed
@throws IllegalStateException if start el... | java | public void writeCharacters(final char[] ch, final int start, final int length) throws SAXException {
if (elementStack.isEmpty()) {
throw new IllegalStateException("Current state does not allow Character writing");
}
processStartElement();
transformer.characters(ch, start, le... | [
"public",
"void",
"writeCharacters",
"(",
"final",
"char",
"[",
"]",
"ch",
",",
"final",
"int",
"start",
",",
"final",
"int",
"length",
")",
"throws",
"SAXException",
"{",
"if",
"(",
"elementStack",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"... | Write characters.
@param ch character data array
@param start start index
@param length length data to write
@throws SAXException if processing the event failed
@throws IllegalStateException if start element is not open | [
"Write",
"characters",
"."
] | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/XMLSerializer.java#L271-L277 |
treelogic-swe/aws-mock | src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java | MockEC2QueryHandler.createVpc | private CreateVpcResponseType createVpc(final String cidrBlock, final String instanceTenancy) {
"""
Handles "createVpc" request and create new Vpc.
@param cidrBlock : vpc cidrBlock.
@param instanceTenancy : vpc instanceTenancy.
@return a CreateVpcResponseType with new Vpc.
"""
CreateVpcResponseType ... | java | private CreateVpcResponseType createVpc(final String cidrBlock, final String instanceTenancy) {
CreateVpcResponseType ret = new CreateVpcResponseType();
ret.setRequestId(UUID.randomUUID().toString());
MockVpc mockVpc = mockVpcController.createVpc(cidrBlock, instanceTenancy);
VpcType vpc... | [
"private",
"CreateVpcResponseType",
"createVpc",
"(",
"final",
"String",
"cidrBlock",
",",
"final",
"String",
"instanceTenancy",
")",
"{",
"CreateVpcResponseType",
"ret",
"=",
"new",
"CreateVpcResponseType",
"(",
")",
";",
"ret",
".",
"setRequestId",
"(",
"UUID",
... | Handles "createVpc" request and create new Vpc.
@param cidrBlock : vpc cidrBlock.
@param instanceTenancy : vpc instanceTenancy.
@return a CreateVpcResponseType with new Vpc. | [
"Handles",
"createVpc",
"request",
"and",
"create",
"new",
"Vpc",
"."
] | train | https://github.com/treelogic-swe/aws-mock/blob/1d1058c0ebbd0615efa28695481e36ae3ffc58a0/src/main/java/com/tlswe/awsmock/ec2/control/MockEC2QueryHandler.java#L1977-L1990 |
jwtk/jjwt | api/src/main/java/io/jsonwebtoken/lang/Assert.java | Assert.isAssignable | public static void isAssignable(Class superType, Class subType, String message) {
"""
Assert that <code>superType.isAssignableFrom(subType)</code> is <code>true</code>.
<pre class="code">Assert.isAssignable(Number.class, myClass);</pre>
@param superType the super type to check against
@param subType the sub typ... | java | public static void isAssignable(Class superType, Class subType, String message) {
notNull(superType, "Type to check against must not be null");
if (subType == null || !superType.isAssignableFrom(subType)) {
throw new IllegalArgumentException(message + subType + " is not assignable to " + sup... | [
"public",
"static",
"void",
"isAssignable",
"(",
"Class",
"superType",
",",
"Class",
"subType",
",",
"String",
"message",
")",
"{",
"notNull",
"(",
"superType",
",",
"\"Type to check against must not be null\"",
")",
";",
"if",
"(",
"subType",
"==",
"null",
"||"... | Assert that <code>superType.isAssignableFrom(subType)</code> is <code>true</code>.
<pre class="code">Assert.isAssignable(Number.class, myClass);</pre>
@param superType the super type to check against
@param subType the sub type to check
@param message a message which will be prepended to the message produced by
the fun... | [
"Assert",
"that",
"<code",
">",
"superType",
".",
"isAssignableFrom",
"(",
"subType",
")",
"<",
"/",
"code",
">",
"is",
"<code",
">",
"true<",
"/",
"code",
">",
".",
"<pre",
"class",
"=",
"code",
">",
"Assert",
".",
"isAssignable",
"(",
"Number",
".",
... | train | https://github.com/jwtk/jjwt/blob/86b6096946752cffcfbc9b0a5503f1ea195cc140/api/src/main/java/io/jsonwebtoken/lang/Assert.java#L341-L346 |
ManfredTremmel/gwt-commons-lang3 | src/main/java/org/apache/commons/lang3/time/DateUtils.java | DateUtils.getFragmentInMinutes | @GwtIncompatible("incompatible method")
public static long getFragmentInMinutes(final Calendar calendar, final int fragment) {
"""
<p>Returns the number of minutes within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the minutes of any date will only return the numbe... | java | @GwtIncompatible("incompatible method")
public static long getFragmentInMinutes(final Calendar calendar, final int fragment) {
return getFragment(calendar, fragment, TimeUnit.MINUTES);
} | [
"@",
"GwtIncompatible",
"(",
"\"incompatible method\"",
")",
"public",
"static",
"long",
"getFragmentInMinutes",
"(",
"final",
"Calendar",
"calendar",
",",
"final",
"int",
"fragment",
")",
"{",
"return",
"getFragment",
"(",
"calendar",
",",
"fragment",
",",
"TimeU... | <p>Returns the number of minutes within the
fragment. All datefields greater than the fragment will be ignored.</p>
<p>Asking the minutes of any date will only return the number of minutes
of the current hour (resulting in a number between 0 and 59). This
method will retrieve the number of minutes for any fragment.
Fo... | [
"<p",
">",
"Returns",
"the",
"number",
"of",
"minutes",
"within",
"the",
"fragment",
".",
"All",
"datefields",
"greater",
"than",
"the",
"fragment",
"will",
"be",
"ignored",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ManfredTremmel/gwt-commons-lang3/blob/9e2dfbbda3668cfa5d935fe76479d1426c294504/src/main/java/org/apache/commons/lang3/time/DateUtils.java#L1568-L1571 |
alkacon/opencms-core | src/org/opencms/loader/CmsResourceManager.java | CmsResourceManager.addRelationType | public CmsRelationType addRelationType(String name, String type) throws CmsConfigurationException {
"""
Adds a new relation type from the XML configuration to the list of user defined relation types.<p>
@param name the name of the relation type
@param type the type of the relation type, weak or strong
@retu... | java | public CmsRelationType addRelationType(String name, String type) throws CmsConfigurationException {
// check if new relation types can still be added
if (m_frozen) {
throw new CmsConfigurationException(Messages.get().container(Messages.ERR_NO_CONFIG_AFTER_STARTUP_0));
}
Cms... | [
"public",
"CmsRelationType",
"addRelationType",
"(",
"String",
"name",
",",
"String",
"type",
")",
"throws",
"CmsConfigurationException",
"{",
"// check if new relation types can still be added",
"if",
"(",
"m_frozen",
")",
"{",
"throw",
"new",
"CmsConfigurationException",
... | Adds a new relation type from the XML configuration to the list of user defined relation types.<p>
@param name the name of the relation type
@param type the type of the relation type, weak or strong
@return the new created relation type instance
@throws CmsConfigurationException in case the resource manager configur... | [
"Adds",
"a",
"new",
"relation",
"type",
"from",
"the",
"XML",
"configuration",
"to",
"the",
"list",
"of",
"user",
"defined",
"relation",
"types",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/loader/CmsResourceManager.java#L526-L536 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java | IndexElasticsearchUpdater.updateIndexWithSettingsInElasticsearch | @Deprecated
private static void updateIndexWithSettingsInElasticsearch(Client client, String index, String settings) throws Exception {
"""
Update settings in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param settings Settings if any, null if no update settings
@throws Exception ... | java | @Deprecated
private static void updateIndexWithSettingsInElasticsearch(Client client, String index, String settings) throws Exception {
logger.trace("updateIndex([{}])", index);
assert client != null;
assert index != null;
if (settings != null) {
logger.trace("Found update settings for index [{}]: [{}]", ... | [
"@",
"Deprecated",
"private",
"static",
"void",
"updateIndexWithSettingsInElasticsearch",
"(",
"Client",
"client",
",",
"String",
"index",
",",
"String",
"settings",
")",
"throws",
"Exception",
"{",
"logger",
".",
"trace",
"(",
"\"updateIndex([{}])\"",
",",
"index",... | Update settings in Elasticsearch
@param client Elasticsearch client
@param index Index name
@param settings Settings if any, null if no update settings
@throws Exception if the elasticsearch API call is failing | [
"Update",
"settings",
"in",
"Elasticsearch"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/index/IndexElasticsearchUpdater.java#L150-L164 |
hypfvieh/java-utils | src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java | XmlUtil.parseXmlStringWithXsdValidation | public static Document parseXmlStringWithXsdValidation(String _xmlStr, boolean _namespaceAware) throws IOException {
"""
Loads XML from string and uses referenced XSD to validate the content.
This method will use {@link XmlErrorHandlerQuiet} to suppress all errors/warnings when validating.
@param _xmlStr strin... | java | public static Document parseXmlStringWithXsdValidation(String _xmlStr, boolean _namespaceAware) throws IOException {
return parseXmlStringWithXsdValidation(_xmlStr, _namespaceAware, null);
} | [
"public",
"static",
"Document",
"parseXmlStringWithXsdValidation",
"(",
"String",
"_xmlStr",
",",
"boolean",
"_namespaceAware",
")",
"throws",
"IOException",
"{",
"return",
"parseXmlStringWithXsdValidation",
"(",
"_xmlStr",
",",
"_namespaceAware",
",",
"null",
")",
";",... | Loads XML from string and uses referenced XSD to validate the content.
This method will use {@link XmlErrorHandlerQuiet} to suppress all errors/warnings when validating.
@param _xmlStr string to validate
@param _namespaceAware take care of namespace
@return Document
@throws IOException on error | [
"Loads",
"XML",
"from",
"string",
"and",
"uses",
"referenced",
"XSD",
"to",
"validate",
"the",
"content",
".",
"This",
"method",
"will",
"use",
"{",
"@link",
"XmlErrorHandlerQuiet",
"}",
"to",
"suppress",
"all",
"errors",
"/",
"warnings",
"when",
"validating",... | train | https://github.com/hypfvieh/java-utils/blob/407c32d6b485596d4d2b644f5f7fc7a02d0169c6/src/main/java/com/github/hypfvieh/util/xml/XmlUtil.java#L197-L199 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/core/MtoNBroker.java | MtoNBroker.deleteMtoNImplementor | public void deleteMtoNImplementor(CollectionDescriptor cod, Object obj, Iterator collectionIterator, Collection mnKeys) {
"""
deletes all rows from m:n table that are not used in relatedObjects
@param cod
@param obj
@param collectionIterator
@param mnKeys
"""
if(mnKeys.isEmpty() || collectionIte... | java | public void deleteMtoNImplementor(CollectionDescriptor cod, Object obj, Iterator collectionIterator, Collection mnKeys)
{
if(mnKeys.isEmpty() || collectionIterator == null)
{
return;
}
List workList = new ArrayList(mnKeys);
MtoNBroker.Key relatedObjKeys;
... | [
"public",
"void",
"deleteMtoNImplementor",
"(",
"CollectionDescriptor",
"cod",
",",
"Object",
"obj",
",",
"Iterator",
"collectionIterator",
",",
"Collection",
"mnKeys",
")",
"{",
"if",
"(",
"mnKeys",
".",
"isEmpty",
"(",
")",
"||",
"collectionIterator",
"==",
"n... | deletes all rows from m:n table that are not used in relatedObjects
@param cod
@param obj
@param collectionIterator
@param mnKeys | [
"deletes",
"all",
"rows",
"from",
"m",
":",
"n",
"table",
"that",
"are",
"not",
"used",
"in",
"relatedObjects"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/core/MtoNBroker.java#L214-L250 |
bohnman/squiggly-java | src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java | SquigglyUtils.collectify | public static <E> Collection<E> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<E> targetElementType) {
"""
Convert an object to a collection.
@param mapper the object mapper
@param source the source object
@param targetCollect... | java | public static <E> Collection<E> collectify(ObjectMapper mapper, Object source, Class<? extends Collection> targetCollectionType, Class<E> targetElementType) {
CollectionType collectionType = mapper.getTypeFactory().constructCollectionType(targetCollectionType, targetElementType);
return objectify(mapper... | [
"public",
"static",
"<",
"E",
">",
"Collection",
"<",
"E",
">",
"collectify",
"(",
"ObjectMapper",
"mapper",
",",
"Object",
"source",
",",
"Class",
"<",
"?",
"extends",
"Collection",
">",
"targetCollectionType",
",",
"Class",
"<",
"E",
">",
"targetElementTyp... | Convert an object to a collection.
@param mapper the object mapper
@param source the source object
@param targetCollectionType the target collection type
@param targetElementType the target collection element type
@return collection | [
"Convert",
"an",
"object",
"to",
"a",
"collection",
"."
] | train | https://github.com/bohnman/squiggly-java/blob/ba0c0b924ab718225d1ad180273ee63ea6c4f55a/src/main/java/com/github/bohnman/squiggly/util/SquigglyUtils.java#L45-L48 |
Netflix/ribbon | ribbon-transport/src/main/java/com/netflix/ribbon/transport/netty/LoadBalancingRxClient.java | LoadBalancingRxClient.addLoadBalancerListener | private void addLoadBalancerListener() {
"""
Add a listener that is responsible for removing an HttpClient and shutting down
its connection pool if it is no longer available from load balancer.
"""
if (!(lbContext.getLoadBalancer() instanceof BaseLoadBalancer)) {
return;
}
... | java | private void addLoadBalancerListener() {
if (!(lbContext.getLoadBalancer() instanceof BaseLoadBalancer)) {
return;
}
((BaseLoadBalancer) lbContext.getLoadBalancer()).addServerListChangeListener(new ServerListChangeListener() {
@Override
public void se... | [
"private",
"void",
"addLoadBalancerListener",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"lbContext",
".",
"getLoadBalancer",
"(",
")",
"instanceof",
"BaseLoadBalancer",
")",
")",
"{",
"return",
";",
"}",
"(",
"(",
"BaseLoadBalancer",
")",
"lbContext",
".",
"getLoa... | Add a listener that is responsible for removing an HttpClient and shutting down
its connection pool if it is no longer available from load balancer. | [
"Add",
"a",
"listener",
"that",
"is",
"responsible",
"for",
"removing",
"an",
"HttpClient",
"and",
"shutting",
"down",
"its",
"connection",
"pool",
"if",
"it",
"is",
"no",
"longer",
"available",
"from",
"load",
"balancer",
"."
] | train | https://github.com/Netflix/ribbon/blob/d15cd7715b0bf2f64ae6ca98c5e4d184f178e261/ribbon-transport/src/main/java/com/netflix/ribbon/transport/netty/LoadBalancingRxClient.java#L191-L209 |
EdwardRaff/JSAT | JSAT/src/jsat/linear/vectorcollection/KDTree.java | KDTree.getMedianIndex | public int getMedianIndex(final List<Integer> data, int pivot) {
"""
Returns the index for the median, adjusted incase multiple features have the same value.
@param data the dataset to get the median index of
@param pivot the dimension to pivot on, and ensure the median index has a different value on the left si... | java | public int getMedianIndex(final List<Integer> data, int pivot)
{
int medianIndex = data.size()/2;
//What if more than one point have the samve value? Keep incrementing until that dosn't happen
while(medianIndex < data.size()-1 && allVecs.get(data.get(medianIndex)).get(pivot) == allVecs.get(d... | [
"public",
"int",
"getMedianIndex",
"(",
"final",
"List",
"<",
"Integer",
">",
"data",
",",
"int",
"pivot",
")",
"{",
"int",
"medianIndex",
"=",
"data",
".",
"size",
"(",
")",
"/",
"2",
";",
"//What if more than one point have the samve value? Keep incrementing unt... | Returns the index for the median, adjusted incase multiple features have the same value.
@param data the dataset to get the median index of
@param pivot the dimension to pivot on, and ensure the median index has a different value on the left side
@return | [
"Returns",
"the",
"index",
"for",
"the",
"median",
"adjusted",
"incase",
"multiple",
"features",
"have",
"the",
"same",
"value",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/linear/vectorcollection/KDTree.java#L615-L622 |
facebookarchive/hive-dwrf | hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/LazyTreeReader.java | LazyTreeReader.getInComplexType | public Object getInComplexType(Object previous, long row) throws IOException {
"""
Should be called only from containers (lists, maps, structs, unions) since for these tree
readers the number of rows does not correspond to the number of values (e.g. there may
be many more if it contains the entries in lists with... | java | public Object getInComplexType(Object previous, long row) throws IOException {
if (nextIsNullInComplexType()) {
return null;
}
previousRow = row;
return next(previous);
} | [
"public",
"Object",
"getInComplexType",
"(",
"Object",
"previous",
",",
"long",
"row",
")",
"throws",
"IOException",
"{",
"if",
"(",
"nextIsNullInComplexType",
"(",
")",
")",
"{",
"return",
"null",
";",
"}",
"previousRow",
"=",
"row",
";",
"return",
"next",
... | Should be called only from containers (lists, maps, structs, unions) since for these tree
readers the number of rows does not correspond to the number of values (e.g. there may
be many more if it contains the entries in lists with more than one element, or much less
if it is the fields in a struct where every other str... | [
"Should",
"be",
"called",
"only",
"from",
"containers",
"(",
"lists",
"maps",
"structs",
"unions",
")",
"since",
"for",
"these",
"tree",
"readers",
"the",
"number",
"of",
"rows",
"does",
"not",
"correspond",
"to",
"the",
"number",
"of",
"values",
"(",
"e",... | train | https://github.com/facebookarchive/hive-dwrf/blob/a7b4fcf28a57e006a2fc041d40cf7e5ad16e6b45/hive-dwrf/src/main/java/com/facebook/hive/orc/lazy/LazyTreeReader.java#L110-L118 |
qiujiayu/AutoLoadCache | src/main/java/com/jarvis/cache/script/AbstractScriptParser.java | AbstractScriptParser.isAutoload | public boolean isAutoload(Cache cache, Object target, Object[] arguments, Object retVal) throws Exception {
"""
是否可以自动加载
@param cache Cache 注解
@param target AOP 拦截到的实例
@param arguments 参数
@param retVal return value
@return autoload 是否自动加载
@throws Exception 异常
"""
if (cache.opType() =... | java | public boolean isAutoload(Cache cache, Object target, Object[] arguments, Object retVal) throws Exception {
if (cache.opType() == CacheOpType.WRITE) {
return false;
}
boolean autoload = cache.autoload();
if (null != arguments && arguments.length > 0 && null != cache.auto... | [
"public",
"boolean",
"isAutoload",
"(",
"Cache",
"cache",
",",
"Object",
"target",
",",
"Object",
"[",
"]",
"arguments",
",",
"Object",
"retVal",
")",
"throws",
"Exception",
"{",
"if",
"(",
"cache",
".",
"opType",
"(",
")",
"==",
"CacheOpType",
".",
"WRI... | 是否可以自动加载
@param cache Cache 注解
@param target AOP 拦截到的实例
@param arguments 参数
@param retVal return value
@return autoload 是否自动加载
@throws Exception 异常 | [
"是否可以自动加载"
] | train | https://github.com/qiujiayu/AutoLoadCache/blob/8121c146f1a420fa6d6832e849acadb547c13622/src/main/java/com/jarvis/cache/script/AbstractScriptParser.java#L148-L158 |
lamydev/Android-Notification | core/src/zemin/notification/NotificationBoard.java | NotificationBoard.setBodyMargin | public void setBodyMargin(int l, int t, int r, int b) {
"""
Set the margin of the body.
@param l
@param t
@param r
@param b
"""
mBody.setMargin(l, t, r, b);
} | java | public void setBodyMargin(int l, int t, int r, int b) {
mBody.setMargin(l, t, r, b);
} | [
"public",
"void",
"setBodyMargin",
"(",
"int",
"l",
",",
"int",
"t",
",",
"int",
"r",
",",
"int",
"b",
")",
"{",
"mBody",
".",
"setMargin",
"(",
"l",
",",
"t",
",",
"r",
",",
"b",
")",
";",
"}"
] | Set the margin of the body.
@param l
@param t
@param r
@param b | [
"Set",
"the",
"margin",
"of",
"the",
"body",
"."
] | train | https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationBoard.java#L580-L582 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java | JdbcAccessImpl.harvestReturnValue | private void harvestReturnValue(
Object obj,
CallableStatement callable,
FieldDescriptor fmd,
int index)
throws PersistenceBrokerSQLException {
"""
Harvest a single value that was returned by a callable statement.
@param obj the object that will receive the value tha... | java | private void harvestReturnValue(
Object obj,
CallableStatement callable,
FieldDescriptor fmd,
int index)
throws PersistenceBrokerSQLException
{
try
{
// If we have a field descriptor, then we can harvest
// the return value.... | [
"private",
"void",
"harvestReturnValue",
"(",
"Object",
"obj",
",",
"CallableStatement",
"callable",
",",
"FieldDescriptor",
"fmd",
",",
"int",
"index",
")",
"throws",
"PersistenceBrokerSQLException",
"{",
"try",
"{",
"// If we have a field descriptor, then we can harvest\r... | Harvest a single value that was returned by a callable statement.
@param obj the object that will receive the value that is harvested.
@param callable the CallableStatement that contains the value to harvest
@param fmd the FieldDescriptor that identifies the field where the
harvested value will be stord.
@param index ... | [
"Harvest",
"a",
"single",
"value",
"that",
"was",
"returned",
"by",
"a",
"callable",
"statement",
"."
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/JdbcAccessImpl.java#L704-L740 |
hageldave/ImagingKit | ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java | ComplexImg.setComplex_atIndex | public void setComplex_atIndex(int index, double real, double imag) {
"""
Sets real part and imaginary part of the complex number at specified index.
<br>
If {@link #isSynchronizePowerSpectrum()} is true, then this will also
update the corresponding power value.
@param index for the value to be set
@param rea... | java | public void setComplex_atIndex(int index, double real, double imag){
this.real[index] = real;
this.imag[index] = imag;
if(synchronizePowerSpectrum){
computePower(index);
}
} | [
"public",
"void",
"setComplex_atIndex",
"(",
"int",
"index",
",",
"double",
"real",
",",
"double",
"imag",
")",
"{",
"this",
".",
"real",
"[",
"index",
"]",
"=",
"real",
";",
"this",
".",
"imag",
"[",
"index",
"]",
"=",
"imag",
";",
"if",
"(",
"syn... | Sets real part and imaginary part of the complex number at specified index.
<br>
If {@link #isSynchronizePowerSpectrum()} is true, then this will also
update the corresponding power value.
@param index for the value to be set
@param real part
@param imag part | [
"Sets",
"real",
"part",
"and",
"imaginary",
"part",
"of",
"the",
"complex",
"number",
"at",
"specified",
"index",
".",
"<br",
">",
"If",
"{"
] | train | https://github.com/hageldave/ImagingKit/blob/3837c7d550a12cf4dc5718b644ced94b97f52668/ImagingKit_Fourier/src/main/java/hageldave/imagingkit/fourier/ComplexImg.java#L413-L419 |
SQiShER/java-object-diff | src/main/java/de/danielbechler/diff/ObjectDiffer.java | ObjectDiffer.compare | public <T> DiffNode compare(final T working, final T base) {
"""
Recursively inspects the given objects and returns a node representing their differences. Both objects
have be have the same type.
@param working This object will be treated as the successor of the `base` object.
@param base This object will ... | java | public <T> DiffNode compare(final T working, final T base)
{
dispatcher.resetInstanceMemory();
try
{
return dispatcher.dispatch(DiffNode.ROOT, Instances.of(working, base), RootAccessor.getInstance());
}
finally
{
dispatcher.clearInstanceMemory();
}
} | [
"public",
"<",
"T",
">",
"DiffNode",
"compare",
"(",
"final",
"T",
"working",
",",
"final",
"T",
"base",
")",
"{",
"dispatcher",
".",
"resetInstanceMemory",
"(",
")",
";",
"try",
"{",
"return",
"dispatcher",
".",
"dispatch",
"(",
"DiffNode",
".",
"ROOT",... | Recursively inspects the given objects and returns a node representing their differences. Both objects
have be have the same type.
@param working This object will be treated as the successor of the `base` object.
@param base This object will be treated as the predecessor of the <code>working</code> object.
@return ... | [
"Recursively",
"inspects",
"the",
"given",
"objects",
"and",
"returns",
"a",
"node",
"representing",
"their",
"differences",
".",
"Both",
"objects",
"have",
"be",
"have",
"the",
"same",
"type",
"."
] | train | https://github.com/SQiShER/java-object-diff/blob/6f576669d49087f0e825a417cadc3d4c707a4924/src/main/java/de/danielbechler/diff/ObjectDiffer.java#L47-L58 |
wildfly/wildfly-core | controller/src/main/java/org/jboss/as/controller/AttributeMarshaller.java | AttributeMarshaller.marshallAsAttribute | public void marshallAsAttribute(final AttributeDefinition attribute,final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException {
"""
Marshalls the value from the given {@code resourceModel} as an xml element, if it
{@link #isMarshallable(AttributeDefiniti... | java | public void marshallAsAttribute(final AttributeDefinition attribute,final ModelNode resourceModel, final boolean marshallDefault, final XMLStreamWriter writer) throws XMLStreamException{
throw ControllerLogger.ROOT_LOGGER.couldNotMarshalAttributeAsAttribute(attribute.getName());
} | [
"public",
"void",
"marshallAsAttribute",
"(",
"final",
"AttributeDefinition",
"attribute",
",",
"final",
"ModelNode",
"resourceModel",
",",
"final",
"boolean",
"marshallDefault",
",",
"final",
"XMLStreamWriter",
"writer",
")",
"throws",
"XMLStreamException",
"{",
"throw... | Marshalls the value from the given {@code resourceModel} as an xml element, if it
{@link #isMarshallable(AttributeDefinition, org.jboss.dmr.ModelNode, boolean) is marshallable}.
@param attribute - attribute for which marshaling is being done
@param resourceModel the model, a non-null node of {@link org.jboss.dmr.Model... | [
"Marshalls",
"the",
"value",
"from",
"the",
"given",
"{",
"@code",
"resourceModel",
"}",
"as",
"an",
"xml",
"element",
"if",
"it",
"{",
"@link",
"#isMarshallable",
"(",
"AttributeDefinition",
"org",
".",
"jboss",
".",
"dmr",
".",
"ModelNode",
"boolean",
")",... | train | https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/controller/src/main/java/org/jboss/as/controller/AttributeMarshaller.java#L78-L80 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java | AdvancedImpl.style | @Override
public <E> E style(E element, Object data) throws VectorPrintException {
"""
when {@link #DYNAMICDATA} is true call {@link #setData(java.lang.Object) } with {@link #convert(java.lang.Object)
}.
@param <E>
@param element the element to be returned
@param data
@return
@throws VectorPrintExceptio... | java | @Override
public <E> E style(E element, Object data) throws VectorPrintException {
if (getValue(DYNAMICDATA, Boolean.class)) {
setData(convert(data));
}
return element;
} | [
"@",
"Override",
"public",
"<",
"E",
">",
"E",
"style",
"(",
"E",
"element",
",",
"Object",
"data",
")",
"throws",
"VectorPrintException",
"{",
"if",
"(",
"getValue",
"(",
"DYNAMICDATA",
",",
"Boolean",
".",
"class",
")",
")",
"{",
"setData",
"(",
"con... | when {@link #DYNAMICDATA} is true call {@link #setData(java.lang.Object) } with {@link #convert(java.lang.Object)
}.
@param <E>
@param element the element to be returned
@param data
@return
@throws VectorPrintException | [
"when",
"{",
"@link",
"#DYNAMICDATA",
"}",
"is",
"true",
"call",
"{",
"@link",
"#setData",
"(",
"java",
".",
"lang",
".",
"Object",
")",
"}",
"with",
"{",
"@link",
"#convert",
"(",
"java",
".",
"lang",
".",
"Object",
")",
"}",
"."
] | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/style/stylers/AdvancedImpl.java#L203-L209 |
osmdroid/osmdroid | osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java | OsmMapShapeConverter.addLatLngToMap | public static Marker addLatLngToMap(MapView map, GeoPoint latLng,
MarkerOptions options) {
"""
Add a LatLng to the map
@param map
@param latLng
@param options
@return
"""
Marker m = new Marker(map);
m.setPosition(latLng);
if (options!=null) ... | java | public static Marker addLatLngToMap(MapView map, GeoPoint latLng,
MarkerOptions options) {
Marker m = new Marker(map);
m.setPosition(latLng);
if (options!=null) {
if (options.getIcon()!=null){
m.setIcon(options.getIcon());
... | [
"public",
"static",
"Marker",
"addLatLngToMap",
"(",
"MapView",
"map",
",",
"GeoPoint",
"latLng",
",",
"MarkerOptions",
"options",
")",
"{",
"Marker",
"m",
"=",
"new",
"Marker",
"(",
"map",
")",
";",
"m",
".",
"setPosition",
"(",
"latLng",
")",
";",
"if"... | Add a LatLng to the map
@param map
@param latLng
@param options
@return | [
"Add",
"a",
"LatLng",
"to",
"the",
"map"
] | train | https://github.com/osmdroid/osmdroid/blob/3b178b2f078497dd88c137110e87aafe45ad2b16/osmdroid-geopackage/src/main/java/org/osmdroid/gpkg/overlay/OsmMapShapeConverter.java#L682-L697 |
lucee/Lucee | core/src/main/java/lucee/runtime/config/XMLConfigWebFactory.java | XMLConfigWebFactory.createFileFromResourceCheckSizeDiff | static void createFileFromResourceCheckSizeDiff(String resource, Resource file) throws IOException {
"""
creates a File and his content froma a resurce
@param resource
@param file
@throws IOException
"""
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtil.copy(InfoImpl.class.getResourceAsSt... | java | static void createFileFromResourceCheckSizeDiff(String resource, Resource file) throws IOException {
ByteArrayOutputStream baos = new ByteArrayOutputStream();
IOUtil.copy(InfoImpl.class.getResourceAsStream(resource), baos, true, false);
byte[] barr = baos.toByteArray();
if (file.exists()) {
long trgSize = fil... | [
"static",
"void",
"createFileFromResourceCheckSizeDiff",
"(",
"String",
"resource",
",",
"Resource",
"file",
")",
"throws",
"IOException",
"{",
"ByteArrayOutputStream",
"baos",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"IOUtil",
".",
"copy",
"(",
"InfoImpl... | creates a File and his content froma a resurce
@param resource
@param file
@throws IOException | [
"creates",
"a",
"File",
"and",
"his",
"content",
"froma",
"a",
"resurce"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/config/XMLConfigWebFactory.java#L1060-L1079 |
aws/aws-sdk-java | aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/GetIntegrationResponseResult.java | GetIntegrationResponseResult.withResponseParameters | public GetIntegrationResponseResult withResponseParameters(java.util.Map<String, String> responseParameters) {
"""
<p>
A key-value map specifying response parameters that are passed to the method response from the backend. The key
is a method response header parameter name and the mapped value is an integration ... | java | public GetIntegrationResponseResult withResponseParameters(java.util.Map<String, String> responseParameters) {
setResponseParameters(responseParameters);
return this;
} | [
"public",
"GetIntegrationResponseResult",
"withResponseParameters",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"String",
">",
"responseParameters",
")",
"{",
"setResponseParameters",
"(",
"responseParameters",
")",
";",
"return",
"this",
";",
"}"
] | <p>
A key-value map specifying response parameters that are passed to the method response from the backend. The key
is a method response header parameter name and the mapped value is an integration response header value, a static
value enclosed within a pair of single quotes, or a JSON expression from the integration r... | [
"<p",
">",
"A",
"key",
"-",
"value",
"map",
"specifying",
"response",
"parameters",
"that",
"are",
"passed",
"to",
"the",
"method",
"response",
"from",
"the",
"backend",
".",
"The",
"key",
"is",
"a",
"method",
"response",
"header",
"parameter",
"name",
"an... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-apigatewayv2/src/main/java/com/amazonaws/services/apigatewayv2/model/GetIntegrationResponseResult.java#L375-L378 |
igniterealtime/Smack | smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java | LeafNode.deleteAllItems | public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
"""
Purges the node of all items.
<p>Note: Some implementations may keep the last item
sent.
@throws XMPPErrorException
@throws NoResponseException if there was no response from the serv... | java | public void deleteAllItems() throws NoResponseException, XMPPErrorException, NotConnectedException, InterruptedException {
PubSub request = createPubsubPacket(Type.set, new NodeExtension(PubSubElementType.PURGE_OWNER, getId()));
pubSubManager.getConnection().createStanzaCollectorAndSend(request).nextRe... | [
"public",
"void",
"deleteAllItems",
"(",
")",
"throws",
"NoResponseException",
",",
"XMPPErrorException",
",",
"NotConnectedException",
",",
"InterruptedException",
"{",
"PubSub",
"request",
"=",
"createPubsubPacket",
"(",
"Type",
".",
"set",
",",
"new",
"NodeExtensio... | Purges the node of all items.
<p>Note: Some implementations may keep the last item
sent.
@throws XMPPErrorException
@throws NoResponseException if there was no response from the server.
@throws NotConnectedException
@throws InterruptedException | [
"Purges",
"the",
"node",
"of",
"all",
"items",
"."
] | train | https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-extensions/src/main/java/org/jivesoftware/smackx/pubsub/LeafNode.java#L343-L347 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckMethodAdapter.java | CheckMethodAdapter.checkDesc | static void checkDesc(final String desc, final boolean canBeVoid) {
"""
Checks that the given string is a valid type descriptor.
@param desc
the string to be checked.
@param canBeVoid
<tt>true</tt> if <tt>V</tt> can be considered valid.
"""
int end = checkDesc(desc, 0, canBeVoid);
if (end... | java | static void checkDesc(final String desc, final boolean canBeVoid) {
int end = checkDesc(desc, 0, canBeVoid);
if (end != desc.length()) {
throw new IllegalArgumentException("Invalid descriptor: " + desc);
}
} | [
"static",
"void",
"checkDesc",
"(",
"final",
"String",
"desc",
",",
"final",
"boolean",
"canBeVoid",
")",
"{",
"int",
"end",
"=",
"checkDesc",
"(",
"desc",
",",
"0",
",",
"canBeVoid",
")",
";",
"if",
"(",
"end",
"!=",
"desc",
".",
"length",
"(",
")",... | Checks that the given string is a valid type descriptor.
@param desc
the string to be checked.
@param canBeVoid
<tt>true</tt> if <tt>V</tt> can be considered valid. | [
"Checks",
"that",
"the",
"given",
"string",
"is",
"a",
"valid",
"type",
"descriptor",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckMethodAdapter.java#L1367-L1372 |
salesforce/Argus | ArgusCore/src/main/java/com/salesforce/dva/argus/entity/DistributedSchedulingLock.java | DistributedSchedulingLock.getDistributedScheduleByType | public static DistributedSchedulingLock getDistributedScheduleByType(EntityManager em, long type) {
"""
Obtains a distributed schedule object of a given type.
@param em The entity manager to use. Cannot be null.
@param type The scheduling type represented as a long value.
@return The dist... | java | public static DistributedSchedulingLock getDistributedScheduleByType(EntityManager em, long type) {
requireArgument(em != null, "Entity manager can not be null.");
TypedQuery<DistributedSchedulingLock> query = em.createNamedQuery("DistributedSchedulingLock.GetEntryById", DistributedSchedulingLock.class);
query... | [
"public",
"static",
"DistributedSchedulingLock",
"getDistributedScheduleByType",
"(",
"EntityManager",
"em",
",",
"long",
"type",
")",
"{",
"requireArgument",
"(",
"em",
"!=",
"null",
",",
"\"Entity manager can not be null.\"",
")",
";",
"TypedQuery",
"<",
"DistributedS... | Obtains a distributed schedule object of a given type.
@param em The entity manager to use. Cannot be null.
@param type The scheduling type represented as a long value.
@return The distributed schedule object of a given type. | [
"Obtains",
"a",
"distributed",
"schedule",
"object",
"of",
"a",
"given",
"type",
"."
] | train | https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusCore/src/main/java/com/salesforce/dva/argus/entity/DistributedSchedulingLock.java#L125-L136 |
QSFT/Doradus | doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java | DBTransaction.addColumn | public void addColumn(String storeName, String rowKey, String columnName, long columnValue) {
"""
Add or set a column with the given long value. The column value is converted to
binary form using Long.toString(colValue), which is then converted to a String using
UTF-8.
@param storeName Name of store that owns... | java | public void addColumn(String storeName, String rowKey, String columnName, long columnValue) {
addColumn(storeName, rowKey, columnName, Long.toString(columnValue));
} | [
"public",
"void",
"addColumn",
"(",
"String",
"storeName",
",",
"String",
"rowKey",
",",
"String",
"columnName",
",",
"long",
"columnValue",
")",
"{",
"addColumn",
"(",
"storeName",
",",
"rowKey",
",",
"columnName",
",",
"Long",
".",
"toString",
"(",
"column... | Add or set a column with the given long value. The column value is converted to
binary form using Long.toString(colValue), which is then converted to a String using
UTF-8.
@param storeName Name of store that owns row.
@param rowKey Key of row that owns column.
@param columnName Name of column.
@param columnValue ... | [
"Add",
"or",
"set",
"a",
"column",
"with",
"the",
"given",
"long",
"value",
".",
"The",
"column",
"value",
"is",
"converted",
"to",
"binary",
"form",
"using",
"Long",
".",
"toString",
"(",
"colValue",
")",
"which",
"is",
"then",
"converted",
"to",
"a",
... | train | https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/DBTransaction.java#L220-L222 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_license_windows_POST | public OvhTask serviceName_license_windows_POST(String serviceName, String licenseId, OvhWindowsOsVersionEnum version) throws IOException {
"""
Add your existing windows license serial to this dedicated server. Will be manageable in /license/windows.
REST: POST /dedicated/server/{serviceName}/license/windows
@... | java | public OvhTask serviceName_license_windows_POST(String serviceName, String licenseId, OvhWindowsOsVersionEnum version) throws IOException {
String qPath = "/dedicated/server/{serviceName}/license/windows";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, Object>();
add... | [
"public",
"OvhTask",
"serviceName_license_windows_POST",
"(",
"String",
"serviceName",
",",
"String",
"licenseId",
",",
"OvhWindowsOsVersionEnum",
"version",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/license/windows\"",
";",... | Add your existing windows license serial to this dedicated server. Will be manageable in /license/windows.
REST: POST /dedicated/server/{serviceName}/license/windows
@param version [required] Your license version
@param licenseId [required] Your license serial number
@param serviceName [required] The internal name of ... | [
"Add",
"your",
"existing",
"windows",
"license",
"serial",
"to",
"this",
"dedicated",
"server",
".",
"Will",
"be",
"manageable",
"in",
"/",
"license",
"/",
"windows",
"."
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L1177-L1185 |
alkacon/opencms-core | src/org/opencms/flex/CmsFlexCacheKey.java | CmsFlexCacheKey.appendKeyValue | private static void appendKeyValue(StringBuffer str, String key, String value) {
"""
Appends a flex cache key value to the given buffer.<p>
@param str the buffer to append to
@param key the key to append
@param value the value to append
"""
str.append(key);
if (value == IS_USED) {
... | java | private static void appendKeyValue(StringBuffer str, String key, String value) {
str.append(key);
if (value == IS_USED) {
str.append(";");
} else {
str.append("=(");
str.append(value);
str.append(");");
}
} | [
"private",
"static",
"void",
"appendKeyValue",
"(",
"StringBuffer",
"str",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"str",
".",
"append",
"(",
"key",
")",
";",
"if",
"(",
"value",
"==",
"IS_USED",
")",
"{",
"str",
".",
"append",
"(",
"... | Appends a flex cache key value to the given buffer.<p>
@param str the buffer to append to
@param key the key to append
@param value the value to append | [
"Appends",
"a",
"flex",
"cache",
"key",
"value",
"to",
"the",
"given",
"buffer",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/flex/CmsFlexCacheKey.java#L290-L300 |
eurekaclinical/javautil | src/main/java/org/arp/javautil/collections/Collections.java | Collections.putSetAll | public static <K, V> void putSetAll(Map<K, Set<V>> map, Map<K, Set<V>> other) {
"""
Copies all of the mappings from the second map to the first. The value
for each key is the union of the first and second maps' values for that
key.
@param <K>
@param <V>
@param map the first {@link Map}.
@param other the seco... | java | public static <K, V> void putSetAll(Map<K, Set<V>> map, Map<K, Set<V>> other) {
for (Map.Entry<K, Set<V>> me : other.entrySet()) {
putSetMult(map, me.getKey(), me.getValue());
}
} | [
"public",
"static",
"<",
"K",
",",
"V",
">",
"void",
"putSetAll",
"(",
"Map",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"map",
",",
"Map",
"<",
"K",
",",
"Set",
"<",
"V",
">",
">",
"other",
")",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<",
... | Copies all of the mappings from the second map to the first. The value
for each key is the union of the first and second maps' values for that
key.
@param <K>
@param <V>
@param map the first {@link Map}.
@param other the second {@link Map}. | [
"Copies",
"all",
"of",
"the",
"mappings",
"from",
"the",
"second",
"map",
"to",
"the",
"first",
".",
"The",
"value",
"for",
"each",
"key",
"is",
"the",
"union",
"of",
"the",
"first",
"and",
"second",
"maps",
"values",
"for",
"that",
"key",
"."
] | train | https://github.com/eurekaclinical/javautil/blob/779bbc5bf096c75f8eed4f99ca45b99c1d44df43/src/main/java/org/arp/javautil/collections/Collections.java#L117-L121 |
JOML-CI/JOML | src/org/joml/Intersectionf.java | Intersectionf.intersectLineCircle | public static boolean intersectLineCircle(float a, float b, float c, float centerX, float centerY, float radius, Vector3f intersectionCenterAndHL) {
"""
Test whether the line with the general line equation <i>a*x + b*y + c = 0</i> intersects the circle with center
<code>(centerX, centerY)</code> and <code>radius<... | java | public static boolean intersectLineCircle(float a, float b, float c, float centerX, float centerY, float radius, Vector3f intersectionCenterAndHL) {
float invDenom = 1.0f / (float) Math.sqrt(a * a + b * b);
float dist = (a * centerX + b * centerY + c) * invDenom;
if (-radius <= dist && dist <= r... | [
"public",
"static",
"boolean",
"intersectLineCircle",
"(",
"float",
"a",
",",
"float",
"b",
",",
"float",
"c",
",",
"float",
"centerX",
",",
"float",
"centerY",
",",
"float",
"radius",
",",
"Vector3f",
"intersectionCenterAndHL",
")",
"{",
"float",
"invDenom",
... | Test whether the line with the general line equation <i>a*x + b*y + c = 0</i> intersects the circle with center
<code>(centerX, centerY)</code> and <code>radius</code>, and store the center of the line segment of
intersection in the <code>(x, y)</code> components of the supplied vector and the half-length of that line ... | [
"Test",
"whether",
"the",
"line",
"with",
"the",
"general",
"line",
"equation",
"<i",
">",
"a",
"*",
"x",
"+",
"b",
"*",
"y",
"+",
"c",
"=",
"0<",
"/",
"i",
">",
"intersects",
"the",
"circle",
"with",
"center",
"<code",
">",
"(",
"centerX",
"center... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Intersectionf.java#L3433-L3443 |
BigBadaboom/androidsvg | androidsvg/src/main/java/com/caverock/androidsvg/SVG.java | SVG.setDocumentViewBox | @SuppressWarnings( {
"""
Change the document view box by altering the "viewBox" attribute
of the root {@code <svg>} element.
<p>
The viewBox generally describes the bounding box dimensions of the
document contents. A valid viewBox is necessary if you want the
document scaled to fit the canvas or viewport the... | java | @SuppressWarnings({"WeakerAccess", "unused"})
public void setDocumentViewBox(float minX, float minY, float width, float height)
{
if (this.rootElement == null)
throw new IllegalArgumentException("SVG document is empty");
this.rootElement.viewBox = new Box(minX, minY, width, height);
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"public",
"void",
"setDocumentViewBox",
"(",
"float",
"minX",
",",
"float",
"minY",
",",
"float",
"width",
",",
"float",
"height",
")",
"{",
"if",
"(",
"this",
".",
"rootEl... | Change the document view box by altering the "viewBox" attribute
of the root {@code <svg>} element.
<p>
The viewBox generally describes the bounding box dimensions of the
document contents. A valid viewBox is necessary if you want the
document scaled to fit the canvas or viewport the document is to be
rendered into.
<... | [
"Change",
"the",
"document",
"view",
"box",
"by",
"altering",
"the",
"viewBox",
"attribute",
"of",
"the",
"root",
"{",
"@code",
"<svg",
">",
"}",
"element",
".",
"<p",
">",
"The",
"viewBox",
"generally",
"describes",
"the",
"bounding",
"box",
"dimensions",
... | train | https://github.com/BigBadaboom/androidsvg/blob/0d1614dd1a4da10ea4afe3b0cea1361a4ac6b45a/androidsvg/src/main/java/com/caverock/androidsvg/SVG.java#L816-L823 |
netty/netty | codec/src/main/java/io/netty/handler/codec/compression/Snappy.java | Snappy.decodeLiteral | static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) {
"""
Reads a literal from the input buffer directly to the output buffer.
A "literal" is an uncompressed segment of data stored directly in the
byte stream.
@param tag The tag that identified this segment as a literal is also
used to encode part of... | java | static int decodeLiteral(byte tag, ByteBuf in, ByteBuf out) {
in.markReaderIndex();
int length;
switch(tag >> 2 & 0x3F) {
case 60:
if (!in.isReadable()) {
return NOT_ENOUGH_INPUT;
}
length = in.readUnsignedByte();
break;
... | [
"static",
"int",
"decodeLiteral",
"(",
"byte",
"tag",
",",
"ByteBuf",
"in",
",",
"ByteBuf",
"out",
")",
"{",
"in",
".",
"markReaderIndex",
"(",
")",
";",
"int",
"length",
";",
"switch",
"(",
"tag",
">>",
"2",
"&",
"0x3F",
")",
"{",
"case",
"60",
":... | Reads a literal from the input buffer directly to the output buffer.
A "literal" is an uncompressed segment of data stored directly in the
byte stream.
@param tag The tag that identified this segment as a literal is also
used to encode part of the length of the data
@param in The input buffer to read the literal from
... | [
"Reads",
"a",
"literal",
"from",
"the",
"input",
"buffer",
"directly",
"to",
"the",
"output",
"buffer",
".",
"A",
"literal",
"is",
"an",
"uncompressed",
"segment",
"of",
"data",
"stored",
"directly",
"in",
"the",
"byte",
"stream",
"."
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec/src/main/java/io/netty/handler/codec/compression/Snappy.java#L392-L432 |
eserating/siren4j | src/main/java/com/google/code/siren4j/util/ComponentUtils.java | ComponentUtils.getActionByName | public static Action getActionByName(Entity entity, String name) {
"""
Retrieve an action by its name.
@param entity cannot be <code>null</code>.
@param name cannot be <code>null</code> or empty.
@return the located action or <code>null</code> if not found.
"""
if(entity == null) {
thr... | java | public static Action getActionByName(Entity entity, String name) {
if(entity == null) {
throw new IllegalArgumentException("entity cannot be null.");
}
if(StringUtils.isBlank(name)) {
throw new IllegalArgumentException("name cannot be null or empty.");
}
... | [
"public",
"static",
"Action",
"getActionByName",
"(",
"Entity",
"entity",
",",
"String",
"name",
")",
"{",
"if",
"(",
"entity",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"entity cannot be null.\"",
")",
";",
"}",
"if",
"(",
"... | Retrieve an action by its name.
@param entity cannot be <code>null</code>.
@param name cannot be <code>null</code> or empty.
@return the located action or <code>null</code> if not found. | [
"Retrieve",
"an",
"action",
"by",
"its",
"name",
"."
] | train | https://github.com/eserating/siren4j/blob/f12e3185076ad920352ec4f6eb2a071a3683505f/src/main/java/com/google/code/siren4j/util/ComponentUtils.java#L102-L120 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/SmartsheetFactory.java | SmartsheetFactory.createDefaultGovAccountClient | public static Smartsheet createDefaultGovAccountClient(String accessToken) {
"""
<p>Creates a Smartsheet client with default parameters using the Smartsheetgov URI.</p>
@param accessToken
@return the Smartsheet client
"""
SmartsheetImpl smartsheet = new SmartsheetImpl(GOV_BASE_URI, accessToken);
... | java | public static Smartsheet createDefaultGovAccountClient(String accessToken) {
SmartsheetImpl smartsheet = new SmartsheetImpl(GOV_BASE_URI, accessToken);
return smartsheet;
} | [
"public",
"static",
"Smartsheet",
"createDefaultGovAccountClient",
"(",
"String",
"accessToken",
")",
"{",
"SmartsheetImpl",
"smartsheet",
"=",
"new",
"SmartsheetImpl",
"(",
"GOV_BASE_URI",
",",
"accessToken",
")",
";",
"return",
"smartsheet",
";",
"}"
] | <p>Creates a Smartsheet client with default parameters using the Smartsheetgov URI.</p>
@param accessToken
@return the Smartsheet client | [
"<p",
">",
"Creates",
"a",
"Smartsheet",
"client",
"with",
"default",
"parameters",
"using",
"the",
"Smartsheetgov",
"URI",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/SmartsheetFactory.java#L84-L87 |
aws/aws-sdk-java | aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Input.java | Input.withAudioSelectors | public Input withAudioSelectors(java.util.Map<String, AudioSelector> audioSelectors) {
"""
Use Audio selectors (AudioSelectors) to specify a track or set of tracks from the input that you will use in your
outputs. You can use mutiple Audio selectors per input.
@param audioSelectors
Use Audio selectors (AudioS... | java | public Input withAudioSelectors(java.util.Map<String, AudioSelector> audioSelectors) {
setAudioSelectors(audioSelectors);
return this;
} | [
"public",
"Input",
"withAudioSelectors",
"(",
"java",
".",
"util",
".",
"Map",
"<",
"String",
",",
"AudioSelector",
">",
"audioSelectors",
")",
"{",
"setAudioSelectors",
"(",
"audioSelectors",
")",
";",
"return",
"this",
";",
"}"
] | Use Audio selectors (AudioSelectors) to specify a track or set of tracks from the input that you will use in your
outputs. You can use mutiple Audio selectors per input.
@param audioSelectors
Use Audio selectors (AudioSelectors) to specify a track or set of tracks from the input that you will use
in your outputs. You ... | [
"Use",
"Audio",
"selectors",
"(",
"AudioSelectors",
")",
"to",
"specify",
"a",
"track",
"or",
"set",
"of",
"tracks",
"from",
"the",
"input",
"that",
"you",
"will",
"use",
"in",
"your",
"outputs",
".",
"You",
"can",
"use",
"mutiple",
"Audio",
"selectors",
... | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-mediaconvert/src/main/java/com/amazonaws/services/mediaconvert/model/Input.java#L219-L222 |
geomajas/geomajas-project-client-gwt2 | common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java | StyleUtil.createGraphic | public static GraphicInfo createGraphic(ExternalGraphicInfo graphic, int size) {
"""
Creates a graphic with the specified external graphic and size.
@param graphic the graphic
@param size the size
@return the graphic
"""
GraphicInfo graphicInfo = new GraphicInfo();
ChoiceInfo choice = new ChoiceInfo()... | java | public static GraphicInfo createGraphic(ExternalGraphicInfo graphic, int size) {
GraphicInfo graphicInfo = new GraphicInfo();
ChoiceInfo choice = new ChoiceInfo();
choice.setExternalGraphic(graphic);
graphicInfo.getChoiceList().add(choice);
SizeInfo sizeInfo = new SizeInfo();
sizeInfo.setValue(Integer.toStr... | [
"public",
"static",
"GraphicInfo",
"createGraphic",
"(",
"ExternalGraphicInfo",
"graphic",
",",
"int",
"size",
")",
"{",
"GraphicInfo",
"graphicInfo",
"=",
"new",
"GraphicInfo",
"(",
")",
";",
"ChoiceInfo",
"choice",
"=",
"new",
"ChoiceInfo",
"(",
")",
";",
"c... | Creates a graphic with the specified external graphic and size.
@param graphic the graphic
@param size the size
@return the graphic | [
"Creates",
"a",
"graphic",
"with",
"the",
"specified",
"external",
"graphic",
"and",
"size",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/common-gwt/command/src/main/java/org/geomajas/gwt/client/util/StyleUtil.java#L317-L326 |
groupon/robo-remote | RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java | Solo2.waitForResource | public <T> boolean waitForResource(int res, int timeout) {
"""
Wait for a resource to become active
@param res - view resource
@param timeout - timeout period to keep retrying
@param <T> - View type
"""
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int... | java | public <T> boolean waitForResource(int res, int timeout) {
int RETRY_PERIOD = 250;
int retryNum = timeout / RETRY_PERIOD;
for (int i = 0; i < retryNum; i++) {
T View = (T) this.getView(res);
if (View != null) {
break;
}
if (i == ret... | [
"public",
"<",
"T",
">",
"boolean",
"waitForResource",
"(",
"int",
"res",
",",
"int",
"timeout",
")",
"{",
"int",
"RETRY_PERIOD",
"=",
"250",
";",
"int",
"retryNum",
"=",
"timeout",
"/",
"RETRY_PERIOD",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i"... | Wait for a resource to become active
@param res - view resource
@param timeout - timeout period to keep retrying
@param <T> - View type | [
"Wait",
"for",
"a",
"resource",
"to",
"become",
"active"
] | train | https://github.com/groupon/robo-remote/blob/12d242faad50bf90f98657ca9a0c0c3ae1993f07/RoboRemoteServer/apklib/src/main/com/groupon/roboremote/roboremoteserver/robotium/Solo2.java#L158-L172 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java | VirtualMachineScaleSetsInner.startAsync | public Observable<OperationStatusResponseInner> startAsync(String resourceGroupName, String vmScaleSetName) {
"""
Starts one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException... | java | public Observable<OperationStatusResponseInner> startAsync(String resourceGroupName, String vmScaleSetName) {
return startWithServiceResponseAsync(resourceGroupName, vmScaleSetName).map(new Func1<ServiceResponse<OperationStatusResponseInner>, OperationStatusResponseInner>() {
@Override
p... | [
"public",
"Observable",
"<",
"OperationStatusResponseInner",
">",
"startAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmScaleSetName",
")",
"{",
"return",
"startWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmScaleSetName",
")",
".",
"map",
"(... | Starts one or more virtual machines in a VM scale set.
@param resourceGroupName The name of the resource group.
@param vmScaleSetName The name of the VM scale set.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable for the request | [
"Starts",
"one",
"or",
"more",
"virtual",
"machines",
"in",
"a",
"VM",
"scale",
"set",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_03_30/src/main/java/com/microsoft/azure/management/compute/v2017_03_30/implementation/VirtualMachineScaleSetsInner.java#L2409-L2416 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java | ProcessContext.addDataUsageForAll | public void addDataUsageForAll(Collection<String> activities, String attribute, DataUsage dataUsage) {
"""
Adds a data attribute for all given activities together with its
usage.<br>
The given activities/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param acti... | java | public void addDataUsageForAll(Collection<String> activities, String attribute, DataUsage dataUsage) {
Validate.notNull(activities);
Validate.notEmpty(activities);
for (String activity : activities) {
addDataUsageFor(activity, attribute, dataUsage)... | [
"public",
"void",
"addDataUsageForAll",
"(",
"Collection",
"<",
"String",
">",
"activities",
",",
"String",
"attribute",
",",
"DataUsage",
"dataUsage",
")",
"{",
"Validate",
".",
"notNull",
"(",
"activities",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"activi... | Adds a data attribute for all given activities together with its
usage.<br>
The given activities/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param activities Activities for which the attribute usage is set.
@param attribute Attribute used by the given activities.
@par... | [
"Adds",
"a",
"data",
"attribute",
"for",
"all",
"given",
"activities",
"together",
"with",
"its",
"usage",
".",
"<br",
">",
"The",
"given",
"activities",
"/",
"attributes",
"have",
"to",
"be",
"known",
"by",
"the",
"context",
"i",
".",
"e",
".",
"be",
... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java#L705-L711 |
amaembo/streamex | src/main/java/one/util/streamex/StreamEx.java | StreamEx.toMap | public <K, V> Map<K, V> toMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends V> valMapper, BinaryOperator<V> mergeFunction) {
"""
Returns a {@link Map} whose keys and values are the result of applying
the provided mapping functions to the input elements.
<p>
This is a <a... | java | public <K, V> Map<K, V> toMap(Function<? super T, ? extends K> keyMapper,
Function<? super T, ? extends V> valMapper, BinaryOperator<V> mergeFunction) {
return rawCollect(Collectors.toMap(keyMapper, valMapper, mergeFunction, HashMap::new));
} | [
"public",
"<",
"K",
",",
"V",
">",
"Map",
"<",
"K",
",",
"V",
">",
"toMap",
"(",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"K",
">",
"keyMapper",
",",
"Function",
"<",
"?",
"super",
"T",
",",
"?",
"extends",
"V",
">",
"valMapper"... | Returns a {@link Map} whose keys and values are the result of applying
the provided mapping functions to the input elements.
<p>
This is a <a href="package-summary.html#StreamOps">terminal</a>
operation.
<p>
If the mapped keys contains duplicates (according to
{@link Object#equals(Object)}), the value mapping functio... | [
"Returns",
"a",
"{",
"@link",
"Map",
"}",
"whose",
"keys",
"and",
"values",
"are",
"the",
"result",
"of",
"applying",
"the",
"provided",
"mapping",
"functions",
"to",
"the",
"input",
"elements",
"."
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/StreamEx.java#L1000-L1003 |
interedition/collatex | collatex-core/src/main/java/eu/interedition/collatex/suffixarray/QSufSort.java | QSufSort.update_group | private void update_group(int pl, int pm) {
"""
Subroutine for {@link #select_sort_split(int, int)} and
{@link #sort_split(int, int)}. Sets group numbers for a group whose lowest position
in {@link #I} is <code>pl</code> and highest position is <code>pm</code>.
"""
int g;
g = pm; /* group nu... | java | private void update_group(int pl, int pm) {
int g;
g = pm; /* group number. */
V[start + I[pl]] = g; /* update group number of first position. */
if (pl == pm) I[pl] = -1; /* one element, sorted group. */
else do
/* more than one element, unsorted group. */
... | [
"private",
"void",
"update_group",
"(",
"int",
"pl",
",",
"int",
"pm",
")",
"{",
"int",
"g",
";",
"g",
"=",
"pm",
";",
"/* group number. */",
"V",
"[",
"start",
"+",
"I",
"[",
"pl",
"]",
"]",
"=",
"g",
";",
"/* update group number of first position. */",... | Subroutine for {@link #select_sort_split(int, int)} and
{@link #sort_split(int, int)}. Sets group numbers for a group whose lowest position
in {@link #I} is <code>pl</code> and highest position is <code>pm</code>. | [
"Subroutine",
"for",
"{"
] | train | https://github.com/interedition/collatex/blob/76dd1fcc36047bc66a87d31142e72e98b5347821/collatex-core/src/main/java/eu/interedition/collatex/suffixarray/QSufSort.java#L215-L226 |
OpenCompare/OpenCompare | org.opencompare/api-java/src/main/java/org/opencompare/api/java/PCMMetadata.java | PCMMetadata.getSortedProducts | public List<Product> getSortedProducts() {
"""
Return the sorted products concordingly with metadata
@return an ordered list of products
"""
ArrayList<Product> result = new ArrayList<>(pcm.getProducts());
Collections.sort(result, new Comparator<Product>() {
@Override
p... | java | public List<Product> getSortedProducts() {
ArrayList<Product> result = new ArrayList<>(pcm.getProducts());
Collections.sort(result, new Comparator<Product>() {
@Override
public int compare(Product o1, Product o2) {
Integer op1 = getProductPosition(o1);
... | [
"public",
"List",
"<",
"Product",
">",
"getSortedProducts",
"(",
")",
"{",
"ArrayList",
"<",
"Product",
">",
"result",
"=",
"new",
"ArrayList",
"<>",
"(",
"pcm",
".",
"getProducts",
"(",
")",
")",
";",
"Collections",
".",
"sort",
"(",
"result",
",",
"n... | Return the sorted products concordingly with metadata
@return an ordered list of products | [
"Return",
"the",
"sorted",
"products",
"concordingly",
"with",
"metadata"
] | train | https://github.com/OpenCompare/OpenCompare/blob/6cd776466b375cb8ecca08fcd94e573d65e20b14/org.opencompare/api-java/src/main/java/org/opencompare/api/java/PCMMetadata.java#L101-L113 |
ngageoint/geopackage-core-java | src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java | RelatedTablesCoreExtension.addAttributesRelationship | public ExtendedRelation addAttributesRelationship(String baseTableName,
AttributesTable attributesTable, UserMappingTable userMappingTable) {
"""
Adds an attributes relationship between the base table and user
attributes related table. Creates the user mapping table and an
attributes table if needed.
@para... | java | public ExtendedRelation addAttributesRelationship(String baseTableName,
AttributesTable attributesTable, UserMappingTable userMappingTable) {
return addRelationship(baseTableName, attributesTable, userMappingTable);
} | [
"public",
"ExtendedRelation",
"addAttributesRelationship",
"(",
"String",
"baseTableName",
",",
"AttributesTable",
"attributesTable",
",",
"UserMappingTable",
"userMappingTable",
")",
"{",
"return",
"addRelationship",
"(",
"baseTableName",
",",
"attributesTable",
",",
"user... | Adds an attributes relationship between the base table and user
attributes related table. Creates the user mapping table and an
attributes table if needed.
@param baseTableName
base table name
@param attributesTable
user attributes table
@param userMappingTable
user mapping table
@return The relationship that was adde... | [
"Adds",
"an",
"attributes",
"relationship",
"between",
"the",
"base",
"table",
"and",
"user",
"attributes",
"related",
"table",
".",
"Creates",
"the",
"user",
"mapping",
"table",
"and",
"an",
"attributes",
"table",
"if",
"needed",
"."
] | train | https://github.com/ngageoint/geopackage-core-java/blob/6431c3b041a45b7f3802904ea4156b4082a72daa/src/main/java/mil/nga/geopackage/extension/related/RelatedTablesCoreExtension.java#L660-L663 |
VoltDB/voltdb | third_party/java/src/au/com/bytecode/opencsv_voltpatches/CSVParser.java | CSVParser.isNextCharacterEscapable | protected boolean isNextCharacterEscapable(String nextLine, boolean inQuotes, int i) {
"""
precondition: the current character is an escape
@param nextLine the current line
@param inQuotes true if the current context is quoted
@param i current index in line
@return true if the following character is a... | java | protected boolean isNextCharacterEscapable(String nextLine, boolean inQuotes, int i) {
return inQuotes // we are in quotes, therefore there can be escaped quotes in here.
&& nextLine.length() > (i + 1) // there is indeed another character to check.
&& (nextLine.charAt(i + 1)... | [
"protected",
"boolean",
"isNextCharacterEscapable",
"(",
"String",
"nextLine",
",",
"boolean",
"inQuotes",
",",
"int",
"i",
")",
"{",
"return",
"inQuotes",
"// we are in quotes, therefore there can be escaped quotes in here.\r",
"&&",
"nextLine",
".",
"length",
"(",
")",
... | precondition: the current character is an escape
@param nextLine the current line
@param inQuotes true if the current context is quoted
@param i current index in line
@return true if the following character is a quote | [
"precondition",
":",
"the",
"current",
"character",
"is",
"an",
"escape"
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/third_party/java/src/au/com/bytecode/opencsv_voltpatches/CSVParser.java#L316-L320 |
kuali/ojb-1.0.4 | src/java/org/apache/ojb/broker/accesslayer/sql/SqlPkStatement.java | SqlPkStatement.appendWhereClause | protected void appendWhereClause(ClassDescriptor cld, boolean useLocking, StringBuffer stmt) {
"""
Generate a where clause for a prepared Statement.
Only primary key and locking fields are used in this where clause
@param cld the ClassDescriptor
@param useLocking true if locking fields should be included
@pa... | java | protected void appendWhereClause(ClassDescriptor cld, boolean useLocking, StringBuffer stmt)
{
FieldDescriptor[] pkFields = cld.getPkFields();
FieldDescriptor[] fields;
fields = pkFields;
if(useLocking)
{
FieldDescriptor[] lockingFields = cld.getLockingFi... | [
"protected",
"void",
"appendWhereClause",
"(",
"ClassDescriptor",
"cld",
",",
"boolean",
"useLocking",
",",
"StringBuffer",
"stmt",
")",
"{",
"FieldDescriptor",
"[",
"]",
"pkFields",
"=",
"cld",
".",
"getPkFields",
"(",
")",
";",
"FieldDescriptor",
"[",
"]",
"... | Generate a where clause for a prepared Statement.
Only primary key and locking fields are used in this where clause
@param cld the ClassDescriptor
@param useLocking true if locking fields should be included
@param stmt the StatementBuffer | [
"Generate",
"a",
"where",
"clause",
"for",
"a",
"prepared",
"Statement",
".",
"Only",
"primary",
"key",
"and",
"locking",
"fields",
"are",
"used",
"in",
"this",
"where",
"clause"
] | train | https://github.com/kuali/ojb-1.0.4/blob/9a544372f67ce965f662cdc71609dd03683c8f04/src/java/org/apache/ojb/broker/accesslayer/sql/SqlPkStatement.java#L107-L125 |
carewebframework/carewebframework-core | org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java | InfoPanelService.getInfoPanel | private static IInfoPanel getInfoPanel(ElementBase element, boolean activeOnly) {
"""
Returns the info panel associated with the UI element, if there is one.
@param element The element to examine.
@param activeOnly If true, only active info panels are considered.
@return The associated active info panel, or n... | java | private static IInfoPanel getInfoPanel(ElementBase element, boolean activeOnly) {
if (element instanceof ElementPlugin) {
ElementPlugin plugin = (ElementPlugin) element;
if ((!activeOnly || plugin.isActivated()) && (plugin.getDefinition().getId().equals("infoPanelPlugin"))) ... | [
"private",
"static",
"IInfoPanel",
"getInfoPanel",
"(",
"ElementBase",
"element",
",",
"boolean",
"activeOnly",
")",
"{",
"if",
"(",
"element",
"instanceof",
"ElementPlugin",
")",
"{",
"ElementPlugin",
"plugin",
"=",
"(",
"ElementPlugin",
")",
"element",
";",
"i... | Returns the info panel associated with the UI element, if there is one.
@param element The element to examine.
@param activeOnly If true, only active info panels are considered.
@return The associated active info panel, or null if there is none. | [
"Returns",
"the",
"info",
"panel",
"associated",
"with",
"the",
"UI",
"element",
"if",
"there",
"is",
"one",
"."
] | train | https://github.com/carewebframework/carewebframework-core/blob/fa3252d4f7541dbe151b92c3d4f6f91433cd1673/org.carewebframework.plugin-parent/org.carewebframework.plugin.infopanel/src/main/java/org/carewebframework/plugin/infopanel/service/InfoPanelService.java#L138-L150 |
alkacon/opencms-core | src/org/opencms/file/wrapper/CmsResourceWrapperPropertyFile.java | CmsResourceWrapperPropertyFile.getResource | CmsResource getResource(CmsObject cms, CmsUUID structureId) {
"""
Tries to the read the resource with the given structure id using the given CmsObject and returns it, or null if the resource can not be read.<p>
@param cms the CmsObject to use
@param structureId the structure id of the resource
@return the res... | java | CmsResource getResource(CmsObject cms, CmsUUID structureId) {
try {
CmsResource result = cms.readResource(structureId);
return result;
} catch (CmsVfsResourceNotFoundException e) {
return null;
} catch (CmsException e) {
LOG.error(e.getLocalizedMe... | [
"CmsResource",
"getResource",
"(",
"CmsObject",
"cms",
",",
"CmsUUID",
"structureId",
")",
"{",
"try",
"{",
"CmsResource",
"result",
"=",
"cms",
".",
"readResource",
"(",
"structureId",
")",
";",
"return",
"result",
";",
"}",
"catch",
"(",
"CmsVfsResourceNotFo... | Tries to the read the resource with the given structure id using the given CmsObject and returns it, or null if the resource can not be read.<p>
@param cms the CmsObject to use
@param structureId the structure id of the resource
@return the resource which has been read | [
"Tries",
"to",
"the",
"read",
"the",
"resource",
"with",
"the",
"given",
"structure",
"id",
"using",
"the",
"given",
"CmsObject",
"and",
"returns",
"it",
"or",
"null",
"if",
"the",
"resource",
"can",
"not",
"be",
"read",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/file/wrapper/CmsResourceWrapperPropertyFile.java#L391-L402 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java | TimeZoneFormat.parseExemplarLocation | private String parseExemplarLocation(String text, ParsePosition pos) {
"""
Parse an exemplar location string.
@param text the text contains an exemplar location string at the position.
@param pos the position.
@return The zone ID for the parsed exemplar location.
"""
int startIdx = pos.getIndex();
... | java | private String parseExemplarLocation(String text, ParsePosition pos) {
int startIdx = pos.getIndex();
int parsedPos = -1;
String tzID = null;
EnumSet<NameType> nameTypes = EnumSet.of(NameType.EXEMPLAR_LOCATION);
Collection<MatchInfo> exemplarMatches = _tznames.find(text, startId... | [
"private",
"String",
"parseExemplarLocation",
"(",
"String",
"text",
",",
"ParsePosition",
"pos",
")",
"{",
"int",
"startIdx",
"=",
"pos",
".",
"getIndex",
"(",
")",
";",
"int",
"parsedPos",
"=",
"-",
"1",
";",
"String",
"tzID",
"=",
"null",
";",
"EnumSe... | Parse an exemplar location string.
@param text the text contains an exemplar location string at the position.
@param pos the position.
@return The zone ID for the parsed exemplar location. | [
"Parse",
"an",
"exemplar",
"location",
"string",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/TimeZoneFormat.java#L3005-L3030 |
liferay/com-liferay-commerce | commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java | CPAttachmentFileEntryPersistenceImpl.findAll | @Override
public List<CPAttachmentFileEntry> findAll() {
"""
Returns all the cp attachment file entries.
@return the cp attachment file entries
"""
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CPAttachmentFileEntry> findAll() {
return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CPAttachmentFileEntry",
">",
"findAll",
"(",
")",
"{",
"return",
"findAll",
"(",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
"}"
] | Returns all the cp attachment file entries.
@return the cp attachment file entries | [
"Returns",
"all",
"the",
"cp",
"attachment",
"file",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-service/src/main/java/com/liferay/commerce/product/service/persistence/impl/CPAttachmentFileEntryPersistenceImpl.java#L5772-L5775 |
paypal/SeLion | dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java | XmlDataProviderImpl.getAllKeyValueData | @Override
public Object[][] getAllKeyValueData() {
"""
Generates a two dimensional array for TestNG DataProvider from the XML data representing a map of name value
collection.
This method needs the referenced {@link DataResource} to be instantiated using its constructors with
parameter {@code Class<?> cls... | java | @Override
public Object[][] getAllKeyValueData() {
logger.entering();
Object[][] objectArray;
try {
JAXBContext context = JAXBContext.newInstance(resource.getCls());
Unmarshaller unmarshaller = context.createUnmarshaller();
StreamSource xmlStreamSource = ... | [
"@",
"Override",
"public",
"Object",
"[",
"]",
"[",
"]",
"getAllKeyValueData",
"(",
")",
"{",
"logger",
".",
"entering",
"(",
")",
";",
"Object",
"[",
"]",
"[",
"]",
"objectArray",
";",
"try",
"{",
"JAXBContext",
"context",
"=",
"JAXBContext",
".",
"ne... | Generates a two dimensional array for TestNG DataProvider from the XML data representing a map of name value
collection.
This method needs the referenced {@link DataResource} to be instantiated using its constructors with
parameter {@code Class<?> cls} and set to {@code KeyValueMap.class}. The implementation in this m... | [
"Generates",
"a",
"two",
"dimensional",
"array",
"for",
"TestNG",
"DataProvider",
"from",
"the",
"XML",
"data",
"representing",
"a",
"map",
"of",
"name",
"value",
"collection",
"."
] | train | https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/dataproviders/src/main/java/com/paypal/selion/platform/dataprovider/impl/XmlDataProviderImpl.java#L212-L231 |
mrniko/netty-socketio | src/main/java/com/corundumstudio/socketio/SocketIOServer.java | SocketIOServer.getRoomOperations | public BroadcastOperations getRoomOperations(String room) {
"""
Get broadcast operations for clients within
room by <code>room</code> name
@param room - name of room
@return broadcast operations
"""
Iterable<SocketIOClient> clients = namespacesHub.getRoomClients(room);
return new Broadcast... | java | public BroadcastOperations getRoomOperations(String room) {
Iterable<SocketIOClient> clients = namespacesHub.getRoomClients(room);
return new BroadcastOperations(clients, configCopy.getStoreFactory());
} | [
"public",
"BroadcastOperations",
"getRoomOperations",
"(",
"String",
"room",
")",
"{",
"Iterable",
"<",
"SocketIOClient",
">",
"clients",
"=",
"namespacesHub",
".",
"getRoomClients",
"(",
"room",
")",
";",
"return",
"new",
"BroadcastOperations",
"(",
"clients",
",... | Get broadcast operations for clients within
room by <code>room</code> name
@param room - name of room
@return broadcast operations | [
"Get",
"broadcast",
"operations",
"for",
"clients",
"within",
"room",
"by",
"<code",
">",
"room<",
"/",
"code",
">",
"name"
] | train | https://github.com/mrniko/netty-socketio/blob/ea1787f3369f94f527002bd9737fb278750933e2/src/main/java/com/corundumstudio/socketio/SocketIOServer.java#L110-L113 |
apereo/cas | core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CollectionUtils.java | CollectionUtils.asMultiValueMap | public static MultiValueMap asMultiValueMap(final String key1, final Object value1, final String key2, final Object value2) {
"""
As multi value map.
@param key1 the key 1
@param value1 the value 1
@param key2 the key 2
@param value2 the value 2
@return the multi value map
"""
val wrap = (Ma... | java | public static MultiValueMap asMultiValueMap(final String key1, final Object value1, final String key2, final Object value2) {
val wrap = (Map) wrap(key1, wrapList(value1), key2, wrapList(value2));
return org.springframework.util.CollectionUtils.toMultiValueMap(wrap);
} | [
"public",
"static",
"MultiValueMap",
"asMultiValueMap",
"(",
"final",
"String",
"key1",
",",
"final",
"Object",
"value1",
",",
"final",
"String",
"key2",
",",
"final",
"Object",
"value2",
")",
"{",
"val",
"wrap",
"=",
"(",
"Map",
")",
"wrap",
"(",
"key1",
... | As multi value map.
@param key1 the key 1
@param value1 the value 1
@param key2 the key 2
@param value2 the value 2
@return the multi value map | [
"As",
"multi",
"value",
"map",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/core/cas-server-core-util-api/src/main/java/org/apereo/cas/util/CollectionUtils.java#L471-L474 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java | ExceptionUtils.rethrow | public static void rethrow(Throwable t, String parentMessage) {
"""
Throws the given {@code Throwable} in scenarios where the signatures do not allow you to
throw an arbitrary Throwable. Errors and RuntimeExceptions are thrown directly, other exceptions
are packed into a parent RuntimeException.
@param t The ... | java | public static void rethrow(Throwable t, String parentMessage) {
if (t instanceof Error) {
throw (Error) t;
}
else if (t instanceof RuntimeException) {
throw (RuntimeException) t;
}
else {
throw new RuntimeException(parentMessage, t);
}
} | [
"public",
"static",
"void",
"rethrow",
"(",
"Throwable",
"t",
",",
"String",
"parentMessage",
")",
"{",
"if",
"(",
"t",
"instanceof",
"Error",
")",
"{",
"throw",
"(",
"Error",
")",
"t",
";",
"}",
"else",
"if",
"(",
"t",
"instanceof",
"RuntimeException",
... | Throws the given {@code Throwable} in scenarios where the signatures do not allow you to
throw an arbitrary Throwable. Errors and RuntimeExceptions are thrown directly, other exceptions
are packed into a parent RuntimeException.
@param t The throwable to be thrown.
@param parentMessage The message for the parent Runti... | [
"Throws",
"the",
"given",
"{",
"@code",
"Throwable",
"}",
"in",
"scenarios",
"where",
"the",
"signatures",
"do",
"not",
"allow",
"you",
"to",
"throw",
"an",
"arbitrary",
"Throwable",
".",
"Errors",
"and",
"RuntimeExceptions",
"are",
"thrown",
"directly",
"othe... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ExceptionUtils.java#L211-L221 |
alkacon/opencms-core | src/org/opencms/workplace/CmsWorkplace.java | CmsWorkplace.bodyStart | public String bodyStart(String className, String parameters) {
"""
Builds the start html of the body.<p>
@param className optional class attribute to add to the body tag
@param parameters optional parameters to add to the body tag
@return the start html of the body
"""
return pageBody(HTML_START,... | java | public String bodyStart(String className, String parameters) {
return pageBody(HTML_START, className, parameters);
} | [
"public",
"String",
"bodyStart",
"(",
"String",
"className",
",",
"String",
"parameters",
")",
"{",
"return",
"pageBody",
"(",
"HTML_START",
",",
"className",
",",
"parameters",
")",
";",
"}"
] | Builds the start html of the body.<p>
@param className optional class attribute to add to the body tag
@param parameters optional parameters to add to the body tag
@return the start html of the body | [
"Builds",
"the",
"start",
"html",
"of",
"the",
"body",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplace.java#L1094-L1097 |
b3dgs/lionengine | lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java | CollisionCategoryConfig.exports | public static void exports(Xml root, CollisionCategory category) {
"""
Export the collision category data as a node.
@param root The node root (must not be <code>null</code>).
@param category The collision category to export (must not be <code>null</code>).
@throws LionEngineException If error on writing.
... | java | public static void exports(Xml root, CollisionCategory category)
{
Check.notNull(root);
Check.notNull(category);
final Xml node = root.createChild(NODE_CATEGORY);
node.writeString(ATT_NAME, category.getName());
node.writeString(ATT_AXIS, category.getAxis().name());
... | [
"public",
"static",
"void",
"exports",
"(",
"Xml",
"root",
",",
"CollisionCategory",
"category",
")",
"{",
"Check",
".",
"notNull",
"(",
"root",
")",
";",
"Check",
".",
"notNull",
"(",
"category",
")",
";",
"final",
"Xml",
"node",
"=",
"root",
".",
"cr... | Export the collision category data as a node.
@param root The node root (must not be <code>null</code>).
@param category The collision category to export (must not be <code>null</code>).
@throws LionEngineException If error on writing. | [
"Export",
"the",
"collision",
"category",
"data",
"as",
"a",
"node",
"."
] | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-game/src/main/java/com/b3dgs/lionengine/game/feature/tile/map/collision/CollisionCategoryConfig.java#L168-L185 |
JOML-CI/JOML | src/org/joml/sampling/StratifiedSampling.java | StratifiedSampling.generateRandom | public void generateRandom(int n, Callback2d callback) {
"""
Generate <code>n * n</code> random sample positions in the unit square of <code>x, y = [-1..+1]</code>.
<p>
Each sample within its stratum is distributed randomly.
@param n
the number of strata in each dimension
@param callback
will be called for... | java | public void generateRandom(int n, Callback2d callback) {
for (int y = 0; y < n; y++) {
for (int x = 0; x < n; x++) {
float sampleX = (rnd.nextFloat() / n + (float) x / n) * 2.0f - 1.0f;
float sampleY = (rnd.nextFloat() / n + (float) y / n) * 2.0f - 1.0f;
... | [
"public",
"void",
"generateRandom",
"(",
"int",
"n",
",",
"Callback2d",
"callback",
")",
"{",
"for",
"(",
"int",
"y",
"=",
"0",
";",
"y",
"<",
"n",
";",
"y",
"++",
")",
"{",
"for",
"(",
"int",
"x",
"=",
"0",
";",
"x",
"<",
"n",
";",
"x",
"+... | Generate <code>n * n</code> random sample positions in the unit square of <code>x, y = [-1..+1]</code>.
<p>
Each sample within its stratum is distributed randomly.
@param n
the number of strata in each dimension
@param callback
will be called for each generated sample position | [
"Generate",
"<code",
">",
"n",
"*",
"n<",
"/",
"code",
">",
"random",
"sample",
"positions",
"in",
"the",
"unit",
"square",
"of",
"<code",
">",
"x",
"y",
"=",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
">",
".",
"<p",
">",
"Each",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/sampling/StratifiedSampling.java#L58-L66 |
matthewhorridge/owlapi-gwt | owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectMinCardinalityImpl_CustomFieldSerializer.java | OWLObjectMinCardinalityImpl_CustomFieldSerializer.serializeInstance | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLObjectMinCardinalityImpl instance) throws SerializationException {
"""
Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google... | java | @Override
public void serializeInstance(SerializationStreamWriter streamWriter, OWLObjectMinCardinalityImpl instance) throws SerializationException {
serialize(streamWriter, instance);
} | [
"@",
"Override",
"public",
"void",
"serializeInstance",
"(",
"SerializationStreamWriter",
"streamWriter",
",",
"OWLObjectMinCardinalityImpl",
"instance",
")",
"throws",
"SerializationException",
"{",
"serialize",
"(",
"streamWriter",
",",
"instance",
")",
";",
"}"
] | Serializes the content of the object into the
{@link com.google.gwt.user.client.rpc.SerializationStreamWriter}.
@param streamWriter the {@link com.google.gwt.user.client.rpc.SerializationStreamWriter} to write the
object's content to
@param instance the object instance to serialize
@throws com.google.gwt.user.clie... | [
"Serializes",
"the",
"content",
"of",
"the",
"object",
"into",
"the",
"{",
"@link",
"com",
".",
"google",
".",
"gwt",
".",
"user",
".",
"client",
".",
"rpc",
".",
"SerializationStreamWriter",
"}",
"."
] | train | https://github.com/matthewhorridge/owlapi-gwt/blob/7ab975fb6cef3c8947099983551672a3b5d4e2fd/owlapi-gwt-serialization/src/main/java/uk/ac/manchester/cs/owl/owlapi/OWLObjectMinCardinalityImpl_CustomFieldSerializer.java#L73-L76 |
Stratio/bdt | src/main/java/com/stratio/qa/specs/SeleniumSpec.java | SeleniumSpec.seleniumDrag | @When("^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$")
public void seleniumDrag(String smethod, String source, String dmethod, String destination) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
"""
Searchs for two webelemen... | java | @When("^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$")
public void seleniumDrag(String smethod, String source, String dmethod, String destination) throws ClassNotFoundException, NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException {
Actions builder = new Acti... | [
"@",
"When",
"(",
"\"^I drag '([^:]*?):(.+?)' and drop it to '([^:]*?):(.+?)'$\"",
")",
"public",
"void",
"seleniumDrag",
"(",
"String",
"smethod",
",",
"String",
"source",
",",
"String",
"dmethod",
",",
"String",
"destination",
")",
"throws",
"ClassNotFoundException",
... | Searchs for two webelements dragging the first one to the second
@param source
@param destination
@throws IllegalAccessException
@throws IllegalArgumentException
@throws SecurityException
@throws NoSuchFieldException
@throws ClassNotFoundException | [
"Searchs",
"for",
"two",
"webelements",
"dragging",
"the",
"first",
"one",
"to",
"the",
"second"
] | train | https://github.com/Stratio/bdt/blob/55324d19e7497764ad3dd7139923e13eb9841d75/src/main/java/com/stratio/qa/specs/SeleniumSpec.java#L180-L188 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_conference_serviceName_participants_id_GET | public OvhConferenceParticipants billingAccount_conference_serviceName_participants_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
"""
Get this object properties
REST: GET /telephony/{billingAccount}/conference/{serviceName}/participants/{id}
@param billingAccount [required] Th... | java | public OvhConferenceParticipants billingAccount_conference_serviceName_participants_id_GET(String billingAccount, String serviceName, Long id) throws IOException {
String qPath = "/telephony/{billingAccount}/conference/{serviceName}/participants/{id}";
StringBuilder sb = path(qPath, billingAccount, serviceName, id)... | [
"public",
"OvhConferenceParticipants",
"billingAccount_conference_serviceName_participants_id_GET",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"id",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/telephony/{billingAccount}/confer... | Get this object properties
REST: GET /telephony/{billingAccount}/conference/{serviceName}/participants/{id}
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param id [required] Id of the object | [
"Get",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L4886-L4891 |
google/closure-templates | java/src/com/google/template/soy/jssrc/dsl/Expression.java | Expression.operation | public static Expression operation(Operator op, List<Expression> operands) {
"""
Creates a code chunk representing the given Soy operator applied to the given operands.
<p>Cannot be used for {@link Operator#AND}, {@link Operator#OR}, or {@link
Operator#CONDITIONAL}, as they require access to a {@link Generator... | java | public static Expression operation(Operator op, List<Expression> operands) {
Preconditions.checkArgument(operands.size() == op.getNumOperands());
Preconditions.checkArgument(
op != Operator.AND && op != Operator.OR && op != Operator.CONDITIONAL);
switch (op.getNumOperands()) {
case 1:
... | [
"public",
"static",
"Expression",
"operation",
"(",
"Operator",
"op",
",",
"List",
"<",
"Expression",
">",
"operands",
")",
"{",
"Preconditions",
".",
"checkArgument",
"(",
"operands",
".",
"size",
"(",
")",
"==",
"op",
".",
"getNumOperands",
"(",
")",
")"... | Creates a code chunk representing the given Soy operator applied to the given operands.
<p>Cannot be used for {@link Operator#AND}, {@link Operator#OR}, or {@link
Operator#CONDITIONAL}, as they require access to a {@link Generator} to generate temporary
variables for short-circuiting. Use {@link Expression#and}, {@lin... | [
"Creates",
"a",
"code",
"chunk",
"representing",
"the",
"given",
"Soy",
"operator",
"applied",
"to",
"the",
"given",
"operands",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/dsl/Expression.java#L198-L210 |
gitblit/fathom | fathom-mailer/src/main/java/fathom/mailer/Mailer.java | Mailer.newTextTemplateMailRequest | public MailRequest newTextTemplateMailRequest(String subjectTemplate, String textTemplateName, Map<String, Object> parameters) {
"""
Creates a MailRequest from the specified template.
The request id is automatically generated.
@param subjectTemplate a string that uses the parameters & TemplateEngine to interp... | java | public MailRequest newTextTemplateMailRequest(String subjectTemplate, String textTemplateName, Map<String, Object> parameters) {
return createTemplateMailRequest(generateRequestId(), subjectTemplate, textTemplateName, false, parameters);
} | [
"public",
"MailRequest",
"newTextTemplateMailRequest",
"(",
"String",
"subjectTemplate",
",",
"String",
"textTemplateName",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"parameters",
")",
"{",
"return",
"createTemplateMailRequest",
"(",
"generateRequestId",
"(",
")"... | Creates a MailRequest from the specified template.
The request id is automatically generated.
@param subjectTemplate a string that uses the parameters & TemplateEngine to interpolate values
@param textTemplateName the name of the classpath template resource
@param parameters
@return a text mail request | [
"Creates",
"a",
"MailRequest",
"from",
"the",
"specified",
"template",
".",
"The",
"request",
"id",
"is",
"automatically",
"generated",
"."
] | train | https://github.com/gitblit/fathom/blob/f2f820eb16e9fea1e36ad4eda4ed51b35f056538/fathom-mailer/src/main/java/fathom/mailer/Mailer.java#L155-L157 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/Project.java | Project.addToListInternal | private <T> boolean addToListInternal(Collection<T> list, T value) {
"""
Add a value to given list, making the Project modified if the value is
not already present in the list.
@param list
the list
@param value
the value to be added
@return true if the value was not already present in the list, false
othe... | java | private <T> boolean addToListInternal(Collection<T> list, T value) {
if (!list.contains(value)) {
list.add(value);
isModified = true;
return true;
} else {
return false;
}
} | [
"private",
"<",
"T",
">",
"boolean",
"addToListInternal",
"(",
"Collection",
"<",
"T",
">",
"list",
",",
"T",
"value",
")",
"{",
"if",
"(",
"!",
"list",
".",
"contains",
"(",
"value",
")",
")",
"{",
"list",
".",
"add",
"(",
"value",
")",
";",
"is... | Add a value to given list, making the Project modified if the value is
not already present in the list.
@param list
the list
@param value
the value to be added
@return true if the value was not already present in the list, false
otherwise | [
"Add",
"a",
"value",
"to",
"given",
"list",
"making",
"the",
"Project",
"modified",
"if",
"the",
"value",
"is",
"not",
"already",
"present",
"in",
"the",
"list",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/Project.java#L1027-L1035 |
Erudika/para | para-client/src/main/java/com/erudika/para/client/ParaClient.java | ParaClient.invokeDelete | public Response invokeDelete(String resourcePath, MultivaluedMap<String, String> params) {
"""
Invoke a DELETE request to the Para API.
@param resourcePath the subpath after '/v1/', should not start with '/'
@param params query parameters
@return a {@link Response} object
"""
logger.debug("DELETE {}, para... | java | public Response invokeDelete(String resourcePath, MultivaluedMap<String, String> params) {
logger.debug("DELETE {}, params: {}", getFullPath(resourcePath), params);
return invokeSignedRequest(getApiClient(), accessKey, key(true), DELETE,
getEndpoint(), getFullPath(resourcePath), null, params, new byte[0]);
} | [
"public",
"Response",
"invokeDelete",
"(",
"String",
"resourcePath",
",",
"MultivaluedMap",
"<",
"String",
",",
"String",
">",
"params",
")",
"{",
"logger",
".",
"debug",
"(",
"\"DELETE {}, params: {}\"",
",",
"getFullPath",
"(",
"resourcePath",
")",
",",
"param... | Invoke a DELETE request to the Para API.
@param resourcePath the subpath after '/v1/', should not start with '/'
@param params query parameters
@return a {@link Response} object | [
"Invoke",
"a",
"DELETE",
"request",
"to",
"the",
"Para",
"API",
"."
] | train | https://github.com/Erudika/para/blob/5ba096c477042ea7b18e9a0e8b5b1ee0f5bd6ce9/para-client/src/main/java/com/erudika/para/client/ParaClient.java#L372-L376 |
dadoonet/elasticsearch-beyonder | src/main/java/fr/pilato/elasticsearch/tools/SettingsFinder.java | SettingsFinder.findJsonFiles | @Deprecated
protected static ArrayList<String> findJsonFiles(Path root, String subdir) throws IOException {
"""
Find all types within an index
@param root dir within the classpath
@param subdir subdir name
@return A list of found JSON files
@deprecated Sounds like it's not used. We will remove it
@throws IOE... | java | @Deprecated
protected static ArrayList<String> findJsonFiles(Path root, String subdir) throws IOException {
logger.debug("Looking for json files in classpath under [{}/{}].", root, subdir);
final ArrayList<String> jsonFiles = new ArrayList<>();
final Path indexDir = root.resolve(subdir);
if (Files.exists(inde... | [
"@",
"Deprecated",
"protected",
"static",
"ArrayList",
"<",
"String",
">",
"findJsonFiles",
"(",
"Path",
"root",
",",
"String",
"subdir",
")",
"throws",
"IOException",
"{",
"logger",
".",
"debug",
"(",
"\"Looking for json files in classpath under [{}/{}].\"",
",",
"... | Find all types within an index
@param root dir within the classpath
@param subdir subdir name
@return A list of found JSON files
@deprecated Sounds like it's not used. We will remove it
@throws IOException if something goes wrong | [
"Find",
"all",
"types",
"within",
"an",
"index"
] | train | https://github.com/dadoonet/elasticsearch-beyonder/blob/275bf63432b97169a90a266e983143cca9ad7629/src/main/java/fr/pilato/elasticsearch/tools/SettingsFinder.java#L69-L99 |
boncey/Flickr4Java | src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java | PhotosetsInterface.getList | public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException {
"""
Get a list of all photosets for the specified user.
This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated.
@param u... | java | public Photosets getList(String userId, String primaryPhotoExtras) throws FlickrException {
return getList(userId, 0, 0, primaryPhotoExtras);
} | [
"public",
"Photosets",
"getList",
"(",
"String",
"userId",
",",
"String",
"primaryPhotoExtras",
")",
"throws",
"FlickrException",
"{",
"return",
"getList",
"(",
"userId",
",",
"0",
",",
"0",
",",
"primaryPhotoExtras",
")",
";",
"}"
] | Get a list of all photosets for the specified user.
This method does not require authentication. But to get a Photoset into the list, that contains just private photos, the call needs to be authenticated.
@param userId
The User id
@param primaryPhotoExtras
A comma-delimited list of extra information to fetch for the ... | [
"Get",
"a",
"list",
"of",
"all",
"photosets",
"for",
"the",
"specified",
"user",
"."
] | train | https://github.com/boncey/Flickr4Java/blob/f66987ba0e360e5fb7730efbbb8c51f3d978fc25/src/main/java/com/flickr4java/flickr/photosets/PhotosetsInterface.java#L329-L331 |
lessthanoptimal/ejml | main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/BlockHouseHolder_DDRB.java | BlockHouseHolder_DDRB.computeW_Column | public static void computeW_Column(final int blockLength ,
final DSubmatrixD1 Y , final DSubmatrixD1 W ,
final double temp[], final double beta[] , int betaIndex ) {
"""
<p>
Computes W from the householder reflectors stored in the colum... | java | public static void computeW_Column(final int blockLength ,
final DSubmatrixD1 Y , final DSubmatrixD1 W ,
final double temp[], final double beta[] , int betaIndex ) {
final int widthB = W.col1-W.col0;
// set the first column ... | [
"public",
"static",
"void",
"computeW_Column",
"(",
"final",
"int",
"blockLength",
",",
"final",
"DSubmatrixD1",
"Y",
",",
"final",
"DSubmatrixD1",
"W",
",",
"final",
"double",
"temp",
"[",
"]",
",",
"final",
"double",
"beta",
"[",
"]",
",",
"int",
"betaIn... | <p>
Computes W from the householder reflectors stored in the columns of the column block
submatrix Y.
</p>
<p>
Y = v<sup>(1)</sup><br>
W = -β<sub>1</sub>v<sup>(1)</sup><br>
for j=2:r<br>
z = -β(I +WY<sup>T</sup>)v<sup>(j)</sup> <br>
W = [W z]<br>
Y = [Y v<sup>(j)</sup>]<br... | [
"<p",
">",
"Computes",
"W",
"from",
"the",
"householder",
"reflectors",
"stored",
"in",
"the",
"columns",
"of",
"the",
"column",
"block",
"submatrix",
"Y",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-ddense/src/org/ejml/dense/block/decomposition/qr/BlockHouseHolder_DDRB.java#L766-L783 |
twitter/cloudhopper-commons | ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java | DateTimePeriod.toHours | public List<DateTimePeriod> toHours() {
"""
Converts this period to a list of hour periods. Partial hours will not be
included. For example, a period of "January 20, 2009" will return a list
of 24 hours - one for each hour on January 20, 2009. On the other hand,
a period of "January 20, 2009 13:10" would ret... | java | public List<DateTimePeriod> toHours() {
ArrayList<DateTimePeriod> list = new ArrayList<DateTimePeriod>();
// default "current" hour to start datetime
DateTime currentStart = getStart();
// calculate "next" hour
DateTime nextStart = currentStart.plusHours(1);
// continue ... | [
"public",
"List",
"<",
"DateTimePeriod",
">",
"toHours",
"(",
")",
"{",
"ArrayList",
"<",
"DateTimePeriod",
">",
"list",
"=",
"new",
"ArrayList",
"<",
"DateTimePeriod",
">",
"(",
")",
";",
"// default \"current\" hour to start datetime",
"DateTime",
"currentStart",
... | Converts this period to a list of hour periods. Partial hours will not be
included. For example, a period of "January 20, 2009" will return a list
of 24 hours - one for each hour on January 20, 2009. On the other hand,
a period of "January 20, 2009 13:10" would return an empty list since partial
hours are not includ... | [
"Converts",
"this",
"period",
"to",
"a",
"list",
"of",
"hour",
"periods",
".",
"Partial",
"hours",
"will",
"not",
"be",
"included",
".",
"For",
"example",
"a",
"period",
"of",
"January",
"20",
"2009",
"will",
"return",
"a",
"list",
"of",
"24",
"hours",
... | train | https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/time/DateTimePeriod.java#L271-L288 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/filecache/DistributedCache.java | DistributedCache.setCacheFiles | public static void setCacheFiles(URI[] files, Configuration conf) {
"""
Set the configuration with the given set of files
@param files The list of files that need to be localized
@param conf Configuration which will be changed
"""
String sfiles = StringUtils.uriToString(files);
conf.set("mapred.cache... | java | public static void setCacheFiles(URI[] files, Configuration conf) {
String sfiles = StringUtils.uriToString(files);
conf.set("mapred.cache.files", sfiles);
} | [
"public",
"static",
"void",
"setCacheFiles",
"(",
"URI",
"[",
"]",
"files",
",",
"Configuration",
"conf",
")",
"{",
"String",
"sfiles",
"=",
"StringUtils",
".",
"uriToString",
"(",
"files",
")",
";",
"conf",
".",
"set",
"(",
"\"mapred.cache.files\"",
",",
... | Set the configuration with the given set of files
@param files The list of files that need to be localized
@param conf Configuration which will be changed | [
"Set",
"the",
"configuration",
"with",
"the",
"given",
"set",
"of",
"files"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/filecache/DistributedCache.java#L726-L729 |
messagebird/java-rest-api | api/src/main/java/com/messagebird/MessageBirdClient.java | MessageBirdClient.viewCallLegsByCallId | public VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException {
"""
Retrieves a listing of all legs.
@param callId Voice call ID
@param page page to fetch (can be null - will return first page),... | java | public VoiceCallLegResponse viewCallLegsByCallId(String callId, Integer page, Integer pageSize) throws UnsupportedEncodingException, UnauthorizedException, GeneralException {
if (callId == null) {
throw new IllegalArgumentException("Voice call ID must be specified.");
}
String url =... | [
"public",
"VoiceCallLegResponse",
"viewCallLegsByCallId",
"(",
"String",
"callId",
",",
"Integer",
"page",
",",
"Integer",
"pageSize",
")",
"throws",
"UnsupportedEncodingException",
",",
"UnauthorizedException",
",",
"GeneralException",
"{",
"if",
"(",
"callId",
"==",
... | Retrieves a listing of all legs.
@param callId Voice call ID
@param page page to fetch (can be null - will return first page), number of first page is 1
@param pageSize page size
@return VoiceCallLegResponse
@throws UnsupportedEncodingException no UTF8 supported url
@throws UnauthorizedException if client... | [
"Retrieves",
"a",
"listing",
"of",
"all",
"legs",
"."
] | train | https://github.com/messagebird/java-rest-api/blob/f92cd93afff413e6dc12aa6e41e69f26cbae8941/api/src/main/java/com/messagebird/MessageBirdClient.java#L984-L997 |
OpenLiberty/open-liberty | dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/productinfo/ProductInfo.java | ProductInfo.getUserExtensionVersionFiles | public static File[] getUserExtensionVersionFiles(File installDir) {
"""
Retrieves the product extension jar bundles located in the installation's usr directory.
@return The array of product extension jar bundles in the default (usr) location.
"""
File[] versionFiles = null;
String userDirL... | java | public static File[] getUserExtensionVersionFiles(File installDir) {
File[] versionFiles = null;
String userDirLoc = System.getenv(BootstrapConstants.ENV_WLP_USER_DIR);
File userDir = (userDirLoc != null) ? new File(userDirLoc) : ((installDir != null) ? new File(installDir, "usr") : null);
... | [
"public",
"static",
"File",
"[",
"]",
"getUserExtensionVersionFiles",
"(",
"File",
"installDir",
")",
"{",
"File",
"[",
"]",
"versionFiles",
"=",
"null",
";",
"String",
"userDirLoc",
"=",
"System",
".",
"getenv",
"(",
"BootstrapConstants",
".",
"ENV_WLP_USER_DIR... | Retrieves the product extension jar bundles located in the installation's usr directory.
@return The array of product extension jar bundles in the default (usr) location. | [
"Retrieves",
"the",
"product",
"extension",
"jar",
"bundles",
"located",
"in",
"the",
"installation",
"s",
"usr",
"directory",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.kernel.boot.core/src/com/ibm/ws/kernel/productinfo/ProductInfo.java#L233-L247 |
Azure/azure-sdk-for-java | storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/BlobServicesInner.java | BlobServicesInner.getServicePropertiesAsync | public Observable<BlobServicePropertiesInner> getServicePropertiesAsync(String resourceGroupName, String accountName) {
"""
Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@param resourceGroupName The name of the... | java | public Observable<BlobServicePropertiesInner> getServicePropertiesAsync(String resourceGroupName, String accountName) {
return getServicePropertiesWithServiceResponseAsync(resourceGroupName, accountName).map(new Func1<ServiceResponse<BlobServicePropertiesInner>, BlobServicePropertiesInner>() {
@Over... | [
"public",
"Observable",
"<",
"BlobServicePropertiesInner",
">",
"getServicePropertiesAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"accountName",
")",
"{",
"return",
"getServicePropertiesWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"accountName",
")"... | Gets the properties of a storage account’s Blob service, including properties for Storage Analytics and CORS (Cross-Origin Resource Sharing) rules.
@param resourceGroupName The name of the resource group within the user's subscription. The name is case insensitive.
@param accountName The name of the storage account wi... | [
"Gets",
"the",
"properties",
"of",
"a",
"storage",
"account’s",
"Blob",
"service",
"including",
"properties",
"for",
"Storage",
"Analytics",
"and",
"CORS",
"(",
"Cross",
"-",
"Origin",
"Resource",
"Sharing",
")",
"rules",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/storage/resource-manager/v2018_11_01/src/main/java/com/microsoft/azure/management/storage/v2018_11_01/implementation/BlobServicesInner.java#L197-L204 |
Omertron/api-themoviedb | src/main/java/com/omertron/themoviedbapi/methods/TmdbSeasons.java | TmdbSeasons.getSeasonCredits | public MediaCreditList getSeasonCredits(int tvID, int seasonNumber) throws MovieDbException {
"""
Get the cast & crew credits for a TV season by season number.
@param tvID
@param seasonNumber
@return
@throws MovieDbException
"""
TmdbParameters parameters = new TmdbParameters();
parameters... | java | public MediaCreditList getSeasonCredits(int tvID, int seasonNumber) throws MovieDbException {
TmdbParameters parameters = new TmdbParameters();
parameters.add(Param.ID, tvID);
parameters.add(Param.SEASON_NUMBER, seasonNumber);
URL url = new ApiUrl(apiKey, MethodBase.SEASON).subMethod(Me... | [
"public",
"MediaCreditList",
"getSeasonCredits",
"(",
"int",
"tvID",
",",
"int",
"seasonNumber",
")",
"throws",
"MovieDbException",
"{",
"TmdbParameters",
"parameters",
"=",
"new",
"TmdbParameters",
"(",
")",
";",
"parameters",
".",
"add",
"(",
"Param",
".",
"ID... | Get the cast & crew credits for a TV season by season number.
@param tvID
@param seasonNumber
@return
@throws MovieDbException | [
"Get",
"the",
"cast",
"&",
"crew",
"credits",
"for",
"a",
"TV",
"season",
"by",
"season",
"number",
"."
] | train | https://github.com/Omertron/api-themoviedb/blob/bf132d7c7271734e13b58ba3bc92bba46f220118/src/main/java/com/omertron/themoviedbapi/methods/TmdbSeasons.java#L134-L146 |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/vectorized/ColumnVector.java | ColumnVector.getInterval | public final CalendarInterval getInterval(int rowId) {
"""
Returns the calendar interval type value for rowId. If the slot for rowId is null, it should
return null.
In Spark, calendar interval type value is basically an integer value representing the number of
months in this interval, and a long value represe... | java | public final CalendarInterval getInterval(int rowId) {
if (isNullAt(rowId)) return null;
final int months = getChild(0).getInt(rowId);
final long microseconds = getChild(1).getLong(rowId);
return new CalendarInterval(months, microseconds);
} | [
"public",
"final",
"CalendarInterval",
"getInterval",
"(",
"int",
"rowId",
")",
"{",
"if",
"(",
"isNullAt",
"(",
"rowId",
")",
")",
"return",
"null",
";",
"final",
"int",
"months",
"=",
"getChild",
"(",
"0",
")",
".",
"getInt",
"(",
"rowId",
")",
";",
... | Returns the calendar interval type value for rowId. If the slot for rowId is null, it should
return null.
In Spark, calendar interval type value is basically an integer value representing the number of
months in this interval, and a long value representing the number of microseconds in this
interval. An interval type ... | [
"Returns",
"the",
"calendar",
"interval",
"type",
"value",
"for",
"rowId",
".",
"If",
"the",
"slot",
"for",
"rowId",
"is",
"null",
"it",
"should",
"return",
"null",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/vectorized/ColumnVector.java#L280-L285 |
Arnauld/org.technbolts.junit | src/main/java/org/technbolts/junit/runners/FrameworkMethodRunner.java | FrameworkMethodRunner.methodInvoker | protected Statement methodInvoker(FrameworkMethod method, Object test) {
"""
Returns a {@link Statement} that invokes {@code method} on {@code test}
"""
return new ParameterizedInvokeMethod(method, test, methodArgs);
} | java | protected Statement methodInvoker(FrameworkMethod method, Object test) {
return new ParameterizedInvokeMethod(method, test, methodArgs);
} | [
"protected",
"Statement",
"methodInvoker",
"(",
"FrameworkMethod",
"method",
",",
"Object",
"test",
")",
"{",
"return",
"new",
"ParameterizedInvokeMethod",
"(",
"method",
",",
"test",
",",
"methodArgs",
")",
";",
"}"
] | Returns a {@link Statement} that invokes {@code method} on {@code test} | [
"Returns",
"a",
"{"
] | train | https://github.com/Arnauld/org.technbolts.junit/blob/90fb8032bbbcaf25f266693a4bdd3bde8dcc37a9/src/main/java/org/technbolts/junit/runners/FrameworkMethodRunner.java#L162-L164 |
spotbugs/spotbugs | eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java | ASTUtil.getFieldDeclaration | public static FieldDeclaration getFieldDeclaration(TypeDeclaration type, String fieldName)
throws FieldDeclarationNotFoundException {
"""
Returns the <CODE>FieldDeclaration</CODE> for the specified field name.
The field has to be declared in the specified
<CODE>TypeDeclaration</CODE>.
@param type
... | java | public static FieldDeclaration getFieldDeclaration(TypeDeclaration type, String fieldName)
throws FieldDeclarationNotFoundException {
requireNonNull(type, "type declaration");
requireNonNull(fieldName, "field name");
for (FieldDeclaration field : type.getFields()) {
for ... | [
"public",
"static",
"FieldDeclaration",
"getFieldDeclaration",
"(",
"TypeDeclaration",
"type",
",",
"String",
"fieldName",
")",
"throws",
"FieldDeclarationNotFoundException",
"{",
"requireNonNull",
"(",
"type",
",",
"\"type declaration\"",
")",
";",
"requireNonNull",
"(",... | Returns the <CODE>FieldDeclaration</CODE> for the specified field name.
The field has to be declared in the specified
<CODE>TypeDeclaration</CODE>.
@param type
The <CODE>TypeDeclaration</CODE>, where the
<CODE>FieldDeclaration</CODE> is declared in.
@param fieldName
The simple field name to search for.
@return the <CO... | [
"Returns",
"the",
"<CODE",
">",
"FieldDeclaration<",
"/",
"CODE",
">",
"for",
"the",
"specified",
"field",
"name",
".",
"The",
"field",
"has",
"to",
"be",
"declared",
"in",
"the",
"specified",
"<CODE",
">",
"TypeDeclaration<",
"/",
"CODE",
">",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/eclipsePlugin/src/edu/umd/cs/findbugs/plugin/eclipse/quickfix/util/ASTUtil.java#L305-L320 |
datacleaner/DataCleaner | engine/core/src/main/java/org/datacleaner/job/runner/AbstractRowProcessingPublisher.java | AbstractRowProcessingPublisher.initializeConsumers | @Override
public final void initializeConsumers(final TaskListener finishedListener) {
"""
Initializes consumers of this {@link SourceTableRowProcessingPublisher}.
This method will not initialize consumers containing
{@link MultiStreamComponent}s. Ensure that
{@link #initializeMultiStreamConsumers(Set)} i... | java | @Override
public final void initializeConsumers(final TaskListener finishedListener) {
final TaskRunner taskRunner = getTaskRunner();
final List<RowProcessingConsumer> configurableConsumers = getConsumers();
final int numConfigurableConsumers = configurableConsumers.size();
final Joi... | [
"@",
"Override",
"public",
"final",
"void",
"initializeConsumers",
"(",
"final",
"TaskListener",
"finishedListener",
")",
"{",
"final",
"TaskRunner",
"taskRunner",
"=",
"getTaskRunner",
"(",
")",
";",
"final",
"List",
"<",
"RowProcessingConsumer",
">",
"configurable... | Initializes consumers of this {@link SourceTableRowProcessingPublisher}.
This method will not initialize consumers containing
{@link MultiStreamComponent}s. Ensure that
{@link #initializeMultiStreamConsumers(Set)} is also invoked.
Once consumers are initialized, row processing can begin, expected rows
can be calculat... | [
"Initializes",
"consumers",
"of",
"this",
"{",
"@link",
"SourceTableRowProcessingPublisher",
"}",
"."
] | train | https://github.com/datacleaner/DataCleaner/blob/9aa01fdac3560cef51c55df3cb2ac5c690b57639/engine/core/src/main/java/org/datacleaner/job/runner/AbstractRowProcessingPublisher.java#L297-L307 |
Azure/azure-sdk-for-java | batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java | ExperimentsInner.listByWorkspaceAsync | public Observable<Page<ExperimentInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
"""
Gets a list of Experiments within the specified Workspace.
@param resourceGroupName Name of the resource grou... | java | public Observable<Page<ExperimentInner>> listByWorkspaceAsync(final String resourceGroupName, final String workspaceName, final ExperimentsListByWorkspaceOptions experimentsListByWorkspaceOptions) {
return listByWorkspaceWithServiceResponseAsync(resourceGroupName, workspaceName, experimentsListByWorkspaceOption... | [
"public",
"Observable",
"<",
"Page",
"<",
"ExperimentInner",
">",
">",
"listByWorkspaceAsync",
"(",
"final",
"String",
"resourceGroupName",
",",
"final",
"String",
"workspaceName",
",",
"final",
"ExperimentsListByWorkspaceOptions",
"experimentsListByWorkspaceOptions",
")",
... | Gets a list of Experiments within the specified Workspace.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param workspaceName The name of the workspace. Workspace names can only contain a combination of alphanumeric characters along with dash (-) and underscore (_). The name must b... | [
"Gets",
"a",
"list",
"of",
"Experiments",
"within",
"the",
"specified",
"Workspace",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batchai/resource-manager/v2018_05_01/src/main/java/com/microsoft/azure/management/batchai/v2018_05_01/implementation/ExperimentsInner.java#L264-L272 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/QueryParserBase.java | QueryParserBase.createQueryStringFromCriteria | protected String createQueryStringFromCriteria(Criteria criteria, @Nullable Class<?> domainType) {
"""
Iterates criteria list and concats query string fragments to form a valid query string to be used with
{@link org.apache.solr.client.solrj.SolrQuery#setQuery(String)}
@param criteria
@param domainType
@retu... | java | protected String createQueryStringFromCriteria(Criteria criteria, @Nullable Class<?> domainType) {
return createQueryStringFromNode(criteria, domainType);
} | [
"protected",
"String",
"createQueryStringFromCriteria",
"(",
"Criteria",
"criteria",
",",
"@",
"Nullable",
"Class",
"<",
"?",
">",
"domainType",
")",
"{",
"return",
"createQueryStringFromNode",
"(",
"criteria",
",",
"domainType",
")",
";",
"}"
] | Iterates criteria list and concats query string fragments to form a valid query string to be used with
{@link org.apache.solr.client.solrj.SolrQuery#setQuery(String)}
@param criteria
@param domainType
@return
@since 4.0 | [
"Iterates",
"criteria",
"list",
"and",
"concats",
"query",
"string",
"fragments",
"to",
"form",
"a",
"valid",
"query",
"string",
"to",
"be",
"used",
"with",
"{",
"@link",
"org",
".",
"apache",
".",
"solr",
".",
"client",
".",
"solrj",
".",
"SolrQuery#setQu... | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/QueryParserBase.java#L240-L242 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.