repository_name stringlengths 7 54 | func_path_in_repository stringlengths 18 196 | func_name stringlengths 7 107 | whole_func_string stringlengths 76 3.82k | language stringclasses 1
value | func_code_string stringlengths 76 3.82k | func_code_tokens listlengths 22 717 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 508 | split_name stringclasses 1
value | func_code_url stringlengths 111 310 |
|---|---|---|---|---|---|---|---|---|---|---|
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java | EJBMDOrchestrator.getWrapperProxyClassLoader | private ClassLoader getWrapperProxyClassLoader(BeanMetaData bmd, Class<?> intf) // F58064
throws EJBConfigurationException {
// Wrapper proxies are intended to support application restart scenarios.
// In order to allow GC of the target EJB class loader when the
// applicatio... | java | private ClassLoader getWrapperProxyClassLoader(BeanMetaData bmd, Class<?> intf) // F58064
throws EJBConfigurationException {
// Wrapper proxies are intended to support application restart scenarios.
// In order to allow GC of the target EJB class loader when the
// applicatio... | [
"private",
"ClassLoader",
"getWrapperProxyClassLoader",
"(",
"BeanMetaData",
"bmd",
",",
"Class",
"<",
"?",
">",
"intf",
")",
"// F58064",
"throws",
"EJBConfigurationException",
"{",
"// Wrapper proxies are intended to support application restart scenarios.",
"// In order to allo... | Returns a class loader that can be used to define a proxy for the
specified interface.
@param bmd the bean metadata
@param intf the interface to proxy
@return the loader
@throws EJBConfigurationException | [
"Returns",
"a",
"class",
"loader",
"that",
"can",
"be",
"used",
"to",
"define",
"a",
"proxy",
"for",
"the",
"specified",
"interface",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java#L4453-L4495 |
lodborg/interval-tree | src/main/java/com/lodborg/intervaltree/Interval.java | Interval.isLeftOf | public boolean isLeftOf(T point, boolean inclusive){
if (point == null || end == null)
return false;
int compare = point.compareTo(end);
if (compare != 0)
return compare > 0;
return !isEndInclusive() || !inclusive;
} | java | public boolean isLeftOf(T point, boolean inclusive){
if (point == null || end == null)
return false;
int compare = point.compareTo(end);
if (compare != 0)
return compare > 0;
return !isEndInclusive() || !inclusive;
} | [
"public",
"boolean",
"isLeftOf",
"(",
"T",
"point",
",",
"boolean",
"inclusive",
")",
"{",
"if",
"(",
"point",
"==",
"null",
"||",
"end",
"==",
"null",
")",
"return",
"false",
";",
"int",
"compare",
"=",
"point",
".",
"compareTo",
"(",
"end",
")",
";... | This method checks, if this current interval is entirely to the left of a point. More formally,
the method will return {@code true}, if for every point {@code x} from the current interval the inequality
{@code x} < {@code point} holds. If the parameter {@code inclusive} is set to {@code false}, this
method will retu... | [
"This",
"method",
"checks",
"if",
"this",
"current",
"interval",
"is",
"entirely",
"to",
"the",
"left",
"of",
"a",
"point",
".",
"More",
"formally",
"the",
"method",
"will",
"return",
"{",
"@code",
"true",
"}",
"if",
"for",
"every",
"point",
"{",
"@code"... | train | https://github.com/lodborg/interval-tree/blob/716b18fb0a5a53c9add9926176bc263f14c9bf90/src/main/java/com/lodborg/intervaltree/Interval.java#L434-L441 |
google/closure-templates | java/src/com/google/template/soy/jssrc/internal/JsRuntime.java | JsRuntime.extensionField | public static Expression extensionField(FieldDescriptor desc) {
String jsExtensionImport = ProtoUtils.getJsExtensionImport(desc);
String jsExtensionName = ProtoUtils.getJsExtensionName(desc);
return symbolWithNamespace(jsExtensionImport, jsExtensionName);
} | java | public static Expression extensionField(FieldDescriptor desc) {
String jsExtensionImport = ProtoUtils.getJsExtensionImport(desc);
String jsExtensionName = ProtoUtils.getJsExtensionName(desc);
return symbolWithNamespace(jsExtensionImport, jsExtensionName);
} | [
"public",
"static",
"Expression",
"extensionField",
"(",
"FieldDescriptor",
"desc",
")",
"{",
"String",
"jsExtensionImport",
"=",
"ProtoUtils",
".",
"getJsExtensionImport",
"(",
"desc",
")",
";",
"String",
"jsExtensionName",
"=",
"ProtoUtils",
".",
"getJsExtensionName... | Returns the field containing the extension object for the given field descriptor. | [
"Returns",
"the",
"field",
"containing",
"the",
"extension",
"object",
"for",
"the",
"given",
"field",
"descriptor",
"."
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jssrc/internal/JsRuntime.java#L179-L183 |
Azure/azure-sdk-for-java | compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachinesInner.java | VirtualMachinesInner.beginUpdate | public VirtualMachineInner beginUpdate(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body();
} | java | public VirtualMachineInner beginUpdate(String resourceGroupName, String vmName, VirtualMachineUpdate parameters) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, vmName, parameters).toBlocking().single().body();
} | [
"public",
"VirtualMachineInner",
"beginUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"vmName",
",",
"VirtualMachineUpdate",
"parameters",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vmName",
",",
"parameters",
"... | The operation to update a virtual machine.
@param resourceGroupName The name of the resource group.
@param vmName The name of the virtual machine.
@param parameters Parameters supplied to the Update Virtual Machine operation.
@throws IllegalArgumentException thrown if parameters fail the validation
@throws CloudExcept... | [
"The",
"operation",
"to",
"update",
"a",
"virtual",
"machine",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/compute/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/compute/v2017_12_01/implementation/VirtualMachinesInner.java#L809-L811 |
Azure/azure-sdk-for-java | recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultCertificatesInner.java | VaultCertificatesInner.createAsync | public Observable<VaultCertificateResponseInner> createAsync(String resourceGroupName, String vaultName, String certificateName) {
return createWithServiceResponseAsync(resourceGroupName, vaultName, certificateName).map(new Func1<ServiceResponse<VaultCertificateResponseInner>, VaultCertificateResponseInner>() {... | java | public Observable<VaultCertificateResponseInner> createAsync(String resourceGroupName, String vaultName, String certificateName) {
return createWithServiceResponseAsync(resourceGroupName, vaultName, certificateName).map(new Func1<ServiceResponse<VaultCertificateResponseInner>, VaultCertificateResponseInner>() {... | [
"public",
"Observable",
"<",
"VaultCertificateResponseInner",
">",
"createAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"vaultName",
",",
"String",
"certificateName",
")",
"{",
"return",
"createWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"vaultN... | Uploads a certificate for a resource.
@param resourceGroupName The name of the resource group where the recovery services vault is present.
@param vaultName The name of the recovery services vault.
@param certificateName Certificate friendly name.
@throws IllegalArgumentException thrown if parameters fail the validati... | [
"Uploads",
"a",
"certificate",
"for",
"a",
"resource",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/recoveryservices/resource-manager/v2016_06_01/src/main/java/com/microsoft/azure/management/recoveryservices/v2016_06_01/implementation/VaultCertificatesInner.java#L102-L109 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java | ServiceEndpointPoliciesInner.beginCreateOrUpdateAsync | public Observable<ServiceEndpointPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1<ServiceResponse<S... | java | public Observable<ServiceEndpointPolicyInner> beginCreateOrUpdateAsync(String resourceGroupName, String serviceEndpointPolicyName, ServiceEndpointPolicyInner parameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, serviceEndpointPolicyName, parameters).map(new Func1<ServiceResponse<S... | [
"public",
"Observable",
"<",
"ServiceEndpointPolicyInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serviceEndpointPolicyName",
",",
"ServiceEndpointPolicyInner",
"parameters",
")",
"{",
"return",
"beginCreateOrUpdateWithServiceResponse... | Creates or updates a service Endpoint Policies.
@param resourceGroupName The name of the resource group.
@param serviceEndpointPolicyName The name of the service endpoint policy.
@param parameters Parameters supplied to the create or update service endpoint policy operation.
@throws IllegalArgumentException thrown if ... | [
"Creates",
"or",
"updates",
"a",
"service",
"Endpoint",
"Policies",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/ServiceEndpointPoliciesInner.java#L546-L553 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FixDependencyChecker.java | FixDependencyChecker.isToBeUninstalled | public boolean isToBeUninstalled(String name, List<UninstallAsset> list) {
for (UninstallAsset asset : list) {
String fixName = asset.getIFixInfo().getId();
if (fixName != null && fixName.equals(name)) {
return true;
}
}
return false;
} | java | public boolean isToBeUninstalled(String name, List<UninstallAsset> list) {
for (UninstallAsset asset : list) {
String fixName = asset.getIFixInfo().getId();
if (fixName != null && fixName.equals(name)) {
return true;
}
}
return false;
} | [
"public",
"boolean",
"isToBeUninstalled",
"(",
"String",
"name",
",",
"List",
"<",
"UninstallAsset",
">",
"list",
")",
"{",
"for",
"(",
"UninstallAsset",
"asset",
":",
"list",
")",
"{",
"String",
"fixName",
"=",
"asset",
".",
"getIFixInfo",
"(",
")",
".",
... | Verify the name is on the uninstall list
@param name symbolic name of the fix
@param list list of the uninstalling fix
@return true if the feature is going to be uninstalled, otherwise, return false. | [
"Verify",
"the",
"name",
"is",
"on",
"the",
"uninstall",
"list"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/FixDependencyChecker.java#L99-L107 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/UserMetadata.java | UserMetadata.isFieldProtected | public static boolean isFieldProtected(FormModel formModel, String fieldName) {
FieldMetadata metaData = formModel.getFieldMetadata(fieldName);
return Boolean.TRUE.equals(metaData.getUserMetadata(UserMetadata.PROTECTED_FIELD));
} | java | public static boolean isFieldProtected(FormModel formModel, String fieldName) {
FieldMetadata metaData = formModel.getFieldMetadata(fieldName);
return Boolean.TRUE.equals(metaData.getUserMetadata(UserMetadata.PROTECTED_FIELD));
} | [
"public",
"static",
"boolean",
"isFieldProtected",
"(",
"FormModel",
"formModel",
",",
"String",
"fieldName",
")",
"{",
"FieldMetadata",
"metaData",
"=",
"formModel",
".",
"getFieldMetadata",
"(",
"fieldName",
")",
";",
"return",
"Boolean",
".",
"TRUE",
".",
"eq... | tests if the usermetadata of the field has a boolean value true for the key {@value #PROTECTED_FIELD}
@param fieldName
the fieldname
@return true if the field is protected, otherwise false | [
"tests",
"if",
"the",
"usermetadata",
"of",
"the",
"field",
"has",
"a",
"boolean",
"value",
"true",
"for",
"the",
"key",
"{",
"@value",
"#PROTECTED_FIELD",
"}"
] | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/binding/form/support/UserMetadata.java#L44-L47 |
ZuInnoTe/hadoopcryptoledger | inputformat/src/main/java/org/zuinnote/hadoop/namecoin/format/common/NamecoinUtil.java | NamecoinUtil.extractNamecoinField | public static String[] extractNamecoinField(byte[] scriptPubKey) {
// check if valid script
if ((scriptPubKey==null) || (scriptPubKey.length<2)) {
return null;
}
// only firstupdate and update work
if (!((scriptPubKey[0]==NamecoinUtil.OP_NAME_UDPATE)|| (scriptPubKey[0]==NamecoinUtil.OP_NAME_FIRSTUPDATE... | java | public static String[] extractNamecoinField(byte[] scriptPubKey) {
// check if valid script
if ((scriptPubKey==null) || (scriptPubKey.length<2)) {
return null;
}
// only firstupdate and update work
if (!((scriptPubKey[0]==NamecoinUtil.OP_NAME_UDPATE)|| (scriptPubKey[0]==NamecoinUtil.OP_NAME_FIRSTUPDATE... | [
"public",
"static",
"String",
"[",
"]",
"extractNamecoinField",
"(",
"byte",
"[",
"]",
"scriptPubKey",
")",
"{",
"// check if valid script",
"if",
"(",
"(",
"scriptPubKey",
"==",
"null",
")",
"||",
"(",
"scriptPubKey",
".",
"length",
"<",
"2",
")",
")",
"{... | Extracts a Namecoin field name (String) and value field (a JSON object) from a script. Please note that not all Namecoin transactions do contain Namecoin fields, some are coinbase (ie mining) transactions and others are regular transactions to transfer Namecoins (comparable to Bitcoin transactions=
Additionally, you ca... | [
"Extracts",
"a",
"Namecoin",
"field",
"name",
"(",
"String",
")",
"and",
"value",
"field",
"(",
"a",
"JSON",
"object",
")",
"from",
"a",
"script",
".",
"Please",
"note",
"that",
"not",
"all",
"Namecoin",
"transactions",
"do",
"contain",
"Namecoin",
"fields... | train | https://github.com/ZuInnoTe/hadoopcryptoledger/blob/5c9bfb61dd1a82374cd0de8413a7c66391ee4414/inputformat/src/main/java/org/zuinnote/hadoop/namecoin/format/common/NamecoinUtil.java#L53-L88 |
zerodhatech/javakiteconnect | kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java | KiteRequestHandler.createGetRequest | public Request createGetRequest(String url, String apiKey, String accessToken) {
HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder();
return new Request.Builder().url(httpBuilder.build()).header("User-Agent", USER_AGENT).header("X-Kite-Version", "3").header("Authorization", "token "+apiKey+":"... | java | public Request createGetRequest(String url, String apiKey, String accessToken) {
HttpUrl.Builder httpBuilder = HttpUrl.parse(url).newBuilder();
return new Request.Builder().url(httpBuilder.build()).header("User-Agent", USER_AGENT).header("X-Kite-Version", "3").header("Authorization", "token "+apiKey+":"... | [
"public",
"Request",
"createGetRequest",
"(",
"String",
"url",
",",
"String",
"apiKey",
",",
"String",
"accessToken",
")",
"{",
"HttpUrl",
".",
"Builder",
"httpBuilder",
"=",
"HttpUrl",
".",
"parse",
"(",
"url",
")",
".",
"newBuilder",
"(",
")",
";",
"retu... | Creates a GET request.
@param url is the endpoint to which request has to be done.
@param apiKey is the api key of the Kite Connect app.
@param accessToken is the access token obtained after successful login process. | [
"Creates",
"a",
"GET",
"request",
"."
] | train | https://github.com/zerodhatech/javakiteconnect/blob/4a3f15ff2c8a1b3b6ec61799f8bb047e4dfeb92d/kiteconnect/src/com/zerodhatech/kiteconnect/kitehttp/KiteRequestHandler.java#L158-L161 |
netty/netty | buffer/src/main/java/io/netty/buffer/ByteBufUtil.java | ByteBufUtil.getBytes | public static byte[] getBytes(ByteBuf buf, int start, int length) {
return getBytes(buf, start, length, true);
} | java | public static byte[] getBytes(ByteBuf buf, int start, int length) {
return getBytes(buf, start, length, true);
} | [
"public",
"static",
"byte",
"[",
"]",
"getBytes",
"(",
"ByteBuf",
"buf",
",",
"int",
"start",
",",
"int",
"length",
")",
"{",
"return",
"getBytes",
"(",
"buf",
",",
"start",
",",
"length",
",",
"true",
")",
";",
"}"
] | Create a copy of the underlying storage from {@code buf} into a byte array.
The copy will start at {@code start} and copy {@code length} bytes. | [
"Create",
"a",
"copy",
"of",
"the",
"underlying",
"storage",
"from",
"{"
] | train | https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/buffer/src/main/java/io/netty/buffer/ByteBufUtil.java#L829-L831 |
DiUS/pact-jvm | pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java | PactDslRequestWithoutPath.queryParameterFromProviderState | public PactDslRequestWithoutPath queryParameterFromProviderState(String name, String expression, String example) {
requestGenerators.addGenerator(Category.QUERY, name, new ProviderStateGenerator(expression));
query.put(name, Collections.singletonList(example));
return this;
} | java | public PactDslRequestWithoutPath queryParameterFromProviderState(String name, String expression, String example) {
requestGenerators.addGenerator(Category.QUERY, name, new ProviderStateGenerator(expression));
query.put(name, Collections.singletonList(example));
return this;
} | [
"public",
"PactDslRequestWithoutPath",
"queryParameterFromProviderState",
"(",
"String",
"name",
",",
"String",
"expression",
",",
"String",
"example",
")",
"{",
"requestGenerators",
".",
"addGenerator",
"(",
"Category",
".",
"QUERY",
",",
"name",
",",
"new",
"Provi... | Adds a query parameter that will have it's value injected from the provider state
@param name Name
@param expression Expression to be evaluated from the provider state
@param example Example value to use in the consumer test | [
"Adds",
"a",
"query",
"parameter",
"that",
"will",
"have",
"it",
"s",
"value",
"injected",
"from",
"the",
"provider",
"state"
] | train | https://github.com/DiUS/pact-jvm/blob/2f447e9dd4ac152a6a36b7fcf8962d07de9ef3ef/pact-jvm-consumer/src/main/java/au/com/dius/pact/consumer/dsl/PactDslRequestWithoutPath.java#L308-L312 |
lucee/Lucee | core/src/main/java/lucee/transformer/bytecode/op/OpDecision.java | OpDecision.toExprBoolean | public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
return new OpDecision(left, right, operation);
} | java | public static ExprBoolean toExprBoolean(Expression left, Expression right, int operation) {
return new OpDecision(left, right, operation);
} | [
"public",
"static",
"ExprBoolean",
"toExprBoolean",
"(",
"Expression",
"left",
",",
"Expression",
"right",
",",
"int",
"operation",
")",
"{",
"return",
"new",
"OpDecision",
"(",
"left",
",",
"right",
",",
"operation",
")",
";",
"}"
] | Create a String expression from a operation
@param left
@param right
@return String expression | [
"Create",
"a",
"String",
"expression",
"from",
"a",
"operation"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/transformer/bytecode/op/OpDecision.java#L67-L69 |
google/error-prone-javac | src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java | ClassReader.enterTypevars | protected void enterTypevars(Symbol sym, Type t) {
if (t.getEnclosingType() != null) {
if (!t.getEnclosingType().hasTag(TypeTag.NONE)) {
enterTypevars(sym.owner, t.getEnclosingType());
}
} else if (sym.kind == MTH && !sym.isStatic()) {
enterTypevars(sy... | java | protected void enterTypevars(Symbol sym, Type t) {
if (t.getEnclosingType() != null) {
if (!t.getEnclosingType().hasTag(TypeTag.NONE)) {
enterTypevars(sym.owner, t.getEnclosingType());
}
} else if (sym.kind == MTH && !sym.isStatic()) {
enterTypevars(sy... | [
"protected",
"void",
"enterTypevars",
"(",
"Symbol",
"sym",
",",
"Type",
"t",
")",
"{",
"if",
"(",
"t",
".",
"getEnclosingType",
"(",
")",
"!=",
"null",
")",
"{",
"if",
"(",
"!",
"t",
".",
"getEnclosingType",
"(",
")",
".",
"hasTag",
"(",
"TypeTag",
... | Enter type variables of this classtype and all enclosing ones in
`typevars'. | [
"Enter",
"type",
"variables",
"of",
"this",
"classtype",
"and",
"all",
"enclosing",
"ones",
"in",
"typevars",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/jvm/ClassReader.java#L2543-L2554 |
ineunetOS/knife-commons | knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java | StringUtils.indexOf | public static int indexOf(String str, String searchStr, int startPos) {
if (str == null || searchStr == null) {
return INDEX_NOT_FOUND;
}
// JDK1.2/JDK1.3 have a bug, when startPos > str.length for "", hence
if (searchStr.length() == 0 && startPos >= str.length()) {
... | java | public static int indexOf(String str, String searchStr, int startPos) {
if (str == null || searchStr == null) {
return INDEX_NOT_FOUND;
}
// JDK1.2/JDK1.3 have a bug, when startPos > str.length for "", hence
if (searchStr.length() == 0 && startPos >= str.length()) {
... | [
"public",
"static",
"int",
"indexOf",
"(",
"String",
"str",
",",
"String",
"searchStr",
",",
"int",
"startPos",
")",
"{",
"if",
"(",
"str",
"==",
"null",
"||",
"searchStr",
"==",
"null",
")",
"{",
"return",
"INDEX_NOT_FOUND",
";",
"}",
"// JDK1.2/JDK1.3 ha... | <p>Finds the first index within a String, handling <code>null</code>.
This method uses {@link String#indexOf(String, int)}.</p>
<p>A <code>null</code> String will return <code>-1</code>.
A negative start position is treated as zero.
An empty ("") search String always matches.
A start position greater than the string l... | [
"<p",
">",
"Finds",
"the",
"first",
"index",
"within",
"a",
"String",
"handling",
"<code",
">",
"null<",
"/",
"code",
">",
".",
"This",
"method",
"uses",
"{",
"@link",
"String#indexOf",
"(",
"String",
"int",
")",
"}",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/ineunetOS/knife-commons/blob/eae9e59afa020a00ae8977c10d43ac8ae46ae236/knife-commons-utils/src/main/java/com/ineunet/knife/util/StringUtils.java#L852-L861 |
arquillian/arquillian-extension-warp | impl/src/main/java/org/jboss/arquillian/warp/impl/utils/URLUtils.java | URLUtils.buildUrl | public static URL buildUrl(String context, String... relocations) {
try {
return buildUrl(new URL(context), relocations);
} catch (MalformedURLException e) {
throw new AssertionError("URL('" + context + "') isn't valid URL");
}
} | java | public static URL buildUrl(String context, String... relocations) {
try {
return buildUrl(new URL(context), relocations);
} catch (MalformedURLException e) {
throw new AssertionError("URL('" + context + "') isn't valid URL");
}
} | [
"public",
"static",
"URL",
"buildUrl",
"(",
"String",
"context",
",",
"String",
"...",
"relocations",
")",
"{",
"try",
"{",
"return",
"buildUrl",
"(",
"new",
"URL",
"(",
"context",
")",
",",
"relocations",
")",
";",
"}",
"catch",
"(",
"MalformedURLExceptio... | Use URL context and one or more relocations to build end URL.
@param context first URL used like a context root for all relocation changes
@param relocations array of relocation URLs
@return end url after all changes made on context with relocations
@throws AssertionError when context or some of relocations are ma... | [
"Use",
"URL",
"context",
"and",
"one",
"or",
"more",
"relocations",
"to",
"build",
"end",
"URL",
"."
] | train | https://github.com/arquillian/arquillian-extension-warp/blob/e958f4d782851baf7f40e39835d3d1ad185b74dd/impl/src/main/java/org/jboss/arquillian/warp/impl/utils/URLUtils.java#L40-L46 |
infinispan/infinispan | core/src/main/java/org/infinispan/util/concurrent/locks/StripedLock.java | StripedLock.acquireLock | public void acquireLock(Object key, boolean exclusive) {
ReentrantReadWriteLock lock = getLock(key);
if (exclusive) {
lock.writeLock().lock();
if (trace) log.tracef("WL acquired for '%s'", key);
} else {
lock.readLock().lock();
if (trace) log.tracef("RL acquired for... | java | public void acquireLock(Object key, boolean exclusive) {
ReentrantReadWriteLock lock = getLock(key);
if (exclusive) {
lock.writeLock().lock();
if (trace) log.tracef("WL acquired for '%s'", key);
} else {
lock.readLock().lock();
if (trace) log.tracef("RL acquired for... | [
"public",
"void",
"acquireLock",
"(",
"Object",
"key",
",",
"boolean",
"exclusive",
")",
"{",
"ReentrantReadWriteLock",
"lock",
"=",
"getLock",
"(",
"key",
")",
";",
"if",
"(",
"exclusive",
")",
"{",
"lock",
".",
"writeLock",
"(",
")",
".",
"lock",
"(",
... | Blocks until a lock is acquired.
@param exclusive if true, a write (exclusive) lock is attempted, otherwise a read (shared) lock is used. | [
"Blocks",
"until",
"a",
"lock",
"is",
"acquired",
"."
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/util/concurrent/locks/StripedLock.java#L74-L83 |
LearnLib/learnlib | algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/BlockList.java | BlockList.insertBlock | public void insertBlock(AbstractBaseDTNode<I, D> blockRoot) {
blockRoot.removeFromBlockList();
blockRoot.setNextElement(next);
if (getNextElement() != null) {
next.setPrevElement(blockRoot);
}
blockRoot.setPrevElement(this);
next = blockRoot;
} | java | public void insertBlock(AbstractBaseDTNode<I, D> blockRoot) {
blockRoot.removeFromBlockList();
blockRoot.setNextElement(next);
if (getNextElement() != null) {
next.setPrevElement(blockRoot);
}
blockRoot.setPrevElement(this);
next = blockRoot;
} | [
"public",
"void",
"insertBlock",
"(",
"AbstractBaseDTNode",
"<",
"I",
",",
"D",
">",
"blockRoot",
")",
"{",
"blockRoot",
".",
"removeFromBlockList",
"(",
")",
";",
"blockRoot",
".",
"setNextElement",
"(",
"next",
")",
";",
"if",
"(",
"getNextElement",
"(",
... | Inserts a block into the list. Currently, the block is inserted at the head of the list. However, callers should
not rely on this.
@param blockRoot
the root node of the block to be inserted | [
"Inserts",
"a",
"block",
"into",
"the",
"list",
".",
"Currently",
"the",
"block",
"is",
"inserted",
"at",
"the",
"head",
"of",
"the",
"list",
".",
"However",
"callers",
"should",
"not",
"rely",
"on",
"this",
"."
] | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/algorithms/active/ttt/src/main/java/de/learnlib/algorithms/ttt/base/BlockList.java#L38-L47 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java | ModulusSubstitution.doSubstitution | public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) {
// if this isn't a >>> substitution, just use the inherited version
// of this function (which uses either a rule set or a DecimalFormat
// to format its substitution value)
if (ruleTo... | java | public void doSubstitution(long number, StringBuilder toInsertInto, int position, int recursionCount) {
// if this isn't a >>> substitution, just use the inherited version
// of this function (which uses either a rule set or a DecimalFormat
// to format its substitution value)
if (ruleTo... | [
"public",
"void",
"doSubstitution",
"(",
"long",
"number",
",",
"StringBuilder",
"toInsertInto",
",",
"int",
"position",
",",
"int",
"recursionCount",
")",
"{",
"// if this isn't a >>> substitution, just use the inherited version",
"// of this function (which uses either a rule s... | If this is a >>> substitution, use ruleToUse to fill in
the substitution. Otherwise, just use the superclass function.
@param number The number being formatted
@param toInsertInto The string to insert the result of this substitution
into
@param position The position of the rule text in toInsertInto | [
"If",
"this",
"is",
"a",
">",
";",
">",
";",
">",
";",
"substitution",
"use",
"ruleToUse",
"to",
"fill",
"in",
"the",
"substitution",
".",
"Otherwise",
"just",
"use",
"the",
"superclass",
"function",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/NFSubstitution.java#L879-L892 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/context/DefaultBeanContext.java | DefaultBeanContext.getActiveBeanRegistration | @Nullable
protected <T> BeanRegistration<T> getActiveBeanRegistration(BeanDefinition<T> beanDefinition, Qualifier qualifier) {
if (beanDefinition == null) {
return null;
}
return singletonObjects.get(new BeanKey(beanDefinition, qualifier));
} | java | @Nullable
protected <T> BeanRegistration<T> getActiveBeanRegistration(BeanDefinition<T> beanDefinition, Qualifier qualifier) {
if (beanDefinition == null) {
return null;
}
return singletonObjects.get(new BeanKey(beanDefinition, qualifier));
} | [
"@",
"Nullable",
"protected",
"<",
"T",
">",
"BeanRegistration",
"<",
"T",
">",
"getActiveBeanRegistration",
"(",
"BeanDefinition",
"<",
"T",
">",
"beanDefinition",
",",
"Qualifier",
"qualifier",
")",
"{",
"if",
"(",
"beanDefinition",
"==",
"null",
")",
"{",
... | Find an active {@link javax.inject.Singleton} bean for the given definition and qualifier.
@param beanDefinition The bean definition
@param qualifier The qualifier
@param <T> The bean generic type
@return The bean registration | [
"Find",
"an",
"active",
"{",
"@link",
"javax",
".",
"inject",
".",
"Singleton",
"}",
"bean",
"for",
"the",
"given",
"definition",
"and",
"qualifier",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/context/DefaultBeanContext.java#L787-L793 |
Azure/azure-sdk-for-java | sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java | SyncMembersInner.refreshMemberSchema | public void refreshMemberSchema(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
refreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).toBlocking().last().body();
} | java | public void refreshMemberSchema(String resourceGroupName, String serverName, String databaseName, String syncGroupName, String syncMemberName) {
refreshMemberSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName, syncMemberName).toBlocking().last().body();
} | [
"public",
"void",
"refreshMemberSchema",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
",",
"String",
"syncMemberName",
")",
"{",
"refreshMemberSchemaWithServiceResponseAsync",
"(",
"resourc... | Refreshes a sync member database schema.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param databaseName The name of the database on which the sync group is hos... | [
"Refreshes",
"a",
"sync",
"member",
"database",
"schema",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2015_05_01_preview/src/main/java/com/microsoft/azure/management/sql/v2015_05_01_preview/implementation/SyncMembersInner.java#L1151-L1153 |
jcuda/jcuda | JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java | JCudaDriver.cuOccupancyMaxActiveBlocksPerMultiprocessor | public static int cuOccupancyMaxActiveBlocksPerMultiprocessor(int numBlocks[], CUfunction func, int blockSize, long dynamicSMemSize)
{
return checkResult(cuOccupancyMaxActiveBlocksPerMultiprocessorNative(numBlocks, func, blockSize, dynamicSMemSize));
} | java | public static int cuOccupancyMaxActiveBlocksPerMultiprocessor(int numBlocks[], CUfunction func, int blockSize, long dynamicSMemSize)
{
return checkResult(cuOccupancyMaxActiveBlocksPerMultiprocessorNative(numBlocks, func, blockSize, dynamicSMemSize));
} | [
"public",
"static",
"int",
"cuOccupancyMaxActiveBlocksPerMultiprocessor",
"(",
"int",
"numBlocks",
"[",
"]",
",",
"CUfunction",
"func",
",",
"int",
"blockSize",
",",
"long",
"dynamicSMemSize",
")",
"{",
"return",
"checkResult",
"(",
"cuOccupancyMaxActiveBlocksPerMultipr... | <code><pre>
\brief Returns occupancy of a function
Returns in \p *numBlocks the number of the maximum active blocks per
streaming multiprocessor.
\param numBlocks - Returned occupancy
\param func - Kernel for which occupancy is calulated
\param blockSize - Block size the kernel is intended to b... | [
"<code",
">",
"<pre",
">",
"\\",
"brief",
"Returns",
"occupancy",
"of",
"a",
"function"
] | train | https://github.com/jcuda/jcuda/blob/468528b5b9b37dfceb6ed83fcfd889e9b359f984/JCudaJava/src/main/java/jcuda/driver/JCudaDriver.java#L13055-L13058 |
jbundle/jbundle | model/base/src/main/java/org/jbundle/model/util/Util.java | Util.isNumeric | public static boolean isNumeric(String string, boolean bAllowFormatting)
{
if ((string == null) || (string.length() == 0))
return false;
boolean bIsNumeric = true;
for (int i = 0; i < string.length(); i++)
{
if (!Character.isDigit(string.charAt(i)))
... | java | public static boolean isNumeric(String string, boolean bAllowFormatting)
{
if ((string == null) || (string.length() == 0))
return false;
boolean bIsNumeric = true;
for (int i = 0; i < string.length(); i++)
{
if (!Character.isDigit(string.charAt(i)))
... | [
"public",
"static",
"boolean",
"isNumeric",
"(",
"String",
"string",
",",
"boolean",
"bAllowFormatting",
")",
"{",
"if",
"(",
"(",
"string",
"==",
"null",
")",
"||",
"(",
"string",
".",
"length",
"(",
")",
"==",
"0",
")",
")",
"return",
"false",
";",
... | Is this string a valid number?
@param string The string to check.
@return true if this string is a valid number (all characters numeric). | [
"Is",
"this",
"string",
"a",
"valid",
"number?"
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/model/base/src/main/java/org/jbundle/model/util/Util.java#L135-L150 |
jboss/jboss-el-api_spec | src/main/java/org/jboss/el/cache/FactoryFinderCache.java | FactoryFinderCache.addCacheEntry | public static void addCacheEntry(final ClassLoader classLoader, final String factoryId, final String factoryClassName) {
if (factoryClassName == null) {
CLASS_CACHE.put(new CacheKey(classLoader, factoryId), "");
} else {
CLASS_CACHE.put(new CacheKey(classLoader, factoryId), facto... | java | public static void addCacheEntry(final ClassLoader classLoader, final String factoryId, final String factoryClassName) {
if (factoryClassName == null) {
CLASS_CACHE.put(new CacheKey(classLoader, factoryId), "");
} else {
CLASS_CACHE.put(new CacheKey(classLoader, factoryId), facto... | [
"public",
"static",
"void",
"addCacheEntry",
"(",
"final",
"ClassLoader",
"classLoader",
",",
"final",
"String",
"factoryId",
",",
"final",
"String",
"factoryClassName",
")",
"{",
"if",
"(",
"factoryClassName",
"==",
"null",
")",
"{",
"CLASS_CACHE",
".",
"put",
... | Called by the container at deployment time to set the name of a given factory, to remove the need for the
implementation to look it up on every call.
@param classLoader The deployments class loader
@param factoryId The type of factory that is being recorded (at this stage only javax.el.ExpressionFactory ha... | [
"Called",
"by",
"the",
"container",
"at",
"deployment",
"time",
"to",
"set",
"the",
"name",
"of",
"a",
"given",
"factory",
"to",
"remove",
"the",
"need",
"for",
"the",
"implementation",
"to",
"look",
"it",
"up",
"on",
"every",
"call",
"."
] | train | https://github.com/jboss/jboss-el-api_spec/blob/4cef117cae3ccf9f76439845687a8d219ad2eb43/src/main/java/org/jboss/el/cache/FactoryFinderCache.java#L47-L53 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.executeCDCQueryAsync | public void executeCDCQueryAsync(List<? extends IEntity> entities, String changedSince, CallbackHandler callbackHandler) throws FMSException {
IntuitMessage intuitMessage = prepareCDCQuery(entities, changedSince);
//set callback handler
intuitMessage.getRequestElements().setCallbackHandler(call... | java | public void executeCDCQueryAsync(List<? extends IEntity> entities, String changedSince, CallbackHandler callbackHandler) throws FMSException {
IntuitMessage intuitMessage = prepareCDCQuery(entities, changedSince);
//set callback handler
intuitMessage.getRequestElements().setCallbackHandler(call... | [
"public",
"void",
"executeCDCQueryAsync",
"(",
"List",
"<",
"?",
"extends",
"IEntity",
">",
"entities",
",",
"String",
"changedSince",
",",
"CallbackHandler",
"callbackHandler",
")",
"throws",
"FMSException",
"{",
"IntuitMessage",
"intuitMessage",
"=",
"prepareCDCQuer... | Method to retrieve records for the given list of query in asynchronous fashion
@param entities the list of entities to be listed in the response
@param changedSince the date where the entities should be listed from the last changed date
@param callbackHandler
the callback handler
@throws FMSException | [
"Method",
"to",
"retrieve",
"records",
"for",
"the",
"given",
"list",
"of",
"query",
"in",
"asynchronous",
"fashion"
] | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L984-L992 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/GZIPOutputStream.java | GZIPOutputStream.writeShort | private void writeShort(int s, byte[] buf, int offset) throws IOException {
buf[offset] = (byte)(s & 0xff);
buf[offset + 1] = (byte)((s >> 8) & 0xff);
} | java | private void writeShort(int s, byte[] buf, int offset) throws IOException {
buf[offset] = (byte)(s & 0xff);
buf[offset + 1] = (byte)((s >> 8) & 0xff);
} | [
"private",
"void",
"writeShort",
"(",
"int",
"s",
",",
"byte",
"[",
"]",
"buf",
",",
"int",
"offset",
")",
"throws",
"IOException",
"{",
"buf",
"[",
"offset",
"]",
"=",
"(",
"byte",
")",
"(",
"s",
"&",
"0xff",
")",
";",
"buf",
"[",
"offset",
"+",... | /*
Writes short integer in Intel byte order to a byte array, starting
at a given offset | [
"/",
"*",
"Writes",
"short",
"integer",
"in",
"Intel",
"byte",
"order",
"to",
"a",
"byte",
"array",
"starting",
"at",
"a",
"given",
"offset"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/zip/GZIPOutputStream.java#L218-L221 |
elki-project/elki | elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java | GeneratorXMLDatabaseConnection.processElementStatic | private void processElementStatic(GeneratorMain gen, Node cur) {
String name = ((Element) cur).getAttribute(ATTR_NAME);
if(name == null) {
throw new AbortException("No cluster name given in specification file.");
}
ArrayList<double[]> points = new ArrayList<>();
// TODO: check for unknown att... | java | private void processElementStatic(GeneratorMain gen, Node cur) {
String name = ((Element) cur).getAttribute(ATTR_NAME);
if(name == null) {
throw new AbortException("No cluster name given in specification file.");
}
ArrayList<double[]> points = new ArrayList<>();
// TODO: check for unknown att... | [
"private",
"void",
"processElementStatic",
"(",
"GeneratorMain",
"gen",
",",
"Node",
"cur",
")",
"{",
"String",
"name",
"=",
"(",
"(",
"Element",
")",
"cur",
")",
".",
"getAttribute",
"(",
"ATTR_NAME",
")",
";",
"if",
"(",
"name",
"==",
"null",
")",
"{... | Process a 'static' cluster Element in the XML stream.
@param gen Generator
@param cur Current document nod | [
"Process",
"a",
"static",
"cluster",
"Element",
"in",
"the",
"XML",
"stream",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-data-generator/src/main/java/de/lmu/ifi/dbs/elki/datasource/GeneratorXMLDatabaseConnection.java#L635-L660 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java | Field.newBuilder | public static Builder newBuilder(String name, LegacySQLTypeName type, Field... subFields) {
return new Builder().setName(name).setType(type, subFields);
} | java | public static Builder newBuilder(String name, LegacySQLTypeName type, Field... subFields) {
return new Builder().setName(name).setType(type, subFields);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"String",
"name",
",",
"LegacySQLTypeName",
"type",
",",
"Field",
"...",
"subFields",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"setName",
"(",
"name",
")",
".",
"setType",
"(",
"type",
",",
"s... | Returns a builder for a Field object with given name and type. | [
"Returns",
"a",
"builder",
"for",
"a",
"Field",
"object",
"with",
"given",
"name",
"and",
"type",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/Field.java#L274-L276 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java | PerspectiveOps.pinholeToMatrix | public static FMatrixRMaj pinholeToMatrix(CameraPinhole param , FMatrixRMaj K )
{
return ImplPerspectiveOps_F32.pinholeToMatrix(param, K);
} | java | public static FMatrixRMaj pinholeToMatrix(CameraPinhole param , FMatrixRMaj K )
{
return ImplPerspectiveOps_F32.pinholeToMatrix(param, K);
} | [
"public",
"static",
"FMatrixRMaj",
"pinholeToMatrix",
"(",
"CameraPinhole",
"param",
",",
"FMatrixRMaj",
"K",
")",
"{",
"return",
"ImplPerspectiveOps_F32",
".",
"pinholeToMatrix",
"(",
"param",
",",
"K",
")",
";",
"}"
] | Given the intrinsic parameters create a calibration matrix
@param param Intrinsic parameters structure that is to be converted into a matrix
@param K Storage for calibration matrix, must be 3x3. If null then a new matrix is declared
@return Calibration matrix 3x3 | [
"Given",
"the",
"intrinsic",
"parameters",
"create",
"a",
"calibration",
"matrix"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/PerspectiveOps.java#L271-L274 |
apache/flink | flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java | KeyGroupPartitioner.reportKeyGroupOfElementAtIndex | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[keyGroupIndex];
} | java | protected void reportKeyGroupOfElementAtIndex(int index, int keyGroup) {
final int keyGroupIndex = keyGroup - firstKeyGroup;
elementKeyGroups[index] = keyGroupIndex;
++counterHistogram[keyGroupIndex];
} | [
"protected",
"void",
"reportKeyGroupOfElementAtIndex",
"(",
"int",
"index",
",",
"int",
"keyGroup",
")",
"{",
"final",
"int",
"keyGroupIndex",
"=",
"keyGroup",
"-",
"firstKeyGroup",
";",
"elementKeyGroups",
"[",
"index",
"]",
"=",
"keyGroupIndex",
";",
"++",
"co... | This method reports in the bookkeeping data that the element at the given index belongs to the given key-group. | [
"This",
"method",
"reports",
"in",
"the",
"bookkeeping",
"data",
"that",
"the",
"element",
"at",
"the",
"given",
"index",
"belongs",
"to",
"the",
"given",
"key",
"-",
"group",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/state/KeyGroupPartitioner.java#L161-L165 |
Azure/azure-sdk-for-java | policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java | PolicyDefinitionsInner.deleteAtManagementGroupAsync | public Observable<Void> deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) {
return deleteAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceR... | java | public Observable<Void> deleteAtManagementGroupAsync(String policyDefinitionName, String managementGroupId) {
return deleteAtManagementGroupWithServiceResponseAsync(policyDefinitionName, managementGroupId).map(new Func1<ServiceResponse<Void>, Void>() {
@Override
public Void call(ServiceR... | [
"public",
"Observable",
"<",
"Void",
">",
"deleteAtManagementGroupAsync",
"(",
"String",
"policyDefinitionName",
",",
"String",
"managementGroupId",
")",
"{",
"return",
"deleteAtManagementGroupWithServiceResponseAsync",
"(",
"policyDefinitionName",
",",
"managementGroupId",
"... | Deletes a policy definition at management group level.
@param policyDefinitionName The name of the policy definition to delete.
@param managementGroupId The ID of the management group.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the {@link ServiceResponse} object if successful. | [
"Deletes",
"a",
"policy",
"definition",
"at",
"management",
"group",
"level",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/policy/resource-manager/v2016_12_01/src/main/java/com/microsoft/azure/management/policy/v2016_12_01/implementation/PolicyDefinitionsInner.java#L564-L571 |
cdk/cdk | tool/charges/src/main/java/org/openscience/cdk/charges/Polarizability.java | Polarizability.getNumberOfHydrogen | private int getNumberOfHydrogen(IAtomContainer atomContainer, IAtom atom) {
java.util.List<IBond> bonds = atomContainer.getConnectedBondsList(atom);
IAtom connectedAtom;
int hCounter = 0;
for (IBond bond : bonds) {
connectedAtom = bond.getOther(atom);
if (connecte... | java | private int getNumberOfHydrogen(IAtomContainer atomContainer, IAtom atom) {
java.util.List<IBond> bonds = atomContainer.getConnectedBondsList(atom);
IAtom connectedAtom;
int hCounter = 0;
for (IBond bond : bonds) {
connectedAtom = bond.getOther(atom);
if (connecte... | [
"private",
"int",
"getNumberOfHydrogen",
"(",
"IAtomContainer",
"atomContainer",
",",
"IAtom",
"atom",
")",
"{",
"java",
".",
"util",
".",
"List",
"<",
"IBond",
">",
"bonds",
"=",
"atomContainer",
".",
"getConnectedBondsList",
"(",
"atom",
")",
";",
"IAtom",
... | Gets the numberOfHydrogen attribute of the Polarizability object.
@param atomContainer Description of the Parameter
@param atom Description of the Parameter
@return The numberOfHydrogen value | [
"Gets",
"the",
"numberOfHydrogen",
"attribute",
"of",
"the",
"Polarizability",
"object",
"."
] | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/charges/src/main/java/org/openscience/cdk/charges/Polarizability.java#L298-L309 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/doc/DocClient.java | DocClient.listDocuments | public ListDocumentsResponse listDocuments(String status, String marker, int maxSize) {
ListDocumentsRequest request = new ListDocumentsRequest();
InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC);
internalRequest.addParameter("status", status);
if (m... | java | public ListDocumentsResponse listDocuments(String status, String marker, int maxSize) {
ListDocumentsRequest request = new ListDocumentsRequest();
InternalRequest internalRequest = this.createRequest(HttpMethodName.GET, request, DOC);
internalRequest.addParameter("status", status);
if (m... | [
"public",
"ListDocumentsResponse",
"listDocuments",
"(",
"String",
"status",
",",
"String",
"marker",
",",
"int",
"maxSize",
")",
"{",
"ListDocumentsRequest",
"request",
"=",
"new",
"ListDocumentsRequest",
"(",
")",
";",
"InternalRequest",
"internalRequest",
"=",
"t... | list all Document by status, marker.
@param status document status
@param marker the marker, can be ""
@param maxSize the maxSize, should be (0, 200]
@return A ListDocumentsResponse object containing the information returned by Document. | [
"list",
"all",
"Document",
"by",
"status",
"marker",
".",
"@param",
"status",
"document",
"status",
"@param",
"marker",
"the",
"marker",
"can",
"be",
"@param",
"maxSize",
"the",
"maxSize",
"should",
"be",
"(",
"0",
"200",
"]"
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/doc/DocClient.java#L593-L614 |
jayantk/jklol | src/com/jayantkrish/jklol/models/bayesnet/CptTableFactor.java | CptTableFactor.getTensorFromVariables | private static TensorBuilder getTensorFromVariables(VariableNumMap variables) {
// Get the dimensions and dimension sizes for the tensor.
int[] dimensions = variables.getVariableNumsArray();
int[] sizes = new int[dimensions.length];
List<DiscreteVariable> varTypes = variables.getDiscreteVariables();
... | java | private static TensorBuilder getTensorFromVariables(VariableNumMap variables) {
// Get the dimensions and dimension sizes for the tensor.
int[] dimensions = variables.getVariableNumsArray();
int[] sizes = new int[dimensions.length];
List<DiscreteVariable> varTypes = variables.getDiscreteVariables();
... | [
"private",
"static",
"TensorBuilder",
"getTensorFromVariables",
"(",
"VariableNumMap",
"variables",
")",
"{",
"// Get the dimensions and dimension sizes for the tensor.",
"int",
"[",
"]",
"dimensions",
"=",
"variables",
".",
"getVariableNumsArray",
"(",
")",
";",
"int",
"... | Constructs a tensor with one dimension per variable in {@code variables}.
@param variables
@return | [
"Constructs",
"a",
"tensor",
"with",
"one",
"dimension",
"per",
"variable",
"in",
"{",
"@code",
"variables",
"}",
"."
] | train | https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/models/bayesnet/CptTableFactor.java#L89-L98 |
digipost/signature-api-client-java | src/main/java/no/digipost/signature/client/security/KeyStoreConfig.java | KeyStoreConfig.fromOrganizationCertificate | public static KeyStoreConfig fromOrganizationCertificate(final InputStream organizationCertificateStream, final String privatekeyPassword) {
KeyStore ks = KeyStoreType.PKCS12.loadKeyStore(organizationCertificateStream, privatekeyPassword);
Enumeration<String> aliases;
try {
aliases =... | java | public static KeyStoreConfig fromOrganizationCertificate(final InputStream organizationCertificateStream, final String privatekeyPassword) {
KeyStore ks = KeyStoreType.PKCS12.loadKeyStore(organizationCertificateStream, privatekeyPassword);
Enumeration<String> aliases;
try {
aliases =... | [
"public",
"static",
"KeyStoreConfig",
"fromOrganizationCertificate",
"(",
"final",
"InputStream",
"organizationCertificateStream",
",",
"final",
"String",
"privatekeyPassword",
")",
"{",
"KeyStore",
"ks",
"=",
"KeyStoreType",
".",
"PKCS12",
".",
"loadKeyStore",
"(",
"or... | Create a {@link KeyStoreConfig} from an Organization Certificate (Virksomhetssertifikat).
@param organizationCertificateStream A stream of the certificate in PKCS12 format. The file should have .p12-file ending.
@param privatekeyPassword The password for the private key of the organization certificate.
@ret... | [
"Create",
"a",
"{",
"@link",
"KeyStoreConfig",
"}",
"from",
"an",
"Organization",
"Certificate",
"(",
"Virksomhetssertifikat",
")",
"."
] | train | https://github.com/digipost/signature-api-client-java/blob/246207571641fbac6beda5ffc585eec188825c45/src/main/java/no/digipost/signature/client/security/KeyStoreConfig.java#L121-L136 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxUser.java | BoxUser.createAppUser | public static BoxUser.Info createAppUser(BoxAPIConnection api, String name,
CreateUserParams params) {
params.setIsPlatformAccessOnly(true);
return createEnterpriseUser(api, null, name, params);
} | java | public static BoxUser.Info createAppUser(BoxAPIConnection api, String name,
CreateUserParams params) {
params.setIsPlatformAccessOnly(true);
return createEnterpriseUser(api, null, name, params);
} | [
"public",
"static",
"BoxUser",
".",
"Info",
"createAppUser",
"(",
"BoxAPIConnection",
"api",
",",
"String",
"name",
",",
"CreateUserParams",
"params",
")",
"{",
"params",
".",
"setIsPlatformAccessOnly",
"(",
"true",
")",
";",
"return",
"createEnterpriseUser",
"(",... | Provisions a new app user in an enterprise with additional user information using Box Developer Edition.
@param api the API connection to be used by the created user.
@param name the name of the user.
@param params additional user information.
@return the created user's info. | [
"Provisions",
"a",
"new",
"app",
"user",
"in",
"an",
"enterprise",
"with",
"additional",
"user",
"information",
"using",
"Box",
"Developer",
"Edition",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxUser.java#L94-L99 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java | SpringApplication.configureProfiles | protected void configureProfiles(ConfigurableEnvironment environment, String[] args) {
environment.getActiveProfiles(); // ensure they are initialized
// But these ones should go first (last wins in a property key clash)
Set<String> profiles = new LinkedHashSet<>(this.additionalProfiles);
profiles.addAll(Arrays... | java | protected void configureProfiles(ConfigurableEnvironment environment, String[] args) {
environment.getActiveProfiles(); // ensure they are initialized
// But these ones should go first (last wins in a property key clash)
Set<String> profiles = new LinkedHashSet<>(this.additionalProfiles);
profiles.addAll(Arrays... | [
"protected",
"void",
"configureProfiles",
"(",
"ConfigurableEnvironment",
"environment",
",",
"String",
"[",
"]",
"args",
")",
"{",
"environment",
".",
"getActiveProfiles",
"(",
")",
";",
"// ensure they are initialized",
"// But these ones should go first (last wins in a pro... | Configure which profiles are active (or active by default) for this application
environment. Additional profiles may be activated during configuration file
processing via the {@code spring.profiles.active} property.
@param environment this application's environment
@param args arguments passed to the {@code run} method... | [
"Configure",
"which",
"profiles",
"are",
"active",
"(",
"or",
"active",
"by",
"default",
")",
"for",
"this",
"application",
"environment",
".",
"Additional",
"profiles",
"may",
"be",
"activated",
"during",
"configuration",
"file",
"processing",
"via",
"the",
"{"... | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/SpringApplication.java#L540-L546 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/CartUrl.java | CartUrl.rejectSuggestedDiscountUrl | public static MozuUrl rejectSuggestedDiscountUrl(String cartId, Integer discountId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/{cartId}/rejectautodiscount/{discountId}?responseFields={responseFields}");
formatter.formatUrl("cartId", cartId);
formatter.formatUrl("d... | java | public static MozuUrl rejectSuggestedDiscountUrl(String cartId, Integer discountId, String responseFields)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/carts/{cartId}/rejectautodiscount/{discountId}?responseFields={responseFields}");
formatter.formatUrl("cartId", cartId);
formatter.formatUrl("d... | [
"public",
"static",
"MozuUrl",
"rejectSuggestedDiscountUrl",
"(",
"String",
"cartId",
",",
"Integer",
"discountId",
",",
"String",
"responseFields",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/carts/{cartId}/rejectautodiscount/{d... | Get Resource Url for RejectSuggestedDiscount
@param cartId Identifier of the cart to delete.
@param discountId discountId parameter description DOCUMENT_HERE
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should onl... | [
"Get",
"Resource",
"Url",
"for",
"RejectSuggestedDiscount"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/commerce/CartUrl.java#L89-L96 |
elki-project/elki | elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java | BitsUtil.get | public static boolean get(long[] v, int off) {
final int wordindex = off >>> LONG_LOG2_SIZE;
return (wordindex < v.length) && (v[wordindex] & (1L << off)) != 0;
} | java | public static boolean get(long[] v, int off) {
final int wordindex = off >>> LONG_LOG2_SIZE;
return (wordindex < v.length) && (v[wordindex] & (1L << off)) != 0;
} | [
"public",
"static",
"boolean",
"get",
"(",
"long",
"[",
"]",
"v",
",",
"int",
"off",
")",
"{",
"final",
"int",
"wordindex",
"=",
"off",
">>>",
"LONG_LOG2_SIZE",
";",
"return",
"(",
"wordindex",
"<",
"v",
".",
"length",
")",
"&&",
"(",
"v",
"[",
"wo... | Set bit number "off" in v.
<p>
Low-endian layout for the array.
@param v Buffer
@param off Offset to set | [
"Set",
"bit",
"number",
"off",
"in",
"v",
".",
"<p",
">",
"Low",
"-",
"endian",
"layout",
"for",
"the",
"array",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/datastructures/BitsUtil.java#L432-L435 |
Baidu-AIP/java-sdk | src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java | AipImageSearch.similarSearchUrl | public JSONObject similarSearchUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchC... | java | public JSONObject similarSearchUrl(String url, HashMap<String, String> options) {
AipRequest request = new AipRequest();
preOperation(request);
request.addBody("url", url);
if (options != null) {
request.addBody(options);
}
request.setUri(ImageSearchC... | [
"public",
"JSONObject",
"similarSearchUrl",
"(",
"String",
"url",
",",
"HashMap",
"<",
"String",
",",
"String",
">",
"options",
")",
"{",
"AipRequest",
"request",
"=",
"new",
"AipRequest",
"(",
")",
";",
"preOperation",
"(",
"request",
")",
";",
"request",
... | 相似图检索—检索接口
完成入库后,可使用该接口实现相似图检索。**支持传入指定分类维度(具体变量tags)进行检索,返回结果支持翻页(具体变量pn、rn)。****请注意,检索接口不返回原图,仅反馈当前填写的brief信息,请调用入库接口时尽量填写可关联至本地图库的图片id或者图片url等信息。**
@param url - 图片完整URL,URL长度不超过1024字节,URL对应的图片base64编码后大小不超过4M,最短边至少15px,最长边最大4096px,支持jpg/png/bmp格式,当image字段存在时url字段失效
@param options - 可选参数对象,key: value都为string类型
optio... | [
"相似图检索—检索接口",
"完成入库后,可使用该接口实现相似图检索。",
"**",
"支持传入指定分类维度(具体变量tags)进行检索,返回结果支持翻页(具体变量pn、rn)。",
"****",
"请注意,检索接口不返回原图,仅反馈当前填写的brief信息,请调用入库接口时尽量填写可关联至本地图库的图片id或者图片url等信息。",
"**"
] | train | https://github.com/Baidu-AIP/java-sdk/blob/16bb8b7bb8f9bbcb7c8af62d0a67a1e79eecad90/src/main/java/com/baidu/aip/imagesearch/AipImageSearch.java#L491-L502 |
intuit/QuickBooks-V3-Java-SDK | ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java | DataService.findAllAsync | public <T extends IEntity> void findAllAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
//findall is to be called as query
String query = "SELECT * FROM " + entity.getClass().getSimpleName();
executeQueryAsync(query, callbackHandler);
} | java | public <T extends IEntity> void findAllAsync(T entity, CallbackHandler callbackHandler) throws FMSException {
//findall is to be called as query
String query = "SELECT * FROM " + entity.getClass().getSimpleName();
executeQueryAsync(query, callbackHandler);
} | [
"public",
"<",
"T",
"extends",
"IEntity",
">",
"void",
"findAllAsync",
"(",
"T",
"entity",
",",
"CallbackHandler",
"callbackHandler",
")",
"throws",
"FMSException",
"{",
"//findall is to be called as query",
"String",
"query",
"=",
"\"SELECT * FROM \"",
"+",
"entity",... | Method to retrieve all records for the given entity in asynchronous fashion
Note, without pagination this will return only 100 records
Use query API to add pagintion and obtain additional records
@param entity
the entity
@param callbackHandler
the callback handler
@throws FMSException
throws FMSException | [
"Method",
"to",
"retrieve",
"all",
"records",
"for",
"the",
"given",
"entity",
"in",
"asynchronous",
"fashion",
"Note",
"without",
"pagination",
"this",
"will",
"return",
"only",
"100",
"records",
"Use",
"query",
"API",
"to",
"add",
"pagintion",
"and",
"obtain... | train | https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/ipp-v3-java-devkit/src/main/java/com/intuit/ipp/services/DataService.java#L740-L745 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/trees/tregex/tsurgeon/Tsurgeon.java | Tsurgeon.processPattern | public static Tree processPattern(TregexPattern matchPattern, TsurgeonPattern p, Tree t) {
TregexMatcher m = matchPattern.matcher(t);
while(m.find()) {
t = p.evaluate(t,m);
if(t==null)
break;
m = matchPattern.matcher(t);
}
return t;
} | java | public static Tree processPattern(TregexPattern matchPattern, TsurgeonPattern p, Tree t) {
TregexMatcher m = matchPattern.matcher(t);
while(m.find()) {
t = p.evaluate(t,m);
if(t==null)
break;
m = matchPattern.matcher(t);
}
return t;
} | [
"public",
"static",
"Tree",
"processPattern",
"(",
"TregexPattern",
"matchPattern",
",",
"TsurgeonPattern",
"p",
",",
"Tree",
"t",
")",
"{",
"TregexMatcher",
"m",
"=",
"matchPattern",
".",
"matcher",
"(",
"t",
")",
";",
"while",
"(",
"m",
".",
"find",
"(",... | Tries to match a pattern against a tree. If it succeeds, apply the surgical operations contained in a {@link TsurgeonPattern}.
@param matchPattern A {@link TregexPattern} to be matched against a {@link Tree}.
@param p A {@link TsurgeonPattern} to apply.
@param t the {@link Tree} to match against and perform surgery on... | [
"Tries",
"to",
"match",
"a",
"pattern",
"against",
"a",
"tree",
".",
"If",
"it",
"succeeds",
"apply",
"the",
"surgical",
"operations",
"contained",
"in",
"a",
"{"
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/trees/tregex/tsurgeon/Tsurgeon.java#L435-L444 |
Viascom/groundwork | foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/query/FoxHttpRequestQuery.java | FoxHttpRequestQuery.parseObjectAsQueryMap | public void parseObjectAsQueryMap(List<String> params, Object o) throws FoxHttpRequestException {
try {
Class clazz = o.getClass();
HashMap<String, String> paramMap = new HashMap<>();
for (String param : params) {
Field field = clazz.getDeclaredField(param);
... | java | public void parseObjectAsQueryMap(List<String> params, Object o) throws FoxHttpRequestException {
try {
Class clazz = o.getClass();
HashMap<String, String> paramMap = new HashMap<>();
for (String param : params) {
Field field = clazz.getDeclaredField(param);
... | [
"public",
"void",
"parseObjectAsQueryMap",
"(",
"List",
"<",
"String",
">",
"params",
",",
"Object",
"o",
")",
"throws",
"FoxHttpRequestException",
"{",
"try",
"{",
"Class",
"clazz",
"=",
"o",
".",
"getClass",
"(",
")",
";",
"HashMap",
"<",
"String",
",",
... | Parse an object as query map
@param params list of attribute names which will be included
@param o object with the attributes
@throws FoxHttpRequestException can throw an exception if a field does not exist | [
"Parse",
"an",
"object",
"as",
"query",
"map"
] | train | https://github.com/Viascom/groundwork/blob/d3f7d0df65e2e75861fc7db938090683f2cdf919/foxhttp/src/main/java/ch/viascom/groundwork/foxhttp/query/FoxHttpRequestQuery.java#L78-L95 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/GridFTPClient.java | GridFTPClient.setChecksum | public void setChecksum(ChecksumAlgorithm algorithm,
String value)
throws IOException, ServerException {
String arguments = algorithm.toFtpCmdArgument() + " " + value;
Command cmd = new Command("SCKS", arguments);
try {
controlChannel.execute(cmd)... | java | public void setChecksum(ChecksumAlgorithm algorithm,
String value)
throws IOException, ServerException {
String arguments = algorithm.toFtpCmdArgument() + " " + value;
Command cmd = new Command("SCKS", arguments);
try {
controlChannel.execute(cmd)... | [
"public",
"void",
"setChecksum",
"(",
"ChecksumAlgorithm",
"algorithm",
",",
"String",
"value",
")",
"throws",
"IOException",
",",
"ServerException",
"{",
"String",
"arguments",
"=",
"algorithm",
".",
"toFtpCmdArgument",
"(",
")",
"+",
"\" \"",
"+",
"value",
";"... | Sets the checksum values ahead of the transfer
@param algorithm the checksume algorithm
@param value the checksum value as hexadecimal number
@exception ServerException if an error occured. | [
"Sets",
"the",
"checksum",
"values",
"ahead",
"of",
"the",
"transfer"
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/GridFTPClient.java#L968-L981 |
Mozu/mozu-java | mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CategoryUrl.java | CategoryUrl.addCategoryUrl | public static MozuUrl addCategoryUrl(Boolean incrementSequence, String responseFields, Boolean useProvidedId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/?incrementSequence={incrementSequence}&useProvidedId={useProvidedId}&responseFields={responseFields}");
formatter.form... | java | public static MozuUrl addCategoryUrl(Boolean incrementSequence, String responseFields, Boolean useProvidedId)
{
UrlFormatter formatter = new UrlFormatter("/api/commerce/catalog/admin/categories/?incrementSequence={incrementSequence}&useProvidedId={useProvidedId}&responseFields={responseFields}");
formatter.form... | [
"public",
"static",
"MozuUrl",
"addCategoryUrl",
"(",
"Boolean",
"incrementSequence",
",",
"String",
"responseFields",
",",
"Boolean",
"useProvidedId",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/commerce/catalog/admin/categories/?increme... | Get Resource Url for AddCategory
@param incrementSequence If true, when adding a new product category, set the sequence number of the new category to an increment of one integer greater than the maximum available sequence number across all product categories. If false, set the sequence number to zero.
@param responseFi... | [
"Get",
"Resource",
"Url",
"for",
"AddCategory"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-java-core/src/main/java/com/mozu/api/urls/commerce/catalog/admin/CategoryUrl.java#L71-L78 |
googleapis/google-http-java-client | google-http-client/src/main/java/com/google/api/client/json/JsonParser.java | JsonParser.parseMap | private void parseMap(
Field fieldContext,
Map<String, Object> destinationMap,
Type valueType,
ArrayList<Type> context,
CustomizeJsonParser customizeParser)
throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken == JsonToken.FIELD_NAME) {
... | java | private void parseMap(
Field fieldContext,
Map<String, Object> destinationMap,
Type valueType,
ArrayList<Type> context,
CustomizeJsonParser customizeParser)
throws IOException {
JsonToken curToken = startParsingObjectOrArray();
while (curToken == JsonToken.FIELD_NAME) {
... | [
"private",
"void",
"parseMap",
"(",
"Field",
"fieldContext",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"destinationMap",
",",
"Type",
"valueType",
",",
"ArrayList",
"<",
"Type",
">",
"context",
",",
"CustomizeJsonParser",
"customizeParser",
")",
"throws",
... | Parse a JSON Object from the given JSON parser into the given destination map, optionally using
the given parser customizer.
@param fieldContext field context or {@code null} for none
@param destinationMap destination map
@param valueType valueType of the map value type parameter
@param context destination context sta... | [
"Parse",
"a",
"JSON",
"Object",
"from",
"the",
"given",
"JSON",
"parser",
"into",
"the",
"given",
"destination",
"map",
"optionally",
"using",
"the",
"given",
"parser",
"customizer",
"."
] | train | https://github.com/googleapis/google-http-java-client/blob/0988ae4e0f26a80f579b6adb2b276dd8254928de/google-http-client/src/main/java/com/google/api/client/json/JsonParser.java#L665-L685 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsInner.java | NetworkInterfaceTapConfigurationsInner.createOrUpdate | public NetworkInterfaceTapConfigurationInner createOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurat... | java | public NetworkInterfaceTapConfigurationInner createOrUpdate(String resourceGroupName, String networkInterfaceName, String tapConfigurationName, NetworkInterfaceTapConfigurationInner tapConfigurationParameters) {
return createOrUpdateWithServiceResponseAsync(resourceGroupName, networkInterfaceName, tapConfigurat... | [
"public",
"NetworkInterfaceTapConfigurationInner",
"createOrUpdate",
"(",
"String",
"resourceGroupName",
",",
"String",
"networkInterfaceName",
",",
"String",
"tapConfigurationName",
",",
"NetworkInterfaceTapConfigurationInner",
"tapConfigurationParameters",
")",
"{",
"return",
"... | Creates or updates a Tap configuration in the specified NetworkInterface.
@param resourceGroupName The name of the resource group.
@param networkInterfaceName The name of the network interface.
@param tapConfigurationName The name of the tap configuration.
@param tapConfigurationParameters Parameters supplied to the c... | [
"Creates",
"or",
"updates",
"a",
"Tap",
"configuration",
"in",
"the",
"specified",
"NetworkInterface",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_08_01/src/main/java/com/microsoft/azure/management/network/v2018_08_01/implementation/NetworkInterfaceTapConfigurationsInner.java#L362-L364 |
cfg4j/cfg4j | cfg4j-core/src/main/java/org/cfg4j/source/context/propertiesprovider/PropertyBasedPropertiesProvider.java | PropertyBasedPropertiesProvider.getProperties | @Override
public Properties getProperties(InputStream inputStream) {
Properties properties = new Properties();
try {
properties.load(inputStream);
} catch (IOException | IllegalArgumentException e) {
throw new IllegalStateException("Unable to load properties from provided stream", e);
}
... | java | @Override
public Properties getProperties(InputStream inputStream) {
Properties properties = new Properties();
try {
properties.load(inputStream);
} catch (IOException | IllegalArgumentException e) {
throw new IllegalStateException("Unable to load properties from provided stream", e);
}
... | [
"@",
"Override",
"public",
"Properties",
"getProperties",
"(",
"InputStream",
"inputStream",
")",
"{",
"Properties",
"properties",
"=",
"new",
"Properties",
"(",
")",
";",
"try",
"{",
"properties",
".",
"load",
"(",
"inputStream",
")",
";",
"}",
"catch",
"("... | Get {@link Properties} for a given {@code inputStream} treating it as a properties file.
@param inputStream input stream representing properties file
@return properties representing values from {@code inputStream}
@throws IllegalStateException when unable to read properties | [
"Get",
"{",
"@link",
"Properties",
"}",
"for",
"a",
"given",
"{",
"@code",
"inputStream",
"}",
"treating",
"it",
"as",
"a",
"properties",
"file",
"."
] | train | https://github.com/cfg4j/cfg4j/blob/47d4f63e5fc820c62631e557adc34a29d8ab396d/cfg4j-core/src/main/java/org/cfg4j/source/context/propertiesprovider/PropertyBasedPropertiesProvider.java#L35-L46 |
Jasig/uPortal | uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java | RDBMEntityGroupStore.updateMembers | @Override
public void updateMembers(IEntityGroup eg) throws GroupsException {
Connection conn = null;
EntityGroupImpl egi = (EntityGroupImpl) eg;
if (egi.isDirty())
try {
conn = RDBMServices.getConnection();
setAutoCommit(conn, false);
... | java | @Override
public void updateMembers(IEntityGroup eg) throws GroupsException {
Connection conn = null;
EntityGroupImpl egi = (EntityGroupImpl) eg;
if (egi.isDirty())
try {
conn = RDBMServices.getConnection();
setAutoCommit(conn, false);
... | [
"@",
"Override",
"public",
"void",
"updateMembers",
"(",
"IEntityGroup",
"eg",
")",
"throws",
"GroupsException",
"{",
"Connection",
"conn",
"=",
"null",
";",
"EntityGroupImpl",
"egi",
"=",
"(",
"EntityGroupImpl",
")",
"eg",
";",
"if",
"(",
"egi",
".",
"isDir... | Insert and delete group membership rows inside a transaction.
@param eg IEntityGroup | [
"Insert",
"and",
"delete",
"group",
"membership",
"rows",
"inside",
"a",
"transaction",
"."
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-groups/uPortal-groups-core/src/main/java/org/apereo/portal/groups/RDBMEntityGroupStore.java#L1496-L1525 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java | PackageIndexWriter.addPackagesList | protected void addPackagesList(PackageDoc[] packages, Content tbody) {
for (int i = 0; i < packages.length; i++) {
if (packages[i] != null && packages[i].name().length() > 0) {
if (configuration.nodeprecated && Util.isDeprecated(packages[i]))
continue;
... | java | protected void addPackagesList(PackageDoc[] packages, Content tbody) {
for (int i = 0; i < packages.length; i++) {
if (packages[i] != null && packages[i].name().length() > 0) {
if (configuration.nodeprecated && Util.isDeprecated(packages[i]))
continue;
... | [
"protected",
"void",
"addPackagesList",
"(",
"PackageDoc",
"[",
"]",
"packages",
",",
"Content",
"tbody",
")",
"{",
"for",
"(",
"int",
"i",
"=",
"0",
";",
"i",
"<",
"packages",
".",
"length",
";",
"i",
"++",
")",
"{",
"if",
"(",
"packages",
"[",
"i... | Adds list of packages in the index table. Generate link to each package.
@param packages Packages to which link is to be generated
@param tbody the documentation tree to which the list will be added | [
"Adds",
"list",
"of",
"packages",
"in",
"the",
"index",
"table",
".",
"Generate",
"link",
"to",
"each",
"package",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java#L168-L188 |
sarl/sarl | main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/ExpressionBuilderImpl.java | ExpressionBuilderImpl.eInit | public void eInit(EObject context, Procedure1<? super XExpression> setter, IJvmTypeProvider typeContext) {
setTypeResolutionContext(typeContext);
this.context = context;
this.setter = setter;
this.expr = null;
} | java | public void eInit(EObject context, Procedure1<? super XExpression> setter, IJvmTypeProvider typeContext) {
setTypeResolutionContext(typeContext);
this.context = context;
this.setter = setter;
this.expr = null;
} | [
"public",
"void",
"eInit",
"(",
"EObject",
"context",
",",
"Procedure1",
"<",
"?",
"super",
"XExpression",
">",
"setter",
",",
"IJvmTypeProvider",
"typeContext",
")",
"{",
"setTypeResolutionContext",
"(",
"typeContext",
")",
";",
"this",
".",
"context",
"=",
"... | Initialize the expression.
@param context the context of the expressions.
@param setter the object that permits to assign the expression to the context. | [
"Initialize",
"the",
"expression",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src-gen/io/sarl/lang/codebuilder/builders/ExpressionBuilderImpl.java#L73-L78 |
florent37/DaVinci | davinci/src/main/java/com/github/florent37/davinci/DaVinci.java | DaVinci.downloadBitmap | private void downloadBitmap(final String path, final Object into, final Transformation transformation) {
//download the bitmap from bluetooth
new AsyncTask<Void, Void, Bitmap>() {
@Override
protected Bitmap doInBackground(Void... params) {
Bitmap bitmap = getBitma... | java | private void downloadBitmap(final String path, final Object into, final Transformation transformation) {
//download the bitmap from bluetooth
new AsyncTask<Void, Void, Bitmap>() {
@Override
protected Bitmap doInBackground(Void... params) {
Bitmap bitmap = getBitma... | [
"private",
"void",
"downloadBitmap",
"(",
"final",
"String",
"path",
",",
"final",
"Object",
"into",
",",
"final",
"Transformation",
"transformation",
")",
"{",
"//download the bitmap from bluetooth",
"new",
"AsyncTask",
"<",
"Void",
",",
"Void",
",",
"Bitmap",
">... | Download bitmap from bluetooth asset and store it into LruCache and LruDiskCache
@param path the path or url of the image
@param into the destination object | [
"Download",
"bitmap",
"from",
"bluetooth",
"asset",
"and",
"store",
"it",
"into",
"LruCache",
"and",
"LruDiskCache"
] | train | https://github.com/florent37/DaVinci/blob/9c6ce4aa2df8e2288cd6ee8b57d9091b1b770a7a/davinci/src/main/java/com/github/florent37/davinci/DaVinci.java#L485-L510 |
Waikato/moa | moa/src/main/java/moa/cluster/CFCluster.java | CFCluster.addVectors | public static void addVectors(double[] a1, double[] a2) {
assert (a1 != null);
assert (a2 != null);
assert (a1.length == a2.length) : "Adding two arrays of different "
+ "length";
for (int i = 0; i < a1.length; i++) {
a1[i] += a2[i];
}
} | java | public static void addVectors(double[] a1, double[] a2) {
assert (a1 != null);
assert (a2 != null);
assert (a1.length == a2.length) : "Adding two arrays of different "
+ "length";
for (int i = 0; i < a1.length; i++) {
a1[i] += a2[i];
}
} | [
"public",
"static",
"void",
"addVectors",
"(",
"double",
"[",
"]",
"a1",
",",
"double",
"[",
"]",
"a2",
")",
"{",
"assert",
"(",
"a1",
"!=",
"null",
")",
";",
"assert",
"(",
"a2",
"!=",
"null",
")",
";",
"assert",
"(",
"a1",
".",
"length",
"==",
... | Adds the second array to the first array element by element. The arrays
must have the same length.
@param a1 Vector to which the second vector is added.
@param a2 Vector to be added. This vector does not change. | [
"Adds",
"the",
"second",
"array",
"to",
"the",
"first",
"array",
"element",
"by",
"element",
".",
"The",
"arrays",
"must",
"have",
"the",
"same",
"length",
"."
] | train | https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/moa/cluster/CFCluster.java#L162-L171 |
cache2k/cache2k | cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java | CacheConfigurationProviderImpl.handleSection | private boolean handleSection(
final ConfigurationContext ctx,
final Class<?> _type,
final ConfigurationWithSections cfg,
final ParsedConfiguration sc) {
String _containerName = sc.getContainer();
if (!"sections".equals(_containerName)) {
return false;
}
@SuppressWarnings("unchecke... | java | private boolean handleSection(
final ConfigurationContext ctx,
final Class<?> _type,
final ConfigurationWithSections cfg,
final ParsedConfiguration sc) {
String _containerName = sc.getContainer();
if (!"sections".equals(_containerName)) {
return false;
}
@SuppressWarnings("unchecke... | [
"private",
"boolean",
"handleSection",
"(",
"final",
"ConfigurationContext",
"ctx",
",",
"final",
"Class",
"<",
"?",
">",
"_type",
",",
"final",
"ConfigurationWithSections",
"cfg",
",",
"final",
"ParsedConfiguration",
"sc",
")",
"{",
"String",
"_containerName",
"=... | Create a new configuration section or reuse an existing section, if it is a singleton.
<p>No support for writing on existing sections, which means it is not possible to define a non singleton
in the defaults section and then override values later in the cache specific configuration.
This is not needed for version 1.0.... | [
"Create",
"a",
"new",
"configuration",
"section",
"or",
"reuse",
"an",
"existing",
"section",
"if",
"it",
"is",
"a",
"singleton",
"."
] | train | https://github.com/cache2k/cache2k/blob/3c9ccff12608c598c387ec50957089784cc4b618/cache2k-core/src/main/java/org/cache2k/impl/xmlConfiguration/CacheConfigurationProviderImpl.java#L410-L430 |
aol/cyclops | cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java | Pipes.subscribeTo | public void subscribeTo(final K key, final Subscriber<V> subscriber) {
registered.get(key)
.stream()
.subscribe(subscriber);
} | java | public void subscribeTo(final K key, final Subscriber<V> subscriber) {
registered.get(key)
.stream()
.subscribe(subscriber);
} | [
"public",
"void",
"subscribeTo",
"(",
"final",
"K",
"key",
",",
"final",
"Subscriber",
"<",
"V",
">",
"subscriber",
")",
"{",
"registered",
".",
"get",
"(",
"key",
")",
".",
"stream",
"(",
")",
".",
"subscribe",
"(",
"subscriber",
")",
";",
"}"
] | Subscribe synchronously to a pipe
@param key for registered simple-react async.Adapter
@param subscriber Reactive Streams reactiveSubscriber for data on this pipe | [
"Subscribe",
"synchronously",
"to",
"a",
"pipe"
] | train | https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops-futurestream/src/main/java/cyclops/futurestream/Pipes.java#L544-L549 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContextProperties.java | ConstraintContextProperties.addRoutingConstraint | public void addRoutingConstraint(String activity, AbstractConstraint<?> constraint) throws PropertyException{
Validate.notNull(activity);
Validate.notEmpty(activity);
Validate.notNull(constraint);
//1. Add constraint itself
// This also adds the constraint to the list of constraints
String propertyName... | java | public void addRoutingConstraint(String activity, AbstractConstraint<?> constraint) throws PropertyException{
Validate.notNull(activity);
Validate.notEmpty(activity);
Validate.notNull(constraint);
//1. Add constraint itself
// This also adds the constraint to the list of constraints
String propertyName... | [
"public",
"void",
"addRoutingConstraint",
"(",
"String",
"activity",
",",
"AbstractConstraint",
"<",
"?",
">",
"constraint",
")",
"throws",
"PropertyException",
"{",
"Validate",
".",
"notNull",
"(",
"activity",
")",
";",
"Validate",
".",
"notEmpty",
"(",
"activi... | Adds a routing constraint for an activity.
@param activity The name of the activity for which the constraint is added.
@param constraint The routing constraint to add.
@throws ParameterException if the given parameters are invalid.
@throws PropertyException if the given constraint cannot be added as a property.
@see #a... | [
"Adds",
"a",
"routing",
"constraint",
"for",
"an",
"activity",
"."
] | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/constraint/ConstraintContextProperties.java#L43-L60 |
xvik/generics-resolver | src/main/java/ru/vyarus/java/generics/resolver/util/TypeToStringUtils.java | TypeToStringUtils.toStringWithNamedGenerics | public static String toStringWithNamedGenerics(final Class<?> type) {
return toStringType(new ParameterizedTypeImpl(type, type.getTypeParameters()), new PrintableGenericsMap());
} | java | public static String toStringWithNamedGenerics(final Class<?> type) {
return toStringType(new ParameterizedTypeImpl(type, type.getTypeParameters()), new PrintableGenericsMap());
} | [
"public",
"static",
"String",
"toStringWithNamedGenerics",
"(",
"final",
"Class",
"<",
"?",
">",
"type",
")",
"{",
"return",
"toStringType",
"(",
"new",
"ParameterizedTypeImpl",
"(",
"type",
",",
"type",
".",
"getTypeParameters",
"(",
")",
")",
",",
"new",
"... | Print class with generic variables. For example, {@code List<T>}.
@param type class to print
@return string containing class and it's declared generics | [
"Print",
"class",
"with",
"generic",
"variables",
".",
"For",
"example",
"{",
"@code",
"List<T",
">",
"}",
"."
] | train | https://github.com/xvik/generics-resolver/blob/d7d9d2783265df1178230e8f0b7cb6d853b67a7b/src/main/java/ru/vyarus/java/generics/resolver/util/TypeToStringUtils.java#L97-L99 |
gmessner/gitlab4j-api | src/main/java/org/gitlab4j/api/RepositoryFileApi.java | RepositoryFileApi.getFile | public RepositoryFile getFile(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException {
return (getFile(projectIdOrPath, filePath, ref, true));
} | java | public RepositoryFile getFile(Object projectIdOrPath, String filePath, String ref) throws GitLabApiException {
return (getFile(projectIdOrPath, filePath, ref, true));
} | [
"public",
"RepositoryFile",
"getFile",
"(",
"Object",
"projectIdOrPath",
",",
"String",
"filePath",
",",
"String",
"ref",
")",
"throws",
"GitLabApiException",
"{",
"return",
"(",
"getFile",
"(",
"projectIdOrPath",
",",
"filePath",
",",
"ref",
",",
"true",
")",
... | Get file from repository. Allows you to receive information about file in repository like name, size, content.
Note that file content is Base64 encoded.
<pre><code>GitLab Endpoint: GET /projects/:id/repository/files</code></pre>
@param projectIdOrPath the id, path of the project, or a Project instance holding the pro... | [
"Get",
"file",
"from",
"repository",
".",
"Allows",
"you",
"to",
"receive",
"information",
"about",
"file",
"in",
"repository",
"like",
"name",
"size",
"content",
".",
"Note",
"that",
"file",
"content",
"is",
"Base64",
"encoded",
"."
] | train | https://github.com/gmessner/gitlab4j-api/blob/ab045070abac0a8f4ccbf17b5ed9bfdef5723eed/src/main/java/org/gitlab4j/api/RepositoryFileApi.java#L114-L116 |
threerings/gwt-utils | src/main/java/com/threerings/gwt/util/ClickCallback.java | ClickCallback.addConfirmPopupMessage | protected int addConfirmPopupMessage (SmartTable contents, int row)
{
if (_confirmHTML) {
contents.setHTML(row, 0, _confirmMessage, 2, "Message");
} else {
contents.setText(row, 0, _confirmMessage, 2, "Message");
}
return row + 1;
} | java | protected int addConfirmPopupMessage (SmartTable contents, int row)
{
if (_confirmHTML) {
contents.setHTML(row, 0, _confirmMessage, 2, "Message");
} else {
contents.setText(row, 0, _confirmMessage, 2, "Message");
}
return row + 1;
} | [
"protected",
"int",
"addConfirmPopupMessage",
"(",
"SmartTable",
"contents",
",",
"int",
"row",
")",
"{",
"if",
"(",
"_confirmHTML",
")",
"{",
"contents",
".",
"setHTML",
"(",
"row",
",",
"0",
",",
"_confirmMessage",
",",
"2",
",",
"\"Message\"",
")",
";",... | Adds the message area for the confirmation popup to the given row and returns the row to
insert next. | [
"Adds",
"the",
"message",
"area",
"for",
"the",
"confirmation",
"popup",
"to",
"the",
"given",
"row",
"and",
"returns",
"the",
"row",
"to",
"insert",
"next",
"."
] | train | https://github.com/threerings/gwt-utils/blob/31b31a23b667f2a9c683160d77646db259f2aae5/src/main/java/com/threerings/gwt/util/ClickCallback.java#L222-L230 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/APIClient.java | APIClient.getLogs | public JSONObject getLogs(int offset, int length, LogType logType, RequestOptions requestOptions) throws AlgoliaException {
String type = null;
switch (logType) {
case LOG_BUILD:
type = "build";
break;
case LOG_QUERY:
type = "query";
break;
case LOG_ERROR:
... | java | public JSONObject getLogs(int offset, int length, LogType logType, RequestOptions requestOptions) throws AlgoliaException {
String type = null;
switch (logType) {
case LOG_BUILD:
type = "build";
break;
case LOG_QUERY:
type = "query";
break;
case LOG_ERROR:
... | [
"public",
"JSONObject",
"getLogs",
"(",
"int",
"offset",
",",
"int",
"length",
",",
"LogType",
"logType",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"String",
"type",
"=",
"null",
";",
"switch",
"(",
"logType",
")",
"{",
... | Return last logs entries.
@param offset Specify the first entry to retrieve (0-based, 0 is the most recent log entry).
@param length Specify the maximum number of entries to retrieve starting at offset. Maximum allowed value: 1000.
@param logType Specify the type of log to retrieve
@param reques... | [
"Return",
"last",
"logs",
"entries",
"."
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/APIClient.java#L484-L501 |
cchantep/acolyte | jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java | PreparedStatement.createBytes | private byte[] createBytes(InputStream stream, long length)
throws SQLException {
ByteArrayOutputStream buff = null;
try {
buff = new ByteArrayOutputStream();
if (length > 0) IOUtils.copyLarge(stream, buff, 0, length);
else IOUtils.copy(stream, buff);
... | java | private byte[] createBytes(InputStream stream, long length)
throws SQLException {
ByteArrayOutputStream buff = null;
try {
buff = new ByteArrayOutputStream();
if (length > 0) IOUtils.copyLarge(stream, buff, 0, length);
else IOUtils.copy(stream, buff);
... | [
"private",
"byte",
"[",
"]",
"createBytes",
"(",
"InputStream",
"stream",
",",
"long",
"length",
")",
"throws",
"SQLException",
"{",
"ByteArrayOutputStream",
"buff",
"=",
"null",
";",
"try",
"{",
"buff",
"=",
"new",
"ByteArrayOutputStream",
"(",
")",
";",
"i... | Creates bytes array from input stream.
@param stream Input stream
@param length | [
"Creates",
"bytes",
"array",
"from",
"input",
"stream",
"."
] | train | https://github.com/cchantep/acolyte/blob/a383dff20fadc08ec9306f2f1f24b2a7e0047449/jdbc-driver/src/main/java/acolyte/jdbc/PreparedStatement.java#L1054-L1071 |
lessthanoptimal/BoofCV | main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java | StereoConsistencyCheck.checkPixel | public boolean checkPixel( Point2D_F64 left , Point2D_F64 right ) {
leftImageToRect.compute(left.x,left.y,rectLeft);
rightImageToRect.compute(right.x, right.y, rectRight);
return checkRectified(rectLeft,rectRight);
} | java | public boolean checkPixel( Point2D_F64 left , Point2D_F64 right ) {
leftImageToRect.compute(left.x,left.y,rectLeft);
rightImageToRect.compute(right.x, right.y, rectRight);
return checkRectified(rectLeft,rectRight);
} | [
"public",
"boolean",
"checkPixel",
"(",
"Point2D_F64",
"left",
",",
"Point2D_F64",
"right",
")",
"{",
"leftImageToRect",
".",
"compute",
"(",
"left",
".",
"x",
",",
"left",
".",
"y",
",",
"rectLeft",
")",
";",
"rightImageToRect",
".",
"compute",
"(",
"righ... | Checks to see if the observations from the left and right camera are consistent. Observations
are assumed to be in the original image pixel coordinates.
@param left Left camera observation in original pixels
@param right Right camera observation in original pixels
@return true for consistent | [
"Checks",
"to",
"see",
"if",
"the",
"observations",
"from",
"the",
"left",
"and",
"right",
"camera",
"are",
"consistent",
".",
"Observations",
"are",
"assumed",
"to",
"be",
"in",
"the",
"original",
"image",
"pixel",
"coordinates",
"."
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-sfm/src/main/java/boofcv/alg/feature/associate/StereoConsistencyCheck.java#L87-L92 |
baratine/baratine | web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java | Strategy2StartManualRedeployManual.startOnInit | @Override
public void startOnInit(DeployService2Impl<I> deploy, Result<I> result)
{
deploy.startImpl(result);
} | java | @Override
public void startOnInit(DeployService2Impl<I> deploy, Result<I> result)
{
deploy.startImpl(result);
} | [
"@",
"Override",
"public",
"void",
"startOnInit",
"(",
"DeployService2Impl",
"<",
"I",
">",
"deploy",
",",
"Result",
"<",
"I",
">",
"result",
")",
"{",
"deploy",
".",
"startImpl",
"(",
"result",
")",
";",
"}"
] | Called at initialization time for automatic start.
@param deploy the owning controller | [
"Called",
"at",
"initialization",
"time",
"for",
"automatic",
"start",
"."
] | train | https://github.com/baratine/baratine/blob/db34b45c03c5a5e930d8142acc72319125569fcf/web/src/main/java/com/caucho/v5/deploy2/Strategy2StartManualRedeployManual.java#L83-L87 |
HolmesNL/kafka-spout | src/main/java/nl/minvenj/nfi/storm/kafka/KafkaSpout.java | KafkaSpout.createConsumer | protected void createConsumer(final Map<String, Object> config) {
final Properties consumerConfig = createKafkaConfig(config);
LOG.info("connecting kafka client to zookeeper at {} as client group {}",
consumerConfig.getProperty("zookeeper.connect"),
consumerConfig.getProperty("g... | java | protected void createConsumer(final Map<String, Object> config) {
final Properties consumerConfig = createKafkaConfig(config);
LOG.info("connecting kafka client to zookeeper at {} as client group {}",
consumerConfig.getProperty("zookeeper.connect"),
consumerConfig.getProperty("g... | [
"protected",
"void",
"createConsumer",
"(",
"final",
"Map",
"<",
"String",
",",
"Object",
">",
"config",
")",
"{",
"final",
"Properties",
"consumerConfig",
"=",
"createKafkaConfig",
"(",
"config",
")",
";",
"LOG",
".",
"info",
"(",
"\"connecting kafka client to ... | Ensures an initialized kafka {@link ConsumerConnector} is present.
@param config The storm configuration passed to {@link #open(Map, TopologyContext, SpoutOutputCollector)}.
@throws IllegalArgumentException When a required configuration parameter is missing or a sanity check fails. | [
"Ensures",
"an",
"initialized",
"kafka",
"{",
"@link",
"ConsumerConnector",
"}",
"is",
"present",
"."
] | train | https://github.com/HolmesNL/kafka-spout/blob/bef626b9fab6946a7e0d3c85979ec36ae0870233/src/main/java/nl/minvenj/nfi/storm/kafka/KafkaSpout.java#L170-L177 |
cybazeitalia/emaze-dysfunctional | src/main/java/net/emaze/dysfunctional/Spies.java | Spies.spyRes | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spyRes(TriFunction<T1, T2, T3, R> function, Box<R> result) {
return spy(function, result, Box.<T1>empty(), Box.<T2>empty(), Box.<T3>empty());
} | java | public static <T1, T2, T3, R> TriFunction<T1, T2, T3, R> spyRes(TriFunction<T1, T2, T3, R> function, Box<R> result) {
return spy(function, result, Box.<T1>empty(), Box.<T2>empty(), Box.<T3>empty());
} | [
"public",
"static",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"spyRes",
"(",
"TriFunction",
"<",
"T1",
",",
"T2",
",",
"T3",
",",
"R",
">",
"function",
",",
"Box",
"<",
"R",... | Proxies a ternary function spying for result.
@param <R> the function result type
@param <T1> the function first parameter type
@param <T2> the function second parameter type
@param <T3> the function third parameter type
@param function the function that will be spied
@param result a box that will be containing spied ... | [
"Proxies",
"a",
"ternary",
"function",
"spying",
"for",
"result",
"."
] | train | https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Spies.java#L194-L196 |
jmxtrans/jmxtrans | jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java | Settings.getIntSetting | protected static int getIntSetting(Map<String, Object> settings, String key, int defaultVal) throws IllegalArgumentException {
if (settings.containsKey(key)) {
final Object objectValue = settings.get(key);
if (objectValue == null) {
throw new IllegalArgumentException("Setting '" + key + " null");
}
fi... | java | protected static int getIntSetting(Map<String, Object> settings, String key, int defaultVal) throws IllegalArgumentException {
if (settings.containsKey(key)) {
final Object objectValue = settings.get(key);
if (objectValue == null) {
throw new IllegalArgumentException("Setting '" + key + " null");
}
fi... | [
"protected",
"static",
"int",
"getIntSetting",
"(",
"Map",
"<",
"String",
",",
"Object",
">",
"settings",
",",
"String",
"key",
",",
"int",
"defaultVal",
")",
"throws",
"IllegalArgumentException",
"{",
"if",
"(",
"settings",
".",
"containsKey",
"(",
"key",
"... | Gets an int value for the setting, returning the default value if not
specified.
@param settings
@param key the key to get the int value for
@param defaultVal default value if the setting was not specified
@return the int value for the setting
@throws IllegalArgumentException if setting does not contain an int | [
"Gets",
"an",
"int",
"value",
"for",
"the",
"setting",
"returning",
"the",
"default",
"value",
"if",
"not",
"specified",
"."
] | train | https://github.com/jmxtrans/jmxtrans/blob/496f342de3bcf2c2226626374b7a16edf8f4ba2a/jmxtrans-core/src/main/java/com/googlecode/jmxtrans/model/output/Settings.java#L133-L148 |
GoogleCloudPlatform/appengine-gcs-client | java/src/main/java/com/google/appengine/tools/cloudstorage/oauth/OauthRawGcsService.java | OauthRawGcsService.put | private RawGcsCreationToken put(final GcsRestCreationToken token, ByteBuffer chunk,
final boolean isFinalChunk, long timeoutMillis) throws IOException {
final int length = chunk.remaining();
HTTPRequest req = createPutRequest(token, chunk, isFinalChunk, timeoutMillis, length);
HTTPRequestInfo info = n... | java | private RawGcsCreationToken put(final GcsRestCreationToken token, ByteBuffer chunk,
final boolean isFinalChunk, long timeoutMillis) throws IOException {
final int length = chunk.remaining();
HTTPRequest req = createPutRequest(token, chunk, isFinalChunk, timeoutMillis, length);
HTTPRequestInfo info = n... | [
"private",
"RawGcsCreationToken",
"put",
"(",
"final",
"GcsRestCreationToken",
"token",
",",
"ByteBuffer",
"chunk",
",",
"final",
"boolean",
"isFinalChunk",
",",
"long",
"timeoutMillis",
")",
"throws",
"IOException",
"{",
"final",
"int",
"length",
"=",
"chunk",
".... | Write the provided chunk at the offset specified in the token. If finalChunk is set, the file
will be closed. | [
"Write",
"the",
"provided",
"chunk",
"at",
"the",
"offset",
"specified",
"in",
"the",
"token",
".",
"If",
"finalChunk",
"is",
"set",
"the",
"file",
"will",
"be",
"closed",
"."
] | train | https://github.com/GoogleCloudPlatform/appengine-gcs-client/blob/d11078331ecd915d753c886e96a80133599f3f98/java/src/main/java/com/google/appengine/tools/cloudstorage/oauth/OauthRawGcsService.java#L405-L417 |
UrielCh/ovh-java-sdk | ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java | ApiOvhHostingweb.serviceName_ovhConfig_GET | public ArrayList<Long> serviceName_ovhConfig_GET(String serviceName, Boolean historical, String path) throws IOException {
String qPath = "/hosting/web/{serviceName}/ovhConfig";
StringBuilder sb = path(qPath, serviceName);
query(sb, "historical", historical);
query(sb, "path", path);
String resp = exec(qPath,... | java | public ArrayList<Long> serviceName_ovhConfig_GET(String serviceName, Boolean historical, String path) throws IOException {
String qPath = "/hosting/web/{serviceName}/ovhConfig";
StringBuilder sb = path(qPath, serviceName);
query(sb, "historical", historical);
query(sb, "path", path);
String resp = exec(qPath,... | [
"public",
"ArrayList",
"<",
"Long",
">",
"serviceName_ovhConfig_GET",
"(",
"String",
"serviceName",
",",
"Boolean",
"historical",
",",
"String",
"path",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/hosting/web/{serviceName}/ovhConfig\"",
";",
"String... | Configuration used on your hosting
REST: GET /hosting/web/{serviceName}/ovhConfig
@param path [required] Filter the value of path property (like)
@param historical [required] Filter the value of historical property (=)
@param serviceName [required] The internal name of your hosting | [
"Configuration",
"used",
"on",
"your",
"hosting"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-hostingweb/src/main/java/net/minidev/ovh/api/ApiOvhHostingweb.java#L214-L221 |
Azure/azure-sdk-for-java | containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java | ContainersInner.listLogs | public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName, Integer tail) {
return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body();
} | java | public LogsInner listLogs(String resourceGroupName, String containerGroupName, String containerName, Integer tail) {
return listLogsWithServiceResponseAsync(resourceGroupName, containerGroupName, containerName, tail).toBlocking().single().body();
} | [
"public",
"LogsInner",
"listLogs",
"(",
"String",
"resourceGroupName",
",",
"String",
"containerGroupName",
",",
"String",
"containerName",
",",
"Integer",
"tail",
")",
"{",
"return",
"listLogsWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"containerGroupName",... | Get the logs for a specified container instance.
Get the logs for a specified container instance in a specified resource group and container group.
@param resourceGroupName The name of the resource group.
@param containerGroupName The name of the container group.
@param containerName The name of the container instance... | [
"Get",
"the",
"logs",
"for",
"a",
"specified",
"container",
"instance",
".",
"Get",
"the",
"logs",
"for",
"a",
"specified",
"container",
"instance",
"in",
"a",
"specified",
"resource",
"group",
"and",
"container",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerinstance/resource-manager/v2018_10_01/src/main/java/com/microsoft/azure/management/containerinstance/v2018_10_01/implementation/ContainersInner.java#L172-L174 |
biojava/biojava | biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java | NCBIQBlastService.sendAlignmentRequest | @Override
public String sendAlignmentRequest(Sequence<Compound> seq, RemotePairwiseAlignmentProperties rpa) throws Exception {
return sendAlignmentRequest(seq.getSequenceAsString(), rpa);
} | java | @Override
public String sendAlignmentRequest(Sequence<Compound> seq, RemotePairwiseAlignmentProperties rpa) throws Exception {
return sendAlignmentRequest(seq.getSequenceAsString(), rpa);
} | [
"@",
"Override",
"public",
"String",
"sendAlignmentRequest",
"(",
"Sequence",
"<",
"Compound",
">",
"seq",
",",
"RemotePairwiseAlignmentProperties",
"rpa",
")",
"throws",
"Exception",
"{",
"return",
"sendAlignmentRequest",
"(",
"seq",
".",
"getSequenceAsString",
"(",
... | Converts given sequence to String and calls
{@link #sendAlignmentRequest(String, RemotePairwiseAlignmentProperties)} | [
"Converts",
"given",
"sequence",
"to",
"String",
"and",
"calls",
"{"
] | train | https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-ws/src/main/java/org/biojava/nbio/ws/alignment/qblast/NCBIQBlastService.java#L142-L145 |
alkacon/opencms-core | src/org/opencms/publish/CmsPublishManager.java | CmsPublishManager.getPublishList | public CmsPublishList getPublishList(
CmsObject cms,
List<CmsResource> directPublishResources,
boolean directPublishSiblings,
boolean publishSubResources) throws CmsException {
return m_securityManager.fillPublishList(
cms.getRequestContext(),
new CmsPubl... | java | public CmsPublishList getPublishList(
CmsObject cms,
List<CmsResource> directPublishResources,
boolean directPublishSiblings,
boolean publishSubResources) throws CmsException {
return m_securityManager.fillPublishList(
cms.getRequestContext(),
new CmsPubl... | [
"public",
"CmsPublishList",
"getPublishList",
"(",
"CmsObject",
"cms",
",",
"List",
"<",
"CmsResource",
">",
"directPublishResources",
",",
"boolean",
"directPublishSiblings",
",",
"boolean",
"publishSubResources",
")",
"throws",
"CmsException",
"{",
"return",
"m_securi... | Returns a publish list with all new/changed/deleted resources of the current (offline)
project that actually get published for a direct publish of a List of resources.<p>
@param cms the cms request context
@param directPublishResources the {@link CmsResource} objects which will be directly published
@param directPubli... | [
"Returns",
"a",
"publish",
"list",
"with",
"all",
"new",
"/",
"changed",
"/",
"deleted",
"resources",
"of",
"the",
"current",
"(",
"offline",
")",
"project",
"that",
"actually",
"get",
"published",
"for",
"a",
"direct",
"publish",
"of",
"a",
"List",
"of",
... | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/publish/CmsPublishManager.java#L350-L359 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java | ModelsImpl.getClosedListAsync | public Observable<ClosedListEntityExtractor> getClosedListAsync(UUID appId, String versionId, UUID clEntityId) {
return getClosedListWithServiceResponseAsync(appId, versionId, clEntityId).map(new Func1<ServiceResponse<ClosedListEntityExtractor>, ClosedListEntityExtractor>() {
@Override
p... | java | public Observable<ClosedListEntityExtractor> getClosedListAsync(UUID appId, String versionId, UUID clEntityId) {
return getClosedListWithServiceResponseAsync(appId, versionId, clEntityId).map(new Func1<ServiceResponse<ClosedListEntityExtractor>, ClosedListEntityExtractor>() {
@Override
p... | [
"public",
"Observable",
"<",
"ClosedListEntityExtractor",
">",
"getClosedListAsync",
"(",
"UUID",
"appId",
",",
"String",
"versionId",
",",
"UUID",
"clEntityId",
")",
"{",
"return",
"getClosedListWithServiceResponseAsync",
"(",
"appId",
",",
"versionId",
",",
"clEntit... | Gets information of a closed list model.
@param appId The application ID.
@param versionId The version ID.
@param clEntityId The closed list model ID.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the ClosedListEntityExtractor object | [
"Gets",
"information",
"of",
"a",
"closed",
"list",
"model",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L4245-L4252 |
snowflakedb/snowflake-jdbc | src/main/java/net/snowflake/client/core/SessionUtil.java | SessionUtil.handleFederatedFlowError | private static void handleFederatedFlowError(LoginInput loginInput, Exception ex)
throws SnowflakeSQLException
{
if (ex instanceof IOException)
{
logger.error("IOException when authenticating with " +
loginInput.getAuthenticator(), ex);
throw new SnowflakeSQLException(ex, Sql... | java | private static void handleFederatedFlowError(LoginInput loginInput, Exception ex)
throws SnowflakeSQLException
{
if (ex instanceof IOException)
{
logger.error("IOException when authenticating with " +
loginInput.getAuthenticator(), ex);
throw new SnowflakeSQLException(ex, Sql... | [
"private",
"static",
"void",
"handleFederatedFlowError",
"(",
"LoginInput",
"loginInput",
",",
"Exception",
"ex",
")",
"throws",
"SnowflakeSQLException",
"{",
"if",
"(",
"ex",
"instanceof",
"IOException",
")",
"{",
"logger",
".",
"error",
"(",
"\"IOException when au... | Logs an error generated during the federated authentication flow and
re-throws it as a SnowflakeSQLException.
Note that we seperate IOExceptions since those tend to be network related.
@param loginInput
@param ex
@throws SnowflakeSQLException | [
"Logs",
"an",
"error",
"generated",
"during",
"the",
"federated",
"authentication",
"flow",
"and",
"re",
"-",
"throws",
"it",
"as",
"a",
"SnowflakeSQLException",
".",
"Note",
"that",
"we",
"seperate",
"IOExceptions",
"since",
"those",
"tend",
"to",
"be",
"netw... | train | https://github.com/snowflakedb/snowflake-jdbc/blob/98567b5a57753f29d51446809640b969a099658f/src/main/java/net/snowflake/client/core/SessionUtil.java#L1352-L1371 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java | DecimalFormat.getEquivalentDecimals | private UnicodeSet getEquivalentDecimals(String decimal, boolean strictParse) {
UnicodeSet equivSet = UnicodeSet.EMPTY;
if (strictParse) {
if (strictDotEquivalents.contains(decimal)) {
equivSet = strictDotEquivalents;
} else if (strictCommaEquivalents.contains(dec... | java | private UnicodeSet getEquivalentDecimals(String decimal, boolean strictParse) {
UnicodeSet equivSet = UnicodeSet.EMPTY;
if (strictParse) {
if (strictDotEquivalents.contains(decimal)) {
equivSet = strictDotEquivalents;
} else if (strictCommaEquivalents.contains(dec... | [
"private",
"UnicodeSet",
"getEquivalentDecimals",
"(",
"String",
"decimal",
",",
"boolean",
"strictParse",
")",
"{",
"UnicodeSet",
"equivSet",
"=",
"UnicodeSet",
".",
"EMPTY",
";",
"if",
"(",
"strictParse",
")",
"{",
"if",
"(",
"strictDotEquivalents",
".",
"cont... | Returns a set of characters equivalent to the given desimal separator used for
parsing number. This method may return an empty set. | [
"Returns",
"a",
"set",
"of",
"characters",
"equivalent",
"to",
"the",
"given",
"desimal",
"separator",
"used",
"for",
"parsing",
"number",
".",
"This",
"method",
"may",
"return",
"an",
"empty",
"set",
"."
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DecimalFormat.java#L2824-L2840 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.bucketSort | public static void bucketSort(final Object[] a, final int fromIndex, final int toIndex) {
Array.bucketSort(a, fromIndex, toIndex);
} | java | public static void bucketSort(final Object[] a, final int fromIndex, final int toIndex) {
Array.bucketSort(a, fromIndex, toIndex);
} | [
"public",
"static",
"void",
"bucketSort",
"(",
"final",
"Object",
"[",
"]",
"a",
",",
"final",
"int",
"fromIndex",
",",
"final",
"int",
"toIndex",
")",
"{",
"Array",
".",
"bucketSort",
"(",
"a",
",",
"fromIndex",
",",
"toIndex",
")",
";",
"}"
] | Note: All the objects with same value will be replaced with first element with the same value.
@param a the elements in the array must implements the <code>Comparable</code> interface.
@param fromIndex
@param toIndex | [
"Note",
":",
"All",
"the",
"objects",
"with",
"same",
"value",
"will",
"be",
"replaced",
"with",
"first",
"element",
"with",
"the",
"same",
"value",
"."
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L12008-L12010 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java | ElementsExceptionsFactory.newServiceInvocationException | public static ServiceInvocationException newServiceInvocationException(Throwable cause,
String message, Object... args) {
return new ServiceInvocationException(format(message, args), cause);
} | java | public static ServiceInvocationException newServiceInvocationException(Throwable cause,
String message, Object... args) {
return new ServiceInvocationException(format(message, args), cause);
} | [
"public",
"static",
"ServiceInvocationException",
"newServiceInvocationException",
"(",
"Throwable",
"cause",
",",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"new",
"ServiceInvocationException",
"(",
"format",
"(",
"message",
",",
"args",
... | Constructs and initializes a new {@link ServiceInvocationException} with the given {@link Throwable cause}
and {@link String message} formatted with the given {@link Object[] arguments}.
@param cause {@link Throwable} identified as the reason this {@link ServiceInvocationException} was thrown.
@param message {@link St... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"ServiceInvocationException",
"}",
"with",
"the",
"given",
"{",
"@link",
"Throwable",
"cause",
"}",
"and",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
... | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L685-L689 |
Red5/red5-server-common | src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolEncoder.java | RTMPProtocolEncoder.getHeaderType | private byte getHeaderType(final Header header, final Header lastHeader) {
//int lastFullTs = ((RTMPConnection) Red5.getConnectionLocal()).getState().getLastFullTimestampWritten(header.getChannelId());
if (lastHeader == null || header.getStreamId() != lastHeader.getStreamId() || header.getTimer() < la... | java | private byte getHeaderType(final Header header, final Header lastHeader) {
//int lastFullTs = ((RTMPConnection) Red5.getConnectionLocal()).getState().getLastFullTimestampWritten(header.getChannelId());
if (lastHeader == null || header.getStreamId() != lastHeader.getStreamId() || header.getTimer() < la... | [
"private",
"byte",
"getHeaderType",
"(",
"final",
"Header",
"header",
",",
"final",
"Header",
"lastHeader",
")",
"{",
"//int lastFullTs = ((RTMPConnection) Red5.getConnectionLocal()).getState().getLastFullTimestampWritten(header.getChannelId());\r",
"if",
"(",
"lastHeader",
"==",
... | Determine type of header to use.
@param header RTMP message header
@param lastHeader Previous header
@return Header type to use | [
"Determine",
"type",
"of",
"header",
"to",
"use",
"."
] | train | https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/codec/RTMPProtocolEncoder.java#L356-L370 |
Azure/azure-sdk-for-java | cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/implementation/BingCustomInstancesImpl.java | BingCustomInstancesImpl.imageSearchAsync | public Observable<Images> imageSearchAsync(long customConfig, String query, ImageSearchOptionalParameter imageSearchOptionalParameter) {
return imageSearchWithServiceResponseAsync(customConfig, query, imageSearchOptionalParameter).map(new Func1<ServiceResponse<Images>, Images>() {
@Override
... | java | public Observable<Images> imageSearchAsync(long customConfig, String query, ImageSearchOptionalParameter imageSearchOptionalParameter) {
return imageSearchWithServiceResponseAsync(customConfig, query, imageSearchOptionalParameter).map(new Func1<ServiceResponse<Images>, Images>() {
@Override
... | [
"public",
"Observable",
"<",
"Images",
">",
"imageSearchAsync",
"(",
"long",
"customConfig",
",",
"String",
"query",
",",
"ImageSearchOptionalParameter",
"imageSearchOptionalParameter",
")",
"{",
"return",
"imageSearchWithServiceResponseAsync",
"(",
"customConfig",
",",
"... | The Custom Image Search API lets you send an image search query to Bing and get image results found in your custom view of the web.
@param customConfig The identifier for the custom search configuration
@param query The user's search query term. The term cannot be empty. The term may contain [Bing Advanced Operators](... | [
"The",
"Custom",
"Image",
"Search",
"API",
"lets",
"you",
"send",
"an",
"image",
"search",
"query",
"to",
"Bing",
"and",
"get",
"image",
"results",
"found",
"in",
"your",
"custom",
"view",
"of",
"the",
"web",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/search/bingcustomimagesearch/src/main/java/com/microsoft/azure/cognitiveservices/search/customimagesearch/implementation/BingCustomInstancesImpl.java#L109-L116 |
alkacon/opencms-core | src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java | CmsXmlSitemapGenerator.replaceServerUri | public static String replaceServerUri(String link, String server) {
String serverUriStr = server;
if (CmsStringUtil.isEmptyOrWhitespaceOnly(serverUriStr)) {
return link;
}
try {
URI serverUri = new URI(serverUriStr);
URI linkUri = new URI(li... | java | public static String replaceServerUri(String link, String server) {
String serverUriStr = server;
if (CmsStringUtil.isEmptyOrWhitespaceOnly(serverUriStr)) {
return link;
}
try {
URI serverUri = new URI(serverUriStr);
URI linkUri = new URI(li... | [
"public",
"static",
"String",
"replaceServerUri",
"(",
"String",
"link",
",",
"String",
"server",
")",
"{",
"String",
"serverUriStr",
"=",
"server",
";",
"if",
"(",
"CmsStringUtil",
".",
"isEmptyOrWhitespaceOnly",
"(",
"serverUriStr",
")",
")",
"{",
"return",
... | Replaces the protocol/host/port of a link with the ones from the given server URI, if it's not empty.<p>
@param link the link to change
@param server the server URI string
@return the changed link | [
"Replaces",
"the",
"protocol",
"/",
"host",
"/",
"port",
"of",
"a",
"link",
"with",
"the",
"ones",
"from",
"the",
"given",
"server",
"URI",
"if",
"it",
"s",
"not",
"empty",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/site/xmlsitemap/CmsXmlSitemapGenerator.java#L211-L233 |
alkacon/opencms-core | src/org/opencms/workplace/tools/CmsToolGroup.java | CmsToolGroup.addAdminTool | public void addAdminTool(CmsTool adminTool, float position) {
m_container.addIdentifiableObject(adminTool.getId(), adminTool, position);
} | java | public void addAdminTool(CmsTool adminTool, float position) {
m_container.addIdentifiableObject(adminTool.getId(), adminTool, position);
} | [
"public",
"void",
"addAdminTool",
"(",
"CmsTool",
"adminTool",
",",
"float",
"position",
")",
"{",
"m_container",
".",
"addIdentifiableObject",
"(",
"adminTool",
".",
"getId",
"(",
")",
",",
"adminTool",
",",
"position",
")",
";",
"}"
] | Adds an admin tool at the given position.<p>
@param adminTool the admin tool
@param position the position
@see org.opencms.workplace.tools.CmsIdentifiableObjectContainer#addIdentifiableObject(String, Object, float) | [
"Adds",
"an",
"admin",
"tool",
"at",
"the",
"given",
"position",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/tools/CmsToolGroup.java#L87-L90 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/ProfilePictureView.java | ProfilePictureView.onMeasure | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
ViewGroup.LayoutParams params = getLayoutParams();
boolean customMeasure = false;
int newHeight = MeasureSpec.getSize(heightMeasureSpec);
int newWidth = MeasureSpec.getSize(widthMeasureSpec);
if... | java | @Override
protected void onMeasure(int widthMeasureSpec, int heightMeasureSpec) {
ViewGroup.LayoutParams params = getLayoutParams();
boolean customMeasure = false;
int newHeight = MeasureSpec.getSize(heightMeasureSpec);
int newWidth = MeasureSpec.getSize(widthMeasureSpec);
if... | [
"@",
"Override",
"protected",
"void",
"onMeasure",
"(",
"int",
"widthMeasureSpec",
",",
"int",
"heightMeasureSpec",
")",
"{",
"ViewGroup",
".",
"LayoutParams",
"params",
"=",
"getLayoutParams",
"(",
")",
";",
"boolean",
"customMeasure",
"=",
"false",
";",
"int",... | Overriding onMeasure to handle the case where WRAP_CONTENT might be
specified in the layout. Since we don't know the dimensions of the profile
photo, we need to handle this case specifically.
<p/>
The approach is to default to a NORMAL sized amount of space in the case that
a preset size is not specified. This logic is... | [
"Overriding",
"onMeasure",
"to",
"handle",
"the",
"case",
"where",
"WRAP_CONTENT",
"might",
"be",
"specified",
"in",
"the",
"layout",
".",
"Since",
"we",
"don",
"t",
"know",
"the",
"dimensions",
"of",
"the",
"profile",
"photo",
"we",
"need",
"to",
"handle",
... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/ProfilePictureView.java#L267-L296 |
mgormley/pacaya | src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java | ProjDepTreeFactor.getLogOddsRatios | private EdgeScores getLogOddsRatios(VarTensor[] inMsgs) {
EdgeScores es = new EdgeScores(n, Double.NEGATIVE_INFINITY);
Algebra s = inMsgs[0].getAlgebra();
// Compute the odds ratios of the messages for each edge in the tree.
for (VarTensor inMsg : inMsgs) {
LinkVar link = (... | java | private EdgeScores getLogOddsRatios(VarTensor[] inMsgs) {
EdgeScores es = new EdgeScores(n, Double.NEGATIVE_INFINITY);
Algebra s = inMsgs[0].getAlgebra();
// Compute the odds ratios of the messages for each edge in the tree.
for (VarTensor inMsg : inMsgs) {
LinkVar link = (... | [
"private",
"EdgeScores",
"getLogOddsRatios",
"(",
"VarTensor",
"[",
"]",
"inMsgs",
")",
"{",
"EdgeScores",
"es",
"=",
"new",
"EdgeScores",
"(",
"n",
",",
"Double",
".",
"NEGATIVE_INFINITY",
")",
";",
"Algebra",
"s",
"=",
"inMsgs",
"[",
"0",
"]",
".",
"ge... | Computes the log odds ratio for each edge. w_i = \mu_i(1) / \mu_i(0) | [
"Computes",
"the",
"log",
"odds",
"ratio",
"for",
"each",
"edge",
".",
"w_i",
"=",
"\\",
"mu_i",
"(",
"1",
")",
"/",
"\\",
"mu_i",
"(",
"0",
")"
] | train | https://github.com/mgormley/pacaya/blob/786294cbac7cc65dbc32210c10acc32ed0c69233/src/main/java/edu/jhu/pacaya/gm/model/globalfac/ProjDepTreeFactor.java#L365-L379 |
jenkinsci/support-core-plugin | src/main/java/com/cloudbees/jenkins/support/filter/ContentMappings.java | ContentMappings.getMappingOrCreate | public @Nonnull ContentMapping getMappingOrCreate(@Nonnull String original, @Nonnull Function<String, ContentMapping> generator) {
boolean isNew = !mappings.containsKey(original);
ContentMapping mapping = mappings.computeIfAbsent(original, generator);
try {
if (isNew) {
... | java | public @Nonnull ContentMapping getMappingOrCreate(@Nonnull String original, @Nonnull Function<String, ContentMapping> generator) {
boolean isNew = !mappings.containsKey(original);
ContentMapping mapping = mappings.computeIfAbsent(original, generator);
try {
if (isNew) {
... | [
"public",
"@",
"Nonnull",
"ContentMapping",
"getMappingOrCreate",
"(",
"@",
"Nonnull",
"String",
"original",
",",
"@",
"Nonnull",
"Function",
"<",
"String",
",",
"ContentMapping",
">",
"generator",
")",
"{",
"boolean",
"isNew",
"=",
"!",
"mappings",
".",
"cont... | Looks up or creates a new ContentMapping for the given original string and a ContentMapping generator. | [
"Looks",
"up",
"or",
"creates",
"a",
"new",
"ContentMapping",
"for",
"the",
"given",
"original",
"string",
"and",
"a",
"ContentMapping",
"generator",
"."
] | train | https://github.com/jenkinsci/support-core-plugin/blob/bcbe1dfd5bf48ac89903645cd48ed897c1a04688/src/main/java/com/cloudbees/jenkins/support/filter/ContentMappings.java#L167-L178 |
apache/incubator-gobblin | gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java | ProxiedTrash.getUserTrash | protected Trash getUserTrash(final String user) throws IOException {
if (UserGroupInformation.getCurrentUser().getShortUserName().equals(user)) {
return this;
}
try {
return this.trashCache.get(user, new Callable<Trash>() {
@Override
public Trash call() throws Exception {
... | java | protected Trash getUserTrash(final String user) throws IOException {
if (UserGroupInformation.getCurrentUser().getShortUserName().equals(user)) {
return this;
}
try {
return this.trashCache.get(user, new Callable<Trash>() {
@Override
public Trash call() throws Exception {
... | [
"protected",
"Trash",
"getUserTrash",
"(",
"final",
"String",
"user",
")",
"throws",
"IOException",
"{",
"if",
"(",
"UserGroupInformation",
".",
"getCurrentUser",
"(",
")",
".",
"getShortUserName",
"(",
")",
".",
"equals",
"(",
"user",
")",
")",
"{",
"return... | Get {@link org.apache.gobblin.data.management.trash.Trash} instance for the specified user.
@param user user for whom {@link org.apache.gobblin.data.management.trash.Trash} should be generated.
@return {@link org.apache.gobblin.data.management.trash.Trash} as generated by proxied user.
@throws IOException | [
"Get",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-data-management/src/main/java/org/apache/gobblin/data/management/trash/ProxiedTrash.java#L145-L159 |
jbundle/jbundle | base/base/src/main/java/org/jbundle/base/field/PasswordPropertiesField.java | PasswordPropertiesField.setProperty | public int setProperty(String strProperty, String strValue, boolean bDisplayOption, int iMoveMode)
{
if (m_setPropertiesDescriptions != null)
if (m_setPropertiesDescriptions.contains(strProperty))
{
byte[] rgbValue = strValue.getBytes();
rgbValue = XorEncr... | java | public int setProperty(String strProperty, String strValue, boolean bDisplayOption, int iMoveMode)
{
if (m_setPropertiesDescriptions != null)
if (m_setPropertiesDescriptions.contains(strProperty))
{
byte[] rgbValue = strValue.getBytes();
rgbValue = XorEncr... | [
"public",
"int",
"setProperty",
"(",
"String",
"strProperty",
",",
"String",
"strValue",
",",
"boolean",
"bDisplayOption",
",",
"int",
"iMoveMode",
")",
"{",
"if",
"(",
"m_setPropertiesDescriptions",
"!=",
"null",
")",
"if",
"(",
"m_setPropertiesDescriptions",
"."... | Set this property in the user's property area.
@param strProperty The property key.
@param strValue The property value.
@param iDisplayOption If true, display the new field.
@param iMoveMove The move mode.
@return An error code (NORMAL_RETURN for success). | [
"Set",
"this",
"property",
"in",
"the",
"user",
"s",
"property",
"area",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/PasswordPropertiesField.java#L106-L117 |
box/box-java-sdk | src/main/java/com/box/sdk/BoxItem.java | BoxItem.getWatermark | protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
... | java | protected BoxWatermark getWatermark(URLTemplate itemUrl, String... fields) {
URL watermarkUrl = itemUrl.build(this.getAPI().getBaseURL(), this.getID());
QueryStringBuilder builder = new QueryStringBuilder();
if (fields.length > 0) {
builder.appendParam("fields", fields);
}
... | [
"protected",
"BoxWatermark",
"getWatermark",
"(",
"URLTemplate",
"itemUrl",
",",
"String",
"...",
"fields",
")",
"{",
"URL",
"watermarkUrl",
"=",
"itemUrl",
".",
"build",
"(",
"this",
".",
"getAPI",
"(",
")",
".",
"getBaseURL",
"(",
")",
",",
"this",
".",
... | Used to retrieve the watermark for the item.
If the item does not have a watermark applied to it, a 404 Not Found will be returned by API.
@param itemUrl url template for the item.
@param fields the fields to retrieve.
@return the watermark associated with the item. | [
"Used",
"to",
"retrieve",
"the",
"watermark",
"for",
"the",
"item",
".",
"If",
"the",
"item",
"does",
"not",
"have",
"a",
"watermark",
"applied",
"to",
"it",
"a",
"404",
"Not",
"Found",
"will",
"be",
"returned",
"by",
"API",
"."
] | train | https://github.com/box/box-java-sdk/blob/35b4ba69417f9d6a002c19dfaab57527750ef349/src/main/java/com/box/sdk/BoxItem.java#L87-L97 |
unbescape/unbescape | src/main/java/org/unbescape/uri/UriEscape.java | UriEscape.unescapeUriQueryParam | public static String unescapeUriQueryParam(final String text, final String encoding) {
if (encoding == null) {
throw new IllegalArgumentException("Argument 'encoding' cannot be null");
}
return UriEscapeUtil.unescape(text, UriEscapeUtil.UriEscapeType.QUERY_PARAM, encoding);
} | java | public static String unescapeUriQueryParam(final String text, final String encoding) {
if (encoding == null) {
throw new IllegalArgumentException("Argument 'encoding' cannot be null");
}
return UriEscapeUtil.unescape(text, UriEscapeUtil.UriEscapeType.QUERY_PARAM, encoding);
} | [
"public",
"static",
"String",
"unescapeUriQueryParam",
"(",
"final",
"String",
"text",
",",
"final",
"String",
"encoding",
")",
"{",
"if",
"(",
"encoding",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Argument 'encoding' cannot be null... | <p>
Perform am URI query parameter (name or value) <strong>unescape</strong> operation
on a <tt>String</tt> input.
</p>
<p>
This method will unescape every percent-encoded (<tt>%HH</tt>) sequences present in input,
even for those characters that do not need to be percent-encoded in this context (unreserved characters
c... | [
"<p",
">",
"Perform",
"am",
"URI",
"query",
"parameter",
"(",
"name",
"or",
"value",
")",
"<strong",
">",
"unescape<",
"/",
"strong",
">",
"operation",
"on",
"a",
"<tt",
">",
"String<",
"/",
"tt",
">",
"input",
".",
"<",
"/",
"p",
">",
"<p",
">",
... | train | https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/uri/UriEscape.java#L1698-L1703 |
SeleniumHQ/selenium | java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java | RemoteWebDriverBuilder.build | public WebDriver build() {
if (options.isEmpty() && additionalCapabilities.isEmpty()) {
throw new SessionNotCreatedException("Refusing to create session without any capabilities");
}
Plan plan = getPlan();
CommandExecutor executor;
if (plan.isUsingDriverService()) {
AtomicReference<Dri... | java | public WebDriver build() {
if (options.isEmpty() && additionalCapabilities.isEmpty()) {
throw new SessionNotCreatedException("Refusing to create session without any capabilities");
}
Plan plan = getPlan();
CommandExecutor executor;
if (plan.isUsingDriverService()) {
AtomicReference<Dri... | [
"public",
"WebDriver",
"build",
"(",
")",
"{",
"if",
"(",
"options",
".",
"isEmpty",
"(",
")",
"&&",
"additionalCapabilities",
".",
"isEmpty",
"(",
")",
")",
"{",
"throw",
"new",
"SessionNotCreatedException",
"(",
"\"Refusing to create session without any capabiliti... | Actually create a new WebDriver session. The returned webdriver is not guaranteed to be a
{@link RemoteWebDriver}. | [
"Actually",
"create",
"a",
"new",
"WebDriver",
"session",
".",
"The",
"returned",
"webdriver",
"is",
"not",
"guaranteed",
"to",
"be",
"a",
"{"
] | train | https://github.com/SeleniumHQ/selenium/blob/7af172729f17b20269c8ca4ea6f788db48616535/java/client/src/org/openqa/selenium/remote/RemoteWebDriverBuilder.java#L194-L227 |
OpenLiberty/open-liberty | dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsCreator.java | StatsCreator.addStatisticsToParent | public static void addStatisticsToParent(SPIStats parentStats, SPIStatistic statistic) {
StatsImpl p = (StatsImpl) parentStats;
StatisticImpl s = (StatisticImpl) statistic;
p.add(s);
} | java | public static void addStatisticsToParent(SPIStats parentStats, SPIStatistic statistic) {
StatsImpl p = (StatsImpl) parentStats;
StatisticImpl s = (StatisticImpl) statistic;
p.add(s);
} | [
"public",
"static",
"void",
"addStatisticsToParent",
"(",
"SPIStats",
"parentStats",
",",
"SPIStatistic",
"statistic",
")",
"{",
"StatsImpl",
"p",
"=",
"(",
"StatsImpl",
")",
"parentStats",
";",
"StatisticImpl",
"s",
"=",
"(",
"StatisticImpl",
")",
"statistic",
... | This method adds one Statistic object as the child of a Stats object
@param parentStats This stats is the parent
@param statistic This statistic should be added | [
"This",
"method",
"adds",
"one",
"Statistic",
"object",
"as",
"the",
"child",
"of",
"a",
"Stats",
"object"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.monitor/src/com/ibm/ws/pmi/stat/StatsCreator.java#L147-L151 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/LateFileRecordCountProvider.java | LateFileRecordCountProvider.constructLateFilePath | public Path constructLateFilePath(String originalFilename, FileSystem fs, Path outputDir) throws IOException {
if (!fs.exists(new Path(outputDir, originalFilename))) {
return new Path(outputDir, originalFilename);
}
return constructLateFilePath(FilenameUtils.getBaseName(originalFilename) + LATE_COMPON... | java | public Path constructLateFilePath(String originalFilename, FileSystem fs, Path outputDir) throws IOException {
if (!fs.exists(new Path(outputDir, originalFilename))) {
return new Path(outputDir, originalFilename);
}
return constructLateFilePath(FilenameUtils.getBaseName(originalFilename) + LATE_COMPON... | [
"public",
"Path",
"constructLateFilePath",
"(",
"String",
"originalFilename",
",",
"FileSystem",
"fs",
",",
"Path",
"outputDir",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"fs",
".",
"exists",
"(",
"new",
"Path",
"(",
"outputDir",
",",
"originalFilenam... | Construct filename for a late file. If the file does not exists in the output dir, retain the original name.
Otherwise, append a LATE_COMPONENT{RandomInteger} to the original file name.
For example, if file "part1.123.avro" exists in dir "/a/b/", the returned path will be "/a/b/part1.123.late12345.avro". | [
"Construct",
"filename",
"for",
"a",
"late",
"file",
".",
"If",
"the",
"file",
"does",
"not",
"exists",
"in",
"the",
"output",
"dir",
"retain",
"the",
"original",
"name",
".",
"Otherwise",
"append",
"a",
"LATE_COMPONENT",
"{",
"RandomInteger",
"}",
"to",
"... | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/util/recordcount/LateFileRecordCountProvider.java#L45-L52 |
rundeck/rundeck | core/src/main/java/com/dtolabs/rundeck/core/storage/StorageTreeFactory.java | StorageTreeFactory.configureConverterPlugin | private TreeBuilder<ResourceMeta> configureConverterPlugin(TreeBuilder<ResourceMeta> builder, int index,
Map<String, String> configProps) {
String pref1 = getConverterConfigPrefix() + SEP + index;
String pluginType = configProps.get(pref1 + ... | java | private TreeBuilder<ResourceMeta> configureConverterPlugin(TreeBuilder<ResourceMeta> builder, int index,
Map<String, String> configProps) {
String pref1 = getConverterConfigPrefix() + SEP + index;
String pluginType = configProps.get(pref1 + ... | [
"private",
"TreeBuilder",
"<",
"ResourceMeta",
">",
"configureConverterPlugin",
"(",
"TreeBuilder",
"<",
"ResourceMeta",
">",
"builder",
",",
"int",
"index",
",",
"Map",
"<",
"String",
",",
"String",
">",
"configProps",
")",
"{",
"String",
"pref1",
"=",
"getCo... | Configure converter plugins for the builder
@param builder builder
@param index given index
@param configProps configuration properties
@return builder | [
"Configure",
"converter",
"plugins",
"for",
"the",
"builder"
] | train | https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/storage/StorageTreeFactory.java#L204-L227 |
spring-projects/spring-boot | spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java | JarWriter.writeEntry | @Override
public void writeEntry(String entryName, InputStream inputStream) throws IOException {
JarArchiveEntry entry = new JarArchiveEntry(entryName);
writeEntry(entry, new InputStreamEntryWriter(inputStream, true));
} | java | @Override
public void writeEntry(String entryName, InputStream inputStream) throws IOException {
JarArchiveEntry entry = new JarArchiveEntry(entryName);
writeEntry(entry, new InputStreamEntryWriter(inputStream, true));
} | [
"@",
"Override",
"public",
"void",
"writeEntry",
"(",
"String",
"entryName",
",",
"InputStream",
"inputStream",
")",
"throws",
"IOException",
"{",
"JarArchiveEntry",
"entry",
"=",
"new",
"JarArchiveEntry",
"(",
"entryName",
")",
";",
"writeEntry",
"(",
"entry",
... | Writes an entry. The {@code inputStream} is closed once the entry has been written
@param entryName the name of the entry
@param inputStream the stream from which the entry's data can be read
@throws IOException if the write fails | [
"Writes",
"an",
"entry",
".",
"The",
"{"
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-loader-tools/src/main/java/org/springframework/boot/loader/tools/JarWriter.java#L167-L171 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/UserAPI.java | UserAPI.tagsMembersGetblacklist | public static GetblacklistResult tagsMembersGetblacklist(String access_token,String begin_openid){
String json = String.format("{\"begin_openid\":\"%s\"}",begin_openid == null?"":begin_openid);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bi... | java | public static GetblacklistResult tagsMembersGetblacklist(String access_token,String begin_openid){
String json = String.format("{\"begin_openid\":\"%s\"}",begin_openid == null?"":begin_openid);
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI+"/cgi-bi... | [
"public",
"static",
"GetblacklistResult",
"tagsMembersGetblacklist",
"(",
"String",
"access_token",
",",
"String",
"begin_openid",
")",
"{",
"String",
"json",
"=",
"String",
".",
"format",
"(",
"\"{\\\"begin_openid\\\":\\\"%s\\\"}\"",
",",
"begin_openid",
"==",
"null",
... | 黑名单管理 获取公众号的黑名单列表<br>
该接口每次调用最多可拉取 10000 个OpenID,当列表数较多时,可以通过多次拉取的方式来满足需求。
@since 2.8.1
@param access_token access_token
@param begin_openid 当 begin_openid 为空时,默认从开头拉取。
@return result | [
"黑名单管理",
"获取公众号的黑名单列表<br",
">",
"该接口每次调用最多可拉取",
"10000",
"个OpenID,当列表数较多时,可以通过多次拉取的方式来满足需求。"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/UserAPI.java#L431-L440 |
pravega/pravega | common/src/main/java/io/pravega/common/io/StreamHelpers.java | StreamHelpers.readAll | public static int readAll(InputStream stream, byte[] target, int startOffset, int maxLength) throws IOException {
Preconditions.checkNotNull(stream, "stream");
Preconditions.checkNotNull(stream, "target");
Preconditions.checkElementIndex(startOffset, target.length, "startOffset");
Except... | java | public static int readAll(InputStream stream, byte[] target, int startOffset, int maxLength) throws IOException {
Preconditions.checkNotNull(stream, "stream");
Preconditions.checkNotNull(stream, "target");
Preconditions.checkElementIndex(startOffset, target.length, "startOffset");
Except... | [
"public",
"static",
"int",
"readAll",
"(",
"InputStream",
"stream",
",",
"byte",
"[",
"]",
"target",
",",
"int",
"startOffset",
",",
"int",
"maxLength",
")",
"throws",
"IOException",
"{",
"Preconditions",
".",
"checkNotNull",
"(",
"stream",
",",
"\"stream\"",
... | Reads at most 'maxLength' bytes from the given input stream, as long as the stream still has data to serve.
@param stream The InputStream to read from.
@param target The target array to write data to.
@param startOffset The offset within the target array to start writing data to.
@param maxLength The maxim... | [
"Reads",
"at",
"most",
"maxLength",
"bytes",
"from",
"the",
"given",
"input",
"stream",
"as",
"long",
"as",
"the",
"stream",
"still",
"has",
"data",
"to",
"serve",
"."
] | train | https://github.com/pravega/pravega/blob/6e24df7470669b3956a07018f52b2c6b3c2a3503/common/src/main/java/io/pravega/common/io/StreamHelpers.java#L32-L50 |
jbehave/jbehave-core | jbehave-core/src/main/java/org/jbehave/core/steps/StepCreator.java | StepCreator.parameterNames | private ParameterName[] parameterNames(Method method) {
ParameterName[] parameterNames;
if (method != null) {
String[] annotatedNames = annotatedParameterNames(method);
String[] paranamerNames = paranamerParameterNames(method);
String[] contextNames = contextParameter... | java | private ParameterName[] parameterNames(Method method) {
ParameterName[] parameterNames;
if (method != null) {
String[] annotatedNames = annotatedParameterNames(method);
String[] paranamerNames = paranamerParameterNames(method);
String[] contextNames = contextParameter... | [
"private",
"ParameterName",
"[",
"]",
"parameterNames",
"(",
"Method",
"method",
")",
"{",
"ParameterName",
"[",
"]",
"parameterNames",
";",
"if",
"(",
"method",
"!=",
"null",
")",
"{",
"String",
"[",
"]",
"annotatedNames",
"=",
"annotatedParameterNames",
"(",... | Returns the {@link ParameterName} representations for the method,
providing an abstraction that supports both annotated and non-annotated
parameters.
@param method the Method
@return The array of {@link ParameterName}s | [
"Returns",
"the",
"{",
"@link",
"ParameterName",
"}",
"representations",
"for",
"the",
"method",
"providing",
"an",
"abstraction",
"that",
"supports",
"both",
"annotated",
"and",
"non",
"-",
"annotated",
"parameters",
"."
] | train | https://github.com/jbehave/jbehave-core/blob/bdd6a6199528df3c35087e72d4644870655b23e6/jbehave-core/src/main/java/org/jbehave/core/steps/StepCreator.java#L138-L157 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.rules_GET | public OvhRule rules_GET(String cartId, Long itemId) throws IOException {
String qPath = "/domain/rules";
StringBuilder sb = path(qPath);
query(sb, "cartId", cartId);
query(sb, "itemId", itemId);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRule.class);
} | java | public OvhRule rules_GET(String cartId, Long itemId) throws IOException {
String qPath = "/domain/rules";
StringBuilder sb = path(qPath);
query(sb, "cartId", cartId);
query(sb, "itemId", itemId);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, OvhRule.class);
} | [
"public",
"OvhRule",
"rules_GET",
"(",
"String",
"cartId",
",",
"Long",
"itemId",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/rules\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"query",
"(",
"sb",
",",
"\"c... | List all the rules for a specific cartId/itemId
REST: GET /domain/rules
@param cartId [required] Cart ID concerned for the rules
@param itemId [required] Item ID concerned for the rules
API beta | [
"List",
"all",
"the",
"rules",
"for",
"a",
"specific",
"cartId",
"/",
"itemId"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L310-L317 |
RobotiumTech/robotium | robotium-solo/src/main/java/com/robotium/solo/Searcher.java | Searcher.searchForWebElement | public WebElement searchForWebElement(final By by, int minimumNumberOfMatches){
if(minimumNumberOfMatches < 1){
minimumNumberOfMatches = 1;
}
List<WebElement> viewsFromScreen = webUtils.getWebElements(by, true);
addViewsToList (webElements, viewsFromScreen);
return getViewFromList(webElements, minimumNu... | java | public WebElement searchForWebElement(final By by, int minimumNumberOfMatches){
if(minimumNumberOfMatches < 1){
minimumNumberOfMatches = 1;
}
List<WebElement> viewsFromScreen = webUtils.getWebElements(by, true);
addViewsToList (webElements, viewsFromScreen);
return getViewFromList(webElements, minimumNu... | [
"public",
"WebElement",
"searchForWebElement",
"(",
"final",
"By",
"by",
",",
"int",
"minimumNumberOfMatches",
")",
"{",
"if",
"(",
"minimumNumberOfMatches",
"<",
"1",
")",
"{",
"minimumNumberOfMatches",
"=",
"1",
";",
"}",
"List",
"<",
"WebElement",
">",
"vie... | Searches for a web element.
@param by the By object e.g. By.id("id");
@param minimumNumberOfMatches the minimum number of matches that are expected to be shown. {@code 0} means any number of matches
@return the web element or null if not found | [
"Searches",
"for",
"a",
"web",
"element",
"."
] | train | https://github.com/RobotiumTech/robotium/blob/75e567c38f26a6a87dc8bef90b3886a20e28d291/robotium-solo/src/main/java/com/robotium/solo/Searcher.java#L231-L241 |
jhipster/jhipster | jhipster-framework/src/main/java/io/github/jhipster/service/QueryService.java | QueryService.buildStringSpecification | protected Specification<ENTITY> buildStringSpecification(StringFilter filter, SingularAttribute<? super ENTITY,
String> field) {
return buildSpecification(filter, root -> root.get(field));
} | java | protected Specification<ENTITY> buildStringSpecification(StringFilter filter, SingularAttribute<? super ENTITY,
String> field) {
return buildSpecification(filter, root -> root.get(field));
} | [
"protected",
"Specification",
"<",
"ENTITY",
">",
"buildStringSpecification",
"(",
"StringFilter",
"filter",
",",
"SingularAttribute",
"<",
"?",
"super",
"ENTITY",
",",
"String",
">",
"field",
")",
"{",
"return",
"buildSpecification",
"(",
"filter",
",",
"root",
... | Helper function to return a specification for filtering on a {@link String} field, where equality, containment,
and null/non-null conditions are supported.
@param filter the individual attribute filter coming from the frontend.
@param field the JPA static metamodel representing the field.
@return a Specification | [
"Helper",
"function",
"to",
"return",
"a",
"specification",
"for",
"filtering",
"on",
"a",
"{",
"@link",
"String",
"}",
"field",
"where",
"equality",
"containment",
"and",
"null",
"/",
"non",
"-",
"null",
"conditions",
"are",
"supported",
"."
] | train | https://github.com/jhipster/jhipster/blob/5dcf4239c7cc035e188ef02447d3c628fac5c5d9/jhipster-framework/src/main/java/io/github/jhipster/service/QueryService.java#L88-L91 |
zaproxy/zaproxy | src/org/zaproxy/zap/extension/dynssl/SslCertificateUtils.java | SslCertificateUtils.pem2Keystore | public static KeyStore pem2Keystore(File pemFile) throws IOException, CertificateException,
InvalidKeySpecException, NoSuchAlgorithmException, KeyStoreException {
String certAndKey = FileUtils.readFileToString(pemFile, StandardCharsets.US_ASCII);
byte[] certBytes = extractCertificate(certAndKey);
byte[]... | java | public static KeyStore pem2Keystore(File pemFile) throws IOException, CertificateException,
InvalidKeySpecException, NoSuchAlgorithmException, KeyStoreException {
String certAndKey = FileUtils.readFileToString(pemFile, StandardCharsets.US_ASCII);
byte[] certBytes = extractCertificate(certAndKey);
byte[]... | [
"public",
"static",
"KeyStore",
"pem2Keystore",
"(",
"File",
"pemFile",
")",
"throws",
"IOException",
",",
"CertificateException",
",",
"InvalidKeySpecException",
",",
"NoSuchAlgorithmException",
",",
"KeyStoreException",
"{",
"String",
"certAndKey",
"=",
"FileUtils",
"... | Code c/o http://stackoverflow.com/questions/12501117/programmatically-obtain-keystore-from-pem
@param pemFile
@return
@throws IOException
@throws CertificateException
@throws InvalidKeySpecException
@throws NoSuchAlgorithmException
@throws KeyStoreException | [
"Code",
"c",
"/",
"o",
"http",
":",
"//",
"stackoverflow",
".",
"com",
"/",
"questions",
"/",
"12501117",
"/",
"programmatically",
"-",
"obtain",
"-",
"keystore",
"-",
"from",
"-",
"pem"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/extension/dynssl/SslCertificateUtils.java#L212-L219 |
mpetazzoni/ttorrent | ttorrent-client/src/main/java/com/turn/ttorrent/client/SharedTorrent.java | SharedTorrent.handlePieceAvailability | @Override
public void handlePieceAvailability(SharingPeer peer, Piece piece) {
boolean isPeerInteresting = !this.completedPieces.get(piece.getIndex()) &&
!this.requestedPieces.get(piece.getIndex());
if (isPeerInteresting) {
peer.interesting();
}
piece.seenAt(peer);
logger.trace... | java | @Override
public void handlePieceAvailability(SharingPeer peer, Piece piece) {
boolean isPeerInteresting = !this.completedPieces.get(piece.getIndex()) &&
!this.requestedPieces.get(piece.getIndex());
if (isPeerInteresting) {
peer.interesting();
}
piece.seenAt(peer);
logger.trace... | [
"@",
"Override",
"public",
"void",
"handlePieceAvailability",
"(",
"SharingPeer",
"peer",
",",
"Piece",
"piece",
")",
"{",
"boolean",
"isPeerInteresting",
"=",
"!",
"this",
".",
"completedPieces",
".",
"get",
"(",
"piece",
".",
"getIndex",
"(",
")",
")",
"&&... | Piece availability handler.
<p/>
<p>
Handle updates in piece availability from a peer's HAVE message. When
this happens, we need to mark that piece as available from the peer.
</p>
@param peer The peer we got the update from.
@param piece The piece that became available. | [
"Piece",
"availability",
"handler",
".",
"<p",
"/",
">",
"<p",
">",
"Handle",
"updates",
"in",
"piece",
"availability",
"from",
"a",
"peer",
"s",
"HAVE",
"message",
".",
"When",
"this",
"happens",
"we",
"need",
"to",
"mark",
"that",
"piece",
"as",
"avail... | train | https://github.com/mpetazzoni/ttorrent/blob/ecd0e6caf853b63393c4ab63cfd8f20114f73f70/ttorrent-client/src/main/java/com/turn/ttorrent/client/SharedTorrent.java#L556-L580 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.