repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 194 | func_name stringlengths 6 111 | whole_func_string stringlengths 80 3.8k | language stringclasses 1
value | func_code_string stringlengths 80 3.8k | func_code_tokens listlengths 20 697 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 434 | split_name stringclasses 1
value | func_code_url stringlengths 111 308 |
|---|---|---|---|---|---|---|---|---|---|---|
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.assertJsonEquals | public static void assertJsonEquals(Object expected, Object actual, Configuration configuration) {
assertJsonPartEquals(expected, actual, ROOT, configuration);
} | java | public static void assertJsonEquals(Object expected, Object actual, Configuration configuration) {
assertJsonPartEquals(expected, actual, ROOT, configuration);
} | [
"public",
"static",
"void",
"assertJsonEquals",
"(",
"Object",
"expected",
",",
"Object",
"actual",
",",
"Configuration",
"configuration",
")",
"{",
"assertJsonPartEquals",
"(",
"expected",
",",
"actual",
",",
"ROOT",
",",
"configuration",
")",
";",
"}"
] | Compares to JSON documents. Throws {@link AssertionError} if they are different. | [
"Compares",
"to",
"JSON",
"documents",
".",
"Throws",
"{"
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L66-L68 |
SeleniumJT/seleniumjt-core | src/main/java/com/jt/selenium/SeleniumJT.java | SeleniumJT.fireEvent | @LogExecTime
public void fireEvent(String locator, String eventName)
{
jtCore.fireEvent(locator, eventName);
} | java | @LogExecTime
public void fireEvent(String locator, String eventName)
{
jtCore.fireEvent(locator, eventName);
} | [
"@",
"LogExecTime",
"public",
"void",
"fireEvent",
"(",
"String",
"locator",
",",
"String",
"eventName",
")",
"{",
"jtCore",
".",
"fireEvent",
"(",
"locator",
",",
"eventName",
")",
";",
"}"
] | This requires a jquery locator or an ID. The leading hash (#) should not be provided to this method if it is just an ID | [
"This",
"requires",
"a",
"jquery",
"locator",
"or",
"an",
"ID",
".",
"The",
"leading",
"hash",
"(",
"#",
")",
"should",
"not",
"be",
"provided",
"to",
"this",
"method",
"if",
"it",
"is",
"just",
"an",
"ID"
] | train | https://github.com/SeleniumJT/seleniumjt-core/blob/8e972f69adc4846a3f1d7b8ca9c3f8d953a2d0f3/src/main/java/com/jt/selenium/SeleniumJT.java#L741-L745 |
Azure/azure-sdk-for-java | applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsInner.java | ProactiveDetectionConfigurationsInner.getAsync | public Observable<ApplicationInsightsComponentProactiveDetectionConfigurationInner> getAsync(String resourceGroupName, String resourceName, String configurationId) {
return getWithServiceResponseAsync(resourceGroupName, resourceName, configurationId).map(new Func1<ServiceResponse<ApplicationInsightsComponentPro... | java | public Observable<ApplicationInsightsComponentProactiveDetectionConfigurationInner> getAsync(String resourceGroupName, String resourceName, String configurationId) {
return getWithServiceResponseAsync(resourceGroupName, resourceName, configurationId).map(new Func1<ServiceResponse<ApplicationInsightsComponentPro... | [
"public",
"Observable",
"<",
"ApplicationInsightsComponentProactiveDetectionConfigurationInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
",",
"String",
"configurationId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"reso... | Get the ProactiveDetection configuration for this configuration id.
@param resourceGroupName The name of the resource group.
@param resourceName The name of the Application Insights component resource.
@param configurationId The ProactiveDetection configuration ID. This is unique within a Application Insights componen... | [
"Get",
"the",
"ProactiveDetection",
"configuration",
"for",
"this",
"configuration",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/applicationinsights/resource-manager/v2015_05_01/src/main/java/com/microsoft/azure/management/applicationinsights/v2015_05_01/implementation/ProactiveDetectionConfigurationsInner.java#L196-L203 |
guardtime/ksi-java-sdk | ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/VerificationContextBuilder.java | VerificationContextBuilder.createVerificationContext | @Deprecated
public final VerificationContext createVerificationContext() throws KSIException {
if (signature == null) {
throw new KSIException("Failed to createSignature verification context. Signature must be present.");
}
if (extendingService == null) {
throw new KS... | java | @Deprecated
public final VerificationContext createVerificationContext() throws KSIException {
if (signature == null) {
throw new KSIException("Failed to createSignature verification context. Signature must be present.");
}
if (extendingService == null) {
throw new KS... | [
"@",
"Deprecated",
"public",
"final",
"VerificationContext",
"createVerificationContext",
"(",
")",
"throws",
"KSIException",
"{",
"if",
"(",
"signature",
"==",
"null",
")",
"{",
"throw",
"new",
"KSIException",
"(",
"\"Failed to createSignature verification context. Signa... | Builds the verification context.
@return instance of verification context
@throws KSIException when error occurs (e.g mandatory parameters aren't present) | [
"Builds",
"the",
"verification",
"context",
"."
] | train | https://github.com/guardtime/ksi-java-sdk/blob/b2cd877050f0f392657c724452318d10a1002171/ksi-api/src/main/java/com/guardtime/ksi/unisignature/verifier/VerificationContextBuilder.java#L149-L161 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java | RichClientFramework.isEqual | private boolean isEqual(Object o1, Object o2)
{
// Both null - they are equal
if (o1 == null && o2 == null)
{
return true;
}
// One is null and the other isn't - they are not equal
if ((o1 == null && o2 != null) || (o1 != null && o2 == null))
{
... | java | private boolean isEqual(Object o1, Object o2)
{
// Both null - they are equal
if (o1 == null && o2 == null)
{
return true;
}
// One is null and the other isn't - they are not equal
if ((o1 == null && o2 != null) || (o1 != null && o2 == null))
{
... | [
"private",
"boolean",
"isEqual",
"(",
"Object",
"o1",
",",
"Object",
"o2",
")",
"{",
"// Both null - they are equal",
"if",
"(",
"o1",
"==",
"null",
"&&",
"o2",
"==",
"null",
")",
"{",
"return",
"true",
";",
"}",
"// One is null and the other isn't - they are no... | Compares two objects. Returns false if one is null but the other isn't, returns true if both
are null, otherwise returns the result of their equals() method.
@param o1
@param o2
@return Returns true if o1 and o2 are equal. | [
"Compares",
"two",
"objects",
".",
"Returns",
"false",
"if",
"one",
"is",
"null",
"but",
"the",
"other",
"isn",
"t",
"returns",
"true",
"if",
"both",
"are",
"null",
"otherwise",
"returns",
"the",
"result",
"of",
"their",
"equals",
"()",
"method",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/jfapchannel/richclient/framework/impl/RichClientFramework.java#L638-L653 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/ObjectIdentifier.java | ObjectIdentifier.verifyNonEmpty | protected static String verifyNonEmpty(String value, String argName) {
if (value != null) {
value = value.trim();
if (value.isEmpty()) {
value = null;
}
}
if (value == null) {
throw new IllegalArgumentException(argName);
}
... | java | protected static String verifyNonEmpty(String value, String argName) {
if (value != null) {
value = value.trim();
if (value.isEmpty()) {
value = null;
}
}
if (value == null) {
throw new IllegalArgumentException(argName);
}
... | [
"protected",
"static",
"String",
"verifyNonEmpty",
"(",
"String",
"value",
",",
"String",
"argName",
")",
"{",
"if",
"(",
"value",
"!=",
"null",
")",
"{",
"value",
"=",
"value",
".",
"trim",
"(",
")",
";",
"if",
"(",
"value",
".",
"isEmpty",
"(",
")"... | Verifies a value is null or empty. Returns the value if non-empty and throws exception if empty.
@param value the value to verify.
@param argName the name of the value.
@return Returns the value if non-empty. | [
"Verifies",
"a",
"value",
"is",
"null",
"or",
"empty",
".",
"Returns",
"the",
"value",
"if",
"non",
"-",
"empty",
"and",
"throws",
"exception",
"if",
"empty",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/ObjectIdentifier.java#L52-L63 |
needle4j/needle4j | src/main/java/org/needle4j/common/Preconditions.java | Preconditions.checkArgument | public static void checkArgument(final boolean condition, final String message, final Object... parameters) {
if (!condition) {
throw new IllegalArgumentException(format(message, parameters));
}
} | java | public static void checkArgument(final boolean condition, final String message, final Object... parameters) {
if (!condition) {
throw new IllegalArgumentException(format(message, parameters));
}
} | [
"public",
"static",
"void",
"checkArgument",
"(",
"final",
"boolean",
"condition",
",",
"final",
"String",
"message",
",",
"final",
"Object",
"...",
"parameters",
")",
"{",
"if",
"(",
"!",
"condition",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | Throws an {@link IllegalArgumentException} with formatted message if
condition is not met.
@param condition
a boolean condition that must be <code>true</code> to pass
@param message
text to use as exception message
@param parameters
optional parameters used in
{@link String#format(String, Object...)} | [
"Throws",
"an",
"{",
"@link",
"IllegalArgumentException",
"}",
"with",
"formatted",
"message",
"if",
"condition",
"is",
"not",
"met",
"."
] | train | https://github.com/needle4j/needle4j/blob/55fbcdeed72be5cf26e4404b0fe40282792b51f2/src/main/java/org/needle4j/common/Preconditions.java#L47-L51 |
authorjapps/zerocode | core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java | BasicHttpClient.createDefaultRequestBuilder | public RequestBuilder createDefaultRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) {
RequestBuilder requestBuilder = RequestBuilder
.create(methodName)
.setUri(httpUrl);
if (reqBodyAsString != null) {
HttpEntity httpEntity = EntityBu... | java | public RequestBuilder createDefaultRequestBuilder(String httpUrl, String methodName, String reqBodyAsString) {
RequestBuilder requestBuilder = RequestBuilder
.create(methodName)
.setUri(httpUrl);
if (reqBodyAsString != null) {
HttpEntity httpEntity = EntityBu... | [
"public",
"RequestBuilder",
"createDefaultRequestBuilder",
"(",
"String",
"httpUrl",
",",
"String",
"methodName",
",",
"String",
"reqBodyAsString",
")",
"{",
"RequestBuilder",
"requestBuilder",
"=",
"RequestBuilder",
".",
"create",
"(",
"methodName",
")",
".",
"setUri... | This is the usual http request builder most widely used using Apache Http Client. In case you want to build
or prepare the requests differently, you can override this method.
Please see the following request builder to handle file uploads.
- BasicHttpClient#createFileUploadRequestBuilder(java.lang.String, java.lang.St... | [
"This",
"is",
"the",
"usual",
"http",
"request",
"builder",
"most",
"widely",
"used",
"using",
"Apache",
"Http",
"Client",
".",
"In",
"case",
"you",
"want",
"to",
"build",
"or",
"prepare",
"the",
"requests",
"differently",
"you",
"can",
"override",
"this",
... | train | https://github.com/authorjapps/zerocode/blob/d66a3e8778d2eb5e4f0006bfcccfc0922ceb7cef/core/src/main/java/org/jsmart/zerocode/core/httpclient/BasicHttpClient.java#L279-L292 |
fuzzylite/jfuzzylite | jfuzzylite/src/main/java/com/fuzzylite/imex/RScriptExporter.java | RScriptExporter.writeScriptHeader | protected void writeScriptHeader(Writer writer, Engine engine) throws IOException {
writer.append("#Code automatically generated with " + FuzzyLite.LIBRARY + ".\n\n");
writer.append("library(ggplot2);\n");
writer.append("\n");
writer.append("engine.name = \"" + engine.getName() + "\"\n")... | java | protected void writeScriptHeader(Writer writer, Engine engine) throws IOException {
writer.append("#Code automatically generated with " + FuzzyLite.LIBRARY + ".\n\n");
writer.append("library(ggplot2);\n");
writer.append("\n");
writer.append("engine.name = \"" + engine.getName() + "\"\n")... | [
"protected",
"void",
"writeScriptHeader",
"(",
"Writer",
"writer",
",",
"Engine",
"engine",
")",
"throws",
"IOException",
"{",
"writer",
".",
"append",
"(",
"\"#Code automatically generated with \"",
"+",
"FuzzyLite",
".",
"LIBRARY",
"+",
"\".\\n\\n\"",
")",
";",
... | Writes the header of the R script (e.g., import libraries)
@param writer is the output where the header will be written to
@param engine is the engine to export
@throws IOException if any error occurs upon writing on the writer | [
"Writes",
"the",
"header",
"of",
"the",
"R",
"script",
"(",
"e",
".",
"g",
".",
"import",
"libraries",
")"
] | train | https://github.com/fuzzylite/jfuzzylite/blob/583ac1928f39512af75de80d560e67448039595a/jfuzzylite/src/main/java/com/fuzzylite/imex/RScriptExporter.java#L375-L385 |
lightblueseas/email-tails | src/main/java/de/alpharogroup/email/messages/EmailWithAttachments.java | EmailWithAttachments.addAttachment | public void addAttachment(final byte[] content, final String filename, final String mimetype)
throws MessagingException
{
final DataSource dataSource = new ByteArrayDataSource(content, mimetype);
final DataHandler dataHandler = new DataHandler(dataSource);
addAttachment(dataHandler, filename);
} | java | public void addAttachment(final byte[] content, final String filename, final String mimetype)
throws MessagingException
{
final DataSource dataSource = new ByteArrayDataSource(content, mimetype);
final DataHandler dataHandler = new DataHandler(dataSource);
addAttachment(dataHandler, filename);
} | [
"public",
"void",
"addAttachment",
"(",
"final",
"byte",
"[",
"]",
"content",
",",
"final",
"String",
"filename",
",",
"final",
"String",
"mimetype",
")",
"throws",
"MessagingException",
"{",
"final",
"DataSource",
"dataSource",
"=",
"new",
"ByteArrayDataSource",
... | Adds the attachment.
@param content
The bytearray with the content.
@param filename
The new Filename for the attachment.
@param mimetype
The mimetype.
@throws MessagingException
is thrown if the underlying implementation does not support modification of
existing values | [
"Adds",
"the",
"attachment",
"."
] | train | https://github.com/lightblueseas/email-tails/blob/7be6fee3548e61e697cc8e64e90603cb1f505be2/src/main/java/de/alpharogroup/email/messages/EmailWithAttachments.java#L97-L103 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java | SDNN.batchNorm | public SDVariable batchNorm(String name, SDVariable input, SDVariable mean,
SDVariable variance, SDVariable gamma,
SDVariable beta, double epsilon, int... axis) {
return batchNorm(name, input, mean, variance, gamma, beta, true, true, epsilon, axis)... | java | public SDVariable batchNorm(String name, SDVariable input, SDVariable mean,
SDVariable variance, SDVariable gamma,
SDVariable beta, double epsilon, int... axis) {
return batchNorm(name, input, mean, variance, gamma, beta, true, true, epsilon, axis)... | [
"public",
"SDVariable",
"batchNorm",
"(",
"String",
"name",
",",
"SDVariable",
"input",
",",
"SDVariable",
"mean",
",",
"SDVariable",
"variance",
",",
"SDVariable",
"gamma",
",",
"SDVariable",
"beta",
",",
"double",
"epsilon",
",",
"int",
"...",
"axis",
")",
... | Neural network batch normalization operation.<br>
For details, see <a href="http://arxiv.org/abs/1502.03167">http://arxiv.org/abs/1502.03167</a>
@param name Name of the output variable
@param input Input variable.
@param mean Mean value. For 1d axis, this should match input.size(axis)
@param variance Varian... | [
"Neural",
"network",
"batch",
"normalization",
"operation",
".",
"<br",
">",
"For",
"details",
"see",
"<a",
"href",
"=",
"http",
":",
"//",
"arxiv",
".",
"org",
"/",
"abs",
"/",
"1502",
".",
"03167",
">",
"http",
":",
"//",
"arxiv",
".",
"org",
"/",
... | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/samediff/ops/SDNN.java#L69-L73 |
stripe/stripe-java | src/main/java/com/stripe/model/Invoice.java | Invoice.sendInvoice | public Invoice sendInvoice() throws StripeException {
return sendInvoice((Map<String, Object>) null, (RequestOptions) null);
} | java | public Invoice sendInvoice() throws StripeException {
return sendInvoice((Map<String, Object>) null, (RequestOptions) null);
} | [
"public",
"Invoice",
"sendInvoice",
"(",
")",
"throws",
"StripeException",
"{",
"return",
"sendInvoice",
"(",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
")",
"null",
",",
"(",
"RequestOptions",
")",
"null",
")",
";",
"}"
] | Stripe will automatically send invoices to customers according to your <a
href="https://dashboard.stripe.com/account/billing/automatic">subscriptions settings</a>.
However, if you’d like to manually send an invoice to your customer out of the normal schedule,
you can do so. When sending invoices that have already been ... | [
"Stripe",
"will",
"automatically",
"send",
"invoices",
"to",
"customers",
"according",
"to",
"your",
"<a",
"href",
"=",
"https",
":",
"//",
"dashboard",
".",
"stripe",
".",
"com",
"/",
"account",
"/",
"billing",
"/",
"automatic",
">",
"subscriptions",
"setti... | train | https://github.com/stripe/stripe-java/blob/acfa8becef3e73bfe3e9d8880bea3f3f30dadeac/src/main/java/com/stripe/model/Invoice.java#L1017-L1019 |
lastaflute/lastaflute | src/main/java/org/lastaflute/core/magic/ThreadCacheContext.java | ThreadCacheContext.setObject | public static void setObject(String key, Object value) {
if (!exists()) {
throwThreadCacheNotInitializedException(key);
}
threadLocal.get().put(key, value);
} | java | public static void setObject(String key, Object value) {
if (!exists()) {
throwThreadCacheNotInitializedException(key);
}
threadLocal.get().put(key, value);
} | [
"public",
"static",
"void",
"setObject",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"if",
"(",
"!",
"exists",
"(",
")",
")",
"{",
"throwThreadCacheNotInitializedException",
"(",
"key",
")",
";",
"}",
"threadLocal",
".",
"get",
"(",
")",
".",... | Set the value of the object.
@param key The key of the object. (NotNull)
@param value The value of the object. (NullAllowed) | [
"Set",
"the",
"value",
"of",
"the",
"object",
"."
] | train | https://github.com/lastaflute/lastaflute/blob/17b56dda8322e4c6d79043532c1dda917d6b60a8/src/main/java/org/lastaflute/core/magic/ThreadCacheContext.java#L146-L151 |
phax/ph-commons | ph-commons/src/main/java/com/helger/commons/string/StringHelper.java | StringHelper.containsNone | public static boolean containsNone (@Nullable final String sStr, @Nullable final ICharPredicate aFilter)
{
final int nLen = getLength (sStr);
if (aFilter == null)
return nLen == 0;
if (nLen > 0)
for (final char c : sStr.toCharArray ())
if (aFilter.test (c))
return false;
... | java | public static boolean containsNone (@Nullable final String sStr, @Nullable final ICharPredicate aFilter)
{
final int nLen = getLength (sStr);
if (aFilter == null)
return nLen == 0;
if (nLen > 0)
for (final char c : sStr.toCharArray ())
if (aFilter.test (c))
return false;
... | [
"public",
"static",
"boolean",
"containsNone",
"(",
"@",
"Nullable",
"final",
"String",
"sStr",
",",
"@",
"Nullable",
"final",
"ICharPredicate",
"aFilter",
")",
"{",
"final",
"int",
"nLen",
"=",
"getLength",
"(",
"sStr",
")",
";",
"if",
"(",
"aFilter",
"==... | Check if the passed {@link String} contains no character matching the
provided filter.
@param sStr
String to check. May be <code>null</code>.
@param aFilter
The filter to use. May be <code>null</code>.
@return <code>true</code> if the filter is <code>null</code> and the string
is empty. <code>true</code> if the filter... | [
"Check",
"if",
"the",
"passed",
"{",
"@link",
"String",
"}",
"contains",
"no",
"character",
"matching",
"the",
"provided",
"filter",
"."
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/string/StringHelper.java#L284-L295 |
j256/ormlite-core | src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java | DatabaseFieldConfig.fromField | public static DatabaseFieldConfig fromField(DatabaseType databaseType, String tableName, Field field)
throws SQLException {
// first we lookup the @DatabaseField annotation
DatabaseField databaseField = field.getAnnotation(DatabaseField.class);
if (databaseField != null) {
if (databaseField.persisted()) {
... | java | public static DatabaseFieldConfig fromField(DatabaseType databaseType, String tableName, Field field)
throws SQLException {
// first we lookup the @DatabaseField annotation
DatabaseField databaseField = field.getAnnotation(DatabaseField.class);
if (databaseField != null) {
if (databaseField.persisted()) {
... | [
"public",
"static",
"DatabaseFieldConfig",
"fromField",
"(",
"DatabaseType",
"databaseType",
",",
"String",
"tableName",
",",
"Field",
"field",
")",
"throws",
"SQLException",
"{",
"// first we lookup the @DatabaseField annotation",
"DatabaseField",
"databaseField",
"=",
"fi... | Create and return a config converted from a {@link Field} that may have one of the following annotations:
{@link DatabaseField}, {@link ForeignCollectionField}, or javax.persistence... | [
"Create",
"and",
"return",
"a",
"config",
"converted",
"from",
"a",
"{"
] | train | https://github.com/j256/ormlite-core/blob/154d85bbb9614a0ea65a012251257831fb4fba21/src/main/java/com/j256/ormlite/field/DatabaseFieldConfig.java#L511-L539 |
lucee/Lucee | core/src/main/java/lucee/runtime/reflection/Reflector.java | Reflector.getGetter | public static MethodInstance getGetter(Class clazz, String prop) throws PageException, NoSuchMethodException {
String getterName = "get" + StringUtil.ucFirst(prop);
MethodInstance mi = getMethodInstanceEL(null, clazz, KeyImpl.getInstance(getterName), ArrayUtil.OBJECT_EMPTY);
if (mi == null) {
String isName = "... | java | public static MethodInstance getGetter(Class clazz, String prop) throws PageException, NoSuchMethodException {
String getterName = "get" + StringUtil.ucFirst(prop);
MethodInstance mi = getMethodInstanceEL(null, clazz, KeyImpl.getInstance(getterName), ArrayUtil.OBJECT_EMPTY);
if (mi == null) {
String isName = "... | [
"public",
"static",
"MethodInstance",
"getGetter",
"(",
"Class",
"clazz",
",",
"String",
"prop",
")",
"throws",
"PageException",
",",
"NoSuchMethodException",
"{",
"String",
"getterName",
"=",
"\"get\"",
"+",
"StringUtil",
".",
"ucFirst",
"(",
"prop",
")",
";",
... | to get a Getter Method of a Object
@param clazz Class to invoke method from
@param prop Name of the Method without get
@return return Value of the getter Method
@throws NoSuchMethodException
@throws PageException | [
"to",
"get",
"a",
"Getter",
"Method",
"of",
"a",
"Object"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/reflection/Reflector.java#L946-L967 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.createUnknown | public static SourceLineAnnotation createUnknown(@DottedClassName String className, String sourceFile) {
return createUnknown(className, sourceFile, -1, -1);
} | java | public static SourceLineAnnotation createUnknown(@DottedClassName String className, String sourceFile) {
return createUnknown(className, sourceFile, -1, -1);
} | [
"public",
"static",
"SourceLineAnnotation",
"createUnknown",
"(",
"@",
"DottedClassName",
"String",
"className",
",",
"String",
"sourceFile",
")",
"{",
"return",
"createUnknown",
"(",
"className",
",",
"sourceFile",
",",
"-",
"1",
",",
"-",
"1",
")",
";",
"}"
... | Factory method to create an unknown source line annotation.
@param className
the class name
@param sourceFile
the source file name
@return the SourceLineAnnotation | [
"Factory",
"method",
"to",
"create",
"an",
"unknown",
"source",
"line",
"annotation",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L167-L169 |
icode/ameba-utils | src/main/java/ameba/util/bean/BeanMap.java | BeanMap.put | @Override
public Object put(String name, Object value) throws IllegalArgumentException, ClassCastException {
if (bean != null) {
Object oldValue = get(name);
BeanInvoker invoker = getWriteInvoker(name);
if (invoker == null) {
return null;
}
... | java | @Override
public Object put(String name, Object value) throws IllegalArgumentException, ClassCastException {
if (bean != null) {
Object oldValue = get(name);
BeanInvoker invoker = getWriteInvoker(name);
if (invoker == null) {
return null;
}
... | [
"@",
"Override",
"public",
"Object",
"put",
"(",
"String",
"name",
",",
"Object",
"value",
")",
"throws",
"IllegalArgumentException",
",",
"ClassCastException",
"{",
"if",
"(",
"bean",
"!=",
"null",
")",
"{",
"Object",
"oldValue",
"=",
"get",
"(",
"name",
... | {@inheritDoc}
Sets the bean property with the given name to the given value. | [
"{",
"@inheritDoc",
"}"
] | train | https://github.com/icode/ameba-utils/blob/1aad5317a22e546c83dfe2dc0c80a1dc1fa0ea35/src/main/java/ameba/util/bean/BeanMap.java#L255-L278 |
baratine/baratine | framework/src/main/java/com/caucho/v5/vfs/Jar.java | Jar.createDepend | public static PersistentDependency createDepend(PathImpl backing, long digest)
{
Jar jar = create(backing);
return new JarDigestDepend(jar.getJarDepend(), digest);
} | java | public static PersistentDependency createDepend(PathImpl backing, long digest)
{
Jar jar = create(backing);
return new JarDigestDepend(jar.getJarDepend(), digest);
} | [
"public",
"static",
"PersistentDependency",
"createDepend",
"(",
"PathImpl",
"backing",
",",
"long",
"digest",
")",
"{",
"Jar",
"jar",
"=",
"create",
"(",
"backing",
")",
";",
"return",
"new",
"JarDigestDepend",
"(",
"jar",
".",
"getJarDepend",
"(",
")",
","... | Return a Jar for the path. If the backing already exists, return
the old jar. | [
"Return",
"a",
"Jar",
"for",
"the",
"path",
".",
"If",
"the",
"backing",
"already",
"exists",
"return",
"the",
"old",
"jar",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/framework/src/main/java/com/caucho/v5/vfs/Jar.java#L168-L173 |
Azure/azure-sdk-for-java | edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/StorageAccountCredentialsInner.java | StorageAccountCredentialsInner.beginCreateOrUpdate | public StorageAccountCredentialInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).toBlocking().single().bod... | java | public StorageAccountCredentialInner beginCreateOrUpdate(String deviceName, String name, String resourceGroupName, StorageAccountCredentialInner storageAccountCredential) {
return beginCreateOrUpdateWithServiceResponseAsync(deviceName, name, resourceGroupName, storageAccountCredential).toBlocking().single().bod... | [
"public",
"StorageAccountCredentialInner",
"beginCreateOrUpdate",
"(",
"String",
"deviceName",
",",
"String",
"name",
",",
"String",
"resourceGroupName",
",",
"StorageAccountCredentialInner",
"storageAccountCredential",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponseA... | Creates or updates the storage account credential.
@param deviceName The device name.
@param name The storage account credential name.
@param resourceGroupName The resource group name.
@param storageAccountCredential The storage account credential.
@throws IllegalArgumentException thrown if parameters fail the validat... | [
"Creates",
"or",
"updates",
"the",
"storage",
"account",
"credential",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/edgegateway/resource-manager/v2019_03_01/src/main/java/com/microsoft/azure/management/edgegateway/v2019_03_01/implementation/StorageAccountCredentialsInner.java#L406-L408 |
apache/flink | flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java | PythonStreamExecutionEnvironment.socket_text_stream | public PythonDataStream socket_text_stream(String host, int port) {
return new PythonDataStream<>(env.socketTextStream(host, port).map(new AdapterMap<String>()));
} | java | public PythonDataStream socket_text_stream(String host, int port) {
return new PythonDataStream<>(env.socketTextStream(host, port).map(new AdapterMap<String>()));
} | [
"public",
"PythonDataStream",
"socket_text_stream",
"(",
"String",
"host",
",",
"int",
"port",
")",
"{",
"return",
"new",
"PythonDataStream",
"<>",
"(",
"env",
".",
"socketTextStream",
"(",
"host",
",",
"port",
")",
".",
"map",
"(",
"new",
"AdapterMap",
"<",... | A thin wrapper layer over {@link StreamExecutionEnvironment#socketTextStream(java.lang.String, int)}.
@param host The host name which a server socket binds
@param port The port number which a server socket binds. A port number of 0 means that the port number is automatically
allocated.
@return A python data stream con... | [
"A",
"thin",
"wrapper",
"layer",
"over",
"{",
"@link",
"StreamExecutionEnvironment#socketTextStream",
"(",
"java",
".",
"lang",
".",
"String",
"int",
")",
"}",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-libraries/flink-streaming-python/src/main/java/org/apache/flink/streaming/python/api/environment/PythonStreamExecutionEnvironment.java#L200-L202 |
cvut/JCOP | src/main/java/cz/cvut/felk/cig/jcop/problem/sat/SAT.java | SAT.initCommons | protected void initCommons() {
this.setTrueOperations = new ArrayList<SetTrueOperation>(this.dimension);
this.setFalseOperations = new ArrayList<SetFalseOperation>(this.dimension);
SetTrueOperation setTrueOperation;
SetFalseOperation setFalseOperation;
for (int i = 0; i < this.di... | java | protected void initCommons() {
this.setTrueOperations = new ArrayList<SetTrueOperation>(this.dimension);
this.setFalseOperations = new ArrayList<SetFalseOperation>(this.dimension);
SetTrueOperation setTrueOperation;
SetFalseOperation setFalseOperation;
for (int i = 0; i < this.di... | [
"protected",
"void",
"initCommons",
"(",
")",
"{",
"this",
".",
"setTrueOperations",
"=",
"new",
"ArrayList",
"<",
"SetTrueOperation",
">",
"(",
"this",
".",
"dimension",
")",
";",
"this",
".",
"setFalseOperations",
"=",
"new",
"ArrayList",
"<",
"SetFalseOpera... | Initializes common attributes such as operations and default fitness.
<p/>
Requires {@link #formula}/{@link #variables} to be already fully loaded. | [
"Initializes",
"common",
"attributes",
"such",
"as",
"operations",
"and",
"default",
"fitness",
".",
"<p",
"/",
">",
"Requires",
"{"
] | train | https://github.com/cvut/JCOP/blob/2ec18315a9a452e5f4e3d07cccfde0310adc465a/src/main/java/cz/cvut/felk/cig/jcop/problem/sat/SAT.java#L180-L197 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/PersistentPageFile.java | PersistentPageFile.readPage | @Override
public P readPage(int pageID) {
try {
countRead();
long offset = ((long) (header.getReservedPages() + pageID)) * (long) pageSize;
byte[] buffer = new byte[pageSize];
file.seek(offset);
file.read(buffer);
return byteArrayToPage(buffer);
}
catch(IOException e) {... | java | @Override
public P readPage(int pageID) {
try {
countRead();
long offset = ((long) (header.getReservedPages() + pageID)) * (long) pageSize;
byte[] buffer = new byte[pageSize];
file.seek(offset);
file.read(buffer);
return byteArrayToPage(buffer);
}
catch(IOException e) {... | [
"@",
"Override",
"public",
"P",
"readPage",
"(",
"int",
"pageID",
")",
"{",
"try",
"{",
"countRead",
"(",
")",
";",
"long",
"offset",
"=",
"(",
"(",
"long",
")",
"(",
"header",
".",
"getReservedPages",
"(",
")",
"+",
"pageID",
")",
")",
"*",
"(",
... | Reads the page with the given id from this file.
@param pageID the id of the page to be returned
@return the page with the given pageId | [
"Reads",
"the",
"page",
"with",
"the",
"given",
"id",
"from",
"this",
"file",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/persistent/PersistentPageFile.java#L112-L125 |
weld/core | impl/src/main/java/org/jboss/weld/resolution/AbstractAssignabilityRules.java | AbstractAssignabilityRules.boundsMatch | protected boolean boundsMatch(Type[] upperBounds, Type[] stricterUpperBounds) {
// getUppermostBounds to make sure that both arrays of bounds contain ONLY ACTUAL TYPES! otherwise, the CovariantTypes
// assignability rules do not reflect our needs
upperBounds = getUppermostBounds(upperBounds);
... | java | protected boolean boundsMatch(Type[] upperBounds, Type[] stricterUpperBounds) {
// getUppermostBounds to make sure that both arrays of bounds contain ONLY ACTUAL TYPES! otherwise, the CovariantTypes
// assignability rules do not reflect our needs
upperBounds = getUppermostBounds(upperBounds);
... | [
"protected",
"boolean",
"boundsMatch",
"(",
"Type",
"[",
"]",
"upperBounds",
",",
"Type",
"[",
"]",
"stricterUpperBounds",
")",
"{",
"// getUppermostBounds to make sure that both arrays of bounds contain ONLY ACTUAL TYPES! otherwise, the CovariantTypes",
"// assignability rules do no... | Returns <tt>true</tt> iff for each upper bound T, there is at least one bound from <tt>stricterUpperBounds</tt>
assignable to T. This reflects that <tt>stricterUpperBounds</tt> are at least as strict as <tt>upperBounds</tt> are.
<p>
Arguments passed to this method must be legal java bounds, i.e. bounds returned by {@li... | [
"Returns",
"<tt",
">",
"true<",
"/",
"tt",
">",
"iff",
"for",
"each",
"upper",
"bound",
"T",
"there",
"is",
"at",
"least",
"one",
"bound",
"from",
"<tt",
">",
"stricterUpperBounds<",
"/",
"tt",
">",
"assignable",
"to",
"T",
".",
"This",
"reflects",
"th... | train | https://github.com/weld/core/blob/567a2eaf95b168597d23a56be89bf05a7834b2aa/impl/src/main/java/org/jboss/weld/resolution/AbstractAssignabilityRules.java#L79-L90 |
OpenLiberty/open-liberty | dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/CommonFunction.java | CommonFunction.getNLSMessage | public static final String getNLSMessage(String key, Object... args) {
return NLS.getFormattedMessage(key, args, key);
} | java | public static final String getNLSMessage(String key, Object... args) {
return NLS.getFormattedMessage(key, args, key);
} | [
"public",
"static",
"final",
"String",
"getNLSMessage",
"(",
"String",
"key",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"NLS",
".",
"getFormattedMessage",
"(",
"key",
",",
"args",
",",
"key",
")",
";",
"}"
] | Retrieve a translated message from the J2C messages file.
If the message cannot be found, the key is returned.
@param key a valid message key from the J2C messages file.
@param args a list of parameters to include in the translatable message.
@return a translated message. | [
"Retrieve",
"a",
"translated",
"message",
"from",
"the",
"J2C",
"messages",
"file",
".",
"If",
"the",
"message",
"cannot",
"be",
"found",
"the",
"key",
"is",
"returned",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jca.cm/src/com/ibm/ejs/j2c/CommonFunction.java#L131-L133 |
sporniket/core | sporniket-core-ui/src/main/java/com/sporniket/libre/ui/swing/WindowLocation.java | WindowLocation.snapWindowTo | public static void snapWindowTo(Window win, int location)
{
Dimension _screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension _window = win.getSize();
int _wx = 0;
int _wy = 0;
switch (location)
{
case TOP_LEFT:
break;
case TOP_CENTER:
_wx = (_screen.width - _window.width) / 2;
b... | java | public static void snapWindowTo(Window win, int location)
{
Dimension _screen = Toolkit.getDefaultToolkit().getScreenSize();
Dimension _window = win.getSize();
int _wx = 0;
int _wy = 0;
switch (location)
{
case TOP_LEFT:
break;
case TOP_CENTER:
_wx = (_screen.width - _window.width) / 2;
b... | [
"public",
"static",
"void",
"snapWindowTo",
"(",
"Window",
"win",
",",
"int",
"location",
")",
"{",
"Dimension",
"_screen",
"=",
"Toolkit",
".",
"getDefaultToolkit",
"(",
")",
".",
"getScreenSize",
"(",
")",
";",
"Dimension",
"_window",
"=",
"win",
".",
"g... | Snap the Window Position to a special location.
@param win
The Window to move
@param location
A value among the allowed predefined positions | [
"Snap",
"the",
"Window",
"Position",
"to",
"a",
"special",
"location",
"."
] | train | https://github.com/sporniket/core/blob/3480ebd72a07422fcc09971be2607ee25efb2c26/sporniket-core-ui/src/main/java/com/sporniket/libre/ui/swing/WindowLocation.java#L76-L116 |
whitesource/agents | wss-agent-api/src/main/java/org/whitesource/agent/api/dispatch/RequestFactory.java | RequestFactory.newDependencyDataRequest | @Deprecated
public GetDependencyDataRequest newDependencyDataRequest(String orgToken, Collection<AgentProjectInfo> projects, String userKey) {
return newDependencyDataRequest(orgToken, null, null, projects, userKey);
} | java | @Deprecated
public GetDependencyDataRequest newDependencyDataRequest(String orgToken, Collection<AgentProjectInfo> projects, String userKey) {
return newDependencyDataRequest(orgToken, null, null, projects, userKey);
} | [
"@",
"Deprecated",
"public",
"GetDependencyDataRequest",
"newDependencyDataRequest",
"(",
"String",
"orgToken",
",",
"Collection",
"<",
"AgentProjectInfo",
">",
"projects",
",",
"String",
"userKey",
")",
"{",
"return",
"newDependencyDataRequest",
"(",
"orgToken",
",",
... | Create new Dependency Data request.
@param orgToken WhiteSource organization token.
@param projects Projects status statement to check.
@param userKey user key uniquely identifying the account at white source.
@return Newly created request to get Dependency Additional Data (Licenses, Description, homepageUrl and Vuln... | [
"Create",
"new",
"Dependency",
"Data",
"request",
"."
] | train | https://github.com/whitesource/agents/blob/8a947a3dbad257aff70f23f79fb3a55ca90b765f/wss-agent-api/src/main/java/org/whitesource/agent/api/dispatch/RequestFactory.java#L483-L486 |
OpenBEL/openbel-framework | org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java | BasicPathFinder.runDepthFirstScan | private void runDepthFirstScan(final Kam kam,
final KamNode cnode,
final KamNode source,
int depth,
final SetStack<KamNode> nodeStack,
final SetStack<KamEdge> edgeStack,
final List<SimplePath> pathResults) {
depth += 1;
final Set<... | java | private void runDepthFirstScan(final Kam kam,
final KamNode cnode,
final KamNode source,
int depth,
final SetStack<KamNode> nodeStack,
final SetStack<KamEdge> edgeStack,
final List<SimplePath> pathResults) {
depth += 1;
final Set<... | [
"private",
"void",
"runDepthFirstScan",
"(",
"final",
"Kam",
"kam",
",",
"final",
"KamNode",
"cnode",
",",
"final",
"KamNode",
"source",
",",
"int",
"depth",
",",
"final",
"SetStack",
"<",
"KamNode",
">",
"nodeStack",
",",
"final",
"SetStack",
"<",
"KamEdge"... | Runs a recursive depth-first scan from a {@link KamNode} source until a
max search depth ({@link BasicPathFinder#maxSearchDepth}) is reached.
When the max search depth is reached a {@link SimplePath} is added,
containing the {@link Stack} of {@link KamEdge}, and the algorithm continues.
@param kam {@link Kam}, the kam... | [
"Runs",
"a",
"recursive",
"depth",
"-",
"first",
"scan",
"from",
"a",
"{",
"@link",
"KamNode",
"}",
"source",
"until",
"a",
"max",
"search",
"depth",
"(",
"{",
"@link",
"BasicPathFinder#maxSearchDepth",
"}",
")",
"is",
"reached",
".",
"When",
"the",
"max",... | train | https://github.com/OpenBEL/openbel-framework/blob/149f80b1d6eabb15ab15815b6f745b0afa9fd2d3/org.openbel.framework.api/src/main/java/org/openbel/framework/api/BasicPathFinder.java#L374-L409 |
SimiaCryptus/utilities | java-util/src/main/java/com/simiacryptus/text/CharTrieIndex.java | CharTrieIndex.addDocument | public int addDocument(String document) {
if (root().getNumberOfChildren() >= 0) {
throw new IllegalStateException("Tree sorting has begun");
}
final int index;
synchronized (this) {
index = documents.size();
documents.add(document);
}
cursors.addAll(
IntStream.range(0, d... | java | public int addDocument(String document) {
if (root().getNumberOfChildren() >= 0) {
throw new IllegalStateException("Tree sorting has begun");
}
final int index;
synchronized (this) {
index = documents.size();
documents.add(document);
}
cursors.addAll(
IntStream.range(0, d... | [
"public",
"int",
"addDocument",
"(",
"String",
"document",
")",
"{",
"if",
"(",
"root",
"(",
")",
".",
"getNumberOfChildren",
"(",
")",
">=",
"0",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"\"Tree sorting has begun\"",
")",
";",
"}",
"final",
... | Adds a document to be indexed. This can only be performed before splitting.
@param document the document
@return this int | [
"Adds",
"a",
"document",
"to",
"be",
"indexed",
".",
"This",
"can",
"only",
"be",
"performed",
"before",
"splitting",
"."
] | train | https://github.com/SimiaCryptus/utilities/blob/b5a5e73449aae57de7dbfca2ed7a074432c5b17e/java-util/src/main/java/com/simiacryptus/text/CharTrieIndex.java#L220-L233 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java | IntersectionImpl.wrapInstance | static IntersectionImpl wrapInstance(final WritableMemory srcMem, final long seed) {
final IntersectionImpl impl = new IntersectionImpl(srcMem, seed, false);
return (IntersectionImpl) internalWrapInstance(srcMem, impl);
} | java | static IntersectionImpl wrapInstance(final WritableMemory srcMem, final long seed) {
final IntersectionImpl impl = new IntersectionImpl(srcMem, seed, false);
return (IntersectionImpl) internalWrapInstance(srcMem, impl);
} | [
"static",
"IntersectionImpl",
"wrapInstance",
"(",
"final",
"WritableMemory",
"srcMem",
",",
"final",
"long",
"seed",
")",
"{",
"final",
"IntersectionImpl",
"impl",
"=",
"new",
"IntersectionImpl",
"(",
"srcMem",
",",
"seed",
",",
"false",
")",
";",
"return",
"... | Wrap an Intersection target around the given source Memory containing intersection data.
@param srcMem The source Memory image.
<a href="{@docRoot}/resources/dictionary.html#mem">See Memory</a>
@param seed <a href="{@docRoot}/resources/dictionary.html#seed">See seed</a>
@return a IntersectionImpl that wraps a source Me... | [
"Wrap",
"an",
"Intersection",
"target",
"around",
"the",
"given",
"source",
"Memory",
"containing",
"intersection",
"data",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/theta/IntersectionImpl.java#L164-L167 |
Azure/azure-sdk-for-java | hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java | ConfigurationsInner.list | public ClusterConfigurationsInner list(String resourceGroupName, String clusterName) {
return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | java | public ClusterConfigurationsInner list(String resourceGroupName, String clusterName) {
return listWithServiceResponseAsync(resourceGroupName, clusterName).toBlocking().single().body();
} | [
"public",
"ClusterConfigurationsInner",
"list",
"(",
"String",
"resourceGroupName",
",",
"String",
"clusterName",
")",
"{",
"return",
"listWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"clusterName",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"(",
... | Gets all configuration information for an HDI cluster.
@param resourceGroupName The name of the resource group.
@param clusterName The name of the cluster.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws ErrorResponseException thrown if the request is rejected by server
@throws Runtim... | [
"Gets",
"all",
"configuration",
"information",
"for",
"an",
"HDI",
"cluster",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/hdinsight/resource-manager/v2018_06_01_preview/src/main/java/com/microsoft/azure/management/hdinsight/v2018_06_01_preview/implementation/ConfigurationsInner.java#L86-L88 |
elki-project/elki | elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/DBSCAN.java | DBSCAN.processNeighbors | private void processNeighbors(DoubleDBIDListIter neighbor, ModifiableDBIDs currentCluster, ArrayModifiableDBIDs seeds) {
final boolean ismetric = getDistanceFunction().isMetric();
for(; neighbor.valid(); neighbor.advance()) {
if(processedIDs.add(neighbor)) {
if(!ismetric || neighbor.doubleValue() ... | java | private void processNeighbors(DoubleDBIDListIter neighbor, ModifiableDBIDs currentCluster, ArrayModifiableDBIDs seeds) {
final boolean ismetric = getDistanceFunction().isMetric();
for(; neighbor.valid(); neighbor.advance()) {
if(processedIDs.add(neighbor)) {
if(!ismetric || neighbor.doubleValue() ... | [
"private",
"void",
"processNeighbors",
"(",
"DoubleDBIDListIter",
"neighbor",
",",
"ModifiableDBIDs",
"currentCluster",
",",
"ArrayModifiableDBIDs",
"seeds",
")",
"{",
"final",
"boolean",
"ismetric",
"=",
"getDistanceFunction",
"(",
")",
".",
"isMetric",
"(",
")",
"... | Process a single core point.
@param neighbor Iterator over neighbors
@param currentCluster Current cluster
@param seeds Seed set | [
"Process",
"a",
"single",
"core",
"point",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/algorithm/clustering/DBSCAN.java#L260-L273 |
Javacord/Javacord | javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java | EmbedBuilder.addInlineField | public EmbedBuilder addInlineField(String name, String value) {
delegate.addField(name, value, true);
return this;
} | java | public EmbedBuilder addInlineField(String name, String value) {
delegate.addField(name, value, true);
return this;
} | [
"public",
"EmbedBuilder",
"addInlineField",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"delegate",
".",
"addField",
"(",
"name",
",",
"value",
",",
"true",
")",
";",
"return",
"this",
";",
"}"
] | Adds an inline field to the embed.
@param name The name of the field.
@param value The value of the field.
@return The current instance in order to chain call methods. | [
"Adds",
"an",
"inline",
"field",
"to",
"the",
"embed",
"."
] | train | https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L599-L602 |
rometools/rome | rome/src/main/java/com/rometools/rome/io/impl/DateParser.java | DateParser.parseUsingMask | private static Date parseUsingMask(final String[] masks, String sDate, final Locale locale) {
if (sDate != null) {
sDate = sDate.trim();
}
ParsePosition pp = null;
Date d = null;
for (int i = 0; d == null && i < masks.length; i++) {
final DateFormat df = n... | java | private static Date parseUsingMask(final String[] masks, String sDate, final Locale locale) {
if (sDate != null) {
sDate = sDate.trim();
}
ParsePosition pp = null;
Date d = null;
for (int i = 0; d == null && i < masks.length; i++) {
final DateFormat df = n... | [
"private",
"static",
"Date",
"parseUsingMask",
"(",
"final",
"String",
"[",
"]",
"masks",
",",
"String",
"sDate",
",",
"final",
"Locale",
"locale",
")",
"{",
"if",
"(",
"sDate",
"!=",
"null",
")",
"{",
"sDate",
"=",
"sDate",
".",
"trim",
"(",
")",
";... | Parses a Date out of a string using an array of masks.
<p/>
It uses the masks in order until one of them succedes or all fail.
<p/>
@param masks array of masks to use for parsing the string
@param sDate string to parse for a date.
@return the Date represented by the given string using one of the given masks. It return... | [
"Parses",
"a",
"Date",
"out",
"of",
"a",
"string",
"using",
"an",
"array",
"of",
"masks",
".",
"<p",
"/",
">",
"It",
"uses",
"the",
"masks",
"in",
"order",
"until",
"one",
"of",
"them",
"succedes",
"or",
"all",
"fail",
".",
"<p",
"/",
">"
] | train | https://github.com/rometools/rome/blob/5fcf0b1a9a6cdedbe253a45ad9468c54a0f97010/rome/src/main/java/com/rometools/rome/io/impl/DateParser.java#L100-L120 |
GenesysPureEngage/workspace-client-java | src/main/java/com/genesys/workspace/VoiceApi.java | VoiceApi.initiateConference | public void initiateConference(String connId, String destination) throws WorkspaceApiException {
this.initiateConference(connId, destination, null, null, null, null, null);
} | java | public void initiateConference(String connId, String destination) throws WorkspaceApiException {
this.initiateConference(connId, destination, null, null, null, null, null);
} | [
"public",
"void",
"initiateConference",
"(",
"String",
"connId",
",",
"String",
"destination",
")",
"throws",
"WorkspaceApiException",
"{",
"this",
".",
"initiateConference",
"(",
"connId",
",",
"destination",
",",
"null",
",",
"null",
",",
"null",
",",
"null",
... | Initiate a two-step conference to the specified destination. This places the existing call on
hold and creates a new call in the dialing state (step 1). After initiating the conference you can use
`completeConference()` to complete the conference and bring all parties into the same call (step 2).
@param connId The conn... | [
"Initiate",
"a",
"two",
"-",
"step",
"conference",
"to",
"the",
"specified",
"destination",
".",
"This",
"places",
"the",
"existing",
"call",
"on",
"hold",
"and",
"creates",
"a",
"new",
"call",
"in",
"the",
"dialing",
"state",
"(",
"step",
"1",
")",
".",... | train | https://github.com/GenesysPureEngage/workspace-client-java/blob/509fdd9e89b9359d012f9a72be95037a3cef53e6/src/main/java/com/genesys/workspace/VoiceApi.java#L663-L665 |
JOML-CI/JOML | src/org/joml/Matrix4d.java | Matrix4d.orthoSymmetricLH | public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, Matrix4d dest) {
return orthoSymmetricLH(width, height, zNear, zFar, false, dest);
} | java | public Matrix4d orthoSymmetricLH(double width, double height, double zNear, double zFar, Matrix4d dest) {
return orthoSymmetricLH(width, height, zNear, zFar, false, dest);
} | [
"public",
"Matrix4d",
"orthoSymmetricLH",
"(",
"double",
"width",
",",
"double",
"height",
",",
"double",
"zNear",
",",
"double",
"zFar",
",",
"Matrix4d",
"dest",
")",
"{",
"return",
"orthoSymmetricLH",
"(",
"width",
",",
"height",
",",
"zNear",
",",
"zFar",... | Apply a symmetric orthographic projection transformation for a left-handed coordinate system
using OpenGL's NDC z range of <code>[-1..+1]</code> to this matrix and store the result in <code>dest</code>.
<p>
This method is equivalent to calling {@link #orthoLH(double, double, double, double, double, double, Matrix4d) or... | [
"Apply",
"a",
"symmetric",
"orthographic",
"projection",
"transformation",
"for",
"a",
"left",
"-",
"handed",
"coordinate",
"system",
"using",
"OpenGL",
"s",
"NDC",
"z",
"range",
"of",
"<code",
">",
"[",
"-",
"1",
"..",
"+",
"1",
"]",
"<",
"/",
"code",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix4d.java#L10325-L10327 |
opentelecoms-org/jsmpp | jsmpp/src/main/java/org/jsmpp/util/RelativeTimeFormatter.java | RelativeTimeFormatter.format | public String format(Calendar calendar, Calendar smscCalendar) {
if (calendar == null || smscCalendar == null) {
return null;
}
long diffTimeInMillis = calendar.getTimeInMillis() - smscCalendar.getTimeInMillis();
if (diffTimeInMillis < 0) {
throw new IllegalArgumentException("The requested ... | java | public String format(Calendar calendar, Calendar smscCalendar) {
if (calendar == null || smscCalendar == null) {
return null;
}
long diffTimeInMillis = calendar.getTimeInMillis() - smscCalendar.getTimeInMillis();
if (diffTimeInMillis < 0) {
throw new IllegalArgumentException("The requested ... | [
"public",
"String",
"format",
"(",
"Calendar",
"calendar",
",",
"Calendar",
"smscCalendar",
")",
"{",
"if",
"(",
"calendar",
"==",
"null",
"||",
"smscCalendar",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"long",
"diffTimeInMillis",
"=",
"calendar",
... | Return the relative time from the calendar datetime against the SMSC datetime.
@param calendar the date.
@param smscCalendar the SMSC date.
@return The relative time between the calendar date and the SMSC calendar date. | [
"Return",
"the",
"relative",
"time",
"from",
"the",
"calendar",
"datetime",
"against",
"the",
"SMSC",
"datetime",
"."
] | train | https://github.com/opentelecoms-org/jsmpp/blob/acc15e73e7431deabc803731971b15323315baaf/jsmpp/src/main/java/org/jsmpp/util/RelativeTimeFormatter.java#L64-L89 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java | Dl4jReflection.getFieldsAsProperties | public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {
Properties props = new Properties();
for (Field field : obj.getClass().getDeclaredFields()) {
if (Modifier.isStatic(field.getModifiers()))
continue;
field.setAccessib... | java | public static Properties getFieldsAsProperties(Object obj, Class<?>[] clazzes) throws Exception {
Properties props = new Properties();
for (Field field : obj.getClass().getDeclaredFields()) {
if (Modifier.isStatic(field.getModifiers()))
continue;
field.setAccessib... | [
"public",
"static",
"Properties",
"getFieldsAsProperties",
"(",
"Object",
"obj",
",",
"Class",
"<",
"?",
">",
"[",
"]",
"clazzes",
")",
"throws",
"Exception",
"{",
"Properties",
"props",
"=",
"new",
"Properties",
"(",
")",
";",
"for",
"(",
"Field",
"field"... | Get fields as properties
@param obj the object to get fields for
@param clazzes the classes to use for reflection and properties.
T
@return the fields as properties | [
"Get",
"fields",
"as",
"properties"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-util/src/main/java/org/deeplearning4j/util/Dl4jReflection.java#L106-L122 |
joniles/mpxj | src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java | FastTrackData.matchChildBlock | private final boolean matchChildBlock(int bufferIndex)
{
//
// Match the pattern we see at the start of the child block
//
int index = 0;
for (byte b : CHILD_BLOCK_PATTERN)
{
if (b != m_buffer[bufferIndex + index])
{
return false;
}
... | java | private final boolean matchChildBlock(int bufferIndex)
{
//
// Match the pattern we see at the start of the child block
//
int index = 0;
for (byte b : CHILD_BLOCK_PATTERN)
{
if (b != m_buffer[bufferIndex + index])
{
return false;
}
... | [
"private",
"final",
"boolean",
"matchChildBlock",
"(",
"int",
"bufferIndex",
")",
"{",
"//",
"// Match the pattern we see at the start of the child block",
"//",
"int",
"index",
"=",
"0",
";",
"for",
"(",
"byte",
"b",
":",
"CHILD_BLOCK_PATTERN",
")",
"{",
"if",
"(... | Locate a child block by byte pattern and validate by
checking the length of the string we are expecting
to follow the pattern.
@param bufferIndex start index
@return true if a child block starts at this point | [
"Locate",
"a",
"child",
"block",
"by",
"byte",
"pattern",
"and",
"validate",
"by",
"checking",
"the",
"length",
"of",
"the",
"string",
"we",
"are",
"expecting",
"to",
"follow",
"the",
"pattern",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/fasttrack/FastTrackData.java#L307-L338 |
VoltDB/voltdb | src/frontend/org/voltdb/SnapshotDaemon.java | SnapshotDaemon.createAndWatchRequestNode | public void createAndWatchRequestNode(final long clientHandle,
final Connection c,
SnapshotInitiationInfo snapInfo,
boolean notifyChanges) throws ForwardClientException {
boolean request... | java | public void createAndWatchRequestNode(final long clientHandle,
final Connection c,
SnapshotInitiationInfo snapInfo,
boolean notifyChanges) throws ForwardClientException {
boolean request... | [
"public",
"void",
"createAndWatchRequestNode",
"(",
"final",
"long",
"clientHandle",
",",
"final",
"Connection",
"c",
",",
"SnapshotInitiationInfo",
"snapInfo",
",",
"boolean",
"notifyChanges",
")",
"throws",
"ForwardClientException",
"{",
"boolean",
"requestExists",
"=... | Try to create the ZK request node and watch it if created successfully. | [
"Try",
"to",
"create",
"the",
"ZK",
"request",
"node",
"and",
"watch",
"it",
"if",
"created",
"successfully",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/SnapshotDaemon.java#L1704-L1750 |
aerogear/aerogear-unifiedpush-server | jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java | InstallationRegistrationEndpoint.crossOriginForInstallations | @OPTIONS
public Response crossOriginForInstallations(@Context HttpHeaders headers) {
return appendPreflightResponseHeaders(headers, Response.ok()).build();
} | java | @OPTIONS
public Response crossOriginForInstallations(@Context HttpHeaders headers) {
return appendPreflightResponseHeaders(headers, Response.ok()).build();
} | [
"@",
"OPTIONS",
"public",
"Response",
"crossOriginForInstallations",
"(",
"@",
"Context",
"HttpHeaders",
"headers",
")",
"{",
"return",
"appendPreflightResponseHeaders",
"(",
"headers",
",",
"Response",
".",
"ok",
"(",
")",
")",
".",
"build",
"(",
")",
";",
"}... | Cross Origin for Installations
@param headers "Origin" header
@return "Access-Control-Allow-Origin" header for your response
@responseheader Access-Control-Allow-Origin With host in your "Origin" header
@responseheader Access-Control-Allow-Methods POST, DELETE
@responseheader Access-Control-Allow-... | [
"Cross",
"Origin",
"for",
"Installations"
] | train | https://github.com/aerogear/aerogear-unifiedpush-server/blob/c7b798f085449117d84345d8c378b27165cad32b/jaxrs/src/main/java/org/jboss/aerogear/unifiedpush/rest/registry/installations/InstallationRegistrationEndpoint.java#L105-L109 |
apache/spark | launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java | CommandBuilderUtils.mergeEnvPathList | static void mergeEnvPathList(Map<String, String> userEnv, String envKey, String pathList) {
if (!isEmpty(pathList)) {
String current = firstNonEmpty(userEnv.get(envKey), System.getenv(envKey));
userEnv.put(envKey, join(File.pathSeparator, current, pathList));
}
} | java | static void mergeEnvPathList(Map<String, String> userEnv, String envKey, String pathList) {
if (!isEmpty(pathList)) {
String current = firstNonEmpty(userEnv.get(envKey), System.getenv(envKey));
userEnv.put(envKey, join(File.pathSeparator, current, pathList));
}
} | [
"static",
"void",
"mergeEnvPathList",
"(",
"Map",
"<",
"String",
",",
"String",
">",
"userEnv",
",",
"String",
"envKey",
",",
"String",
"pathList",
")",
"{",
"if",
"(",
"!",
"isEmpty",
"(",
"pathList",
")",
")",
"{",
"String",
"current",
"=",
"firstNonEm... | Updates the user environment, appending the given pathList to the existing value of the given
environment variable (or setting it if it hasn't yet been set). | [
"Updates",
"the",
"user",
"environment",
"appending",
"the",
"given",
"pathList",
"to",
"the",
"existing",
"value",
"of",
"the",
"given",
"environment",
"variable",
"(",
"or",
"setting",
"it",
"if",
"it",
"hasn",
"t",
"yet",
"been",
"set",
")",
"."
] | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/launcher/src/main/java/org/apache/spark/launcher/CommandBuilderUtils.java#L114-L119 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java | WaveformDetailComponent.drawCueList | private void drawCueList(Graphics g, Rectangle clipRect, CueList cueList, int axis, int maxHeight) {
for (CueList.Entry entry : cueList.entries) {
final int x = millisecondsToX(entry.cueTime);
if ((x > clipRect.x - 4) && (x < clipRect.x + clipRect.width + 4)) {
g.setColor... | java | private void drawCueList(Graphics g, Rectangle clipRect, CueList cueList, int axis, int maxHeight) {
for (CueList.Entry entry : cueList.entries) {
final int x = millisecondsToX(entry.cueTime);
if ((x > clipRect.x - 4) && (x < clipRect.x + clipRect.width + 4)) {
g.setColor... | [
"private",
"void",
"drawCueList",
"(",
"Graphics",
"g",
",",
"Rectangle",
"clipRect",
",",
"CueList",
"cueList",
",",
"int",
"axis",
",",
"int",
"maxHeight",
")",
"{",
"for",
"(",
"CueList",
".",
"Entry",
"entry",
":",
"cueList",
".",
"entries",
")",
"{"... | Draw the visible memory cue points or hot cues.
@param g the graphics object in which we are being rendered
@param clipRect the region that is being currently rendered
@param cueList the cues to be drawn
@param axis the base on which the waveform is being drawn
@param maxHeight the highest waveform segment | [
"Draw",
"the",
"visible",
"memory",
"cue",
"points",
"or",
"hot",
"cues",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/data/WaveformDetailComponent.java#L798-L809 |
cloudant/java-cloudant | cloudant-client/src/main/java/com/cloudant/client/internal/query/Helpers.java | Helpers.withKey | public static String withKey(String key, Selector selector) {
return String.format("\"%s\": %s", key, enclose(selector));
} | java | public static String withKey(String key, Selector selector) {
return String.format("\"%s\": %s", key, enclose(selector));
} | [
"public",
"static",
"String",
"withKey",
"(",
"String",
"key",
",",
"Selector",
"selector",
")",
"{",
"return",
"String",
".",
"format",
"(",
"\"\\\"%s\\\": %s\"",
",",
"key",
",",
"enclose",
"(",
"selector",
")",
")",
";",
"}"
] | <P>
Returns the string form of the specified key mapping to a JSON object enclosing the selector.
</P>
<pre>
{@code
Selector selector = eq("year", 2017);
System.out.println(selector.toString());
// Output: "year": {"$eq" : 2017}
System.out.println(SelectorUtils.withKey("selector", selector));
// Output: "selector": {"y... | [
"<P",
">",
"Returns",
"the",
"string",
"form",
"of",
"the",
"specified",
"key",
"mapping",
"to",
"a",
"JSON",
"object",
"enclosing",
"the",
"selector",
".",
"<",
"/",
"P",
">",
"<pre",
">",
"{",
"@code",
"Selector",
"selector",
"=",
"eq",
"(",
"year",
... | train | https://github.com/cloudant/java-cloudant/blob/42c438654945361bded2cc0827afc046d535b31b/cloudant-client/src/main/java/com/cloudant/client/internal/query/Helpers.java#L144-L146 |
lessthanoptimal/BoofCV | main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java | ReidSolomonCodes.findErrorLocatorPolynomial | void findErrorLocatorPolynomial( int messageLength , GrowQueue_I32 errorLocations , GrowQueue_I8 errorLocator ) {
tmp1.resize(2);
tmp1.data[1] = 1;
errorLocator.resize(1);
errorLocator.data[0] = 1;
for (int i = 0; i < errorLocations.size; i++) {
// Convert from positions in the message to coefficient degre... | java | void findErrorLocatorPolynomial( int messageLength , GrowQueue_I32 errorLocations , GrowQueue_I8 errorLocator ) {
tmp1.resize(2);
tmp1.data[1] = 1;
errorLocator.resize(1);
errorLocator.data[0] = 1;
for (int i = 0; i < errorLocations.size; i++) {
// Convert from positions in the message to coefficient degre... | [
"void",
"findErrorLocatorPolynomial",
"(",
"int",
"messageLength",
",",
"GrowQueue_I32",
"errorLocations",
",",
"GrowQueue_I8",
"errorLocator",
")",
"{",
"tmp1",
".",
"resize",
"(",
"2",
")",
";",
"tmp1",
".",
"data",
"[",
"1",
"]",
"=",
"1",
";",
"errorLoca... | Compute the error locator polynomial when given the error locations in the message.
@param messageLength (Input) Length of the message
@param errorLocations (Input) List of error locations in the byte
@param errorLocator (Output) Error locator polynomial. Coefficients are large to small. | [
"Compute",
"the",
"error",
"locator",
"polynomial",
"when",
"given",
"the",
"error",
"locations",
"in",
"the",
"message",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-recognition/src/main/java/boofcv/alg/fiducial/qrcode/ReidSolomonCodes.java#L186-L202 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getString | protected String getString(final String key, final JSONObject jsonObject) {
String value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getString(key);
}
catch(JSONException e) {
LOGGER.error("Could not get String from JSONObject for key: " + key, e);
}
... | java | protected String getString(final String key, final JSONObject jsonObject) {
String value = null;
if(hasKey(key, jsonObject)) {
try {
value = jsonObject.getString(key);
}
catch(JSONException e) {
LOGGER.error("Could not get String from JSONObject for key: " + key, e);
}
... | [
"protected",
"String",
"getString",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"String",
"value",
"=",
"null",
";",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"try",
"{",
"value",
"=",
"js... | Check to make sure the JSONObject has the specified key and if so return
the value as a string. If no key is found "" is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return string value corresponding to the key or null if key not found | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"string",
".",
"If",
"no",
"key",
"is",
"found",
"is",
"returned",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L208-L219 |
zaproxy/zaproxy | src/org/zaproxy/zap/utils/ClassLoaderUtil.java | ClassLoaderUtil.addURL | public static void addURL(URL u) throws IOException {
if (!(ClassLoader.getSystemClassLoader() instanceof URLClassLoader)) {
return;
}
URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL[] urls = sysLoader.getURLs();
for (int i ... | java | public static void addURL(URL u) throws IOException {
if (!(ClassLoader.getSystemClassLoader() instanceof URLClassLoader)) {
return;
}
URLClassLoader sysLoader = (URLClassLoader) ClassLoader.getSystemClassLoader();
URL[] urls = sysLoader.getURLs();
for (int i ... | [
"public",
"static",
"void",
"addURL",
"(",
"URL",
"u",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"(",
"ClassLoader",
".",
"getSystemClassLoader",
"(",
")",
"instanceof",
"URLClassLoader",
")",
")",
"{",
"return",
";",
"}",
"URLClassLoader",
"sysLoad... | Add URL to CLASSPATH
@param u URL
@throws IOException IOException | [
"Add",
"URL",
"to",
"CLASSPATH"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/utils/ClassLoaderUtil.java#L51-L75 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/view/ViewRetryHandler.java | ViewRetryHandler.shouldRetry | private static boolean shouldRetry(final int status, final String content) {
switch (status) {
case 200:
return false;
case 404:
return analyse404Response(content);
case 500:
return analyse500Response(content);
case ... | java | private static boolean shouldRetry(final int status, final String content) {
switch (status) {
case 200:
return false;
case 404:
return analyse404Response(content);
case 500:
return analyse500Response(content);
case ... | [
"private",
"static",
"boolean",
"shouldRetry",
"(",
"final",
"int",
"status",
",",
"final",
"String",
"content",
")",
"{",
"switch",
"(",
"status",
")",
"{",
"case",
"200",
":",
"return",
"false",
";",
"case",
"404",
":",
"return",
"analyse404Response",
"(... | Analyses status codes and checks if a retry needs to happen.
Some status codes are ambiguous, so their contents are inspected further.
@param status the status code.
@param content the error body from the response.
@return true if retry is needed, false otherwise. | [
"Analyses",
"status",
"codes",
"and",
"checks",
"if",
"a",
"retry",
"needs",
"to",
"happen",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/view/ViewRetryHandler.java#L118-L146 |
jenetics/jenetics | jenetics/src/main/java/io/jenetics/engine/EvolutionResult.java | EvolutionResult.toUniquePopulation | public static <G extends Gene<?, G>, C extends Comparable<? super C>>
UnaryOperator<EvolutionResult<G, C>>
toUniquePopulation(final Factory<Genotype<G>> factory) {
return toUniquePopulation(factory, 100);
} | java | public static <G extends Gene<?, G>, C extends Comparable<? super C>>
UnaryOperator<EvolutionResult<G, C>>
toUniquePopulation(final Factory<Genotype<G>> factory) {
return toUniquePopulation(factory, 100);
} | [
"public",
"static",
"<",
"G",
"extends",
"Gene",
"<",
"?",
",",
"G",
">",
",",
"C",
"extends",
"Comparable",
"<",
"?",
"super",
"C",
">",
">",
"UnaryOperator",
"<",
"EvolutionResult",
"<",
"G",
",",
"C",
">",
">",
"toUniquePopulation",
"(",
"final",
... | Return a mapping function, which removes duplicate individuals from the
population and replaces it with newly created one by the given genotype
{@code factory}.
<pre>{@code
final Problem<Double, DoubleGene, Integer> problem = ...;
final Engine<DoubleGene, Integer> engine = Engine.builder(problem)
.mapping(EvolutionRes... | [
"Return",
"a",
"mapping",
"function",
"which",
"removes",
"duplicate",
"individuals",
"from",
"the",
"population",
"and",
"replaces",
"it",
"with",
"newly",
"created",
"one",
"by",
"the",
"given",
"genotype",
"{",
"@code",
"factory",
"}",
"."
] | train | https://github.com/jenetics/jenetics/blob/ee516770c65ef529b27deb283f071c85f344eff4/jenetics/src/main/java/io/jenetics/engine/EvolutionResult.java#L611-L615 |
dialogflow/dialogflow-android-client | ailib/src/main/java/ai/api/android/AIService.java | AIService.getService | public static AIService getService(final Context context, final AIConfiguration config) {
if (config.getRecognitionEngine() == AIConfiguration.RecognitionEngine.Google) {
return new GoogleRecognitionServiceImpl(context, config);
}
if (config.getRecognitionEngine() == AIConfiguration.... | java | public static AIService getService(final Context context, final AIConfiguration config) {
if (config.getRecognitionEngine() == AIConfiguration.RecognitionEngine.Google) {
return new GoogleRecognitionServiceImpl(context, config);
}
if (config.getRecognitionEngine() == AIConfiguration.... | [
"public",
"static",
"AIService",
"getService",
"(",
"final",
"Context",
"context",
",",
"final",
"AIConfiguration",
"config",
")",
"{",
"if",
"(",
"config",
".",
"getRecognitionEngine",
"(",
")",
"==",
"AIConfiguration",
".",
"RecognitionEngine",
".",
"Google",
... | Use this method to get ready to work instance
@param context
@param config
@return instance of AIService implementation | [
"Use",
"this",
"method",
"to",
"get",
"ready",
"to",
"work",
"instance"
] | train | https://github.com/dialogflow/dialogflow-android-client/blob/331f3ae8f2e404e245cc6024fdf44ec99feba7ee/ailib/src/main/java/ai/api/android/AIService.java#L58-L70 |
Deep-Symmetry/beat-link | src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java | Client.performSetupExchange | private void performSetupExchange() throws IOException {
Message setupRequest = new Message(0xfffffffeL, Message.KnownType.SETUP_REQ, new NumberField(posingAsPlayer, 4));
sendMessage(setupRequest);
Message response = Message.read(is);
if (response.knownType != Message.KnownType.MENU_AVAI... | java | private void performSetupExchange() throws IOException {
Message setupRequest = new Message(0xfffffffeL, Message.KnownType.SETUP_REQ, new NumberField(posingAsPlayer, 4));
sendMessage(setupRequest);
Message response = Message.read(is);
if (response.knownType != Message.KnownType.MENU_AVAI... | [
"private",
"void",
"performSetupExchange",
"(",
")",
"throws",
"IOException",
"{",
"Message",
"setupRequest",
"=",
"new",
"Message",
"(",
"0xfffffffe",
"L",
",",
"Message",
".",
"KnownType",
".",
"SETUP_REQ",
",",
"new",
"NumberField",
"(",
"posingAsPlayer",
","... | Exchanges the initial fully-formed messages which establishes the transaction context for queries to
the dbserver.
@throws IOException if there is a problem during the exchange | [
"Exchanges",
"the",
"initial",
"fully",
"-",
"formed",
"messages",
"which",
"establishes",
"the",
"transaction",
"context",
"for",
"queries",
"to",
"the",
"dbserver",
"."
] | train | https://github.com/Deep-Symmetry/beat-link/blob/f958a2a70e8a87a31a75326d7b4db77c2f0b4212/src/main/java/org/deepsymmetry/beatlink/dbserver/Client.java#L117-L135 |
milaboratory/milib | src/main/java/com/milaboratory/core/mutations/MutationsUtil.java | MutationsUtil.shiftIndelsAtHomopolymers | public static void shiftIndelsAtHomopolymers(Sequence seq1, int seq1From, int[] mutations) {
int prevPos = seq1From;
for (int i = 0; i < mutations.length; i++) {
int code = mutations[i];
if (!isSubstitution(code)) {
int pos = getPosition(code), offset = 0;
... | java | public static void shiftIndelsAtHomopolymers(Sequence seq1, int seq1From, int[] mutations) {
int prevPos = seq1From;
for (int i = 0; i < mutations.length; i++) {
int code = mutations[i];
if (!isSubstitution(code)) {
int pos = getPosition(code), offset = 0;
... | [
"public",
"static",
"void",
"shiftIndelsAtHomopolymers",
"(",
"Sequence",
"seq1",
",",
"int",
"seq1From",
",",
"int",
"[",
"]",
"mutations",
")",
"{",
"int",
"prevPos",
"=",
"seq1From",
";",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"mutations",
... | This one shifts indels to the left at homopolymer regions Applicable to KAligner data, which normally put indels
randomly along such regions Required for filterMutations algorithm to work correctly Works inplace
@param seq1 reference sequence for the mutations
@param seq1From seq1 from
@param mutations array of ... | [
"This",
"one",
"shifts",
"indels",
"to",
"the",
"left",
"at",
"homopolymer",
"regions",
"Applicable",
"to",
"KAligner",
"data",
"which",
"normally",
"put",
"indels",
"randomly",
"along",
"such",
"regions",
"Required",
"for",
"filterMutations",
"algorithm",
"to",
... | train | https://github.com/milaboratory/milib/blob/2349b3dccdd3c7948643760e570238d6e30d5a34/src/main/java/com/milaboratory/core/mutations/MutationsUtil.java#L136-L158 |
pmlopes/yoke | framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeResponse.java | YokeResponse.getHeader | public <R> R getHeader(String name, R defaultValue) {
if (headers().contains(name)) {
return getHeader(name);
} else {
return defaultValue;
}
} | java | public <R> R getHeader(String name, R defaultValue) {
if (headers().contains(name)) {
return getHeader(name);
} else {
return defaultValue;
}
} | [
"public",
"<",
"R",
">",
"R",
"getHeader",
"(",
"String",
"name",
",",
"R",
"defaultValue",
")",
"{",
"if",
"(",
"headers",
"(",
")",
".",
"contains",
"(",
"name",
")",
")",
"{",
"return",
"getHeader",
"(",
"name",
")",
";",
"}",
"else",
"{",
"re... | Allow getting headers in a generified way and return defaultValue if the key does not exist.
@param name The key to get
@param defaultValue value returned when the key does not exist
@param <R> The type of the return
@return The found object | [
"Allow",
"getting",
"headers",
"in",
"a",
"generified",
"way",
"and",
"return",
"defaultValue",
"if",
"the",
"key",
"does",
"not",
"exist",
"."
] | train | https://github.com/pmlopes/yoke/blob/fe8a64036f09fb745f0644faddd46162d64faf3c/framework/src/main/java/com/jetdrone/vertx/yoke/middleware/YokeResponse.java#L154-L160 |
GoogleCloudPlatform/appengine-mapreduce | java/src/main/java/com/google/appengine/tools/mapreduce/outputs/SizeSegmentedGoogleCloudStorageFileOutput.java | SizeSegmentedGoogleCloudStorageFileOutput.finish | @Override
public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
throws IOException {
List<String> fileNames = new ArrayList<>();
for (OutputWriter<ByteBuffer> writer : writers) {
SizeSegmentingGoogleCloudStorageFileWriter segWriter =
(SizeSegment... | java | @Override
public GoogleCloudStorageFileSet finish(Collection<? extends OutputWriter<ByteBuffer>> writers)
throws IOException {
List<String> fileNames = new ArrayList<>();
for (OutputWriter<ByteBuffer> writer : writers) {
SizeSegmentingGoogleCloudStorageFileWriter segWriter =
(SizeSegment... | [
"@",
"Override",
"public",
"GoogleCloudStorageFileSet",
"finish",
"(",
"Collection",
"<",
"?",
"extends",
"OutputWriter",
"<",
"ByteBuffer",
">",
">",
"writers",
")",
"throws",
"IOException",
"{",
"List",
"<",
"String",
">",
"fileNames",
"=",
"new",
"ArrayList",... | Returns a list of all the filenames written by the output writers
@throws IOException | [
"Returns",
"a",
"list",
"of",
"all",
"the",
"filenames",
"written",
"by",
"the",
"output",
"writers"
] | train | https://github.com/GoogleCloudPlatform/appengine-mapreduce/blob/2045eb3605b6ecb40c83d11dd5442a89fe5c5dd6/java/src/main/java/com/google/appengine/tools/mapreduce/outputs/SizeSegmentedGoogleCloudStorageFileOutput.java#L116-L128 |
spockframework/spock | spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java | GroovyRuntimeUtil.setProperty | public static void setProperty(Object target, String property, Object value) {
try {
InvokerHelper.setProperty(target, property, value);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
}
} | java | public static void setProperty(Object target, String property, Object value) {
try {
InvokerHelper.setProperty(target, property, value);
} catch (InvokerInvocationException e) {
ExceptionUtil.sneakyThrow(e.getCause());
}
} | [
"public",
"static",
"void",
"setProperty",
"(",
"Object",
"target",
",",
"String",
"property",
",",
"Object",
"value",
")",
"{",
"try",
"{",
"InvokerHelper",
".",
"setProperty",
"(",
"target",
",",
"property",
",",
"value",
")",
";",
"}",
"catch",
"(",
"... | Note: This method may throw checked exceptions although it doesn't say so. | [
"Note",
":",
"This",
"method",
"may",
"throw",
"checked",
"exceptions",
"although",
"it",
"doesn",
"t",
"say",
"so",
"."
] | train | https://github.com/spockframework/spock/blob/d751a0abd8d5a2ec5338aa10bc2d19371b3b3ad9/spock-core/src/main/java/org/spockframework/runtime/GroovyRuntimeUtil.java#L146-L152 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java | EJSContainer.preInvoke | public EnterpriseBean preInvoke(EJSWrapperBase wrapper,
int methodId,
EJSDeployedSupport s,
String methodSignature) throws RemoteException {
EJBMethodInfoImpl methodInfo = mapMethodInfo(s, wrapper, method... | java | public EnterpriseBean preInvoke(EJSWrapperBase wrapper,
int methodId,
EJSDeployedSupport s,
String methodSignature) throws RemoteException {
EJBMethodInfoImpl methodInfo = mapMethodInfo(s, wrapper, method... | [
"public",
"EnterpriseBean",
"preInvoke",
"(",
"EJSWrapperBase",
"wrapper",
",",
"int",
"methodId",
",",
"EJSDeployedSupport",
"s",
",",
"String",
"methodSignature",
")",
"throws",
"RemoteException",
"{",
"EJBMethodInfoImpl",
"methodInfo",
"=",
"mapMethodInfo",
"(",
"s... | This method is called by the generated code to support PMgr home finder methods.
When this method is called, the methodId should be in the negative range to
indicate this is a special method with the method signature passed in. This
method signature is then used to create the EJSMethodInfo in mapMethodInfo call.
The me... | [
"This",
"method",
"is",
"called",
"by",
"the",
"generated",
"code",
"to",
"support",
"PMgr",
"home",
"finder",
"methods",
".",
"When",
"this",
"method",
"is",
"called",
"the",
"methodId",
"should",
"be",
"in",
"the",
"negative",
"range",
"to",
"indicate",
... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ejs/container/EJSContainer.java#L2697-L2705 |
protegeproject/jpaul | src/main/java/jpaul/DataStructs/UnionFind.java | UnionFind.areUnified | public boolean areUnified(E e1, E e2) {
return find(e1).equals(find(e2));
} | java | public boolean areUnified(E e1, E e2) {
return find(e1).equals(find(e2));
} | [
"public",
"boolean",
"areUnified",
"(",
"E",
"e1",
",",
"E",
"e2",
")",
"{",
"return",
"find",
"(",
"e1",
")",
".",
"equals",
"(",
"find",
"(",
"e2",
")",
")",
";",
"}"
] | Checks whether the elements <code>e1</code> and
<code>e2</code> are unified in this union-find structure. | [
"Checks",
"whether",
"the",
"elements",
"<code",
">",
"e1<",
"/",
"code",
">",
"and",
"<code",
">",
"e2<",
"/",
"code",
">",
"are",
"unified",
"in",
"this",
"union",
"-",
"find",
"structure",
"."
] | train | https://github.com/protegeproject/jpaul/blob/db579ffb16faaa4b0c577ec82c246f7349427714/src/main/java/jpaul/DataStructs/UnionFind.java#L68-L70 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java | Shape.setOrder | @Deprecated
public static void setOrder(IntBuffer buffer, char order) {
int length = Shape.shapeInfoLength(Shape.rank(buffer));
buffer.put(length - 1, (int) order);
throw new RuntimeException("setOrder called");
} | java | @Deprecated
public static void setOrder(IntBuffer buffer, char order) {
int length = Shape.shapeInfoLength(Shape.rank(buffer));
buffer.put(length - 1, (int) order);
throw new RuntimeException("setOrder called");
} | [
"@",
"Deprecated",
"public",
"static",
"void",
"setOrder",
"(",
"IntBuffer",
"buffer",
",",
"char",
"order",
")",
"{",
"int",
"length",
"=",
"Shape",
".",
"shapeInfoLength",
"(",
"Shape",
".",
"rank",
"(",
"buffer",
")",
")",
";",
"buffer",
".",
"put",
... | Returns the order given the shape information
@param buffer the buffer
@return | [
"Returns",
"the",
"order",
"given",
"the",
"shape",
"information"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/linalg/api/shape/Shape.java#L3153-L3158 |
geomajas/geomajas-project-client-gwt | common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java | HtmlBuilder.openTagStyleHtmlContent | public static String openTagStyleHtmlContent(String tag, String style, String... content) {
return openTagHtmlContent(tag, null, style, content);
} | java | public static String openTagStyleHtmlContent(String tag, String style, String... content) {
return openTagHtmlContent(tag, null, style, content);
} | [
"public",
"static",
"String",
"openTagStyleHtmlContent",
"(",
"String",
"tag",
",",
"String",
"style",
",",
"String",
"...",
"content",
")",
"{",
"return",
"openTagHtmlContent",
"(",
"tag",
",",
"null",
",",
"style",
",",
"content",
")",
";",
"}"
] | Build a String containing a HTML opening tag with given CSS style attribute(s) and
concatenates the given HTML content.
@param tag String name of HTML tag
@param style style for tag (plain CSS)
@param content content string
@return HTML tag element as string | [
"Build",
"a",
"String",
"containing",
"a",
"HTML",
"opening",
"tag",
"with",
"given",
"CSS",
"style",
"attribute",
"(",
"s",
")",
"and",
"concatenates",
"the",
"given",
"HTML",
"content",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/common-gwt-smartgwt/src/main/java/org/geomajas/gwt/client/util/HtmlBuilder.java#L338-L340 |
jglobus/JGlobus | ssl-proxies/src/main/java/org/globus/gsi/trustmanager/DateValidityChecker.java | DateValidityChecker.invoke | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
try {
cert.checkValidity();
} catch (CertificateExpiredException e) {
throw new CertPathValidatorException(
"Certificate " + cert.getSubjectDN()... | java | public void invoke(X509Certificate cert, GSIConstants.CertificateType certType) throws CertPathValidatorException {
try {
cert.checkValidity();
} catch (CertificateExpiredException e) {
throw new CertPathValidatorException(
"Certificate " + cert.getSubjectDN()... | [
"public",
"void",
"invoke",
"(",
"X509Certificate",
"cert",
",",
"GSIConstants",
".",
"CertificateType",
"certType",
")",
"throws",
"CertPathValidatorException",
"{",
"try",
"{",
"cert",
".",
"checkValidity",
"(",
")",
";",
"}",
"catch",
"(",
"CertificateExpiredEx... | Method that checks the time validity. Uses the standard Certificate.checkValidity method.
@throws CertPathValidatorException If certificate has expired or is not yet valid. | [
"Method",
"that",
"checks",
"the",
"time",
"validity",
".",
"Uses",
"the",
"standard",
"Certificate",
".",
"checkValidity",
"method",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/ssl-proxies/src/main/java/org/globus/gsi/trustmanager/DateValidityChecker.java#L39-L49 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/linear/StochasticSTLinearL1.java | StochasticSTLinearL1.setMaxScaled | public void setMaxScaled(double maxFeature)
{
if(Double.isNaN(maxFeature))
throw new ArithmeticException("NaN is not a valid feature value");
else if(maxFeature > 1)
throw new ArithmeticException("Maximum possible feature value is 1, can not use " + maxFeature);
else ... | java | public void setMaxScaled(double maxFeature)
{
if(Double.isNaN(maxFeature))
throw new ArithmeticException("NaN is not a valid feature value");
else if(maxFeature > 1)
throw new ArithmeticException("Maximum possible feature value is 1, can not use " + maxFeature);
else ... | [
"public",
"void",
"setMaxScaled",
"(",
"double",
"maxFeature",
")",
"{",
"if",
"(",
"Double",
".",
"isNaN",
"(",
"maxFeature",
")",
")",
"throw",
"new",
"ArithmeticException",
"(",
"\"NaN is not a valid feature value\"",
")",
";",
"else",
"if",
"(",
"maxFeature"... | Sets the maximum value of any feature after scaling is applied. This
value can be no greater than 1.
@param maxFeature the maximum feature value after scaling | [
"Sets",
"the",
"maximum",
"value",
"of",
"any",
"feature",
"after",
"scaling",
"is",
"applied",
".",
"This",
"value",
"can",
"be",
"no",
"greater",
"than",
"1",
"."
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/linear/StochasticSTLinearL1.java#L233-L242 |
Netflix/concurrency-limits | concurrency-limits-servlet/src/main/java/com/netflix/concurrency/limits/servlet/ServletLimiterBuilder.java | ServletLimiterBuilder.partitionByPathInfo | public ServletLimiterBuilder partitionByPathInfo(Function<String, String> pathToGroup) {
return partitionResolver(request -> Optional.ofNullable(request.getPathInfo()).map(pathToGroup).orElse(null));
} | java | public ServletLimiterBuilder partitionByPathInfo(Function<String, String> pathToGroup) {
return partitionResolver(request -> Optional.ofNullable(request.getPathInfo()).map(pathToGroup).orElse(null));
} | [
"public",
"ServletLimiterBuilder",
"partitionByPathInfo",
"(",
"Function",
"<",
"String",
",",
"String",
">",
"pathToGroup",
")",
"{",
"return",
"partitionResolver",
"(",
"request",
"->",
"Optional",
".",
"ofNullable",
"(",
"request",
".",
"getPathInfo",
"(",
")",... | Partition the limit by the full path. Percentages of the limit are partitioned to named
groups. Group membership is derived from the provided mapping function.
@param pathToGroup Mapping function from full path to a named group.
@return Chainable builder | [
"Partition",
"the",
"limit",
"by",
"the",
"full",
"path",
".",
"Percentages",
"of",
"the",
"limit",
"are",
"partitioned",
"to",
"named",
"groups",
".",
"Group",
"membership",
"is",
"derived",
"from",
"the",
"provided",
"mapping",
"function",
"."
] | train | https://github.com/Netflix/concurrency-limits/blob/5ae2be4fea9848af6f63c7b5632af30c494e7373/concurrency-limits-servlet/src/main/java/com/netflix/concurrency/limits/servlet/ServletLimiterBuilder.java#L72-L74 |
open-pay/openpay-java | src/main/java/mx/openpay/client/core/operations/OpenpayFeesOperations.java | OpenpayFeesOperations.getSummary | public OpenpayFeesSummary getSummary(final int year, final int month) throws OpenpayServiceException,
ServiceUnavailableException {
String path = String.format(FEES_PATH, this.getMerchantId());
Map<String, String> params = new HashMap<String, String>();
params.put("year", String.valu... | java | public OpenpayFeesSummary getSummary(final int year, final int month) throws OpenpayServiceException,
ServiceUnavailableException {
String path = String.format(FEES_PATH, this.getMerchantId());
Map<String, String> params = new HashMap<String, String>();
params.put("year", String.valu... | [
"public",
"OpenpayFeesSummary",
"getSummary",
"(",
"final",
"int",
"year",
",",
"final",
"int",
"month",
")",
"throws",
"OpenpayServiceException",
",",
"ServiceUnavailableException",
"{",
"String",
"path",
"=",
"String",
".",
"format",
"(",
"FEES_PATH",
",",
"this... | Retrieve the summary of the charged fees in the given month. The amounts retrieved in the current month may
change on a daily basis.
@param year Year of the date to retrieve
@param month Month to retrieve
@return The summary of the fees charged by Openpay.
@throws OpenpayServiceException If the service returns an error... | [
"Retrieve",
"the",
"summary",
"of",
"the",
"charged",
"fees",
"in",
"the",
"given",
"month",
".",
"The",
"amounts",
"retrieved",
"in",
"the",
"current",
"month",
"may",
"change",
"on",
"a",
"daily",
"basis",
"."
] | train | https://github.com/open-pay/openpay-java/blob/7f4220466b394dd54e2b1642821dde7daebc5433/src/main/java/mx/openpay/client/core/operations/OpenpayFeesOperations.java#L58-L65 |
mediathekview/MServer | src/main/java/mServer/crawler/sender/hr/HrSendungenListDeserializer.java | HrSendungenListDeserializer.prepareUrl | private String prepareUrl(String theme, String url) {
// Sonderseite für Hessenschau verwenden
if (theme.contains("hessenschau")) {
return "http://www.hessenschau.de/tv-sendung/sendungsarchiv/index.html";
}
// bei allen anderen, probieren, ob eine URL mit "sendungen" vor in... | java | private String prepareUrl(String theme, String url) {
// Sonderseite für Hessenschau verwenden
if (theme.contains("hessenschau")) {
return "http://www.hessenschau.de/tv-sendung/sendungsarchiv/index.html";
}
// bei allen anderen, probieren, ob eine URL mit "sendungen" vor in... | [
"private",
"String",
"prepareUrl",
"(",
"String",
"theme",
",",
"String",
"url",
")",
"{",
"// Sonderseite für Hessenschau verwenden",
"if",
"(",
"theme",
".",
"contains",
"(",
"\"hessenschau\"",
")",
")",
"{",
"return",
"\"http://www.hessenschau.de/tv-sendung/sendungsa... | URL anpassen, so dass diese direkt die Übersicht der Folgen beinhaltet,
sofern diese Seite existiert!
Damit wird das unnötige Einlesen einer Zwischenseite gespart.
@param theme Thema der Sendung
@param url URL zu Startseite der Sendung
@return URL zu der Folgenübersicht der Sendung | [
"URL",
"anpassen",
"so",
"dass",
"diese",
"direkt",
"die",
"Übersicht",
"der",
"Folgen",
"beinhaltet",
"sofern",
"diese",
"Seite",
"existiert!",
"Damit",
"wird",
"das",
"unnötige",
"Einlesen",
"einer",
"Zwischenseite",
"gespart",
"."
] | train | https://github.com/mediathekview/MServer/blob/ba8d03e6a1a303db3807a1327f553f1decd30388/src/main/java/mServer/crawler/sender/hr/HrSendungenListDeserializer.java#L53-L66 |
domaframework/doma-gen | src/main/java/org/seasar/doma/extension/gen/SqlDescFactory.java | SqlDescFactory.createSqlDesc | protected SqlDesc createSqlDesc(EntityDesc entityDesc, String fileName, String templateName) {
SqlDesc sqlFileDesc = new SqlDesc();
sqlFileDesc.setFileName(fileName);
sqlFileDesc.setTemplateName(templateName);
sqlFileDesc.setEntityDesc(entityDesc);
sqlFileDesc.setDialect(dialect);
return sqlFile... | java | protected SqlDesc createSqlDesc(EntityDesc entityDesc, String fileName, String templateName) {
SqlDesc sqlFileDesc = new SqlDesc();
sqlFileDesc.setFileName(fileName);
sqlFileDesc.setTemplateName(templateName);
sqlFileDesc.setEntityDesc(entityDesc);
sqlFileDesc.setDialect(dialect);
return sqlFile... | [
"protected",
"SqlDesc",
"createSqlDesc",
"(",
"EntityDesc",
"entityDesc",
",",
"String",
"fileName",
",",
"String",
"templateName",
")",
"{",
"SqlDesc",
"sqlFileDesc",
"=",
"new",
"SqlDesc",
"(",
")",
";",
"sqlFileDesc",
".",
"setFileName",
"(",
"fileName",
")",... | SQL記述を返します。
@param entityDesc エンティティ記述
@param fileName ファイル名
@param templateName テンプレート名
@return SQL記述 | [
"SQL記述を返します。"
] | train | https://github.com/domaframework/doma-gen/blob/8046e0b28d2167d444125f206ce36e554b3ee616/src/main/java/org/seasar/doma/extension/gen/SqlDescFactory.java#L104-L111 |
aalmiray/Json-lib | src/main/java/net/sf/json/JSONObject.java | JSONObject.elementOpt | public JSONObject elementOpt( String key, Object value ) {
return elementOpt( key, value, new JsonConfig() );
} | java | public JSONObject elementOpt( String key, Object value ) {
return elementOpt( key, value, new JsonConfig() );
} | [
"public",
"JSONObject",
"elementOpt",
"(",
"String",
"key",
",",
"Object",
"value",
")",
"{",
"return",
"elementOpt",
"(",
"key",
",",
"value",
",",
"new",
"JsonConfig",
"(",
")",
")",
";",
"}"
] | Put a key/value pair in the JSONObject, but only if the key and the value
are both non-null.
@param key A key string.
@param value An object which is the value. It should be of one of these
types: Boolean, Double, Integer, JSONArray, JSONObject, Long,
String, or the JSONNull object.
@return this.
@throws JSONException... | [
"Put",
"a",
"key",
"/",
"value",
"pair",
"in",
"the",
"JSONObject",
"but",
"only",
"if",
"the",
"key",
"and",
"the",
"value",
"are",
"both",
"non",
"-",
"null",
"."
] | train | https://github.com/aalmiray/Json-lib/blob/9e2b3376ee8f511a48aa7ac05f75a7414e02280f/src/main/java/net/sf/json/JSONObject.java#L1731-L1733 |
liferay/com-liferay-commerce | commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java | CommerceNotificationQueueEntryPersistenceImpl.findByLtS | @Override
public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate) {
return findByLtS(sentDate, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | java | @Override
public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate) {
return findByLtS(sentDate, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceNotificationQueueEntry",
">",
"findByLtS",
"(",
"Date",
"sentDate",
")",
"{",
"return",
"findByLtS",
"(",
"sentDate",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"QueryUtil",
".",
"ALL_POS",
",",
"null",
")",
";",
... | Returns all the commerce notification queue entries where sentDate < ?.
@param sentDate the sent date
@return the matching commerce notification queue entries | [
"Returns",
"all",
"the",
"commerce",
"notification",
"queue",
"entries",
"where",
"sentDate",
"<",
";",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L1686-L1689 |
dasein-cloud/dasein-cloud-aws | src/main/java/org/dasein/cloud/aws/platform/RDS.java | RDS.authorizeClassicDbSecurityGroup | private void authorizeClassicDbSecurityGroup(String groupName, String sourceCidr) throws CloudException, InternalException {
Map<String,String> parameters = getProvider().getStandardRdsParameters(getProvider().getContext(), AUTHORIZE_DB_SECURITY_GROUP_INGRESS);
parameters.put("DBSecurityGroupName", grou... | java | private void authorizeClassicDbSecurityGroup(String groupName, String sourceCidr) throws CloudException, InternalException {
Map<String,String> parameters = getProvider().getStandardRdsParameters(getProvider().getContext(), AUTHORIZE_DB_SECURITY_GROUP_INGRESS);
parameters.put("DBSecurityGroupName", grou... | [
"private",
"void",
"authorizeClassicDbSecurityGroup",
"(",
"String",
"groupName",
",",
"String",
"sourceCidr",
")",
"throws",
"CloudException",
",",
"InternalException",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"parameters",
"=",
"getProvider",
"(",
")",
"."... | Use this to authorize with security groups in EC2-Classic
@param groupName
@param sourceCidr
@throws CloudException
@throws InternalException | [
"Use",
"this",
"to",
"authorize",
"with",
"security",
"groups",
"in",
"EC2",
"-",
"Classic"
] | train | https://github.com/dasein-cloud/dasein-cloud-aws/blob/05098574197a1f573f77447cadc39a76bf00b99d/src/main/java/org/dasein/cloud/aws/platform/RDS.java#L121-L136 |
patrickfav/bcrypt | modules/bcrypt/src/main/java/at/favre/lib/crypto/bcrypt/BCryptOpenBSDProtocol.java | BCryptOpenBSDProtocol.streamToWord | private static int streamToWord(byte[] data, int[] offp) {
int i;
int word = 0;
int off = offp[0];
for (i = 0; i < 4; i++) {
word = (word << 8) | (data[off] & 0xff);
off = (off + 1) % data.length;
}
offp[0] = off;
return word;
} | java | private static int streamToWord(byte[] data, int[] offp) {
int i;
int word = 0;
int off = offp[0];
for (i = 0; i < 4; i++) {
word = (word << 8) | (data[off] & 0xff);
off = (off + 1) % data.length;
}
offp[0] = off;
return word;
} | [
"private",
"static",
"int",
"streamToWord",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"[",
"]",
"offp",
")",
"{",
"int",
"i",
";",
"int",
"word",
"=",
"0",
";",
"int",
"off",
"=",
"offp",
"[",
"0",
"]",
";",
"for",
"(",
"i",
"=",
"0",
";",
... | Cyclically extract a word of key material
@param data the string to extract the data from
@param offp a "pointer" (as a one-entry array) to the
current offset into data
@return the next word of material from data | [
"Cyclically",
"extract",
"a",
"word",
"of",
"key",
"material"
] | train | https://github.com/patrickfav/bcrypt/blob/40e75be395b4e1b57b9872b22d98a9fb560e0184/modules/bcrypt/src/main/java/at/favre/lib/crypto/bcrypt/BCryptOpenBSDProtocol.java#L403-L415 |
maxirosson/jdroid-android | jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java | SharedPreferencesHelper.loadPreferenceAsBoolean | public Boolean loadPreferenceAsBoolean(String key, Boolean defaultValue) {
Boolean value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getBoolean(key, false);
}
logLoad(key, value);
return value;
} | java | public Boolean loadPreferenceAsBoolean(String key, Boolean defaultValue) {
Boolean value = defaultValue;
if (hasPreference(key)) {
value = getSharedPreferences().getBoolean(key, false);
}
logLoad(key, value);
return value;
} | [
"public",
"Boolean",
"loadPreferenceAsBoolean",
"(",
"String",
"key",
",",
"Boolean",
"defaultValue",
")",
"{",
"Boolean",
"value",
"=",
"defaultValue",
";",
"if",
"(",
"hasPreference",
"(",
"key",
")",
")",
"{",
"value",
"=",
"getSharedPreferences",
"(",
")",... | Retrieve a boolean value from the preferences.
@param key The name of the preference to retrieve
@param defaultValue Value to return if this preference does not exist
@return the preference value if it exists, or defaultValue. | [
"Retrieve",
"a",
"boolean",
"value",
"from",
"the",
"preferences",
"."
] | train | https://github.com/maxirosson/jdroid-android/blob/1ba9cae56a16fa36bdb2c9c04379853f0300707f/jdroid-android-core/src/main/java/com/jdroid/android/utils/SharedPreferencesHelper.java#L202-L209 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java | FileWriterServices.copyResourceToDir | public void copyResourceToDir(String path, String filename, String dir) {
String fullpath = path + ProcessorConstants.SEPARATORCHAR + filename;
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript copy js : " + fullpath + " to : "+dir);
try (Writer writer = getFileObjectWriter(dir, "org.ocelotds.... | java | public void copyResourceToDir(String path, String filename, String dir) {
String fullpath = path + ProcessorConstants.SEPARATORCHAR + filename;
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript copy js : " + fullpath + " to : "+dir);
try (Writer writer = getFileObjectWriter(dir, "org.ocelotds.... | [
"public",
"void",
"copyResourceToDir",
"(",
"String",
"path",
",",
"String",
"filename",
",",
"String",
"dir",
")",
"{",
"String",
"fullpath",
"=",
"path",
"+",
"ProcessorConstants",
".",
"SEPARATORCHAR",
"+",
"filename",
";",
"messager",
".",
"printMessage",
... | copy path/filename in dir
@param path
@param filename
@param dir | [
"copy",
"path",
"/",
"filename",
"in",
"dir"
] | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/FileWriterServices.java#L56-L64 |
alibaba/canal | dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java | RowsLogBuffer.nextOneRow | public final boolean nextOneRow(BitSet columns, boolean after) {
final boolean hasOneRow = buffer.hasRemaining();
if (hasOneRow) {
int column = 0;
for (int i = 0; i < columnLen; i++)
if (columns.get(i)) {
column++;
}
... | java | public final boolean nextOneRow(BitSet columns, boolean after) {
final boolean hasOneRow = buffer.hasRemaining();
if (hasOneRow) {
int column = 0;
for (int i = 0; i < columnLen; i++)
if (columns.get(i)) {
column++;
}
... | [
"public",
"final",
"boolean",
"nextOneRow",
"(",
"BitSet",
"columns",
",",
"boolean",
"after",
")",
"{",
"final",
"boolean",
"hasOneRow",
"=",
"buffer",
".",
"hasRemaining",
"(",
")",
";",
"if",
"(",
"hasOneRow",
")",
"{",
"int",
"column",
"=",
"0",
";",... | Extracting next row from packed buffer.
@see mysql-5.1.60/sql/log_event.cc -
Rows_log_event::print_verbose_one_row | [
"Extracting",
"next",
"row",
"from",
"packed",
"buffer",
"."
] | train | https://github.com/alibaba/canal/blob/8f088cddc0755f4350c5aaae95c6e4002d90a40f/dbsync/src/main/java/com/taobao/tddl/dbsync/binlog/event/RowsLogBuffer.java#L70-L96 |
line/armeria | core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java | AbstractClientOptionsBuilder.rpcDecorator | public <T extends Client<I, O>, R extends Client<I, O>, I extends RpcRequest, O extends RpcResponse>
B rpcDecorator(Function<T, R> decorator) {
decoration.addRpc(decorator);
return self();
} | java | public <T extends Client<I, O>, R extends Client<I, O>, I extends RpcRequest, O extends RpcResponse>
B rpcDecorator(Function<T, R> decorator) {
decoration.addRpc(decorator);
return self();
} | [
"public",
"<",
"T",
"extends",
"Client",
"<",
"I",
",",
"O",
">",
",",
"R",
"extends",
"Client",
"<",
"I",
",",
"O",
">",
",",
"I",
"extends",
"RpcRequest",
",",
"O",
"extends",
"RpcResponse",
">",
"B",
"rpcDecorator",
"(",
"Function",
"<",
"T",
",... | Adds the specified RPC-level {@code decorator}.
@param decorator the {@link Function} that transforms a {@link Client} to another
@param <T> the type of the {@link Client} being decorated
@param <R> the type of the {@link Client} produced by the {@code decorator}
@param <I> the {@link Request} type of the {@link Clien... | [
"Adds",
"the",
"specified",
"RPC",
"-",
"level",
"{",
"@code",
"decorator",
"}",
"."
] | train | https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java#L311-L315 |
google/j2objc | xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java | WalkingIterator.fixupVariables | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
m_predicateIndex = -1;
AxesWalker walker = m_firstWalker;
while (null != walker)
{
walker.fixupVariables(vars, globalsSize);
walker = walker.getNextWalker();
}
} | java | public void fixupVariables(java.util.Vector vars, int globalsSize)
{
m_predicateIndex = -1;
AxesWalker walker = m_firstWalker;
while (null != walker)
{
walker.fixupVariables(vars, globalsSize);
walker = walker.getNextWalker();
}
} | [
"public",
"void",
"fixupVariables",
"(",
"java",
".",
"util",
".",
"Vector",
"vars",
",",
"int",
"globalsSize",
")",
"{",
"m_predicateIndex",
"=",
"-",
"1",
";",
"AxesWalker",
"walker",
"=",
"m_firstWalker",
";",
"while",
"(",
"null",
"!=",
"walker",
")",
... | This function is used to fixup variables from QNames to stack frame
indexes at stylesheet build time.
@param vars List of QNames that correspond to variables. This list
should be searched backwards for the first qualified name that
corresponds to the variable reference qname. The position of the
QName in the vector f... | [
"This",
"function",
"is",
"used",
"to",
"fixup",
"variables",
"from",
"QNames",
"to",
"stack",
"frame",
"indexes",
"at",
"stylesheet",
"build",
"time",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/axes/WalkingIterator.java#L286-L297 |
dwdyer/uncommons-maths | demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java | SwingBackgroundTask.execute | public void execute()
{
Runnable task = new Runnable()
{
public void run()
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
... | java | public void execute()
{
Runnable task = new Runnable()
{
public void run()
{
final V result = performTask();
SwingUtilities.invokeLater(new Runnable()
{
public void run()
{
... | [
"public",
"void",
"execute",
"(",
")",
"{",
"Runnable",
"task",
"=",
"new",
"Runnable",
"(",
")",
"{",
"public",
"void",
"run",
"(",
")",
"{",
"final",
"V",
"result",
"=",
"performTask",
"(",
")",
";",
"SwingUtilities",
".",
"invokeLater",
"(",
"new",
... | Asynchronous call that begins execution of the task
and returns immediately. | [
"Asynchronous",
"call",
"that",
"begins",
"execution",
"of",
"the",
"task",
"and",
"returns",
"immediately",
"."
] | train | https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/demo/src/java/main/org/uncommons/swing/SwingBackgroundTask.java#L49-L67 |
Azure/azure-sdk-for-java | labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java | EnvironmentSettingsInner.getAsync | public Observable<EnvironmentSettingInner> getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) {
return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand).map(new Func1<ServiceResponse<Enviro... | java | public Observable<EnvironmentSettingInner> getAsync(String resourceGroupName, String labAccountName, String labName, String environmentSettingName, String expand) {
return getWithServiceResponseAsync(resourceGroupName, labAccountName, labName, environmentSettingName, expand).map(new Func1<ServiceResponse<Enviro... | [
"public",
"Observable",
"<",
"EnvironmentSettingInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"labAccountName",
",",
"String",
"labName",
",",
"String",
"environmentSettingName",
",",
"String",
"expand",
")",
"{",
"return",
"getWithServic... | Get environment setting.
@param resourceGroupName The name of the resource group.
@param labAccountName The name of the lab Account.
@param labName The name of the lab.
@param environmentSettingName The name of the environment Setting.
@param expand Specify the $expand query. Example: 'properties($select=publishingSta... | [
"Get",
"environment",
"setting",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/labservices/resource-manager/v2018_10_15/src/main/java/com/microsoft/azure/management/labservices/v2018_10_15/implementation/EnvironmentSettingsInner.java#L543-L550 |
apache/spark | sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java | OffHeapColumnVector.allocateColumns | public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) {
OffHeapColumnVector[] vectors = new OffHeapColumnVector[fields.length];
for (int i = 0; i < fields.length; i++) {
vectors[i] = new OffHeapColumnVector(capacity, fields[i].dataType());
}
return vectors;
} | java | public static OffHeapColumnVector[] allocateColumns(int capacity, StructField[] fields) {
OffHeapColumnVector[] vectors = new OffHeapColumnVector[fields.length];
for (int i = 0; i < fields.length; i++) {
vectors[i] = new OffHeapColumnVector(capacity, fields[i].dataType());
}
return vectors;
} | [
"public",
"static",
"OffHeapColumnVector",
"[",
"]",
"allocateColumns",
"(",
"int",
"capacity",
",",
"StructField",
"[",
"]",
"fields",
")",
"{",
"OffHeapColumnVector",
"[",
"]",
"vectors",
"=",
"new",
"OffHeapColumnVector",
"[",
"fields",
".",
"length",
"]",
... | Allocates columns to store elements of each field off heap.
Capacity is the initial capacity of the vector and it will grow as necessary. Capacity is
in number of elements, not number of bytes. | [
"Allocates",
"columns",
"to",
"store",
"elements",
"of",
"each",
"field",
"off",
"heap",
".",
"Capacity",
"is",
"the",
"initial",
"capacity",
"of",
"the",
"vector",
"and",
"it",
"will",
"grow",
"as",
"necessary",
".",
"Capacity",
"is",
"in",
"number",
"of"... | train | https://github.com/apache/spark/blob/25ee0474f47d9c30d6f553a7892d9549f91071cf/sql/core/src/main/java/org/apache/spark/sql/execution/vectorized/OffHeapColumnVector.java#L50-L56 |
exoplatform/jcr | exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java | LinkedWorkspaceStorageCacheImpl.removeSiblings | protected void removeSiblings(final NodeData node)
{
if (node.getIdentifier().equals(Constants.ROOT_UUID))
{
return;
}
// remove child nodes of the item parent recursive
writeLock.lock();
try
{
// remove on-parent child nodes list
nodesCache.remov... | java | protected void removeSiblings(final NodeData node)
{
if (node.getIdentifier().equals(Constants.ROOT_UUID))
{
return;
}
// remove child nodes of the item parent recursive
writeLock.lock();
try
{
// remove on-parent child nodes list
nodesCache.remov... | [
"protected",
"void",
"removeSiblings",
"(",
"final",
"NodeData",
"node",
")",
"{",
"if",
"(",
"node",
".",
"getIdentifier",
"(",
")",
".",
"equals",
"(",
"Constants",
".",
"ROOT_UUID",
")",
")",
"{",
"return",
";",
"}",
"// remove child nodes of the item paren... | Remove sibling's subtrees from cache C, CN, CP.<br> For update (order-before) usecase.<br>
The work does remove of all descendants of the item parent. I.e. the node and its siblings (for
SNS case).<br> | [
"Remove",
"sibling",
"s",
"subtrees",
"from",
"cache",
"C",
"CN",
"CP",
".",
"<br",
">",
"For",
"update",
"(",
"order",
"-",
"before",
")",
"usecase",
".",
"<br",
">",
"The",
"work",
"does",
"remove",
"of",
"all",
"descendants",
"of",
"the",
"item",
... | train | https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/dataflow/persistent/LinkedWorkspaceStorageCacheImpl.java#L1810-L1865 |
alkacon/opencms-core | src/org/opencms/xml/page/CmsXmlPage.java | CmsXmlPage.setEnabled | public void setEnabled(String name, Locale locale, boolean isEnabled) {
CmsXmlHtmlValue value = (CmsXmlHtmlValue)getValue(name, locale);
Element element = value.getElement();
Attribute enabled = element.attribute(ATTRIBUTE_ENABLED);
if (enabled == null) {
if (!isEnabled) {
... | java | public void setEnabled(String name, Locale locale, boolean isEnabled) {
CmsXmlHtmlValue value = (CmsXmlHtmlValue)getValue(name, locale);
Element element = value.getElement();
Attribute enabled = element.attribute(ATTRIBUTE_ENABLED);
if (enabled == null) {
if (!isEnabled) {
... | [
"public",
"void",
"setEnabled",
"(",
"String",
"name",
",",
"Locale",
"locale",
",",
"boolean",
"isEnabled",
")",
"{",
"CmsXmlHtmlValue",
"value",
"=",
"(",
"CmsXmlHtmlValue",
")",
"getValue",
"(",
"name",
",",
"locale",
")",
";",
"Element",
"element",
"=",
... | Sets the enabled flag of an already existing element.<p>
Note: if isEnabled is set to true, the attribute is removed
since true is the default
@param name name name of the element
@param locale locale of the element
@param isEnabled enabled flag for the element | [
"Sets",
"the",
"enabled",
"flag",
"of",
"an",
"already",
"existing",
"element",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/page/CmsXmlPage.java#L408-L423 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java | ClassPathBuilder.parseClassName | private void parseClassName(ICodeBaseEntry entry) {
DataInputStream in = null;
try {
InputStream resourceIn = entry.openResource();
if (resourceIn == null) {
throw new NullPointerException("Got null resource");
}
in = new DataInputStream(re... | java | private void parseClassName(ICodeBaseEntry entry) {
DataInputStream in = null;
try {
InputStream resourceIn = entry.openResource();
if (resourceIn == null) {
throw new NullPointerException("Got null resource");
}
in = new DataInputStream(re... | [
"private",
"void",
"parseClassName",
"(",
"ICodeBaseEntry",
"entry",
")",
"{",
"DataInputStream",
"in",
"=",
"null",
";",
"try",
"{",
"InputStream",
"resourceIn",
"=",
"entry",
".",
"openResource",
"(",
")",
";",
"if",
"(",
"resourceIn",
"==",
"null",
")",
... | Attempt to parse data of given resource in order to divine the real name
of the class contained in the resource.
@param entry
the resource | [
"Attempt",
"to",
"parse",
"data",
"of",
"given",
"resource",
"in",
"order",
"to",
"divine",
"the",
"real",
"name",
"of",
"the",
"class",
"contained",
"in",
"the",
"resource",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/classfile/impl/ClassPathBuilder.java#L723-L746 |
lessthanoptimal/BoofCV | main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java | ConvertNV21.nv21ToInterleaved | public static InterleavedU8 nv21ToInterleaved( byte[] data , int width , int height ,
InterleavedU8 output ) {
if( output == null ) {
output = new InterleavedU8(width,height,3);
} else {
output.reshape(width, height, 3);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.nv21ToIn... | java | public static InterleavedU8 nv21ToInterleaved( byte[] data , int width , int height ,
InterleavedU8 output ) {
if( output == null ) {
output = new InterleavedU8(width,height,3);
} else {
output.reshape(width, height, 3);
}
if(BoofConcurrency.USE_CONCURRENT ) {
ImplConvertNV21_MT.nv21ToIn... | [
"public",
"static",
"InterleavedU8",
"nv21ToInterleaved",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"width",
",",
"int",
"height",
",",
"InterleavedU8",
"output",
")",
"{",
"if",
"(",
"output",
"==",
"null",
")",
"{",
"output",
"=",
"new",
"InterleavedU8"... | Converts an NV21 image into a {@link InterleavedU8} RGB image.
@param data Input: NV21 image data
@param width Input: NV21 image width
@param height Input: NV21 image height
@param output Output: Optional storage for output image. Can be null. | [
"Converts",
"an",
"NV21",
"image",
"into",
"a",
"{",
"@link",
"InterleavedU8",
"}",
"RGB",
"image",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-ip/src/main/java/boofcv/core/encoding/ConvertNV21.java#L231-L245 |
youngmonkeys/ezyfox-sfs2x | src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/AddBuddyImpl.java | AddBuddyImpl.checkBuddyManagerIsActive | private void checkBuddyManagerIsActive(BuddyListManager buddyListManager, User sfsOwner) {
if (!buddyListManager.isActive()) {
throw new IllegalStateException(
String.format("BuddyList operation failure. BuddyListManager is not active. Zone: %s, Sender: %s", new Object[] { sfsOwn... | java | private void checkBuddyManagerIsActive(BuddyListManager buddyListManager, User sfsOwner) {
if (!buddyListManager.isActive()) {
throw new IllegalStateException(
String.format("BuddyList operation failure. BuddyListManager is not active. Zone: %s, Sender: %s", new Object[] { sfsOwn... | [
"private",
"void",
"checkBuddyManagerIsActive",
"(",
"BuddyListManager",
"buddyListManager",
",",
"User",
"sfsOwner",
")",
"{",
"if",
"(",
"!",
"buddyListManager",
".",
"isActive",
"(",
")",
")",
"{",
"throw",
"new",
"IllegalStateException",
"(",
"String",
".",
... | Check whether buddy manager is active
@param buddyListManager manager object
@param sfsOwner buddy's owner | [
"Check",
"whether",
"buddy",
"manager",
"is",
"active"
] | train | https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/command/impl/AddBuddyImpl.java#L174-L179 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/ConceptParser.java | ConceptParser.isValidConcept | private boolean isValidConcept(final String concept, final Double score) {
return !StringUtils.isBlank(concept)
|| score != null;
} | java | private boolean isValidConcept(final String concept, final Double score) {
return !StringUtils.isBlank(concept)
|| score != null;
} | [
"private",
"boolean",
"isValidConcept",
"(",
"final",
"String",
"concept",
",",
"final",
"Double",
"score",
")",
"{",
"return",
"!",
"StringUtils",
".",
"isBlank",
"(",
"concept",
")",
"||",
"score",
"!=",
"null",
";",
"}"
] | Return true if at least one of the values is not null/empty.
@param concept the sentiment concept
@param score the sentiment score
@return true if at least one of the values is not null/empty | [
"Return",
"true",
"if",
"at",
"least",
"one",
"of",
"the",
"values",
"is",
"not",
"null",
"/",
"empty",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/ConceptParser.java#L96-L99 |
alkacon/opencms-core | src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java | CmsPropertyCustom.dialogButtonsOkCancelAdvanced | @Override
public String dialogButtonsOkCancelAdvanced(
String okAttributes,
String cancelAttributes,
String advancedAttributes) {
if (isEditable()) {
int okButton = BUTTON_OK;
if ((getParamDialogmode() != null) && getParamDialogmode().startsWith(MODE_WIZARD))... | java | @Override
public String dialogButtonsOkCancelAdvanced(
String okAttributes,
String cancelAttributes,
String advancedAttributes) {
if (isEditable()) {
int okButton = BUTTON_OK;
if ((getParamDialogmode() != null) && getParamDialogmode().startsWith(MODE_WIZARD))... | [
"@",
"Override",
"public",
"String",
"dialogButtonsOkCancelAdvanced",
"(",
"String",
"okAttributes",
",",
"String",
"cancelAttributes",
",",
"String",
"advancedAttributes",
")",
"{",
"if",
"(",
"isEditable",
"(",
")",
")",
"{",
"int",
"okButton",
"=",
"BUTTON_OK",... | Builds a button row with an "ok", a "cancel" and an "advanced" button.<p>
@param okAttributes additional attributes for the "ok" button
@param cancelAttributes additional attributes for the "cancel" button
@param advancedAttributes additional attributes for the "advanced" button
@return the button row | [
"Builds",
"a",
"button",
"row",
"with",
"an",
"ok",
"a",
"cancel",
"and",
"an",
"advanced",
"button",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-modules/org/opencms/workplace/commons/CmsPropertyCustom.java#L233-L265 |
aspectran/aspectran | core/src/main/java/com/aspectran/core/activity/AdviceActivity.java | AdviceActivity.putAdviceResult | protected void putAdviceResult(AspectAdviceRule aspectAdviceRule, Object adviceActionResult) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAdviceResult(aspectAdviceRule, adviceActionResult);
} | java | protected void putAdviceResult(AspectAdviceRule aspectAdviceRule, Object adviceActionResult) {
if (aspectAdviceResult == null) {
aspectAdviceResult = new AspectAdviceResult();
}
aspectAdviceResult.putAdviceResult(aspectAdviceRule, adviceActionResult);
} | [
"protected",
"void",
"putAdviceResult",
"(",
"AspectAdviceRule",
"aspectAdviceRule",
",",
"Object",
"adviceActionResult",
")",
"{",
"if",
"(",
"aspectAdviceResult",
"==",
"null",
")",
"{",
"aspectAdviceResult",
"=",
"new",
"AspectAdviceResult",
"(",
")",
";",
"}",
... | Puts the result of the advice.
@param aspectAdviceRule the aspect advice rule
@param adviceActionResult the advice action result | [
"Puts",
"the",
"result",
"of",
"the",
"advice",
"."
] | train | https://github.com/aspectran/aspectran/blob/2d758a2a28b71ee85b42823c12dc44674d7f2c70/core/src/main/java/com/aspectran/core/activity/AdviceActivity.java#L522-L527 |
smartsheet-platform/smartsheet-java-sdk | src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java | SheetRowResourcesImpl.getRow | public Row getRow(long sheetId, long rowId, EnumSet<RowInclusion> includes, EnumSet<ObjectExclusion> excludes) throws SmartsheetException {
String path = "sheets/" + sheetId + "/rows/" + rowId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("include", QueryU... | java | public Row getRow(long sheetId, long rowId, EnumSet<RowInclusion> includes, EnumSet<ObjectExclusion> excludes) throws SmartsheetException {
String path = "sheets/" + sheetId + "/rows/" + rowId;
HashMap<String, Object> parameters = new HashMap<String, Object>();
parameters.put("include", QueryU... | [
"public",
"Row",
"getRow",
"(",
"long",
"sheetId",
",",
"long",
"rowId",
",",
"EnumSet",
"<",
"RowInclusion",
">",
"includes",
",",
"EnumSet",
"<",
"ObjectExclusion",
">",
"excludes",
")",
"throws",
"SmartsheetException",
"{",
"String",
"path",
"=",
"\"sheets/... | Get a row.
It mirrors to the following Smartsheet REST API method: GET /sheets/{sheetId}/rows/{rowId}
Exceptions:
- InvalidRequestException : if there is any problem with the REST API request
- AuthorizationException : if there is any problem with the REST API authorization(access token)
- ResourceNotFoundException :... | [
"Get",
"a",
"row",
"."
] | train | https://github.com/smartsheet-platform/smartsheet-java-sdk/blob/f60e264412076271f83b65889ef9b891fad83df8/src/main/java/com/smartsheet/api/internal/SheetRowResourcesImpl.java#L116-L126 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxGroup.java | BoxGroup.getMemberships | public Collection<BoxGroupMembership.Info> getMemberships() {
final BoxAPIConnection api = this.getAPI();
final String groupID = this.getID();
Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() {
public Iterator<BoxGroupMembership.Info> iterator() {
... | java | public Collection<BoxGroupMembership.Info> getMemberships() {
final BoxAPIConnection api = this.getAPI();
final String groupID = this.getID();
Iterable<BoxGroupMembership.Info> iter = new Iterable<BoxGroupMembership.Info>() {
public Iterator<BoxGroupMembership.Info> iterator() {
... | [
"public",
"Collection",
"<",
"BoxGroupMembership",
".",
"Info",
">",
"getMemberships",
"(",
")",
"{",
"final",
"BoxAPIConnection",
"api",
"=",
"this",
".",
"getAPI",
"(",
")",
";",
"final",
"String",
"groupID",
"=",
"this",
".",
"getID",
"(",
")",
";",
"... | Gets information about all of the group memberships for this group.
Does not support paging.
@return a collection of information about the group memberships for this group. | [
"Gets",
"information",
"about",
"all",
"of",
"the",
"group",
"memberships",
"for",
"this",
"group",
".",
"Does",
"not",
"support",
"paging",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxGroup.java#L200-L218 |
Domo42/saga-lib | saga-lib/src/main/java/com/codebullets/sagalib/processing/SagaKeyReaderExtractor.java | SagaKeyReaderExtractor.tryGetKeyReader | private KeyReader tryGetKeyReader(final Class<? extends Saga> sagaClazz, final Object message) {
KeyReader reader;
try {
Optional<KeyReader> cachedReader = knownReaders.get(
SagaMessageKey.forMessage(sagaClazz, message),
() -> {
... | java | private KeyReader tryGetKeyReader(final Class<? extends Saga> sagaClazz, final Object message) {
KeyReader reader;
try {
Optional<KeyReader> cachedReader = knownReaders.get(
SagaMessageKey.forMessage(sagaClazz, message),
() -> {
... | [
"private",
"KeyReader",
"tryGetKeyReader",
"(",
"final",
"Class",
"<",
"?",
"extends",
"Saga",
">",
"sagaClazz",
",",
"final",
"Object",
"message",
")",
"{",
"KeyReader",
"reader",
";",
"try",
"{",
"Optional",
"<",
"KeyReader",
">",
"cachedReader",
"=",
"kno... | Does not throw an exception when accessing the loading cache for key readers. | [
"Does",
"not",
"throw",
"an",
"exception",
"when",
"accessing",
"the",
"loading",
"cache",
"for",
"key",
"readers",
"."
] | train | https://github.com/Domo42/saga-lib/blob/c8f232e2a51fcb6a3fe0082cfbf105c1e6bf90ef/saga-lib/src/main/java/com/codebullets/sagalib/processing/SagaKeyReaderExtractor.java#L71-L88 |
GoogleCloudPlatform/bigdata-interop | gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java | GoogleCloudStorageFileSystem.copyInternal | private void copyInternal(Map<FileInfo, URI> srcToDstItemNames) throws IOException {
if (srcToDstItemNames.isEmpty()) {
return;
}
String srcBucketName = null;
String dstBucketName = null;
List<String> srcObjectNames = new ArrayList<>(srcToDstItemNames.size());
List<String> dstObjectNames ... | java | private void copyInternal(Map<FileInfo, URI> srcToDstItemNames) throws IOException {
if (srcToDstItemNames.isEmpty()) {
return;
}
String srcBucketName = null;
String dstBucketName = null;
List<String> srcObjectNames = new ArrayList<>(srcToDstItemNames.size());
List<String> dstObjectNames ... | [
"private",
"void",
"copyInternal",
"(",
"Map",
"<",
"FileInfo",
",",
"URI",
">",
"srcToDstItemNames",
")",
"throws",
"IOException",
"{",
"if",
"(",
"srcToDstItemNames",
".",
"isEmpty",
"(",
")",
")",
"{",
"return",
";",
"}",
"String",
"srcBucketName",
"=",
... | Copies items in given map that maps source items to destination items. | [
"Copies",
"items",
"in",
"given",
"map",
"that",
"maps",
"source",
"items",
"to",
"destination",
"items",
"."
] | train | https://github.com/GoogleCloudPlatform/bigdata-interop/blob/918d91c80a63e36046edb28972a5c65d3326a858/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageFileSystem.java#L836-L862 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/sch/util/ScheduleUtils.java | ScheduleUtils.buildTriggers | public static IntDiGraph buildTriggers(IntDiGraph g, Schedule s) {
// return trigger DAG
IntDiGraph d = new IntDiGraph();
// map from node to triggering indexes
DefaultDict<Integer, List<Integer>> currentTriggers = new DefaultDict<>(i -> new LinkedList<Integer>());
for (Indexed<... | java | public static IntDiGraph buildTriggers(IntDiGraph g, Schedule s) {
// return trigger DAG
IntDiGraph d = new IntDiGraph();
// map from node to triggering indexes
DefaultDict<Integer, List<Integer>> currentTriggers = new DefaultDict<>(i -> new LinkedList<Integer>());
for (Indexed<... | [
"public",
"static",
"IntDiGraph",
"buildTriggers",
"(",
"IntDiGraph",
"g",
",",
"Schedule",
"s",
")",
"{",
"// return trigger DAG",
"IntDiGraph",
"d",
"=",
"new",
"IntDiGraph",
"(",
")",
";",
"// map from node to triggering indexes",
"DefaultDict",
"<",
"Integer",
"... | return a DAG, G' = V', E' such that vertecies correspond to indexes in
the schedule and there is an edge (i,j) \in E' if s_i triggered s_j | [
"return",
"a",
"DAG",
"G",
"=",
"V",
"E",
"such",
"that",
"vertecies",
"correspond",
"to",
"indexes",
"in",
"the",
"schedule",
"and",
"there",
"is",
"an",
"edge",
"(",
"i",
"j",
")",
"\\",
"in",
"E",
"if",
"s_i",
"triggered",
"s_j"
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/sch/util/ScheduleUtils.java#L33-L62 |
lightblueseas/file-worker | src/main/java/de/alpharogroup/file/search/PathFinder.java | PathFinder.getRelativePathTo | public static File getRelativePathTo(final File parent, final String separator,
final String folders, final String filename)
{
final List<String> list = new ArrayList<>(Arrays.asList(folders.split(separator)));
if (filename != null && !filename.isEmpty())
{
list.add(filename);
}
return getRelati... | java | public static File getRelativePathTo(final File parent, final String separator,
final String folders, final String filename)
{
final List<String> list = new ArrayList<>(Arrays.asList(folders.split(separator)));
if (filename != null && !filename.isEmpty())
{
list.add(filename);
}
return getRelati... | [
"public",
"static",
"File",
"getRelativePathTo",
"(",
"final",
"File",
"parent",
",",
"final",
"String",
"separator",
",",
"final",
"String",
"folders",
",",
"final",
"String",
"filename",
")",
"{",
"final",
"List",
"<",
"String",
">",
"list",
"=",
"new",
... | Gets the file or directory from the given parent File object and the relative path given over
the list as String objects.
@param parent
The parent directory.
@param separator
The separator for separate the String folders.
@param folders
The relative path as a String object separated with the defined separator.
@param ... | [
"Gets",
"the",
"file",
"or",
"directory",
"from",
"the",
"given",
"parent",
"File",
"object",
"and",
"the",
"relative",
"path",
"given",
"over",
"the",
"list",
"as",
"String",
"objects",
"."
] | train | https://github.com/lightblueseas/file-worker/blob/2c81de10fb5d68de64c1abc3ed64ca681ce76da8/src/main/java/de/alpharogroup/file/search/PathFinder.java#L162-L171 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/session/SessionFile.java | SessionFile.getInstance | public static Session getInstance(String name, PageContext pc, Log log) {
Resource res = _loadResource(pc.getConfig(), SCOPE_SESSION, name, pc.getCFID());
Struct data = _loadData(pc, res, log);
return new SessionFile(pc, res, data);
} | java | public static Session getInstance(String name, PageContext pc, Log log) {
Resource res = _loadResource(pc.getConfig(), SCOPE_SESSION, name, pc.getCFID());
Struct data = _loadData(pc, res, log);
return new SessionFile(pc, res, data);
} | [
"public",
"static",
"Session",
"getInstance",
"(",
"String",
"name",
",",
"PageContext",
"pc",
",",
"Log",
"log",
")",
"{",
"Resource",
"res",
"=",
"_loadResource",
"(",
"pc",
".",
"getConfig",
"(",
")",
",",
"SCOPE_SESSION",
",",
"name",
",",
"pc",
".",... | load new instance of the class
@param name
@param pc
@param checkExpires
@return | [
"load",
"new",
"instance",
"of",
"the",
"class"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/session/SessionFile.java#L61-L66 |
drinkjava2/jBeanBox | jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java | CheckClassAdapter.checkTypeArguments | private static int checkTypeArguments(final String signature, int pos) {
// TypeArguments:
// < TypeArgument+ >
pos = checkChar('<', signature, pos);
pos = checkTypeArgument(signature, pos);
while (getChar(signature, pos) != '>') {
pos = checkTypeArgument(signature, ... | java | private static int checkTypeArguments(final String signature, int pos) {
// TypeArguments:
// < TypeArgument+ >
pos = checkChar('<', signature, pos);
pos = checkTypeArgument(signature, pos);
while (getChar(signature, pos) != '>') {
pos = checkTypeArgument(signature, ... | [
"private",
"static",
"int",
"checkTypeArguments",
"(",
"final",
"String",
"signature",
",",
"int",
"pos",
")",
"{",
"// TypeArguments:",
"// < TypeArgument+ >",
"pos",
"=",
"checkChar",
"(",
"'",
"'",
",",
"signature",
",",
"pos",
")",
";",
"pos",
"=",
"chec... | Checks the type arguments in a class type signature.
@param signature
a string containing the signature that must be checked.
@param pos
index of first character to be checked.
@return the index of the first character after the checked part. | [
"Checks",
"the",
"type",
"arguments",
"in",
"a",
"class",
"type",
"signature",
"."
] | train | https://github.com/drinkjava2/jBeanBox/blob/01c216599ffa2e5f2d9c01df2adaad0f45567c04/jbeanbox/src/main/java/com/github/drinkjava2/asm5_0_3/util/CheckClassAdapter.java#L877-L887 |
amaembo/streamex | src/main/java/one/util/streamex/AbstractStreamEx.java | AbstractStreamEx.foldLeft | public <U> U foldLeft(U seed, BiFunction<U, ? super T, U> accumulator) {
Box<U> result = new Box<>(seed);
forEachOrdered(t -> result.a = accumulator.apply(result.a, t));
return result.a;
} | java | public <U> U foldLeft(U seed, BiFunction<U, ? super T, U> accumulator) {
Box<U> result = new Box<>(seed);
forEachOrdered(t -> result.a = accumulator.apply(result.a, t));
return result.a;
} | [
"public",
"<",
"U",
">",
"U",
"foldLeft",
"(",
"U",
"seed",
",",
"BiFunction",
"<",
"U",
",",
"?",
"super",
"T",
",",
"U",
">",
"accumulator",
")",
"{",
"Box",
"<",
"U",
">",
"result",
"=",
"new",
"Box",
"<>",
"(",
"seed",
")",
";",
"forEachOrd... | Folds the elements of this stream using the provided seed object and
accumulation function, going left to right. This is equivalent to:
<pre>
{@code
U result = seed;
for (T element : this stream)
result = accumulator.apply(result, element)
return result;
}
</pre>
<p>
This is a terminal operation.
<p>
This method can... | [
"Folds",
"the",
"elements",
"of",
"this",
"stream",
"using",
"the",
"provided",
"seed",
"object",
"and",
"accumulation",
"function",
"going",
"left",
"to",
"right",
".",
"This",
"is",
"equivalent",
"to",
":"
] | train | https://github.com/amaembo/streamex/blob/936bbd1b7dfbcf64a3b990682bfc848213441d14/src/main/java/one/util/streamex/AbstractStreamEx.java#L1352-L1356 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.serviceName_features_backupCloud_POST | public OvhBackupCloud serviceName_features_backupCloud_POST(String serviceName, String cloudProjectId, String projectDescription) throws IOException {
String qPath = "/dedicated/server/{serviceName}/features/backupCloud";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, ... | java | public OvhBackupCloud serviceName_features_backupCloud_POST(String serviceName, String cloudProjectId, String projectDescription) throws IOException {
String qPath = "/dedicated/server/{serviceName}/features/backupCloud";
StringBuilder sb = path(qPath, serviceName);
HashMap<String, Object>o = new HashMap<String, ... | [
"public",
"OvhBackupCloud",
"serviceName_features_backupCloud_POST",
"(",
"String",
"serviceName",
",",
"String",
"cloudProjectId",
",",
"String",
"projectDescription",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/{serviceName}/features/backup... | Create a new storage backup space associated to server
REST: POST /dedicated/server/{serviceName}/features/backupCloud
@param projectDescription [required] Project description of the project to be created (ignored when an existing project is already specified)
@param cloudProjectId [required] cloud project id
@param s... | [
"Create",
"a",
"new",
"storage",
"backup",
"space",
"associated",
"to",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L778-L786 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/PmiRegistry.java | PmiRegistry.getStats | private static StatsImpl getStats(ModuleItem moduleItem, boolean recursive) {
// Note: cannot retrieve single data for JMX interface
//int[] dataIds = msd.getDataIds();
if (moduleItem == null) { // not found
return null;
}
return moduleItem.getStats(recursive);
... | java | private static StatsImpl getStats(ModuleItem moduleItem, boolean recursive) {
// Note: cannot retrieve single data for JMX interface
//int[] dataIds = msd.getDataIds();
if (moduleItem == null) { // not found
return null;
}
return moduleItem.getStats(recursive);
... | [
"private",
"static",
"StatsImpl",
"getStats",
"(",
"ModuleItem",
"moduleItem",
",",
"boolean",
"recursive",
")",
"{",
"// Note: cannot retrieve single data for JMX interface",
"//int[] dataIds = msd.getDataIds();",
"if",
"(",
"moduleItem",
"==",
"null",
")",
"{",
"// not fo... | /*
// Return a StatsImpl for server data
// Take a boolean parameter for two modes: recursive and non-recursive
private static StatsImpl getServer(boolean recursive)
{
// Note: there is no data under directly under server module tree root,
// so return null if not recursive
if(!recursive) return null;
ModuleItem[] modI... | [
"/",
"*",
"//",
"Return",
"a",
"StatsImpl",
"for",
"server",
"data",
"//",
"Take",
"a",
"boolean",
"parameter",
"for",
"two",
"modes",
":",
"recursive",
"and",
"non",
"-",
"recursive",
"private",
"static",
"StatsImpl",
"getServer",
"(",
"boolean",
"recursive... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/server/PmiRegistry.java#L559-L578 |
micronaut-projects/micronaut-core | core/src/main/java/io/micronaut/core/util/StringUtils.java | StringUtils.prependUri | public static String prependUri(String baseUri, String uri) {
if (!uri.startsWith("/")) {
uri = "/" + uri;
}
if (uri.length() == 1 && uri.charAt(0) == '/') {
uri = "";
}
uri = baseUri + uri;
return uri.replaceAll("[\\/]{2,}", "/");
} | java | public static String prependUri(String baseUri, String uri) {
if (!uri.startsWith("/")) {
uri = "/" + uri;
}
if (uri.length() == 1 && uri.charAt(0) == '/') {
uri = "";
}
uri = baseUri + uri;
return uri.replaceAll("[\\/]{2,}", "/");
} | [
"public",
"static",
"String",
"prependUri",
"(",
"String",
"baseUri",
",",
"String",
"uri",
")",
"{",
"if",
"(",
"!",
"uri",
".",
"startsWith",
"(",
"\"/\"",
")",
")",
"{",
"uri",
"=",
"\"/\"",
"+",
"uri",
";",
"}",
"if",
"(",
"uri",
".",
"length",... | Prepends a partial uri and normalizes / characters.
For example, if the base uri is "/foo/" and the uri
is "/bar/", the output will be "/foo/bar/". Similarly
if the base uri is "/foo" and the uri is "bar", the
output will be "/foo/bar"
@param baseUri The uri to prepend. Eg. /foo
@param uri The uri to combine with the ... | [
"Prepends",
"a",
"partial",
"uri",
"and",
"normalizes",
"/",
"characters",
".",
"For",
"example",
"if",
"the",
"base",
"uri",
"is",
"/",
"foo",
"/",
"and",
"the",
"uri",
"is",
"/",
"bar",
"/",
"the",
"output",
"will",
"be",
"/",
"foo",
"/",
"bar",
... | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/core/src/main/java/io/micronaut/core/util/StringUtils.java#L255-L264 |
Azure/azure-sdk-for-java | resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java | ResourcesInner.moveResources | public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().body();
} | java | public void moveResources(String sourceResourceGroupName, ResourcesMoveInfo parameters) {
moveResourcesWithServiceResponseAsync(sourceResourceGroupName, parameters).toBlocking().last().body();
} | [
"public",
"void",
"moveResources",
"(",
"String",
"sourceResourceGroupName",
",",
"ResourcesMoveInfo",
"parameters",
")",
"{",
"moveResourcesWithServiceResponseAsync",
"(",
"sourceResourceGroupName",
",",
"parameters",
")",
".",
"toBlocking",
"(",
")",
".",
"last",
"(",... | Moves resources from one resource group to another resource group.
The resources to move must be in the same source resource group. The target resource group may be in a different subscription. When moving resources, both the source group and the target group are locked for the duration of the operation. Write and dele... | [
"Moves",
"resources",
"from",
"one",
"resource",
"group",
"to",
"another",
"resource",
"group",
".",
"The",
"resources",
"to",
"move",
"must",
"be",
"in",
"the",
"same",
"source",
"resource",
"group",
".",
"The",
"target",
"resource",
"group",
"may",
"be",
... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/resources/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/resources/v2018_02_01/implementation/ResourcesInner.java#L418-L420 |
spring-projects/spring-data-solr | src/main/java/org/springframework/data/solr/core/DefaultQueryParser.java | DefaultQueryParser.doConstructSolrQuery | @Override
public final SolrQuery doConstructSolrQuery(SolrDataQuery query, @Nullable Class<?> domainType) {
Assert.notNull(query, "Cannot construct solrQuery from null value.");
Assert.notNull(query.getCriteria(), "Query has to have a criteria.");
SolrQuery solrQuery = new SolrQuery();
solrQuery.setParam(Com... | java | @Override
public final SolrQuery doConstructSolrQuery(SolrDataQuery query, @Nullable Class<?> domainType) {
Assert.notNull(query, "Cannot construct solrQuery from null value.");
Assert.notNull(query.getCriteria(), "Query has to have a criteria.");
SolrQuery solrQuery = new SolrQuery();
solrQuery.setParam(Com... | [
"@",
"Override",
"public",
"final",
"SolrQuery",
"doConstructSolrQuery",
"(",
"SolrDataQuery",
"query",
",",
"@",
"Nullable",
"Class",
"<",
"?",
">",
"domainType",
")",
"{",
"Assert",
".",
"notNull",
"(",
"query",
",",
"\"Cannot construct solrQuery from null value.\... | Convert given Query into a SolrQuery executable via {@link org.apache.solr.client.solrj.SolrClient}
@param query the source query to turn into a {@link SolrQuery}.
@param domainType can be {@literal null}.
@return | [
"Convert",
"given",
"Query",
"into",
"a",
"SolrQuery",
"executable",
"via",
"{",
"@link",
"org",
".",
"apache",
".",
"solr",
".",
"client",
".",
"solrj",
".",
"SolrClient",
"}"
] | train | https://github.com/spring-projects/spring-data-solr/blob/20be5cb82498b70134dfda6c1a91ad21f8e657e0/src/main/java/org/springframework/data/solr/core/DefaultQueryParser.java#L89-L111 |
citrusframework/citrus | modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java | ReceiveMessageBuilder.extractFromHeader | public T extractFromHeader(String headerName, String variable) {
if (headerExtractor == null) {
headerExtractor = new MessageHeaderVariableExtractor();
getAction().getVariableExtractors().add(headerExtractor);
}
headerExtractor.getHeaderMappings().put(headerName... | java | public T extractFromHeader(String headerName, String variable) {
if (headerExtractor == null) {
headerExtractor = new MessageHeaderVariableExtractor();
getAction().getVariableExtractors().add(headerExtractor);
}
headerExtractor.getHeaderMappings().put(headerName... | [
"public",
"T",
"extractFromHeader",
"(",
"String",
"headerName",
",",
"String",
"variable",
")",
"{",
"if",
"(",
"headerExtractor",
"==",
"null",
")",
"{",
"headerExtractor",
"=",
"new",
"MessageHeaderVariableExtractor",
"(",
")",
";",
"getAction",
"(",
")",
"... | Extract message header entry as variable.
@param headerName
@param variable
@return | [
"Extract",
"message",
"header",
"entry",
"as",
"variable",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/ReceiveMessageBuilder.java#L778-L787 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.