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 |
|---|---|---|---|---|---|---|---|---|---|---|
Azure/azure-sdk-for-java | mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ConfigurationsInner.java | ConfigurationsInner.getAsync | public Observable<ConfigurationInner> getAsync(String resourceGroupName, String serverName, String configurationName) {
"""
Gets information about a configuration of server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Mana... | java | public Observable<ConfigurationInner> getAsync(String resourceGroupName, String serverName, String configurationName) {
return getWithServiceResponseAsync(resourceGroupName, serverName, configurationName).map(new Func1<ServiceResponse<ConfigurationInner>, ConfigurationInner>() {
@Override
... | [
"public",
"Observable",
"<",
"ConfigurationInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"serverName",
",",
"String",
"configurationName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"serverName",
",",
... | Gets information about a configuration of server.
@param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal.
@param serverName The name of the server.
@param configurationName The name of the server configuration.
@th... | [
"Gets",
"information",
"about",
"a",
"configuration",
"of",
"server",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/mysql/resource-manager/v2017_12_01/src/main/java/com/microsoft/azure/management/mysql/v2017_12_01/implementation/ConfigurationsInner.java#L300-L307 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCircuitPeeringsInner.java | ExpressRouteCircuitPeeringsInner.beginCreateOrUpdateAsync | public Observable<ExpressRouteCircuitPeeringInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) {
"""
Creates or updates a peering in the specified express route circuits.
@param resourceGroupName The name of the re... | java | public Observable<ExpressRouteCircuitPeeringInner> beginCreateOrUpdateAsync(String resourceGroupName, String circuitName, String peeringName, ExpressRouteCircuitPeeringInner peeringParameters) {
return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, circuitName, peeringName, peeringParameters).ma... | [
"public",
"Observable",
"<",
"ExpressRouteCircuitPeeringInner",
">",
"beginCreateOrUpdateAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"circuitName",
",",
"String",
"peeringName",
",",
"ExpressRouteCircuitPeeringInner",
"peeringParameters",
")",
"{",
"return",
... | Creates or updates a peering in the specified express route circuits.
@param resourceGroupName The name of the resource group.
@param circuitName The name of the express route circuit.
@param peeringName The name of the peering.
@param peeringParameters Parameters supplied to the create or update express route circuit... | [
"Creates",
"or",
"updates",
"a",
"peering",
"in",
"the",
"specified",
"express",
"route",
"circuits",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ExpressRouteCircuitPeeringsInner.java#L473-L480 |
JodaOrg/joda-time | src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java | DateTimeFormatterBuilder.appendFraction | public DateTimeFormatterBuilder appendFraction(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
"""
Instructs the printer to emit a remainder of time as a decimal fraction,
without decimal point. For example, if the field is specified as
minuteOfHour and the time is 12:30:45, the value p... | java | public DateTimeFormatterBuilder appendFraction(
DateTimeFieldType fieldType, int minDigits, int maxDigits) {
if (fieldType == null) {
throw new IllegalArgumentException("Field type must not be null");
}
if (maxDigits < minDigits) {
maxDigits = minDigits;
... | [
"public",
"DateTimeFormatterBuilder",
"appendFraction",
"(",
"DateTimeFieldType",
"fieldType",
",",
"int",
"minDigits",
",",
"int",
"maxDigits",
")",
"{",
"if",
"(",
"fieldType",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Field type ... | Instructs the printer to emit a remainder of time as a decimal fraction,
without decimal point. For example, if the field is specified as
minuteOfHour and the time is 12:30:45, the value printed is 75. A
decimal point is implied, so the fraction is 0.75, or three-quarters of
a minute.
@param fieldType type of field t... | [
"Instructs",
"the",
"printer",
"to",
"emit",
"a",
"remainder",
"of",
"time",
"as",
"a",
"decimal",
"fraction",
"without",
"decimal",
"point",
".",
"For",
"example",
"if",
"the",
"field",
"is",
"specified",
"as",
"minuteOfHour",
"and",
"the",
"time",
"is",
... | train | https://github.com/JodaOrg/joda-time/blob/bd79f1c4245e79b3c2c56d7b04fde2a6e191fa42/src/main/java/org/joda/time/format/DateTimeFormatterBuilder.java#L569-L581 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java | ApplicationGatewaysInner.beginBackendHealthAsync | public Observable<ApplicationGatewayBackendHealthInner> beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) {
"""
Gets the backend health of the specified application gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param applica... | java | public Observable<ApplicationGatewayBackendHealthInner> beginBackendHealthAsync(String resourceGroupName, String applicationGatewayName, String expand) {
return beginBackendHealthWithServiceResponseAsync(resourceGroupName, applicationGatewayName, expand).map(new Func1<ServiceResponse<ApplicationGatewayBackendHe... | [
"public",
"Observable",
"<",
"ApplicationGatewayBackendHealthInner",
">",
"beginBackendHealthAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"applicationGatewayName",
",",
"String",
"expand",
")",
"{",
"return",
"beginBackendHealthWithServiceResponseAsync",
"(",
"r... | Gets the backend health of the specified application gateway in a resource group.
@param resourceGroupName The name of the resource group.
@param applicationGatewayName The name of the application gateway.
@param expand Expands BackendAddressPool and BackendHttpSettings referenced in backend health.
@throws IllegalArg... | [
"Gets",
"the",
"backend",
"health",
"of",
"the",
"specified",
"application",
"gateway",
"in",
"a",
"resource",
"group",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/ApplicationGatewaysInner.java#L1649-L1656 |
elki-project/elki | elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTreeNode.java | AbstractMTreeNode.integrityCheckParameters | protected void integrityCheckParameters(E parentEntry, N parent, int index, AbstractMTree<O, N, E, ?> mTree) {
"""
Tests, if the parameters of the entry representing this node, are correctly
set. Subclasses may need to overwrite this method.
@param parentEntry the entry representing the parent
@param parent t... | java | protected void integrityCheckParameters(E parentEntry, N parent, int index, AbstractMTree<O, N, E, ?> mTree) {
// test if parent distance is correctly set
E entry = parent.getEntry(index);
double parentDistance = mTree.distance(entry.getRoutingObjectID(), parentEntry.getRoutingObjectID());
if(Math.abs(e... | [
"protected",
"void",
"integrityCheckParameters",
"(",
"E",
"parentEntry",
",",
"N",
"parent",
",",
"int",
"index",
",",
"AbstractMTree",
"<",
"O",
",",
"N",
",",
"E",
",",
"?",
">",
"mTree",
")",
"{",
"// test if parent distance is correctly set",
"E",
"entry"... | Tests, if the parameters of the entry representing this node, are correctly
set. Subclasses may need to overwrite this method.
@param parentEntry the entry representing the parent
@param parent the parent holding the entry representing this node
@param index the index of the entry in the parents child arry
@param mTre... | [
"Tests",
"if",
"the",
"parameters",
"of",
"the",
"entry",
"representing",
"this",
"node",
"are",
"correctly",
"set",
".",
"Subclasses",
"may",
"need",
"to",
"overwrite",
"this",
"method",
"."
] | train | https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-index-mtree/src/main/java/de/lmu/ifi/dbs/elki/index/tree/metrical/mtreevariants/AbstractMTreeNode.java#L168-L182 |
jronrun/benayn | benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java | FindingReplacing.setBetn | public S setBetn(int leftIndex, int rightIndex) {
"""
Sets the substring in given left index and right index as the delegate string
@param leftIndex
@param rightIndex
@return
"""
return set(Indexer.of(delegate.get()).between(leftIndex, rightIndex));
} | java | public S setBetn(int leftIndex, int rightIndex) {
return set(Indexer.of(delegate.get()).between(leftIndex, rightIndex));
} | [
"public",
"S",
"setBetn",
"(",
"int",
"leftIndex",
",",
"int",
"rightIndex",
")",
"{",
"return",
"set",
"(",
"Indexer",
".",
"of",
"(",
"delegate",
".",
"get",
"(",
")",
")",
".",
"between",
"(",
"leftIndex",
",",
"rightIndex",
")",
")",
";",
"}"
] | Sets the substring in given left index and right index as the delegate string
@param leftIndex
@param rightIndex
@return | [
"Sets",
"the",
"substring",
"in",
"given",
"left",
"index",
"and",
"right",
"index",
"as",
"the",
"delegate",
"string"
] | train | https://github.com/jronrun/benayn/blob/7585152e10e4cac07b4274c65f1c72ad7061ae69/benayn-ustyle/src/main/java/com/benayn/ustyle/string/FindingReplacing.java#L314-L316 |
Azure/azure-sdk-for-java | network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java | VpnConnectionsInner.getAsync | public Observable<VpnConnectionInner> getAsync(String resourceGroupName, String gatewayName, String connectionName) {
"""
Retrieves the details of a vpn connection.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@param connectionName The name of... | java | public Observable<VpnConnectionInner> getAsync(String resourceGroupName, String gatewayName, String connectionName) {
return getWithServiceResponseAsync(resourceGroupName, gatewayName, connectionName).map(new Func1<ServiceResponse<VpnConnectionInner>, VpnConnectionInner>() {
@Override
pu... | [
"public",
"Observable",
"<",
"VpnConnectionInner",
">",
"getAsync",
"(",
"String",
"resourceGroupName",
",",
"String",
"gatewayName",
",",
"String",
"connectionName",
")",
"{",
"return",
"getWithServiceResponseAsync",
"(",
"resourceGroupName",
",",
"gatewayName",
",",
... | Retrieves the details of a vpn connection.
@param resourceGroupName The resource group name of the VpnGateway.
@param gatewayName The name of the gateway.
@param connectionName The name of the vpn connection.
@throws IllegalArgumentException thrown if parameters fail the validation
@return the observable to the VpnCon... | [
"Retrieves",
"the",
"details",
"of",
"a",
"vpn",
"connection",
"."
] | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_04_01/src/main/java/com/microsoft/azure/management/network/v2018_04_01/implementation/VpnConnectionsInner.java#L132-L139 |
Jasig/uPortal | uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/SmartCache.java | SmartCache.put | public synchronized Object put(Object key, Object value, long lCacheInterval) {
"""
Add a new value to the cache
@param key the key, typically a String
@param value the value
@param lCacheInterval an expiration timeout value, in seconds, which will override the
default cache value just for this item. If a ne... | java | public synchronized Object put(Object key, Object value, long lCacheInterval) {
ValueWrapper valueWrapper = new ValueWrapper(value, lCacheInterval);
return super.put(key, valueWrapper);
} | [
"public",
"synchronized",
"Object",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
",",
"long",
"lCacheInterval",
")",
"{",
"ValueWrapper",
"valueWrapper",
"=",
"new",
"ValueWrapper",
"(",
"value",
",",
"lCacheInterval",
")",
";",
"return",
"super",
".",... | Add a new value to the cache
@param key the key, typically a String
@param value the value
@param lCacheInterval an expiration timeout value, in seconds, which will override the
default cache value just for this item. If a negative timeout value is specified, the
value will be cached indefinitely.
@return the cached o... | [
"Add",
"a",
"new",
"value",
"to",
"the",
"cache"
] | train | https://github.com/Jasig/uPortal/blob/c1986542abb9acd214268f2df21c6305ad2f262b/uPortal-utils/uPortal-utils-core/src/main/java/org/apereo/portal/utils/SmartCache.java#L96-L99 |
apache/reef | lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/transport/netty/LoggingLinkListener.java | LoggingLinkListener.onException | @Override
public void onException(final Throwable cause, final SocketAddress remoteAddress, final T message) {
"""
Called when the sent message to remoteAddress is failed to be transferred.
"""
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "Error sending message " + message + " to " + r... | java | @Override
public void onException(final Throwable cause, final SocketAddress remoteAddress, final T message) {
if (LOG.isLoggable(Level.FINEST)) {
LOG.log(Level.FINEST, "Error sending message " + message + " to " + remoteAddress, cause);
}
} | [
"@",
"Override",
"public",
"void",
"onException",
"(",
"final",
"Throwable",
"cause",
",",
"final",
"SocketAddress",
"remoteAddress",
",",
"final",
"T",
"message",
")",
"{",
"if",
"(",
"LOG",
".",
"isLoggable",
"(",
"Level",
".",
"FINEST",
")",
")",
"{",
... | Called when the sent message to remoteAddress is failed to be transferred. | [
"Called",
"when",
"the",
"sent",
"message",
"to",
"remoteAddress",
"is",
"failed",
"to",
"be",
"transferred",
"."
] | train | https://github.com/apache/reef/blob/e2c47121cde21108a602c560cf76565a40d0e916/lang/java/reef-wake/wake/src/main/java/org/apache/reef/wake/remote/transport/netty/LoggingLinkListener.java#L47-L52 |
Pixplicity/EasyPrefs | library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java | Prefs.getString | public static String getString(final String key, final String defValue) {
"""
Retrieves a stored String value.
@param key The name of the preference to retrieve.
@param defValue Value to return if this preference does not exist.
@return Returns the preference value if it exists, or defValue.
@throws Cla... | java | public static String getString(final String key, final String defValue) {
return getPreferences().getString(key, defValue);
} | [
"public",
"static",
"String",
"getString",
"(",
"final",
"String",
"key",
",",
"final",
"String",
"defValue",
")",
"{",
"return",
"getPreferences",
"(",
")",
".",
"getString",
"(",
"key",
",",
"defValue",
")",
";",
"}"
] | Retrieves a stored String value.
@param key The name of the preference to retrieve.
@param defValue Value to return if this preference does not exist.
@return Returns the preference value if it exists, or defValue.
@throws ClassCastException if there is a preference with this name that is not a String.
@see andro... | [
"Retrieves",
"a",
"stored",
"String",
"value",
"."
] | train | https://github.com/Pixplicity/EasyPrefs/blob/0ca13a403bf099019a13d68b38edcf55fca5a653/library/src/main/java/com/pixplicity/easyprefs/library/Prefs.java#L200-L202 |
jfinal/jfinal | src/main/java/com/jfinal/plugin/redis/Cache.java | Cache.migrate | public String migrate(String host, int port, Object key, int destinationDb, int timeout) {
"""
将 key 原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功, key 保证会出现在目标实例上,而当前实例上的 key 会被删除。
"""
Jedis jedis = getJedis();
try {
return jedis.migrate(valueToBytes(host), port, keyToBytes(key), destinationDb, timeout);
}
f... | java | public String migrate(String host, int port, Object key, int destinationDb, int timeout) {
Jedis jedis = getJedis();
try {
return jedis.migrate(valueToBytes(host), port, keyToBytes(key), destinationDb, timeout);
}
finally {close(jedis);}
} | [
"public",
"String",
"migrate",
"(",
"String",
"host",
",",
"int",
"port",
",",
"Object",
"key",
",",
"int",
"destinationDb",
",",
"int",
"timeout",
")",
"{",
"Jedis",
"jedis",
"=",
"getJedis",
"(",
")",
";",
"try",
"{",
"return",
"jedis",
".",
"migrate... | 将 key 原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功, key 保证会出现在目标实例上,而当前实例上的 key 会被删除。 | [
"将",
"key",
"原子性地从当前实例传送到目标实例的指定数据库上,一旦传送成功,",
"key",
"保证会出现在目标实例上,而当前实例上的",
"key",
"会被删除。"
] | train | https://github.com/jfinal/jfinal/blob/fc07f0f5d56e85ccd3cfcdd587b56b8dd9c663e9/src/main/java/com/jfinal/plugin/redis/Cache.java#L289-L295 |
axibase/atsd-api-java | src/main/java/com/axibase/tsd/client/MetaDataService.java | MetaDataService.retrieveMetricSeries | public List<Series> retrieveMetricSeries(String metricName, String entityName) {
"""
Retrieve series list of the specified metric
@param metricName metric name
@param entityName entity name's filter
@return list of series
"""
return retrieveMetricSeries(metricName, Collections.singletonMap("entity... | java | public List<Series> retrieveMetricSeries(String metricName, String entityName) {
return retrieveMetricSeries(metricName, Collections.singletonMap("entity", entityName));
} | [
"public",
"List",
"<",
"Series",
">",
"retrieveMetricSeries",
"(",
"String",
"metricName",
",",
"String",
"entityName",
")",
"{",
"return",
"retrieveMetricSeries",
"(",
"metricName",
",",
"Collections",
".",
"singletonMap",
"(",
"\"entity\"",
",",
"entityName",
")... | Retrieve series list of the specified metric
@param metricName metric name
@param entityName entity name's filter
@return list of series | [
"Retrieve",
"series",
"list",
"of",
"the",
"specified",
"metric"
] | train | https://github.com/axibase/atsd-api-java/blob/63a0767d08b202dad2ebef4372ff947d6fba0246/src/main/java/com/axibase/tsd/client/MetaDataService.java#L596-L598 |
radkovo/jStyleParser | src/main/java/cz/vutbr/web/csskit/antlr4/CSSLexerState.java | CSSLexerState.isBalanced | public boolean isBalanced(RecoveryMode mode, CSSLexerState state, CSSToken t) {
"""
Checks whether some pair characters are balanced. Modes are:
<ul>
<li>BALANCED - everything must be balanced: single and double quotatation marks, curly braces, parentheses
<li>FUNCTION - within the function arguments: parenthes... | java | public boolean isBalanced(RecoveryMode mode, CSSLexerState state, CSSToken t) {
if (mode == RecoveryMode.BALANCED)
return !aposOpen && !quotOpen && curlyNest == 0 && parenNest == 0 && sqNest == 0;
else if (mode == RecoveryMode.FUNCTION)
return parenNest == 0 && sqNest == 0;
... | [
"public",
"boolean",
"isBalanced",
"(",
"RecoveryMode",
"mode",
",",
"CSSLexerState",
"state",
",",
"CSSToken",
"t",
")",
"{",
"if",
"(",
"mode",
"==",
"RecoveryMode",
".",
"BALANCED",
")",
"return",
"!",
"aposOpen",
"&&",
"!",
"quotOpen",
"&&",
"curlyNest",... | Checks whether some pair characters are balanced. Modes are:
<ul>
<li>BALANCED - everything must be balanced: single and double quotatation marks, curly braces, parentheses
<li>FUNCTION - within the function arguments: parentheses must be balanced
<li>RULE - within the CSS rule: all but curly braces
<li>DECL - within d... | [
"Checks",
"whether",
"some",
"pair",
"characters",
"are",
"balanced",
".",
"Modes",
"are",
":",
"<ul",
">",
"<li",
">",
"BALANCED",
"-",
"everything",
"must",
"be",
"balanced",
":",
"single",
"and",
"double",
"quotatation",
"marks",
"curly",
"braces",
"paren... | train | https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/antlr4/CSSLexerState.java#L69-L83 |
iig-uni-freiburg/SEWOL | src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java | ProcessContext.setDataFor | public void setDataFor(String activity, Set<String> attributes) throws CompatibilityException {
"""
Sets the data attributes used by the given activity.<br>
The given activity/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param activity Activity for which the a... | java | public void setDataFor(String activity, Set<String> attributes) throws CompatibilityException {
validateActivity(activity);
validateAttributes(attributes);
if (!attributes.isEmpty()) {
Map<String, Set<DataUsage>> dataUsage = new HashMap<>();
... | [
"public",
"void",
"setDataFor",
"(",
"String",
"activity",
",",
"Set",
"<",
"String",
">",
"attributes",
")",
"throws",
"CompatibilityException",
"{",
"validateActivity",
"(",
"activity",
")",
";",
"validateAttributes",
"(",
"attributes",
")",
";",
"if",
"(",
... | Sets the data attributes used by the given activity.<br>
The given activity/attributes have to be known by the context, i.e.
be contained in the activity/attribute list.
@param activity Activity for which the attribute usage is set.
@param attributes Attributes used as input by the given activity.
@throws ParameterExc... | [
"Sets",
"the",
"data",
"attributes",
"used",
"by",
"the",
"given",
"activity",
".",
"<br",
">",
"The",
"given",
"activity",
"/",
"attributes",
"have",
"to",
"be",
"known",
"by",
"the",
"context",
"i",
".",
"e",
".",
"be",
"contained",
"in",
"the",
"act... | train | https://github.com/iig-uni-freiburg/SEWOL/blob/e791cb07a6e62ecf837d760d58a25f32fbf6bbca/src/de/uni/freiburg/iig/telematik/sewol/context/process/ProcessContext.java#L558-L568 |
citrusframework/citrus | modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java | AbstractMessageActionParser.parseExtractHeaderElements | protected void parseExtractHeaderElements(Element element, List<VariableExtractor> variableExtractors) {
"""
Parses header extract information.
@param element the root action element.
@param variableExtractors the variable extractors to add new extractors to.
"""
Element extractElement = DomUtils.get... | java | protected void parseExtractHeaderElements(Element element, List<VariableExtractor> variableExtractors) {
Element extractElement = DomUtils.getChildElementByTagName(element, "extract");
Map<String, String> extractHeaderValues = new HashMap<>();
if (extractElement != null) {
List<?> he... | [
"protected",
"void",
"parseExtractHeaderElements",
"(",
"Element",
"element",
",",
"List",
"<",
"VariableExtractor",
">",
"variableExtractors",
")",
"{",
"Element",
"extractElement",
"=",
"DomUtils",
".",
"getChildElementByTagName",
"(",
"element",
",",
"\"extract\"",
... | Parses header extract information.
@param element the root action element.
@param variableExtractors the variable extractors to add new extractors to. | [
"Parses",
"header",
"extract",
"information",
"."
] | train | https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-core/src/main/java/com/consol/citrus/config/xml/AbstractMessageActionParser.java#L255-L272 |
OpenLiberty/open-liberty | dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java | HashtableOnDisk.put | public synchronized HashtableEntry put(Object key, Object value, int len, long expirationTime, long validatorExpirationTime,
byte[] serializedKey, byte[] serializedCacheValue, int valueHashcode, boolean isAliasId) // LI4337-17
throws IOException,
EOFExc... | java | public synchronized HashtableEntry put(Object key, Object value, int len, long expirationTime, long validatorExpirationTime,
byte[] serializedKey, byte[] serializedCacheValue, int valueHashcode, boolean isAliasId) // LI4337-17
throws IOException,
EOFExc... | [
"public",
"synchronized",
"HashtableEntry",
"put",
"(",
"Object",
"key",
",",
"Object",
"value",
",",
"int",
"len",
",",
"long",
"expirationTime",
",",
"long",
"validatorExpirationTime",
",",
"byte",
"[",
"]",
"serializedKey",
",",
"byte",
"[",
"]",
"serialize... | ************************************************************************
Associates the object with the key and stores it. If an object already
exists for this key it is replaced and the previous object discard. The
object is assumed to have been "manually" serialized by the caller and will
be written up to length "len... | [
"************************************************************************",
"Associates",
"the",
"object",
"with",
"the",
"key",
"and",
"stores",
"it",
".",
"If",
"an",
"object",
"already",
"exists",
"for",
"this",
"key",
"it",
"is",
"replaced",
"and",
"the",
"previou... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.dynacache/src/com/ibm/ws/cache/persistent/htod/HashtableOnDisk.java#L885-L897 |
RestComm/jss7 | map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java | MAPProviderImpl.fireTCAbortV1 | protected void fireTCAbortV1(Dialog tcapDialog, boolean returnMessageOnError) throws MAPException {
"""
Issue TC-U-ABORT without any apdu - for MAP V1
@param tcapDialog
@param returnMessageOnError
@throws MAPException
"""
if (this.getTCAPProvider().getPreviewMode()) {
return;
... | java | protected void fireTCAbortV1(Dialog tcapDialog, boolean returnMessageOnError) throws MAPException {
if (this.getTCAPProvider().getPreviewMode()) {
return;
}
TCUserAbortRequest tcUserAbort = this.getTCAPProvider().getDialogPrimitiveFactory().createUAbort(tcapDialog);
if (ret... | [
"protected",
"void",
"fireTCAbortV1",
"(",
"Dialog",
"tcapDialog",
",",
"boolean",
"returnMessageOnError",
")",
"throws",
"MAPException",
"{",
"if",
"(",
"this",
".",
"getTCAPProvider",
"(",
")",
".",
"getPreviewMode",
"(",
")",
")",
"{",
"return",
";",
"}",
... | Issue TC-U-ABORT without any apdu - for MAP V1
@param tcapDialog
@param returnMessageOnError
@throws MAPException | [
"Issue",
"TC",
"-",
"U",
"-",
"ABORT",
"without",
"any",
"apdu",
"-",
"for",
"MAP",
"V1"
] | train | https://github.com/RestComm/jss7/blob/402b4b3984e581c581e309cb5f6a858fde6dbc33/map/map-impl/src/main/java/org/restcomm/protocols/ss7/map/MAPProviderImpl.java#L2139-L2154 |
apache/incubator-gobblin | gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/RequesterService.java | RequesterService.deserialize | public static List<ServiceRequester> deserialize(String encodedString) throws IOException {
"""
<p> This implementation decode a given string encoded by
{@link #serialize(List)}.
"""
String base64Str = URLDecoder.decode(encodedString, "UTF-8");
byte[] decodedBytes = Base64.getDecoder().decode(base64St... | java | public static List<ServiceRequester> deserialize(String encodedString) throws IOException {
String base64Str = URLDecoder.decode(encodedString, "UTF-8");
byte[] decodedBytes = Base64.getDecoder().decode(base64Str);
String jsonList = new String(decodedBytes, "UTF-8");
TypeReference<List<ServiceRequester>... | [
"public",
"static",
"List",
"<",
"ServiceRequester",
">",
"deserialize",
"(",
"String",
"encodedString",
")",
"throws",
"IOException",
"{",
"String",
"base64Str",
"=",
"URLDecoder",
".",
"decode",
"(",
"encodedString",
",",
"\"UTF-8\"",
")",
";",
"byte",
"[",
... | <p> This implementation decode a given string encoded by
{@link #serialize(List)}. | [
"<p",
">",
"This",
"implementation",
"decode",
"a",
"given",
"string",
"encoded",
"by",
"{"
] | train | https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-restli/gobblin-flow-config-service/gobblin-flow-config-service-server/src/main/java/org/apache/gobblin/service/RequesterService.java#L61-L68 |
google/j2objc | jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java | IDNA.convertIDNToASCII | @Deprecated
public static StringBuffer convertIDNToASCII(String src,int options)
throws StringPrepParseException {
"""
IDNA2003: Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".
It is... | java | @Deprecated
public static StringBuffer convertIDNToASCII(String src,int options)
throws StringPrepParseException{
return IDNA2003.convertIDNToASCII(src, options);
} | [
"@",
"Deprecated",
"public",
"static",
"StringBuffer",
"convertIDNToASCII",
"(",
"String",
"src",
",",
"int",
"options",
")",
"throws",
"StringPrepParseException",
"{",
"return",
"IDNA2003",
".",
"convertIDNToASCII",
"(",
"src",
",",
"options",
")",
";",
"}"
] | IDNA2003: Convenience function that implements the IDNToASCII operation as defined in the IDNA RFC.
This operation is done on complete domain names, e.g: "www.example.com".
It is important to note that this operation can fail. If it fails, then the input
domain name cannot be used as an Internationalized Domain Name an... | [
"IDNA2003",
":",
"Convenience",
"function",
"that",
"implements",
"the",
"IDNToASCII",
"operation",
"as",
"defined",
"in",
"the",
"IDNA",
"RFC",
".",
"This",
"operation",
"is",
"done",
"on",
"complete",
"domain",
"names",
"e",
".",
"g",
":",
"www",
".",
"e... | train | https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/IDNA.java#L651-L655 |
leancloud/java-sdk-all | android-sdk/mixpush-android/src/main/java/cn/leancloud/AVMixPushManager.java | AVMixPushManager.registerXiaomiPush | public static void registerXiaomiPush(Context context, String miAppId, String miAppKey, String profile) {
"""
注册小米推送
只有 appId、appKey 有效 且 MIUI 且 manifest 正确填写 才能注册
@param context
@param miAppId
@param miAppKey
@param profile 小米推送配置
"""
if (null == context) {
throw new IllegalArgumentException... | java | public static void registerXiaomiPush(Context context, String miAppId, String miAppKey, String profile) {
if (null == context) {
throw new IllegalArgumentException("context cannot be null.");
}
if (StringUtil.isEmpty(miAppId)) {
throw new IllegalArgumentException("miAppId cannot be null.");
... | [
"public",
"static",
"void",
"registerXiaomiPush",
"(",
"Context",
"context",
",",
"String",
"miAppId",
",",
"String",
"miAppKey",
",",
"String",
"profile",
")",
"{",
"if",
"(",
"null",
"==",
"context",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",... | 注册小米推送
只有 appId、appKey 有效 且 MIUI 且 manifest 正确填写 才能注册
@param context
@param miAppId
@param miAppKey
@param profile 小米推送配置 | [
"注册小米推送",
"只有",
"appId、appKey",
"有效",
"且",
"MIUI",
"且",
"manifest",
"正确填写",
"才能注册"
] | train | https://github.com/leancloud/java-sdk-all/blob/323f8e7ee38051b1350790e5192304768c5c9f5f/android-sdk/mixpush-android/src/main/java/cn/leancloud/AVMixPushManager.java#L64-L92 |
craterdog/java-smart-objects | src/main/java/craterdog/smart/SmartObjectMapper.java | SmartObjectMapper.writeValueAsString | String writeValueAsString(Object value, String indentation) throws JsonProcessingException {
"""
This method behaves similarly to the <code>writeValueAsString(Object value)</code> method
except that it includes an indentation prefix that will be prepended to each line of the
resulting string (except the first li... | java | String writeValueAsString(Object value, String indentation) throws JsonProcessingException {
PrettyPrinter printer = new BetterPrettyPrinter(indentation).withArrayIndenter(new DefaultIndenter());
return writer(printer).writeValueAsString(value);
} | [
"String",
"writeValueAsString",
"(",
"Object",
"value",
",",
"String",
"indentation",
")",
"throws",
"JsonProcessingException",
"{",
"PrettyPrinter",
"printer",
"=",
"new",
"BetterPrettyPrinter",
"(",
"indentation",
")",
".",
"withArrayIndenter",
"(",
"new",
"DefaultI... | This method behaves similarly to the <code>writeValueAsString(Object value)</code> method
except that it includes an indentation prefix that will be prepended to each line of the
resulting string (except the first line).
@param value The smart object to be written out as a string.
@param indentation The indentation st... | [
"This",
"method",
"behaves",
"similarly",
"to",
"the",
"<code",
">",
"writeValueAsString",
"(",
"Object",
"value",
")",
"<",
"/",
"code",
">",
"method",
"except",
"that",
"it",
"includes",
"an",
"indentation",
"prefix",
"that",
"will",
"be",
"prepended",
"to... | train | https://github.com/craterdog/java-smart-objects/blob/6d11e2f345e4d2836e3aca3990c8ed2db330d856/src/main/java/craterdog/smart/SmartObjectMapper.java#L91-L94 |
xmlet/XsdAsmFaster | src/main/java/org/xmlet/xsdasmfaster/classes/infrastructure/RestrictionValidator.java | RestrictionValidator.validateFractionDigits | public static void validateFractionDigits(int fractionDigits, double value) {
"""
Validates the number of fraction digits present in the {@code value} received.
@param fractionDigits The allowed number of fraction digits.
@param value The {@link Double} to be validated.
"""
if (value != ((int) value)... | java | public static void validateFractionDigits(int fractionDigits, double value){
if (value != ((int) value)){
String doubleValue = String.valueOf(value);
int numberOfFractionDigits = doubleValue.substring(doubleValue.indexOf(',')).length();
if (numberOfFractionDigits > fraction... | [
"public",
"static",
"void",
"validateFractionDigits",
"(",
"int",
"fractionDigits",
",",
"double",
"value",
")",
"{",
"if",
"(",
"value",
"!=",
"(",
"(",
"int",
")",
"value",
")",
")",
"{",
"String",
"doubleValue",
"=",
"String",
".",
"valueOf",
"(",
"va... | Validates the number of fraction digits present in the {@code value} received.
@param fractionDigits The allowed number of fraction digits.
@param value The {@link Double} to be validated. | [
"Validates",
"the",
"number",
"of",
"fraction",
"digits",
"present",
"in",
"the",
"{"
] | train | https://github.com/xmlet/XsdAsmFaster/blob/ccb78f9dd4b957ad5ac1ca349eaf24338c421e94/src/main/java/org/xmlet/xsdasmfaster/classes/infrastructure/RestrictionValidator.java#L18-L28 |
apache/incubator-heron | storm-compatibility/src/java/org/apache/storm/utils/ConfigUtils.java | ConfigUtils.translateConfig | @SuppressWarnings( {
"""
Translate storm config to heron config for topology
@param stormConfig the storm config
@return a heron config
""""rawtypes", "unchecked"})
public static Config translateConfig(Map stormConfig) {
Config heronConfig;
if (stormConfig != null) {
heronConfig = new Config(... | java | @SuppressWarnings({"rawtypes", "unchecked"})
public static Config translateConfig(Map stormConfig) {
Config heronConfig;
if (stormConfig != null) {
heronConfig = new Config((Map<String, Object>) stormConfig);
} else {
heronConfig = new Config();
}
// Look at serialization stuff first
... | [
"@",
"SuppressWarnings",
"(",
"{",
"\"rawtypes\"",
",",
"\"unchecked\"",
"}",
")",
"public",
"static",
"Config",
"translateConfig",
"(",
"Map",
"stormConfig",
")",
"{",
"Config",
"heronConfig",
";",
"if",
"(",
"stormConfig",
"!=",
"null",
")",
"{",
"heronConfi... | Translate storm config to heron config for topology
@param stormConfig the storm config
@return a heron config | [
"Translate",
"storm",
"config",
"to",
"heron",
"config",
"for",
"topology"
] | train | https://github.com/apache/incubator-heron/blob/776abe2b5a45b93a0eb957fd65cbc149d901a92a/storm-compatibility/src/java/org/apache/storm/utils/ConfigUtils.java#L38-L58 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/BasePanel.java | BasePanel.selectField | public void selectField(ScreenField sfCurrent, int iSelectField) {
"""
Move the focus to the next logical field.
@param sfCurrent The currently selected screen field.
@param iSelectField The screen field to select (next/prev/first/last).
"""
ScreenField sField = this.getComponentAfter(sfCurrent, iSel... | java | public void selectField(ScreenField sfCurrent, int iSelectField)
{
ScreenField sField = this.getComponentAfter(sfCurrent, iSelectField);
if (sField != null)
sField.requestFocus();
} | [
"public",
"void",
"selectField",
"(",
"ScreenField",
"sfCurrent",
",",
"int",
"iSelectField",
")",
"{",
"ScreenField",
"sField",
"=",
"this",
".",
"getComponentAfter",
"(",
"sfCurrent",
",",
"iSelectField",
")",
";",
"if",
"(",
"sField",
"!=",
"null",
")",
"... | Move the focus to the next logical field.
@param sfCurrent The currently selected screen field.
@param iSelectField The screen field to select (next/prev/first/last). | [
"Move",
"the",
"focus",
"to",
"the",
"next",
"logical",
"field",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/BasePanel.java#L1219-L1224 |
liferay/com-liferay-commerce | commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceRegionUtil.java | CommerceRegionUtil.removeByC_C | public static CommerceRegion removeByC_C(long commerceCountryId, String code)
throws com.liferay.commerce.exception.NoSuchRegionException {
"""
Removes the commerce region where commerceCountryId = ? and code = ? from the database.
@param commerceCountryId the commerce country ID
@param code the code... | java | public static CommerceRegion removeByC_C(long commerceCountryId, String code)
throws com.liferay.commerce.exception.NoSuchRegionException {
return getPersistence().removeByC_C(commerceCountryId, code);
} | [
"public",
"static",
"CommerceRegion",
"removeByC_C",
"(",
"long",
"commerceCountryId",
",",
"String",
"code",
")",
"throws",
"com",
".",
"liferay",
".",
"commerce",
".",
"exception",
".",
"NoSuchRegionException",
"{",
"return",
"getPersistence",
"(",
")",
".",
"... | Removes the commerce region where commerceCountryId = ? and code = ? from the database.
@param commerceCountryId the commerce country ID
@param code the code
@return the commerce region that was removed | [
"Removes",
"the",
"commerce",
"region",
"where",
"commerceCountryId",
"=",
"?",
";",
"and",
"code",
"=",
"?",
";",
"from",
"the",
"database",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/persistence/CommerceRegionUtil.java#L724-L727 |
DataSketches/sketches-core | src/main/java/com/yahoo/sketches/fdt/FdtSketch.java | FdtSketch.getResult | public List<Group> getResult(final int[] priKeyIndices, final int limit, final int numStdDev,
final char sep) {
"""
Returns an ordered List of Groups of the most frequent distinct population of subset tuples
represented by the count of entries of each group.
@param priKeyIndices these indices define the di... | java | public List<Group> getResult(final int[] priKeyIndices, final int limit, final int numStdDev,
final char sep) {
final PostProcessor proc = new PostProcessor(this, new Group(), sep);
return proc.getGroupList(priKeyIndices, numStdDev, limit);
} | [
"public",
"List",
"<",
"Group",
">",
"getResult",
"(",
"final",
"int",
"[",
"]",
"priKeyIndices",
",",
"final",
"int",
"limit",
",",
"final",
"int",
"numStdDev",
",",
"final",
"char",
"sep",
")",
"{",
"final",
"PostProcessor",
"proc",
"=",
"new",
"PostPr... | Returns an ordered List of Groups of the most frequent distinct population of subset tuples
represented by the count of entries of each group.
@param priKeyIndices these indices define the dimensions used for the Primary Keys.
@param limit the maximum number of groups to return. If this value is ≤ 0, all
groups will... | [
"Returns",
"an",
"ordered",
"List",
"of",
"Groups",
"of",
"the",
"most",
"frequent",
"distinct",
"population",
"of",
"subset",
"tuples",
"represented",
"by",
"the",
"count",
"of",
"entries",
"of",
"each",
"group",
"."
] | train | https://github.com/DataSketches/sketches-core/blob/900c8c9668a1e2f1d54d453e956caad54702e540/src/main/java/com/yahoo/sketches/fdt/FdtSketch.java#L89-L93 |
apache/groovy | src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java | CompilerConfiguration.setOptimizationOptions | public void setOptimizationOptions(Map<String, Boolean> options) {
"""
Sets the optimization options for this configuration.
No entry or a true for that entry means to enable that optimization,
a false means the optimization is disabled.
Valid keys are "all" and "int".
@param options the options.
@throws Ille... | java | public void setOptimizationOptions(Map<String, Boolean> options) {
if (options == null) throw new IllegalArgumentException("provided option map must not be null");
optimizationOptions = options;
} | [
"public",
"void",
"setOptimizationOptions",
"(",
"Map",
"<",
"String",
",",
"Boolean",
">",
"options",
")",
"{",
"if",
"(",
"options",
"==",
"null",
")",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"provided option map must not be null\"",
")",
";",
"optimi... | Sets the optimization options for this configuration.
No entry or a true for that entry means to enable that optimization,
a false means the optimization is disabled.
Valid keys are "all" and "int".
@param options the options.
@throws IllegalArgumentException if the options are null | [
"Sets",
"the",
"optimization",
"options",
"for",
"this",
"configuration",
".",
"No",
"entry",
"or",
"a",
"true",
"for",
"that",
"entry",
"means",
"to",
"enable",
"that",
"optimization",
"a",
"false",
"means",
"the",
"optimization",
"is",
"disabled",
".",
"Va... | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1047-L1050 |
networknt/light-4j | utility/src/main/java/com/networknt/utility/StringUtils.java | StringUtils.inputStreamToString | public static String inputStreamToString(InputStream inputStream, Charset charset) throws IOException {
"""
Convert an InputStream into a String.
Highest performing conversion per: https://stackoverflow.com/a/35446009
@param inputStream The input stream to be converted.
@param charset The decoding charset t... | java | public static String inputStreamToString(InputStream inputStream, Charset charset) throws IOException {
if (inputStream != null && inputStream.available() != -1) {
ByteArrayOutputStream result = new ByteArrayOutputStream();
byte[] buffer = new byte[1024];
int length;
... | [
"public",
"static",
"String",
"inputStreamToString",
"(",
"InputStream",
"inputStream",
",",
"Charset",
"charset",
")",
"throws",
"IOException",
"{",
"if",
"(",
"inputStream",
"!=",
"null",
"&&",
"inputStream",
".",
"available",
"(",
")",
"!=",
"-",
"1",
")",
... | Convert an InputStream into a String.
Highest performing conversion per: https://stackoverflow.com/a/35446009
@param inputStream The input stream to be converted.
@param charset The decoding charset to use.
@return The string value of the input stream, null otherwise.
@throws IOException If there are any issues in re... | [
"Convert",
"an",
"InputStream",
"into",
"a",
"String",
"."
] | train | https://github.com/networknt/light-4j/blob/2a60257c60663684c8f6dc8b5ea3cf184e534db6/utility/src/main/java/com/networknt/utility/StringUtils.java#L1265-L1279 |
dita-ot/dita-ot | src/main/java/org/dita/dost/util/FileUtils.java | FileUtils.resolveTopic | @Deprecated
public static String resolveTopic(final File rootPath, final String relativePath) {
"""
Normalize topic path base on current directory and href value, by
replacing "\\" and "\" with {@link File#separator}, and removing ".", ".."
from the file path, with no change to substring behind "#".
@para... | java | @Deprecated
public static String resolveTopic(final File rootPath, final String relativePath) {
return setFragment(resolve(rootPath, stripFragment(relativePath)).getPath(), getFragment(relativePath));
} | [
"@",
"Deprecated",
"public",
"static",
"String",
"resolveTopic",
"(",
"final",
"File",
"rootPath",
",",
"final",
"String",
"relativePath",
")",
"{",
"return",
"setFragment",
"(",
"resolve",
"(",
"rootPath",
",",
"stripFragment",
"(",
"relativePath",
")",
")",
... | Normalize topic path base on current directory and href value, by
replacing "\\" and "\" with {@link File#separator}, and removing ".", ".."
from the file path, with no change to substring behind "#".
@param rootPath root directory path
@param relativePath relative path
@return resolved topic file | [
"Normalize",
"topic",
"path",
"base",
"on",
"current",
"directory",
"and",
"href",
"value",
"by",
"replacing",
"\\\\",
"and",
"\\",
"with",
"{",
"@link",
"File#separator",
"}",
"and",
"removing",
".",
"..",
"from",
"the",
"file",
"path",
"with",
"no",
"cha... | train | https://github.com/dita-ot/dita-ot/blob/ea776b3c60c03d9f033b6f7ea072349e49dbcdd2/src/main/java/org/dita/dost/util/FileUtils.java#L303-L306 |
devnied/EMV-NFC-Paycard-Enrollment | library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java | EmvTemplate.selectPaymentEnvironment | protected byte[] selectPaymentEnvironment() throws CommunicationException {
"""
Method used to select payment environment PSE or PPSE
@return response byte array
@throws CommunicationException communication error
"""
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Select " + (config.contactLess ? "PPSE" ... | java | protected byte[] selectPaymentEnvironment() throws CommunicationException {
if (LOGGER.isDebugEnabled()) {
LOGGER.debug("Select " + (config.contactLess ? "PPSE" : "PSE") + " Application");
}
// Select the PPSE or PSE directory
return provider.transceive(new CommandApdu(CommandEnum.SELECT, config.contactLess ... | [
"protected",
"byte",
"[",
"]",
"selectPaymentEnvironment",
"(",
")",
"throws",
"CommunicationException",
"{",
"if",
"(",
"LOGGER",
".",
"isDebugEnabled",
"(",
")",
")",
"{",
"LOGGER",
".",
"debug",
"(",
"\"Select \"",
"+",
"(",
"config",
".",
"contactLess",
... | Method used to select payment environment PSE or PPSE
@return response byte array
@throws CommunicationException communication error | [
"Method",
"used",
"to",
"select",
"payment",
"environment",
"PSE",
"or",
"PPSE"
] | train | https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L536-L542 |
structr/structr | structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java | JarConfigurationProvider.registerPropertySet | @Override
public void registerPropertySet(Class type, String propertyView, PropertyKey... propertySet) {
"""
Registers the given set of property keys for the view with name
<code>propertyView</code> and the given prefix of entities with the
given type.
@param type the type of the entities for which the view ... | java | @Override
public void registerPropertySet(Class type, String propertyView, PropertyKey... propertySet) {
Map<String, Set<PropertyKey>> propertyViewMap = getPropertyViewMapForType(type);
Set<PropertyKey> properties = propertyViewMap.get(propertyView);
if (properties == null) {
properties = new LinkedHashSet<... | [
"@",
"Override",
"public",
"void",
"registerPropertySet",
"(",
"Class",
"type",
",",
"String",
"propertyView",
",",
"PropertyKey",
"...",
"propertySet",
")",
"{",
"Map",
"<",
"String",
",",
"Set",
"<",
"PropertyKey",
">",
">",
"propertyViewMap",
"=",
"getPrope... | Registers the given set of property keys for the view with name
<code>propertyView</code> and the given prefix of entities with the
given type.
@param type the type of the entities for which the view will be
registered
@param propertyView the name of the property view for which the
property set will be registered
@par... | [
"Registers",
"the",
"given",
"set",
"of",
"property",
"keys",
"for",
"the",
"view",
"with",
"name",
"<code",
">",
"propertyView<",
"/",
"code",
">",
"and",
"the",
"given",
"prefix",
"of",
"entities",
"with",
"the",
"given",
"type",
"."
] | train | https://github.com/structr/structr/blob/c111a1d0c0201c7fea5574ed69aa5a5053185a97/structr-core/src/main/java/org/structr/module/JarConfigurationProvider.java#L841-L866 |
nextreports/nextreports-server | src/ro/nextreports/server/report/jasper/JasperReportsUtil.java | JasperReportsUtil.getValueClassName | public static String getValueClassName(StorageService storageService, DataSource ds, String sql) throws Exception {
"""
get value class name for the first column on a select sql query
"""
try {
if ((sql != null) && !sql.trim().equals("")) {
Connection con = null;
... | java | public static String getValueClassName(StorageService storageService, DataSource ds, String sql) throws Exception {
try {
if ((sql != null) && !sql.trim().equals("")) {
Connection con = null;
try {
con = ConnectionUtil.createConnection(storageServ... | [
"public",
"static",
"String",
"getValueClassName",
"(",
"StorageService",
"storageService",
",",
"DataSource",
"ds",
",",
"String",
"sql",
")",
"throws",
"Exception",
"{",
"try",
"{",
"if",
"(",
"(",
"sql",
"!=",
"null",
")",
"&&",
"!",
"sql",
".",
"trim",... | get value class name for the first column on a select sql query | [
"get",
"value",
"class",
"name",
"for",
"the",
"first",
"column",
"on",
"a",
"select",
"sql",
"query"
] | train | https://github.com/nextreports/nextreports-server/blob/cfce12f5c6d52cb6a739388d50142c6e2e07c55e/src/ro/nextreports/server/report/jasper/JasperReportsUtil.java#L522-L549 |
UrielCh/ovh-java-sdk | ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java | ApiOvhMe.paymentMean_creditCard_POST | public OvhPaymentMeanValidation paymentMean_creditCard_POST(String description, String returnUrl, Boolean setDefault) throws IOException {
"""
Add a new credit card
REST: POST /me/paymentMean/creditCard
@param returnUrl [required] Callback URL where the customer will be redirected to after validation
@param s... | java | public OvhPaymentMeanValidation paymentMean_creditCard_POST(String description, String returnUrl, Boolean setDefault) throws IOException {
String qPath = "/me/paymentMean/creditCard";
StringBuilder sb = path(qPath);
HashMap<String, Object>o = new HashMap<String, Object>();
addBody(o, "description", description)... | [
"public",
"OvhPaymentMeanValidation",
"paymentMean_creditCard_POST",
"(",
"String",
"description",
",",
"String",
"returnUrl",
",",
"Boolean",
"setDefault",
")",
"throws",
"IOException",
"{",
"String",
"qPath",
"=",
"\"/me/paymentMean/creditCard\"",
";",
"StringBuilder",
... | Add a new credit card
REST: POST /me/paymentMean/creditCard
@param returnUrl [required] Callback URL where the customer will be redirected to after validation
@param setDefault [required] Set as default payment mean once validated
@param description [required] Custom description of this account | [
"Add",
"a",
"new",
"credit",
"card"
] | train | https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-me/src/main/java/net/minidev/ovh/api/ApiOvhMe.java#L801-L810 |
Azure/azure-sdk-for-java | keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java | KeyVaultClientBaseImpl.setCertificateContacts | public Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts) {
"""
Sets the certificate contacts for the specified key vault.
Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.
@param vaultBaseUrl The vault name, for ... | java | public Contacts setCertificateContacts(String vaultBaseUrl, Contacts contacts) {
return setCertificateContactsWithServiceResponseAsync(vaultBaseUrl, contacts).toBlocking().single().body();
} | [
"public",
"Contacts",
"setCertificateContacts",
"(",
"String",
"vaultBaseUrl",
",",
"Contacts",
"contacts",
")",
"{",
"return",
"setCertificateContactsWithServiceResponseAsync",
"(",
"vaultBaseUrl",
",",
"contacts",
")",
".",
"toBlocking",
"(",
")",
".",
"single",
"("... | Sets the certificate contacts for the specified key vault.
Sets the certificate contacts for the specified key vault. This operation requires the certificates/managecontacts permission.
@param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net.
@param contacts The contacts for the key vault certi... | [
"Sets",
"the",
"certificate",
"contacts",
"for",
"the",
"specified",
"key",
"vault",
".",
"Sets",
"the",
"certificate",
"contacts",
"for",
"the",
"specified",
"key",
"vault",
".",
"This",
"operation",
"requires",
"the",
"certificates",
"/",
"managecontacts",
"pe... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java#L5413-L5415 |
baidubce/bce-sdk-java | src/main/java/com/baidubce/services/bos/BosClient.java | BosClient.generatePresignedUrl | public URL generatePresignedUrl(String bucketName, String key, int expirationInSeconds) {
"""
Returns a pre-signed URL for accessing a Bos resource.
@param bucketName The name of the bucket containing the desired object.
@param key The key in the specified bucket under which the desired object is stored.
@par... | java | public URL generatePresignedUrl(String bucketName, String key, int expirationInSeconds) {
return this.generatePresignedUrl(bucketName, key, expirationInSeconds, HttpMethodName.GET);
} | [
"public",
"URL",
"generatePresignedUrl",
"(",
"String",
"bucketName",
",",
"String",
"key",
",",
"int",
"expirationInSeconds",
")",
"{",
"return",
"this",
".",
"generatePresignedUrl",
"(",
"bucketName",
",",
"key",
",",
"expirationInSeconds",
",",
"HttpMethodName",
... | Returns a pre-signed URL for accessing a Bos resource.
@param bucketName The name of the bucket containing the desired object.
@param key The key in the specified bucket under which the desired object is stored.
@param expirationInSeconds The expiration after which the returned pre-signed URL will expire.
@return A pr... | [
"Returns",
"a",
"pre",
"-",
"signed",
"URL",
"for",
"accessing",
"a",
"Bos",
"resource",
"."
] | train | https://github.com/baidubce/bce-sdk-java/blob/f7140f28dd82121515c88ded7bfe769a37d0ec4a/src/main/java/com/baidubce/services/bos/BosClient.java#L459-L461 |
OpenLiberty/open-liberty | dev/com.ibm.ws.couchdb/src/com/ibm/ws/couchdb/internal/Utils.java | Utils.getMessage | @Trivial
public static final String getMessage(String key, Object... params) {
"""
Gets an NLS message.
@param key the message key
@param params the message parameters
@return formatted message
"""
return Tr.formatMessage(tc, key, params);
} | java | @Trivial
public static final String getMessage(String key, Object... params) {
return Tr.formatMessage(tc, key, params);
} | [
"@",
"Trivial",
"public",
"static",
"final",
"String",
"getMessage",
"(",
"String",
"key",
",",
"Object",
"...",
"params",
")",
"{",
"return",
"Tr",
".",
"formatMessage",
"(",
"tc",
",",
"key",
",",
"params",
")",
";",
"}"
] | Gets an NLS message.
@param key the message key
@param params the message parameters
@return formatted message | [
"Gets",
"an",
"NLS",
"message",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.couchdb/src/com/ibm/ws/couchdb/internal/Utils.java#L33-L36 |
TheCoder4eu/BootsFaces-OSP | src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java | SelectBooleanCheckboxRenderer.encodeBegin | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
"""
This methods generates the HTML code of the current
b:selectBooleanCheckbox.
@param context
the FacesContext.
@param component
the current b:selectBooleanCheckbox.
@throws IOException
thrown if somethi... | java | @Override
public void encodeBegin(FacesContext context, UIComponent component) throws IOException {
if (!component.isRendered()) {
return;
}
SelectBooleanCheckbox selectBooleanCheckbox = (SelectBooleanCheckbox) component;
ResponseWriter rw = context.getResponseWriter();
String clientId = selectBooleanChec... | [
"@",
"Override",
"public",
"void",
"encodeBegin",
"(",
"FacesContext",
"context",
",",
"UIComponent",
"component",
")",
"throws",
"IOException",
"{",
"if",
"(",
"!",
"component",
".",
"isRendered",
"(",
")",
")",
"{",
"return",
";",
"}",
"SelectBooleanCheckbox... | This methods generates the HTML code of the current
b:selectBooleanCheckbox.
@param context
the FacesContext.
@param component
the current b:selectBooleanCheckbox.
@throws IOException
thrown if something goes wrong when writing the HTML code. | [
"This",
"methods",
"generates",
"the",
"HTML",
"code",
"of",
"the",
"current",
"b",
":",
"selectBooleanCheckbox",
"."
] | train | https://github.com/TheCoder4eu/BootsFaces-OSP/blob/d1a70952bc240979b5272fa4fe1c7f100873add0/src/main/java/net/bootsfaces/component/selectBooleanCheckbox/SelectBooleanCheckboxRenderer.java#L103-L132 |
spotbugs/spotbugs | spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java | SourceLineAnnotation.fromVisitedInstructionRange | public static SourceLineAnnotation fromVisitedInstructionRange(BytecodeScanningDetector visitor, int startPC, int endPC) {
"""
Factory method for creating a source line annotation describing the
source line numbers for a range of instructions in the method being
visited by the given visitor.
@param visitor
a... | java | public static SourceLineAnnotation fromVisitedInstructionRange(BytecodeScanningDetector visitor, int startPC, int endPC) {
LineNumberTable lineNumberTable = getLineNumberTable(visitor);
String className = visitor.getDottedClassName();
String sourceFile = visitor.getSourceFile();
if (lin... | [
"public",
"static",
"SourceLineAnnotation",
"fromVisitedInstructionRange",
"(",
"BytecodeScanningDetector",
"visitor",
",",
"int",
"startPC",
",",
"int",
"endPC",
")",
"{",
"LineNumberTable",
"lineNumberTable",
"=",
"getLineNumberTable",
"(",
"visitor",
")",
";",
"Strin... | Factory method for creating a source line annotation describing the
source line numbers for a range of instructions in the method being
visited by the given visitor.
@param visitor
a BetterVisitor which is visiting the method
@param startPC
the bytecode offset of the start instruction in the range
@param endPC
the byt... | [
"Factory",
"method",
"for",
"creating",
"a",
"source",
"line",
"annotation",
"describing",
"the",
"source",
"line",
"numbers",
"for",
"a",
"range",
"of",
"instructions",
"in",
"the",
"method",
"being",
"visited",
"by",
"the",
"given",
"visitor",
"."
] | train | https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/SourceLineAnnotation.java#L494-L506 |
thiagokimo/Faker | faker-core/src/main/java/io/kimo/lib/faker/Faker.java | Faker.fillWithText | public void fillWithText(TextView view, FakerTextComponent component) {
"""
Fill a TextView with a specific FakerTextComponent
@param view
@param component
"""
validateNotNullableView(view);
validateIfIsATextView(view);
validateNotNullableFakerComponent(component);
view.setTe... | java | public void fillWithText(TextView view, FakerTextComponent component) {
validateNotNullableView(view);
validateIfIsATextView(view);
validateNotNullableFakerComponent(component);
view.setText(component.randomText());
} | [
"public",
"void",
"fillWithText",
"(",
"TextView",
"view",
",",
"FakerTextComponent",
"component",
")",
"{",
"validateNotNullableView",
"(",
"view",
")",
";",
"validateIfIsATextView",
"(",
"view",
")",
";",
"validateNotNullableFakerComponent",
"(",
"component",
")",
... | Fill a TextView with a specific FakerTextComponent
@param view
@param component | [
"Fill",
"a",
"TextView",
"with",
"a",
"specific",
"FakerTextComponent"
] | train | https://github.com/thiagokimo/Faker/blob/8b0eccd499817a2bc3377db0c6e1b50736d0f034/faker-core/src/main/java/io/kimo/lib/faker/Faker.java#L103-L109 |
lessthanoptimal/BoofCV | main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo2Line.java | HomographyInducedStereo2Line.process | public boolean process(PairLineNorm line0, PairLineNorm line1) {
"""
Computes the homography based on two unique lines on the plane
@param line0 Line on the plane
@param line1 Line on the plane
"""
// Find plane equations of second lines in the first view
double a0 = GeometryMath_F64.dot(e2,line0.l2);... | java | public boolean process(PairLineNorm line0, PairLineNorm line1) {
// Find plane equations of second lines in the first view
double a0 = GeometryMath_F64.dot(e2,line0.l2);
double a1 = GeometryMath_F64.dot(e2,line1.l2);
GeometryMath_F64.multTran(A,line0.l2,Al0);
GeometryMath_F64.multTran(A,line1.l2,Al1);
//... | [
"public",
"boolean",
"process",
"(",
"PairLineNorm",
"line0",
",",
"PairLineNorm",
"line1",
")",
"{",
"// Find plane equations of second lines in the first view",
"double",
"a0",
"=",
"GeometryMath_F64",
".",
"dot",
"(",
"e2",
",",
"line0",
".",
"l2",
")",
";",
"d... | Computes the homography based on two unique lines on the plane
@param line0 Line on the plane
@param line1 Line on the plane | [
"Computes",
"the",
"homography",
"based",
"on",
"two",
"unique",
"lines",
"on",
"the",
"plane"
] | train | https://github.com/lessthanoptimal/BoofCV/blob/f01c0243da0ec086285ee722183804d5923bc3ac/main/boofcv-geo/src/main/java/boofcv/alg/geo/h/HomographyInducedStereo2Line.java#L110-L159 |
apache/incubator-atlas | repository/src/main/java/org/apache/atlas/gremlin/GremlinExpressionFactory.java | GremlinExpressionFactory.generateAdjacentVerticesExpression | public GroovyExpression generateAdjacentVerticesExpression(GroovyExpression parent, AtlasEdgeDirection dir,
String label) {
"""
Generates an expression that gets the vertices adjacent to the vertex in 'parent'
in the specified direction, following only edges with the given label.
@param parent
@pa... | java | public GroovyExpression generateAdjacentVerticesExpression(GroovyExpression parent, AtlasEdgeDirection dir,
String label) {
return new FunctionCallExpression(TraversalStepType.FLAT_MAP_TO_ELEMENTS, parent, getGremlinFunctionName(dir), new LiteralExpression(label));
} | [
"public",
"GroovyExpression",
"generateAdjacentVerticesExpression",
"(",
"GroovyExpression",
"parent",
",",
"AtlasEdgeDirection",
"dir",
",",
"String",
"label",
")",
"{",
"return",
"new",
"FunctionCallExpression",
"(",
"TraversalStepType",
".",
"FLAT_MAP_TO_ELEMENTS",
",",
... | Generates an expression that gets the vertices adjacent to the vertex in 'parent'
in the specified direction, following only edges with the given label.
@param parent
@param dir
@return | [
"Generates",
"an",
"expression",
"that",
"gets",
"the",
"vertices",
"adjacent",
"to",
"the",
"vertex",
"in",
"parent",
"in",
"the",
"specified",
"direction",
"following",
"only",
"edges",
"with",
"the",
"given",
"label",
"."
] | train | https://github.com/apache/incubator-atlas/blob/e0d2cdc27c32742ebecd24db4cca62dc04dcdf4b/repository/src/main/java/org/apache/atlas/gremlin/GremlinExpressionFactory.java#L489-L492 |
zaproxy/zaproxy | src/org/parosproxy/paros/network/SSLConnector.java | SSLConnector.createTunnelServerSocket | public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException {
"""
Create a SSLsocket using an existing connected socket. It can be used
such as a tunneled SSL proxy socket (eg when a CONNECT request is
received). This SSLSocket will start server side handshake immediately.
@par... | java | public Socket createTunnelServerSocket(String targethost, Socket socket) throws IOException {
InetAddress listeningAddress = socket.getLocalAddress();
// ZAP: added host name parameter
SSLSocket s = (SSLSocket) getTunnelSSLSocketFactory(targethost, listeningAddress).createSocket(socket, socket
.getInetAdd... | [
"public",
"Socket",
"createTunnelServerSocket",
"(",
"String",
"targethost",
",",
"Socket",
"socket",
")",
"throws",
"IOException",
"{",
"InetAddress",
"listeningAddress",
"=",
"socket",
".",
"getLocalAddress",
"(",
")",
";",
"// ZAP: added host name parameter\r",
"SSLS... | Create a SSLsocket using an existing connected socket. It can be used
such as a tunneled SSL proxy socket (eg when a CONNECT request is
received). This SSLSocket will start server side handshake immediately.
@param targethost the host where you want to connect to
@param socket
@return
@throws IOException | [
"Create",
"a",
"SSLsocket",
"using",
"an",
"existing",
"connected",
"socket",
".",
"It",
"can",
"be",
"used",
"such",
"as",
"a",
"tunneled",
"SSL",
"proxy",
"socket",
"(",
"eg",
"when",
"a",
"CONNECT",
"request",
"is",
"received",
")",
".",
"This",
"SSLS... | train | https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/network/SSLConnector.java#L553-L562 |
OpenLiberty/open-liberty | dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/InterceptorMetaDataHelper.java | InterceptorMetaDataHelper.validateAroundSignature | public static void validateAroundSignature(InterceptorMethodKind kind, Method m, J2EEName name)
throws EJBConfigurationException {
"""
Verify a specified AroundInvoke interceptor method has correct method
modifiers and signature.
@param kind the interceptor kind
@param m is the java reflec... | java | public static void validateAroundSignature(InterceptorMethodKind kind, Method m, J2EEName name)
throws EJBConfigurationException
{
// Get the modifers for the interceptor method and verify that the
// method is neither final nor static as required by EJB specification.
i... | [
"public",
"static",
"void",
"validateAroundSignature",
"(",
"InterceptorMethodKind",
"kind",
",",
"Method",
"m",
",",
"J2EEName",
"name",
")",
"throws",
"EJBConfigurationException",
"{",
"// Get the modifers for the interceptor method and verify that the",
"// method is neither f... | Verify a specified AroundInvoke interceptor method has correct method
modifiers and signature.
@param kind the interceptor kind
@param m is the java reflection Method object for the around invoke method.
@param ejbClass is true if the interceptor is defined on the enterprise bean class
@param name is the {@link J2EENa... | [
"Verify",
"a",
"specified",
"AroundInvoke",
"interceptor",
"method",
"has",
"correct",
"method",
"modifiers",
"and",
"signature",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.core/src/com/ibm/ws/metadata/ejb/InterceptorMetaDataHelper.java#L617-L675 |
liferay/com-liferay-commerce | commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java | CommerceDiscountPersistenceImpl.countByLtE_S | @Override
public int countByLtE_S(Date expirationDate, int status) {
"""
Returns the number of commerce discounts where expirationDate < ? and status = ?.
@param expirationDate the expiration date
@param status the status
@return the number of matching commerce discounts
"""
FinderPath finde... | java | @Override
public int countByLtE_S(Date expirationDate, int status) {
FinderPath finderPath = FINDER_PATH_WITH_PAGINATION_COUNT_BY_LTE_S;
Object[] finderArgs = new Object[] { _getTime(expirationDate), status };
Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
if (count == null) {
St... | [
"@",
"Override",
"public",
"int",
"countByLtE_S",
"(",
"Date",
"expirationDate",
",",
"int",
"status",
")",
"{",
"FinderPath",
"finderPath",
"=",
"FINDER_PATH_WITH_PAGINATION_COUNT_BY_LTE_S",
";",
"Object",
"[",
"]",
"finderArgs",
"=",
"new",
"Object",
"[",
"]",
... | Returns the number of commerce discounts where expirationDate < ? and status = ?.
@param expirationDate the expiration date
@param status the status
@return the number of matching commerce discounts | [
"Returns",
"the",
"number",
"of",
"commerce",
"discounts",
"where",
"expirationDate",
"<",
";",
"?",
";",
"and",
"status",
"=",
"?",
";",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-discount-service/src/main/java/com/liferay/commerce/discount/service/persistence/impl/CommerceDiscountPersistenceImpl.java#L4438-L4496 |
flow/caustic | api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java | MeshGenerator.generateWireCuboid | public static VertexData generateWireCuboid(Vector3f size) {
"""
Generates a cuboid shaped wireframe (the outline of the cuboid). The center is at the middle of the cuboid.
@param size The size of the cuboid to generate, on x, y and z
@return The vertex data
"""
final VertexData destination = new V... | java | public static VertexData generateWireCuboid(Vector3f size) {
final VertexData destination = new VertexData();
final VertexAttribute positionsAttribute = new VertexAttribute("positions", DataType.FLOAT, 3);
destination.addAttribute(0, positionsAttribute);
final TFloatList positions = new ... | [
"public",
"static",
"VertexData",
"generateWireCuboid",
"(",
"Vector3f",
"size",
")",
"{",
"final",
"VertexData",
"destination",
"=",
"new",
"VertexData",
"(",
")",
";",
"final",
"VertexAttribute",
"positionsAttribute",
"=",
"new",
"VertexAttribute",
"(",
"\"positio... | Generates a cuboid shaped wireframe (the outline of the cuboid). The center is at the middle of the cuboid.
@param size The size of the cuboid to generate, on x, y and z
@return The vertex data | [
"Generates",
"a",
"cuboid",
"shaped",
"wireframe",
"(",
"the",
"outline",
"of",
"the",
"cuboid",
")",
".",
"The",
"center",
"is",
"at",
"the",
"middle",
"of",
"the",
"cuboid",
"."
] | train | https://github.com/flow/caustic/blob/88652fcf0621ce158a0e92ce4c570ed6b1f6fca9/api/src/main/java/com/flowpowered/caustic/api/util/MeshGenerator.java#L530-L541 |
TNG/JGiven | jgiven-core/src/main/java/com/tngtech/jgiven/report/config/ConfigOptionBuilder.java | ConfigOptionBuilder.setCommandLineOptionWithoutArgument | public ConfigOptionBuilder setCommandLineOptionWithoutArgument( CommandLineOption commandLineOption, Object value ) {
"""
if you don't have an argument, choose the value that is going to be inserted into the map instead
@param commandLineOption specification of the command line options
@param value the value t... | java | public ConfigOptionBuilder setCommandLineOptionWithoutArgument( CommandLineOption commandLineOption, Object value ) {
co.setCommandLineOption( commandLineOption );
co.setValue( value );
return this;
} | [
"public",
"ConfigOptionBuilder",
"setCommandLineOptionWithoutArgument",
"(",
"CommandLineOption",
"commandLineOption",
",",
"Object",
"value",
")",
"{",
"co",
".",
"setCommandLineOption",
"(",
"commandLineOption",
")",
";",
"co",
".",
"setValue",
"(",
"value",
")",
";... | if you don't have an argument, choose the value that is going to be inserted into the map instead
@param commandLineOption specification of the command line options
@param value the value that is going to be inserted into the map instead of the argument | [
"if",
"you",
"don",
"t",
"have",
"an",
"argument",
"choose",
"the",
"value",
"that",
"is",
"going",
"to",
"be",
"inserted",
"into",
"the",
"map",
"instead"
] | train | https://github.com/TNG/JGiven/blob/1a69248fc6d7eb380cdc4542e3be273842889748/jgiven-core/src/main/java/com/tngtech/jgiven/report/config/ConfigOptionBuilder.java#L41-L45 |
eduarddrenth/ConfigurableReports | src/main/java/com/vectorprint/report/itext/BaseReportGenerator.java | BaseReportGenerator.createReportBody | protected void createReportBody(Document document, RD data, com.itextpdf.text.pdf.PdfWriter writer) throws DocumentException, VectorPrintException {
"""
Calls {@link #processData(com.vectorprint.report.data.ReportDataHolder) }. If you don't want to use the {@link DataCollector} /
{@link ReportDataHolder} mechanis... | java | protected void createReportBody(Document document, RD data, com.itextpdf.text.pdf.PdfWriter writer) throws DocumentException, VectorPrintException {
processData(data);
} | [
"protected",
"void",
"createReportBody",
"(",
"Document",
"document",
",",
"RD",
"data",
",",
"com",
".",
"itextpdf",
".",
"text",
".",
"pdf",
".",
"PdfWriter",
"writer",
")",
"throws",
"DocumentException",
",",
"VectorPrintException",
"{",
"processData",
"(",
... | Calls {@link #processData(com.vectorprint.report.data.ReportDataHolder) }. If you don't want to use the {@link DataCollector} /
{@link ReportDataHolder} mechanism extend this class, override this method and provide it's name in a setting
{@link ReportConstants#REPORTCLASS}.
@throws com.vectorprint.VectorPrintException... | [
"Calls",
"{",
"@link",
"#processData",
"(",
"com",
".",
"vectorprint",
".",
"report",
".",
"data",
".",
"ReportDataHolder",
")",
"}",
".",
"If",
"you",
"don",
"t",
"want",
"to",
"use",
"the",
"{",
"@link",
"DataCollector",
"}",
"/",
"{",
"@link",
"Repo... | train | https://github.com/eduarddrenth/ConfigurableReports/blob/b5fb7a89e16d9b35f557f3bf620594f821fa1552/src/main/java/com/vectorprint/report/itext/BaseReportGenerator.java#L336-L338 |
jbundle/jbundle | base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/BaseMessageTransport.java | BaseMessageTransport.getProperty | public String getProperty(TrxMessageHeader trxMessageHeader, String strParamName) {
"""
Get this transport specific param.
Get this param. The transport properties specify param names by adding the word
param after it. For example, to specify a different param for the messageClass
for a SOAP transport, the SOAP... | java | public String getProperty(TrxMessageHeader trxMessageHeader, String strParamName)
{
String strProperty = (String)trxMessageHeader.get(strParamName);
if (strProperty == null)
strProperty = this.getProperty(strParamName);
return strProperty;
} | [
"public",
"String",
"getProperty",
"(",
"TrxMessageHeader",
"trxMessageHeader",
",",
"String",
"strParamName",
")",
"{",
"String",
"strProperty",
"=",
"(",
"String",
")",
"trxMessageHeader",
".",
"get",
"(",
"strParamName",
")",
";",
"if",
"(",
"strProperty",
"=... | Get this transport specific param.
Get this param. The transport properties specify param names by adding the word
param after it. For example, to specify a different param for the messageClass
for a SOAP transport, the SOAP property messageClassParam=SOAPMessageClass should
be set in the SOAP transport properties and ... | [
"Get",
"this",
"transport",
"specific",
"param",
".",
"Get",
"this",
"param",
".",
"The",
"transport",
"properties",
"specify",
"param",
"names",
"by",
"adding",
"the",
"word",
"param",
"after",
"it",
".",
"For",
"example",
"to",
"specify",
"a",
"different",... | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/message/trx/src/main/java/org/jbundle/base/message/trx/transport/BaseMessageTransport.java#L436-L442 |
JOML-CI/JOML | src/org/joml/Matrix3x2d.java | Matrix3x2d.setView | public Matrix3x2d setView(double left, double right, double bottom, double top) {
"""
Set this matrix to define a "view" transformation that maps the given <code>(left, bottom)</code> and
<code>(right, top)</code> corners to <code>(-1, -1)</code> and <code>(1, 1)</code> respectively.
@see #view(double, double,... | java | public Matrix3x2d setView(double left, double right, double bottom, double top) {
m00 = 2.0 / (right - left);
m01 = 0.0;
m10 = 0.0;
m11 = 2.0 / (top - bottom);
m20 = (left + right) / (left - right);
m21 = (bottom + top) / (bottom - top);
return this;
} | [
"public",
"Matrix3x2d",
"setView",
"(",
"double",
"left",
",",
"double",
"right",
",",
"double",
"bottom",
",",
"double",
"top",
")",
"{",
"m00",
"=",
"2.0",
"/",
"(",
"right",
"-",
"left",
")",
";",
"m01",
"=",
"0.0",
";",
"m10",
"=",
"0.0",
";",
... | Set this matrix to define a "view" transformation that maps the given <code>(left, bottom)</code> and
<code>(right, top)</code> corners to <code>(-1, -1)</code> and <code>(1, 1)</code> respectively.
@see #view(double, double, double, double)
@param left
the distance from the center to the left view edge
@param right
... | [
"Set",
"this",
"matrix",
"to",
"define",
"a",
"view",
"transformation",
"that",
"maps",
"the",
"given",
"<code",
">",
"(",
"left",
"bottom",
")",
"<",
"/",
"code",
">",
"and",
"<code",
">",
"(",
"right",
"top",
")",
"<",
"/",
"code",
">",
"corners",
... | train | https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Matrix3x2d.java#L2161-L2169 |
facebook/SoLoader | java/com/facebook/soloader/DirectorySoSource.java | DirectorySoSource.loadLibraryFrom | protected int loadLibraryFrom(
String soName, int loadFlags, File libDir, StrictMode.ThreadPolicy threadPolicy)
throws IOException {
"""
Abstracted this logic in another method so subclasses can take advantage of it.
"""
File soFile = new File(libDir, soName);
if (!soFile.exists()) {
... | java | protected int loadLibraryFrom(
String soName, int loadFlags, File libDir, StrictMode.ThreadPolicy threadPolicy)
throws IOException {
File soFile = new File(libDir, soName);
if (!soFile.exists()) {
Log.d(SoLoader.TAG, soName + " not found on " + libDir.getCanonicalPath());
return LOAD_RES... | [
"protected",
"int",
"loadLibraryFrom",
"(",
"String",
"soName",
",",
"int",
"loadFlags",
",",
"File",
"libDir",
",",
"StrictMode",
".",
"ThreadPolicy",
"threadPolicy",
")",
"throws",
"IOException",
"{",
"File",
"soFile",
"=",
"new",
"File",
"(",
"libDir",
",",... | Abstracted this logic in another method so subclasses can take advantage of it. | [
"Abstracted",
"this",
"logic",
"in",
"another",
"method",
"so",
"subclasses",
"can",
"take",
"advantage",
"of",
"it",
"."
] | train | https://github.com/facebook/SoLoader/blob/263af31d2960b2c0d0afe79d80197165a543be86/java/com/facebook/soloader/DirectorySoSource.java#L56-L91 |
joniles/mpxj | src/main/java/net/sf/mpxj/mpp/MPPUtility.java | MPPUtility.getByteArray | public static final void getByteArray(byte[] data, int offset, int size, byte[] buffer, int bufferOffset) {
"""
This method extracts a portion of a byte array and writes it into
another byte array.
@param data Source data
@param offset Offset into source data
@param size Required size to be extracted from th... | java | public static final void getByteArray(byte[] data, int offset, int size, byte[] buffer, int bufferOffset)
{
System.arraycopy(data, offset, buffer, bufferOffset, size);
} | [
"public",
"static",
"final",
"void",
"getByteArray",
"(",
"byte",
"[",
"]",
"data",
",",
"int",
"offset",
",",
"int",
"size",
",",
"byte",
"[",
"]",
"buffer",
",",
"int",
"bufferOffset",
")",
"{",
"System",
".",
"arraycopy",
"(",
"data",
",",
"offset",... | This method extracts a portion of a byte array and writes it into
another byte array.
@param data Source data
@param offset Offset into source data
@param size Required size to be extracted from the source data
@param buffer Destination buffer
@param bufferOffset Offset into destination buffer | [
"This",
"method",
"extracts",
"a",
"portion",
"of",
"a",
"byte",
"array",
"and",
"writes",
"it",
"into",
"another",
"byte",
"array",
"."
] | train | https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpp/MPPUtility.java#L155-L158 |
algolia/instantsearch-android | core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java | Searcher.forwardBackendSearchResult | @NonNull
@SuppressWarnings( {
"""
Forwards the given algolia response to the {@link Searcher#resultListeners results listeners}.
<p>
<i>This method is useful if you rely on a backend implementation,
but still want to use InstantSearch Android in your frontend application.</i>
@param response the response... | java | @NonNull
@SuppressWarnings({"WeakerAccess", "unused"}) // For library users
public Searcher forwardBackendSearchResult(@NonNull JSONObject response) {
if (!hasHits(response)) {
endReached = true;
} else {
checkIfLastPage(response);
}
updateListeners(respo... | [
"@",
"NonNull",
"@",
"SuppressWarnings",
"(",
"{",
"\"WeakerAccess\"",
",",
"\"unused\"",
"}",
")",
"// For library users",
"public",
"Searcher",
"forwardBackendSearchResult",
"(",
"@",
"NonNull",
"JSONObject",
"response",
")",
"{",
"if",
"(",
"!",
"hasHits",
"(",... | Forwards the given algolia response to the {@link Searcher#resultListeners results listeners}.
<p>
<i>This method is useful if you rely on a backend implementation,
but still want to use InstantSearch Android in your frontend application.</i>
@param response the response sent by the algolia server.
@return this {@link... | [
"Forwards",
"the",
"given",
"algolia",
"response",
"to",
"the",
"{",
"@link",
"Searcher#resultListeners",
"results",
"listeners",
"}",
".",
"<p",
">",
"<i",
">",
"This",
"method",
"is",
"useful",
"if",
"you",
"rely",
"on",
"a",
"backend",
"implementation",
"... | train | https://github.com/algolia/instantsearch-android/blob/12092ec30140df9ffc2bf916339b433372034616/core/src/main/java/com/algolia/instantsearch/core/helpers/Searcher.java#L382-L395 |
facebookarchive/hadoop-20 | src/mapred/org/apache/hadoop/mapreduce/CounterGroup.java | CounterGroup.localize | private String localize(String key, String defaultValue) {
"""
Looks up key in the ResourceBundle and returns the corresponding value.
If the bundle or the key doesn't exist, returns the default value.
"""
String result = defaultValue;
if (bundle != null) {
try {
result = bundle.getStrin... | java | private String localize(String key, String defaultValue) {
String result = defaultValue;
if (bundle != null) {
try {
result = bundle.getString(key);
}
catch (MissingResourceException mre) {
}
}
return result;
} | [
"private",
"String",
"localize",
"(",
"String",
"key",
",",
"String",
"defaultValue",
")",
"{",
"String",
"result",
"=",
"defaultValue",
";",
"if",
"(",
"bundle",
"!=",
"null",
")",
"{",
"try",
"{",
"result",
"=",
"bundle",
".",
"getString",
"(",
"key",
... | Looks up key in the ResourceBundle and returns the corresponding value.
If the bundle or the key doesn't exist, returns the default value. | [
"Looks",
"up",
"key",
"in",
"the",
"ResourceBundle",
"and",
"returns",
"the",
"corresponding",
"value",
".",
"If",
"the",
"bundle",
"or",
"the",
"key",
"doesn",
"t",
"exist",
"returns",
"the",
"default",
"value",
"."
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/mapred/org/apache/hadoop/mapreduce/CounterGroup.java#L140-L150 |
recruit-mp/android-RMP-Appirater | library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java | RmpAppirater.appLaunched | public static void appLaunched(Context context, ShowRateDialogCondition showRateDialogCondition) {
"""
Tells RMP-Appirater that the app has launched.
<p/>
Rating dialog is shown after calling this method.
@param context Context
@param showRateDialogCondition Showing rate dialog condition.
... | java | public static void appLaunched(Context context, ShowRateDialogCondition showRateDialogCondition) {
appLaunched(context, showRateDialogCondition, null, null);
} | [
"public",
"static",
"void",
"appLaunched",
"(",
"Context",
"context",
",",
"ShowRateDialogCondition",
"showRateDialogCondition",
")",
"{",
"appLaunched",
"(",
"context",
",",
"showRateDialogCondition",
",",
"null",
",",
"null",
")",
";",
"}"
] | Tells RMP-Appirater that the app has launched.
<p/>
Rating dialog is shown after calling this method.
@param context Context
@param showRateDialogCondition Showing rate dialog condition. | [
"Tells",
"RMP",
"-",
"Appirater",
"that",
"the",
"app",
"has",
"launched",
".",
"<p",
"/",
">",
"Rating",
"dialog",
"is",
"shown",
"after",
"calling",
"this",
"method",
"."
] | train | https://github.com/recruit-mp/android-RMP-Appirater/blob/14fcdf110dfb97120303f39aab1de9393e84b90a/library/src/main/java/jp/co/recruit_mp/android/rmp_appirater/RmpAppirater.java#L71-L73 |
jglobus/JGlobus | gridftp/src/main/java/org/globus/ftp/FTPClient.java | FTPClient.getSize | public long getSize(String filename)
throws IOException, ServerException {
"""
Returns the remote file size.
@param filename filename get the size for.
@return size of the file.
@exception ServerException if the file does not exist or
an error occured.
"""
if (filename == null) {
... | java | public long getSize(String filename)
throws IOException, ServerException {
if (filename == null) {
throw new IllegalArgumentException("Required argument missing");
}
Command cmd = new Command("SIZE", filename);
Reply reply = null;
try {
reply = con... | [
"public",
"long",
"getSize",
"(",
"String",
"filename",
")",
"throws",
"IOException",
",",
"ServerException",
"{",
"if",
"(",
"filename",
"==",
"null",
")",
"{",
"throw",
"new",
"IllegalArgumentException",
"(",
"\"Required argument missing\"",
")",
";",
"}",
"Co... | Returns the remote file size.
@param filename filename get the size for.
@return size of the file.
@exception ServerException if the file does not exist or
an error occured. | [
"Returns",
"the",
"remote",
"file",
"size",
"."
] | train | https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/FTPClient.java#L141-L161 |
apereo/cas | support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java | AbstractSaml20ObjectBuilder.getNameID | public NameID getNameID(final String nameIdFormat, final String nameIdValue) {
"""
Gets name id.
@param nameIdFormat the name id format
@param nameIdValue the name id value
@return the name iD
"""
val nameId = newSamlObject(NameID.class);
nameId.setFormat(nameIdFormat);
nameId.set... | java | public NameID getNameID(final String nameIdFormat, final String nameIdValue) {
val nameId = newSamlObject(NameID.class);
nameId.setFormat(nameIdFormat);
nameId.setValue(nameIdValue);
return nameId;
} | [
"public",
"NameID",
"getNameID",
"(",
"final",
"String",
"nameIdFormat",
",",
"final",
"String",
"nameIdValue",
")",
"{",
"val",
"nameId",
"=",
"newSamlObject",
"(",
"NameID",
".",
"class",
")",
";",
"nameId",
".",
"setFormat",
"(",
"nameIdFormat",
")",
";",... | Gets name id.
@param nameIdFormat the name id format
@param nameIdValue the name id value
@return the name iD | [
"Gets",
"name",
"id",
"."
] | train | https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-saml-core-api/src/main/java/org/apereo/cas/support/saml/util/AbstractSaml20ObjectBuilder.java#L95-L100 |
apache/flink | flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java | ShutdownHookUtil.addShutdownHook | public static Thread addShutdownHook(
final AutoCloseable service,
final String serviceName,
final Logger logger) {
"""
Adds a shutdown hook to the JVM and returns the Thread, which has been registered.
"""
checkNotNull(service);
checkNotNull(logger);
final Thread shutdownHook = new Thread(() -> ... | java | public static Thread addShutdownHook(
final AutoCloseable service,
final String serviceName,
final Logger logger) {
checkNotNull(service);
checkNotNull(logger);
final Thread shutdownHook = new Thread(() -> {
try {
service.close();
} catch (Throwable t) {
logger.error("Error during shutdown o... | [
"public",
"static",
"Thread",
"addShutdownHook",
"(",
"final",
"AutoCloseable",
"service",
",",
"final",
"String",
"serviceName",
",",
"final",
"Logger",
"logger",
")",
"{",
"checkNotNull",
"(",
"service",
")",
";",
"checkNotNull",
"(",
"logger",
")",
";",
"fi... | Adds a shutdown hook to the JVM and returns the Thread, which has been registered. | [
"Adds",
"a",
"shutdown",
"hook",
"to",
"the",
"JVM",
"and",
"returns",
"the",
"Thread",
"which",
"has",
"been",
"registered",
"."
] | train | https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/util/ShutdownHookUtil.java#L33-L50 |
structurizr/java | structurizr-core/src/com/structurizr/documentation/ViewpointsAndPerspectivesDocumentationTemplate.java | ViewpointsAndPerspectivesDocumentationTemplate.addArchitecturalViewsSection | public Section addArchitecturalViewsSection(SoftwareSystem softwareSystem, File... files) throws IOException {
"""
Adds an "Architectural Views" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param f... | java | public Section addArchitecturalViewsSection(SoftwareSystem softwareSystem, File... files) throws IOException {
return addSection(softwareSystem, "Architectural Views", files);
} | [
"public",
"Section",
"addArchitecturalViewsSection",
"(",
"SoftwareSystem",
"softwareSystem",
",",
"File",
"...",
"files",
")",
"throws",
"IOException",
"{",
"return",
"addSection",
"(",
"softwareSystem",
",",
"\"Architectural Views\"",
",",
"files",
")",
";",
"}"
] | Adds an "Architectural Views" section relating to a {@link SoftwareSystem} from one or more files.
@param softwareSystem the {@link SoftwareSystem} the documentation content relates to
@param files one or more File objects that point to the documentation content
@return a documentation ... | [
"Adds",
"an",
"Architectural",
"Views",
"section",
"relating",
"to",
"a",
"{",
"@link",
"SoftwareSystem",
"}",
"from",
"one",
"or",
"more",
"files",
"."
] | train | https://github.com/structurizr/java/blob/4b204f077877a24bcac363f5ecf0e129a0f9f4c5/structurizr-core/src/com/structurizr/documentation/ViewpointsAndPerspectivesDocumentationTemplate.java#L140-L142 |
alkacon/opencms-core | src/org/opencms/main/OpenCmsServletErrorHandler.java | OpenCmsServletErrorHandler.doGet | @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
"""
OpenCms servlet main request handling method.<p>
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse)
"""
/... | java | @Override
public void doGet(HttpServletRequest req, HttpServletResponse res) throws IOException, ServletException {
// check the error status
Integer errorStatus = (Integer)req.getAttribute(CmsJspStatusBean.ERROR_STATUS_CODE);
if (errorStatus != null) {
// only use super method ... | [
"@",
"Override",
"public",
"void",
"doGet",
"(",
"HttpServletRequest",
"req",
",",
"HttpServletResponse",
"res",
")",
"throws",
"IOException",
",",
"ServletException",
"{",
"// check the error status",
"Integer",
"errorStatus",
"=",
"(",
"Integer",
")",
"req",
".",
... | OpenCms servlet main request handling method.<p>
@see javax.servlet.http.HttpServlet#doGet(javax.servlet.http.HttpServletRequest, javax.servlet.http.HttpServletResponse) | [
"OpenCms",
"servlet",
"main",
"request",
"handling",
"method",
".",
"<p",
">"
] | train | https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/main/OpenCmsServletErrorHandler.java#L65-L95 |
buschmais/jqa-core-framework | report/src/main/java/com/buschmais/jqassistant/core/report/impl/CompositeReportPlugin.java | CompositeReportPlugin.run | private void run(Map<String, ReportPlugin> reportPlugins, ReportOperation operation, Set<String> executedPlugins) throws ReportException {
"""
Execute a {@link ReportOperation} on the provided {@link ReportPlugin}s but
assure that this happens only once.
@param reportPlugins
The {@link ReportPlugin}s.
@param... | java | private void run(Map<String, ReportPlugin> reportPlugins, ReportOperation operation, Set<String> executedPlugins) throws ReportException {
for (Map.Entry<String, ReportPlugin> entry : reportPlugins.entrySet()) {
if (executedPlugins.add(entry.getKey())) {
operation.run(entry.getValue(... | [
"private",
"void",
"run",
"(",
"Map",
"<",
"String",
",",
"ReportPlugin",
">",
"reportPlugins",
",",
"ReportOperation",
"operation",
",",
"Set",
"<",
"String",
">",
"executedPlugins",
")",
"throws",
"ReportException",
"{",
"for",
"(",
"Map",
".",
"Entry",
"<... | Execute a {@link ReportOperation} on the provided {@link ReportPlugin}s but
assure that this happens only once.
@param reportPlugins
The {@link ReportPlugin}s.
@param operation
The {@link ReportOperation}.
@param executedPlugins
The already executed {@link ReportPlugin}s.
@throws ReportException
If a problem is report... | [
"Execute",
"a",
"{",
"@link",
"ReportOperation",
"}",
"on",
"the",
"provided",
"{",
"@link",
"ReportPlugin",
"}",
"s",
"but",
"assure",
"that",
"this",
"happens",
"only",
"once",
"."
] | train | https://github.com/buschmais/jqa-core-framework/blob/0e63ff509cfe52f9063539a23d5f9f183b2ea4a5/report/src/main/java/com/buschmais/jqassistant/core/report/impl/CompositeReportPlugin.java#L186-L192 |
pgjdbc/pgjdbc | pgjdbc/src/main/java/org/postgresql/core/Parser.java | Parser.parseValuesKeyword | public static boolean parseValuesKeyword(final char[] query, int offset) {
"""
Parse string to check presence of VALUES keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word
"""
if (query.leng... | java | public static boolean parseValuesKeyword(final char[] query, int offset) {
if (query.length < (offset + 6)) {
return false;
}
return (query[offset] | 32) == 'v'
&& (query[offset + 1] | 32) == 'a'
&& (query[offset + 2] | 32) == 'l'
&& (query[offset + 3] | 32) == 'u'
&& ... | [
"public",
"static",
"boolean",
"parseValuesKeyword",
"(",
"final",
"char",
"[",
"]",
"query",
",",
"int",
"offset",
")",
"{",
"if",
"(",
"query",
".",
"length",
"<",
"(",
"offset",
"+",
"6",
")",
")",
"{",
"return",
"false",
";",
"}",
"return",
"(",
... | Parse string to check presence of VALUES keyword regardless of case.
@param query char[] of the query statement
@param offset position of query to start checking
@return boolean indicates presence of word | [
"Parse",
"string",
"to",
"check",
"presence",
"of",
"VALUES",
"keyword",
"regardless",
"of",
"case",
"."
] | train | https://github.com/pgjdbc/pgjdbc/blob/95ba7b261e39754674c5817695ae5ebf9a341fae/pgjdbc/src/main/java/org/postgresql/core/Parser.java#L683-L694 |
lucmoreau/ProvToolbox | prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java | ProvFactory.newValue | public Value newValue(Object value, QualifiedName type) {
"""
Factory method to create an instance of the PROV-DM prov:value attribute (see {@link Value}).
Use class {@link Name} for predefined {@link QualifiedName}s for the common types.
@param value an {@link Object}
@param type a {@link QualifiedName} to den... | java | public Value newValue(Object value, QualifiedName type) {
if (value==null) return null;
Value res = of.createValue();
res.setType(type);
res.setValueFromObject(value);
return res;
} | [
"public",
"Value",
"newValue",
"(",
"Object",
"value",
",",
"QualifiedName",
"type",
")",
"{",
"if",
"(",
"value",
"==",
"null",
")",
"return",
"null",
";",
"Value",
"res",
"=",
"of",
".",
"createValue",
"(",
")",
";",
"res",
".",
"setType",
"(",
"ty... | Factory method to create an instance of the PROV-DM prov:value attribute (see {@link Value}).
Use class {@link Name} for predefined {@link QualifiedName}s for the common types.
@param value an {@link Object}
@param type a {@link QualifiedName} to denote the type of value
@return a new {@link Value} | [
"Factory",
"method",
"to",
"create",
"an",
"instance",
"of",
"the",
"PROV",
"-",
"DM",
"prov",
":",
"value",
"attribute",
"(",
"see",
"{"
] | train | https://github.com/lucmoreau/ProvToolbox/blob/f865952868ffb69432937b08728c86bebbe4678a/prov-model/src/main/java/org/openprovenance/prov/model/ProvFactory.java#L1053-L1059 |
j-a-w-r/jawr-main-repo | jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java | AbstractCachedGenerator.addLinkedResources | protected void addLinkedResources(String path, GeneratorContext context, List<FilePathMapping> fMappings) {
"""
Adds the linked resource to the linked resource map
@param path
the resource path
@param context
the generator context
@param fMappings
the list of mappings linked to the resource
"""
linke... | java | protected void addLinkedResources(String path, GeneratorContext context, List<FilePathMapping> fMappings) {
linkedResourceMap.put(getResourceCacheKey(path, context), new CopyOnWriteArrayList<>(fMappings));
JoinableResourceBundle bundle = context.getBundle();
if (bundle != null) {
List<FilePathMapping> bundleF... | [
"protected",
"void",
"addLinkedResources",
"(",
"String",
"path",
",",
"GeneratorContext",
"context",
",",
"List",
"<",
"FilePathMapping",
">",
"fMappings",
")",
"{",
"linkedResourceMap",
".",
"put",
"(",
"getResourceCacheKey",
"(",
"path",
",",
"context",
")",
... | Adds the linked resource to the linked resource map
@param path
the resource path
@param context
the generator context
@param fMappings
the list of mappings linked to the resource | [
"Adds",
"the",
"linked",
"resource",
"to",
"the",
"linked",
"resource",
"map"
] | train | https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/AbstractCachedGenerator.java#L375-L389 |
looly/hutool | hutool-core/src/main/java/cn/hutool/core/bean/DynaBean.java | DynaBean.get | @SuppressWarnings("unchecked")
public <T> T get(String fieldName) throws BeanException {
"""
获得字段对应值
@param <T> 属性值类型
@param fieldName 字段名
@return 字段值
@throws BeanException 反射获取属性值或字段值导致的异常
"""
if(Map.class.isAssignableFrom(beanClass)){
return (T) ((Map<?, ?>)bean).get(fieldName);
}else{
tr... | java | @SuppressWarnings("unchecked")
public <T> T get(String fieldName) throws BeanException{
if(Map.class.isAssignableFrom(beanClass)){
return (T) ((Map<?, ?>)bean).get(fieldName);
}else{
try {
final Method method = BeanUtil.getBeanDesc(beanClass).getGetter(fieldName);
if(null == method){
thr... | [
"@",
"SuppressWarnings",
"(",
"\"unchecked\"",
")",
"public",
"<",
"T",
">",
"T",
"get",
"(",
"String",
"fieldName",
")",
"throws",
"BeanException",
"{",
"if",
"(",
"Map",
".",
"class",
".",
"isAssignableFrom",
"(",
"beanClass",
")",
")",
"{",
"return",
... | 获得字段对应值
@param <T> 属性值类型
@param fieldName 字段名
@return 字段值
@throws BeanException 反射获取属性值或字段值导致的异常 | [
"获得字段对应值"
] | train | https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/bean/DynaBean.java#L74-L89 |
liferay/com-liferay-commerce | commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java | CommerceUserSegmentEntryPersistenceImpl.findAll | @Override
public List<CommerceUserSegmentEntry> findAll(int start, int end) {
"""
Returns a range of all the commerce user segment entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexe... | java | @Override
public List<CommerceUserSegmentEntry> findAll(int start, int end) {
return findAll(start, end, null);
} | [
"@",
"Override",
"public",
"List",
"<",
"CommerceUserSegmentEntry",
">",
"findAll",
"(",
"int",
"start",
",",
"int",
"end",
")",
"{",
"return",
"findAll",
"(",
"start",
",",
"end",
",",
"null",
")",
";",
"}"
] | Returns a range of all the commerce user segment entries.
<p>
Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting bo... | [
"Returns",
"a",
"range",
"of",
"all",
"the",
"commerce",
"user",
"segment",
"entries",
"."
] | train | https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-user-segment-service/src/main/java/com/liferay/commerce/user/segment/service/persistence/impl/CommerceUserSegmentEntryPersistenceImpl.java#L2786-L2789 |
ReactiveX/RxJavaAsyncUtil | src/main/java/rx/util/async/Async.java | Async.forEachFuture | public static <T> FutureTask<Void> forEachFuture(
Observable<? extends T> source,
Action1<? super T> onNext,
Scheduler scheduler) {
"""
Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
or error through a Future, scheduled ... | java | public static <T> FutureTask<Void> forEachFuture(
Observable<? extends T> source,
Action1<? super T> onNext,
Scheduler scheduler) {
FutureTask<Void> task = OperatorForEachFuture.forEachFuture(source, onNext);
final Worker inner = scheduler.createWorker();
inne... | [
"public",
"static",
"<",
"T",
">",
"FutureTask",
"<",
"Void",
">",
"forEachFuture",
"(",
"Observable",
"<",
"?",
"extends",
"T",
">",
"source",
",",
"Action1",
"<",
"?",
"super",
"T",
">",
"onNext",
",",
"Scheduler",
"scheduler",
")",
"{",
"FutureTask",
... | Subscribes to the given source and calls the callback for each emitted item, and surfaces the completion
or error through a Future, scheduled on the given scheduler.
<p>
<img width="640" src="https://raw.github.com/wiki/ReactiveX/RxJava/images/rx-operators/forEachFuture.s.png" alt="">
@param <T> the source value type
... | [
"Subscribes",
"to",
"the",
"given",
"source",
"and",
"calls",
"the",
"callback",
"for",
"each",
"emitted",
"item",
"and",
"surfaces",
"the",
"completion",
"or",
"error",
"through",
"a",
"Future",
"scheduled",
"on",
"the",
"given",
"scheduler",
".",
"<p",
">"... | train | https://github.com/ReactiveX/RxJavaAsyncUtil/blob/6294e1da30e639df79f76399906229314c14e74d/src/main/java/rx/util/async/Async.java#L1910-L1918 |
BorderTech/wcomponents | wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java | WRowExample.addAppLevelCSSExample | private void addAppLevelCSSExample() {
"""
Build an example with undefined column widths then use application-level CSS and a htmlClass property to define the widths.
"""
String htmlClass = "my_local_class";
add(new WHeading(HeadingLevel.H2, "App defined widths"));
add(new ExplanatoryText("This example s... | java | private void addAppLevelCSSExample() {
String htmlClass = "my_local_class";
add(new WHeading(HeadingLevel.H2, "App defined widths"));
add(new ExplanatoryText("This example shows the use of a htmlClass and app-specific CSS (in this case inline)"
+ " to style the columns including responsive widths"
+ " whi... | [
"private",
"void",
"addAppLevelCSSExample",
"(",
")",
"{",
"String",
"htmlClass",
"=",
"\"my_local_class\"",
";",
"add",
"(",
"new",
"WHeading",
"(",
"HeadingLevel",
".",
"H2",
",",
"\"App defined widths\"",
")",
")",
";",
"add",
"(",
"new",
"ExplanatoryText",
... | Build an example with undefined column widths then use application-level CSS and a htmlClass property to define the widths. | [
"Build",
"an",
"example",
"with",
"undefined",
"column",
"widths",
"then",
"use",
"application",
"-",
"level",
"CSS",
"and",
"a",
"htmlClass",
"property",
"to",
"define",
"the",
"widths",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-examples/src/main/java/com/github/bordertech/wcomponents/examples/theme/WRowExample.java#L160-L208 |
OpenLiberty/open-liberty | dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/adapter/FrameworkEventAdapter.java | FrameworkEventAdapter.frameworkEvent | public void frameworkEvent(FrameworkEvent frameworkEvent) {
"""
Receive notification of a framework event and adapt it to the format
required for the <code>EventAdmin</code> service.
@param frameworkEvent
the framework event to publish as an <code>Event</code>
"""
final String topic = getTopic(fra... | java | public void frameworkEvent(FrameworkEvent frameworkEvent) {
final String topic = getTopic(frameworkEvent);
// Bail quickly if the event is one that should be ignored
if (topic == null) {
return;
}
// Event properties
Map<String, Object> eventProperties = new... | [
"public",
"void",
"frameworkEvent",
"(",
"FrameworkEvent",
"frameworkEvent",
")",
"{",
"final",
"String",
"topic",
"=",
"getTopic",
"(",
"frameworkEvent",
")",
";",
"// Bail quickly if the event is one that should be ignored",
"if",
"(",
"topic",
"==",
"null",
")",
"{... | Receive notification of a framework event and adapt it to the format
required for the <code>EventAdmin</code> service.
@param frameworkEvent
the framework event to publish as an <code>Event</code> | [
"Receive",
"notification",
"of",
"a",
"framework",
"event",
"and",
"adapt",
"it",
"to",
"the",
"format",
"required",
"for",
"the",
"<code",
">",
"EventAdmin<",
"/",
"code",
">",
"service",
"."
] | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.event/src/com/ibm/ws/event/internal/adapter/FrameworkEventAdapter.java#L53-L98 |
threerings/narya | core/src/main/java/com/threerings/crowd/client/LocationDirector.java | LocationDirector.moveTo | public boolean moveTo (int placeId) {
"""
Requests that this client be moved to the specified place. A request will be made and when
the response is received, the location observers will be notified of success or failure.
@return true if the move to request was issued, false if it was rejected by a location
o... | java | public boolean moveTo (int placeId)
{
// make sure the placeId is valid
if (placeId < 0) {
log.warning("Refusing moveTo(): invalid placeId " + placeId + ".");
return false;
}
// first check to see if our observers are happy with this move request
if (... | [
"public",
"boolean",
"moveTo",
"(",
"int",
"placeId",
")",
"{",
"// make sure the placeId is valid",
"if",
"(",
"placeId",
"<",
"0",
")",
"{",
"log",
".",
"warning",
"(",
"\"Refusing moveTo(): invalid placeId \"",
"+",
"placeId",
"+",
"\".\"",
")",
";",
"return"... | Requests that this client be moved to the specified place. A request will be made and when
the response is received, the location observers will be notified of success or failure.
@return true if the move to request was issued, false if it was rejected by a location
observer or because we have another request outstand... | [
"Requests",
"that",
"this",
"client",
"be",
"moved",
"to",
"the",
"specified",
"place",
".",
"A",
"request",
"will",
"be",
"made",
"and",
"when",
"the",
"response",
"is",
"received",
"the",
"location",
"observers",
"will",
"be",
"notified",
"of",
"success",
... | train | https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/crowd/client/LocationDirector.java#L125-L182 |
datastax/java-driver | query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java | SchemaBuilder.alterType | @NonNull
public static AlterTypeStart alterType(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier typeName) {
"""
Starts an ALTER TYPE query with the given type name for the given keyspace name.
"""
return new DefaultAlterType(keyspace, typeName);
} | java | @NonNull
public static AlterTypeStart alterType(
@Nullable CqlIdentifier keyspace, @NonNull CqlIdentifier typeName) {
return new DefaultAlterType(keyspace, typeName);
} | [
"@",
"NonNull",
"public",
"static",
"AlterTypeStart",
"alterType",
"(",
"@",
"Nullable",
"CqlIdentifier",
"keyspace",
",",
"@",
"NonNull",
"CqlIdentifier",
"typeName",
")",
"{",
"return",
"new",
"DefaultAlterType",
"(",
"keyspace",
",",
"typeName",
")",
";",
"}"... | Starts an ALTER TYPE query with the given type name for the given keyspace name. | [
"Starts",
"an",
"ALTER",
"TYPE",
"query",
"with",
"the",
"given",
"type",
"name",
"for",
"the",
"given",
"keyspace",
"name",
"."
] | train | https://github.com/datastax/java-driver/blob/612a63f2525618e2020e86c9ad75ab37adba6132/query-builder/src/main/java/com/datastax/oss/driver/api/querybuilder/SchemaBuilder.java#L362-L366 |
EdwardRaff/JSAT | JSAT/src/jsat/classifiers/trees/MDA.java | MDA.walkCorruptedPath | private TreeNodeVisitor walkCorruptedPath(TreeLearner model, DataPoint dp, int j, Random rand) {
"""
walks the tree down to a leaf node, adding corruption for a specific feature
@param model the tree model to walk
@param dp the data point to push down the tree
@param j the feature index to corrupt
@param rand ... | java | private TreeNodeVisitor walkCorruptedPath(TreeLearner model, DataPoint dp, int j, Random rand)
{
TreeNodeVisitor curNode = model.getTreeNodeVisitor();
while(!curNode.isLeaf())
{
int path = curNode.getPath(dp);
int numChild = curNode.childrenCount();
if(cur... | [
"private",
"TreeNodeVisitor",
"walkCorruptedPath",
"(",
"TreeLearner",
"model",
",",
"DataPoint",
"dp",
",",
"int",
"j",
",",
"Random",
"rand",
")",
"{",
"TreeNodeVisitor",
"curNode",
"=",
"model",
".",
"getTreeNodeVisitor",
"(",
")",
";",
"while",
"(",
"!",
... | walks the tree down to a leaf node, adding corruption for a specific feature
@param model the tree model to walk
@param dp the data point to push down the tree
@param j the feature index to corrupt
@param rand source of randomness
@return the leaf node | [
"walks",
"the",
"tree",
"down",
"to",
"a",
"leaf",
"node",
"adding",
"corruption",
"for",
"a",
"specific",
"feature"
] | train | https://github.com/EdwardRaff/JSAT/blob/0ff53b7b39684b2379cc1da522f5b3a954b15cfb/JSAT/src/jsat/classifiers/trees/MDA.java#L139-L158 |
facebookarchive/hadoop-20 | src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java | FSEditLogLoader.getAndUpdateLastInodeId | private static long getAndUpdateLastInodeId(FSDirectory fsDir,
long inodeIdFromOp, int logVersion) throws IOException {
"""
Allocate inode id for legacy edit log, or generate inode id for new edit log,
and update lastInodeId in {@link FSDirectory}
Also doing some sanity check
@param fsDir {@link FSDire... | java | private static long getAndUpdateLastInodeId(FSDirectory fsDir,
long inodeIdFromOp, int logVersion) throws IOException {
long inodeId = inodeIdFromOp;
if (inodeId == INodeId.GRANDFATHER_INODE_ID) {
// This id is read from old edit log
if (LayoutVersion.supports(Feature.ADD_INODE_ID, logVersion... | [
"private",
"static",
"long",
"getAndUpdateLastInodeId",
"(",
"FSDirectory",
"fsDir",
",",
"long",
"inodeIdFromOp",
",",
"int",
"logVersion",
")",
"throws",
"IOException",
"{",
"long",
"inodeId",
"=",
"inodeIdFromOp",
";",
"if",
"(",
"inodeId",
"==",
"INodeId",
"... | Allocate inode id for legacy edit log, or generate inode id for new edit log,
and update lastInodeId in {@link FSDirectory}
Also doing some sanity check
@param fsDir {@link FSDirectory}
@param inodeIdFromOp inode id read from edit log
@param logVersion current layout version
@param lastInodeId the latest inode id in t... | [
"Allocate",
"inode",
"id",
"for",
"legacy",
"edit",
"log",
"or",
"generate",
"inode",
"id",
"for",
"new",
"edit",
"log",
"and",
"update",
"lastInodeId",
"in",
"{",
"@link",
"FSDirectory",
"}",
"Also",
"doing",
"some",
"sanity",
"check"
] | train | https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/hdfs/org/apache/hadoop/hdfs/server/namenode/FSEditLogLoader.java#L82-L100 |
cesarferreira/AndroidQuickUtils | library/src/main/java/quickutils/core/categories/sdcard.java | sdcard.copyFile | public static void copyFile(File fromFile, File toFile) throws IOException {
"""
Creates the specified <code>toFile</code> as a byte for byte copy of the
<code>fromFile</code>. If <code>toFile</code> already exists, then it
will be replaced with a copy of <code>fromFile</code>. The name and path
of <code>toFile... | java | public static void copyFile(File fromFile, File toFile) throws IOException {
copyFile(new FileInputStream(fromFile), new FileOutputStream(toFile));
} | [
"public",
"static",
"void",
"copyFile",
"(",
"File",
"fromFile",
",",
"File",
"toFile",
")",
"throws",
"IOException",
"{",
"copyFile",
"(",
"new",
"FileInputStream",
"(",
"fromFile",
")",
",",
"new",
"FileOutputStream",
"(",
"toFile",
")",
")",
";",
"}"
] | Creates the specified <code>toFile</code> as a byte for byte copy of the
<code>fromFile</code>. If <code>toFile</code> already exists, then it
will be replaced with a copy of <code>fromFile</code>. The name and path
of <code>toFile</code> will be that of <code>toFile</code>.<br/>
<br/>
<i> Note: <code>fromFile</code> a... | [
"Creates",
"the",
"specified",
"<code",
">",
"toFile<",
"/",
"code",
">",
"as",
"a",
"byte",
"for",
"byte",
"copy",
"of",
"the",
"<code",
">",
"fromFile<",
"/",
"code",
">",
".",
"If",
"<code",
">",
"toFile<",
"/",
"code",
">",
"already",
"exists",
"... | train | https://github.com/cesarferreira/AndroidQuickUtils/blob/73a91daedbb9f7be7986ea786fbc441c9e5a881c/library/src/main/java/quickutils/core/categories/sdcard.java#L163-L165 |
webmetrics/browsermob-proxy | src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java | ProxyHandler.isForbidden | protected boolean isForbidden(String scheme, String host, int port, boolean openNonPrivPorts) {
"""
Is scheme,host & port Forbidden.
@param scheme A scheme that mast be in the proxySchemes StringMap.
@param host A host that must pass the white and black lists
@param port A port that must in the allowedConnect... | java | protected boolean isForbidden(String scheme, String host, int port, boolean openNonPrivPorts)
{
// Check port
Integer p = new Integer(port);
if (port > 0 && !_allowedConnectPorts.contains(p))
{
if (!openNonPrivPorts || port <= 1024)
return true;
}
... | [
"protected",
"boolean",
"isForbidden",
"(",
"String",
"scheme",
",",
"String",
"host",
",",
"int",
"port",
",",
"boolean",
"openNonPrivPorts",
")",
"{",
"// Check port",
"Integer",
"p",
"=",
"new",
"Integer",
"(",
"port",
")",
";",
"if",
"(",
"port",
">",
... | Is scheme,host & port Forbidden.
@param scheme A scheme that mast be in the proxySchemes StringMap.
@param host A host that must pass the white and black lists
@param port A port that must in the allowedConnectPorts Set
@param openNonPrivPorts If true ports greater than 1024 are allowed.
@return True if the request to... | [
"Is",
"scheme",
"host",
"&",
"port",
"Forbidden",
"."
] | train | https://github.com/webmetrics/browsermob-proxy/blob/a9252e62246ac33d55d51b993ba1159404e7d389/src/main/java/org/browsermob/proxy/jetty/http/handler/ProxyHandler.java#L586-L609 |
deeplearning4j/deeplearning4j | nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java | SparseCpuLevel1.dnrm2 | @Override
protected double dnrm2(long N, INDArray X, int incx) {
"""
Computes the Euclidean norm of a double vector
@param N The number of elements in vector X
@param X an INDArray
@param incx the increment of X
"""
return cblas_dnrm2((int) N, (DoublePointer) X.data().addressPointer(), incx);
... | java | @Override
protected double dnrm2(long N, INDArray X, int incx){
return cblas_dnrm2((int) N, (DoublePointer) X.data().addressPointer(), incx);
} | [
"@",
"Override",
"protected",
"double",
"dnrm2",
"(",
"long",
"N",
",",
"INDArray",
"X",
",",
"int",
"incx",
")",
"{",
"return",
"cblas_dnrm2",
"(",
"(",
"int",
")",
"N",
",",
"(",
"DoublePointer",
")",
"X",
".",
"data",
"(",
")",
".",
"addressPointe... | Computes the Euclidean norm of a double vector
@param N The number of elements in vector X
@param X an INDArray
@param incx the increment of X | [
"Computes",
"the",
"Euclidean",
"norm",
"of",
"a",
"double",
"vector"
] | train | https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-native/src/main/java/org/nd4j/linalg/cpu/nativecpu/blas/SparseCpuLevel1.java#L85-L88 |
spotify/helios | helios-services/src/main/java/com/spotify/helios/master/resources/HostsResource.java | HostsResource.jobDelete | @DELETE
@Path("/ {
"""
Causes the job identified by its {@link JobId} to be undeployed from the specified host.
This call will fail if the host is not found or the job is not deployed on the host.
@param host The host to undeploy from.
@param jobId The job to undeploy.
@param token The authorization token... | java | @DELETE
@Path("/{host}/jobs/{job}")
@Produces(APPLICATION_JSON)
@Timed
@ExceptionMetered
public JobUndeployResponse jobDelete(@PathParam("host") final String host,
@PathParam("job") final JobId jobId,
@QueryParam("token") @DefaultVa... | [
"@",
"DELETE",
"@",
"Path",
"(",
"\"/{host}/jobs/{job}\"",
")",
"@",
"Produces",
"(",
"APPLICATION_JSON",
")",
"@",
"Timed",
"@",
"ExceptionMetered",
"public",
"JobUndeployResponse",
"jobDelete",
"(",
"@",
"PathParam",
"(",
"\"host\"",
")",
"final",
"String",
"h... | Causes the job identified by its {@link JobId} to be undeployed from the specified host.
This call will fail if the host is not found or the job is not deployed on the host.
@param host The host to undeploy from.
@param jobId The job to undeploy.
@param token The authorization token.
@return The response. | [
"Causes",
"the",
"job",
"identified",
"by",
"its",
"{",
"@link",
"JobId",
"}",
"to",
"be",
"undeployed",
"from",
"the",
"specified",
"host",
".",
"This",
"call",
"will",
"fail",
"if",
"the",
"host",
"is",
"not",
"found",
"or",
"the",
"job",
"is",
"not"... | train | https://github.com/spotify/helios/blob/c9000bc1d6908651570be8b057d4981bba4df5b4/helios-services/src/main/java/com/spotify/helios/master/resources/HostsResource.java#L289-L310 |
j-easy/easy-random | easy-random-core/src/main/java/org/jeasy/random/randomizers/range/LocalDateTimeRangeRandomizer.java | LocalDateTimeRangeRandomizer.aNewLocalDateTimeRangeRandomizer | public static LocalDateTimeRangeRandomizer aNewLocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed) {
"""
Create a new {@link LocalDateTimeRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link LocalDateTimeRangeR... | java | public static LocalDateTimeRangeRandomizer aNewLocalDateTimeRangeRandomizer(final LocalDateTime min, final LocalDateTime max, final long seed) {
return new LocalDateTimeRangeRandomizer(min, max, seed);
} | [
"public",
"static",
"LocalDateTimeRangeRandomizer",
"aNewLocalDateTimeRangeRandomizer",
"(",
"final",
"LocalDateTime",
"min",
",",
"final",
"LocalDateTime",
"max",
",",
"final",
"long",
"seed",
")",
"{",
"return",
"new",
"LocalDateTimeRangeRandomizer",
"(",
"min",
",",
... | Create a new {@link LocalDateTimeRangeRandomizer}.
@param min min value
@param max max value
@param seed initial seed
@return a new {@link LocalDateTimeRangeRandomizer}. | [
"Create",
"a",
"new",
"{",
"@link",
"LocalDateTimeRangeRandomizer",
"}",
"."
] | train | https://github.com/j-easy/easy-random/blob/816b0d6a74c7288af111e70ae1b0b57d7fe3b59d/easy-random-core/src/main/java/org/jeasy/random/randomizers/range/LocalDateTimeRangeRandomizer.java#L85-L87 |
cdapio/tigon | tigon-sql/src/main/java/co/cask/tigon/sql/io/MethodsDriver.java | MethodsDriver.invokeMethods | public void invokeMethods(String queryName, GDATDecoder decoder) throws InvocationTargetException,
IllegalAccessException {
"""
This function invokes all the methods associated with the provided query name
@param queryName Name of query
@param decoder {@link co.cask.tigon.sql.io.GDATDecoder} object for the i... | java | public void invokeMethods(String queryName, GDATDecoder decoder) throws InvocationTargetException,
IllegalAccessException {
for (MethodInvoker methodInvoker : methodListMap.get(queryName)) {
// Reset the position to 0 of the underlying ByteBuffer before calling MethodInvoker.invoke()
decoder.reset()... | [
"public",
"void",
"invokeMethods",
"(",
"String",
"queryName",
",",
"GDATDecoder",
"decoder",
")",
"throws",
"InvocationTargetException",
",",
"IllegalAccessException",
"{",
"for",
"(",
"MethodInvoker",
"methodInvoker",
":",
"methodListMap",
".",
"get",
"(",
"queryNam... | This function invokes all the methods associated with the provided query name
@param queryName Name of query
@param decoder {@link co.cask.tigon.sql.io.GDATDecoder} object for the incoming GDAT format data record
@throws InvocationTargetException thrown by {@link java.lang.reflect.Method}.invoke()
@throws IllegalAccess... | [
"This",
"function",
"invokes",
"all",
"the",
"methods",
"associated",
"with",
"the",
"provided",
"query",
"name"
] | train | https://github.com/cdapio/tigon/blob/5be6dffd7c79519d1211bb08f75be7dcfbbad392/tigon-sql/src/main/java/co/cask/tigon/sql/io/MethodsDriver.java#L100-L107 |
jbossws/jbossws-common | src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java | ReflectionUtils.assertNotStatic | public static void assertNotStatic(final Method method, Class<? extends Annotation> annotation) {
"""
Asserts method is not static.
@param method to validate
@param annotation annotation to propagate in exception message
"""
if (Modifier.isStatic(method.getModifiers()))
{
throw annotat... | java | public static void assertNotStatic(final Method method, Class<? extends Annotation> annotation)
{
if (Modifier.isStatic(method.getModifiers()))
{
throw annotation == null ? MESSAGES.methodCannotBeStatic(method) : MESSAGES.methodCannotBeStatic2(method, annotation);
}
} | [
"public",
"static",
"void",
"assertNotStatic",
"(",
"final",
"Method",
"method",
",",
"Class",
"<",
"?",
"extends",
"Annotation",
">",
"annotation",
")",
"{",
"if",
"(",
"Modifier",
".",
"isStatic",
"(",
"method",
".",
"getModifiers",
"(",
")",
")",
")",
... | Asserts method is not static.
@param method to validate
@param annotation annotation to propagate in exception message | [
"Asserts",
"method",
"is",
"not",
"static",
"."
] | train | https://github.com/jbossws/jbossws-common/blob/fcff8a3ef9bfe046d6fa8c855a3fe4f62841add7/src/main/java/org/jboss/ws/common/injection/finders/ReflectionUtils.java#L205-L211 |
ocelotds/ocelot | ocelot-processor/src/main/java/org/ocelotds/processors/OcelotProcessor.java | OcelotProcessor.writeGeneratedJsInDiferentTargets | void writeGeneratedJsInDiferentTargets(TypeElement element) {
"""
Write generated js service in differents target alway in Service class directory, for no framework eg : org.ocelotds.OcelotServies.js </br>
if jsfwk is defined by user, copy fwk version in class directory eg : org.ocelotds.OcelotServies.ng.js </br>... | java | void writeGeneratedJsInDiferentTargets(TypeElement element) {
String packagePath = getPackagePath(element);
messager.printMessage(Diagnostic.Kind.MANDATORY_WARNING, " javascript generation class : " + element);
writeJsFileToJsDir(element, visitorfwk, packagePath, getFilename(element, jsfwk), jsdir); // one cor... | [
"void",
"writeGeneratedJsInDiferentTargets",
"(",
"TypeElement",
"element",
")",
"{",
"String",
"packagePath",
"=",
"getPackagePath",
"(",
"element",
")",
";",
"messager",
".",
"printMessage",
"(",
"Diagnostic",
".",
"Kind",
".",
"MANDATORY_WARNING",
",",
"\" javasc... | Write generated js service in differents target alway in Service class directory, for no framework eg : org.ocelotds.OcelotServies.js </br>
if jsfwk is defined by user, copy fwk version in class directory eg : org.ocelotds.OcelotServies.ng.js </br>
if jsdir is defined by user, copy normal version or fwk version injsdir... | [
"Write",
"generated",
"js",
"service",
"in",
"differents",
"target",
"alway",
"in",
"Service",
"class",
"directory",
"for",
"no",
"framework",
"eg",
":",
"org",
".",
"ocelotds",
".",
"OcelotServies",
".",
"js",
"<",
"/",
"br",
">",
"if",
"jsfwk",
"is",
"... | train | https://github.com/ocelotds/ocelot/blob/5f0ac37afd8fa4dc9f7234a2aac8abbb522128e7/ocelot-processor/src/main/java/org/ocelotds/processors/OcelotProcessor.java#L202-L208 |
lessthanoptimal/ejml | main/ejml-core/src/org/ejml/ops/ReadMatrixCsv.java | ReadMatrixCsv.readZDRM | public ZMatrixRMaj readZDRM(int numRows, int numCols) throws IOException {
"""
Reads in a {@link ZMatrixRMaj} from the IO stream where the user specifies the matrix dimensions.
@param numRows Number of rows in the matrix
@param numCols Number of columns in the matrix
@return ZMatrixRMaj
@throws IOException
... | java | public ZMatrixRMaj readZDRM(int numRows, int numCols) throws IOException {
ZMatrixRMaj A = new ZMatrixRMaj(numRows,numCols);
int wordsCol = numCols*2;
for( int i = 0; i < numRows; i++ ) {
List<String> words = extractWords();
if( words == null )
throw ne... | [
"public",
"ZMatrixRMaj",
"readZDRM",
"(",
"int",
"numRows",
",",
"int",
"numCols",
")",
"throws",
"IOException",
"{",
"ZMatrixRMaj",
"A",
"=",
"new",
"ZMatrixRMaj",
"(",
"numRows",
",",
"numCols",
")",
";",
"int",
"wordsCol",
"=",
"numCols",
"*",
"2",
";",... | Reads in a {@link ZMatrixRMaj} from the IO stream where the user specifies the matrix dimensions.
@param numRows Number of rows in the matrix
@param numCols Number of columns in the matrix
@return ZMatrixRMaj
@throws IOException | [
"Reads",
"in",
"a",
"{",
"@link",
"ZMatrixRMaj",
"}",
"from",
"the",
"IO",
"stream",
"where",
"the",
"user",
"specifies",
"the",
"matrix",
"dimensions",
"."
] | train | https://github.com/lessthanoptimal/ejml/blob/1444680cc487af5e866730e62f48f5f9636850d9/main/ejml-core/src/org/ejml/ops/ReadMatrixCsv.java#L183-L206 |
languagetool-org/languagetool | languagetool-core/src/main/java/org/languagetool/rules/patterns/Match.java | Match.createState | public MatchState createState(Synthesizer synthesizer, AnalyzedTokenReadings token) {
"""
Creates a state used for actually matching a token.
@since 2.3
"""
MatchState state = new MatchState(this, synthesizer);
state.setToken(token);
return state;
} | java | public MatchState createState(Synthesizer synthesizer, AnalyzedTokenReadings token) {
MatchState state = new MatchState(this, synthesizer);
state.setToken(token);
return state;
} | [
"public",
"MatchState",
"createState",
"(",
"Synthesizer",
"synthesizer",
",",
"AnalyzedTokenReadings",
"token",
")",
"{",
"MatchState",
"state",
"=",
"new",
"MatchState",
"(",
"this",
",",
"synthesizer",
")",
";",
"state",
".",
"setToken",
"(",
"token",
")",
... | Creates a state used for actually matching a token.
@since 2.3 | [
"Creates",
"a",
"state",
"used",
"for",
"actually",
"matching",
"a",
"token",
"."
] | train | https://github.com/languagetool-org/languagetool/blob/b7a3d63883d242fb2525877c6382681c57a0a142/languagetool-core/src/main/java/org/languagetool/rules/patterns/Match.java#L92-L96 |
dlemmermann/CalendarFX | CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java | Calendar.addEntryToResult | private void addEntryToResult(Map<LocalDate, List<Entry<?>>> result, Entry<?> entry, LocalDate startDate, LocalDate endDate) {
"""
/*
Assign the given entry to each date that it intersects with in the given search interval.
"""
LocalDate entryStartDate = entry.getStartDate();
LocalDate entryEn... | java | private void addEntryToResult(Map<LocalDate, List<Entry<?>>> result, Entry<?> entry, LocalDate startDate, LocalDate endDate) {
LocalDate entryStartDate = entry.getStartDate();
LocalDate entryEndDate = entry.getEndDate();
// entry does not intersect with time interval
if (entryEndDate.is... | [
"private",
"void",
"addEntryToResult",
"(",
"Map",
"<",
"LocalDate",
",",
"List",
"<",
"Entry",
"<",
"?",
">",
">",
">",
"result",
",",
"Entry",
"<",
"?",
">",
"entry",
",",
"LocalDate",
"startDate",
",",
"LocalDate",
"endDate",
")",
"{",
"LocalDate",
... | /*
Assign the given entry to each date that it intersects with in the given search interval. | [
"/",
"*",
"Assign",
"the",
"given",
"entry",
"to",
"each",
"date",
"that",
"it",
"intersects",
"with",
"in",
"the",
"given",
"search",
"interval",
"."
] | train | https://github.com/dlemmermann/CalendarFX/blob/f2b91c2622c3f29d004485b6426b23b86c331f96/CalendarFXView/src/main/java/com/calendarfx/model/Calendar.java#L389-L411 |
pip-services3-java/pip-services3-commons-java | src/org/pipservices3/commons/random/RandomLong.java | RandomLong.updateLong | public static long updateLong(long value, long range) {
"""
Updates (drifts) a long value within specified range defined
@param value a long value to drift.
@param range (optional) a range. Default: 10% of the value
@return updated random long value.
"""
range = range == 0 ? (long)(0.1 * value) :... | java | public static long updateLong(long value, long range)
{
range = range == 0 ? (long)(0.1 * value) : range;
long minValue = value - range;
long maxValue = value + range;
return nextLong(minValue, maxValue);
} | [
"public",
"static",
"long",
"updateLong",
"(",
"long",
"value",
",",
"long",
"range",
")",
"{",
"range",
"=",
"range",
"==",
"0",
"?",
"(",
"long",
")",
"(",
"0.1",
"*",
"value",
")",
":",
"range",
";",
"long",
"minValue",
"=",
"value",
"-",
"range... | Updates (drifts) a long value within specified range defined
@param value a long value to drift.
@param range (optional) a range. Default: 10% of the value
@return updated random long value. | [
"Updates",
"(",
"drifts",
")",
"a",
"long",
"value",
"within",
"specified",
"range",
"defined"
] | train | https://github.com/pip-services3-java/pip-services3-commons-java/blob/a8a0c3e5ec58f0663c295aa855c6b3afad2af86a/src/org/pipservices3/commons/random/RandomLong.java#L69-L75 |
openbaton/openbaton-client | sdk/src/main/java/org/openbaton/sdk/api/util/RestRequest.java | RestRequest.preparePostHeader | private void preparePostHeader(HttpPost httpPost, String acceptMimeType, String contentMimeType) {
"""
Add accept, content-type, projectId and token headers to an HttpPost object.
@param httpPost
@param acceptMimeType
@param contentMimeType
"""
if (acceptMimeType != null && !acceptMimeType.equals(""))... | java | private void preparePostHeader(HttpPost httpPost, String acceptMimeType, String contentMimeType) {
if (acceptMimeType != null && !acceptMimeType.equals("")) {
httpPost.setHeader(new BasicHeader("accept", acceptMimeType));
}
if (contentMimeType != null && !contentMimeType.equals("")) {
httpPost.s... | [
"private",
"void",
"preparePostHeader",
"(",
"HttpPost",
"httpPost",
",",
"String",
"acceptMimeType",
",",
"String",
"contentMimeType",
")",
"{",
"if",
"(",
"acceptMimeType",
"!=",
"null",
"&&",
"!",
"acceptMimeType",
".",
"equals",
"(",
"\"\"",
")",
")",
"{",... | Add accept, content-type, projectId and token headers to an HttpPost object.
@param httpPost
@param acceptMimeType
@param contentMimeType | [
"Add",
"accept",
"content",
"-",
"type",
"projectId",
"and",
"token",
"headers",
"to",
"an",
"HttpPost",
"object",
"."
] | train | https://github.com/openbaton/openbaton-client/blob/6ca6dd6b62a23940d312213d6fa489d5b636061a/sdk/src/main/java/org/openbaton/sdk/api/util/RestRequest.java#L364-L375 |
sebastiangraf/perfidix | src/main/java/org/perfidix/Benchmark.java | Benchmark.getBenchmarkElements | private List<BenchmarkElement> getBenchmarkElements(
final Map<Class<?>, Object> paramObjs)
throws PerfidixMethodCheckException {
"""
Getting all benchmarkable objects out of the registered classes with the
annotated number of runs.
@param paramObjs
a set with all existing objects for getting data from ... | java | private List<BenchmarkElement> getBenchmarkElements(
final Map<Class<?>, Object> paramObjs)
throws PerfidixMethodCheckException {
final List<BenchmarkElement> elems = new ArrayList<BenchmarkElement>();
final List<BenchmarkMethod> meths = getBenchmarkMethods();
for (final BenchmarkMethod meth : meths) {
... | [
"private",
"List",
"<",
"BenchmarkElement",
">",
"getBenchmarkElements",
"(",
"final",
"Map",
"<",
"Class",
"<",
"?",
">",
",",
"Object",
">",
"paramObjs",
")",
"throws",
"PerfidixMethodCheckException",
"{",
"final",
"List",
"<",
"BenchmarkElement",
">",
"elems"... | Getting all benchmarkable objects out of the registered classes with the
annotated number of runs.
@param paramObjs
a set with all existing objects for getting data from the
dataproviders
@return a Set with {@link BenchmarkMethod}
@throws PerfidixMethodCheckException | [
"Getting",
"all",
"benchmarkable",
"objects",
"out",
"of",
"the",
"registered",
"classes",
"with",
"the",
"annotated",
"number",
"of",
"runs",
"."
] | train | https://github.com/sebastiangraf/perfidix/blob/f13aa793b6a3055215ed4edbb946c1bb5d564886/src/main/java/org/perfidix/Benchmark.java#L431-L470 |
prometheus/client_java | simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java | PushGateway.pushAdd | public void pushAdd(CollectorRegistry registry, String job) throws IOException {
"""
Pushes all metrics in a registry, replacing only previously pushed metrics of the same name and job and no grouping key.
<p>
This uses the POST HTTP method.
"""
doRequest(registry, job, null, "POST");
} | java | public void pushAdd(CollectorRegistry registry, String job) throws IOException {
doRequest(registry, job, null, "POST");
} | [
"public",
"void",
"pushAdd",
"(",
"CollectorRegistry",
"registry",
",",
"String",
"job",
")",
"throws",
"IOException",
"{",
"doRequest",
"(",
"registry",
",",
"job",
",",
"null",
",",
"\"POST\"",
")",
";",
"}"
] | Pushes all metrics in a registry, replacing only previously pushed metrics of the same name and job and no grouping key.
<p>
This uses the POST HTTP method. | [
"Pushes",
"all",
"metrics",
"in",
"a",
"registry",
"replacing",
"only",
"previously",
"pushed",
"metrics",
"of",
"the",
"same",
"name",
"and",
"job",
"and",
"no",
"grouping",
"key",
".",
"<p",
">",
"This",
"uses",
"the",
"POST",
"HTTP",
"method",
"."
] | train | https://github.com/prometheus/client_java/blob/4e0e7527b048f1ffd0382dcb74c0b9dab23b4d9f/simpleclient_pushgateway/src/main/java/io/prometheus/client/exporter/PushGateway.java#L157-L159 |
FaritorKang/unmz-common-util | src/main/java/net/unmz/java/util/http/HttpUtils.java | HttpUtils.doPut | public static String doPut(String host, String path,
Map<String, String> headers,
Map<String, String> queries) throws Exception {
"""
Put String
@param host
@param path
@param headers
@param queries
@param body
@return
@throws Exception
"""... | java | public static String doPut(String host, String path,
Map<String, String> headers,
Map<String, String> queries) throws Exception {
return doPut(host, path, headers, queries, "");
} | [
"public",
"static",
"String",
"doPut",
"(",
"String",
"host",
",",
"String",
"path",
",",
"Map",
"<",
"String",
",",
"String",
">",
"headers",
",",
"Map",
"<",
"String",
",",
"String",
">",
"queries",
")",
"throws",
"Exception",
"{",
"return",
"doPut",
... | Put String
@param host
@param path
@param headers
@param queries
@param body
@return
@throws Exception | [
"Put",
"String"
] | train | https://github.com/FaritorKang/unmz-common-util/blob/2912b8889b85ed910d536f85b24b6fa68035814a/src/main/java/net/unmz/java/util/http/HttpUtils.java#L264-L268 |
FXMisc/WellBehavedFX | src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java | InputMapTemplate.installFallback | public static <S, N extends Node, E extends Event> void installFallback(InputMapTemplate<S, E> imt, S target, Function<? super S, ? extends N> getNode) {
"""
Instantiates the input map and installs it into the node via {@link Nodes#addFallbackInputMap(Node, InputMap)}
"""
Nodes.addFallbackInputMap(getN... | java | public static <S, N extends Node, E extends Event> void installFallback(InputMapTemplate<S, E> imt, S target, Function<? super S, ? extends N> getNode) {
Nodes.addFallbackInputMap(getNode.apply(target), imt.instantiate(target));
} | [
"public",
"static",
"<",
"S",
",",
"N",
"extends",
"Node",
",",
"E",
"extends",
"Event",
">",
"void",
"installFallback",
"(",
"InputMapTemplate",
"<",
"S",
",",
"E",
">",
"imt",
",",
"S",
"target",
",",
"Function",
"<",
"?",
"super",
"S",
",",
"?",
... | Instantiates the input map and installs it into the node via {@link Nodes#addFallbackInputMap(Node, InputMap)} | [
"Instantiates",
"the",
"input",
"map",
"and",
"installs",
"it",
"into",
"the",
"node",
"via",
"{"
] | train | https://github.com/FXMisc/WellBehavedFX/blob/ca889734481f5439655ca8deb6f742964b5654b0/src/main/java/org/fxmisc/wellbehaved/event/template/InputMapTemplate.java#L392-L394 |
OpenLiberty/open-liberty | dev/com.ibm.ws.junit.extensions/src/com/ibm/websphere/ras/CapturedOutputHolder.java | CapturedOutputHolder.writeStreamOutput | @Override
protected synchronized void writeStreamOutput(SystemLogHolder holder, String txt, boolean rawStream) {
"""
This overrides the BaseTraceService method that writes output to the
system streams. If the output is for a captured stream, we shunt the output
over to that stream instead.
<p>
We're relyin... | java | @Override
protected synchronized void writeStreamOutput(SystemLogHolder holder, String txt, boolean rawStream) {
if (holder == systemErr && capturedSystemErr != null) {
// clear the hushed stream if there was an error using it
capturedSystemErr = writeCapturedData(holder, txt, captur... | [
"@",
"Override",
"protected",
"synchronized",
"void",
"writeStreamOutput",
"(",
"SystemLogHolder",
"holder",
",",
"String",
"txt",
",",
"boolean",
"rawStream",
")",
"{",
"if",
"(",
"holder",
"==",
"systemErr",
"&&",
"capturedSystemErr",
"!=",
"null",
")",
"{",
... | This overrides the BaseTraceService method that writes output to the
system streams. If the output is for a captured stream, we shunt the output
over to that stream instead.
<p>
We're relying on the BaseTraceService to manage set/restore of system streams.
The SharedOutputManager makes sure that Tr as a whole is starte... | [
"This",
"overrides",
"the",
"BaseTraceService",
"method",
"that",
"writes",
"output",
"to",
"the",
"system",
"streams",
".",
"If",
"the",
"output",
"is",
"for",
"a",
"captured",
"stream",
"we",
"shunt",
"the",
"output",
"over",
"to",
"that",
"stream",
"inste... | train | https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.junit.extensions/src/com/ibm/websphere/ras/CapturedOutputHolder.java#L168-L179 |
Alluxio/alluxio | core/common/src/main/java/alluxio/collections/LockCache.java | LockCache.get | public LockResource get(K key, LockMode mode) {
"""
Locks the specified key in the specified mode.
@param key the key to lock
@param mode the mode to lock in
@return a lock resource which must be closed to unlock the key
"""
ValNode valNode = getValNode(key);
ReentrantReadWriteLock lock = valNode.... | java | public LockResource get(K key, LockMode mode) {
ValNode valNode = getValNode(key);
ReentrantReadWriteLock lock = valNode.mValue;
switch (mode) {
case READ:
return new RefCountLockResource(lock.readLock(), true, valNode.mRefCount);
case WRITE:
return new RefCountLockResource(lock.... | [
"public",
"LockResource",
"get",
"(",
"K",
"key",
",",
"LockMode",
"mode",
")",
"{",
"ValNode",
"valNode",
"=",
"getValNode",
"(",
"key",
")",
";",
"ReentrantReadWriteLock",
"lock",
"=",
"valNode",
".",
"mValue",
";",
"switch",
"(",
"mode",
")",
"{",
"ca... | Locks the specified key in the specified mode.
@param key the key to lock
@param mode the mode to lock in
@return a lock resource which must be closed to unlock the key | [
"Locks",
"the",
"specified",
"key",
"in",
"the",
"specified",
"mode",
"."
] | train | https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/core/common/src/main/java/alluxio/collections/LockCache.java#L123-L134 |
apache/groovy | src/main/groovy/groovy/time/TimeCategory.java | TimeCategory.minus | public static TimeDuration minus(final Date lhs, final Date rhs) {
"""
Subtract one date from the other.
@param lhs a Date
@param rhs another Date
@return a Duration
"""
long milliseconds = lhs.getTime() - rhs.getTime();
long days = milliseconds / (24 * 60 * 60 * 1000);
millisecond... | java | public static TimeDuration minus(final Date lhs, final Date rhs) {
long milliseconds = lhs.getTime() - rhs.getTime();
long days = milliseconds / (24 * 60 * 60 * 1000);
milliseconds -= days * 24 * 60 * 60 * 1000;
int hours = (int) (milliseconds / (60 * 60 * 1000));
milliseconds -=... | [
"public",
"static",
"TimeDuration",
"minus",
"(",
"final",
"Date",
"lhs",
",",
"final",
"Date",
"rhs",
")",
"{",
"long",
"milliseconds",
"=",
"lhs",
".",
"getTime",
"(",
")",
"-",
"rhs",
".",
"getTime",
"(",
")",
";",
"long",
"days",
"=",
"milliseconds... | Subtract one date from the other.
@param lhs a Date
@param rhs another Date
@return a Duration | [
"Subtract",
"one",
"date",
"from",
"the",
"other",
"."
] | train | https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/groovy/groovy/time/TimeCategory.java#L118-L130 |
fabric8io/ipaas-quickstarts | archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java | ArchetypeBuilder.fileIncludesLine | private boolean fileIncludesLine(File file, String matches) throws IOException {
"""
Checks whether the file contains specific line. Partial matches do not count.
"""
for (String line: Files.readLines(file)) {
String trimmed = line.trim();
if (trimmed.equals(matches)) {
... | java | private boolean fileIncludesLine(File file, String matches) throws IOException {
for (String line: Files.readLines(file)) {
String trimmed = line.trim();
if (trimmed.equals(matches)) {
return true;
}
}
return false;
} | [
"private",
"boolean",
"fileIncludesLine",
"(",
"File",
"file",
",",
"String",
"matches",
")",
"throws",
"IOException",
"{",
"for",
"(",
"String",
"line",
":",
"Files",
".",
"readLines",
"(",
"file",
")",
")",
"{",
"String",
"trimmed",
"=",
"line",
".",
"... | Checks whether the file contains specific line. Partial matches do not count. | [
"Checks",
"whether",
"the",
"file",
"contains",
"specific",
"line",
".",
"Partial",
"matches",
"do",
"not",
"count",
"."
] | train | https://github.com/fabric8io/ipaas-quickstarts/blob/cf9a9aa09204a82ac996304ab8c96791f7e5db22/archetype-builder/src/main/java/io/fabric8/tooling/archetype/builder/ArchetypeBuilder.java#L683-L691 |
Azure/azure-sdk-for-java | batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java | JobsImpl.disableAsync | public Observable<Void> disableAsync(String jobId, DisableJobOption disableTasks) {
"""
Disables the specified job, preventing new tasks from running.
The Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks parameter to determine what to do with the currently running t... | java | public Observable<Void> disableAsync(String jobId, DisableJobOption disableTasks) {
return disableWithServiceResponseAsync(jobId, disableTasks).map(new Func1<ServiceResponseWithHeaders<Void, JobDisableHeaders>, Void>() {
@Override
public Void call(ServiceResponseWithHeaders<Void, JobDisa... | [
"public",
"Observable",
"<",
"Void",
">",
"disableAsync",
"(",
"String",
"jobId",
",",
"DisableJobOption",
"disableTasks",
")",
"{",
"return",
"disableWithServiceResponseAsync",
"(",
"jobId",
",",
"disableTasks",
")",
".",
"map",
"(",
"new",
"Func1",
"<",
"Servi... | Disables the specified job, preventing new tasks from running.
The Batch Service immediately moves the job to the disabling state. Batch then uses the disableTasks parameter to determine what to do with the currently running tasks of the job. The job remains in the disabling state until the disable operation is complet... | [
"Disables",
"the",
"specified",
"job",
"preventing",
"new",
"tasks",
"from",
"running",
".",
"The",
"Batch",
"Service",
"immediately",
"moves",
"the",
"job",
"to",
"the",
"disabling",
"state",
".",
"Batch",
"then",
"uses",
"the",
"disableTasks",
"parameter",
"... | train | https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/batch/data-plane/src/main/java/com/microsoft/azure/batch/protocol/implementation/JobsImpl.java#L1343-L1350 |
kiegroup/jbpmmigration | src/main/java/org/jbpm/migration/Validator.java | Validator.validateDefinition | static boolean validateDefinition(final String def, final ProcessLanguage language) {
"""
Validate a given jPDL process definition against the applicable definition language's schema.
@param def
The process definition, in {@link String} format.
@param language
The process definition language for which the gi... | java | static boolean validateDefinition(final String def, final ProcessLanguage language) {
return XmlUtils.validate(new StreamSource(new StringReader(def)), language.getSchemaSources());
} | [
"static",
"boolean",
"validateDefinition",
"(",
"final",
"String",
"def",
",",
"final",
"ProcessLanguage",
"language",
")",
"{",
"return",
"XmlUtils",
".",
"validate",
"(",
"new",
"StreamSource",
"(",
"new",
"StringReader",
"(",
"def",
")",
")",
",",
"language... | Validate a given jPDL process definition against the applicable definition language's schema.
@param def
The process definition, in {@link String} format.
@param language
The process definition language for which the given definition is to be validated.
@return Whether the validation was successful. | [
"Validate",
"a",
"given",
"jPDL",
"process",
"definition",
"against",
"the",
"applicable",
"definition",
"language",
"s",
"schema",
"."
] | train | https://github.com/kiegroup/jbpmmigration/blob/5e133e2824aa38f316a2eb061123313a7276aba0/src/main/java/org/jbpm/migration/Validator.java#L99-L101 |
grails/grails-core | grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java | GrailsASTUtils.addDelegateInstanceMethod | public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expression delegate, MethodNode declaredMethod, AnnotationNode markerAnnotation, boolean thisAsFirstArgument, Map<String, ClassNode> genericsPlaceholders, boolean noNullCheck) {
"""
Adds a delegate method to the target class node where the fir... | java | public static MethodNode addDelegateInstanceMethod(ClassNode classNode, Expression delegate, MethodNode declaredMethod, AnnotationNode markerAnnotation, boolean thisAsFirstArgument, Map<String, ClassNode> genericsPlaceholders, boolean noNullCheck) {
Parameter[] parameterTypes = thisAsFirstArgument ? getRemainin... | [
"public",
"static",
"MethodNode",
"addDelegateInstanceMethod",
"(",
"ClassNode",
"classNode",
",",
"Expression",
"delegate",
",",
"MethodNode",
"declaredMethod",
",",
"AnnotationNode",
"markerAnnotation",
",",
"boolean",
"thisAsFirstArgument",
",",
"Map",
"<",
"String",
... | Adds a delegate method to the target class node where the first argument
is to the delegate method is 'this'. In other words a method such as
foo(Object instance, String bar) would be added with a signature of foo(String)
and 'this' is passed to the delegate instance
@param classNode The class node
@param delegate The... | [
"Adds",
"a",
"delegate",
"method",
"to",
"the",
"target",
"class",
"node",
"where",
"the",
"first",
"argument",
"is",
"to",
"the",
"delegate",
"method",
"is",
"this",
".",
"In",
"other",
"words",
"a",
"method",
"such",
"as",
"foo",
"(",
"Object",
"instan... | train | https://github.com/grails/grails-core/blob/c0b08aa995b0297143b75d05642abba8cb7b4122/grails-core/src/main/groovy/org/grails/compiler/injection/GrailsASTUtils.java#L252-L295 |
jbundle/jbundle | base/screen/model/src/main/java/org/jbundle/base/screen/model/MenuScreen.java | MenuScreen.getURLMenu | public String getURLMenu() {
"""
From the URL, get the menu.
First try the app URL, then try the host URL (ie., www.tourgeek.com/fred then www.tourgeek.com).
@return The menu name.
"""
String strMenu = this.getProperty(DBParams.URL);
if ((strMenu != null) && (strMenu.length() > 0))
{ ... | java | public String getURLMenu()
{
String strMenu = this.getProperty(DBParams.URL);
if ((strMenu != null) && (strMenu.length() > 0))
{ // Look to see if this URL has a menu associated with it.
strMenu = Utility.getDomainFromURL(strMenu, null);
// Now I have the domain nam... | [
"public",
"String",
"getURLMenu",
"(",
")",
"{",
"String",
"strMenu",
"=",
"this",
".",
"getProperty",
"(",
"DBParams",
".",
"URL",
")",
";",
"if",
"(",
"(",
"strMenu",
"!=",
"null",
")",
"&&",
"(",
"strMenu",
".",
"length",
"(",
")",
">",
"0",
")"... | From the URL, get the menu.
First try the app URL, then try the host URL (ie., www.tourgeek.com/fred then www.tourgeek.com).
@return The menu name. | [
"From",
"the",
"URL",
"get",
"the",
"menu",
".",
"First",
"try",
"the",
"app",
"URL",
"then",
"try",
"the",
"host",
"URL",
"(",
"ie",
".",
"www",
".",
"tourgeek",
".",
"com",
"/",
"fred",
"then",
"www",
".",
"tourgeek",
".",
"com",
")",
"."
] | train | https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/screen/model/src/main/java/org/jbundle/base/screen/model/MenuScreen.java#L254-L279 |
revelytix/spark | spark-http-client/src/main/java/spark/protocol/SparqlCall.java | SparqlCall.addHeaders | static void addHeaders(HttpUriRequest req, String mimeType) {
"""
Add headers to a request.
@param req The request to set the headers on.
"""
if (POST.equalsIgnoreCase(req.getMethod())) {
req.addHeader(CONTENT_TYPE, FORM_ENCODED);
}
if (mimeType != null) req.setHeader(ACCEPT, mimeType);
} | java | static void addHeaders(HttpUriRequest req, String mimeType) {
if (POST.equalsIgnoreCase(req.getMethod())) {
req.addHeader(CONTENT_TYPE, FORM_ENCODED);
}
if (mimeType != null) req.setHeader(ACCEPT, mimeType);
} | [
"static",
"void",
"addHeaders",
"(",
"HttpUriRequest",
"req",
",",
"String",
"mimeType",
")",
"{",
"if",
"(",
"POST",
".",
"equalsIgnoreCase",
"(",
"req",
".",
"getMethod",
"(",
")",
")",
")",
"{",
"req",
".",
"addHeader",
"(",
"CONTENT_TYPE",
",",
"FORM... | Add headers to a request.
@param req The request to set the headers on. | [
"Add",
"headers",
"to",
"a",
"request",
"."
] | train | https://github.com/revelytix/spark/blob/d777d40c962bc66fdc04b7c3a66d20b777ff6fb4/spark-http-client/src/main/java/spark/protocol/SparqlCall.java#L191-L196 |
likethecolor/Alchemy-API | src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java | AbstractParser.getJSONObject | protected JSONObject getJSONObject(final String key, final JSONObject jsonObject) {
"""
Check to make sure the JSONObject has the specified key and if so return
the value as a JSONObject. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object f... | java | protected JSONObject getJSONObject(final String key, final JSONObject jsonObject) {
JSONObject json = null;
try {
if(hasKey(key, jsonObject)) {
json = jsonObject.getJSONObject(key);
}
}
catch(JSONException e) {
LOGGER.error("Could not get JSONObject from JSONObject for key: " +... | [
"protected",
"JSONObject",
"getJSONObject",
"(",
"final",
"String",
"key",
",",
"final",
"JSONObject",
"jsonObject",
")",
"{",
"JSONObject",
"json",
"=",
"null",
";",
"try",
"{",
"if",
"(",
"hasKey",
"(",
"key",
",",
"jsonObject",
")",
")",
"{",
"json",
... | Check to make sure the JSONObject has the specified key and if so return
the value as a JSONObject. If no key is found null is returned.
@param key name of the field to fetch from the json object
@param jsonObject object from which to fetch the value
@return json object value corresponding to the key or null if key n... | [
"Check",
"to",
"make",
"sure",
"the",
"JSONObject",
"has",
"the",
"specified",
"key",
"and",
"if",
"so",
"return",
"the",
"value",
"as",
"a",
"JSONObject",
".",
"If",
"no",
"key",
"is",
"found",
"null",
"is",
"returned",
"."
] | train | https://github.com/likethecolor/Alchemy-API/blob/5208cfc92a878ceeaff052787af29da92d98db7e/src/main/java/com/likethecolor/alchemy/api/parser/json/AbstractParser.java#L278-L289 |
BorderTech/wcomponents | wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphDump.java | ObjectGraphDump.visitMap | private void visitMap(final ObjectGraphNode node) {
"""
Visits all the keys and entries of the given map.
@param node the ObjectGraphNode containing the map.
"""
Map map = (Map) node.getValue();
for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
O... | java | private void visitMap(final ObjectGraphNode node) {
Map map = (Map) node.getValue();
for (Iterator i = map.entrySet().iterator(); i.hasNext();) {
Map.Entry entry = (Map.Entry) i.next();
Object key = entry.getKey();
if (key != null) {
ObjectGraphNode keyNode = new ObjectGraphNode(++nodeCount, "key", k... | [
"private",
"void",
"visitMap",
"(",
"final",
"ObjectGraphNode",
"node",
")",
"{",
"Map",
"map",
"=",
"(",
"Map",
")",
"node",
".",
"getValue",
"(",
")",
";",
"for",
"(",
"Iterator",
"i",
"=",
"map",
".",
"entrySet",
"(",
")",
".",
"iterator",
"(",
... | Visits all the keys and entries of the given map.
@param node the ObjectGraphNode containing the map. | [
"Visits",
"all",
"the",
"keys",
"and",
"entries",
"of",
"the",
"given",
"map",
"."
] | train | https://github.com/BorderTech/wcomponents/blob/d1a2b2243270067db030feb36ca74255aaa94436/wcomponents-core/src/main/java/com/github/bordertech/wcomponents/util/ObjectGraphDump.java#L292-L325 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.