repository_name stringlengths 7 58 | func_path_in_repository stringlengths 11 218 | func_name stringlengths 4 140 | whole_func_string stringlengths 153 5.32k | language stringclasses 1
value | func_code_string stringlengths 72 4k | func_code_tokens listlengths 20 832 | func_documentation_string stringlengths 61 2k | func_documentation_tokens listlengths 1 647 | split_name stringclasses 1
value | func_code_url stringlengths 102 339 |
|---|---|---|---|---|---|---|---|---|---|---|
realexpayments/rxp-hpp-java | src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java | HppRequest.addSupplementaryDataValue | @JsonAnySetter
public HppRequest addSupplementaryDataValue(String name, String value) {
"""
Helper method to add supplementary data.
@param name
@param value
@return HppRequest
"""
supplementaryData.put(name, value);
return this;
} | java | @JsonAnySetter
public HppRequest addSupplementaryDataValue(String name, String value) {
supplementaryData.put(name, value);
return this;
} | [
"@",
"JsonAnySetter",
"public",
"HppRequest",
"addSupplementaryDataValue",
"(",
"String",
"name",
",",
"String",
"value",
")",
"{",
"supplementaryData",
".",
"put",
"(",
"name",
",",
"value",
")",
";",
"return",
"this",
";",
"}"
] | Helper method to add supplementary data.
@param name
@param value
@return HppRequest | [
"Helper",
"method",
"to",
"add",
"supplementary",
"data",
"."
] | train | https://github.com/realexpayments/rxp-hpp-java/blob/29cc5df036af09a6d8ea16ccd7e02e856f72620f/src/main/java/com/realexpayments/hpp/sdk/domain/HppRequest.java#L1198-L1202 |
WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor | SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/SortedCellTable.java | SortedCellTable.setList | public void setList(List<T> list) {
"""
Sets the table's data provider list and sorts the table based on the
column given in {@link SortedCellTable#setInitialSortColumn(Column)}
@param list
"""
dataProvider.getList().clear();
if (list != null) {
for (T t : list) {
... | java | public void setList(List<T> list) {
dataProvider.getList().clear();
if (list != null) {
for (T t : list) {
dataProvider.getList().add(t);
}
}
// Do a first-time sort based on which column was set in
// setInitialSortColumn()
if (in... | [
"public",
"void",
"setList",
"(",
"List",
"<",
"T",
">",
"list",
")",
"{",
"dataProvider",
".",
"getList",
"(",
")",
".",
"clear",
"(",
")",
";",
"if",
"(",
"list",
"!=",
"null",
")",
"{",
"for",
"(",
"T",
"t",
":",
"list",
")",
"{",
"dataProvi... | Sets the table's data provider list and sorts the table based on the
column given in {@link SortedCellTable#setInitialSortColumn(Column)}
@param list | [
"Sets",
"the",
"table",
"s",
"data",
"provider",
"list",
"and",
"sorts",
"the",
"table",
"based",
"on",
"the",
"column",
"given",
"in",
"{",
"@link",
"SortedCellTable#setInitialSortColumn",
"(",
"Column",
")",
"}"
] | train | https://github.com/WorldwideAntimalarialResistanceNetwork/WWARN-Maps-Surveyor/blob/224280bcd6e8045bda6b673584caf0aea5e4c841/SurveyorCore/src/main/java/org/wwarn/surveyor/client/core/SortedCellTable.java#L195-L223 |
xetorthio/jedis | src/main/java/redis/clients/jedis/BinaryJedis.java | BinaryJedis.zremrangeByRank | @Override
public Long zremrangeByRank(final byte[] key, final long start, final long stop) {
"""
Remove all elements in the sorted set at key with rank between start and end. Start and end are
0-based with rank 0 being the element with the lowest score. Both start and end can be negative
numbers, where they in... | java | @Override
public Long zremrangeByRank(final byte[] key, final long start, final long stop) {
checkIsInMultiOrPipeline();
client.zremrangeByRank(key, start, stop);
return client.getIntegerReply();
} | [
"@",
"Override",
"public",
"Long",
"zremrangeByRank",
"(",
"final",
"byte",
"[",
"]",
"key",
",",
"final",
"long",
"start",
",",
"final",
"long",
"stop",
")",
"{",
"checkIsInMultiOrPipeline",
"(",
")",
";",
"client",
".",
"zremrangeByRank",
"(",
"key",
","... | Remove all elements in the sorted set at key with rank between start and end. Start and end are
0-based with rank 0 being the element with the lowest score. Both start and end can be negative
numbers, where they indicate offsets starting at the element with the highest rank. For
example: -1 is the element with the high... | [
"Remove",
"all",
"elements",
"in",
"the",
"sorted",
"set",
"at",
"key",
"with",
"rank",
"between",
"start",
"and",
"end",
".",
"Start",
"and",
"end",
"are",
"0",
"-",
"based",
"with",
"rank",
"0",
"being",
"the",
"element",
"with",
"the",
"lowest",
"sc... | train | https://github.com/xetorthio/jedis/blob/ef4ab403f9d8fd88bd05092fea96de2e9db0bede/src/main/java/redis/clients/jedis/BinaryJedis.java#L2587-L2592 |
UrielCh/ovh-java-sdk | ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java | ApiOvhDomain.serviceName_ukRegistrars_GET | public ArrayList<OvhUkRegistrar> serviceName_ukRegistrars_GET(String serviceName) throws IOException {
"""
Return the list of all .uk registrars
REST: GET /domain/{serviceName}/ukRegistrars
@param serviceName [required] The internal name of your domain
"""
String qPath = "/domain/{serviceName}/ukRegistra... | java | public ArrayList<OvhUkRegistrar> serviceName_ukRegistrars_GET(String serviceName) throws IOException {
String qPath = "/domain/{serviceName}/ukRegistrars";
StringBuilder sb = path(qPath, serviceName);
String resp = exec(qPath, "GET", sb.toString(), null);
return convertTo(resp, t4);
} | [
"public",
"ArrayList",
"<",
"OvhUkRegistrar",
">",
"serviceName_ukRegistrars_GET",
"(",
"String",
"serviceName",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/domain/{serviceName}/ukRegistrars\"",
";",
"StringBuilder",
"sb",
"=",
"path",
"(",
"qPath",
... | Return the list of all .uk registrars
REST: GET /domain/{serviceName}/ukRegistrars
@param serviceName [required] The internal name of your domain | [
"Return",
"the",
"list",
"of",
"all",
".",
"uk",
"registrars"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-domain/src/main/java/net/minidev/ovh/api/ApiOvhDomain.java#L1102-L1107 |
apache/flink | flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractFetcher.java | AbstractFetcher.registerOffsetMetrics | private void registerOffsetMetrics(
MetricGroup consumerMetricGroup,
List<KafkaTopicPartitionState<KPH>> partitionOffsetStates) {
"""
For each partition, register a new metric group to expose current offsets and committed offsets.
Per-partition metric groups can be scoped by user variables {@link KafkaConsu... | java | private void registerOffsetMetrics(
MetricGroup consumerMetricGroup,
List<KafkaTopicPartitionState<KPH>> partitionOffsetStates) {
for (KafkaTopicPartitionState<KPH> ktp : partitionOffsetStates) {
MetricGroup topicPartitionGroup = consumerMetricGroup
.addGroup(OFFSETS_BY_TOPIC_METRICS_GROUP, ktp.getTopic... | [
"private",
"void",
"registerOffsetMetrics",
"(",
"MetricGroup",
"consumerMetricGroup",
",",
"List",
"<",
"KafkaTopicPartitionState",
"<",
"KPH",
">",
">",
"partitionOffsetStates",
")",
"{",
"for",
"(",
"KafkaTopicPartitionState",
"<",
"KPH",
">",
"ktp",
":",
"partit... | For each partition, register a new metric group to expose current offsets and committed offsets.
Per-partition metric groups can be scoped by user variables {@link KafkaConsumerMetricConstants#OFFSETS_BY_TOPIC_METRICS_GROUP}
and {@link KafkaConsumerMetricConstants#OFFSETS_BY_PARTITION_METRICS_GROUP}.
<p>Note: this met... | [
"For",
"each",
"partition",
"register",
"a",
"new",
"metric",
"group",
"to",
"expose",
"current",
"offsets",
"and",
"committed",
"offsets",
".",
"Per",
"-",
"partition",
"metric",
"groups",
"can",
"be",
"scoped",
"by",
"user",
"variables",
"{",
"@link",
"Kaf... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kafka-base/src/main/java/org/apache/flink/streaming/connectors/kafka/internals/AbstractFetcher.java#L616-L631 |
OpenLiberty/open-liberty | dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java | HttpChannelConfig.parseBinaryTransport | private void parseBinaryTransport(Map<Object, Object> props) {
"""
Check the input configuration for whether the parsing and marshalling
should use the binary transport mode or not.
@param props
"""
Object value = props.get(HttpConfigConstants.PROPNAME_BINARY_TRANSPORT);
if (null != value) ... | java | private void parseBinaryTransport(Map<Object, Object> props) {
Object value = props.get(HttpConfigConstants.PROPNAME_BINARY_TRANSPORT);
if (null != value) {
this.bBinaryTransport = convertBoolean(value);
if (TraceComponent.isAnyTracingEnabled() && tc.isEventEnabled()) {
... | [
"private",
"void",
"parseBinaryTransport",
"(",
"Map",
"<",
"Object",
",",
"Object",
">",
"props",
")",
"{",
"Object",
"value",
"=",
"props",
".",
"get",
"(",
"HttpConfigConstants",
".",
"PROPNAME_BINARY_TRANSPORT",
")",
";",
"if",
"(",
"null",
"!=",
"value"... | Check the input configuration for whether the parsing and marshalling
should use the binary transport mode or not.
@param props | [
"Check",
"the",
"input",
"configuration",
"for",
"whether",
"the",
"parsing",
"and",
"marshalling",
"should",
"use",
"the",
"binary",
"transport",
"mode",
"or",
"not",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.transport.http/src/com/ibm/ws/http/channel/internal/HttpChannelConfig.java#L797-L805 |
czyzby/gdx-lml | kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java | Disposables.gracefullyDisposeOf | public static void gracefullyDisposeOf(final Map<?, ? extends Disposable> disposables) {
"""
Performs null checks and disposes of assets. Ignores exceptions.
@param disposables its values will be disposed of (if they exist). Can be null.
"""
if (disposables != null) {
for (final Disposab... | java | public static void gracefullyDisposeOf(final Map<?, ? extends Disposable> disposables) {
if (disposables != null) {
for (final Disposable disposable : disposables.values()) {
gracefullyDisposeOf(disposable);
}
}
} | [
"public",
"static",
"void",
"gracefullyDisposeOf",
"(",
"final",
"Map",
"<",
"?",
",",
"?",
"extends",
"Disposable",
">",
"disposables",
")",
"{",
"if",
"(",
"disposables",
"!=",
"null",
")",
"{",
"for",
"(",
"final",
"Disposable",
"disposable",
":",
"disp... | Performs null checks and disposes of assets. Ignores exceptions.
@param disposables its values will be disposed of (if they exist). Can be null. | [
"Performs",
"null",
"checks",
"and",
"disposes",
"of",
"assets",
".",
"Ignores",
"exceptions",
"."
] | train | https://github.com/czyzby/gdx-lml/blob/7623b322e6afe49ad4dd636c80c230150a1cfa4e/kiwi/src/main/java/com/github/czyzby/kiwi/util/gdx/asset/Disposables.java#L119-L125 |
op4j/op4j | src/main/java/org/op4j/functions/FnString.java | FnString.toByte | public static final Function<String,Byte> toByte(final RoundingMode roundingMode, final DecimalPoint decimalPoint) {
"""
<p>
Converts a String into a Byte, using the specified decimal point
configuration ({@link DecimalPoint}). Rounding mode is used for removing the
decimal part of the number. The target String... | java | public static final Function<String,Byte> toByte(final RoundingMode roundingMode, final DecimalPoint decimalPoint) {
return new ToByte(roundingMode, decimalPoint);
} | [
"public",
"static",
"final",
"Function",
"<",
"String",
",",
"Byte",
">",
"toByte",
"(",
"final",
"RoundingMode",
"roundingMode",
",",
"final",
"DecimalPoint",
"decimalPoint",
")",
"{",
"return",
"new",
"ToByte",
"(",
"roundingMode",
",",
"decimalPoint",
")",
... | <p>
Converts a String into a Byte, using the specified decimal point
configuration ({@link DecimalPoint}). Rounding mode is used for removing the
decimal part of the number. The target String should contain no
thousand separators. The integer part of the input string must be between
{@link Byte#MIN_VALUE} and {@link By... | [
"<p",
">",
"Converts",
"a",
"String",
"into",
"a",
"Byte",
"using",
"the",
"specified",
"decimal",
"point",
"configuration",
"(",
"{",
"@link",
"DecimalPoint",
"}",
")",
".",
"Rounding",
"mode",
"is",
"used",
"for",
"removing",
"the",
"decimal",
"part",
"o... | train | https://github.com/op4j/op4j/blob/b577596dfe462089d3dd169666defc6de7ad289a/src/main/java/org/op4j/functions/FnString.java#L1236-L1238 |
algolia/instantsearch-android | ui/src/main/java/com/algolia/instantsearch/ui/databinding/RenderingHelper.java | RenderingHelper.getHighlightColor | public @ColorInt
Integer getHighlightColor(@NonNull View view, @NonNull String attribute) {
"""
Gets the highlighting color for a given view/attribute pair.
@param view the view using this attribute.
@param attribute the attribute's name.
@return the {@link ColorInt} associated with this view/attribu... | java | public @ColorInt
Integer getHighlightColor(@NonNull View view, @NonNull String attribute) {
try {
return attributeColors.get(new Pair<>(view.getId(), attribute));
} catch (NullPointerException e) {
return 0;
}
} | [
"public",
"@",
"ColorInt",
"Integer",
"getHighlightColor",
"(",
"@",
"NonNull",
"View",
"view",
",",
"@",
"NonNull",
"String",
"attribute",
")",
"{",
"try",
"{",
"return",
"attributeColors",
".",
"get",
"(",
"new",
"Pair",
"<>",
"(",
"view",
".",
"getId",
... | Gets the highlighting color for a given view/attribute pair.
@param view the view using this attribute.
@param attribute the attribute's name.
@return the {@link ColorInt} associated with this view/attribute pair, or 0 if there is none. | [
"Gets",
"the",
"highlighting",
"color",
"for",
"a",
"given",
"view",
"/",
"attribute",
"pair",
"."
] | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/ui/src/main/java/com/algolia/instantsearch/ui/databinding/RenderingHelper.java#L70-L77 |
Mangopay/mangopay2-java-sdk | src/main/java/com/mangopay/core/Sorting.java | Sorting.addField | public void addField(String fieldName, SortDirection sortDirection) {
"""
Adds field to sort by.
@param fieldName Property name to sort by.
@param sortDirection Sort direction.
"""
if (sortFields == null) sortFields = new HashMap<>();
sortFields.put(fieldName, sortDirection);
} | java | public void addField(String fieldName, SortDirection sortDirection) {
if (sortFields == null) sortFields = new HashMap<>();
sortFields.put(fieldName, sortDirection);
} | [
"public",
"void",
"addField",
"(",
"String",
"fieldName",
",",
"SortDirection",
"sortDirection",
")",
"{",
"if",
"(",
"sortFields",
"==",
"null",
")",
"sortFields",
"=",
"new",
"HashMap",
"<>",
"(",
")",
";",
"sortFields",
".",
"put",
"(",
"fieldName",
","... | Adds field to sort by.
@param fieldName Property name to sort by.
@param sortDirection Sort direction. | [
"Adds",
"field",
"to",
"sort",
"by",
"."
] | train | https://github.com/Mangopay/mangopay2-java-sdk/blob/037cecb44ea62def63b507817fd9961649151157/src/main/java/com/mangopay/core/Sorting.java#L34-L38 |
geomajas/geomajas-project-server | plugin/reporting/reporting/src/main/java/org/geomajas/plugin/reporting/mvc/ReportingController.java | ReportingController.addParameters | @SuppressWarnings("unchecked")
private void addParameters(Model model, HttpServletRequest request) {
"""
Add the extra parameters which are passed as report parameters. The type of the parameter is "guessed" from the
first letter of the parameter name.
@param model view model
@param request servlet request
... | java | @SuppressWarnings("unchecked")
private void addParameters(Model model, HttpServletRequest request) {
for (Object objectEntry : request.getParameterMap().entrySet()) {
Map.Entry<String, String[]> entry = (Map.Entry<String, String[]>) objectEntry;
String key = entry.getKey();
String[] values = entry.getValue(... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"private",
"void",
"addParameters",
"(",
"Model",
"model",
",",
"HttpServletRequest",
"request",
")",
"{",
"for",
"(",
"Object",
"objectEntry",
":",
"request",
".",
"getParameterMap",
"(",
")",
".",
"entrySet",... | Add the extra parameters which are passed as report parameters. The type of the parameter is "guessed" from the
first letter of the parameter name.
@param model view model
@param request servlet request | [
"Add",
"the",
"extra",
"parameters",
"which",
"are",
"passed",
"as",
"report",
"parameters",
".",
"The",
"type",
"of",
"the",
"parameter",
"is",
"guessed",
"from",
"the",
"first",
"letter",
"of",
"the",
"parameter",
"name",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/reporting/reporting/src/main/java/org/geomajas/plugin/reporting/mvc/ReportingController.java#L153-L170 |
vanilladb/vanillacore | src/main/java/org/vanilladb/core/sql/predicate/Predicate.java | Predicate.joinPredicate | public Predicate joinPredicate(Schema sch1, Schema sch2) {
"""
Returns the sub-predicate consisting of terms that applies to the union
of the two specified schemas, but not to either schema separately.
@param sch1
the first schema
@param sch2
the second schema
@return the sub-predicate whose terms apply to... | java | public Predicate joinPredicate(Schema sch1, Schema sch2) {
Predicate result = new Predicate();
Schema newsch = new Schema();
newsch.addAll(sch1);
newsch.addAll(sch2);
for (Term t : terms)
if (!t.isApplicableTo(sch1) && !t.isApplicableTo(sch2)
&& t.isApplicableTo(newsch))
result.terms.add(t... | [
"public",
"Predicate",
"joinPredicate",
"(",
"Schema",
"sch1",
",",
"Schema",
"sch2",
")",
"{",
"Predicate",
"result",
"=",
"new",
"Predicate",
"(",
")",
";",
"Schema",
"newsch",
"=",
"new",
"Schema",
"(",
")",
";",
"newsch",
".",
"addAll",
"(",
"sch1",
... | Returns the sub-predicate consisting of terms that applies to the union
of the two specified schemas, but not to either schema separately.
@param sch1
the first schema
@param sch2
the second schema
@return the sub-predicate whose terms apply to the union of the two
schemas but not either schema separately. | [
"Returns",
"the",
"sub",
"-",
"predicate",
"consisting",
"of",
"terms",
"that",
"applies",
"to",
"the",
"union",
"of",
"the",
"two",
"specified",
"schemas",
"but",
"not",
"to",
"either",
"schema",
"separately",
"."
] | train | https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/sql/predicate/Predicate.java#L115-L125 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java | SourceInfoMap.parseVersionNumber | private static String parseVersionNumber(String line) {
"""
Parse the sourceInfo version string.
@param line
the first line of the sourceInfo file
@return the version number constant, or null if the line does not appear
to be a version string
"""
StringTokenizer tokenizer = new StringTokenizer(li... | java | private static String parseVersionNumber(String line) {
StringTokenizer tokenizer = new StringTokenizer(line, " \t");
if (!expect(tokenizer, "sourceInfo") || !expect(tokenizer, "version") || !tokenizer.hasMoreTokens()) {
return null;
}
return tokenizer.nextToken();
} | [
"private",
"static",
"String",
"parseVersionNumber",
"(",
"String",
"line",
")",
"{",
"StringTokenizer",
"tokenizer",
"=",
"new",
"StringTokenizer",
"(",
"line",
",",
"\" \\t\"",
")",
";",
"if",
"(",
"!",
"expect",
"(",
"tokenizer",
",",
"\"sourceInfo\"",
")",... | Parse the sourceInfo version string.
@param line
the first line of the sourceInfo file
@return the version number constant, or null if the line does not appear
to be a version string | [
"Parse",
"the",
"sourceInfo",
"version",
"string",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/SourceInfoMap.java#L433-L441 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.sendTransactionProposal | public Collection<ProposalResponse> sendTransactionProposal(TransactionProposalRequest transactionProposalRequest, Collection<Peer> peers) throws ProposalException, InvalidArgumentException {
"""
Send a transaction proposal to specific peers.
@param transactionProposalRequest The transaction proposal to be sent... | java | public Collection<ProposalResponse> sendTransactionProposal(TransactionProposalRequest transactionProposalRequest, Collection<Peer> peers) throws ProposalException, InvalidArgumentException {
return sendProposal(transactionProposalRequest, peers);
} | [
"public",
"Collection",
"<",
"ProposalResponse",
">",
"sendTransactionProposal",
"(",
"TransactionProposalRequest",
"transactionProposalRequest",
",",
"Collection",
"<",
"Peer",
">",
"peers",
")",
"throws",
"ProposalException",
",",
"InvalidArgumentException",
"{",
"return"... | Send a transaction proposal to specific peers.
@param transactionProposalRequest The transaction proposal to be sent to the peers.
@param peers
@return responses from peers.
@throws InvalidArgumentException
@throws ProposalException | [
"Send",
"a",
"transaction",
"proposal",
"to",
"specific",
"peers",
"."
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L4354-L4357 |
stratosphere/stratosphere | stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java | Configuration.setBytes | public void setBytes(String key, byte[] bytes) {
"""
Adds the given byte array to the configuration object. If key is <code>null</code> then nothing is added.
@param key
The key under which the bytes are added.
@param bytes
The bytes to be added.
"""
String encoded = new String(Base64.encodeBase64(byte... | java | public void setBytes(String key, byte[] bytes) {
String encoded = new String(Base64.encodeBase64(bytes));
setStringInternal(key, encoded);
} | [
"public",
"void",
"setBytes",
"(",
"String",
"key",
",",
"byte",
"[",
"]",
"bytes",
")",
"{",
"String",
"encoded",
"=",
"new",
"String",
"(",
"Base64",
".",
"encodeBase64",
"(",
"bytes",
")",
")",
";",
"setStringInternal",
"(",
"key",
",",
"encoded",
"... | Adds the given byte array to the configuration object. If key is <code>null</code> then nothing is added.
@param key
The key under which the bytes are added.
@param bytes
The bytes to be added. | [
"Adds",
"the",
"given",
"byte",
"array",
"to",
"the",
"configuration",
"object",
".",
"If",
"key",
"is",
"<code",
">",
"null<",
"/",
"code",
">",
"then",
"nothing",
"is",
"added",
"."
] | train | https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-core/src/main/java/eu/stratosphere/configuration/Configuration.java#L349-L352 |
jhg023/SimpleNet | src/main/java/simplenet/Server.java | Server.writeHelper | @SafeVarargs
private <T extends Client> void writeHelper(Consumer<Client> consumer, T... clients) {
"""
A helper method that eliminates code duplication in the {@link #writeToAllExcept(Packet, Client[])} and
{@link #writeAndFlushToAllExcept(Packet, Client[])} methods.
@param <T> A {@link Client} or any of ... | java | @SafeVarargs
private <T extends Client> void writeHelper(Consumer<Client> consumer, T... clients) {
var toExclude = Collections.newSetFromMap(new IdentityHashMap<>(clients.length));
toExclude.addAll(List.of(clients));
connectedClients.stream().filter(Predicate.not(toExclude::contains)).forEa... | [
"@",
"SafeVarargs",
"private",
"<",
"T",
"extends",
"Client",
">",
"void",
"writeHelper",
"(",
"Consumer",
"<",
"Client",
">",
"consumer",
",",
"T",
"...",
"clients",
")",
"{",
"var",
"toExclude",
"=",
"Collections",
".",
"newSetFromMap",
"(",
"new",
"Iden... | A helper method that eliminates code duplication in the {@link #writeToAllExcept(Packet, Client[])} and
{@link #writeAndFlushToAllExcept(Packet, Client[])} methods.
@param <T> A {@link Client} or any of its children.
@param consumer The action to perform for each {@link Client}.
@param clients A variable amount of {@l... | [
"A",
"helper",
"method",
"that",
"eliminates",
"code",
"duplication",
"in",
"the",
"{",
"@link",
"#writeToAllExcept",
"(",
"Packet",
"Client",
"[]",
")",
"}",
"and",
"{",
"@link",
"#writeAndFlushToAllExcept",
"(",
"Packet",
"Client",
"[]",
")",
"}",
"methods",... | train | https://github.com/jhg023/SimpleNet/blob/a5b55cbfe1768c6a28874f12adac3c748f2b509a/src/main/java/simplenet/Server.java#L210-L215 |
phax/ph-commons | ph-datetime/src/main/java/com/helger/datetime/util/PDTHelper.java | PDTHelper.getWeekDays | public static int getWeekDays (@Nonnull final LocalDate aStartDate, @Nonnull final LocalDate aEndDate) {
"""
Count all non-weekend days in the range. Does not consider holidays!
@param aStartDate
start date
@param aEndDate
end date
@return days not counting Saturdays and Sundays. If start date is after end
... | java | public static int getWeekDays (@Nonnull final LocalDate aStartDate, @Nonnull final LocalDate aEndDate)
{
ValueEnforcer.notNull (aStartDate, "StartDate");
ValueEnforcer.notNull (aEndDate, "EndDate");
final boolean bFlip = aStartDate.isAfter (aEndDate);
LocalDate aCurDate = bFlip ? aEndDate : aStartDat... | [
"public",
"static",
"int",
"getWeekDays",
"(",
"@",
"Nonnull",
"final",
"LocalDate",
"aStartDate",
",",
"@",
"Nonnull",
"final",
"LocalDate",
"aEndDate",
")",
"{",
"ValueEnforcer",
".",
"notNull",
"(",
"aStartDate",
",",
"\"StartDate\"",
")",
";",
"ValueEnforcer... | Count all non-weekend days in the range. Does not consider holidays!
@param aStartDate
start date
@param aEndDate
end date
@return days not counting Saturdays and Sundays. If start date is after end
date, the value will be negative! If start date equals end date the
return will be 1 if it is a week day. | [
"Count",
"all",
"non",
"-",
"weekend",
"days",
"in",
"the",
"range",
".",
"Does",
"not",
"consider",
"holidays!"
] | train | https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-datetime/src/main/java/com/helger/datetime/util/PDTHelper.java#L148-L165 |
line/centraldogma | server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java | MetadataService.findPermissions0 | private CompletableFuture<Collection<Permission>> findPermissions0(String projectName, String repoName,
User user) {
"""
Finds {@link Permission}s which belong to the specified {@link User} from the specified
{@code repoName} in the specified ... | java | private CompletableFuture<Collection<Permission>> findPermissions0(String projectName, String repoName,
User user) {
requireNonNull(projectName, "projectName");
requireNonNull(repoName, "repoName");
requireNonNull(user, "user... | [
"private",
"CompletableFuture",
"<",
"Collection",
"<",
"Permission",
">",
">",
"findPermissions0",
"(",
"String",
"projectName",
",",
"String",
"repoName",
",",
"User",
"user",
")",
"{",
"requireNonNull",
"(",
"projectName",
",",
"\"projectName\"",
")",
";",
"r... | Finds {@link Permission}s which belong to the specified {@link User} from the specified
{@code repoName} in the specified {@code projectName}. | [
"Finds",
"{"
] | train | https://github.com/line/centraldogma/blob/b9e46c67fbc26628c2186ce2f46e7fb303c831e9/server/src/main/java/com/linecorp/centraldogma/server/internal/metadata/MetadataService.java#L628-L648 |
googleapis/google-cloud-java | google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java | LoadJobConfiguration.newBuilder | public static Builder newBuilder(TableId destinationTable, List<String> sourceUris) {
"""
Creates a builder for a BigQuery Load Job configuration given the destination table and source
URIs.
"""
return new Builder().setDestinationTable(destinationTable).setSourceUris(sourceUris);
} | java | public static Builder newBuilder(TableId destinationTable, List<String> sourceUris) {
return new Builder().setDestinationTable(destinationTable).setSourceUris(sourceUris);
} | [
"public",
"static",
"Builder",
"newBuilder",
"(",
"TableId",
"destinationTable",
",",
"List",
"<",
"String",
">",
"sourceUris",
")",
"{",
"return",
"new",
"Builder",
"(",
")",
".",
"setDestinationTable",
"(",
"destinationTable",
")",
".",
"setSourceUris",
"(",
... | Creates a builder for a BigQuery Load Job configuration given the destination table and source
URIs. | [
"Creates",
"a",
"builder",
"for",
"a",
"BigQuery",
"Load",
"Job",
"configuration",
"given",
"the",
"destination",
"table",
"and",
"source",
"URIs",
"."
] | train | https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-clients/google-cloud-bigquery/src/main/java/com/google/cloud/bigquery/LoadJobConfiguration.java#L493-L495 |
zaproxy/zaproxy | src/org/parosproxy/paros/db/paros/ParosTableStructure.java | ParosTableStructure.reconnect | @Override
protected void reconnect(Connection conn) throws DatabaseException {
"""
/*
public RecordStructure(long structureId, long parentId, int historyId, String url) {
"""
try {
if (!DbUtils.hasTable(conn, TABLE_NAME)) {
// Need to create the table
DbUtils.execute(
... | java | @Override
protected void reconnect(Connection conn) throws DatabaseException {
try {
if (!DbUtils.hasTable(conn, TABLE_NAME)) {
// Need to create the table
DbUtils.execute(
conn, "CREATE cached TABLE STRUCTURE (STRUCTUREID bigint generated by default as identity (start ... | [
"@",
"Override",
"protected",
"void",
"reconnect",
"(",
"Connection",
"conn",
")",
"throws",
"DatabaseException",
"{",
"try",
"{",
"if",
"(",
"!",
"DbUtils",
".",
"hasTable",
"(",
"conn",
",",
"TABLE_NAME",
")",
")",
"{",
"// Need to create the table\r",
"DbUt... | /*
public RecordStructure(long structureId, long parentId, int historyId, String url) { | [
"/",
"*",
"public",
"RecordStructure",
"(",
"long",
"structureId",
"long",
"parentId",
"int",
"historyId",
"String",
"url",
")",
"{"
] | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/db/paros/ParosTableStructure.java#L64-L90 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java | MapFixture.addValueToIn | public void addValueToIn(Object value, String name, Map<String, Object> map) {
"""
Adds value to a list map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in.
"""
getMapHelper().addValueToIn(value, name, map);
} | java | public void addValueToIn(Object value, String name, Map<String, Object> map) {
getMapHelper().addValueToIn(value, name, map);
} | [
"public",
"void",
"addValueToIn",
"(",
"Object",
"value",
",",
"String",
"name",
",",
"Map",
"<",
"String",
",",
"Object",
">",
"map",
")",
"{",
"getMapHelper",
"(",
")",
".",
"addValueToIn",
"(",
"value",
",",
"name",
",",
"map",
")",
";",
"}"
] | Adds value to a list map.
@param value value to be passed.
@param name name to use this value for.
@param map map to store value in. | [
"Adds",
"value",
"to",
"a",
"list",
"map",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/MapFixture.java#L95-L97 |
lievendoclo/Valkyrie-RCP | valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java | ObjectUtils.mapObjectOnFormModel | public static void mapObjectOnFormModel(FormModel formModel, Object objectToMap) {
"""
This method tries to map the values of the given object on the valueModels of the formModel. Instead of
setting the object as a backing object, all valueModels are processed one by one and the corresponding
property value is f... | java | public static void mapObjectOnFormModel(FormModel formModel, Object objectToMap)
{
BeanWrapper beanWrapper = new BeanWrapperImpl(objectToMap);
for (String fieldName : (Set<String>) formModel.getFieldNames())
{
try
{
formModel.getValueModel(fieldName).s... | [
"public",
"static",
"void",
"mapObjectOnFormModel",
"(",
"FormModel",
"formModel",
",",
"Object",
"objectToMap",
")",
"{",
"BeanWrapper",
"beanWrapper",
"=",
"new",
"BeanWrapperImpl",
"(",
"objectToMap",
")",
";",
"for",
"(",
"String",
"fieldName",
":",
"(",
"Se... | This method tries to map the values of the given object on the valueModels of the formModel. Instead of
setting the object as a backing object, all valueModels are processed one by one and the corresponding
property value is fetched from the objectToMap and set on that valueModel. This triggers the usual
buffering etc.... | [
"This",
"method",
"tries",
"to",
"map",
"the",
"values",
"of",
"the",
"given",
"object",
"on",
"the",
"valueModels",
"of",
"the",
"formModel",
".",
"Instead",
"of",
"setting",
"the",
"object",
"as",
"a",
"backing",
"object",
"all",
"valueModels",
"are",
"p... | train | https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/util/ObjectUtils.java#L327-L341 |
CloudSlang/cs-actions | cs-couchbase/src/main/java/io/cloudslang/content/couchbase/utils/InputsUtil.java | InputsUtil.getEnforcedBooleanCondition | public static boolean getEnforcedBooleanCondition(String input, boolean enforcedBoolean) {
"""
If enforcedBoolean is "true" and string input is: null, empty, many empty chars, TrUe, tRuE... but not "false"
then returns "true".
If enforcedBoolean is "false" and string input is: null, empty, many empty chars, FaLs... | java | public static boolean getEnforcedBooleanCondition(String input, boolean enforcedBoolean) {
return (enforcedBoolean) ? isValid(input) == parseBoolean(input) : parseBoolean(input);
} | [
"public",
"static",
"boolean",
"getEnforcedBooleanCondition",
"(",
"String",
"input",
",",
"boolean",
"enforcedBoolean",
")",
"{",
"return",
"(",
"enforcedBoolean",
")",
"?",
"isValid",
"(",
"input",
")",
"==",
"parseBoolean",
"(",
"input",
")",
":",
"parseBoole... | If enforcedBoolean is "true" and string input is: null, empty, many empty chars, TrUe, tRuE... but not "false"
then returns "true".
If enforcedBoolean is "false" and string input is: null, empty, many empty chars, FaLsE, fAlSe... but not "true"
then returns "false"
This behavior is needed for inputs like: "imageNoReboo... | [
"If",
"enforcedBoolean",
"is",
"true",
"and",
"string",
"input",
"is",
":",
"null",
"empty",
"many",
"empty",
"chars",
"TrUe",
"tRuE",
"...",
"but",
"not",
"false",
"then",
"returns",
"true",
".",
"If",
"enforcedBoolean",
"is",
"false",
"and",
"string",
"i... | train | https://github.com/CloudSlang/cs-actions/blob/9a1be1e99ad88286a6c153d5f2275df6ae1a57a1/cs-couchbase/src/main/java/io/cloudslang/content/couchbase/utils/InputsUtil.java#L169-L171 |
google/closure-templates | java/src/com/google/template/soy/jbcsrc/restricted/Expression.java | Expression.areAllCheap | public static boolean areAllCheap(Expression first, Expression... rest) {
"""
Returns true if all referenced expressions are {@linkplain #isCheap() cheap}.
"""
return areAllCheap(ImmutableList.<Expression>builder().add(first).add(rest).build());
} | java | public static boolean areAllCheap(Expression first, Expression... rest) {
return areAllCheap(ImmutableList.<Expression>builder().add(first).add(rest).build());
} | [
"public",
"static",
"boolean",
"areAllCheap",
"(",
"Expression",
"first",
",",
"Expression",
"...",
"rest",
")",
"{",
"return",
"areAllCheap",
"(",
"ImmutableList",
".",
"<",
"Expression",
">",
"builder",
"(",
")",
".",
"add",
"(",
"first",
")",
".",
"add"... | Returns true if all referenced expressions are {@linkplain #isCheap() cheap}. | [
"Returns",
"true",
"if",
"all",
"referenced",
"expressions",
"are",
"{"
] | train | https://github.com/google/closure-templates/blob/cc61e1dff70ae97f24f417a57410081bc498bd56/java/src/com/google/template/soy/jbcsrc/restricted/Expression.java#L162-L164 |
Scout24/appmon4j | core/src/main/java/de/is24/util/monitoring/InApplicationMonitor.java | InApplicationMonitor.registerVersion | public void registerVersion(String name, String version) {
"""
This method was intended to register module names with their
current version identifier.
This could / should actually be generalized into an non numeric
state value
@param name name of the versionized "thing" (class, module etc.)
@param version ... | java | public void registerVersion(String name, String version) {
Version versionToAdd = new Version(keyHandler.handle(name), version);
getCorePlugin().registerVersion(versionToAdd);
} | [
"public",
"void",
"registerVersion",
"(",
"String",
"name",
",",
"String",
"version",
")",
"{",
"Version",
"versionToAdd",
"=",
"new",
"Version",
"(",
"keyHandler",
".",
"handle",
"(",
"name",
")",
",",
"version",
")",
";",
"getCorePlugin",
"(",
")",
".",
... | This method was intended to register module names with their
current version identifier.
This could / should actually be generalized into an non numeric
state value
@param name name of the versionized "thing" (class, module etc.)
@param version identifier of the version | [
"This",
"method",
"was",
"intended",
"to",
"register",
"module",
"names",
"with",
"their",
"current",
"version",
"identifier",
".",
"This",
"could",
"/",
"should",
"actually",
"be",
"generalized",
"into",
"an",
"non",
"numeric",
"state",
"value"
] | train | https://github.com/Scout24/appmon4j/blob/a662e5123805ea455cfd01e1b9ae5d808f83529c/core/src/main/java/de/is24/util/monitoring/InApplicationMonitor.java#L335-L338 |
mgm-tp/jfunk | jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java | MailService.findMessage | public MailMessage findMessage(final String accountReservationKey, final Predicate<MailMessage> condition,
final long timeoutSeconds) {
"""
Tries to find a message for the mail account reserved under the specified
{@code accountReservationKey} applying the specified {@code condition} until it times out
using ... | java | public MailMessage findMessage(final String accountReservationKey, final Predicate<MailMessage> condition,
final long timeoutSeconds) {
return findMessage(accountReservationKey, condition, timeoutSeconds, defaultSleepMillis);
} | [
"public",
"MailMessage",
"findMessage",
"(",
"final",
"String",
"accountReservationKey",
",",
"final",
"Predicate",
"<",
"MailMessage",
">",
"condition",
",",
"final",
"long",
"timeoutSeconds",
")",
"{",
"return",
"findMessage",
"(",
"accountReservationKey",
",",
"c... | Tries to find a message for the mail account reserved under the specified
{@code accountReservationKey} applying the specified {@code condition} until it times out
using the specified {@code timeout} and {@link EmailConstants#MAIL_SLEEP_MILLIS}.
@param accountReservationKey
the key under which the account has been res... | [
"Tries",
"to",
"find",
"a",
"message",
"for",
"the",
"mail",
"account",
"reserved",
"under",
"the",
"specified",
"{",
"@code",
"accountReservationKey",
"}",
"applying",
"the",
"specified",
"{",
"@code",
"condition",
"}",
"until",
"it",
"times",
"out",
"using",... | train | https://github.com/mgm-tp/jfunk/blob/5b9fecac5778b988bb458085ded39ea9a4c7c2ae/jfunk-core/src/main/java/com/mgmtp/jfunk/core/mail/MailService.java#L117-L120 |
PeterisP/LVTagger | src/main/java/edu/stanford/nlp/util/CollectionUtils.java | CollectionUtils.loadCollection | public static <T> void loadCollection(File file, Class<T> itemClass, Collection<T> collection) throws NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException, IOException {
"""
Adds the items from the file to the collection.
@param <T>
The type of the items.
@pa... | java | public static <T> void loadCollection(File file, Class<T> itemClass, Collection<T> collection) throws NoSuchMethodException, InstantiationException, IllegalAccessException,
InvocationTargetException, IOException {
Constructor<T> itemConstructor = itemClass.getConstructor(String.class);
BufferedReader i... | [
"public",
"static",
"<",
"T",
">",
"void",
"loadCollection",
"(",
"File",
"file",
",",
"Class",
"<",
"T",
">",
"itemClass",
",",
"Collection",
"<",
"T",
">",
"collection",
")",
"throws",
"NoSuchMethodException",
",",
"InstantiationException",
",",
"IllegalAcce... | Adds the items from the file to the collection.
@param <T>
The type of the items.
@param file
The file from which items should be loaded.
@param itemClass
The class of the items (must have a constructor that accepts a
String).
@param collection
The collection to which items should be added. | [
"Adds",
"the",
"items",
"from",
"the",
"file",
"to",
"the",
"collection",
"."
] | train | https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/util/CollectionUtils.java#L195-L206 |
synchronoss/cpo-api | cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java | CassandraCpoAdapter.retrieveBeans | @Override
public <C> List<C> retrieveBeans(String name, C criteria, CpoWhere where, Collection<CpoOrderBy> orderBy) throws CpoException {
"""
Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource.
@param name The filter name which tells the datasource which beans... | java | @Override
public <C> List<C> retrieveBeans(String name, C criteria, CpoWhere where, Collection<CpoOrderBy> orderBy) throws CpoException {
ArrayList<CpoWhere> wheres = null;
if (where != null) {
wheres = new ArrayList<>();
wheres.add(where);
}
return processSelectGroup(name, criteria, crite... | [
"@",
"Override",
"public",
"<",
"C",
">",
"List",
"<",
"C",
">",
"retrieveBeans",
"(",
"String",
"name",
",",
"C",
"criteria",
",",
"CpoWhere",
"where",
",",
"Collection",
"<",
"CpoOrderBy",
">",
"orderBy",
")",
"throws",
"CpoException",
"{",
"ArrayList",
... | Retrieves the bean from the datasource. The assumption is that the bean exists in the datasource.
@param name The filter name which tells the datasource which beans should be returned. The name also signifies what
data in the bean will be populated.
@param criteria This is an bean that has been defined within the ... | [
"Retrieves",
"the",
"bean",
"from",
"the",
"datasource",
".",
"The",
"assumption",
"is",
"that",
"the",
"bean",
"exists",
"in",
"the",
"datasource",
"."
] | train | https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-cassandra/src/main/java/org/synchronoss/cpo/cassandra/CassandraCpoAdapter.java#L1469-L1477 |
box/box-android-sdk | box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestMultipart.java | BoxRequestMultipart.setFile | public void setFile(InputStream inputStream, String filename, long fileSize) {
"""
Sets the file contents of this request.
@param inputStream a stream containing the file contents.
@param filename the name of the file.
@param fileSize the size of the file.
"""
this.setFile(inputStream, filenam... | java | public void setFile(InputStream inputStream, String filename, long fileSize) {
this.setFile(inputStream, filename);
this.fileSize = fileSize;
} | [
"public",
"void",
"setFile",
"(",
"InputStream",
"inputStream",
",",
"String",
"filename",
",",
"long",
"fileSize",
")",
"{",
"this",
".",
"setFile",
"(",
"inputStream",
",",
"filename",
")",
";",
"this",
".",
"fileSize",
"=",
"fileSize",
";",
"}"
] | Sets the file contents of this request.
@param inputStream a stream containing the file contents.
@param filename the name of the file.
@param fileSize the size of the file. | [
"Sets",
"the",
"file",
"contents",
"of",
"this",
"request",
"."
] | train | https://github.com/box/box-android-sdk/blob/a621ad5ddebf23067fec27529130d72718fc0e88/box-content-sdk/src/main/java/com/box/androidsdk/content/requests/BoxRequestMultipart.java#L95-L98 |
facebookarchive/hadoop-20 | src/core/org/apache/hadoop/fs/HarFileSystem.java | HarFileSystem.decodeHarURI | private URI decodeHarURI(URI rawURI, Configuration conf) throws IOException {
"""
decode the raw URI to get the underlying URI
@param rawURI raw Har URI
@return filtered URI of the underlying fileSystem
"""
String tmpAuth = rawURI.getAuthority();
//we are using the default file
//system in the co... | java | private URI decodeHarURI(URI rawURI, Configuration conf) throws IOException {
String tmpAuth = rawURI.getAuthority();
//we are using the default file
//system in the config
//so create a underlying uri and
//return it
if (tmpAuth == null) {
//create a path
return FileSystem.getDefaul... | [
"private",
"URI",
"decodeHarURI",
"(",
"URI",
"rawURI",
",",
"Configuration",
"conf",
")",
"throws",
"IOException",
"{",
"String",
"tmpAuth",
"=",
"rawURI",
".",
"getAuthority",
"(",
")",
";",
"//we are using the default file",
"//system in the config",
"//so create a... | decode the raw URI to get the underlying URI
@param rawURI raw Har URI
@return filtered URI of the underlying fileSystem | [
"decode",
"the",
"raw",
"URI",
"to",
"get",
"the",
"underlying",
"URI"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/HarFileSystem.java#L237-L269 |
future-architect/uroborosql | src/main/java/jp/co/future/uroborosql/parameter/OutParameter.java | OutParameter.setOutParameter | protected int setOutParameter(final CallableStatement callableStatement, int index) throws SQLException {
"""
ステートメントに出力パラメータを登録。
@param callableStatement コーラブルステートメント
@param index パラメータインデックス
@return 次のパラメータインデックス
@throws SQLException SQL例外
"""
callableStatement.registerOutParameter(index, sqlType.getVe... | java | protected int setOutParameter(final CallableStatement callableStatement, int index) throws SQLException {
callableStatement.registerOutParameter(index, sqlType.getVendorTypeNumber());
parameterLog(index);
index++;
return index;
} | [
"protected",
"int",
"setOutParameter",
"(",
"final",
"CallableStatement",
"callableStatement",
",",
"int",
"index",
")",
"throws",
"SQLException",
"{",
"callableStatement",
".",
"registerOutParameter",
"(",
"index",
",",
"sqlType",
".",
"getVendorTypeNumber",
"(",
")"... | ステートメントに出力パラメータを登録。
@param callableStatement コーラブルステートメント
@param index パラメータインデックス
@return 次のパラメータインデックス
@throws SQLException SQL例外 | [
"ステートメントに出力パラメータを登録。"
] | train | https://github.com/future-architect/uroborosql/blob/4c26db51defdac3c6ed16866e33ab45e190e2e0c/src/main/java/jp/co/future/uroborosql/parameter/OutParameter.java#L83-L88 |
taskadapter/redmine-java-api | src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java | RedmineManagerFactory.createWithUserAuth | public static RedmineManager createWithUserAuth(String uri, String login,
String password, HttpClient httpClient) {
"""
Creates a new redmine managen with user-based authentication.
@param uri redmine manager URI.
@param login user's name.
@param pas... | java | public static RedmineManager createWithUserAuth(String uri, String login,
String password, HttpClient httpClient) {
final Transport transport = new Transport(
new URIConfigurator(uri, null), httpClient);
transport.setCredentials(login, ... | [
"public",
"static",
"RedmineManager",
"createWithUserAuth",
"(",
"String",
"uri",
",",
"String",
"login",
",",
"String",
"password",
",",
"HttpClient",
"httpClient",
")",
"{",
"final",
"Transport",
"transport",
"=",
"new",
"Transport",
"(",
"new",
"URIConfigurator... | Creates a new redmine managen with user-based authentication.
@param uri redmine manager URI.
@param login user's name.
@param password user's password.
@param httpClient you can provide your own pre-configured HttpClient if you want
to control connection pooling, manage connections eviction, closing, etc. | [
"Creates",
"a",
"new",
"redmine",
"managen",
"with",
"user",
"-",
"based",
"authentication",
"."
] | train | https://github.com/taskadapter/redmine-java-api/blob/0bb65f27ee806ec3bd4007e1641f3e996261a04e/src/main/java/com/taskadapter/redmineapi/RedmineManagerFactory.java#L140-L146 |
uber/NullAway | nullaway/src/main/java/com/uber/nullaway/NullAway.java | NullAway.doUnboxingCheck | private Description doUnboxingCheck(VisitorState state, ExpressionTree... expressions) {
"""
if any expression has non-primitive type, we should check that it can't be null as it is
getting unboxed
@param expressions expressions to check
@return error Description if an error is found, otherwise NO_MATCH
"... | java | private Description doUnboxingCheck(VisitorState state, ExpressionTree... expressions) {
for (ExpressionTree tree : expressions) {
Type type = ASTHelpers.getType(tree);
if (type == null) {
throw new RuntimeException("was not expecting null type");
}
if (!type.isPrimitive()) {
... | [
"private",
"Description",
"doUnboxingCheck",
"(",
"VisitorState",
"state",
",",
"ExpressionTree",
"...",
"expressions",
")",
"{",
"for",
"(",
"ExpressionTree",
"tree",
":",
"expressions",
")",
"{",
"Type",
"type",
"=",
"ASTHelpers",
".",
"getType",
"(",
"tree",
... | if any expression has non-primitive type, we should check that it can't be null as it is
getting unboxed
@param expressions expressions to check
@return error Description if an error is found, otherwise NO_MATCH | [
"if",
"any",
"expression",
"has",
"non",
"-",
"primitive",
"type",
"we",
"should",
"check",
"that",
"it",
"can",
"t",
"be",
"null",
"as",
"it",
"is",
"getting",
"unboxed"
] | train | https://github.com/uber/NullAway/blob/c3979b4241f80411dbba6aac3ff653acbb88d00b/nullaway/src/main/java/com/uber/nullaway/NullAway.java#L1247-L1263 |
DDTH/ddth-commons | ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java | SerializationUtils.fromByteArrayFst | public static <T> T fromByteArrayFst(byte[] data, Class<T> clazz) {
"""
Deserialize a byte array back to an object.
<p>
This method uses FST lib.
</p>
@param data
@param clazz
@return
@since 0.6.0
"""
return fromByteArrayFst(data, clazz, null);
} | java | public static <T> T fromByteArrayFst(byte[] data, Class<T> clazz) {
return fromByteArrayFst(data, clazz, null);
} | [
"public",
"static",
"<",
"T",
">",
"T",
"fromByteArrayFst",
"(",
"byte",
"[",
"]",
"data",
",",
"Class",
"<",
"T",
">",
"clazz",
")",
"{",
"return",
"fromByteArrayFst",
"(",
"data",
",",
"clazz",
",",
"null",
")",
";",
"}"
] | Deserialize a byte array back to an object.
<p>
This method uses FST lib.
</p>
@param data
@param clazz
@return
@since 0.6.0 | [
"Deserialize",
"a",
"byte",
"array",
"back",
"to",
"an",
"object",
"."
] | train | https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/SerializationUtils.java#L851-L853 |
datumbox/datumbox-framework | datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java | DiscreteDistributions.hypergeometric | public static double hypergeometric(int k, int n, int Kp, int Np) {
"""
Returns the probability of finding k successes on a sample of n, from a population with Kp successes and size Np
@param k
@param n
@param Kp
@param Np
@return
"""
if(k<0 || n<0 || Kp<0 || Np<0) {
throw new Illega... | java | public static double hypergeometric(int k, int n, int Kp, int Np) {
if(k<0 || n<0 || Kp<0 || Np<0) {
throw new IllegalArgumentException("All the parameters must be positive.");
}
Kp = Math.max(k, Kp);
Np = Math.max(n, Np);
/*
//slow!
$probabil... | [
"public",
"static",
"double",
"hypergeometric",
"(",
"int",
"k",
",",
"int",
"n",
",",
"int",
"Kp",
",",
"int",
"Np",
")",
"{",
"if",
"(",
"k",
"<",
"0",
"||",
"n",
"<",
"0",
"||",
"Kp",
"<",
"0",
"||",
"Np",
"<",
"0",
")",
"{",
"throw",
"n... | Returns the probability of finding k successes on a sample of n, from a population with Kp successes and size Np
@param k
@param n
@param Kp
@param Np
@return | [
"Returns",
"the",
"probability",
"of",
"finding",
"k",
"successes",
"on",
"a",
"sample",
"of",
"n",
"from",
"a",
"population",
"with",
"Kp",
"successes",
"and",
"size",
"Np"
] | train | https://github.com/datumbox/datumbox-framework/blob/909dff0476e80834f05ecdde0624dd2390e9b0ca/datumbox-framework-core/src/main/java/com/datumbox/framework/core/statistics/distributions/DiscreteDistributions.java#L268-L289 |
avianey/facebook-api-android-maven | facebook/src/main/java/com/facebook/widget/FacebookDialog.java | FacebookDialog.canPresentShareDialog | public static boolean canPresentShareDialog(Context context, ShareDialogFeature... features) {
"""
Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Share dialog, which in turn may be used to determine
which UI, e... | java | public static boolean canPresentShareDialog(Context context, ShareDialogFeature... features) {
return handleCanPresent(context, EnumSet.of(ShareDialogFeature.SHARE_DIALOG, features));
} | [
"public",
"static",
"boolean",
"canPresentShareDialog",
"(",
"Context",
"context",
",",
"ShareDialogFeature",
"...",
"features",
")",
"{",
"return",
"handleCanPresent",
"(",
"context",
",",
"EnumSet",
".",
"of",
"(",
"ShareDialogFeature",
".",
"SHARE_DIALOG",
",",
... | Determines whether the version of the Facebook application installed on the user's device is recent
enough to support specific features of the native Share dialog, which in turn may be used to determine
which UI, etc., to present to the user.
@param context the calling Context
@param features zero or more features to... | [
"Determines",
"whether",
"the",
"version",
"of",
"the",
"Facebook",
"application",
"installed",
"on",
"the",
"user",
"s",
"device",
"is",
"recent",
"enough",
"to",
"support",
"specific",
"features",
"of",
"the",
"native",
"Share",
"dialog",
"which",
"in",
"tur... | train | https://github.com/avianey/facebook-api-android-maven/blob/ae6c7aa7ae45739ee19f18c1983e05f7e35b9ede/facebook/src/main/java/com/facebook/widget/FacebookDialog.java#L369-L371 |
geomajas/geomajas-project-client-gwt2 | impl/src/main/java/org/geomajas/gwt2/client/map/render/dom/container/HtmlImageImpl.java | HtmlImageImpl.onLoadingDone | public void onLoadingDone(Callback<String, String> onLoadingDone, int nrRetries) {
"""
Apply a call-back that is executed when the image is done loading. This image is done loading when it has either
loaded successfully or when 5 attempts have failed. In any case, the callback's execute method will be invoked,
t... | java | public void onLoadingDone(Callback<String, String> onLoadingDone, int nrRetries) {
ImageReloader reloader = new ImageReloader(getSrc(), onLoadingDone, nrRetries);
asImage().addLoadHandler(reloader);
asImage().addErrorHandler(reloader);
} | [
"public",
"void",
"onLoadingDone",
"(",
"Callback",
"<",
"String",
",",
"String",
">",
"onLoadingDone",
",",
"int",
"nrRetries",
")",
"{",
"ImageReloader",
"reloader",
"=",
"new",
"ImageReloader",
"(",
"getSrc",
"(",
")",
",",
"onLoadingDone",
",",
"nrRetries"... | Apply a call-back that is executed when the image is done loading. This image is done loading when it has either
loaded successfully or when 5 attempts have failed. In any case, the callback's execute method will be invoked,
thereby indicating success or failure.
@param onLoadingDone
The call-back to be executed when ... | [
"Apply",
"a",
"call",
"-",
"back",
"that",
"is",
"executed",
"when",
"the",
"image",
"is",
"done",
"loading",
".",
"This",
"image",
"is",
"done",
"loading",
"when",
"it",
"has",
"either",
"loaded",
"successfully",
"or",
"when",
"5",
"attempts",
"have",
"... | train | https://github.com/geomajas/geomajas-project-client-gwt2/blob/bd8d7904e861fa80522eed7b83c4ea99844180c7/impl/src/main/java/org/geomajas/gwt2/client/map/render/dom/container/HtmlImageImpl.java#L177-L181 |
gsi-upm/BeastTool | beast-tool/src/main/java/es/upm/dit/gsi/beast/mock/jade/bridgeMock/BridgeMockAgent.java | BridgeMockAgent.updateIntegerBelief | public void updateIntegerBelief(String name, int value) {
"""
Updates the given integer belief
adding the given integer
newBelief = previousBelief + givenValue
@param String - the belief name
@param the value to add
"""
introspector.storeBeliefValue(this, name, getIntegerBelief(name) + value);
... | java | public void updateIntegerBelief(String name, int value) {
introspector.storeBeliefValue(this, name, getIntegerBelief(name) + value);
} | [
"public",
"void",
"updateIntegerBelief",
"(",
"String",
"name",
",",
"int",
"value",
")",
"{",
"introspector",
".",
"storeBeliefValue",
"(",
"this",
",",
"name",
",",
"getIntegerBelief",
"(",
"name",
")",
"+",
"value",
")",
";",
"}"
] | Updates the given integer belief
adding the given integer
newBelief = previousBelief + givenValue
@param String - the belief name
@param the value to add | [
"Updates",
"the",
"given",
"integer",
"belief",
"adding",
"the",
"given",
"integer",
"newBelief",
"=",
"previousBelief",
"+",
"givenValue"
] | train | https://github.com/gsi-upm/BeastTool/blob/cc7fdc75cb818c5d60802aaf32c27829e0ca144c/beast-tool/src/main/java/es/upm/dit/gsi/beast/mock/jade/bridgeMock/BridgeMockAgent.java#L157-L159 |
eclipse/hawkbit | hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectWindow.java | DistributionSetSelectWindow.showForTargetFilter | public void showForTargetFilter(final Long tfqId) {
"""
Shows a distribution set select window for the given target filter query
@param tfqId
target filter query id
"""
this.tfqId = tfqId;
final TargetFilterQuery tfq = targetFilterQueryManagement.get(tfqId)
.orElseThrow(() -... | java | public void showForTargetFilter(final Long tfqId) {
this.tfqId = tfqId;
final TargetFilterQuery tfq = targetFilterQueryManagement.get(tfqId)
.orElseThrow(() -> new EntityNotFoundException(TargetFilterQuery.class, tfqId));
final VerticalLayout verticalLayout = initView();
... | [
"public",
"void",
"showForTargetFilter",
"(",
"final",
"Long",
"tfqId",
")",
"{",
"this",
".",
"tfqId",
"=",
"tfqId",
";",
"final",
"TargetFilterQuery",
"tfq",
"=",
"targetFilterQueryManagement",
".",
"get",
"(",
"tfqId",
")",
".",
"orElseThrow",
"(",
"(",
"... | Shows a distribution set select window for the given target filter query
@param tfqId
target filter query id | [
"Shows",
"a",
"distribution",
"set",
"select",
"window",
"for",
"the",
"given",
"target",
"filter",
"query"
] | train | https://github.com/eclipse/hawkbit/blob/9884452ad42f3b4827461606d8a9215c8625a7fe/hawkbit-ui/src/main/java/org/eclipse/hawkbit/ui/filtermanagement/DistributionSetSelectWindow.java#L100-L121 |
FXMisc/RichTextFX | richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java | ReadOnlyStyledDocumentBuilder.addParagraphs0 | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs0(List<Tuple2<PS, List<SEG>>> paragraphArgList,
StyleSpans<S> entireDocumentStyleSpans) {
"""
Adds multiple paragraphs to the list, allowing one to specify each paragraph's paragraph style.
@param paragraphArgList eac... | java | public ReadOnlyStyledDocumentBuilder<PS, SEG, S> addParagraphs0(List<Tuple2<PS, List<SEG>>> paragraphArgList,
StyleSpans<S> entireDocumentStyleSpans) {
return addParagraphList(paragraphArgList, entireDocumentStyleSpans, Tuple2::get1, Tuple2::get2);
} | [
"public",
"ReadOnlyStyledDocumentBuilder",
"<",
"PS",
",",
"SEG",
",",
"S",
">",
"addParagraphs0",
"(",
"List",
"<",
"Tuple2",
"<",
"PS",
",",
"List",
"<",
"SEG",
">",
">",
">",
"paragraphArgList",
",",
"StyleSpans",
"<",
"S",
">",
"entireDocumentStyleSpans"... | Adds multiple paragraphs to the list, allowing one to specify each paragraph's paragraph style.
@param paragraphArgList each item is a Tuple2 that represents the paragraph style and segment list
for a single paragraph. If the paragraph style is {@code null},
the {@link #defaultParagraphStyle} will be used instead.
@pa... | [
"Adds",
"multiple",
"paragraphs",
"to",
"the",
"list",
"allowing",
"one",
"to",
"specify",
"each",
"paragraph",
"s",
"paragraph",
"style",
"."
] | train | https://github.com/FXMisc/RichTextFX/blob/bc7cab6a637855e0f37d9b9c12a9172c31545f0b/richtextfx/src/main/java/org/fxmisc/richtext/model/ReadOnlyStyledDocumentBuilder.java#L167-L170 |
udoprog/ffwd-client-java | src/main/java/com/google/protobuf250/ExtensionRegistry.java | ExtensionRegistry.findExtensionByNumber | public ExtensionInfo findExtensionByNumber(final Descriptor containingType,
final int fieldNumber) {
"""
Find an extension by containing type and field number.
@return Information about the extension if found, or {@code null}
otherwise.
"""
return extensions... | java | public ExtensionInfo findExtensionByNumber(final Descriptor containingType,
final int fieldNumber) {
return extensionsByNumber.get(
new DescriptorIntPair(containingType, fieldNumber));
} | [
"public",
"ExtensionInfo",
"findExtensionByNumber",
"(",
"final",
"Descriptor",
"containingType",
",",
"final",
"int",
"fieldNumber",
")",
"{",
"return",
"extensionsByNumber",
".",
"get",
"(",
"new",
"DescriptorIntPair",
"(",
"containingType",
",",
"fieldNumber",
")",... | Find an extension by containing type and field number.
@return Information about the extension if found, or {@code null}
otherwise. | [
"Find",
"an",
"extension",
"by",
"containing",
"type",
"and",
"field",
"number",
"."
] | train | https://github.com/udoprog/ffwd-client-java/blob/b4161d2b138e3edb8fa9420cc3cc653d5764cf5b/src/main/java/com/google/protobuf250/ExtensionRegistry.java#L150-L154 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.batchSynonyms | public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas, boolean replaceExistingSynonyms, RequestOptions requestOptions) throws AlgoliaException {
"""
Add or Replace a list of synonyms
@param objects List of synonyms
@param forwardToReplicas Forward the operati... | java | public JSONObject batchSynonyms(List<JSONObject> objects, boolean forwardToReplicas, boolean replaceExistingSynonyms, RequestOptions requestOptions) throws AlgoliaException {
JSONArray array = new JSONArray();
for (JSONObject obj : objects) {
array.put(obj);
}
return client.postRequest("/1/indexe... | [
"public",
"JSONObject",
"batchSynonyms",
"(",
"List",
"<",
"JSONObject",
">",
"objects",
",",
"boolean",
"forwardToReplicas",
",",
"boolean",
"replaceExistingSynonyms",
",",
"RequestOptions",
"requestOptions",
")",
"throws",
"AlgoliaException",
"{",
"JSONArray",
"array"... | Add or Replace a list of synonyms
@param objects List of synonyms
@param forwardToReplicas Forward the operation to the replica indices
@param replaceExistingSynonyms Replace the existing synonyms with this batch
@param requestOptions Options to pass to this request | [
"Add",
"or",
"Replace",
"a",
"list",
"of",
"synonyms"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1583-L1590 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java | FirstNonNullHelper.firstNonNull | public static <T, R> R firstNonNull(Function<T, R> function, Stream<T> values) {
"""
Gets first element which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param values all possible values.
@return first result value which... | java | public static <T, R> R firstNonNull(Function<T, R> function, Stream<T> values) {
return values
.map(function)
.filter(Objects::nonNull)
.findFirst()
.orElse(null);
} | [
"public",
"static",
"<",
"T",
",",
"R",
">",
"R",
"firstNonNull",
"(",
"Function",
"<",
"T",
",",
"R",
">",
"function",
",",
"Stream",
"<",
"T",
">",
"values",
")",
"{",
"return",
"values",
".",
"map",
"(",
"function",
")",
".",
"filter",
"(",
"O... | Gets first element which is not null.
@param <T> type of values.
@param <R> element to return.
@param function function to apply to each value.
@param values all possible values.
@return first result value which was not null, OR <code>null</code> if all values were <code>null</code>. | [
"Gets",
"first",
"element",
"which",
"is",
"not",
"null",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/util/FirstNonNullHelper.java#L94-L100 |
OpenLiberty/open-liberty | dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java | CATMainConsumer.unlockAll | public void unlockAll(int requestNumber, boolean incrementUnlockCount) {
"""
Unlocks all messages locked by this consumer and has an Option to
increment the unlock count or not on unlock of messages. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@p... | java | public void unlockAll(int requestNumber, boolean incrementUnlockCount)
{
if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "unlockAll", new Object[]{requestNumber,incrementUnlockCount});
checkNotBrowserSession(); // F171893
if... | [
"public",
"void",
"unlockAll",
"(",
"int",
"requestNumber",
",",
"boolean",
"incrementUnlockCount",
")",
"{",
"if",
"(",
"TraceComponent",
".",
"isAnyTracingEnabled",
"(",
")",
"&&",
"tc",
".",
"isEntryEnabled",
"(",
")",
")",
"SibTr",
".",
"entry",
"(",
"th... | Unlocks all messages locked by this consumer and has an Option to
increment the unlock count or not on unlock of messages. This call
is delegated to the sub consumer if one exists or the
<code>CATConsumer</code> version is used.
@param requestNumber The request number which replies should be sent to.
@param increment... | [
"Unlocks",
"all",
"messages",
"locked",
"by",
"this",
"consumer",
"and",
"has",
"an",
"Option",
"to",
"increment",
"the",
"unlock",
"count",
"or",
"not",
"on",
"unlock",
"of",
"messages",
".",
"This",
"call",
"is",
"delegated",
"to",
"the",
"sub",
"consume... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.server/src/com/ibm/ws/sib/comms/server/clientsupport/CATMainConsumer.java#L1166-L1182 |
LearnLib/learnlib | oracles/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACaches.java | DFACaches.createCache | public static <I> DFACacheOracle<I> createCache(Alphabet<I> alphabet, MembershipOracle<I, Boolean> mqOracle) {
"""
Creates a cache oracle for a DFA learning setup.
<p>
Note that this method does not specify the implementation to use for the cache. Currently, a DAG ({@link
IncrementalDFABuilder}) is used; howeve... | java | public static <I> DFACacheOracle<I> createCache(Alphabet<I> alphabet, MembershipOracle<I, Boolean> mqOracle) {
return createDAGCache(alphabet, mqOracle);
} | [
"public",
"static",
"<",
"I",
">",
"DFACacheOracle",
"<",
"I",
">",
"createCache",
"(",
"Alphabet",
"<",
"I",
">",
"alphabet",
",",
"MembershipOracle",
"<",
"I",
",",
"Boolean",
">",
"mqOracle",
")",
"{",
"return",
"createDAGCache",
"(",
"alphabet",
",",
... | Creates a cache oracle for a DFA learning setup.
<p>
Note that this method does not specify the implementation to use for the cache. Currently, a DAG ({@link
IncrementalDFABuilder}) is used; however, this may change in the future.
@param alphabet
the input alphabet
@param mqOracle
the membership oracle
@return a Meal... | [
"Creates",
"a",
"cache",
"oracle",
"for",
"a",
"DFA",
"learning",
"setup",
".",
"<p",
">",
"Note",
"that",
"this",
"method",
"does",
"not",
"specify",
"the",
"implementation",
"to",
"use",
"for",
"the",
"cache",
".",
"Currently",
"a",
"DAG",
"(",
"{",
... | train | https://github.com/LearnLib/learnlib/blob/fa38a14adcc0664099f180d671ffa42480318d7b/oracles/filters/cache/src/main/java/de/learnlib/filter/cache/dfa/DFACaches.java#L106-L108 |
Impetus/Kundera | src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java | AbstractManagedType.addSingularAttribute | public void addSingularAttribute(String attributeName, SingularAttribute<X, ?> attribute) {
"""
Adds the singular attribute.
@param attributeName
the attribute name
@param attribute
the attribute
"""
if (declaredSingluarAttribs == null)
{
declaredSingluarAttribs = new HashMap<... | java | public void addSingularAttribute(String attributeName, SingularAttribute<X, ?> attribute)
{
if (declaredSingluarAttribs == null)
{
declaredSingluarAttribs = new HashMap<String, SingularAttribute<X, ?>>();
}
declaredSingluarAttribs.put(attributeName, attribute);
... | [
"public",
"void",
"addSingularAttribute",
"(",
"String",
"attributeName",
",",
"SingularAttribute",
"<",
"X",
",",
"?",
">",
"attribute",
")",
"{",
"if",
"(",
"declaredSingluarAttribs",
"==",
"null",
")",
"{",
"declaredSingluarAttribs",
"=",
"new",
"HashMap",
"<... | Adds the singular attribute.
@param attributeName
the attribute name
@param attribute
the attribute | [
"Adds",
"the",
"singular",
"attribute",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/jpa-engine/core/src/main/java/com/impetus/kundera/metadata/model/type/AbstractManagedType.java#L820-L831 |
mebigfatguy/fb-contrib | src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java | SideEffectConstructor.sawOpcode | @Override
public void sawOpcode(int seen) {
"""
overrides the visitor to look for constructors who's value is popped off the stack, and not assigned before the pop of the value, or if a return is
issued with that object still on the stack.
@param seen
the opcode of the currently parse opcode
"""
... | java | @Override
public void sawOpcode(int seen) {
int pc = 0;
try {
stack.precomputation(this);
switch (state) {
case SAW_NOTHING:
pc = sawOpcodeAfterNothing(seen);
break;
case SAW_CTOR:
if ((... | [
"@",
"Override",
"public",
"void",
"sawOpcode",
"(",
"int",
"seen",
")",
"{",
"int",
"pc",
"=",
"0",
";",
"try",
"{",
"stack",
".",
"precomputation",
"(",
"this",
")",
";",
"switch",
"(",
"state",
")",
"{",
"case",
"SAW_NOTHING",
":",
"pc",
"=",
"s... | overrides the visitor to look for constructors who's value is popped off the stack, and not assigned before the pop of the value, or if a return is
issued with that object still on the stack.
@param seen
the opcode of the currently parse opcode | [
"overrides",
"the",
"visitor",
"to",
"look",
"for",
"constructors",
"who",
"s",
"value",
"is",
"popped",
"off",
"the",
"stack",
"and",
"not",
"assigned",
"before",
"the",
"pop",
"of",
"the",
"value",
"or",
"if",
"a",
"return",
"is",
"issued",
"with",
"th... | train | https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/SideEffectConstructor.java#L96-L124 |
Impetus/Kundera | src/kundera-mongo/src/main/java/com/impetus/client/mongodb/utils/MongoDBUtils.java | MongoDBUtils.getTranslatedObject | public static Object getTranslatedObject(Object value, Class<?> sourceClass, Class<?> targetClass) {
"""
Gets the translated object.
@param value
the value
@param sourceClass
the source class
@param targetClass
the target class
@return the translated object
"""
if (sourceClass.isAssignableFrom... | java | public static Object getTranslatedObject(Object value, Class<?> sourceClass, Class<?> targetClass)
{
if (sourceClass.isAssignableFrom(Date.class))
{
value = PropertyAccessorHelper.fromDate(targetClass, sourceClass, value);
}
else
{
value = PropertyAcce... | [
"public",
"static",
"Object",
"getTranslatedObject",
"(",
"Object",
"value",
",",
"Class",
"<",
"?",
">",
"sourceClass",
",",
"Class",
"<",
"?",
">",
"targetClass",
")",
"{",
"if",
"(",
"sourceClass",
".",
"isAssignableFrom",
"(",
"Date",
".",
"class",
")"... | Gets the translated object.
@param value
the value
@param sourceClass
the source class
@param targetClass
the target class
@return the translated object | [
"Gets",
"the",
"translated",
"object",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-mongo/src/main/java/com/impetus/client/mongodb/utils/MongoDBUtils.java#L194-L205 |
ironjacamar/ironjacamar | common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java | AbstractParser.storeCapacity | protected void storeCapacity(Capacity c, XMLStreamWriter writer) throws Exception {
"""
Store capacity
@param c The capacity
@param writer The writer
@exception Exception Thrown if an error occurs
"""
writer.writeStartElement(CommonXML.ELEMENT_CAPACITY);
if (c.getIncrementer() != null)
{
... | java | protected void storeCapacity(Capacity c, XMLStreamWriter writer) throws Exception
{
writer.writeStartElement(CommonXML.ELEMENT_CAPACITY);
if (c.getIncrementer() != null)
{
storeExtension(c.getIncrementer(), writer, CommonXML.ELEMENT_INCREMENTER);
}
if (c.getDecrementer() != n... | [
"protected",
"void",
"storeCapacity",
"(",
"Capacity",
"c",
",",
"XMLStreamWriter",
"writer",
")",
"throws",
"Exception",
"{",
"writer",
".",
"writeStartElement",
"(",
"CommonXML",
".",
"ELEMENT_CAPACITY",
")",
";",
"if",
"(",
"c",
".",
"getIncrementer",
"(",
... | Store capacity
@param c The capacity
@param writer The writer
@exception Exception Thrown if an error occurs | [
"Store",
"capacity"
] | train | https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/common/src/main/java/org/ironjacamar/common/metadata/common/AbstractParser.java#L1033-L1048 |
codeprimate-software/cp-elements | src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java | RuntimeExceptionsFactory.newRuntimeException | public static RuntimeException newRuntimeException(String message, Object... args) {
"""
Constructs and initializes a new {@link RuntimeException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link RuntimeException exce... | java | public static RuntimeException newRuntimeException(String message, Object... args) {
return newRuntimeException(null, message, args);
} | [
"public",
"static",
"RuntimeException",
"newRuntimeException",
"(",
"String",
"message",
",",
"Object",
"...",
"args",
")",
"{",
"return",
"newRuntimeException",
"(",
"null",
",",
"message",
",",
"args",
")",
";",
"}"
] | Constructs and initializes a new {@link RuntimeException} with the given {@link String message}
formatted with the given {@link Object[] arguments}.
@param message {@link String} describing the {@link RuntimeException exception}.
@param args {@link Object[] arguments} used to replace format placeholders in the {@link ... | [
"Constructs",
"and",
"initializes",
"a",
"new",
"{",
"@link",
"RuntimeException",
"}",
"with",
"the",
"given",
"{",
"@link",
"String",
"message",
"}",
"formatted",
"with",
"the",
"given",
"{",
"@link",
"Object",
"[]",
"arguments",
"}",
"."
] | train | https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/RuntimeExceptionsFactory.java#L190-L192 |
deeplearning4j/deeplearning4j | nd4j/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java | ArrowSerde.typeFromTensorType | public static DataType typeFromTensorType(byte type, int elementSize) {
"""
Create thee databuffer type frm the given type,
relative to the bytes in arrow in class:
{@link Type}
@param type the type to create the nd4j {@link DataType} from
@param elementSize the element size
@return the data buffer type
"... | java | public static DataType typeFromTensorType(byte type, int elementSize) {
if(type == Type.FloatingPoint) {
return DataType.FLOAT;
}
else if(type == Type.Decimal) {
return DataType.DOUBLE;
}
else if(type == Type.Int) {
if(elementSize == 4) {
... | [
"public",
"static",
"DataType",
"typeFromTensorType",
"(",
"byte",
"type",
",",
"int",
"elementSize",
")",
"{",
"if",
"(",
"type",
"==",
"Type",
".",
"FloatingPoint",
")",
"{",
"return",
"DataType",
".",
"FLOAT",
";",
"}",
"else",
"if",
"(",
"type",
"=="... | Create thee databuffer type frm the given type,
relative to the bytes in arrow in class:
{@link Type}
@param type the type to create the nd4j {@link DataType} from
@param elementSize the element size
@return the data buffer type | [
"Create",
"thee",
"databuffer",
"type",
"frm",
"the",
"given",
"type",
"relative",
"to",
"the",
"bytes",
"in",
"arrow",
"in",
"class",
":",
"{"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-serde/nd4j-arrow/src/main/java/org/nd4j/arrow/ArrowSerde.java#L177-L197 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/util/Times.java | Times.isSameDay | public static boolean isSameDay(final Date date1, final Date date2) {
"""
Determines whether the specified date1 is the same day with the specified date2.
@param date1 the specified date1
@param date2 the specified date2
@return {@code true} if it is the same day, returns {@code false} otherwise
"""
... | java | public static boolean isSameDay(final Date date1, final Date date2) {
final Calendar cal1 = Calendar.getInstance();
cal1.setTime(date1);
final Calendar cal2 = Calendar.getInstance();
cal2.setTime(date2);
return cal1.get(Calendar.ERA) == cal2.get(Calendar.ERA) && cal1.get(Calenda... | [
"public",
"static",
"boolean",
"isSameDay",
"(",
"final",
"Date",
"date1",
",",
"final",
"Date",
"date2",
")",
"{",
"final",
"Calendar",
"cal1",
"=",
"Calendar",
".",
"getInstance",
"(",
")",
";",
"cal1",
".",
"setTime",
"(",
"date1",
")",
";",
"final",
... | Determines whether the specified date1 is the same day with the specified date2.
@param date1 the specified date1
@param date2 the specified date2
@return {@code true} if it is the same day, returns {@code false} otherwise | [
"Determines",
"whether",
"the",
"specified",
"date1",
"is",
"the",
"same",
"day",
"with",
"the",
"specified",
"date2",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/util/Times.java#L126-L133 |
phax/ph-pdf-layout | src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java | PDPageContentStreamExt.drawImage | public void drawImage (final PDImageXObject image, final float x, final float y) throws IOException {
"""
Draw an image at the x,y coordinates, with the default size of the image.
@param image
The image to draw.
@param x
The x-coordinate to draw the image.
@param y
The y-coordinate to draw the image.
@thr... | java | public void drawImage (final PDImageXObject image, final float x, final float y) throws IOException
{
drawImage (image, x, y, image.getWidth (), image.getHeight ());
} | [
"public",
"void",
"drawImage",
"(",
"final",
"PDImageXObject",
"image",
",",
"final",
"float",
"x",
",",
"final",
"float",
"y",
")",
"throws",
"IOException",
"{",
"drawImage",
"(",
"image",
",",
"x",
",",
"y",
",",
"image",
".",
"getWidth",
"(",
")",
"... | Draw an image at the x,y coordinates, with the default size of the image.
@param image
The image to draw.
@param x
The x-coordinate to draw the image.
@param y
The y-coordinate to draw the image.
@throws IOException
If there is an error writing to the stream. | [
"Draw",
"an",
"image",
"at",
"the",
"x",
"y",
"coordinates",
"with",
"the",
"default",
"size",
"of",
"the",
"image",
"."
] | train | https://github.com/phax/ph-pdf-layout/blob/777d9f3a131cbe8f592c0de1cf554084e541bb54/src/main/java/com/helger/pdflayout4/pdfbox/PDPageContentStreamExt.java#L487-L490 |
BellaDati/belladati-sdk-java | src/main/java/com/belladati/sdk/impl/BellaDatiServiceImpl.java | BellaDatiServiceImpl.readObject | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
"""
Deserialization. Sets up the element lists and maps as empty objects.
@param in Input stream of object to be de-serialized
@throws IOException Thrown if IO error occurs during class reading
@throws ClassNotFoundExcept... | java | private void readObject(ObjectInputStream in) throws IOException, ClassNotFoundException {
in.defaultReadObject();
try {
Field domainList = getClass().getDeclaredField("domainList");
domainList.setAccessible(true);
domainList.set(this, new DomainList());
Field dashboardList = getClass().getDeclaredFiel... | [
"private",
"void",
"readObject",
"(",
"ObjectInputStream",
"in",
")",
"throws",
"IOException",
",",
"ClassNotFoundException",
"{",
"in",
".",
"defaultReadObject",
"(",
")",
";",
"try",
"{",
"Field",
"domainList",
"=",
"getClass",
"(",
")",
".",
"getDeclaredField... | Deserialization. Sets up the element lists and maps as empty objects.
@param in Input stream of object to be de-serialized
@throws IOException Thrown if IO error occurs during class reading
@throws ClassNotFoundException Thrown if desired class does not exist | [
"Deserialization",
".",
"Sets",
"up",
"the",
"element",
"lists",
"and",
"maps",
"as",
"empty",
"objects",
"."
] | train | https://github.com/BellaDati/belladati-sdk-java/blob/1a732a57ebc825ddf47ce405723cc958adb1a43f/src/main/java/com/belladati/sdk/impl/BellaDatiServiceImpl.java#L556-L603 |
apptik/JustJson | json-core/src/main/java/io/apptik/json/JsonObject.java | JsonObject.getInt | public Integer getInt(String name, boolean strict) throws JsonException {
"""
Returns the value mapped by {@code name} if it exists and is an int or
can be coerced to an int, or throws otherwise.
@throws JsonException if the mapping doesn't exist or cannot be coerced
to an int.
"""
JsonElement el ... | java | public Integer getInt(String name, boolean strict) throws JsonException {
JsonElement el = get(name);
Integer res = null;
if (strict && !el.isNumber()) {
throw Util.typeMismatch(name, el, "int", true);
}
if (el.isNumber()) {
res = el.asInt();
}
... | [
"public",
"Integer",
"getInt",
"(",
"String",
"name",
",",
"boolean",
"strict",
")",
"throws",
"JsonException",
"{",
"JsonElement",
"el",
"=",
"get",
"(",
"name",
")",
";",
"Integer",
"res",
"=",
"null",
";",
"if",
"(",
"strict",
"&&",
"!",
"el",
".",
... | Returns the value mapped by {@code name} if it exists and is an int or
can be coerced to an int, or throws otherwise.
@throws JsonException if the mapping doesn't exist or cannot be coerced
to an int. | [
"Returns",
"the",
"value",
"mapped",
"by",
"{",
"@code",
"name",
"}",
"if",
"it",
"exists",
"and",
"is",
"an",
"int",
"or",
"can",
"be",
"coerced",
"to",
"an",
"int",
"or",
"throws",
"otherwise",
"."
] | train | https://github.com/apptik/JustJson/blob/c90f0dd7f84df26da4749be8cd9b026fff499a79/json-core/src/main/java/io/apptik/json/JsonObject.java#L466-L481 |
alkacon/opencms-core | src/org/opencms/jsp/util/A_CmsJspValueWrapper.java | A_CmsJspValueWrapper.substituteLink | protected static String substituteLink(CmsObject cms, String target) {
"""
Returns the substituted link to the given target.<p>
@param cms the cms context
@param target the link target
@return the substituted link
"""
if (cms != null) {
return OpenCms.getLinkManager().substituteLink... | java | protected static String substituteLink(CmsObject cms, String target) {
if (cms != null) {
return OpenCms.getLinkManager().substituteLinkForUnknownTarget(
cms,
CmsLinkManager.getAbsoluteUri(String.valueOf(target), cms.getRequestContext().getUri()));
} else {
... | [
"protected",
"static",
"String",
"substituteLink",
"(",
"CmsObject",
"cms",
",",
"String",
"target",
")",
"{",
"if",
"(",
"cms",
"!=",
"null",
")",
"{",
"return",
"OpenCms",
".",
"getLinkManager",
"(",
")",
".",
"substituteLinkForUnknownTarget",
"(",
"cms",
... | Returns the substituted link to the given target.<p>
@param cms the cms context
@param target the link target
@return the substituted link | [
"Returns",
"the",
"substituted",
"link",
"to",
"the",
"given",
"target",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/jsp/util/A_CmsJspValueWrapper.java#L171-L180 |
algolia/algoliasearch-client-java | src/main/java/com/algolia/search/saas/Index.java | Index.saveSynonym | public JSONObject saveSynonym(String objectID, JSONObject content) throws AlgoliaException {
"""
Update one synonym
@param objectID The objectId of the synonym to save
@param content The new content of this synonym
"""
return saveSynonym(objectID, content, false);
} | java | public JSONObject saveSynonym(String objectID, JSONObject content) throws AlgoliaException {
return saveSynonym(objectID, content, false);
} | [
"public",
"JSONObject",
"saveSynonym",
"(",
"String",
"objectID",
",",
"JSONObject",
"content",
")",
"throws",
"AlgoliaException",
"{",
"return",
"saveSynonym",
"(",
"objectID",
",",
"content",
",",
"false",
")",
";",
"}"
] | Update one synonym
@param objectID The objectId of the synonym to save
@param content The new content of this synonym | [
"Update",
"one",
"synonym"
] | train | https://github.com/algolia/algoliasearch-client-java/blob/a05da2f66c099fe6f77295c7b6a8a12c24e95f9b/src/main/java/com/algolia/search/saas/Index.java#L1665-L1667 |
Whiley/WhileyCompiler | src/main/java/wyil/type/util/ReadWriteTypeExtractor.java | ReadWriteTypeExtractor.isVoid | protected boolean isVoid(Conjunct type, LifetimeRelation lifetimes) {
"""
Determine whether a given conjunct is equivalent to <code>void</code> or not.
For example, <code>int & !int</code> is equivalent to <code>void</code>.
Likewise, <code>{int f} & !{any f}</code> is equivalent to <code>void</code>.
@param ... | java | protected boolean isVoid(Conjunct type, LifetimeRelation lifetimes) {
// FIXME: do we really need to defensively copy all this data here?
SemanticType.Atom[] positives = Arrays.copyOf(type.positives, type.positives.length);
SemanticType.Atom[] negatives = Arrays.copyOf(type.negatives, type.negatives.length);
Se... | [
"protected",
"boolean",
"isVoid",
"(",
"Conjunct",
"type",
",",
"LifetimeRelation",
"lifetimes",
")",
"{",
"// FIXME: do we really need to defensively copy all this data here?",
"SemanticType",
".",
"Atom",
"[",
"]",
"positives",
"=",
"Arrays",
".",
"copyOf",
"(",
"type... | Determine whether a given conjunct is equivalent to <code>void</code> or not.
For example, <code>int & !int</code> is equivalent to <code>void</code>.
Likewise, <code>{int f} & !{any f}</code> is equivalent to <code>void</code>.
@param type
@return
@throws ResolutionError | [
"Determine",
"whether",
"a",
"given",
"conjunct",
"is",
"equivalent",
"to",
"<code",
">",
"void<",
"/",
"code",
">",
"or",
"not",
".",
"For",
"example",
"<code",
">",
"int",
"&",
"!int<",
"/",
"code",
">",
"is",
"equivalent",
"to",
"<code",
">",
"void<... | train | https://github.com/Whiley/WhileyCompiler/blob/680f8a657d3fc286f8cc422755988b6d74ab3f4c/src/main/java/wyil/type/util/ReadWriteTypeExtractor.java#L259-L266 |
JOML-CI/JOML | src/org/joml/Vector4i.java | Vector4i.set | public Vector4i set(int index, IntBuffer buffer) {
"""
Read this vector from the supplied {@link IntBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given IntBuffer.
@param index
the absolute position into the IntBuffer
@param buffer
... | java | public Vector4i set(int index, IntBuffer buffer) {
MemUtil.INSTANCE.get(this, index, buffer);
return this;
} | [
"public",
"Vector4i",
"set",
"(",
"int",
"index",
",",
"IntBuffer",
"buffer",
")",
"{",
"MemUtil",
".",
"INSTANCE",
".",
"get",
"(",
"this",
",",
"index",
",",
"buffer",
")",
";",
"return",
"this",
";",
"}"
] | Read this vector from the supplied {@link IntBuffer} starting at the
specified absolute buffer position/index.
<p>
This method will not increment the position of the given IntBuffer.
@param index
the absolute position into the IntBuffer
@param buffer
values will be read in <code>x, y, z, w</code> order
@return this | [
"Read",
"this",
"vector",
"from",
"the",
"supplied",
"{",
"@link",
"IntBuffer",
"}",
"starting",
"at",
"the",
"specified",
"absolute",
"buffer",
"position",
"/",
"index",
".",
"<p",
">",
"This",
"method",
"will",
"not",
"increment",
"the",
"position",
"of",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Vector4i.java#L412-L415 |
liyiorg/weixin-popular | src/main/java/weixin/popular/api/ScanAPI.java | ScanAPI.ticketCheck | public static TicketCheckResult ticketCheck(String accessToken, String ticket) {
"""
检查wxticket参数
@param accessToken accessToken
@param ticket ticket
@return TicketCheckResult
"""
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.... | java | public static TicketCheckResult ticketCheck(String accessToken, String ticket) {
HttpUriRequest httpUriRequest = RequestBuilder.post()
.setHeader(jsonHeader)
.setUri(BASE_URI + "/scan/scanticket/check")
.addParameter(PARAM_ACCESS_TOKEN, API.accessToken(accessT... | [
"public",
"static",
"TicketCheckResult",
"ticketCheck",
"(",
"String",
"accessToken",
",",
"String",
"ticket",
")",
"{",
"HttpUriRequest",
"httpUriRequest",
"=",
"RequestBuilder",
".",
"post",
"(",
")",
".",
"setHeader",
"(",
"jsonHeader",
")",
".",
"setUri",
"(... | 检查wxticket参数
@param accessToken accessToken
@param ticket ticket
@return TicketCheckResult | [
"检查wxticket参数"
] | train | https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/api/ScanAPI.java#L278-L287 |
apache/flink | flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java | Configuration.getTrimmed | public String getTrimmed(String name, String defaultValue) {
"""
Get the value of the <code>name</code> property as a trimmed <code>String</code>,
<code>defaultValue</code> if no such property exists.
See @{Configuration#getTrimmed} for more details.
@param name the property name.
@param defaultValu... | java | public String getTrimmed(String name, String defaultValue) {
String ret = getTrimmed(name);
return ret == null ? defaultValue : ret;
} | [
"public",
"String",
"getTrimmed",
"(",
"String",
"name",
",",
"String",
"defaultValue",
")",
"{",
"String",
"ret",
"=",
"getTrimmed",
"(",
"name",
")",
";",
"return",
"ret",
"==",
"null",
"?",
"defaultValue",
":",
"ret",
";",
"}"
] | Get the value of the <code>name</code> property as a trimmed <code>String</code>,
<code>defaultValue</code> if no such property exists.
See @{Configuration#getTrimmed} for more details.
@param name the property name.
@param defaultValue the property default value.
@return the value of the <code>... | [
"Get",
"the",
"value",
"of",
"the",
"<code",
">",
"name<",
"/",
"code",
">",
"property",
"as",
"a",
"trimmed",
"<code",
">",
"String<",
"/",
"code",
">",
"<code",
">",
"defaultValue<",
"/",
"code",
">",
"if",
"no",
"such",
"property",
"exists",
".",
... | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-filesystems/flink-fs-hadoop-shaded/src/main/java/org/apache/hadoop/conf/Configuration.java#L1148-L1151 |
alkacon/opencms-core | src/org/opencms/db/CmsUserSettings.java | CmsUserSettings.getAdditionalPreference | public static String getAdditionalPreference(CmsObject cms, String key, boolean useDefault) {
"""
Gets a configured preference.<p>
@param cms the cms context
@param key the settings key
@param useDefault true if we want the default value if no value is configured
@return the preference value
"""
... | java | public static String getAdditionalPreference(CmsObject cms, String key, boolean useDefault) {
CmsUser user = cms.getRequestContext().getCurrentUser();
CmsUserSettings settings = new CmsUserSettings(user);
return settings.getAdditionalPreference(key, useDefault);
} | [
"public",
"static",
"String",
"getAdditionalPreference",
"(",
"CmsObject",
"cms",
",",
"String",
"key",
",",
"boolean",
"useDefault",
")",
"{",
"CmsUser",
"user",
"=",
"cms",
".",
"getRequestContext",
"(",
")",
".",
"getCurrentUser",
"(",
")",
";",
"CmsUserSet... | Gets a configured preference.<p>
@param cms the cms context
@param key the settings key
@param useDefault true if we want the default value if no value is configured
@return the preference value | [
"Gets",
"a",
"configured",
"preference",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsUserSettings.java#L455-L460 |
hibernate/hibernate-ogm | core/src/main/java/org/hibernate/ogm/model/impl/EntityKeyBuilder.java | EntityKeyBuilder.fromData | public static EntityKey fromData(
EntityKeyMetadata entityKeyMetadata,
GridType identifierGridType,
final Serializable id,
SharedSessionContractImplementor session) {
"""
static method because the builder pattern version was showing up during profiling
"""
Object[] values = LogicalPhysicalConvert... | java | public static EntityKey fromData(
EntityKeyMetadata entityKeyMetadata,
GridType identifierGridType,
final Serializable id,
SharedSessionContractImplementor session) {
Object[] values = LogicalPhysicalConverterHelper.getColumnsValuesFromObjectValue(
id,
identifierGridType,
entityKeyMetadata.get... | [
"public",
"static",
"EntityKey",
"fromData",
"(",
"EntityKeyMetadata",
"entityKeyMetadata",
",",
"GridType",
"identifierGridType",
",",
"final",
"Serializable",
"id",
",",
"SharedSessionContractImplementor",
"session",
")",
"{",
"Object",
"[",
"]",
"values",
"=",
"Log... | static method because the builder pattern version was showing up during profiling | [
"static",
"method",
"because",
"the",
"builder",
"pattern",
"version",
"was",
"showing",
"up",
"during",
"profiling"
] | train | https://github.com/hibernate/hibernate-ogm/blob/9ea971df7c27277029006a6f748d8272fb1d69d2/core/src/main/java/org/hibernate/ogm/model/impl/EntityKeyBuilder.java#L39-L51 |
iipc/openwayback | wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java | GraphRenderer.render | public void render(OutputStream target, Graph graph) throws IOException {
"""
Send a PNG format byte stream for the argument Graph to the provided
OutputStream
@param target OutputStream to write PNG format bytes
@param graph Graph to send to the target
@throws IOException for usual reasons.
"""
Buffe... | java | public void render(OutputStream target, Graph graph) throws IOException {
BufferedImage bi =
new BufferedImage(graph.width, graph.height,
GraphConfiguration.imageType);
Graphics2D g2d = bi.createGraphics();
graph.draw(g2d);
ImageIO.write(bi, "png", target);
} | [
"public",
"void",
"render",
"(",
"OutputStream",
"target",
",",
"Graph",
"graph",
")",
"throws",
"IOException",
"{",
"BufferedImage",
"bi",
"=",
"new",
"BufferedImage",
"(",
"graph",
".",
"width",
",",
"graph",
".",
"height",
",",
"GraphConfiguration",
".",
... | Send a PNG format byte stream for the argument Graph to the provided
OutputStream
@param target OutputStream to write PNG format bytes
@param graph Graph to send to the target
@throws IOException for usual reasons. | [
"Send",
"a",
"PNG",
"format",
"byte",
"stream",
"for",
"the",
"argument",
"Graph",
"to",
"the",
"provided",
"OutputStream"
] | train | https://github.com/iipc/openwayback/blob/da74c3a59a5b5a5c365bd4702dcb45d263535794/wayback-core/src/main/java/org/archive/wayback/util/graph/GraphRenderer.java#L87-L95 |
couchbase/couchbase-java-client | src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java | AnalyticsQuery.parameterized | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonObject namedParams) {
"""
Creates an {@link AnalyticsQuery} with named parameters as part of the query.
@param statement the statement to send.
@param namedParams the named parameters which will be put in for the ... | java | public static ParameterizedAnalyticsQuery parameterized(final String statement,
final JsonObject namedParams) {
return new ParameterizedAnalyticsQuery(statement, null, namedParams, null);
} | [
"public",
"static",
"ParameterizedAnalyticsQuery",
"parameterized",
"(",
"final",
"String",
"statement",
",",
"final",
"JsonObject",
"namedParams",
")",
"{",
"return",
"new",
"ParameterizedAnalyticsQuery",
"(",
"statement",
",",
"null",
",",
"namedParams",
",",
"null"... | Creates an {@link AnalyticsQuery} with named parameters as part of the query.
@param statement the statement to send.
@param namedParams the named parameters which will be put in for the placeholders.
@return a {@link AnalyticsQuery}. | [
"Creates",
"an",
"{",
"@link",
"AnalyticsQuery",
"}",
"with",
"named",
"parameters",
"as",
"part",
"of",
"the",
"query",
"."
] | train | https://github.com/couchbase/couchbase-java-client/blob/f36a0ee0c66923bdde47838ca543e50cbaa99e14/src/main/java/com/couchbase/client/java/analytics/AnalyticsQuery.java#L105-L108 |
Stratio/stratio-cassandra | src/java/org/apache/cassandra/io/sstable/Downsampling.java | Downsampling.getEffectiveIndexIntervalAfterIndex | public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval) {
"""
Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this
returns the number of partitions in the primary on-disk index before the next partition that ... | java | public static int getEffectiveIndexIntervalAfterIndex(int index, int samplingLevel, int minIndexInterval)
{
assert index >= 0;
index %= samplingLevel;
List<Integer> originalIndexes = getOriginalIndexes(samplingLevel);
int nextEntryOriginalIndex = (index == originalIndexes.size() - 1)... | [
"public",
"static",
"int",
"getEffectiveIndexIntervalAfterIndex",
"(",
"int",
"index",
",",
"int",
"samplingLevel",
",",
"int",
"minIndexInterval",
")",
"{",
"assert",
"index",
">=",
"0",
";",
"index",
"%=",
"samplingLevel",
";",
"List",
"<",
"Integer",
">",
"... | Calculates the effective index interval after the entry at `index` in an IndexSummary. In other words, this
returns the number of partitions in the primary on-disk index before the next partition that has an entry in
the index summary. If samplingLevel == BASE_SAMPLING_LEVEL, this will be equal to the index interval.... | [
"Calculates",
"the",
"effective",
"index",
"interval",
"after",
"the",
"entry",
"at",
"index",
"in",
"an",
"IndexSummary",
".",
"In",
"other",
"words",
"this",
"returns",
"the",
"number",
"of",
"partitions",
"in",
"the",
"primary",
"on",
"-",
"disk",
"index"... | train | https://github.com/Stratio/stratio-cassandra/blob/f6416b43ad5309083349ad56266450fa8c6a2106/src/java/org/apache/cassandra/io/sstable/Downsampling.java#L116-L123 |
jeremybrooks/jinx | src/main/java/net/jeremybrooks/jinx/api/TagsApi.java | TagsApi.getClusterPhotos | public Photos getClusterPhotos(String tag, String clusterId) throws JinxException {
"""
Returns the first 24 photos for a given tag cluster
This method does not require authentication.
@param tag the tag that the cluster belongs to. Required.
@param clusterId top three tags for the cluster, separated ... | java | public Photos getClusterPhotos(String tag, String clusterId) throws JinxException {
JinxUtils.validateParams(tag, clusterId);
Map<String, String> params = new TreeMap<>();
params.put("method", "flickr.tags.getClusterPhotos");
params.put("tag", tag);
params.put("cluster_id", clusterId);
return ji... | [
"public",
"Photos",
"getClusterPhotos",
"(",
"String",
"tag",
",",
"String",
"clusterId",
")",
"throws",
"JinxException",
"{",
"JinxUtils",
".",
"validateParams",
"(",
"tag",
",",
"clusterId",
")",
";",
"Map",
"<",
"String",
",",
"String",
">",
"params",
"="... | Returns the first 24 photos for a given tag cluster
This method does not require authentication.
@param tag the tag that the cluster belongs to. Required.
@param clusterId top three tags for the cluster, separated by dashes. Required.
@return first 24 photos for a given tag cluster.
@throws JinxException if req... | [
"Returns",
"the",
"first",
"24",
"photos",
"for",
"a",
"given",
"tag",
"cluster"
] | train | https://github.com/jeremybrooks/jinx/blob/ab7a4b7462d08bcbfd9b98bd3f5029771c20f6c6/src/main/java/net/jeremybrooks/jinx/api/TagsApi.java#L63-L70 |
alkacon/opencms-core | src/org/opencms/ui/apps/CmsPageEditorConfiguration.java | CmsPageEditorConfiguration.getPath | private String getPath(CmsObject cms, HttpSession session) {
"""
Returns the page editor path to open.<p>
@param cms the cms context
@param session the user session
@return the path or <code>null</code>
"""
CmsQuickLaunchLocationCache locationCache = CmsQuickLaunchLocationCache.getLocationCache... | java | private String getPath(CmsObject cms, HttpSession session) {
CmsQuickLaunchLocationCache locationCache = CmsQuickLaunchLocationCache.getLocationCache(session);
String page = locationCache.getPageEditorLocation(cms.getRequestContext().getSiteRoot());
if (page == null) {
try {
... | [
"private",
"String",
"getPath",
"(",
"CmsObject",
"cms",
",",
"HttpSession",
"session",
")",
"{",
"CmsQuickLaunchLocationCache",
"locationCache",
"=",
"CmsQuickLaunchLocationCache",
".",
"getLocationCache",
"(",
"session",
")",
";",
"String",
"page",
"=",
"locationCac... | Returns the page editor path to open.<p>
@param cms the cms context
@param session the user session
@return the path or <code>null</code> | [
"Returns",
"the",
"page",
"editor",
"path",
"to",
"open",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/CmsPageEditorConfiguration.java#L211-L226 |
ArcBees/gwtquery | gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java | Effects.fadeTo | public Effects fadeTo(int millisecs, double opacity, Function... f) {
"""
Fade the opacity of all matched elements to a specified opacity and firing
an optional callback after completion. Only the opacity is adjusted for
this animation, meaning that all of the matched elements should already
have some form of h... | java | public Effects fadeTo(int millisecs, double opacity, Function... f) {
return animate("opacity: " + opacity, millisecs, f);
} | [
"public",
"Effects",
"fadeTo",
"(",
"int",
"millisecs",
",",
"double",
"opacity",
",",
"Function",
"...",
"f",
")",
"{",
"return",
"animate",
"(",
"\"opacity: \"",
"+",
"opacity",
",",
"millisecs",
",",
"f",
")",
";",
"}"
] | Fade the opacity of all matched elements to a specified opacity and firing
an optional callback after completion. Only the opacity is adjusted for
this animation, meaning that all of the matched elements should already
have some form of height and width associated with them. | [
"Fade",
"the",
"opacity",
"of",
"all",
"matched",
"elements",
"to",
"a",
"specified",
"opacity",
"and",
"firing",
"an",
"optional",
"callback",
"after",
"completion",
".",
"Only",
"the",
"opacity",
"is",
"adjusted",
"for",
"this",
"animation",
"meaning",
"that... | train | https://github.com/ArcBees/gwtquery/blob/93e02bc8eb030081061c56134ebee1f585981107/gwtquery-core/src/main/java/com/google/gwt/query/client/plugins/Effects.java#L505-L507 |
landawn/AbacusUtil | src/com/landawn/abacus/util/N.java | N.removeAll | @SafeVarargs
public static int[] removeAll(final int[] a, final int... elements) {
"""
Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection)
"""
if (N.isNullOrEmpty(a)) {
... | java | @SafeVarargs
public static int[] removeAll(final int[] a, final int... elements) {
if (N.isNullOrEmpty(a)) {
return N.EMPTY_INT_ARRAY;
} else if (N.isNullOrEmpty(elements)) {
return a.clone();
} else if (elements.length == 1) {
return removeAllOccur... | [
"@",
"SafeVarargs",
"public",
"static",
"int",
"[",
"]",
"removeAll",
"(",
"final",
"int",
"[",
"]",
"a",
",",
"final",
"int",
"...",
"elements",
")",
"{",
"if",
"(",
"N",
".",
"isNullOrEmpty",
"(",
"a",
")",
")",
"{",
"return",
"N",
".",
"EMPTY_IN... | Returns a new array with removes all the occurrences of specified elements from <code>a</code>
@param a
@param elements
@return
@see Collection#removeAll(Collection) | [
"Returns",
"a",
"new",
"array",
"with",
"removes",
"all",
"the",
"occurrences",
"of",
"specified",
"elements",
"from",
"<code",
">",
"a<",
"/",
"code",
">"
] | train | https://github.com/landawn/AbacusUtil/blob/544b7720175d15e9329f83dd22a8cc5fa4515e12/src/com/landawn/abacus/util/N.java#L23443-L23456 |
dottydingo/hyperion | client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java | QueryBuilder.lt | public QueryExpression lt(String propertyName,String value) {
"""
Create a less than expression
@param propertyName The propery name
@param value The value
@return The query expression
"""
return new SimpleQueryExpression(propertyName, ComparisonOperator.LESS_THAN,wrap(value));
} | java | public QueryExpression lt(String propertyName,String value)
{
return new SimpleQueryExpression(propertyName, ComparisonOperator.LESS_THAN,wrap(value));
} | [
"public",
"QueryExpression",
"lt",
"(",
"String",
"propertyName",
",",
"String",
"value",
")",
"{",
"return",
"new",
"SimpleQueryExpression",
"(",
"propertyName",
",",
"ComparisonOperator",
".",
"LESS_THAN",
",",
"wrap",
"(",
"value",
")",
")",
";",
"}"
] | Create a less than expression
@param propertyName The propery name
@param value The value
@return The query expression | [
"Create",
"a",
"less",
"than",
"expression"
] | train | https://github.com/dottydingo/hyperion/blob/c4d119c90024a88c0335d7d318e9ccdb70149764/client/src/main/java/com/dottydingo/hyperion/client/builder/query/QueryBuilder.java#L213-L216 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryInstantiatedChaincodes | public List<ChaincodeInfo> queryInstantiatedChaincodes(Peer peer) throws InvalidArgumentException, ProposalException {
"""
Query peer for chaincode that has been instantiated
<STRONG>This method may not be thread safe if client context is changed!</STRONG>
@param peer The peer to query.
@return A list of Ch... | java | public List<ChaincodeInfo> queryInstantiatedChaincodes(Peer peer) throws InvalidArgumentException, ProposalException {
return queryInstantiatedChaincodes(peer, client.getUserContext());
} | [
"public",
"List",
"<",
"ChaincodeInfo",
">",
"queryInstantiatedChaincodes",
"(",
"Peer",
"peer",
")",
"throws",
"InvalidArgumentException",
",",
"ProposalException",
"{",
"return",
"queryInstantiatedChaincodes",
"(",
"peer",
",",
"client",
".",
"getUserContext",
"(",
... | Query peer for chaincode that has been instantiated
<STRONG>This method may not be thread safe if client context is changed!</STRONG>
@param peer The peer to query.
@return A list of ChaincodeInfo @see {@link ChaincodeInfo}
@throws InvalidArgumentException
@throws ProposalException | [
"Query",
"peer",
"for",
"chaincode",
"that",
"has",
"been",
"instantiated"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L3868-L3871 |
lucee/Lucee | core/src/main/java/lucee/runtime/type/scope/FormImpl.java | FormImpl.initializeUrlEncodedOrTextPlain | private void initializeUrlEncodedOrTextPlain(PageContext pc, char delimiter, boolean scriptProteced) {
"""
/*
private void initializeMultiPart(PageContext pc, boolean scriptProteced) {
File tempDir=FileWrapper.toFile(pc.getConfig().getTempDirectory());
// Create a factory for disk-based file items DiskFileI... | java | private void initializeUrlEncodedOrTextPlain(PageContext pc, char delimiter, boolean scriptProteced) {
BufferedReader reader = null;
try {
reader = pc.getHttpServletRequest().getReader();
raw = setFrom___(IOUtil.toString(reader, false), delimiter);
fillDecoded(raw, encoding, scriptProteced, pc.getAppli... | [
"private",
"void",
"initializeUrlEncodedOrTextPlain",
"(",
"PageContext",
"pc",
",",
"char",
"delimiter",
",",
"boolean",
"scriptProteced",
")",
"{",
"BufferedReader",
"reader",
"=",
"null",
";",
"try",
"{",
"reader",
"=",
"pc",
".",
"getHttpServletRequest",
"(",
... | /*
private void initializeMultiPart(PageContext pc, boolean scriptProteced) {
File tempDir=FileWrapper.toFile(pc.getConfig().getTempDirectory());
// Create a factory for disk-based file items DiskFileItemFactory factory = new
DiskFileItemFactory(-1,tempDir);
// Create a new file upload handler ServletFileUpload uplo... | [
"/",
"*",
"private",
"void",
"initializeMultiPart",
"(",
"PageContext",
"pc",
"boolean",
"scriptProteced",
")",
"{"
] | train | https://github.com/lucee/Lucee/blob/29b153fc4e126e5edb97da937f2ee2e231b87593/core/src/main/java/lucee/runtime/type/scope/FormImpl.java#L251-L267 |
fhoeben/hsac-fitnesse-fixtures | src/main/java/nl/hsac/fitnesse/fixture/Environment.java | Environment.callService | public void callService(String url, String templateName, Object model, XmlHttpResponse result) {
"""
Performs POST to supplied url of result of applying template with model.
All namespaces registered in this environment will be registered with result.
@param url url to post to.
@param templateName name of templ... | java | public void callService(String url, String templateName, Object model, XmlHttpResponse result) {
callService(url, templateName, model, result, null);
} | [
"public",
"void",
"callService",
"(",
"String",
"url",
",",
"String",
"templateName",
",",
"Object",
"model",
",",
"XmlHttpResponse",
"result",
")",
"{",
"callService",
"(",
"url",
",",
"templateName",
",",
"model",
",",
"result",
",",
"null",
")",
";",
"}... | Performs POST to supplied url of result of applying template with model.
All namespaces registered in this environment will be registered with result.
@param url url to post to.
@param templateName name of template to use.
@param model model for template.
@param result result to populate with response. | [
"Performs",
"POST",
"to",
"supplied",
"url",
"of",
"result",
"of",
"applying",
"template",
"with",
"model",
".",
"All",
"namespaces",
"registered",
"in",
"this",
"environment",
"will",
"be",
"registered",
"with",
"result",
"."
] | train | https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/Environment.java#L234-L236 |
jboss/jboss-jstl-api_spec | src/main/java/org/apache/taglibs/standard/util/XmlUtil.java | XmlUtil.newSAXSource | public static SAXSource newSAXSource(Reader reader, String systemId, JstlEntityResolver entityResolver)
throws ParserConfigurationException, SAXException {
"""
Create a SAXSource from a Reader. Any entities will be resolved using JSTL semantics.
@param reader the source of the XML
@param systemId t... | java | public static SAXSource newSAXSource(Reader reader, String systemId, JstlEntityResolver entityResolver)
throws ParserConfigurationException, SAXException {
SAXSource source = new SAXSource(newXMLReader(entityResolver), new InputSource(reader));
source.setSystemId(wrapSystemId(systemId));
... | [
"public",
"static",
"SAXSource",
"newSAXSource",
"(",
"Reader",
"reader",
",",
"String",
"systemId",
",",
"JstlEntityResolver",
"entityResolver",
")",
"throws",
"ParserConfigurationException",
",",
"SAXException",
"{",
"SAXSource",
"source",
"=",
"new",
"SAXSource",
"... | Create a SAXSource from a Reader. Any entities will be resolved using JSTL semantics.
@param reader the source of the XML
@param systemId the system id
@param entityResolver for resolving using JSTL semamtics
@return a new SAXSource
@throws ParserConfigurationException if there was a configuration problem creating the... | [
"Create",
"a",
"SAXSource",
"from",
"a",
"Reader",
".",
"Any",
"entities",
"will",
"be",
"resolved",
"using",
"JSTL",
"semantics",
"."
] | train | https://github.com/jboss/jboss-jstl-api_spec/blob/4ad412ae5be1ae606b8d33c188cb3d98bfcbe84c/src/main/java/org/apache/taglibs/standard/util/XmlUtil.java#L245-L250 |
feroult/yawp | yawp-core/src/main/java/io/yawp/commons/utils/json/gson/CustomTypeAdapterFactory.java | CustomTypeAdapterFactory.read | protected T read(JsonReader in, TypeAdapter<JsonElement> elementAdapter, TypeAdapter<T> delegate) throws IOException {
"""
Override this to define how this is deserialized in {@code deserialize} to
its type.
"""
JsonElement tree = elementAdapter.read(in);
afterRead(tree);
return delega... | java | protected T read(JsonReader in, TypeAdapter<JsonElement> elementAdapter, TypeAdapter<T> delegate) throws IOException {
JsonElement tree = elementAdapter.read(in);
afterRead(tree);
return delegate.fromJsonTree(tree);
} | [
"protected",
"T",
"read",
"(",
"JsonReader",
"in",
",",
"TypeAdapter",
"<",
"JsonElement",
">",
"elementAdapter",
",",
"TypeAdapter",
"<",
"T",
">",
"delegate",
")",
"throws",
"IOException",
"{",
"JsonElement",
"tree",
"=",
"elementAdapter",
".",
"read",
"(",
... | Override this to define how this is deserialized in {@code deserialize} to
its type. | [
"Override",
"this",
"to",
"define",
"how",
"this",
"is",
"deserialized",
"in",
"{"
] | train | https://github.com/feroult/yawp/blob/b90deb905edd3fdb3009a5525e310cd17ead7f3d/yawp-core/src/main/java/io/yawp/commons/utils/json/gson/CustomTypeAdapterFactory.java#L58-L62 |
williamwebb/alogger | BillingHelper/src/main/java/com/jug6ernaut/billing/Security.java | Security.verify | public static boolean verify(PublicKey publicKey, String signedData, String signature) {
"""
Verifies that the signature from the server matches the computed
signature on the data. Returns true if the data is correctly signed.
@param publicKey public key associated with the developer account
@param signedDat... | java | public static boolean verify(PublicKey publicKey, String signedData, String signature) {
Signature sig;
try {
sig = Signature.getInstance(SIGNATURE_ALGORITHM);
sig.initVerify(publicKey);
sig.update(signedData.getBytes());
if (!sig.verify(Base64.decode(sign... | [
"public",
"static",
"boolean",
"verify",
"(",
"PublicKey",
"publicKey",
",",
"String",
"signedData",
",",
"String",
"signature",
")",
"{",
"Signature",
"sig",
";",
"try",
"{",
"sig",
"=",
"Signature",
".",
"getInstance",
"(",
"SIGNATURE_ALGORITHM",
")",
";",
... | Verifies that the signature from the server matches the computed
signature on the data. Returns true if the data is correctly signed.
@param publicKey public key associated with the developer account
@param signedData signed data from server
@param signature server signature
@return true if the data and signature mat... | [
"Verifies",
"that",
"the",
"signature",
"from",
"the",
"server",
"matches",
"the",
"computed",
"signature",
"on",
"the",
"data",
".",
"Returns",
"true",
"if",
"the",
"data",
"is",
"correctly",
"signed",
"."
] | train | https://github.com/williamwebb/alogger/blob/61fca49e0b8d9c3a76c40da8883ac354b240351e/BillingHelper/src/main/java/com/jug6ernaut/billing/Security.java#L92-L113 |
wuman/orientdb-android | client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java | OServerAdmin.getReplicationJournal | public synchronized ODocument getReplicationJournal(final String iDatabaseName, final String iRemoteServer) throws IOException {
"""
Gets the replication journal for a database.
@param iDatabaseName
database name to replicate
@param iRemoteName
@return The journal composed as a JSON with key the serial numbe... | java | public synchronized ODocument getReplicationJournal(final String iDatabaseName, final String iRemoteServer) throws IOException {
OLogManager.instance().debug(this, "Retrieving the replication log for database '%s' from server '%s'...", iDatabaseName,
storage.getURL());
final ODocument response = se... | [
"public",
"synchronized",
"ODocument",
"getReplicationJournal",
"(",
"final",
"String",
"iDatabaseName",
",",
"final",
"String",
"iRemoteServer",
")",
"throws",
"IOException",
"{",
"OLogManager",
".",
"instance",
"(",
")",
".",
"debug",
"(",
"this",
",",
"\"Retrie... | Gets the replication journal for a database.
@param iDatabaseName
database name to replicate
@param iRemoteName
@return The journal composed as a JSON with key the serial number of the entry and as key the operation type id and the RID
involved. Example {"10022":"1#10:3"}
@throws IOException | [
"Gets",
"the",
"replication",
"journal",
"for",
"a",
"database",
"."
] | train | https://github.com/wuman/orientdb-android/blob/ff9b17e4349f26168b2d0c4facb1a18cbfbe8cf0/client/src/main/java/com/orientechnologies/orient/client/remote/OServerAdmin.java#L396-L409 |
census-instrumentation/opencensus-java | api/src/main/java/io/opencensus/trace/unsafe/ContextUtils.java | ContextUtils.withValue | public static Context withValue(Context context, @javax.annotation.Nullable Span span) {
"""
Creates a new {@code Context} with the given value set.
@param context the parent {@code Context}.
@param span the value to be set.
@return a new context with the given value set.
@since 0.21
"""
return Utils... | java | public static Context withValue(Context context, @javax.annotation.Nullable Span span) {
return Utils.checkNotNull(context, "context").withValue(CONTEXT_SPAN_KEY, span);
} | [
"public",
"static",
"Context",
"withValue",
"(",
"Context",
"context",
",",
"@",
"javax",
".",
"annotation",
".",
"Nullable",
"Span",
"span",
")",
"{",
"return",
"Utils",
".",
"checkNotNull",
"(",
"context",
",",
"\"context\"",
")",
".",
"withValue",
"(",
... | Creates a new {@code Context} with the given value set.
@param context the parent {@code Context}.
@param span the value to be set.
@return a new context with the given value set.
@since 0.21 | [
"Creates",
"a",
"new",
"{",
"@code",
"Context",
"}",
"with",
"the",
"given",
"value",
"set",
"."
] | train | https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/unsafe/ContextUtils.java#L60-L62 |
seedstack/w20-bridge-addon | rest/src/main/java/org/seedstack/w20/internal/PathUtils.java | PathUtils.buildPath | public static String buildPath(String first, String... parts) {
"""
Concatenate path parts into a full path, taking care of extra or missing slashes.
@param first the first part.
@param parts the additional parts.
@return the concatenated path.
"""
StringBuilder result = new StringBuilder(first);
... | java | public static String buildPath(String first, String... parts) {
StringBuilder result = new StringBuilder(first);
for (String part : parts) {
if (result.length() == 0) {
if (part.startsWith("/")) {
result.append(part.substring(1));
} else {... | [
"public",
"static",
"String",
"buildPath",
"(",
"String",
"first",
",",
"String",
"...",
"parts",
")",
"{",
"StringBuilder",
"result",
"=",
"new",
"StringBuilder",
"(",
"first",
")",
";",
"for",
"(",
"String",
"part",
":",
"parts",
")",
"{",
"if",
"(",
... | Concatenate path parts into a full path, taking care of extra or missing slashes.
@param first the first part.
@param parts the additional parts.
@return the concatenated path. | [
"Concatenate",
"path",
"parts",
"into",
"a",
"full",
"path",
"taking",
"care",
"of",
"extra",
"or",
"missing",
"slashes",
"."
] | train | https://github.com/seedstack/w20-bridge-addon/blob/94c997a9392f10a1bf1655e7f25bf2f6f328ce20/rest/src/main/java/org/seedstack/w20/internal/PathUtils.java#L71-L93 |
OpenLiberty/open-liberty | dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java | Director.uninstallFeatures | public void uninstallFeatures(Collection<String> featureNames, Collection<String> uninstallInstallFeatures) {
"""
Uninstalls features
@param featureNames Collection of feature names to uninstall
@param uninstallInstallFeatures
"""
getUninstallDirector().uninstallFeatures(featureNames, uninstallInst... | java | public void uninstallFeatures(Collection<String> featureNames, Collection<String> uninstallInstallFeatures) {
getUninstallDirector().uninstallFeatures(featureNames, uninstallInstallFeatures, false);
} | [
"public",
"void",
"uninstallFeatures",
"(",
"Collection",
"<",
"String",
">",
"featureNames",
",",
"Collection",
"<",
"String",
">",
"uninstallInstallFeatures",
")",
"{",
"getUninstallDirector",
"(",
")",
".",
"uninstallFeatures",
"(",
"featureNames",
",",
"uninstal... | Uninstalls features
@param featureNames Collection of feature names to uninstall
@param uninstallInstallFeatures | [
"Uninstalls",
"features"
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.install/src/com/ibm/ws/install/internal/Director.java#L1838-L1840 |
geomajas/geomajas-project-server | plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayerUtil.java | HibernateLayerUtil.getPropertyClass | protected Class<?> getPropertyClass(ClassMetadata meta, String propertyName) throws HibernateLayerException {
"""
Return the class of one of the properties of another class from which the Hibernate metadata is given.
@param meta
The parent class to search a property in.
@param propertyName
The name of the pr... | java | protected Class<?> getPropertyClass(ClassMetadata meta, String propertyName) throws HibernateLayerException {
// try to assure the correct separator is used
propertyName = propertyName.replace(XPATH_SEPARATOR, SEPARATOR);
if (propertyName.contains(SEPARATOR)) {
String directProperty = propertyName.substring(0... | [
"protected",
"Class",
"<",
"?",
">",
"getPropertyClass",
"(",
"ClassMetadata",
"meta",
",",
"String",
"propertyName",
")",
"throws",
"HibernateLayerException",
"{",
"// try to assure the correct separator is used",
"propertyName",
"=",
"propertyName",
".",
"replace",
"(",... | Return the class of one of the properties of another class from which the Hibernate metadata is given.
@param meta
The parent class to search a property in.
@param propertyName
The name of the property in the parent class (provided by meta)
@return Returns the class of the property in question.
@throws HibernateLayerE... | [
"Return",
"the",
"class",
"of",
"one",
"of",
"the",
"properties",
"of",
"another",
"class",
"from",
"which",
"the",
"Hibernate",
"metadata",
"is",
"given",
"."
] | train | https://github.com/geomajas/geomajas-project-server/blob/904b7d7deed1350d28955589098dd1e0a786d76e/plugin/layer-hibernate/hibernate/src/main/java/org/geomajas/layer/hibernate/HibernateLayerUtil.java#L102-L128 |
comapi/comapi-sdk-android | COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java | InternalService.updateMessageStatus | public Observable<ComapiResult<Void>> updateMessageStatus(@NonNull final String conversationId, @NonNull final List<MessageStatusUpdate> msgStatusList) {
"""
Sets statuses for sets of messages.
@param conversationId ID of a conversation to modify.
@param msgStatusList List of status modifications.
@return Ob... | java | public Observable<ComapiResult<Void>> updateMessageStatus(@NonNull final String conversationId, @NonNull final List<MessageStatusUpdate> msgStatusList) {
final String token = getToken();
if (sessionController.isCreatingSession()) {
return getTaskQueue().queueUpdateMessageStatus(conversatio... | [
"public",
"Observable",
"<",
"ComapiResult",
"<",
"Void",
">",
">",
"updateMessageStatus",
"(",
"@",
"NonNull",
"final",
"String",
"conversationId",
",",
"@",
"NonNull",
"final",
"List",
"<",
"MessageStatusUpdate",
">",
"msgStatusList",
")",
"{",
"final",
"Strin... | Sets statuses for sets of messages.
@param conversationId ID of a conversation to modify.
@param msgStatusList List of status modifications.
@return Observable to modify message statuses. | [
"Sets",
"statuses",
"for",
"sets",
"of",
"messages",
"."
] | train | https://github.com/comapi/comapi-sdk-android/blob/53140a58d5a62afe196047ccc5120bfe090ef211/COMAPI/foundation/src/main/java/com/comapi/internal/network/InternalService.java#L783-L794 |
astrapi69/jaulp-wicket | jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/socialnet/googleplus/share/GooglePlusSharePanel.java | GooglePlusSharePanel.newWebMarkupContainer | protected WebMarkupContainer newWebMarkupContainer(final String id,
final IModel<GooglePlusShareModelBean> model) {
"""
Factory method for creating the new {@link WebMarkupContainer}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version... | java | protected WebMarkupContainer newWebMarkupContainer(final String id,
final IModel<GooglePlusShareModelBean> model)
{
final WebMarkupContainer googlePlusButton = ComponentFactory.newWebMarkupContainer(id,
model);
googlePlusButton.add(new AttributeModifier("class", model.getObject().getCssClass()));
googlePlus... | [
"protected",
"WebMarkupContainer",
"newWebMarkupContainer",
"(",
"final",
"String",
"id",
",",
"final",
"IModel",
"<",
"GooglePlusShareModelBean",
">",
"model",
")",
"{",
"final",
"WebMarkupContainer",
"googlePlusButton",
"=",
"ComponentFactory",
".",
"newWebMarkupContain... | Factory method for creating the new {@link WebMarkupContainer}. This method is invoked in the
constructor from the derived classes and can be overridden so users can provide their own
version of a new {@link WebMarkupContainer}.
@param id
the id
@param model
the model
@return the new {@link WebMarkupContainer} | [
"Factory",
"method",
"for",
"creating",
"the",
"new",
"{",
"@link",
"WebMarkupContainer",
"}",
".",
"This",
"method",
"is",
"invoked",
"in",
"the",
"constructor",
"from",
"the",
"derived",
"classes",
"and",
"can",
"be",
"overridden",
"so",
"users",
"can",
"p... | train | https://github.com/astrapi69/jaulp-wicket/blob/85d74368d00abd9bb97659b5794e38c0f8a013d4/jaulp-wicket-components/src/main/java/de/alpharogroup/wicket/components/socialnet/googleplus/share/GooglePlusSharePanel.java#L102-L113 |
dlew/joda-time-android | library/src/main/java/net/danlew/android/joda/ResUtils.java | ResUtils.getIdentifier | public static int getIdentifier(Class<?> type, String name) {
"""
Retrieves a resource id dynamically, via reflection. It's much faster
than Resources.getIdentifier(), however it only allows you to get
identifiers from your own package.
Note that this method is still slower than retrieving resources
directl... | java | public static int getIdentifier(Class<?> type, String name) {
// See if the cache already contains this identifier
Map<String, Integer> typeCache;
if (!sIdentifierCache.containsKey(type)) {
typeCache = new ConcurrentHashMap<String, Integer>();
sIdentifierCache.put(type, t... | [
"public",
"static",
"int",
"getIdentifier",
"(",
"Class",
"<",
"?",
">",
"type",
",",
"String",
"name",
")",
"{",
"// See if the cache already contains this identifier",
"Map",
"<",
"String",
",",
"Integer",
">",
"typeCache",
";",
"if",
"(",
"!",
"sIdentifierCac... | Retrieves a resource id dynamically, via reflection. It's much faster
than Resources.getIdentifier(), however it only allows you to get
identifiers from your own package.
Note that this method is still slower than retrieving resources
directly (e.g., R.drawable.MyResource) - it should only be used
when dynamically re... | [
"Retrieves",
"a",
"resource",
"id",
"dynamically",
"via",
"reflection",
".",
"It",
"s",
"much",
"faster",
"than",
"Resources",
".",
"getIdentifier",
"()",
"however",
"it",
"only",
"allows",
"you",
"to",
"get",
"identifiers",
"from",
"your",
"own",
"package",
... | train | https://github.com/dlew/joda-time-android/blob/5bf96f6ef4ea63ee91e73e1e528896fa00108dec/library/src/main/java/net/danlew/android/joda/ResUtils.java#L88-L118 |
forge/core | maven/api/src/main/java/org/jboss/forge/addon/maven/archetype/SimpleNamespaceContext.java | SimpleNamespaceContext.registerMapping | public void registerMapping(String prefix, String namespaceURI) {
"""
Registers prefix - namespace URI mapping
@param prefix
@param namespaceURI
"""
prefix2Ns.put(prefix, namespaceURI);
ns2Prefix.put(namespaceURI, prefix);
} | java | public void registerMapping(String prefix, String namespaceURI)
{
prefix2Ns.put(prefix, namespaceURI);
ns2Prefix.put(namespaceURI, prefix);
} | [
"public",
"void",
"registerMapping",
"(",
"String",
"prefix",
",",
"String",
"namespaceURI",
")",
"{",
"prefix2Ns",
".",
"put",
"(",
"prefix",
",",
"namespaceURI",
")",
";",
"ns2Prefix",
".",
"put",
"(",
"namespaceURI",
",",
"prefix",
")",
";",
"}"
] | Registers prefix - namespace URI mapping
@param prefix
@param namespaceURI | [
"Registers",
"prefix",
"-",
"namespace",
"URI",
"mapping"
] | train | https://github.com/forge/core/blob/e140eb03bbe2b3409478ad70c86c3edbef6d9a0c/maven/api/src/main/java/org/jboss/forge/addon/maven/archetype/SimpleNamespaceContext.java#L57-L61 |
hyperledger/fabric-sdk-java | src/main/java/org/hyperledger/fabric/sdk/Channel.java | Channel.queryBlockByTransactionID | public BlockInfo queryBlockByTransactionID(Collection<Peer> peers, String txID, User userContext) throws InvalidArgumentException, ProposalException {
"""
query a peer in this channel for a Block by a TransactionID contained in the block
@param peers the peer to try to send the request to
@param txID ... | java | public BlockInfo queryBlockByTransactionID(Collection<Peer> peers, String txID, User userContext) throws InvalidArgumentException, ProposalException {
checkChannelState();
checkPeers(peers);
User.userContextCheck(userContext);
if (txID == null) {
throw new InvalidArgumentEx... | [
"public",
"BlockInfo",
"queryBlockByTransactionID",
"(",
"Collection",
"<",
"Peer",
">",
"peers",
",",
"String",
"txID",
",",
"User",
"userContext",
")",
"throws",
"InvalidArgumentException",
",",
"ProposalException",
"{",
"checkChannelState",
"(",
")",
";",
"checkP... | query a peer in this channel for a Block by a TransactionID contained in the block
@param peers the peer to try to send the request to
@param txID the transactionID to query on
@param userContext the user context.
@return the {@link BlockInfo} for the Block containing the transaction
@throws InvalidArgume... | [
"query",
"a",
"peer",
"in",
"this",
"channel",
"for",
"a",
"Block",
"by",
"a",
"TransactionID",
"contained",
"in",
"the",
"block"
] | train | https://github.com/hyperledger/fabric-sdk-java/blob/4a2d7b3408b8b0a1ed812aa36942c438159c37a0/src/main/java/org/hyperledger/fabric/sdk/Channel.java#L3033-L3057 |
google/truth | extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java | FieldScopeLogic.ignoringFields | FieldScopeLogic ignoringFields(Iterable<Integer> fieldNumbers) {
"""
something else that doesn't tightly couple FieldScopeLogic to the 'ignore' concept.
"""
if (isEmpty(fieldNumbers)) {
return this;
}
return and(
this,
new NegationFieldScopeLogic(new FieldNumbersLogic(fieldNum... | java | FieldScopeLogic ignoringFields(Iterable<Integer> fieldNumbers) {
if (isEmpty(fieldNumbers)) {
return this;
}
return and(
this,
new NegationFieldScopeLogic(new FieldNumbersLogic(fieldNumbers, /* isRecursive = */ true)));
} | [
"FieldScopeLogic",
"ignoringFields",
"(",
"Iterable",
"<",
"Integer",
">",
"fieldNumbers",
")",
"{",
"if",
"(",
"isEmpty",
"(",
"fieldNumbers",
")",
")",
"{",
"return",
"this",
";",
"}",
"return",
"and",
"(",
"this",
",",
"new",
"NegationFieldScopeLogic",
"(... | something else that doesn't tightly couple FieldScopeLogic to the 'ignore' concept. | [
"something",
"else",
"that",
"doesn",
"t",
"tightly",
"couple",
"FieldScopeLogic",
"to",
"the",
"ignore",
"concept",
"."
] | train | https://github.com/google/truth/blob/60eceffd2e8c3297655d33ed87d965cf5af51108/extensions/proto/src/main/java/com/google/common/truth/extensions/proto/FieldScopeLogic.java#L116-L123 |
infinispan/infinispan | core/src/main/java/org/infinispan/configuration/parsing/Parser.java | Parser.parseStoreAttribute | public static void parseStoreAttribute(XMLExtendedStreamReader reader, int index, AbstractStoreConfigurationBuilder<?, ?> storeBuilder) throws XMLStreamException {
"""
This method is public static so that it can be reused by custom cache store/loader configuration parsers
"""
String value = reader.getAtt... | java | public static void parseStoreAttribute(XMLExtendedStreamReader reader, int index, AbstractStoreConfigurationBuilder<?, ?> storeBuilder) throws XMLStreamException {
String value = reader.getAttributeValue(index);
Attribute attribute = Attribute.forName(reader.getAttributeLocalName(index));
switch (attr... | [
"public",
"static",
"void",
"parseStoreAttribute",
"(",
"XMLExtendedStreamReader",
"reader",
",",
"int",
"index",
",",
"AbstractStoreConfigurationBuilder",
"<",
"?",
",",
"?",
">",
"storeBuilder",
")",
"throws",
"XMLStreamException",
"{",
"String",
"value",
"=",
"re... | This method is public static so that it can be reused by custom cache store/loader configuration parsers | [
"This",
"method",
"is",
"public",
"static",
"so",
"that",
"it",
"can",
"be",
"reused",
"by",
"custom",
"cache",
"store",
"/",
"loader",
"configuration",
"parsers"
] | train | https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/configuration/parsing/Parser.java#L2276-L2320 |
VoltDB/voltdb | src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java | JDBC4CallableStatement.setURL | @Override
public void setURL(String parameterName, URL val) throws SQLException {
"""
Sets the designated parameter to the given java.net.URL object.
"""
checkClosed();
throw SQLError.noSupport();
} | java | @Override
public void setURL(String parameterName, URL val) throws SQLException
{
checkClosed();
throw SQLError.noSupport();
} | [
"@",
"Override",
"public",
"void",
"setURL",
"(",
"String",
"parameterName",
",",
"URL",
"val",
")",
"throws",
"SQLException",
"{",
"checkClosed",
"(",
")",
";",
"throw",
"SQLError",
".",
"noSupport",
"(",
")",
";",
"}"
] | Sets the designated parameter to the given java.net.URL object. | [
"Sets",
"the",
"designated",
"parameter",
"to",
"the",
"given",
"java",
".",
"net",
".",
"URL",
"object",
"."
] | train | https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/jdbc/JDBC4CallableStatement.java#L919-L924 |
Grasia/phatsim | phat-core/src/main/java/phat/sensors/Sensor.java | Sensor.cloneControl | protected Control cloneControl(Control control, Spatial spatial) {
"""
/*protected void notifyListeners(SensorData sourceData) {
for (SensorListener sl : listeners) {
sl.update(this, sourceData);
}
}
"""
if (control instanceof Sensor) {
Sensor sensor = (Sensor) control;
sens... | java | protected Control cloneControl(Control control, Spatial spatial) {
if (control instanceof Sensor) {
Sensor sensor = (Sensor) control;
sensor.setId(id);
sensor.listeners.addAll(listeners);
}
return control;
} | [
"protected",
"Control",
"cloneControl",
"(",
"Control",
"control",
",",
"Spatial",
"spatial",
")",
"{",
"if",
"(",
"control",
"instanceof",
"Sensor",
")",
"{",
"Sensor",
"sensor",
"=",
"(",
"Sensor",
")",
"control",
";",
"sensor",
".",
"setId",
"(",
"id",
... | /*protected void notifyListeners(SensorData sourceData) {
for (SensorListener sl : listeners) {
sl.update(this, sourceData);
}
} | [
"/",
"*",
"protected",
"void",
"notifyListeners",
"(",
"SensorData",
"sourceData",
")",
"{",
"for",
"(",
"SensorListener",
"sl",
":",
"listeners",
")",
"{",
"sl",
".",
"update",
"(",
"this",
"sourceData",
")",
";",
"}",
"}"
] | train | https://github.com/Grasia/phatsim/blob/2d4fc8189be9730b34c8e3e1a08fb4800e01c5df/phat-core/src/main/java/phat/sensors/Sensor.java#L111-L119 |
b3log/latke | latke-core/src/main/java/org/b3log/latke/util/Crypts.java | Crypts.signHmacSHA1 | public static String signHmacSHA1(final String source, final String secret) {
"""
Signs the specified source string using the specified secret.
@param source the specified source string
@param secret the specified secret
@return signed string
"""
try {
final Mac mac = Mac.getInstance("... | java | public static String signHmacSHA1(final String source, final String secret) {
try {
final Mac mac = Mac.getInstance("HmacSHA1");
mac.init(new SecretKeySpec(secret.getBytes("UTF-8"), "HmacSHA1"));
final byte[] signData = mac.doFinal(source.getBytes("UTF-8"));
retu... | [
"public",
"static",
"String",
"signHmacSHA1",
"(",
"final",
"String",
"source",
",",
"final",
"String",
"secret",
")",
"{",
"try",
"{",
"final",
"Mac",
"mac",
"=",
"Mac",
".",
"getInstance",
"(",
"\"HmacSHA1\"",
")",
";",
"mac",
".",
"init",
"(",
"new",
... | Signs the specified source string using the specified secret.
@param source the specified source string
@param secret the specified secret
@return signed string | [
"Signs",
"the",
"specified",
"source",
"string",
"using",
"the",
"specified",
"secret",
"."
] | train | https://github.com/b3log/latke/blob/f7e08a47eeecea5f7c94006382c24f353585de33/latke-core/src/main/java/org/b3log/latke/util/Crypts.java#L46-L56 |
JM-Lab/utils-java8 | src/main/java/kr/jm/utils/datastructure/JMMap.java | JMMap.newFilteredChangedValueWithEntryMap | public static <K, V, NV> Map<K, NV> newFilteredChangedValueWithEntryMap(
Map<K, V> map, Predicate<Entry<K, V>> filter,
Function<Entry<K, V>, NV> changingValueFunction) {
"""
New filtered changed value with entry map map.
@param <K> the type parameter
@param <V> ... | java | public static <K, V, NV> Map<K, NV> newFilteredChangedValueWithEntryMap(
Map<K, V> map, Predicate<Entry<K, V>> filter,
Function<Entry<K, V>, NV> changingValueFunction) {
return getEntryStreamWithFilter(map, filter).collect(
toMap(Entry::getKey, changingValueFunction::appl... | [
"public",
"static",
"<",
"K",
",",
"V",
",",
"NV",
">",
"Map",
"<",
"K",
",",
"NV",
">",
"newFilteredChangedValueWithEntryMap",
"(",
"Map",
"<",
"K",
",",
"V",
">",
"map",
",",
"Predicate",
"<",
"Entry",
"<",
"K",
",",
"V",
">",
">",
"filter",
",... | New filtered changed value with entry map map.
@param <K> the type parameter
@param <V> the type parameter
@param <NV> the type parameter
@param map the map
@param filter the filter
@param changingValueFunction the changing value fun... | [
"New",
"filtered",
"changed",
"value",
"with",
"entry",
"map",
"map",
"."
] | train | https://github.com/JM-Lab/utils-java8/blob/9e407b3f28a7990418a1e877229fa8344f4d78a5/src/main/java/kr/jm/utils/datastructure/JMMap.java#L286-L291 |
lukas-krecan/JsonUnit | json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java | JsonAssert.assertJsonPartEquals | public static void assertJsonPartEquals(Object expected, Object fullJson, String path, Configuration configuration) {
"""
Compares part of the JSON. Path has this format "root.array[0].value".
"""
Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
diff.failIfDifferent();
... | java | public static void assertJsonPartEquals(Object expected, Object fullJson, String path, Configuration configuration) {
Diff diff = create(expected, fullJson, FULL_JSON, path, configuration);
diff.failIfDifferent();
} | [
"public",
"static",
"void",
"assertJsonPartEquals",
"(",
"Object",
"expected",
",",
"Object",
"fullJson",
",",
"String",
"path",
",",
"Configuration",
"configuration",
")",
"{",
"Diff",
"diff",
"=",
"create",
"(",
"expected",
",",
"fullJson",
",",
"FULL_JSON",
... | Compares part of the JSON. Path has this format "root.array[0].value". | [
"Compares",
"part",
"of",
"the",
"JSON",
".",
"Path",
"has",
"this",
"format",
"root",
".",
"array",
"[",
"0",
"]",
".",
"value",
"."
] | train | https://github.com/lukas-krecan/JsonUnit/blob/2b12ed792e8dd787bddd6f3b8eb2325737435791/json-unit/src/main/java/net/javacrumbs/jsonunit/JsonAssert.java#L80-L83 |
alkacon/opencms-core | src/org/opencms/xml/containerpage/CmsXmlContainerPage.java | CmsXmlContainerPage.fillResource | protected CmsResource fillResource(CmsObject cms, Element element, CmsUUID resourceId) throws CmsException {
"""
Fills a {@link CmsXmlVfsFileValue} with the resource identified by the given id.<p>
@param cms the current CMS context
@param element the XML element to fill
@param resourceId the ID identifying th... | java | protected CmsResource fillResource(CmsObject cms, Element element, CmsUUID resourceId) throws CmsException {
String xpath = element.getPath();
int pos = xpath.lastIndexOf("/" + XmlNode.Containers.name() + "/");
if (pos > 0) {
xpath = xpath.substring(pos + 1);
}
CmsRe... | [
"protected",
"CmsResource",
"fillResource",
"(",
"CmsObject",
"cms",
",",
"Element",
"element",
",",
"CmsUUID",
"resourceId",
")",
"throws",
"CmsException",
"{",
"String",
"xpath",
"=",
"element",
".",
"getPath",
"(",
")",
";",
"int",
"pos",
"=",
"xpath",
".... | Fills a {@link CmsXmlVfsFileValue} with the resource identified by the given id.<p>
@param cms the current CMS context
@param element the XML element to fill
@param resourceId the ID identifying the resource to use
@return the resource
@throws CmsException if the resource can not be read | [
"Fills",
"a",
"{",
"@link",
"CmsXmlVfsFileValue",
"}",
"with",
"the",
"resource",
"identified",
"by",
"the",
"given",
"id",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/xml/containerpage/CmsXmlContainerPage.java#L445-L456 |
geomajas/geomajas-project-client-gwt | client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java | SvgGraphicsContext.setCursor | public void setCursor(Object parent, String name, String cursor) {
"""
Set a specific cursor on an element of this <code>GraphicsContext</code>.
@param parent
the parent of the element on which the cursor should be set.
@param name
the name of the child element on which the cursor should be set
@param curso... | java | public void setCursor(Object parent, String name, String cursor) {
if (isAttached()) {
helper.setCursor(parent, name, cursor);
}
} | [
"public",
"void",
"setCursor",
"(",
"Object",
"parent",
",",
"String",
"name",
",",
"String",
"cursor",
")",
"{",
"if",
"(",
"isAttached",
"(",
")",
")",
"{",
"helper",
".",
"setCursor",
"(",
"parent",
",",
"name",
",",
"cursor",
")",
";",
"}",
"}"
] | Set a specific cursor on an element of this <code>GraphicsContext</code>.
@param parent
the parent of the element on which the cursor should be set.
@param name
the name of the child element on which the cursor should be set
@param cursor
The string representation of the cursor to use. | [
"Set",
"a",
"specific",
"cursor",
"on",
"an",
"element",
"of",
"this",
"<code",
">",
"GraphicsContext<",
"/",
"code",
">",
"."
] | train | https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L695-L699 |
google/error-prone-javac | src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java | SerializedFormBuilder.buildMethodDescription | public void buildMethodDescription(XMLNode node, Content methodsContentTree) {
"""
Build method description.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added
"""
methodWriter.addMemberDescription(... | java | public void buildMethodDescription(XMLNode node, Content methodsContentTree) {
methodWriter.addMemberDescription((MethodDoc) currentMember, methodsContentTree);
} | [
"public",
"void",
"buildMethodDescription",
"(",
"XMLNode",
"node",
",",
"Content",
"methodsContentTree",
")",
"{",
"methodWriter",
".",
"addMemberDescription",
"(",
"(",
"MethodDoc",
")",
"currentMember",
",",
"methodsContentTree",
")",
";",
"}"
] | Build method description.
@param node the XML element that specifies which components to document
@param methodsContentTree content tree to which the documentation will be added | [
"Build",
"method",
"description",
"."
] | train | https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java#L341-L343 |
Mozu/mozu-java | mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java | AppPackageUrl.getPackageUrl | public static MozuUrl getPackageUrl(String applicationKey, Boolean includeChildren, String responseFields, Boolean skipDevAccountCheck) {
"""
Get Resource Url for GetPackage
@param applicationKey
@param includeChildren
@param responseFields Filtering syntax appended to an API call to increase or decrease the am... | java | public static MozuUrl getPackageUrl(String applicationKey, Boolean includeChildren, String responseFields, Boolean skipDevAccountCheck)
{
UrlFormatter formatter = new UrlFormatter("/api/platform/appdev/apppackages/{applicationKey}/?includeChildren={includeChildren}&skipDevAccountCheck={skipDevAccountCheck}&respons... | [
"public",
"static",
"MozuUrl",
"getPackageUrl",
"(",
"String",
"applicationKey",
",",
"Boolean",
"includeChildren",
",",
"String",
"responseFields",
",",
"Boolean",
"skipDevAccountCheck",
")",
"{",
"UrlFormatter",
"formatter",
"=",
"new",
"UrlFormatter",
"(",
"\"/api/... | Get Resource Url for GetPackage
@param applicationKey
@param includeChildren
@param responseFields Filtering syntax appended to an API call to increase or decrease the amount of data returned inside a JSON object. This parameter should only be used to retrieve data. Attempting to update data using this parameter may ca... | [
"Get",
"Resource",
"Url",
"for",
"GetPackage"
] | train | https://github.com/Mozu/mozu-java/blob/5beadde73601a859f845e3e2fc1077b39c8bea83/mozu-javaasync-core/src/main/java/com/mozu/api/urls/platform/appdev/AppPackageUrl.java#L44-L52 |
undertow-io/undertow | websockets-jsr/src/main/java/io/undertow/websockets/jsr/ServerWebSocketContainer.java | ServerWebSocketContainer.invokeEndpointMethod | public void invokeEndpointMethod(final Executor executor, final Runnable invocation) {
"""
Runs a web socket invocation, setting up the threads and dispatching a thread pool
<p>
Unfortunately we need to dispatch to a thread pool, because there is a good chance that the endpoint
will use blocking IO methods. We ... | java | public void invokeEndpointMethod(final Executor executor, final Runnable invocation) {
if (dispatchToWorker) {
executor.execute(new Runnable() {
@Override
public void run() {
invokeEndpointMethod(invocation);
}
});
... | [
"public",
"void",
"invokeEndpointMethod",
"(",
"final",
"Executor",
"executor",
",",
"final",
"Runnable",
"invocation",
")",
"{",
"if",
"(",
"dispatchToWorker",
")",
"{",
"executor",
".",
"execute",
"(",
"new",
"Runnable",
"(",
")",
"{",
"@",
"Override",
"pu... | Runs a web socket invocation, setting up the threads and dispatching a thread pool
<p>
Unfortunately we need to dispatch to a thread pool, because there is a good chance that the endpoint
will use blocking IO methods. We suspend recieves while this is in progress, to make sure that we do not have multiple
methods invok... | [
"Runs",
"a",
"web",
"socket",
"invocation",
"setting",
"up",
"the",
"threads",
"and",
"dispatching",
"a",
"thread",
"pool",
"<p",
">",
"Unfortunately",
"we",
"need",
"to",
"dispatch",
"to",
"a",
"thread",
"pool",
"because",
"there",
"is",
"a",
"good",
"cha... | train | https://github.com/undertow-io/undertow/blob/87de0b856a7a4ba8faf5b659537b9af07b763263/websockets-jsr/src/main/java/io/undertow/websockets/jsr/ServerWebSocketContainer.java#L585-L596 |
Impetus/Kundera | src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientFactory.java | DSClientFactory.getPolicyInstance | private LoadBalancingPolicy getPolicyInstance(BalancingPolicy policy, Properties conProperties) {
"""
Gets the policy instance.
@param policy
the policy
@param conProperties
the con properties
@return the policy instance
"""
LoadBalancingPolicy loadBalancingPolicy = null;
String isToken... | java | private LoadBalancingPolicy getPolicyInstance(BalancingPolicy policy, Properties conProperties)
{
LoadBalancingPolicy loadBalancingPolicy = null;
String isTokenAware = (String) conProperties.get("isTokenAware");
String isLatencyAware = (String) conProperties.get("isLatencyAware");
S... | [
"private",
"LoadBalancingPolicy",
"getPolicyInstance",
"(",
"BalancingPolicy",
"policy",
",",
"Properties",
"conProperties",
")",
"{",
"LoadBalancingPolicy",
"loadBalancingPolicy",
"=",
"null",
";",
"String",
"isTokenAware",
"=",
"(",
"String",
")",
"conProperties",
"."... | Gets the policy instance.
@param policy
the policy
@param conProperties
the con properties
@return the policy instance | [
"Gets",
"the",
"policy",
"instance",
"."
] | train | https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-cassandra/cassandra-ds-driver/src/main/java/com/impetus/kundera/client/cassandra/dsdriver/DSClientFactory.java#L485-L549 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.