repository_name stringlengths 7 58 | func_path_in_repository stringlengths 18 188 | func_name stringlengths 7 127 | whole_func_string stringlengths 77 3.91k | language stringclasses 1
value | func_code_string stringlengths 77 3.91k | func_code_tokens listlengths 20 745 | func_documentation_string stringlengths 61 1.98k | func_documentation_tokens listlengths 1 477 | split_name stringclasses 1
value | func_code_url stringlengths 111 288 |
|---|---|---|---|---|---|---|---|---|---|---|
wcm-io/wcm-io-tooling | maven/plugins/json-dialog-conversion-plugin/src/main/java/io/wcm/maven/plugins/jsondlgcnv/DialogConverter.java | DialogConverter.rewriteProperty | private void rewriteProperty(JSONObject node, String key, JSONArray rewriteProperty) throws JSONException {
if (node.get(cleanup(key)) instanceof String) {
if (rewriteProperty.length() == 2) {
if (rewriteProperty.get(0) instanceof String && rewriteProperty.get(1) instanceof String) {
String ... | java | private void rewriteProperty(JSONObject node, String key, JSONArray rewriteProperty) throws JSONException {
if (node.get(cleanup(key)) instanceof String) {
if (rewriteProperty.length() == 2) {
if (rewriteProperty.get(0) instanceof String && rewriteProperty.get(1) instanceof String) {
String ... | [
"private",
"void",
"rewriteProperty",
"(",
"JSONObject",
"node",
",",
"String",
"key",
",",
"JSONArray",
"rewriteProperty",
")",
"throws",
"JSONException",
"{",
"if",
"(",
"node",
".",
"get",
"(",
"cleanup",
"(",
"key",
")",
")",
"instanceof",
"String",
")",... | Applies a string rewrite to a property.
@param node Node
@param key the property name to rewrite
@param rewriteProperty the property that defines the string rewrite
@throws JSONException | [
"Applies",
"a",
"string",
"rewrite",
"to",
"a",
"property",
"."
] | train | https://github.com/wcm-io/wcm-io-tooling/blob/1abcd01dd3ad4cc248f03b431f929573d84fa9b4/maven/plugins/json-dialog-conversion-plugin/src/main/java/io/wcm/maven/plugins/jsondlgcnv/DialogConverter.java#L349-L362 |
khuxtable/seaglass | src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java | SeaGlassSynthPainterImpl.paintSliderThumbBackground | public void paintSliderThumbBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
if (context.getComponent().getClientProperty("Slider.paintThumbArrowShape") == Boolean.TRUE) {
if (orientation == JSlider.HORIZONTAL) {
orientation = JSlider.VERTI... | java | public void paintSliderThumbBackground(SynthContext context, Graphics g, int x, int y, int w, int h, int orientation) {
if (context.getComponent().getClientProperty("Slider.paintThumbArrowShape") == Boolean.TRUE) {
if (orientation == JSlider.HORIZONTAL) {
orientation = JSlider.VERTI... | [
"public",
"void",
"paintSliderThumbBackground",
"(",
"SynthContext",
"context",
",",
"Graphics",
"g",
",",
"int",
"x",
",",
"int",
"y",
",",
"int",
"w",
",",
"int",
"h",
",",
"int",
"orientation",
")",
"{",
"if",
"(",
"context",
".",
"getComponent",
"(",... | Paints the background of the thumb of a slider.
@param context SynthContext identifying the <code>JComponent</code>
and <code>Region</code> to paint to
@param g <code>Graphics</code> to paint to
@param x X coordinate of the area to paint to
@param y Y coordinate of the area to paint t... | [
"Paints",
"the",
"background",
"of",
"the",
"thumb",
"of",
"a",
"slider",
"."
] | train | https://github.com/khuxtable/seaglass/blob/f25ecba622923d7b29b64cb7d6068dd8005989b3/src/main/java/com/seaglasslookandfeel/SeaGlassSynthPainterImpl.java#L1681-L1694 |
azkaban/azkaban | azkaban-common/src/main/java/azkaban/utils/StringUtils.java | StringUtils.join2 | public static String join2(final Collection<String> list, final String delimiter) {
final StringBuffer buffer = new StringBuffer();
boolean first = true;
for (final String str : list) {
if (!first) {
buffer.append(delimiter);
}
buffer.append(str);
first = false;
}
r... | java | public static String join2(final Collection<String> list, final String delimiter) {
final StringBuffer buffer = new StringBuffer();
boolean first = true;
for (final String str : list) {
if (!first) {
buffer.append(delimiter);
}
buffer.append(str);
first = false;
}
r... | [
"public",
"static",
"String",
"join2",
"(",
"final",
"Collection",
"<",
"String",
">",
"list",
",",
"final",
"String",
"delimiter",
")",
"{",
"final",
"StringBuffer",
"buffer",
"=",
"new",
"StringBuffer",
"(",
")",
";",
"boolean",
"first",
"=",
"true",
";"... | Don't bother to add delimiter for last element
@return String - elements in the list separated by delimiter | [
"Don",
"t",
"bother",
"to",
"add",
"delimiter",
"for",
"last",
"element"
] | train | https://github.com/azkaban/azkaban/blob/d258ea7d6e66807c6eff79c5325d6d3443618dff/azkaban-common/src/main/java/azkaban/utils/StringUtils.java#L75-L88 |
i-net-software/jlessc | src/com/inet/lib/less/LessParser.java | LessParser.readQuote | private void readQuote( char quote, StringBuilder builder ) {
builder.append( quote );
boolean isBackslash = false;
for( ;; ) {
char ch = read();
builder.append( ch );
if( ch == quote && !isBackslash ) {
return;
}
isBack... | java | private void readQuote( char quote, StringBuilder builder ) {
builder.append( quote );
boolean isBackslash = false;
for( ;; ) {
char ch = read();
builder.append( ch );
if( ch == quote && !isBackslash ) {
return;
}
isBack... | [
"private",
"void",
"readQuote",
"(",
"char",
"quote",
",",
"StringBuilder",
"builder",
")",
"{",
"builder",
".",
"append",
"(",
"quote",
")",
";",
"boolean",
"isBackslash",
"=",
"false",
";",
"for",
"(",
";",
";",
")",
"{",
"char",
"ch",
"=",
"read",
... | Read a quoted string and append it to the builder.
@param quote the quote character.
@param builder the target | [
"Read",
"a",
"quoted",
"string",
"and",
"append",
"it",
"to",
"the",
"builder",
"."
] | train | https://github.com/i-net-software/jlessc/blob/15b13e1637f6cc2e4d72df021e23ee0ca8d5e629/src/com/inet/lib/less/LessParser.java#L1062-L1073 |
OpenLiberty/open-liberty | dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_ComponentAttributesMap.java | _ComponentAttributesMap.setComponentProperty | private void setComponentProperty(_PropertyDescriptorHolder propertyDescriptor, Object value)
{
Method writeMethod = propertyDescriptor.getWriteMethod();
if (writeMethod == null)
{
throw new IllegalArgumentException("Component property " + propertyDescriptor.getName()
... | java | private void setComponentProperty(_PropertyDescriptorHolder propertyDescriptor, Object value)
{
Method writeMethod = propertyDescriptor.getWriteMethod();
if (writeMethod == null)
{
throw new IllegalArgumentException("Component property " + propertyDescriptor.getName()
... | [
"private",
"void",
"setComponentProperty",
"(",
"_PropertyDescriptorHolder",
"propertyDescriptor",
",",
"Object",
"value",
")",
"{",
"Method",
"writeMethod",
"=",
"propertyDescriptor",
".",
"getWriteMethod",
"(",
")",
";",
"if",
"(",
"writeMethod",
"==",
"null",
")"... | Execute the setter method of the specified property on the underlying
component.
@param propertyDescriptor specifies which property to write.
@throws IllegalArgumentException if the property is not writable.
@throws FacesException if any other problem occurs while invoking
the getter method. | [
"Execute",
"the",
"setter",
"method",
"of",
"the",
"specified",
"property",
"on",
"the",
"underlying",
"component",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.websphere.javaee.jsf.2.2/src/javax/faces/component/_ComponentAttributesMap.java#L705-L724 |
JodaOrg/joda-convert | src/main/java/org/joda/convert/StringConvert.java | StringConvert.convertFromString | public <T> T convertFromString(Class<T> cls, String str) {
if (str == null) {
return null;
}
StringConverter<T> conv = findConverter(cls);
return conv.convertFromString(cls, str);
} | java | public <T> T convertFromString(Class<T> cls, String str) {
if (str == null) {
return null;
}
StringConverter<T> conv = findConverter(cls);
return conv.convertFromString(cls, str);
} | [
"public",
"<",
"T",
">",
"T",
"convertFromString",
"(",
"Class",
"<",
"T",
">",
"cls",
",",
"String",
"str",
")",
"{",
"if",
"(",
"str",
"==",
"null",
")",
"{",
"return",
"null",
";",
"}",
"StringConverter",
"<",
"T",
">",
"conv",
"=",
"findConvert... | Converts the specified object from a {@code String}.
<p>
This uses {@link #findConverter} to provide the converter.
@param <T> the type to convert to
@param cls the class to convert to, not null
@param str the string to convert, null returns null
@return the converted object, may be null
@throws RuntimeException (o... | [
"Converts",
"the",
"specified",
"object",
"from",
"a",
"{",
"@code",
"String",
"}",
".",
"<p",
">",
"This",
"uses",
"{",
"@link",
"#findConverter",
"}",
"to",
"provide",
"the",
"converter",
"."
] | train | https://github.com/JodaOrg/joda-convert/blob/266bd825f4550590d5dafdf4225c548559e0633b/src/main/java/org/joda/convert/StringConvert.java#L441-L447 |
code4everything/util | src/main/java/com/zhazhapan/util/encryption/SimpleEncrypt.java | SimpleEncrypt.mix | public static String mix(String string, int key) {
return ascii(JavaEncrypt.base64(xor(string, key)), key);
} | java | public static String mix(String string, int key) {
return ascii(JavaEncrypt.base64(xor(string, key)), key);
} | [
"public",
"static",
"String",
"mix",
"(",
"String",
"string",
",",
"int",
"key",
")",
"{",
"return",
"ascii",
"(",
"JavaEncrypt",
".",
"base64",
"(",
"xor",
"(",
"string",
",",
"key",
")",
")",
",",
"key",
")",
";",
"}"
] | 混合加密
@param string {@link String}
@param key {@link Integer}
@return {@link String} | [
"混合加密"
] | train | https://github.com/code4everything/util/blob/1fc9f0ead1108f4d7208ba7c000df4244f708418/src/main/java/com/zhazhapan/util/encryption/SimpleEncrypt.java#L20-L22 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/execution/input/Operands.java | Operands.addArgument | public Operands addArgument(@NonNull String id, @NonNull INDArray array) {
map.put(NodeDescriptor.builder().name(id).build(), array);
return this;
} | java | public Operands addArgument(@NonNull String id, @NonNull INDArray array) {
map.put(NodeDescriptor.builder().name(id).build(), array);
return this;
} | [
"public",
"Operands",
"addArgument",
"(",
"@",
"NonNull",
"String",
"id",
",",
"@",
"NonNull",
"INDArray",
"array",
")",
"{",
"map",
".",
"put",
"(",
"NodeDescriptor",
".",
"builder",
"(",
")",
".",
"name",
"(",
"id",
")",
".",
"build",
"(",
")",
","... | This method allows to pass array to the node identified by its name
@param id
@param array
@return | [
"This",
"method",
"allows",
"to",
"pass",
"array",
"to",
"the",
"node",
"identified",
"by",
"its",
"name"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-api-parent/nd4j-api/src/main/java/org/nd4j/autodiff/execution/input/Operands.java#L39-L42 |
joniles/mpxj | src/main/java/net/sf/mpxj/Resource.java | Resource.setBaselineCost | public void setBaselineCost(int baselineNumber, Number value)
{
set(selectField(ResourceFieldLists.BASELINE_COSTS, baselineNumber), value);
} | java | public void setBaselineCost(int baselineNumber, Number value)
{
set(selectField(ResourceFieldLists.BASELINE_COSTS, baselineNumber), value);
} | [
"public",
"void",
"setBaselineCost",
"(",
"int",
"baselineNumber",
",",
"Number",
"value",
")",
"{",
"set",
"(",
"selectField",
"(",
"ResourceFieldLists",
".",
"BASELINE_COSTS",
",",
"baselineNumber",
")",
",",
"value",
")",
";",
"}"
] | Set a baseline value.
@param baselineNumber baseline index (1-10)
@param value baseline value | [
"Set",
"a",
"baseline",
"value",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/Resource.java#L2194-L2197 |
graphhopper/graphhopper | core/src/main/java/com/graphhopper/routing/Path.java | Path.calcDetails | public Map<String, List<PathDetail>> calcDetails(List<String> requestedPathDetails, PathDetailsBuilderFactory pathBuilderFactory, int previousIndex) {
if (!isFound() || requestedPathDetails.isEmpty())
return Collections.emptyMap();
List<PathDetailsBuilder> pathBuilders = pathBuilderFactory.c... | java | public Map<String, List<PathDetail>> calcDetails(List<String> requestedPathDetails, PathDetailsBuilderFactory pathBuilderFactory, int previousIndex) {
if (!isFound() || requestedPathDetails.isEmpty())
return Collections.emptyMap();
List<PathDetailsBuilder> pathBuilders = pathBuilderFactory.c... | [
"public",
"Map",
"<",
"String",
",",
"List",
"<",
"PathDetail",
">",
">",
"calcDetails",
"(",
"List",
"<",
"String",
">",
"requestedPathDetails",
",",
"PathDetailsBuilderFactory",
"pathBuilderFactory",
",",
"int",
"previousIndex",
")",
"{",
"if",
"(",
"!",
"is... | Calculates the PathDetails for this Path. This method will return fast, if there are no calculators.
@param pathBuilderFactory Generates the relevant PathBuilders
@return List of PathDetails for this Path | [
"Calculates",
"the",
"PathDetails",
"for",
"this",
"Path",
".",
"This",
"method",
"will",
"return",
"fast",
"if",
"there",
"are",
"no",
"calculators",
"."
] | train | https://github.com/graphhopper/graphhopper/blob/c235e306e6e823043cadcc41ead0e685bdebf737/core/src/main/java/com/graphhopper/routing/Path.java#L380-L398 |
apache/incubator-gobblin | gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java | MRJobLauncher.addHDFSFiles | @SuppressWarnings("deprecation")
private void addHDFSFiles(String jobFileList, Configuration conf) {
DistributedCache.createSymlink(conf);
jobFileList = PasswordManager.getInstance(this.jobProps).readPassword(jobFileList);
for (String jobFile : SPLITTER.split(jobFileList)) {
Path srcJobFile = new Pa... | java | @SuppressWarnings("deprecation")
private void addHDFSFiles(String jobFileList, Configuration conf) {
DistributedCache.createSymlink(conf);
jobFileList = PasswordManager.getInstance(this.jobProps).readPassword(jobFileList);
for (String jobFile : SPLITTER.split(jobFileList)) {
Path srcJobFile = new Pa... | [
"@",
"SuppressWarnings",
"(",
"\"deprecation\"",
")",
"private",
"void",
"addHDFSFiles",
"(",
"String",
"jobFileList",
",",
"Configuration",
"conf",
")",
"{",
"DistributedCache",
".",
"createSymlink",
"(",
"conf",
")",
";",
"jobFileList",
"=",
"PasswordManager",
"... | Add non-jar files already on HDFS that the job depends on to DistributedCache. | [
"Add",
"non",
"-",
"jar",
"files",
"already",
"on",
"HDFS",
"that",
"the",
"job",
"depends",
"on",
"to",
"DistributedCache",
"."
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-runtime/src/main/java/org/apache/gobblin/runtime/mapreduce/MRJobLauncher.java#L550-L562 |
apache/incubator-zipkin | zipkin-storage/cassandra-v1/src/main/java/zipkin2/storage/cassandra/v1/TimestampCodec.java | TimestampCodec.deserialize | public long deserialize(Row row, String name) {
return 1000L * TypeCodec.bigint().deserialize(row.getBytesUnsafe(name), protocolVersion);
} | java | public long deserialize(Row row, String name) {
return 1000L * TypeCodec.bigint().deserialize(row.getBytesUnsafe(name), protocolVersion);
} | [
"public",
"long",
"deserialize",
"(",
"Row",
"row",
",",
"String",
"name",
")",
"{",
"return",
"1000L",
"*",
"TypeCodec",
".",
"bigint",
"(",
")",
".",
"deserialize",
"(",
"row",
".",
"getBytesUnsafe",
"(",
"name",
")",
",",
"protocolVersion",
")",
";",
... | Reads timestamp binary value directly (getBytesUnsafe) to avoid allocating java.util.Date, and
converts to microseconds. | [
"Reads",
"timestamp",
"binary",
"value",
"directly",
"(",
"getBytesUnsafe",
")",
"to",
"avoid",
"allocating",
"java",
".",
"util",
".",
"Date",
"and",
"converts",
"to",
"microseconds",
"."
] | train | https://github.com/apache/incubator-zipkin/blob/89b2fab983fc626b3be32ce9d7cf64b3f01f1a87/zipkin-storage/cassandra-v1/src/main/java/zipkin2/storage/cassandra/v1/TimestampCodec.java#L48-L50 |
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/SyncGroupsInner.java | SyncGroupsInner.refreshHubSchemaAsync | public Observable<Void> refreshHubSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
return refreshHubSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override... | java | public Observable<Void> refreshHubSchemaAsync(String resourceGroupName, String serverName, String databaseName, String syncGroupName) {
return refreshHubSchemaWithServiceResponseAsync(resourceGroupName, serverName, databaseName, syncGroupName).map(new Func1<ServiceResponse<Void>, Void>() {
@Override... | [
"public",
"Observable",
"<",
"Void",
">",
"refreshHubSchemaAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"databaseName",
",",
"String",
"syncGroupName",
")",
"{",
"return",
"refreshHubSchemaWithServiceResponseAsync",
"(",
"resou... | Refreshes a hub 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 hosted.
@pa... | [
"Refreshes",
"a",
"hub",
"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/SyncGroupsInner.java#L299-L306 |
Swagger2Markup/swagger2markup | src/main/java/io/github/swagger2markup/internal/component/PathOperationComponent.java | PathOperationComponent.buildOperationTitle | private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
buildOperationTitle(markupDocBuilder, operation.getTitle(), operation.getId());
if (operation.getTitle().equals(operation.getOperation().getSummary())) {
markupDocBuilder.block(operation.getMethod(... | java | private void buildOperationTitle(MarkupDocBuilder markupDocBuilder, PathOperation operation) {
buildOperationTitle(markupDocBuilder, operation.getTitle(), operation.getId());
if (operation.getTitle().equals(operation.getOperation().getSummary())) {
markupDocBuilder.block(operation.getMethod(... | [
"private",
"void",
"buildOperationTitle",
"(",
"MarkupDocBuilder",
"markupDocBuilder",
",",
"PathOperation",
"operation",
")",
"{",
"buildOperationTitle",
"(",
"markupDocBuilder",
",",
"operation",
".",
"getTitle",
"(",
")",
",",
"operation",
".",
"getId",
"(",
")",... | Adds the operation title to the document. If the operation has a summary, the title is the summary.
Otherwise the title is the method of the operation and the URL of the operation.
@param operation the Swagger Operation | [
"Adds",
"the",
"operation",
"title",
"to",
"the",
"document",
".",
"If",
"the",
"operation",
"has",
"a",
"summary",
"the",
"title",
"is",
"the",
"summary",
".",
"Otherwise",
"the",
"title",
"is",
"the",
"method",
"of",
"the",
"operation",
"and",
"the",
"... | train | https://github.com/Swagger2Markup/swagger2markup/blob/da83465f19a2f8a0f1fba873b5762bca8587896b/src/main/java/io/github/swagger2markup/internal/component/PathOperationComponent.java#L135-L140 |
awslabs/jsii | packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java | JsiiEngine.registerObject | public void registerObject(final JsiiObjectRef objRef, final Object obj) {
if (obj instanceof JsiiObject) {
((JsiiObject) obj).setObjRef(objRef);
}
this.objects.put(objRef.getObjId(), obj);
} | java | public void registerObject(final JsiiObjectRef objRef, final Object obj) {
if (obj instanceof JsiiObject) {
((JsiiObject) obj).setObjRef(objRef);
}
this.objects.put(objRef.getObjId(), obj);
} | [
"public",
"void",
"registerObject",
"(",
"final",
"JsiiObjectRef",
"objRef",
",",
"final",
"Object",
"obj",
")",
"{",
"if",
"(",
"obj",
"instanceof",
"JsiiObject",
")",
"{",
"(",
"(",
"JsiiObject",
")",
"obj",
")",
".",
"setObjRef",
"(",
"objRef",
")",
"... | Registers an object into the object cache.
@param objRef The object reference.
@param obj The object to register. | [
"Registers",
"an",
"object",
"into",
"the",
"object",
"cache",
"."
] | train | https://github.com/awslabs/jsii/blob/6bbf743f5f65e98e5199ad31c93961533ffc40e5/packages/jsii-java-runtime/project/src/main/java/software/amazon/jsii/JsiiEngine.java#L116-L121 |
http-builder-ng/http-builder-ng | http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java | HttpBuilder.putAsync | public <T> CompletableFuture<T> putAsync(final Class<T> type, final Consumer<HttpConfig> configuration) {
return CompletableFuture.supplyAsync(() -> put(type, configuration), getExecutor());
} | java | public <T> CompletableFuture<T> putAsync(final Class<T> type, final Consumer<HttpConfig> configuration) {
return CompletableFuture.supplyAsync(() -> put(type, configuration), getExecutor());
} | [
"public",
"<",
"T",
">",
"CompletableFuture",
"<",
"T",
">",
"putAsync",
"(",
"final",
"Class",
"<",
"T",
">",
"type",
",",
"final",
"Consumer",
"<",
"HttpConfig",
">",
"configuration",
")",
"{",
"return",
"CompletableFuture",
".",
"supplyAsync",
"(",
"(",... | Executes an asynchronous PUT request on the configured URI (asynchronous alias to `put(Class,Consumer)`), with additional configuration provided
by the configuration function. The result will be cast to the specified `type`.
This method is generally used for Java-specific configuration.
[source,groovy]
----
HttpBuild... | [
"Executes",
"an",
"asynchronous",
"PUT",
"request",
"on",
"the",
"configured",
"URI",
"(",
"asynchronous",
"alias",
"to",
"put",
"(",
"Class",
"Consumer",
")",
")",
"with",
"additional",
"configuration",
"provided",
"by",
"the",
"configuration",
"function",
".",... | train | https://github.com/http-builder-ng/http-builder-ng/blob/865f37732c102c748d3db8b905199dac9222a525/http-builder-ng-core/src/main/java/groovyx/net/http/HttpBuilder.java#L1081-L1083 |
alipay/sofa-rpc | core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterInvoker.java | FilterInvoker.getStringMethodParam | protected String getStringMethodParam(String methodName, String paramKey, String defaultValue) {
if (CommonUtils.isEmpty(configContext)) {
return defaultValue;
}
String o = (String) configContext.get(buildMethodKey(methodName, paramKey));
if (o == null) {
o = (Str... | java | protected String getStringMethodParam(String methodName, String paramKey, String defaultValue) {
if (CommonUtils.isEmpty(configContext)) {
return defaultValue;
}
String o = (String) configContext.get(buildMethodKey(methodName, paramKey));
if (o == null) {
o = (Str... | [
"protected",
"String",
"getStringMethodParam",
"(",
"String",
"methodName",
",",
"String",
"paramKey",
",",
"String",
"defaultValue",
")",
"{",
"if",
"(",
"CommonUtils",
".",
"isEmpty",
"(",
"configContext",
")",
")",
"{",
"return",
"defaultValue",
";",
"}",
"... | 取得方法的特殊参数配置
@param methodName 方法名
@param paramKey 参数关键字
@param defaultValue 默认值
@return 都找不到为null string method param | [
"取得方法的特殊参数配置"
] | train | https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/filter/FilterInvoker.java#L161-L172 |
jimmoores/quandl4j | core/src/main/java/com/jimmoores/quandl/SearchResult.java | SearchResult.getMetaDataResultList | public List<MetaDataResult> getMetaDataResultList() {
JSONArray jsonArray = null;
try {
jsonArray = _jsonObject.getJSONArray(DATASETS_ARRAY_FIELD);
List<MetaDataResult> metaDataResults = new ArrayList<MetaDataResult>(jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
m... | java | public List<MetaDataResult> getMetaDataResultList() {
JSONArray jsonArray = null;
try {
jsonArray = _jsonObject.getJSONArray(DATASETS_ARRAY_FIELD);
List<MetaDataResult> metaDataResults = new ArrayList<MetaDataResult>(jsonArray.length());
for (int i = 0; i < jsonArray.length(); i++) {
m... | [
"public",
"List",
"<",
"MetaDataResult",
">",
"getMetaDataResultList",
"(",
")",
"{",
"JSONArray",
"jsonArray",
"=",
"null",
";",
"try",
"{",
"jsonArray",
"=",
"_jsonObject",
".",
"getJSONArray",
"(",
"DATASETS_ARRAY_FIELD",
")",
";",
"List",
"<",
"MetaDataResul... | Extract a list of MetaDataResult objects, each one representing a match. Throws a QuandlRuntimeException if it cannot construct a valid
HeaderDefinition
@return the header definition, not null | [
"Extract",
"a",
"list",
"of",
"MetaDataResult",
"objects",
"each",
"one",
"representing",
"a",
"match",
".",
"Throws",
"a",
"QuandlRuntimeException",
"if",
"it",
"cannot",
"construct",
"a",
"valid",
"HeaderDefinition"
] | train | https://github.com/jimmoores/quandl4j/blob/5d67ae60279d889da93ae7aa3bf6b7d536f88822/core/src/main/java/com/jimmoores/quandl/SearchResult.java#L92-L105 |
ops4j/org.ops4j.pax.logging | pax-logging-service/src/main/java/org/apache/log4j/OsgiThrowableRenderer.java | OsgiThrowableRenderer.formatElement | private String formatElement(final StackTraceElement element, final Map<String, String> classMap) {
StringBuilder buf = new StringBuilder("\tat ");
buf.append(element);
String className = element.getClassName();
String classDetails = classMap.get(className);
if (classDetails == n... | java | private String formatElement(final StackTraceElement element, final Map<String, String> classMap) {
StringBuilder buf = new StringBuilder("\tat ");
buf.append(element);
String className = element.getClassName();
String classDetails = classMap.get(className);
if (classDetails == n... | [
"private",
"String",
"formatElement",
"(",
"final",
"StackTraceElement",
"element",
",",
"final",
"Map",
"<",
"String",
",",
"String",
">",
"classMap",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
"\"\\tat \"",
")",
";",
"buf",
".",
"a... | Format one element from stack trace.
@param element element, may not be null.
@param classMap map of class name to location.
@return string representation of element. | [
"Format",
"one",
"element",
"from",
"stack",
"trace",
"."
] | train | https://github.com/ops4j/org.ops4j.pax.logging/blob/493de4e1db4fe9f981f3dd78b8e40e5bf2b2e59d/pax-logging-service/src/main/java/org/apache/log4j/OsgiThrowableRenderer.java#L161-L179 |
b3dgs/lionengine | lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java | Drawable.loadSpriteAnimated | public static SpriteAnimated loadSpriteAnimated(Media media, int horizontalFrames, int verticalFrames)
{
return new SpriteAnimatedImpl(getMediaDpi(media), horizontalFrames, verticalFrames);
} | java | public static SpriteAnimated loadSpriteAnimated(Media media, int horizontalFrames, int verticalFrames)
{
return new SpriteAnimatedImpl(getMediaDpi(media), horizontalFrames, verticalFrames);
} | [
"public",
"static",
"SpriteAnimated",
"loadSpriteAnimated",
"(",
"Media",
"media",
",",
"int",
"horizontalFrames",
",",
"int",
"verticalFrames",
")",
"{",
"return",
"new",
"SpriteAnimatedImpl",
"(",
"getMediaDpi",
"(",
"media",
")",
",",
"horizontalFrames",
",",
"... | Load an animated sprite from a file, giving horizontal and vertical frames.
<p>
Once created, sprite must call {@link SpriteAnimated#load()} before any other operations.
</p>
@param media The sprite media (must not be <code>null</code>).
@param horizontalFrames The number of horizontal frames (must be strictly positiv... | [
"Load",
"an",
"animated",
"sprite",
"from",
"a",
"file",
"giving",
"horizontal",
"and",
"vertical",
"frames",
".",
"<p",
">",
"Once",
"created",
"sprite",
"must",
"call",
"{",
"@link",
"SpriteAnimated#load",
"()",
"}",
"before",
"any",
"other",
"operations",
... | train | https://github.com/b3dgs/lionengine/blob/cac3d5578532cf11724a737b9f09e71bf9995ab2/lionengine-core/src/main/java/com/b3dgs/lionengine/graphic/drawable/Drawable.java#L179-L182 |
dashorst/wicket-stuff-markup-validator | jing/src/main/java/com/thaiopensource/validate/nvdl/NvdlSchemaReceiverFactory.java | NvdlSchemaReceiverFactory.createSchemaReceiver | public SchemaReceiver createSchemaReceiver(String namespaceUri, PropertyMap properties) {
if (!SchemaImpl.NVDL_URI.equals(namespaceUri))
return null;
return new SchemaReceiverImpl(properties);
} | java | public SchemaReceiver createSchemaReceiver(String namespaceUri, PropertyMap properties) {
if (!SchemaImpl.NVDL_URI.equals(namespaceUri))
return null;
return new SchemaReceiverImpl(properties);
} | [
"public",
"SchemaReceiver",
"createSchemaReceiver",
"(",
"String",
"namespaceUri",
",",
"PropertyMap",
"properties",
")",
"{",
"if",
"(",
"!",
"SchemaImpl",
".",
"NVDL_URI",
".",
"equals",
"(",
"namespaceUri",
")",
")",
"return",
"null",
";",
"return",
"new",
... | Checks if the namespace is the NVDL namespace and if yes then it creates
a schema receiver, otherwise returns null. | [
"Checks",
"if",
"the",
"namespace",
"is",
"the",
"NVDL",
"namespace",
"and",
"if",
"yes",
"then",
"it",
"creates",
"a",
"schema",
"receiver",
"otherwise",
"returns",
"null",
"."
] | train | https://github.com/dashorst/wicket-stuff-markup-validator/blob/9e529a4dc8bfdbbe4c794f3132ef400a006560a1/jing/src/main/java/com/thaiopensource/validate/nvdl/NvdlSchemaReceiverFactory.java#L16-L20 |
querydsl/querydsl | querydsl-sql/src/main/java/com/querydsl/sql/SQLTemplates.java | SQLTemplates.serializeModifiers | protected void serializeModifiers(QueryMetadata metadata, SQLSerializer context) {
QueryModifiers mod = metadata.getModifiers();
if (mod.getLimit() != null) {
context.handle(limitTemplate, mod.getLimit());
} else if (limitRequired) {
context.handle(limitTemplate, maxLimit... | java | protected void serializeModifiers(QueryMetadata metadata, SQLSerializer context) {
QueryModifiers mod = metadata.getModifiers();
if (mod.getLimit() != null) {
context.handle(limitTemplate, mod.getLimit());
} else if (limitRequired) {
context.handle(limitTemplate, maxLimit... | [
"protected",
"void",
"serializeModifiers",
"(",
"QueryMetadata",
"metadata",
",",
"SQLSerializer",
"context",
")",
"{",
"QueryModifiers",
"mod",
"=",
"metadata",
".",
"getModifiers",
"(",
")",
";",
"if",
"(",
"mod",
".",
"getLimit",
"(",
")",
"!=",
"null",
"... | template method for LIMIT and OFFSET serialization
@param metadata
@param context | [
"template",
"method",
"for",
"LIMIT",
"and",
"OFFSET",
"serialization"
] | train | https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-sql/src/main/java/com/querydsl/sql/SQLTemplates.java#L967-L977 |
JodaOrg/joda-time | src/main/java/org/joda/time/YearMonth.java | YearMonth.readResolve | private Object readResolve() {
if (DateTimeZone.UTC.equals(getChronology().getZone()) == false) {
return new YearMonth(this, getChronology().withUTC());
}
return this;
} | java | private Object readResolve() {
if (DateTimeZone.UTC.equals(getChronology().getZone()) == false) {
return new YearMonth(this, getChronology().withUTC());
}
return this;
} | [
"private",
"Object",
"readResolve",
"(",
")",
"{",
"if",
"(",
"DateTimeZone",
".",
"UTC",
".",
"equals",
"(",
"getChronology",
"(",
")",
".",
"getZone",
"(",
")",
")",
"==",
"false",
")",
"{",
"return",
"new",
"YearMonth",
"(",
"this",
",",
"getChronol... | Handle broken serialization from other tools.
@return the resolved object, not null | [
"Handle",
"broken",
"serialization",
"from",
"other",
"tools",
"."
] | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/YearMonth.java#L371-L376 |
michel-kraemer/bson4jackson | src/main/java/de/undercouch/bson4jackson/BsonGenerator.java | BsonGenerator.writeJavaScript | public void writeJavaScript(JavaScript javaScript, SerializerProvider provider) throws IOException {
_writeArrayFieldNameIfNeeded();
_verifyValueWrite("write javascript");
if (javaScript.getScope() == null) {
_buffer.putByte(_typeMarker, BsonConstants.TYPE_JAVASCRIPT);
_writeString(javaScript.getCode());
... | java | public void writeJavaScript(JavaScript javaScript, SerializerProvider provider) throws IOException {
_writeArrayFieldNameIfNeeded();
_verifyValueWrite("write javascript");
if (javaScript.getScope() == null) {
_buffer.putByte(_typeMarker, BsonConstants.TYPE_JAVASCRIPT);
_writeString(javaScript.getCode());
... | [
"public",
"void",
"writeJavaScript",
"(",
"JavaScript",
"javaScript",
",",
"SerializerProvider",
"provider",
")",
"throws",
"IOException",
"{",
"_writeArrayFieldNameIfNeeded",
"(",
")",
";",
"_verifyValueWrite",
"(",
"\"write javascript\"",
")",
";",
"if",
"(",
"javaS... | Write a BSON JavaScript object
@param javaScript The javaScript to write
@param provider The serializer provider, for serializing the scope
@throws IOException If an error occurred in the stream while writing | [
"Write",
"a",
"BSON",
"JavaScript",
"object"
] | train | https://github.com/michel-kraemer/bson4jackson/blob/32d2ab3c516b3c07490fdfcf0c5e4ed0a2ee3979/src/main/java/de/undercouch/bson4jackson/BsonGenerator.java#L747-L772 |
kohsuke/args4j | args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java | OptionHandlerRegistry.registerHandler | public void registerHandler( Class valueType, Class<? extends OptionHandler> handlerClass ) {
checkNonNull(valueType, "valueType");
checkNonNull(handlerClass, "handlerClass");
if(!OptionHandler.class.isAssignableFrom(handlerClass))
throw new IllegalArgumentException(Messages.NO_OPTI... | java | public void registerHandler( Class valueType, Class<? extends OptionHandler> handlerClass ) {
checkNonNull(valueType, "valueType");
checkNonNull(handlerClass, "handlerClass");
if(!OptionHandler.class.isAssignableFrom(handlerClass))
throw new IllegalArgumentException(Messages.NO_OPTI... | [
"public",
"void",
"registerHandler",
"(",
"Class",
"valueType",
",",
"Class",
"<",
"?",
"extends",
"OptionHandler",
">",
"handlerClass",
")",
"{",
"checkNonNull",
"(",
"valueType",
",",
"\"valueType\"",
")",
";",
"checkNonNull",
"(",
"handlerClass",
",",
"\"hand... | Registers a user-defined {@link OptionHandler} class with args4j.
<p>
This method allows users to extend the behavior of args4j by writing
their own {@link OptionHandler} implementation.
@param valueType
The specified handler is used when the field/method annotated by {@link Option}
is of this type.
@param handlerCla... | [
"Registers",
"a",
"user",
"-",
"defined",
"{",
"@link",
"OptionHandler",
"}",
"class",
"with",
"args4j",
"."
] | train | https://github.com/kohsuke/args4j/blob/dc2e7e265caf15a1a146e3389c1f16a8781f06cf/args4j/src/org/kohsuke/args4j/OptionHandlerRegistry.java#L131-L139 |
Esri/geometry-api-java | src/main/java/com/esri/core/geometry/VertexDescription.java | VertexDescription.isDefaultValue | public static boolean isDefaultValue(int semantics, double v) {
return NumberUtils.doubleToInt64Bits(_defaultValues[semantics]) == NumberUtils
.doubleToInt64Bits(v);
} | java | public static boolean isDefaultValue(int semantics, double v) {
return NumberUtils.doubleToInt64Bits(_defaultValues[semantics]) == NumberUtils
.doubleToInt64Bits(v);
} | [
"public",
"static",
"boolean",
"isDefaultValue",
"(",
"int",
"semantics",
",",
"double",
"v",
")",
"{",
"return",
"NumberUtils",
".",
"doubleToInt64Bits",
"(",
"_defaultValues",
"[",
"semantics",
"]",
")",
"==",
"NumberUtils",
".",
"doubleToInt64Bits",
"(",
"v",... | Checks if the given value is the default one. The simple equality test
with GetDefaultValue does not work due to the use of NaNs as default
value for some parameters. | [
"Checks",
"if",
"the",
"given",
"value",
"is",
"the",
"default",
"one",
".",
"The",
"simple",
"equality",
"test",
"with",
"GetDefaultValue",
"does",
"not",
"work",
"due",
"to",
"the",
"use",
"of",
"NaNs",
"as",
"default",
"value",
"for",
"some",
"parameter... | train | https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/VertexDescription.java#L257-L260 |
dkharrat/NexusDialog | nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/FormSectionController.java | FormSectionController.addElement | public FormElementController addElement(FormElementController element, int position) {
if (element instanceof FormSectionController) {
throw new IllegalArgumentException("Sub-sections are not supported");
}
if (elements.containsKey(element.getName())) {
throw new Illegal... | java | public FormElementController addElement(FormElementController element, int position) {
if (element instanceof FormSectionController) {
throw new IllegalArgumentException("Sub-sections are not supported");
}
if (elements.containsKey(element.getName())) {
throw new Illegal... | [
"public",
"FormElementController",
"addElement",
"(",
"FormElementController",
"element",
",",
"int",
"position",
")",
"{",
"if",
"(",
"element",
"instanceof",
"FormSectionController",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Sub-sections are not supp... | Adds a form element to this section. Note that sub-sections are not supported.
@param element the form element to add
@param position the position at which to insert the element
@return the same instance of the form element that was added to support method chaining | [
"Adds",
"a",
"form",
"element",
"to",
"this",
"section",
".",
"Note",
"that",
"sub",
"-",
"sections",
"are",
"not",
"supported",
"."
] | train | https://github.com/dkharrat/NexusDialog/blob/f43a6a07940cced12286c622140f3a8ae3d178a1/nexusdialog/src/main/java/com/github/dkharrat/nexusdialog/controllers/FormSectionController.java#L75-L87 |
cdk/cdk | base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java | BioPolymer.getMonomer | @Override
public IMonomer getMonomer(String monName, String strandName) {
Strand strand = (Strand) strands.get(strandName);
if (strand != null) {
return (Monomer) strand.getMonomer(monName);
} else {
return null;
}
} | java | @Override
public IMonomer getMonomer(String monName, String strandName) {
Strand strand = (Strand) strands.get(strandName);
if (strand != null) {
return (Monomer) strand.getMonomer(monName);
} else {
return null;
}
} | [
"@",
"Override",
"public",
"IMonomer",
"getMonomer",
"(",
"String",
"monName",
",",
"String",
"strandName",
")",
"{",
"Strand",
"strand",
"=",
"(",
"Strand",
")",
"strands",
".",
"get",
"(",
"strandName",
")",
";",
"if",
"(",
"strand",
"!=",
"null",
")",... | Retrieves a Monomer object by specifying its name. [You have to specify the strand to enable
monomers with the same name in different strands. There is at least one such case: every
strand contains a monomer called "".]
@param monName The name of the monomer to look for
@return The Monomer object which was asked for | [
"Retrieves",
"a",
"Monomer",
"object",
"by",
"specifying",
"its",
"name",
".",
"[",
"You",
"have",
"to",
"specify",
"the",
"strand",
"to",
"enable",
"monomers",
"with",
"the",
"same",
"name",
"in",
"different",
"strands",
".",
"There",
"is",
"at",
"least",... | train | https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/base/silent/src/main/java/org/openscience/cdk/silent/BioPolymer.java#L163-L172 |
duracloud/duracloud | storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java | StorageProviderUtil.compareChecksum | public static String compareChecksum(String providerChecksum,
String spaceId,
String contentId,
String checksum)
throws ChecksumMismatchException {
if (!providerChecksum.equals(chec... | java | public static String compareChecksum(String providerChecksum,
String spaceId,
String contentId,
String checksum)
throws ChecksumMismatchException {
if (!providerChecksum.equals(chec... | [
"public",
"static",
"String",
"compareChecksum",
"(",
"String",
"providerChecksum",
",",
"String",
"spaceId",
",",
"String",
"contentId",
",",
"String",
"checksum",
")",
"throws",
"ChecksumMismatchException",
"{",
"if",
"(",
"!",
"providerChecksum",
".",
"equals",
... | Determines if two checksum values are equal
@param providerChecksum The checksum provided by the StorageProvider
@param spaceId The Space in which the content was stored
@param contentId The Id of the content
@param checksum The content checksum, either provided or computed
@throws ChecksumMism... | [
"Determines",
"if",
"two",
"checksum",
"values",
"are",
"equal"
] | train | https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storageprovider/src/main/java/org/duracloud/storage/util/StorageProviderUtil.java#L139-L154 |
sarl/sarl | main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java | SARLFormatter._format | protected void _format(SarlRequiredCapacity requiredCapacity, IFormattableDocument document) {
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(requiredCapacity);
document.append(regionFor.keyword(this.keywords.getRequiresKeyword()), ONE_SPACE);
formatCommaSeparatedList(requiredCapacit... | java | protected void _format(SarlRequiredCapacity requiredCapacity, IFormattableDocument document) {
final ISemanticRegionsFinder regionFor = this.textRegionExtensions.regionFor(requiredCapacity);
document.append(regionFor.keyword(this.keywords.getRequiresKeyword()), ONE_SPACE);
formatCommaSeparatedList(requiredCapacit... | [
"protected",
"void",
"_format",
"(",
"SarlRequiredCapacity",
"requiredCapacity",
",",
"IFormattableDocument",
"document",
")",
"{",
"final",
"ISemanticRegionsFinder",
"regionFor",
"=",
"this",
".",
"textRegionExtensions",
".",
"regionFor",
"(",
"requiredCapacity",
")",
... | Format a required capacity.
@param requiredCapacity the element ot format.
@param document the document. | [
"Format",
"a",
"required",
"capacity",
"."
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.lang/src/io/sarl/lang/formatting2/SARLFormatter.java#L487-L492 |
getsentry/sentry-java | sentry/src/main/java/io/sentry/event/interfaces/SentryException.java | SentryException.extractExceptionQueue | public static Deque<SentryException> extractExceptionQueue(Throwable throwable) {
Deque<SentryException> exceptions = new ArrayDeque<>();
Set<Throwable> circularityDetector = new HashSet<>();
StackTraceElement[] childExceptionStackTrace = new StackTraceElement[0];
//Stack the exceptions... | java | public static Deque<SentryException> extractExceptionQueue(Throwable throwable) {
Deque<SentryException> exceptions = new ArrayDeque<>();
Set<Throwable> circularityDetector = new HashSet<>();
StackTraceElement[] childExceptionStackTrace = new StackTraceElement[0];
//Stack the exceptions... | [
"public",
"static",
"Deque",
"<",
"SentryException",
">",
"extractExceptionQueue",
"(",
"Throwable",
"throwable",
")",
"{",
"Deque",
"<",
"SentryException",
">",
"exceptions",
"=",
"new",
"ArrayDeque",
"<>",
"(",
")",
";",
"Set",
"<",
"Throwable",
">",
"circul... | Transforms a {@link Throwable} into a Queue of {@link SentryException}.
<p>
Exceptions are stored in the queue from the most recent one to the oldest one.
@param throwable throwable to transform in a queue of exceptions.
@return a queue of exception with StackTrace. | [
"Transforms",
"a",
"{",
"@link",
"Throwable",
"}",
"into",
"a",
"Queue",
"of",
"{",
"@link",
"SentryException",
"}",
".",
"<p",
">",
"Exceptions",
"are",
"stored",
"in",
"the",
"queue",
"from",
"the",
"most",
"recent",
"one",
"to",
"the",
"oldest",
"one"... | train | https://github.com/getsentry/sentry-java/blob/2e01461775cbd5951ff82b566069c349146d8aca/sentry/src/main/java/io/sentry/event/interfaces/SentryException.java#L70-L83 |
venmo/cursor-utils | cursor-utils/src/main/java/com/venmo/cursor/IterableCursorWrapper.java | IterableCursorWrapper.getShort | public short getShort(String columnName, short defaultValue) {
int index = getColumnIndex(columnName);
if (isValidIndex(index)) {
return getShort(index);
} else {
return defaultValue;
}
} | java | public short getShort(String columnName, short defaultValue) {
int index = getColumnIndex(columnName);
if (isValidIndex(index)) {
return getShort(index);
} else {
return defaultValue;
}
} | [
"public",
"short",
"getShort",
"(",
"String",
"columnName",
",",
"short",
"defaultValue",
")",
"{",
"int",
"index",
"=",
"getColumnIndex",
"(",
"columnName",
")",
";",
"if",
"(",
"isValidIndex",
"(",
"index",
")",
")",
"{",
"return",
"getShort",
"(",
"inde... | Convenience alias to {@code getShort\(getColumnIndex(columnName))}. If the column does not
exist for the cursor, return {@code defaultValue}. | [
"Convenience",
"alias",
"to",
"{"
] | train | https://github.com/venmo/cursor-utils/blob/52cf91c4253346632fe70b8d7b7eab8bbcc9b248/cursor-utils/src/main/java/com/venmo/cursor/IterableCursorWrapper.java#L190-L197 |
spring-projects/spring-boot | spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanPropertyName.java | BeanPropertyName.toDashedForm | public static String toDashedForm(String name, int start) {
StringBuilder result = new StringBuilder();
String replaced = name.replace('_', '-');
for (int i = start; i < replaced.length(); i++) {
char ch = replaced.charAt(i);
if (Character.isUpperCase(ch) && result.length() > 0
&& result.charAt(result.... | java | public static String toDashedForm(String name, int start) {
StringBuilder result = new StringBuilder();
String replaced = name.replace('_', '-');
for (int i = start; i < replaced.length(); i++) {
char ch = replaced.charAt(i);
if (Character.isUpperCase(ch) && result.length() > 0
&& result.charAt(result.... | [
"public",
"static",
"String",
"toDashedForm",
"(",
"String",
"name",
",",
"int",
"start",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"String",
"replaced",
"=",
"name",
".",
"replace",
"(",
"'",
"'",
",",
"'",
"'",
... | Return the specified Java Bean property name in dashed form.
@param name the source name
@param start the starting char
@return the dashed from | [
"Return",
"the",
"specified",
"Java",
"Bean",
"property",
"name",
"in",
"dashed",
"form",
"."
] | train | https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot/src/main/java/org/springframework/boot/context/properties/bind/BeanPropertyName.java#L45-L57 |
adorsys/hbci4java-adorsys | src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java | AbstractHBCIJob.saveReturnValues | protected void saveReturnValues(HBCIMsgStatus status, int sref) {
List<HBCIRetVal> retVals = status.segStatus.getRetVals();
String segref = Integer.toString(sref);
retVals.forEach(retVal -> {
if (retVal.segref != null && retVal.segref.equals(segref)) {
jobResult.jobS... | java | protected void saveReturnValues(HBCIMsgStatus status, int sref) {
List<HBCIRetVal> retVals = status.segStatus.getRetVals();
String segref = Integer.toString(sref);
retVals.forEach(retVal -> {
if (retVal.segref != null && retVal.segref.equals(segref)) {
jobResult.jobS... | [
"protected",
"void",
"saveReturnValues",
"(",
"HBCIMsgStatus",
"status",
",",
"int",
"sref",
")",
"{",
"List",
"<",
"HBCIRetVal",
">",
"retVals",
"=",
"status",
".",
"segStatus",
".",
"getRetVals",
"(",
")",
";",
"String",
"segref",
"=",
"Integer",
".",
"t... | /*
speichert die HBCI-Rückgabewerte für diesen GV im outStore ab. Dazu
werden alle RetSegs durchgesehen; diejenigen, die den aktuellen GV
betreffen, werden im @c data Property unter dem namen @c ret_i.*
gespeichert. @i entspricht dabei dem @c retValCounter. | [
"/",
"*",
"speichert",
"die",
"HBCI",
"-",
"Rückgabewerte",
"für",
"diesen",
"GV",
"im",
"outStore",
"ab",
".",
"Dazu",
"werden",
"alle",
"RetSegs",
"durchgesehen",
";",
"diejenigen",
"die",
"den",
"aktuellen",
"GV",
"betreffen",
"werden",
"im"
] | train | https://github.com/adorsys/hbci4java-adorsys/blob/5e24f7e429d6b555e1d993196b4cf1adda6433cf/src/main/java/org/kapott/hbci/GV/AbstractHBCIJob.java#L774-L791 |
orbisgis/h2gis | h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java | GeometryCoordinateDimension.convert | public static LinearRing convert(LinearRing linearRing,int dimension) {
return gf.createLinearRing(convertSequence(linearRing.getCoordinates(),dimension));
} | java | public static LinearRing convert(LinearRing linearRing,int dimension) {
return gf.createLinearRing(convertSequence(linearRing.getCoordinates(),dimension));
} | [
"public",
"static",
"LinearRing",
"convert",
"(",
"LinearRing",
"linearRing",
",",
"int",
"dimension",
")",
"{",
"return",
"gf",
".",
"createLinearRing",
"(",
"convertSequence",
"(",
"linearRing",
".",
"getCoordinates",
"(",
")",
",",
"dimension",
")",
")",
";... | Force the dimension of the LinearRing and update correctly the coordinate
dimension
@param linearRing
@param dimension
@return | [
"Force",
"the",
"dimension",
"of",
"the",
"LinearRing",
"and",
"update",
"correctly",
"the",
"coordinate",
"dimension"
] | train | https://github.com/orbisgis/h2gis/blob/9cd70b447e6469cecbc2fc64b16774b59491df3b/h2gis-functions/src/main/java/org/h2gis/functions/spatial/convert/GeometryCoordinateDimension.java#L154-L156 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java | EJBMDOrchestrator.dealWithUnsatisfiedXMLTimers | private String dealWithUnsatisfiedXMLTimers(Map<String, List<com.ibm.ws.javaee.dd.ejb.Timer>> xmlTimers, BeanMetaData bmd) throws EJBConfigurationException {
String mostRecentMethodWithError = null;
for (Map.Entry<String, List<com.ibm.ws.javaee.dd.ejb.Timer>> entry : xmlTimers.entrySet()) {
... | java | private String dealWithUnsatisfiedXMLTimers(Map<String, List<com.ibm.ws.javaee.dd.ejb.Timer>> xmlTimers, BeanMetaData bmd) throws EJBConfigurationException {
String mostRecentMethodWithError = null;
for (Map.Entry<String, List<com.ibm.ws.javaee.dd.ejb.Timer>> entry : xmlTimers.entrySet()) {
... | [
"private",
"String",
"dealWithUnsatisfiedXMLTimers",
"(",
"Map",
"<",
"String",
",",
"List",
"<",
"com",
".",
"ibm",
".",
"ws",
".",
"javaee",
".",
"dd",
".",
"ejb",
".",
"Timer",
">",
">",
"xmlTimers",
",",
"BeanMetaData",
"bmd",
")",
"throws",
"EJBConf... | Verifies that all timers of a certain parm type (1, 0, or unspecified parm)
were successfully mapped to a Method.
@param xmlTimers List of Timer instances representing timers defined in xml.
@param bmd BeanMetaData
@return
@throws EJBConfigurationException | [
"Verifies",
"that",
"all",
"timers",
"of",
"a",
"certain",
"parm",
"type",
"(",
"1",
"0",
"or",
"unspecified",
"parm",
")",
"were",
"successfully",
"mapped",
"to",
"a",
"Method",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/EJBMDOrchestrator.java#L5293-L5305 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java | FileWriter.write | public File write(byte[] data, int off, int len, boolean isAppend) throws IORuntimeException {
FileOutputStream out = null;
try {
out = new FileOutputStream(FileUtil.touch(file), isAppend);
out.write(data, off, len);
out.flush();
}catch(IOException e){
throw new IORuntimeException(e);
} fina... | java | public File write(byte[] data, int off, int len, boolean isAppend) throws IORuntimeException {
FileOutputStream out = null;
try {
out = new FileOutputStream(FileUtil.touch(file), isAppend);
out.write(data, off, len);
out.flush();
}catch(IOException e){
throw new IORuntimeException(e);
} fina... | [
"public",
"File",
"write",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"off",
",",
"int",
"len",
",",
"boolean",
"isAppend",
")",
"throws",
"IORuntimeException",
"{",
"FileOutputStream",
"out",
"=",
"null",
";",
"try",
"{",
"out",
"=",
"new",
"FileOutputS... | 写入数据到文件
@param data 数据
@param off 数据开始位置
@param len 数据长度
@param isAppend 是否追加模式
@return 目标文件
@throws IORuntimeException IO异常 | [
"写入数据到文件"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/io/file/FileWriter.java#L287-L299 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/PayMchAPI.java | PayMchAPI.payDownloadfundflow | public static PayDownloadfundflowResult payDownloadfundflow(PayDownloadfundflow payDownloadfundflow,String key){
Map<String,String> map = MapUtil.objectToMap(payDownloadfundflow);
String sign_type = map.get("sign_type");
//设置默认签名类型HMAC-SHA256
if(sign_type == null || "".equals(sign_type)){
sign_type = "HMAC-S... | java | public static PayDownloadfundflowResult payDownloadfundflow(PayDownloadfundflow payDownloadfundflow,String key){
Map<String,String> map = MapUtil.objectToMap(payDownloadfundflow);
String sign_type = map.get("sign_type");
//设置默认签名类型HMAC-SHA256
if(sign_type == null || "".equals(sign_type)){
sign_type = "HMAC-S... | [
"public",
"static",
"PayDownloadfundflowResult",
"payDownloadfundflow",
"(",
"PayDownloadfundflow",
"payDownloadfundflow",
",",
"String",
"key",
")",
"{",
"Map",
"<",
"String",
",",
"String",
">",
"map",
"=",
"MapUtil",
".",
"objectToMap",
"(",
"payDownloadfundflow",
... | 下载资金账单<br>
商户可以通过该接口下载自2017年6月1日起 的历史资金流水账单。<br>
说明:<br>
1、资金账单中的数据反映的是商户微信账户资金变动情况;<br>
2、当日账单在次日上午9点开始生成,建议商户在上午10点以后获取;<br>
3、资金账单中涉及金额的字段单位为“元”。<br>
@since 2.8.18
@param payDownloadfundflow payDownloadfundflow
@param key key
@return PayDownloadfundflowResult 对象,请求成功时包含以下数据:<br>
data 文本表格数据 <br>
sign_type 签名类型 <br>
... | [
"下载资金账单<br",
">",
"商户可以通过该接口下载自2017年6月1日起",
"的历史资金流水账单。<br",
">",
"说明:<br",
">",
"1、资金账单中的数据反映的是商户微信账户资金变动情况;<br",
">",
"2、当日账单在次日上午9点开始生成,建议商户在上午10点以后获取;<br",
">",
"3、资金账单中涉及金额的字段单位为“元”。<br",
">"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/PayMchAPI.java#L315-L366 |
jenkinsci/jenkins | core/src/main/java/jenkins/util/FullDuplexHttpService.java | FullDuplexHttpService.download | public synchronized void download(StaplerRequest req, StaplerResponse rsp) throws InterruptedException, IOException {
rsp.setStatus(HttpServletResponse.SC_OK);
// server->client channel.
// this is created first, and this controls the lifespan of the channel
rsp.addHeader("Transfer-Enco... | java | public synchronized void download(StaplerRequest req, StaplerResponse rsp) throws InterruptedException, IOException {
rsp.setStatus(HttpServletResponse.SC_OK);
// server->client channel.
// this is created first, and this controls the lifespan of the channel
rsp.addHeader("Transfer-Enco... | [
"public",
"synchronized",
"void",
"download",
"(",
"StaplerRequest",
"req",
",",
"StaplerResponse",
"rsp",
")",
"throws",
"InterruptedException",
",",
"IOException",
"{",
"rsp",
".",
"setStatus",
"(",
"HttpServletResponse",
".",
"SC_OK",
")",
";",
"// server->client... | This is where we send the data to the client.
<p>
If this connection is lost, we'll abort the channel. | [
"This",
"is",
"where",
"we",
"send",
"the",
"data",
"to",
"the",
"client",
"."
] | train | https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/jenkins/util/FullDuplexHttpService.java#L85-L121 |
google/j2objc | jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java | AttributedString.attributeValuesMatch | private boolean attributeValuesMatch(Set attributes, int runIndex1, int runIndex2) {
Iterator iterator = attributes.iterator();
while (iterator.hasNext()) {
Attribute key = (Attribute) iterator.next();
if (!valuesMatch(getAttribute(key, runIndex1), getAttribute(key, runIndex2))) {... | java | private boolean attributeValuesMatch(Set attributes, int runIndex1, int runIndex2) {
Iterator iterator = attributes.iterator();
while (iterator.hasNext()) {
Attribute key = (Attribute) iterator.next();
if (!valuesMatch(getAttribute(key, runIndex1), getAttribute(key, runIndex2))) {... | [
"private",
"boolean",
"attributeValuesMatch",
"(",
"Set",
"attributes",
",",
"int",
"runIndex1",
",",
"int",
"runIndex2",
")",
"{",
"Iterator",
"iterator",
"=",
"attributes",
".",
"iterator",
"(",
")",
";",
"while",
"(",
"iterator",
".",
"hasNext",
"(",
")",... | returns whether all specified attributes have equal values in the runs with the given indices | [
"returns",
"whether",
"all",
"specified",
"attributes",
"have",
"equal",
"values",
"in",
"the",
"runs",
"with",
"the",
"given",
"indices"
] | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/text/AttributedString.java#L653-L662 |
icode/ameba | src/main/java/ameba/db/ebean/internal/ModelInterceptor.java | ModelInterceptor.applyRowCountHeader | public static void applyRowCountHeader(MultivaluedMap<String, Object> headerParams, Query query, FutureRowCount rowCount) {
if (rowCount != null) {
try {
headerParams.putSingle(REQ_TOTAL_COUNT_HEADER_NAME, rowCount.get());
} catch (InterruptedException | ExecutionExceptio... | java | public static void applyRowCountHeader(MultivaluedMap<String, Object> headerParams, Query query, FutureRowCount rowCount) {
if (rowCount != null) {
try {
headerParams.putSingle(REQ_TOTAL_COUNT_HEADER_NAME, rowCount.get());
} catch (InterruptedException | ExecutionExceptio... | [
"public",
"static",
"void",
"applyRowCountHeader",
"(",
"MultivaluedMap",
"<",
"String",
",",
"Object",
">",
"headerParams",
",",
"Query",
"query",
",",
"FutureRowCount",
"rowCount",
")",
"{",
"if",
"(",
"rowCount",
"!=",
"null",
")",
"{",
"try",
"{",
"heade... | <p>applyRowCountHeader.</p>
@param headerParams a {@link javax.ws.rs.core.MultivaluedMap} object.
@param query a {@link io.ebean.Query} object.
@param rowCount a {@link io.ebean.FutureRowCount} object. | [
"<p",
">",
"applyRowCountHeader",
".",
"<",
"/",
"p",
">"
] | train | https://github.com/icode/ameba/blob/9d4956e935898e41331b2745e400ef869cd265e0/src/main/java/ameba/db/ebean/internal/ModelInterceptor.java#L390-L398 |
WolfgangFahl/Mediawiki-Japi | src/main/java/com/bitplan/mediawiki/japi/user/WikiUser.java | WikiUser.getPropertyFile | public static File getPropertyFile(String wikiId) {
String user = System.getProperty("user.name");
return getPropertyFile(wikiId, user);
} | java | public static File getPropertyFile(String wikiId) {
String user = System.getProperty("user.name");
return getPropertyFile(wikiId, user);
} | [
"public",
"static",
"File",
"getPropertyFile",
"(",
"String",
"wikiId",
")",
"{",
"String",
"user",
"=",
"System",
".",
"getProperty",
"(",
"\"user.name\"",
")",
";",
"return",
"getPropertyFile",
"(",
"wikiId",
",",
"user",
")",
";",
"}"
] | get the propertyFile for the given wikiId
@param wikiId
@return the propertyFile | [
"get",
"the",
"propertyFile",
"for",
"the",
"given",
"wikiId"
] | train | https://github.com/WolfgangFahl/Mediawiki-Japi/blob/78d0177ebfe02eb05da5550839727861f1e888a5/src/main/java/com/bitplan/mediawiki/japi/user/WikiUser.java#L104-L107 |
Azure/azure-sdk-for-java | appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java | DiagnosticsInner.executeSiteAnalysisSlotAsync | public Observable<DiagnosticAnalysisInner> executeSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot, DateTime startTime, DateTime endTime, String timeGrain) {
return executeSiteAnalysisSlotWithServiceResponseAsync(resourceGroupName, site... | java | public Observable<DiagnosticAnalysisInner> executeSiteAnalysisSlotAsync(String resourceGroupName, String siteName, String diagnosticCategory, String analysisName, String slot, DateTime startTime, DateTime endTime, String timeGrain) {
return executeSiteAnalysisSlotWithServiceResponseAsync(resourceGroupName, site... | [
"public",
"Observable",
"<",
"DiagnosticAnalysisInner",
">",
"executeSiteAnalysisSlotAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"siteName",
",",
"String",
"diagnosticCategory",
",",
"String",
"analysisName",
",",
"String",
"slot",
",",
"DateTime",
"start... | Execute Analysis.
Execute Analysis.
@param resourceGroupName Name of the resource group to which the resource belongs.
@param siteName Site Name
@param diagnosticCategory Category Name
@param analysisName Analysis Resource Name
@param slot Slot Name
@param startTime Start Time
@param endTime End Time
@param timeGrain ... | [
"Execute",
"Analysis",
".",
"Execute",
"Analysis",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/appservice/resource-manager/v2018_02_01/src/main/java/com/microsoft/azure/management/appservice/v2018_02_01/implementation/DiagnosticsInner.java#L1995-L2002 |
alkacon/opencms-core | src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java | CmsContentEditor.saveAndDeleteEntities | public void saveAndDeleteEntities(final boolean clearOnSuccess, final I_CmsSimpleCallback<Boolean> callback) {
final CmsEntity entity = m_entityBackend.getEntity(m_entityId);
saveAndDeleteEntities(entity, new ArrayList<String>(m_deletedEntities), clearOnSuccess, callback);
} | java | public void saveAndDeleteEntities(final boolean clearOnSuccess, final I_CmsSimpleCallback<Boolean> callback) {
final CmsEntity entity = m_entityBackend.getEntity(m_entityId);
saveAndDeleteEntities(entity, new ArrayList<String>(m_deletedEntities), clearOnSuccess, callback);
} | [
"public",
"void",
"saveAndDeleteEntities",
"(",
"final",
"boolean",
"clearOnSuccess",
",",
"final",
"I_CmsSimpleCallback",
"<",
"Boolean",
">",
"callback",
")",
"{",
"final",
"CmsEntity",
"entity",
"=",
"m_entityBackend",
".",
"getEntity",
"(",
"m_entityId",
")",
... | Saves the given entities.<p>
@param clearOnSuccess <code>true</code> to clear the VIE instance on success
@param callback the call back command | [
"Saves",
"the",
"given",
"entities",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ade/contenteditor/client/CmsContentEditor.java#L1025-L1029 |
elki-project/elki | addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClassManager.java | CSSClassManager.updateStyleElement | public void updateStyleElement(Document document, Element style) {
StringBuilder buf = new StringBuilder();
serialize(buf);
Text cont = document.createTextNode(buf.toString());
while (style.hasChildNodes()) {
style.removeChild(style.getFirstChild());
}
style.appendChild(cont);
} | java | public void updateStyleElement(Document document, Element style) {
StringBuilder buf = new StringBuilder();
serialize(buf);
Text cont = document.createTextNode(buf.toString());
while (style.hasChildNodes()) {
style.removeChild(style.getFirstChild());
}
style.appendChild(cont);
} | [
"public",
"void",
"updateStyleElement",
"(",
"Document",
"document",
",",
"Element",
"style",
")",
"{",
"StringBuilder",
"buf",
"=",
"new",
"StringBuilder",
"(",
")",
";",
"serialize",
"(",
"buf",
")",
";",
"Text",
"cont",
"=",
"document",
".",
"createTextNo... | Update the text contents of an existing style element.
@param document Document element (factory)
@param style Style element | [
"Update",
"the",
"text",
"contents",
"of",
"an",
"existing",
"style",
"element",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/css/CSSClassManager.java#L192-L200 |
apache/incubator-gobblin | gobblin-utility/src/main/java/org/apache/gobblin/broker/SharedResourcesBrokerUtils.java | SharedResourcesBrokerUtils.isScopeAncestor | static <S extends ScopeType<S>> boolean isScopeAncestor(ScopeWrapper<S> scope, ScopeWrapper<S> possibleAncestor) {
Queue<ScopeWrapper<S>> ancestors = new LinkedList<>();
ancestors.add(scope);
while (true) {
if (ancestors.isEmpty()) {
return false;
}
if (ancestors.peek().equals(poss... | java | static <S extends ScopeType<S>> boolean isScopeAncestor(ScopeWrapper<S> scope, ScopeWrapper<S> possibleAncestor) {
Queue<ScopeWrapper<S>> ancestors = new LinkedList<>();
ancestors.add(scope);
while (true) {
if (ancestors.isEmpty()) {
return false;
}
if (ancestors.peek().equals(poss... | [
"static",
"<",
"S",
"extends",
"ScopeType",
"<",
"S",
">",
">",
"boolean",
"isScopeAncestor",
"(",
"ScopeWrapper",
"<",
"S",
">",
"scope",
",",
"ScopeWrapper",
"<",
"S",
">",
"possibleAncestor",
")",
"{",
"Queue",
"<",
"ScopeWrapper",
"<",
"S",
">>",
"an... | Determine if a {@link ScopeWrapper} is an ancestor of another {@link ScopeWrapper}. | [
"Determine",
"if",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-utility/src/main/java/org/apache/gobblin/broker/SharedResourcesBrokerUtils.java#L61-L73 |
GwtMaterialDesign/gwt-material-addins | src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java | MaterialCutOut.setupCutOutPosition | protected void setupCutOutPosition(Element cutOut, Element relativeTo, int padding, boolean circle) {
float top = relativeTo.getOffsetTop() - (Math.max($("html").scrollTop(), $("body").scrollTop()));
float left = relativeTo.getAbsoluteLeft();
float width = relativeTo.getOffsetWidth();
f... | java | protected void setupCutOutPosition(Element cutOut, Element relativeTo, int padding, boolean circle) {
float top = relativeTo.getOffsetTop() - (Math.max($("html").scrollTop(), $("body").scrollTop()));
float left = relativeTo.getAbsoluteLeft();
float width = relativeTo.getOffsetWidth();
f... | [
"protected",
"void",
"setupCutOutPosition",
"(",
"Element",
"cutOut",
",",
"Element",
"relativeTo",
",",
"int",
"padding",
",",
"boolean",
"circle",
")",
"{",
"float",
"top",
"=",
"relativeTo",
".",
"getOffsetTop",
"(",
")",
"-",
"(",
"Math",
".",
"max",
"... | Setups the cut out position when the screen changes size or is scrolled. | [
"Setups",
"the",
"cut",
"out",
"position",
"when",
"the",
"screen",
"changes",
"size",
"or",
"is",
"scrolled",
"."
] | train | https://github.com/GwtMaterialDesign/gwt-material-addins/blob/11aec9d92918225f70f936285d0ae94f2178c36e/src/main/java/gwt/material/design/addins/client/cutout/MaterialCutOut.java#L371-L401 |
Azure/azure-sdk-for-java | automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobStreamsInner.java | JobStreamsInner.get | public JobStreamInner get(String resourceGroupName, String automationAccountName, String jobId, String jobStreamId) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId, jobStreamId).toBlocking().single().body();
} | java | public JobStreamInner get(String resourceGroupName, String automationAccountName, String jobId, String jobStreamId) {
return getWithServiceResponseAsync(resourceGroupName, automationAccountName, jobId, jobStreamId).toBlocking().single().body();
} | [
"public",
"JobStreamInner",
"get",
"(",
"String",
"resourceGroupName",
",",
"String",
"automationAccountName",
",",
"String",
"jobId",
",",
"String",
"jobStreamId",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"automationAccountName",
... | Retrieve the job stream identified by job stream id.
@param resourceGroupName Name of an Azure Resource group.
@param automationAccountName The name of the automation account.
@param jobId The job id.
@param jobStreamId The job stream id.
@throws IllegalArgumentException thrown if parameters fail the validation
@throw... | [
"Retrieve",
"the",
"job",
"stream",
"identified",
"by",
"job",
"stream",
"id",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/automation/resource-manager/v2015_10_31/src/main/java/com/microsoft/azure/management/automation/v2015_10_31/implementation/JobStreamsInner.java#L86-L88 |
sarl/sarl | main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java | AbstractSARLLaunchConfigurationDelegate.getProgramArguments | @Override
@SuppressWarnings("checkstyle:variabledeclarationusagedistance")
public final String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
// The following line get the standard arguments
final String standardProgramArguments = super.getProgramArguments(configuration);
// Get... | java | @Override
@SuppressWarnings("checkstyle:variabledeclarationusagedistance")
public final String getProgramArguments(ILaunchConfiguration configuration) throws CoreException {
// The following line get the standard arguments
final String standardProgramArguments = super.getProgramArguments(configuration);
// Get... | [
"@",
"Override",
"@",
"SuppressWarnings",
"(",
"\"checkstyle:variabledeclarationusagedistance\"",
")",
"public",
"final",
"String",
"getProgramArguments",
"(",
"ILaunchConfiguration",
"configuration",
")",
"throws",
"CoreException",
"{",
"// The following line get the standard ar... | Replies the arguments of the program including the boot agent name.
{@inheritDoc} | [
"Replies",
"the",
"arguments",
"of",
"the",
"program",
"including",
"the",
"boot",
"agent",
"name",
".",
"{"
] | train | https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/coreplugins/io.sarl.eclipse/src/io/sarl/eclipse/launching/runner/AbstractSARLLaunchConfigurationDelegate.java#L296-L307 |
elki-project/elki | elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java | EvaluateRetrievalPerformance.computeDistances | private void computeDistances(ModifiableDoubleDBIDList nlist, DBIDIter query, final DistanceQuery<O> distQuery, Relation<O> relation) {
nlist.clear();
O qo = relation.get(query);
for(DBIDIter ri = relation.iterDBIDs(); ri.valid(); ri.advance()) {
if(!includeSelf && DBIDUtil.equal(ri, query)) {
... | java | private void computeDistances(ModifiableDoubleDBIDList nlist, DBIDIter query, final DistanceQuery<O> distQuery, Relation<O> relation) {
nlist.clear();
O qo = relation.get(query);
for(DBIDIter ri = relation.iterDBIDs(); ri.valid(); ri.advance()) {
if(!includeSelf && DBIDUtil.equal(ri, query)) {
... | [
"private",
"void",
"computeDistances",
"(",
"ModifiableDoubleDBIDList",
"nlist",
",",
"DBIDIter",
"query",
",",
"final",
"DistanceQuery",
"<",
"O",
">",
"distQuery",
",",
"Relation",
"<",
"O",
">",
"relation",
")",
"{",
"nlist",
".",
"clear",
"(",
")",
";",
... | Compute the distances to the neighbor objects.
@param nlist Neighbor list (output)
@param query Query object
@param distQuery Distance function
@param relation Data relation | [
"Compute",
"the",
"distances",
"to",
"the",
"neighbor",
"objects",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki/src/main/java/de/lmu/ifi/dbs/elki/algorithm/statistics/EvaluateRetrievalPerformance.java#L244-L258 |
mcxiaoke/Android-Next | core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java | IOUtils.skipFully | public static void skipFully(Reader input, long toSkip) throws IOException {
long skipped = skip(input, toSkip);
if (skipped != toSkip) {
throw new EOFException("Chars to skip: " + toSkip + " actual: " + skipped);
}
} | java | public static void skipFully(Reader input, long toSkip) throws IOException {
long skipped = skip(input, toSkip);
if (skipped != toSkip) {
throw new EOFException("Chars to skip: " + toSkip + " actual: " + skipped);
}
} | [
"public",
"static",
"void",
"skipFully",
"(",
"Reader",
"input",
",",
"long",
"toSkip",
")",
"throws",
"IOException",
"{",
"long",
"skipped",
"=",
"skip",
"(",
"input",
",",
"toSkip",
")",
";",
"if",
"(",
"skipped",
"!=",
"toSkip",
")",
"{",
"throw",
"... | Skip the requested number of characters or fail if there are not enough left.
<p/>
This allows for the possibility that {@link Reader#skip(long)} may
not skip as many characters as requested (most likely because of reaching EOF).
@param input stream to skip
@param toSkip the number of characters to skip
@throws IOExc... | [
"Skip",
"the",
"requested",
"number",
"of",
"characters",
"or",
"fail",
"if",
"there",
"are",
"not",
"enough",
"left",
".",
"<p",
"/",
">",
"This",
"allows",
"for",
"the",
"possibility",
"that",
"{",
"@link",
"Reader#skip",
"(",
"long",
")",
"}",
"may",
... | train | https://github.com/mcxiaoke/Android-Next/blob/1bfdf99d0b81a849aa0fa6697c53ed673151ca39/core/src/main/java/com/mcxiaoke/next/utils/IOUtils.java#L869-L874 |
finmath/finmath-lib | src/main/java/net/finmath/montecarlo/interestrate/products/LIBORBond.java | LIBORBond.getValue | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
if(evaluationTime > maturity) {
return new Scalar(0);
}
return model.getLIBOR(evaluationTime, evaluationTime, maturity).mult(maturity - evaluationTime).add(1.0).invert();
... | java | @Override
public RandomVariable getValue(double evaluationTime, LIBORModelMonteCarloSimulationModel model) throws CalculationException {
if(evaluationTime > maturity) {
return new Scalar(0);
}
return model.getLIBOR(evaluationTime, evaluationTime, maturity).mult(maturity - evaluationTime).add(1.0).invert();
... | [
"@",
"Override",
"public",
"RandomVariable",
"getValue",
"(",
"double",
"evaluationTime",
",",
"LIBORModelMonteCarloSimulationModel",
"model",
")",
"throws",
"CalculationException",
"{",
"if",
"(",
"evaluationTime",
">",
"maturity",
")",
"{",
"return",
"new",
"Scalar"... | This method returns the value random variable of the product within the specified model, evaluated at a given evalutationTime.
Note: For a lattice this is often the value conditional to evalutationTime, for a Monte-Carlo simulation this is the (sum of) value discounted to evaluation time.
Cashflows prior evaluationTime... | [
"This",
"method",
"returns",
"the",
"value",
"random",
"variable",
"of",
"the",
"product",
"within",
"the",
"specified",
"model",
"evaluated",
"at",
"a",
"given",
"evalutationTime",
".",
"Note",
":",
"For",
"a",
"lattice",
"this",
"is",
"often",
"the",
"valu... | train | https://github.com/finmath/finmath-lib/blob/a3c067d52dd33feb97d851df6cab130e4116759f/src/main/java/net/finmath/montecarlo/interestrate/products/LIBORBond.java#L43-L50 |
undera/jmeter-plugins | tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java | SynthesisReportGui.getAllDataAsTable | public static DefaultTableModel getAllDataAsTable(ObjectTableModel model, Format[] formats, String[] columns) {
final List<List<Object>> table = getAllTableData(model, formats);
final DefaultTableModel tableModel = new DefaultTableModel();
for (String header : columns) {
tableModel... | java | public static DefaultTableModel getAllDataAsTable(ObjectTableModel model, Format[] formats, String[] columns) {
final List<List<Object>> table = getAllTableData(model, formats);
final DefaultTableModel tableModel = new DefaultTableModel();
for (String header : columns) {
tableModel... | [
"public",
"static",
"DefaultTableModel",
"getAllDataAsTable",
"(",
"ObjectTableModel",
"model",
",",
"Format",
"[",
"]",
"formats",
",",
"String",
"[",
"]",
"columns",
")",
"{",
"final",
"List",
"<",
"List",
"<",
"Object",
">",
">",
"table",
"=",
"getAllTabl... | Present data in javax.swing.table.DefaultTableModel form.
@param model {@link ObjectTableModel}
@param formats Array of {@link Format} array can contain null formatters in this case value is added as is
@param columns Columns headers
@return data in table form | [
"Present",
"data",
"in",
"javax",
".",
"swing",
".",
"table",
".",
"DefaultTableModel",
"form",
"."
] | train | https://github.com/undera/jmeter-plugins/blob/416d2a77249ab921c7e4134c3e6a9639901ef7e8/tools/synthesis/src/main/java/kg/apc/jmeter/vizualizers/SynthesisReportGui.java#L467-L481 |
UrielCh/ovh-java-sdk | ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java | ApiOvhTelephony.billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_PUT | public void billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_PUT(String billingAccount, String serviceName, Long conditionId, OvhEasyHuntingTimeConditions body) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions/{conditionId... | java | public void billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_PUT(String billingAccount, String serviceName, Long conditionId, OvhEasyHuntingTimeConditions body) throws IOException {
String qPath = "/telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions/{conditionId... | [
"public",
"void",
"billingAccount_easyHunting_serviceName_timeConditions_conditions_conditionId_PUT",
"(",
"String",
"billingAccount",
",",
"String",
"serviceName",
",",
"Long",
"conditionId",
",",
"OvhEasyHuntingTimeConditions",
"body",
")",
"throws",
"IOException",
"{",
"Stri... | Alter this object properties
REST: PUT /telephony/{billingAccount}/easyHunting/{serviceName}/timeConditions/conditions/{conditionId}
@param body [required] New object properties
@param billingAccount [required] The name of your billingAccount
@param serviceName [required]
@param conditionId [required] | [
"Alter",
"this",
"object",
"properties"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-telephony/src/main/java/net/minidev/ovh/api/ApiOvhTelephony.java#L3341-L3345 |
kiegroup/drools | kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/impl/FEELImpl.java | FEELImpl.newEvaluationContext | public EvaluationContextImpl newEvaluationContext(ClassLoader cl, Collection<FEELEventListener> listeners, Map<String, Object> inputVariables) {
FEELEventListenersManager eventsManager = getEventsManager(listeners);
EvaluationContextImpl ctx = new EvaluationContextImpl(cl, eventsManager, inputVariables.... | java | public EvaluationContextImpl newEvaluationContext(ClassLoader cl, Collection<FEELEventListener> listeners, Map<String, Object> inputVariables) {
FEELEventListenersManager eventsManager = getEventsManager(listeners);
EvaluationContextImpl ctx = new EvaluationContextImpl(cl, eventsManager, inputVariables.... | [
"public",
"EvaluationContextImpl",
"newEvaluationContext",
"(",
"ClassLoader",
"cl",
",",
"Collection",
"<",
"FEELEventListener",
">",
"listeners",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"inputVariables",
")",
"{",
"FEELEventListenersManager",
"eventsManager",
... | Creates a new EvaluationContext with the supplied classloader, and the supplied parameters listeners and inputVariables | [
"Creates",
"a",
"new",
"EvaluationContext",
"with",
"the",
"supplied",
"classloader",
"and",
"the",
"supplied",
"parameters",
"listeners",
"and",
"inputVariables"
] | train | https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/kie-dmn/kie-dmn-feel/src/main/java/org/kie/dmn/feel/lang/impl/FEELImpl.java#L177-L190 |
zaproxy/zaproxy | src/org/zaproxy/zap/view/StandardFieldsDialog.java | StandardFieldsDialog.createTabScrollable | protected JScrollPane createTabScrollable(String tabLabel, JPanel tabPanel) {
return new JScrollPane(tabPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
} | java | protected JScrollPane createTabScrollable(String tabLabel, JPanel tabPanel) {
return new JScrollPane(tabPanel, JScrollPane.VERTICAL_SCROLLBAR_AS_NEEDED, JScrollPane.HORIZONTAL_SCROLLBAR_AS_NEEDED);
} | [
"protected",
"JScrollPane",
"createTabScrollable",
"(",
"String",
"tabLabel",
",",
"JPanel",
"tabPanel",
")",
"{",
"return",
"new",
"JScrollPane",
"(",
"tabPanel",
",",
"JScrollPane",
".",
"VERTICAL_SCROLLBAR_AS_NEEDED",
",",
"JScrollPane",
".",
"HORIZONTAL_SCROLLBAR_AS... | Creates and returns a {@link JScrollPane} for the given panel. Called when a tab is
{@link #setTabScrollable(String, boolean) set to be scrollable}.
<p>
By default this method returns a {@code JScrollPane} that has the vertical and horizontal scrollbars shown as needed.
@param tabLabel the label of the tab, as set dur... | [
"Creates",
"and",
"returns",
"a",
"{",
"@link",
"JScrollPane",
"}",
"for",
"the",
"given",
"panel",
".",
"Called",
"when",
"a",
"tab",
"is",
"{",
"@link",
"#setTabScrollable",
"(",
"String",
"boolean",
")",
"set",
"to",
"be",
"scrollable",
"}",
".",
"<p"... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/zaproxy/zap/view/StandardFieldsDialog.java#L1939-L1941 |
syphr42/prom | src/main/java/org/syphr/prom/PropertiesManager.java | PropertiesManager.getEnumProperty | public <E extends Enum<E>> E getEnumProperty(T property, Class<E> type) throws IllegalArgumentException
{
return Enum.valueOf(type, getProperty(property).toUpperCase());
} | java | public <E extends Enum<E>> E getEnumProperty(T property, Class<E> type) throws IllegalArgumentException
{
return Enum.valueOf(type, getProperty(property).toUpperCase());
} | [
"public",
"<",
"E",
"extends",
"Enum",
"<",
"E",
">",
">",
"E",
"getEnumProperty",
"(",
"T",
"property",
",",
"Class",
"<",
"E",
">",
"type",
")",
"throws",
"IllegalArgumentException",
"{",
"return",
"Enum",
".",
"valueOf",
"(",
"type",
",",
"getProperty... | Retrieve the value of the given property as an Enum constant of the given
type.<br>
<br>
Note that this method requires the Enum constants to all have upper case
names (following Java naming conventions). This allows for case
insensitivity in the properties file.
@param <E>
the type of Enum that will be returned
@para... | [
"Retrieve",
"the",
"value",
"of",
"the",
"given",
"property",
"as",
"an",
"Enum",
"constant",
"of",
"the",
"given",
"type",
".",
"<br",
">",
"<br",
">",
"Note",
"that",
"this",
"method",
"requires",
"the",
"Enum",
"constants",
"to",
"all",
"have",
"upper... | train | https://github.com/syphr42/prom/blob/074d67c4ebb3afb0b163fcb0bc4826ee577ac803/src/main/java/org/syphr/prom/PropertiesManager.java#L582-L585 |
mcaserta/spring-crypto-utils | src/main/java/com/springcryptoutils/core/key/PublicKeyRegistryByAliasImpl.java | PublicKeyRegistryByAliasImpl.get | public PublicKey get(KeyStoreChooser keyStoreChooser, PublicKeyChooserByAlias publicKeyChooserByAlias) {
CacheKey cacheKey = new CacheKey(keyStoreChooser.getKeyStoreName(), publicKeyChooserByAlias.getAlias());
PublicKey retrievedPublicKey = cache.get(cacheKey);
if (retrievedPublicKey != null) {... | java | public PublicKey get(KeyStoreChooser keyStoreChooser, PublicKeyChooserByAlias publicKeyChooserByAlias) {
CacheKey cacheKey = new CacheKey(keyStoreChooser.getKeyStoreName(), publicKeyChooserByAlias.getAlias());
PublicKey retrievedPublicKey = cache.get(cacheKey);
if (retrievedPublicKey != null) {... | [
"public",
"PublicKey",
"get",
"(",
"KeyStoreChooser",
"keyStoreChooser",
",",
"PublicKeyChooserByAlias",
"publicKeyChooserByAlias",
")",
"{",
"CacheKey",
"cacheKey",
"=",
"new",
"CacheKey",
"(",
"keyStoreChooser",
".",
"getKeyStoreName",
"(",
")",
",",
"publicKeyChooser... | Returns the selected public key or null if not found.
@param keyStoreChooser the keystore chooser
@param publicKeyChooserByAlias the public key chooser by alias
@return the selected public key or null if not found | [
"Returns",
"the",
"selected",
"public",
"key",
"or",
"null",
"if",
"not",
"found",
"."
] | train | https://github.com/mcaserta/spring-crypto-utils/blob/1dbf6211542fb1e3f9297941d691e7e89cc72c46/src/main/java/com/springcryptoutils/core/key/PublicKeyRegistryByAliasImpl.java#L53-L81 |
apache/flink | flink-core/src/main/java/org/apache/flink/configuration/Configuration.java | Configuration.getInteger | @PublicEvolving
public int getInteger(ConfigOption<Integer> configOption, int overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToInt(o, configOption.defaultValue());
} | java | @PublicEvolving
public int getInteger(ConfigOption<Integer> configOption, int overrideDefault) {
Object o = getRawValueFromOption(configOption);
if (o == null) {
return overrideDefault;
}
return convertToInt(o, configOption.defaultValue());
} | [
"@",
"PublicEvolving",
"public",
"int",
"getInteger",
"(",
"ConfigOption",
"<",
"Integer",
">",
"configOption",
",",
"int",
"overrideDefault",
")",
"{",
"Object",
"o",
"=",
"getRawValueFromOption",
"(",
"configOption",
")",
";",
"if",
"(",
"o",
"==",
"null",
... | Returns the value associated with the given config option as an integer.
If no value is mapped under any key of the option, it returns the specified
default instead of the option's default value.
@param configOption The configuration option
@param overrideDefault The value to return if no value was mapper for any key ... | [
"Returns",
"the",
"value",
"associated",
"with",
"the",
"given",
"config",
"option",
"as",
"an",
"integer",
".",
"If",
"no",
"value",
"is",
"mapped",
"under",
"any",
"key",
"of",
"the",
"option",
"it",
"returns",
"the",
"specified",
"default",
"instead",
"... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/configuration/Configuration.java#L234-L241 |
podio/podio-java | src/main/java/com/podio/app/AppAPI.java | AppAPI.getField | public ApplicationField getField(int appId, String externalId) {
return getResourceFactory().getApiResource(
"/app/" + appId + "/field/" + externalId).get(
ApplicationField.class);
} | java | public ApplicationField getField(int appId, String externalId) {
return getResourceFactory().getApiResource(
"/app/" + appId + "/field/" + externalId).get(
ApplicationField.class);
} | [
"public",
"ApplicationField",
"getField",
"(",
"int",
"appId",
",",
"String",
"externalId",
")",
"{",
"return",
"getResourceFactory",
"(",
")",
".",
"getApiResource",
"(",
"\"/app/\"",
"+",
"appId",
"+",
"\"/field/\"",
"+",
"externalId",
")",
".",
"get",
"(",
... | Returns a single field from an app.
@param appId
The id of the app the field is on
@param externalId
The id of the field to be returned
@return The definition and current configuration of the requested field | [
"Returns",
"a",
"single",
"field",
"from",
"an",
"app",
"."
] | train | https://github.com/podio/podio-java/blob/a520b23bac118c957ce02cdd8ff42a6c7d17b49a/src/main/java/com/podio/app/AppAPI.java#L159-L163 |
Frostman/dropbox4j | src/main/java/ru/frostman/dropbox/api/DropboxClient.java | DropboxClient.createFolder | public Entry createFolder(String path) {
OAuthRequest request = new OAuthRequest(Verb.GET, FILE_OPS_CREATE_FOLDER_URL);
request.addQuerystringParameter("root", "dropbox");
request.addQuerystringParameter("path", encode(path));
service.signRequest(accessToken, request);
String co... | java | public Entry createFolder(String path) {
OAuthRequest request = new OAuthRequest(Verb.GET, FILE_OPS_CREATE_FOLDER_URL);
request.addQuerystringParameter("root", "dropbox");
request.addQuerystringParameter("path", encode(path));
service.signRequest(accessToken, request);
String co... | [
"public",
"Entry",
"createFolder",
"(",
"String",
"path",
")",
"{",
"OAuthRequest",
"request",
"=",
"new",
"OAuthRequest",
"(",
"Verb",
".",
"GET",
",",
"FILE_OPS_CREATE_FOLDER_URL",
")",
";",
"request",
".",
"addQuerystringParameter",
"(",
"\"root\"",
",",
"\"d... | Create folder with specified path.
@param path to create
@return metadata of created folder
@see Entry | [
"Create",
"folder",
"with",
"specified",
"path",
"."
] | train | https://github.com/Frostman/dropbox4j/blob/774c817e5bf294d0139ecb5ac81399be50ada5e0/src/main/java/ru/frostman/dropbox/api/DropboxClient.java#L258-L267 |
liferay/com-liferay-commerce | commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderNotePersistenceImpl.java | CommerceOrderNotePersistenceImpl.findAll | @Override
public List<CommerceOrderNote> findAll(int start, int end) {
return findAll(start, end, null);
} | java | @Override
public List<CommerceOrderNote> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceOrderNote",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce order notes.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"order",
"notes",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CommerceOrderNotePersistenceImpl.java#L2027-L2030 |
twitter/hraven | hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java | JobFileTableMapper.getMegaByteMillisPut | private Put getMegaByteMillisPut(Long mbMillis, JobKey jobKey) {
Put pMb = new Put(jobKeyConv.toBytes(jobKey));
pMb.addColumn(Constants.INFO_FAM_BYTES, Constants.MEGABYTEMILLIS_BYTES,
Bytes.toBytes(mbMillis));
return pMb;
} | java | private Put getMegaByteMillisPut(Long mbMillis, JobKey jobKey) {
Put pMb = new Put(jobKeyConv.toBytes(jobKey));
pMb.addColumn(Constants.INFO_FAM_BYTES, Constants.MEGABYTEMILLIS_BYTES,
Bytes.toBytes(mbMillis));
return pMb;
} | [
"private",
"Put",
"getMegaByteMillisPut",
"(",
"Long",
"mbMillis",
",",
"JobKey",
"jobKey",
")",
"{",
"Put",
"pMb",
"=",
"new",
"Put",
"(",
"jobKeyConv",
".",
"toBytes",
"(",
"jobKey",
")",
")",
";",
"pMb",
".",
"addColumn",
"(",
"Constants",
".",
"INFO_... | generates a put for the megabytemillis
@param mbMillis
@param jobKey
@return the put with megabytemillis | [
"generates",
"a",
"put",
"for",
"the",
"megabytemillis"
] | train | https://github.com/twitter/hraven/blob/e35996b6e2f016bcd18db0bad320be7c93d95208/hraven-etl/src/main/java/com/twitter/hraven/mapreduce/JobFileTableMapper.java#L431-L436 |
UrielCh/ovh-java-sdk | ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java | ApiOvhDedicatedserver.availabilities_raw_GET | public ArrayList<OvhAvailabilitiesRaw> availabilities_raw_GET() throws IOException {
String qPath = "/dedicated/server/availabilities/raw";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t16);
} | java | public ArrayList<OvhAvailabilitiesRaw> availabilities_raw_GET() throws IOException {
String qPath = "/dedicated/server/availabilities/raw";
StringBuilder sb = path(qPath);
String resp = execN(qPath, "GET", sb.toString(), null);
return convertTo(resp, t16);
} | [
"public",
"ArrayList",
"<",
"OvhAvailabilitiesRaw",
">",
"availabilities_raw_GET",
"(",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/dedicated/server/availabilities/raw\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
")",
";",
"String",
... | List the availability of dedicated server
REST: GET /dedicated/server/availabilities/raw | [
"List",
"the",
"availability",
"of",
"dedicated",
"server"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-dedicatedserver/src/main/java/net/minidev/ovh/api/ApiOvhDedicatedserver.java#L2360-L2365 |
mapfish/mapfish-print | core/src/main/java/org/mapfish/print/processor/map/SetTiledWmsProcessor.java | SetTiledWmsProcessor.adaptTileDimensions | private static Dimension adaptTileDimensions(
final Dimension pixels, final int maxWidth, final int maxHeight) {
return new Dimension(adaptTileDimension(pixels.width, maxWidth),
adaptTileDimension(pixels.height, maxHeight));
} | java | private static Dimension adaptTileDimensions(
final Dimension pixels, final int maxWidth, final int maxHeight) {
return new Dimension(adaptTileDimension(pixels.width, maxWidth),
adaptTileDimension(pixels.height, maxHeight));
} | [
"private",
"static",
"Dimension",
"adaptTileDimensions",
"(",
"final",
"Dimension",
"pixels",
",",
"final",
"int",
"maxWidth",
",",
"final",
"int",
"maxHeight",
")",
"{",
"return",
"new",
"Dimension",
"(",
"adaptTileDimension",
"(",
"pixels",
".",
"width",
",",
... | Adapt the size of the tiles so that we have the same amount of tiles as we would have had with maxWidth
and maxHeight, but with the smallest tiles as possible. | [
"Adapt",
"the",
"size",
"of",
"the",
"tiles",
"so",
"that",
"we",
"have",
"the",
"same",
"amount",
"of",
"tiles",
"as",
"we",
"would",
"have",
"had",
"with",
"maxWidth",
"and",
"maxHeight",
"but",
"with",
"the",
"smallest",
"tiles",
"as",
"possible",
"."... | train | https://github.com/mapfish/mapfish-print/blob/25a452cb39f592bd8a53b20db1037703898e1e22/core/src/main/java/org/mapfish/print/processor/map/SetTiledWmsProcessor.java#L67-L71 |
Alluxio/alluxio | core/base/src/main/java/alluxio/util/SleepUtils.java | SleepUtils.sleepMs | public static void sleepMs(Logger logger, long timeMs) {
try {
Thread.sleep(timeMs);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (logger != null) {
logger.warn(e.getMessage(), e);
}
}
} | java | public static void sleepMs(Logger logger, long timeMs) {
try {
Thread.sleep(timeMs);
} catch (InterruptedException e) {
Thread.currentThread().interrupt();
if (logger != null) {
logger.warn(e.getMessage(), e);
}
}
} | [
"public",
"static",
"void",
"sleepMs",
"(",
"Logger",
"logger",
",",
"long",
"timeMs",
")",
"{",
"try",
"{",
"Thread",
".",
"sleep",
"(",
"timeMs",
")",
";",
"}",
"catch",
"(",
"InterruptedException",
"e",
")",
"{",
"Thread",
".",
"currentThread",
"(",
... | Sleeps for the given number of milliseconds, reporting interruptions using the given logger.
Unlike Thread.sleep(), this method responds to interrupts by setting the thread interrupt
status. This means that callers must check the interrupt status if they need to handle
interrupts.
@param logger logger for reporting i... | [
"Sleeps",
"for",
"the",
"given",
"number",
"of",
"milliseconds",
"reporting",
"interruptions",
"using",
"the",
"given",
"logger",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/base/src/main/java/alluxio/util/SleepUtils.java#L45-L54 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/boosting/Bagging.java | Bagging.getWeightSampledDataSet | public static ClassificationDataSet getWeightSampledDataSet(ClassificationDataSet dataSet, int[] sampledCounts)
{
ClassificationDataSet destination = new ClassificationDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories(), dataSet.getPredicting());
for (int i = 0; i < sampledCounts.length;... | java | public static ClassificationDataSet getWeightSampledDataSet(ClassificationDataSet dataSet, int[] sampledCounts)
{
ClassificationDataSet destination = new ClassificationDataSet(dataSet.getNumNumericalVars(), dataSet.getCategories(), dataSet.getPredicting());
for (int i = 0; i < sampledCounts.length;... | [
"public",
"static",
"ClassificationDataSet",
"getWeightSampledDataSet",
"(",
"ClassificationDataSet",
"dataSet",
",",
"int",
"[",
"]",
"sampledCounts",
")",
"{",
"ClassificationDataSet",
"destination",
"=",
"new",
"ClassificationDataSet",
"(",
"dataSet",
".",
"getNumNumer... | Creates a new data set from the given sample counts. Points sampled
multiple times will be added once to the data set with their weight
multiplied by the number of times it was sampled.
@param dataSet the data set that was sampled from
@param sampledCounts the sampling values obtained from
{@link #sampleWithReplacement... | [
"Creates",
"a",
"new",
"data",
"set",
"from",
"the",
"given",
"sample",
"counts",
".",
"Points",
"sampled",
"multiple",
"times",
"will",
"be",
"added",
"once",
"to",
"the",
"data",
"set",
"with",
"their",
"weight",
"multiplied",
"by",
"the",
"number",
"of"... | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/boosting/Bagging.java#L301-L314 |
pip-services3-java/pip-services3-components-java | src/org/pipservices3/components/count/CachedCounters.java | CachedCounters.stats | public void stats(String name, float value) {
Counter counter = get(name, CounterType.Statistics);
calculateStats(counter, value);
update();
} | java | public void stats(String name, float value) {
Counter counter = get(name, CounterType.Statistics);
calculateStats(counter, value);
update();
} | [
"public",
"void",
"stats",
"(",
"String",
"name",
",",
"float",
"value",
")",
"{",
"Counter",
"counter",
"=",
"get",
"(",
"name",
",",
"CounterType",
".",
"Statistics",
")",
";",
"calculateStats",
"(",
"counter",
",",
"value",
")",
";",
"update",
"(",
... | Calculates min/average/max statistics based on the current and previous
values.
@param name a counter name of Statistics type
@param value a value to update statistics | [
"Calculates",
"min",
"/",
"average",
"/",
"max",
"statistics",
"based",
"on",
"the",
"current",
"and",
"previous",
"values",
"."
] | train | https://github.com/pip-services3-java/pip-services3-components-java/blob/122352fbf9b208f6417376da7b8ad725bc85ee58/src/org/pipservices3/components/count/CachedCounters.java#L205-L209 |
sai-pullabhotla/catatumbo | src/main/java/com/jmethods/catatumbo/impl/DefaultEntityManager.java | DefaultEntityManager.executeEntityListeners | public void executeEntityListeners(CallbackType callbackType, List<?> entities) {
for (Object entity : entities) {
executeEntityListeners(callbackType, entity);
}
} | java | public void executeEntityListeners(CallbackType callbackType, List<?> entities) {
for (Object entity : entities) {
executeEntityListeners(callbackType, entity);
}
} | [
"public",
"void",
"executeEntityListeners",
"(",
"CallbackType",
"callbackType",
",",
"List",
"<",
"?",
">",
"entities",
")",
"{",
"for",
"(",
"Object",
"entity",
":",
"entities",
")",
"{",
"executeEntityListeners",
"(",
"callbackType",
",",
"entity",
")",
";"... | Executes the entity listeners associated with the given list of entities.
@param callbackType
the callback type
@param entities
the entities | [
"Executes",
"the",
"entity",
"listeners",
"associated",
"with",
"the",
"given",
"list",
"of",
"entities",
"."
] | train | https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DefaultEntityManager.java#L480-L484 |
lucee/Lucee | core/src/main/java/lucee/runtime/registry/RegistryQuery.java | RegistryQuery.setValue | public static void setValue(String branch, String entry, short type, String value) throws RegistryException, IOException, InterruptedException {
if (type == RegistryEntry.TYPE_KEY) {
String fullKey = ListUtil.trim(branch, "\\") + "\\" + ListUtil.trim(entry, "\\");
// String[] cmd = new String[]{"reg","add",... | java | public static void setValue(String branch, String entry, short type, String value) throws RegistryException, IOException, InterruptedException {
if (type == RegistryEntry.TYPE_KEY) {
String fullKey = ListUtil.trim(branch, "\\") + "\\" + ListUtil.trim(entry, "\\");
// String[] cmd = new String[]{"reg","add",... | [
"public",
"static",
"void",
"setValue",
"(",
"String",
"branch",
",",
"String",
"entry",
",",
"short",
"type",
",",
"String",
"value",
")",
"throws",
"RegistryException",
",",
"IOException",
",",
"InterruptedException",
"{",
"if",
"(",
"type",
"==",
"RegistryE... | writes a value to registry
@param branch
@param entry
@param type
@param value
@throws RegistryException
@throws IOException
@throws InterruptedException | [
"writes",
"a",
"value",
"to",
"registry"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/registry/RegistryQuery.java#L101-L114 |
alkacon/opencms-core | src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java | CmsImportExportUserDialog.getExportUserDialogForGroup | public static CmsImportExportUserDialog getExportUserDialogForGroup(
CmsUUID groupID,
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
CmsImportExportUserDialog res = new CmsImportExportUserDialog(ou, groupID, window, allowTechnicalFieldsExport);
return re... | java | public static CmsImportExportUserDialog getExportUserDialogForGroup(
CmsUUID groupID,
String ou,
Window window,
boolean allowTechnicalFieldsExport) {
CmsImportExportUserDialog res = new CmsImportExportUserDialog(ou, groupID, window, allowTechnicalFieldsExport);
return re... | [
"public",
"static",
"CmsImportExportUserDialog",
"getExportUserDialogForGroup",
"(",
"CmsUUID",
"groupID",
",",
"String",
"ou",
",",
"Window",
"window",
",",
"boolean",
"allowTechnicalFieldsExport",
")",
"{",
"CmsImportExportUserDialog",
"res",
"=",
"new",
"CmsImportExpor... | Gets an dialog instance for fixed group.<p>
@param groupID id
@param ou ou name
@param window window
@param allowTechnicalFieldsExport flag indicates if technical field export option should be available
@return an instance of this class | [
"Gets",
"an",
"dialog",
"instance",
"for",
"fixed",
"group",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/user/CmsImportExportUserDialog.java#L453-L461 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java | AbstractSaml20ObjectBuilder.newSubject | public Subject newSubject(final String nameIdFormat, final String nameIdValue,
final String recipient, final ZonedDateTime notOnOrAfter,
final String inResponseTo, final ZonedDateTime notBefore) {
val nameID = getNameID(nameIdFormat, nameIdValue);
... | java | public Subject newSubject(final String nameIdFormat, final String nameIdValue,
final String recipient, final ZonedDateTime notOnOrAfter,
final String inResponseTo, final ZonedDateTime notBefore) {
val nameID = getNameID(nameIdFormat, nameIdValue);
... | [
"public",
"Subject",
"newSubject",
"(",
"final",
"String",
"nameIdFormat",
",",
"final",
"String",
"nameIdValue",
",",
"final",
"String",
"recipient",
",",
"final",
"ZonedDateTime",
"notOnOrAfter",
",",
"final",
"String",
"inResponseTo",
",",
"final",
"ZonedDateTime... | New subject subject.
@param nameIdFormat the name id format
@param nameIdValue the name id value
@param recipient the recipient
@param notOnOrAfter the not on or after
@param inResponseTo the in response to
@param notBefore the not before
@return the subject | [
"New",
"subject",
"subject",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L410-L415 |
btrplace/scheduler | api/src/main/java/org/btrplace/plan/event/Action.java | Action.addEvent | public boolean addEvent(Hook k, Event n) {
Set<Event> l = events.get(k);
if (l == null) {
l = new HashSet<>();
events.put(k, l);
}
return l.add(n);
} | java | public boolean addEvent(Hook k, Event n) {
Set<Event> l = events.get(k);
if (l == null) {
l = new HashSet<>();
events.put(k, l);
}
return l.add(n);
} | [
"public",
"boolean",
"addEvent",
"(",
"Hook",
"k",
",",
"Event",
"n",
")",
"{",
"Set",
"<",
"Event",
">",
"l",
"=",
"events",
".",
"get",
"(",
"k",
")",
";",
"if",
"(",
"l",
"==",
"null",
")",
"{",
"l",
"=",
"new",
"HashSet",
"<>",
"(",
")",
... | Add an event to the action.
The moment the event will be executed depends on its hook.
@param k the hook
@param n the event to attach
@return {@code true} iff the event was added | [
"Add",
"an",
"event",
"to",
"the",
"action",
".",
"The",
"moment",
"the",
"event",
"will",
"be",
"executed",
"depends",
"on",
"its",
"hook",
"."
] | train | https://github.com/btrplace/scheduler/blob/611063aad0b47a016e57ebf36fa4dfdf24de09e8/api/src/main/java/org/btrplace/plan/event/Action.java#L151-L158 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java | URLUtil.getReader | public static BufferedReader getReader(URL url, Charset charset) {
return IoUtil.getReader(getStream(url), charset);
} | java | public static BufferedReader getReader(URL url, Charset charset) {
return IoUtil.getReader(getStream(url), charset);
} | [
"public",
"static",
"BufferedReader",
"getReader",
"(",
"URL",
"url",
",",
"Charset",
"charset",
")",
"{",
"return",
"IoUtil",
".",
"getReader",
"(",
"getStream",
"(",
"url",
")",
",",
"charset",
")",
";",
"}"
] | 获得Reader
@param url {@link URL}
@param charset 编码
@return {@link BufferedReader}
@since 3.2.1 | [
"获得Reader"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/util/URLUtil.java#L523-L525 |
alkacon/opencms-core | src/org/opencms/synchronize/CmsSynchronize.java | CmsSynchronize.importToVfs | private void importToVfs(File fsFile, String resName, String folder) throws CmsException {
try {
// get the content of the FS file
byte[] content = CmsFileUtil.readFile(fsFile);
// create the file
String filename = translate(fsFile.getName());
m_rep... | java | private void importToVfs(File fsFile, String resName, String folder) throws CmsException {
try {
// get the content of the FS file
byte[] content = CmsFileUtil.readFile(fsFile);
// create the file
String filename = translate(fsFile.getName());
m_rep... | [
"private",
"void",
"importToVfs",
"(",
"File",
"fsFile",
",",
"String",
"resName",
",",
"String",
"folder",
")",
"throws",
"CmsException",
"{",
"try",
"{",
"// get the content of the FS file",
"byte",
"[",
"]",
"content",
"=",
"CmsFileUtil",
".",
"readFile",
"("... | Imports a new resource from the FS into the VFS and updates the
synchronization lists.<p>
@param fsFile the file in the FS
@param resName the name of the resource in the VFS
@param folder the folder to import the file into
@throws CmsException if something goes wrong | [
"Imports",
"a",
"new",
"resource",
"from",
"the",
"FS",
"into",
"the",
"VFS",
"and",
"updates",
"the",
"synchronization",
"lists",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/synchronize/CmsSynchronize.java#L528-L596 |
lightbend/config | config/src/main/java/com/typesafe/config/ConfigFactory.java | ConfigFactory.parseReader | public static Config parseReader(Reader reader, ConfigParseOptions options) {
return Parseable.newReader(reader, options).parse().toConfig();
} | java | public static Config parseReader(Reader reader, ConfigParseOptions options) {
return Parseable.newReader(reader, options).parse().toConfig();
} | [
"public",
"static",
"Config",
"parseReader",
"(",
"Reader",
"reader",
",",
"ConfigParseOptions",
"options",
")",
"{",
"return",
"Parseable",
".",
"newReader",
"(",
"reader",
",",
"options",
")",
".",
"parse",
"(",
")",
".",
"toConfig",
"(",
")",
";",
"}"
] | Parses a Reader into a Config instance. Does not call
{@link Config#resolve} or merge the parsed stream with any
other configuration; this method parses a single stream and
does nothing else. It does process "include" statements in
the parsed stream, and may end up doing other IO due to those
statements.
@param reader... | [
"Parses",
"a",
"Reader",
"into",
"a",
"Config",
"instance",
".",
"Does",
"not",
"call",
"{",
"@link",
"Config#resolve",
"}",
"or",
"merge",
"the",
"parsed",
"stream",
"with",
"any",
"other",
"configuration",
";",
"this",
"method",
"parses",
"a",
"single",
... | train | https://github.com/lightbend/config/blob/68cebfde5e861e9a5fdc75ceff366ed95e17d475/config/src/main/java/com/typesafe/config/ConfigFactory.java#L672-L674 |
apache/incubator-gobblin | gobblin-core-base/src/main/java/org/apache/gobblin/converter/AsyncConverter1to1.java | AsyncConverter1to1.processStream | @Override
public RecordStreamWithMetadata<DO, SO> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws SchemaConversionException {
int maxConcurrentAsyncConversions = workUnitState.getPropAsInt(MAX_CONCURRENT_ASYNC_CONVERSIONS_KEY,
DEFAULT_MAX_CONCURRENT_AS... | java | @Override
public RecordStreamWithMetadata<DO, SO> processStream(RecordStreamWithMetadata<DI, SI> inputStream,
WorkUnitState workUnitState) throws SchemaConversionException {
int maxConcurrentAsyncConversions = workUnitState.getPropAsInt(MAX_CONCURRENT_ASYNC_CONVERSIONS_KEY,
DEFAULT_MAX_CONCURRENT_AS... | [
"@",
"Override",
"public",
"RecordStreamWithMetadata",
"<",
"DO",
",",
"SO",
">",
"processStream",
"(",
"RecordStreamWithMetadata",
"<",
"DI",
",",
"SI",
">",
"inputStream",
",",
"WorkUnitState",
"workUnitState",
")",
"throws",
"SchemaConversionException",
"{",
"int... | Return a {@link RecordStreamWithMetadata} with the appropriate modifications.
@param inputStream
@param workUnitState
@return
@throws SchemaConversionException
@implNote this processStream does not handle {@link org.apache.gobblin.stream.MetadataUpdateControlMessage}s | [
"Return",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core-base/src/main/java/org/apache/gobblin/converter/AsyncConverter1to1.java#L78-L99 |
OrienteerBAP/wicket-orientdb | wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java | OSchemaHelper.oClass | public OSchemaHelper oClass(String className, String... superClasses)
{
return oClass(className, false, superClasses);
} | java | public OSchemaHelper oClass(String className, String... superClasses)
{
return oClass(className, false, superClasses);
} | [
"public",
"OSchemaHelper",
"oClass",
"(",
"String",
"className",
",",
"String",
"...",
"superClasses",
")",
"{",
"return",
"oClass",
"(",
"className",
",",
"false",
",",
"superClasses",
")",
";",
"}"
] | Create if required {@link OClass}
@param className name of a class to create
@param superClasses list of superclasses
@return this helper | [
"Create",
"if",
"required",
"{"
] | train | https://github.com/OrienteerBAP/wicket-orientdb/blob/eb1d94f00a6bff9e266c5c032baa6043afc1db92/wicket-orientdb/src/main/java/ru/ydn/wicket/wicketorientdb/utils/OSchemaHelper.java#L65-L68 |
svenkubiak/mangooio | mangooio-core/src/main/java/io/mangoo/utils/SchedulerUtils.java | SchedulerUtils.createJobDetail | public static JobDetail createJobDetail(String identity, String groupName, Class<? extends Job> clazz) {
Objects.requireNonNull(identity, Required.IDENTITY.toString());
Objects.requireNonNull(groupName, Required.GROUP_NAME.toString());
Objects.requireNonNull(clazz, Required.CLASS.toString());
... | java | public static JobDetail createJobDetail(String identity, String groupName, Class<? extends Job> clazz) {
Objects.requireNonNull(identity, Required.IDENTITY.toString());
Objects.requireNonNull(groupName, Required.GROUP_NAME.toString());
Objects.requireNonNull(clazz, Required.CLASS.toString());
... | [
"public",
"static",
"JobDetail",
"createJobDetail",
"(",
"String",
"identity",
",",
"String",
"groupName",
",",
"Class",
"<",
"?",
"extends",
"Job",
">",
"clazz",
")",
"{",
"Objects",
".",
"requireNonNull",
"(",
"identity",
",",
"Required",
".",
"IDENTITY",
... | Creates a new quartz scheduler JobDetail, which can be used to
schedule a new job by passing it into {@link io.mangoo.scheduler.Scheduler#schedule(JobDetail, Trigger) schedule}
@param identity The name of the job
@param groupName The name of the job Group
@param clazz The class where the actual execution takes place
... | [
"Creates",
"a",
"new",
"quartz",
"scheduler",
"JobDetail",
"which",
"can",
"be",
"used",
"to",
"schedule",
"a",
"new",
"job",
"by",
"passing",
"it",
"into",
"{",
"@link",
"io",
".",
"mangoo",
".",
"scheduler",
".",
"Scheduler#schedule",
"(",
"JobDetail",
"... | train | https://github.com/svenkubiak/mangooio/blob/b3beb6d09510dbbab0ed947d5069c463e1fda6e7/mangooio-core/src/main/java/io/mangoo/utils/SchedulerUtils.java#L62-L70 |
micronaut-projects/micronaut-core | inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java | AbstractClassFileWriter.getTypeDescriptor | protected static String getTypeDescriptor(Object type) {
if (type instanceof Class) {
return Type.getDescriptor((Class) type);
} else if (type instanceof Type) {
return ((Type) type).getDescriptor();
} else {
String className = type.toString();
ret... | java | protected static String getTypeDescriptor(Object type) {
if (type instanceof Class) {
return Type.getDescriptor((Class) type);
} else if (type instanceof Type) {
return ((Type) type).getDescriptor();
} else {
String className = type.toString();
ret... | [
"protected",
"static",
"String",
"getTypeDescriptor",
"(",
"Object",
"type",
")",
"{",
"if",
"(",
"type",
"instanceof",
"Class",
")",
"{",
"return",
"Type",
".",
"getDescriptor",
"(",
"(",
"Class",
")",
"type",
")",
";",
"}",
"else",
"if",
"(",
"type",
... | Returns the descriptor corresponding to the given class.
@param type The type
@return The descriptor for the class | [
"Returns",
"the",
"descriptor",
"corresponding",
"to",
"the",
"given",
"class",
"."
] | train | https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/inject/src/main/java/io/micronaut/inject/writer/AbstractClassFileWriter.java#L386-L395 |
aws/aws-sdk-java | aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java | Item.withNumber | public Item withNumber(String attrName, BigDecimal val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, val);
return this;
} | java | public Item withNumber(String attrName, BigDecimal val) {
checkInvalidAttribute(attrName, val);
attributes.put(attrName, val);
return this;
} | [
"public",
"Item",
"withNumber",
"(",
"String",
"attrName",
",",
"BigDecimal",
"val",
")",
"{",
"checkInvalidAttribute",
"(",
"attrName",
",",
"val",
")",
";",
"attributes",
".",
"put",
"(",
"attrName",
",",
"val",
")",
";",
"return",
"this",
";",
"}"
] | Sets the value of the specified attribute in the current item to the
given value. | [
"Sets",
"the",
"value",
"of",
"the",
"specified",
"attribute",
"in",
"the",
"current",
"item",
"to",
"the",
"given",
"value",
"."
] | train | https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-dynamodb/src/main/java/com/amazonaws/services/dynamodbv2/document/Item.java#L267-L271 |
js-lib-com/template.xhtml | src/main/java/js/template/xhtml/OMapOperator.java | OMapOperator.doExec | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) {
throw new TemplateException("Operand is property path but scope is not an object.");... | java | @Override
protected Object doExec(Element element, Object scope, String propertyPath, Object... arguments) throws IOException, TemplateException {
if (!propertyPath.equals(".") && ConverterRegistry.hasType(scope.getClass())) {
throw new TemplateException("Operand is property path but scope is not an object.");... | [
"@",
"Override",
"protected",
"Object",
"doExec",
"(",
"Element",
"element",
",",
"Object",
"scope",
",",
"String",
"propertyPath",
",",
"Object",
"...",
"arguments",
")",
"throws",
"IOException",
",",
"TemplateException",
"{",
"if",
"(",
"!",
"propertyPath",
... | Execute OMAP operator. Behaves like {@link MapOperator#doExec(Element, Object, String, Object...)} counterpart but takes
care to create index and increment it before every key / value pair processing.
@param element context element,
@param scope scope object,
@param propertyPath property path,
@param arguments optiona... | [
"Execute",
"OMAP",
"operator",
".",
"Behaves",
"like",
"{",
"@link",
"MapOperator#doExec",
"(",
"Element",
"Object",
"String",
"Object",
"...",
")",
"}",
"counterpart",
"but",
"takes",
"care",
"to",
"create",
"index",
"and",
"increment",
"it",
"before",
"every... | train | https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/OMapOperator.java#L60-L84 |
inferred/FreeBuilder | src/main/java/org/inferred/freebuilder/processor/source/FunctionalType.java | FunctionalType.functionalTypeAcceptedByMethod | public static FunctionalType functionalTypeAcceptedByMethod(
DeclaredType type,
String methodName,
FunctionalType prototype,
Elements elements,
Types types) {
return functionalTypesAcceptedByMethod(type, methodName, elements, types)
.stream()
.filter(functionalType -> i... | java | public static FunctionalType functionalTypeAcceptedByMethod(
DeclaredType type,
String methodName,
FunctionalType prototype,
Elements elements,
Types types) {
return functionalTypesAcceptedByMethod(type, methodName, elements, types)
.stream()
.filter(functionalType -> i... | [
"public",
"static",
"FunctionalType",
"functionalTypeAcceptedByMethod",
"(",
"DeclaredType",
"type",
",",
"String",
"methodName",
",",
"FunctionalType",
"prototype",
",",
"Elements",
"elements",
",",
"Types",
"types",
")",
"{",
"return",
"functionalTypesAcceptedByMethod",... | Returns the functional type accepted by {@code methodName} on {@code type}, assignable to
{@code prototype}, or {@code prototype} itself if no such method has been declared.
<p>Used to allow the user to override the functional interface used on builder methods,
e.g. to force boxing, or to use Guava types. | [
"Returns",
"the",
"functional",
"type",
"accepted",
"by",
"{",
"@code",
"methodName",
"}",
"on",
"{",
"@code",
"type",
"}",
"assignable",
"to",
"{",
"@code",
"prototype",
"}",
"or",
"{",
"@code",
"prototype",
"}",
"itself",
"if",
"no",
"such",
"method",
... | train | https://github.com/inferred/FreeBuilder/blob/d5a222f90648aece135da4b971c55a60afe8649c/src/main/java/org/inferred/freebuilder/processor/source/FunctionalType.java#L135-L146 |
geomajas/geomajas-project-graphics | graphics/src/main/java/org/geomajas/graphics/client/util/CopyUtil.java | CopyUtil.copyStrokableProperties | public static void copyStrokableProperties(HasStroke strokableOriginal, HasStroke strokableCopy) {
strokableCopy.setStrokeOpacity(strokableOriginal.getStrokeOpacity());
strokableCopy.setStrokeColor(strokableOriginal.getStrokeColor());
strokableCopy.setStrokeWidth(strokableOriginal.getStrokeWidth());
} | java | public static void copyStrokableProperties(HasStroke strokableOriginal, HasStroke strokableCopy) {
strokableCopy.setStrokeOpacity(strokableOriginal.getStrokeOpacity());
strokableCopy.setStrokeColor(strokableOriginal.getStrokeColor());
strokableCopy.setStrokeWidth(strokableOriginal.getStrokeWidth());
} | [
"public",
"static",
"void",
"copyStrokableProperties",
"(",
"HasStroke",
"strokableOriginal",
",",
"HasStroke",
"strokableCopy",
")",
"{",
"strokableCopy",
".",
"setStrokeOpacity",
"(",
"strokableOriginal",
".",
"getStrokeOpacity",
"(",
")",
")",
";",
"strokableCopy",
... | Copy all {@link HasStroke} properties from original to copy.
@param strokableOriginal
@param strokableCopy | [
"Copy",
"all",
"{",
"@link",
"HasStroke",
"}",
"properties",
"from",
"original",
"to",
"copy",
"."
] | train | https://github.com/geomajas/geomajas-project-graphics/blob/1104196640e0ba455b8a619e774352a8e1e319ba/graphics/src/main/java/org/geomajas/graphics/client/util/CopyUtil.java#L55-L59 |
OpenTSDB/opentsdb | src/meta/Annotation.java | Annotation.getAnnotation | public static Deferred<Annotation> getAnnotation(final TSDB tsdb,
final long start_time) {
return getAnnotation(tsdb, (byte[])null, start_time);
} | java | public static Deferred<Annotation> getAnnotation(final TSDB tsdb,
final long start_time) {
return getAnnotation(tsdb, (byte[])null, start_time);
} | [
"public",
"static",
"Deferred",
"<",
"Annotation",
">",
"getAnnotation",
"(",
"final",
"TSDB",
"tsdb",
",",
"final",
"long",
"start_time",
")",
"{",
"return",
"getAnnotation",
"(",
"tsdb",
",",
"(",
"byte",
"[",
"]",
")",
"null",
",",
"start_time",
")",
... | Attempts to fetch a global annotation from storage
@param tsdb The TSDB to use for storage access
@param start_time The start time as a Unix epoch timestamp
@return A valid annotation object if found, null if not | [
"Attempts",
"to",
"fetch",
"a",
"global",
"annotation",
"from",
"storage"
] | train | https://github.com/OpenTSDB/opentsdb/blob/3fc2d491c3c1ad397252c0a80203a69a3f9e3ef3/src/meta/Annotation.java#L231-L234 |
deeplearning4j/deeplearning4j | deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java | WordVectorSerializer.writeWordVectors | public static void writeWordVectors(@NonNull Glove vectors, @NonNull String path) {
try (BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(path))) {
writeWordVectors(vectors, fos);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | java | public static void writeWordVectors(@NonNull Glove vectors, @NonNull String path) {
try (BufferedOutputStream fos = new BufferedOutputStream(new FileOutputStream(path))) {
writeWordVectors(vectors, fos);
} catch (Exception e) {
throw new RuntimeException(e);
}
} | [
"public",
"static",
"void",
"writeWordVectors",
"(",
"@",
"NonNull",
"Glove",
"vectors",
",",
"@",
"NonNull",
"String",
"path",
")",
"{",
"try",
"(",
"BufferedOutputStream",
"fos",
"=",
"new",
"BufferedOutputStream",
"(",
"new",
"FileOutputStream",
"(",
"path",
... | This method saves GloVe model to the given output stream.
@param vectors GloVe model to be saved
@param path path where model should be saved to | [
"This",
"method",
"saves",
"GloVe",
"model",
"to",
"the",
"given",
"output",
"stream",
"."
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp/src/main/java/org/deeplearning4j/models/embeddings/loader/WordVectorSerializer.java#L1127-L1133 |
facebook/fresco | imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java | DefaultImageFormatChecker.isJpegHeader | private static boolean isJpegHeader(final byte[] imageHeaderBytes, final int headerSize) {
return headerSize >= JPEG_HEADER.length &&
ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, JPEG_HEADER);
} | java | private static boolean isJpegHeader(final byte[] imageHeaderBytes, final int headerSize) {
return headerSize >= JPEG_HEADER.length &&
ImageFormatCheckerUtils.startsWithPattern(imageHeaderBytes, JPEG_HEADER);
} | [
"private",
"static",
"boolean",
"isJpegHeader",
"(",
"final",
"byte",
"[",
"]",
"imageHeaderBytes",
",",
"final",
"int",
"headerSize",
")",
"{",
"return",
"headerSize",
">=",
"JPEG_HEADER",
".",
"length",
"&&",
"ImageFormatCheckerUtils",
".",
"startsWithPattern",
... | Checks if imageHeaderBytes starts with SOI (start of image) marker, followed by 0xFF.
If headerSize is lower than 3 false is returned.
Description of jpeg format can be found here:
<a href="http://www.w3.org/Graphics/JPEG/itu-t81.pdf">
http://www.w3.org/Graphics/JPEG/itu-t81.pdf</a>
Annex B deals with compressed data f... | [
"Checks",
"if",
"imageHeaderBytes",
"starts",
"with",
"SOI",
"(",
"start",
"of",
"image",
")",
"marker",
"followed",
"by",
"0xFF",
".",
"If",
"headerSize",
"is",
"lower",
"than",
"3",
"false",
"is",
"returned",
".",
"Description",
"of",
"jpeg",
"format",
"... | train | https://github.com/facebook/fresco/blob/0b85879d51c5036d5e46e627a6651afefc0b971a/imagepipeline-base/src/main/java/com/facebook/imageformat/DefaultImageFormatChecker.java#L145-L148 |
jmxtrans/embedded-jmxtrans | src/main/java/org/jmxtrans/embedded/output/GraphitePickleWriter.java | GraphitePickleWriter.start | @Override
public void start() {
int port = getIntSetting(SETTING_PORT, DEFAULT_GRAPHITE_SERVER_PORT);
String host = getStringSetting(SETTING_HOST);
graphiteServerHostAndPort = new HostAndPort(host, port);
logger.info("Start Graphite Pickle writer connected to '{}'...", graphiteServe... | java | @Override
public void start() {
int port = getIntSetting(SETTING_PORT, DEFAULT_GRAPHITE_SERVER_PORT);
String host = getStringSetting(SETTING_HOST);
graphiteServerHostAndPort = new HostAndPort(host, port);
logger.info("Start Graphite Pickle writer connected to '{}'...", graphiteServe... | [
"@",
"Override",
"public",
"void",
"start",
"(",
")",
"{",
"int",
"port",
"=",
"getIntSetting",
"(",
"SETTING_PORT",
",",
"DEFAULT_GRAPHITE_SERVER_PORT",
")",
";",
"String",
"host",
"=",
"getStringSetting",
"(",
"SETTING_HOST",
")",
";",
"graphiteServerHostAndPort... | Load settings, initialize the {@link SocketWriter} pool and test the connection to the graphite server.
a {@link Logger#warn(String)} message is emitted if the connection to the graphite server fails. | [
"Load",
"settings",
"initialize",
"the",
"{",
"@link",
"SocketWriter",
"}",
"pool",
"and",
"test",
"the",
"connection",
"to",
"the",
"graphite",
"server",
"."
] | train | https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/GraphitePickleWriter.java#L81-L123 |
Impetus/Kundera | src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESQuery.java | ESQuery.buildWhereAggregations | private FilterAggregationBuilder buildWhereAggregations(EntityMetadata entityMetadata, QueryBuilder filter)
{
filter = filter != null ? filter : QueryBuilders.matchAllQuery();
FilterAggregationBuilder filteragg = AggregationBuilders.filter(ESConstants.AGGREGATION_NAME).filter(filter);
retur... | java | private FilterAggregationBuilder buildWhereAggregations(EntityMetadata entityMetadata, QueryBuilder filter)
{
filter = filter != null ? filter : QueryBuilders.matchAllQuery();
FilterAggregationBuilder filteragg = AggregationBuilders.filter(ESConstants.AGGREGATION_NAME).filter(filter);
retur... | [
"private",
"FilterAggregationBuilder",
"buildWhereAggregations",
"(",
"EntityMetadata",
"entityMetadata",
",",
"QueryBuilder",
"filter",
")",
"{",
"filter",
"=",
"filter",
"!=",
"null",
"?",
"filter",
":",
"QueryBuilders",
".",
"matchAllQuery",
"(",
")",
";",
"Filte... | Builds the where aggregations.
@param entityMetadata
the entity metadata
@param filter
the filter
@return the filter aggregation builder | [
"Builds",
"the",
"where",
"aggregations",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESQuery.java#L410-L416 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/TagTrackingCacheEventListener.java | TagTrackingCacheEventListener.putElement | protected void putElement(Ehcache cache, Element element) {
final Set<CacheEntryTag> tags = this.getTags(element);
// Check if the key is tagged
if (tags != null && !tags.isEmpty()) {
final String cacheName = cache.getName();
final Object key = element.getObjectKey();
... | java | protected void putElement(Ehcache cache, Element element) {
final Set<CacheEntryTag> tags = this.getTags(element);
// Check if the key is tagged
if (tags != null && !tags.isEmpty()) {
final String cacheName = cache.getName();
final Object key = element.getObjectKey();
... | [
"protected",
"void",
"putElement",
"(",
"Ehcache",
"cache",
",",
"Element",
"element",
")",
"{",
"final",
"Set",
"<",
"CacheEntryTag",
">",
"tags",
"=",
"this",
".",
"getTags",
"(",
"element",
")",
";",
"// Check if the key is tagged",
"if",
"(",
"tags",
"!=... | If the element has a TaggedCacheKey record the tag associations | [
"If",
"the",
"element",
"has",
"a",
"TaggedCacheKey",
"record",
"the",
"tag",
"associations"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/cache/TagTrackingCacheEventListener.java#L134-L158 |
Azure/azure-sdk-for-java | signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java | SignalRsInner.beginUpdateAsync | public Observable<SignalRResourceInner> beginUpdateAsync(String resourceGroupName, String resourceName) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResourceInner>() {
@Override
public SignalRRes... | java | public Observable<SignalRResourceInner> beginUpdateAsync(String resourceGroupName, String resourceName) {
return beginUpdateWithServiceResponseAsync(resourceGroupName, resourceName).map(new Func1<ServiceResponse<SignalRResourceInner>, SignalRResourceInner>() {
@Override
public SignalRRes... | [
"public",
"Observable",
"<",
"SignalRResourceInner",
">",
"beginUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"resourceName",
")",
"{",
"return",
"beginUpdateWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"resourceName",
")",
".",
"map",
"(... | Operation to update an exiting SignalR service.
@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 resourceName The name of the SignalR resource.
@throws IllegalArgumentException thrown if parameters fa... | [
"Operation",
"to",
"update",
"an",
"exiting",
"SignalR",
"service",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/signalr/resource-manager/v2018_03_01_preview/src/main/java/com/microsoft/azure/management/signalr/v2018_03_01_preview/implementation/SignalRsInner.java#L1606-L1613 |
moparisthebest/beehive | beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java | JdbcControlImpl.onAquire | @EventHandler(field = "_resourceContext", eventSet = ResourceEvents.class, eventName = "onAcquire")
public void onAquire() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onAquire()");
}
try {
getConnection();
} catch (SQLException se) {
th... | java | @EventHandler(field = "_resourceContext", eventSet = ResourceEvents.class, eventName = "onAcquire")
public void onAquire() {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Enter: onAquire()");
}
try {
getConnection();
} catch (SQLException se) {
th... | [
"@",
"EventHandler",
"(",
"field",
"=",
"\"_resourceContext\"",
",",
"eventSet",
"=",
"ResourceEvents",
".",
"class",
",",
"eventName",
"=",
"\"onAcquire\"",
")",
"public",
"void",
"onAquire",
"(",
")",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
"... | Invoked by the controls runtime when a new instance of this class is aquired by the runtime | [
"Invoked",
"by",
"the",
"controls",
"runtime",
"when",
"a",
"new",
"instance",
"of",
"this",
"class",
"is",
"aquired",
"by",
"the",
"runtime"
] | train | https://github.com/moparisthebest/beehive/blob/4246a0cc40ce3c05f1a02c2da2653ac622703d77/beehive-jdbc-control/src/main/java/org/apache/beehive/controls/system/jdbc/JdbcControlImpl.java#L103-L115 |
Netflix/frigga | src/main/java/com/netflix/frigga/cluster/ClusterGrouper.java | ClusterGrouper.groupAsgNamesByClusterName | public static Map<String, List<String>> groupAsgNamesByClusterName(List<String> asgNames) {
return groupByClusterName(asgNames, new AsgNameProvider<String>() {
public String extractAsgName(String asgName) {
return asgName;
}
});
} | java | public static Map<String, List<String>> groupAsgNamesByClusterName(List<String> asgNames) {
return groupByClusterName(asgNames, new AsgNameProvider<String>() {
public String extractAsgName(String asgName) {
return asgName;
}
});
} | [
"public",
"static",
"Map",
"<",
"String",
",",
"List",
"<",
"String",
">",
">",
"groupAsgNamesByClusterName",
"(",
"List",
"<",
"String",
">",
"asgNames",
")",
"{",
"return",
"groupByClusterName",
"(",
"asgNames",
",",
"new",
"AsgNameProvider",
"<",
"String",
... | Groups a list of ASG names by cluster name.
@param asgNames list of asg names
@return map of cluster name to list of ASG names in that cluster | [
"Groups",
"a",
"list",
"of",
"ASG",
"names",
"by",
"cluster",
"name",
"."
] | train | https://github.com/Netflix/frigga/blob/38afefd1726116f3431b95fcb96a6af640b99d10/src/main/java/com/netflix/frigga/cluster/ClusterGrouper.java#L57-L63 |
google/truth | core/src/main/java/com/google/common/truth/Correspondence.java | Correspondence.formatDiff | @NullableDecl
public String formatDiff(@NullableDecl A actual, @NullableDecl E expected) {
return null;
} | java | @NullableDecl
public String formatDiff(@NullableDecl A actual, @NullableDecl E expected) {
return null;
} | [
"@",
"NullableDecl",
"public",
"String",
"formatDiff",
"(",
"@",
"NullableDecl",
"A",
"actual",
",",
"@",
"NullableDecl",
"E",
"expected",
")",
"{",
"return",
"null",
";",
"}"
] | Returns a {@link String} describing the difference between the {@code actual} and {@code
expected} values, if possible, or {@code null} if not.
<p>The implementation on the {@link Correspondence} base class always returns {@code null}. To
enable diffing, use {@link #formattingDiffsUsing} (or override this method in a ... | [
"Returns",
"a",
"{",
"@link",
"String",
"}",
"describing",
"the",
"difference",
"between",
"the",
"{",
"@code",
"actual",
"}",
"and",
"{",
"@code",
"expected",
"}",
"values",
"if",
"possible",
"or",
"{",
"@code",
"null",
"}",
"if",
"not",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/core/src/main/java/com/google/common/truth/Correspondence.java#L709-L712 |
magro/memcached-session-manager | core/src/main/java/de/javakaffee/web/msm/StorageKeyFormat.java | StorageKeyFormat.of | public static StorageKeyFormat of(final String config, final String host, final String context, final String webappVersion) {
if(config == null || config.trim().isEmpty())
return EMPTY;
final String[] tokens = config.split(",");
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < tokens.lengt... | java | public static StorageKeyFormat of(final String config, final String host, final String context, final String webappVersion) {
if(config == null || config.trim().isEmpty())
return EMPTY;
final String[] tokens = config.split(",");
final StringBuilder sb = new StringBuilder();
for (int i = 0; i < tokens.lengt... | [
"public",
"static",
"StorageKeyFormat",
"of",
"(",
"final",
"String",
"config",
",",
"final",
"String",
"host",
",",
"final",
"String",
"context",
",",
"final",
"String",
"webappVersion",
")",
"{",
"if",
"(",
"config",
"==",
"null",
"||",
"config",
".",
"t... | Creates a new {@link StorageKeyFormat} for the given configuration.
The configuration has the form <code>$token,$token</code>
Some examples which config would create which output for the key / session id "foo" with context path "ctxt" and host "hst":
<dl>
<dt>static:x</dt><dd>x_foo</dd>
<dt>host</dt><dd>hst_foo</dd>
<... | [
"Creates",
"a",
"new",
"{",
"@link",
"StorageKeyFormat",
"}",
"for",
"the",
"given",
"configuration",
".",
"The",
"configuration",
"has",
"the",
"form",
"<code",
">",
"$token",
"$token<",
"/",
"code",
">"
] | train | https://github.com/magro/memcached-session-manager/blob/716e147c9840ab10298c4d2b9edd0662058331e6/core/src/main/java/de/javakaffee/web/msm/StorageKeyFormat.java#L71-L88 |
UrielCh/ovh-java-sdk | ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java | ApiOvhCloud.project_serviceName_network_public_GET | public ArrayList<OvhNetwork> project_serviceName_network_public_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/network/public";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t7);
} | java | public ArrayList<OvhNetwork> project_serviceName_network_public_GET(String serviceName) throws IOException {
String qPath = "/cloud/project/{serviceName}/network/public";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t7);
} | [
"public",
"ArrayList",
"<",
"OvhNetwork",
">",
"project_serviceName_network_public_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/cloud/project/{serviceName}/network/public\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(... | Get public networks
REST: GET /cloud/project/{serviceName}/network/public
@param serviceName [required] Service name | [
"Get",
"public",
"networks"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-cloud/src/main/java/net/minidev/ovh/api/ApiOvhCloud.java#L861-L866 |
wmdietl/jsr308-langtools | src/share/classes/com/sun/tools/javac/comp/Resolve.java | Resolve.loadClass | Symbol loadClass(Env<AttrContext> env, Name name) {
try {
ClassSymbol c = reader.loadClass(name);
return isAccessible(env, c) ? c : new AccessError(c);
} catch (ClassReader.BadClassFile err) {
throw err;
} catch (CompletionFailure ex) {
return type... | java | Symbol loadClass(Env<AttrContext> env, Name name) {
try {
ClassSymbol c = reader.loadClass(name);
return isAccessible(env, c) ? c : new AccessError(c);
} catch (ClassReader.BadClassFile err) {
throw err;
} catch (CompletionFailure ex) {
return type... | [
"Symbol",
"loadClass",
"(",
"Env",
"<",
"AttrContext",
">",
"env",
",",
"Name",
"name",
")",
"{",
"try",
"{",
"ClassSymbol",
"c",
"=",
"reader",
".",
"loadClass",
"(",
"name",
")",
";",
"return",
"isAccessible",
"(",
"env",
",",
"c",
")",
"?",
"c",
... | Load toplevel or member class with given fully qualified name and
verify that it is accessible.
@param env The current environment.
@param name The fully qualified name of the class to be loaded. | [
"Load",
"toplevel",
"or",
"member",
"class",
"with",
"given",
"fully",
"qualified",
"name",
"and",
"verify",
"that",
"it",
"is",
"accessible",
"."
] | train | https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Resolve.java#L1905-L1914 |
apache/incubator-gobblin | gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitConfigMonitor.java | GitConfigMonitor.addChange | @Override
public void addChange(DiffEntry change) {
if (checkConfigFilePath(change.getNewPath())) {
Path configFilePath = new Path(this.repositoryDir, change.getNewPath());
try {
Config flowConfig = loadConfigFileWithFlowNameOverrides(configFilePath);
this.flowCatalog.put(FlowSpec.bu... | java | @Override
public void addChange(DiffEntry change) {
if (checkConfigFilePath(change.getNewPath())) {
Path configFilePath = new Path(this.repositoryDir, change.getNewPath());
try {
Config flowConfig = loadConfigFileWithFlowNameOverrides(configFilePath);
this.flowCatalog.put(FlowSpec.bu... | [
"@",
"Override",
"public",
"void",
"addChange",
"(",
"DiffEntry",
"change",
")",
"{",
"if",
"(",
"checkConfigFilePath",
"(",
"change",
".",
"getNewPath",
"(",
")",
")",
")",
"{",
"Path",
"configFilePath",
"=",
"new",
"Path",
"(",
"this",
".",
"repositoryDi... | Add a {@link FlowSpec} for an added, updated, or modified flow config
@param change | [
"Add",
"a",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-service/src/main/java/org/apache/gobblin/service/modules/core/GitConfigMonitor.java#L94-L111 |
johncarl81/transfuse | transfuse-api/src/main/java/org/androidtransfuse/util/InjectionUtil.java | InjectionUtil.callMethod | public static <T> T callMethod(Class<T> retClass, Class<?> targetClass, Object target, String method, Class[] argClasses, Object[] args) {
try {
Method classMethod = targetClass.getDeclaredMethod(method, argClasses);
return AccessController.doPrivileged(
new SetMetho... | java | public static <T> T callMethod(Class<T> retClass, Class<?> targetClass, Object target, String method, Class[] argClasses, Object[] args) {
try {
Method classMethod = targetClass.getDeclaredMethod(method, argClasses);
return AccessController.doPrivileged(
new SetMetho... | [
"public",
"static",
"<",
"T",
">",
"T",
"callMethod",
"(",
"Class",
"<",
"T",
">",
"retClass",
",",
"Class",
"<",
"?",
">",
"targetClass",
",",
"Object",
"target",
",",
"String",
"method",
",",
"Class",
"[",
"]",
"argClasses",
",",
"Object",
"[",
"]"... | Calls a method with the provided arguments as parameters.
@param retClass the method return value
@param targetClass the instance class
@param target the instance containing the method
@param method the method name
@param argClasses types of the method arguments
@param args method arguments used during invocation
@par... | [
"Calls",
"a",
"method",
"with",
"the",
"provided",
"arguments",
"as",
"parameters",
"."
] | train | https://github.com/johncarl81/transfuse/blob/a5f837504797a6c4f8628f7e1dde09b8e6368c8b/transfuse-api/src/main/java/org/androidtransfuse/util/InjectionUtil.java#L144-L158 |
alkacon/opencms-core | src/org/opencms/xml/types/CmsXmlVfsImageValue.java | CmsXmlVfsImageValue.setParameterValue | private void setParameterValue(CmsObject cms, String key, String value) {
if (m_parameters == null) {
m_parameters = getParameterMap(getStringValue(cms));
}
if (CmsStringUtil.isEmptyOrWhitespaceOnly(value) && m_parameters.containsKey(key)) {
m_parameters.remove(key);
... | java | private void setParameterValue(CmsObject cms, String key, String value) {
if (m_parameters == null) {
m_parameters = getParameterMap(getStringValue(cms));
}
if (CmsStringUtil.isEmptyOrWhitespaceOnly(value) && m_parameters.containsKey(key)) {
m_parameters.remove(key);
... | [
"private",
"void",
"setParameterValue",
"(",
"CmsObject",
"cms",
",",
"String",
"key",
",",
"String",
"value",
")",
"{",
"if",
"(",
"m_parameters",
"==",
"null",
")",
"{",
"m_parameters",
"=",
"getParameterMap",
"(",
"getStringValue",
"(",
"cms",
")",
")",
... | Sets a parameter for the image with the provided key as name and the value.<p>
@param cms the current users context
@param key the parameter name to set
@param value the value of the parameter | [
"Sets",
"a",
"parameter",
"for",
"the",
"image",
"with",
"the",
"provided",
"key",
"as",
"name",
"and",
"the",
"value",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/types/CmsXmlVfsImageValue.java#L381-L394 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.