repository_name
stringlengths
7
54
func_path_in_repository
stringlengths
18
196
func_name
stringlengths
7
107
whole_func_string
stringlengths
76
3.82k
language
stringclasses
1 value
func_code_string
stringlengths
76
3.82k
func_code_tokens
listlengths
22
717
func_documentation_string
stringlengths
61
1.98k
func_documentation_tokens
listlengths
1
508
split_name
stringclasses
1 value
func_code_url
stringlengths
111
310
jayantk/jklol
src/com/jayantkrish/jklol/cvsm/CvsmSufficientStatistics.java
CvsmSufficientStatistics.incrementEntry
public void incrementEntry(int i, SufficientStatistics increment) { ensureStatisticInstantiated(i); statistics.get(i).increment(increment, 1.0); }
java
public void incrementEntry(int i, SufficientStatistics increment) { ensureStatisticInstantiated(i); statistics.get(i).increment(increment, 1.0); }
[ "public", "void", "incrementEntry", "(", "int", "i", ",", "SufficientStatistics", "increment", ")", "{", "ensureStatisticInstantiated", "(", "i", ")", ";", "statistics", ".", "get", "(", "i", ")", ".", "increment", "(", "increment", ",", "1.0", ")", ";", "...
Adds {@code increment} to the {@code i}th parameter vector in this. @param i @param increment
[ "Adds", "{", "@code", "increment", "}", "to", "the", "{", "@code", "i", "}", "th", "parameter", "vector", "in", "this", "." ]
train
https://github.com/jayantk/jklol/blob/d27532ca83e212d51066cf28f52621acc3fd44cc/src/com/jayantkrish/jklol/cvsm/CvsmSufficientStatistics.java#L110-L113
joelittlejohn/jsonschema2pojo
jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/ArrayRule.java
ArrayRule.apply
@Override public JClass apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema) { boolean uniqueItems = node.has("uniqueItems") && node.get("uniqueItems").asBoolean(); boolean rootSchemaIsArray = !schema.isGenerated(); JType itemType; if (node.has("items")) { itemType = ruleFactory.getSchemaRule().apply(makeSingular(nodeName), node.get("items"), node, jpackage, schema); } else { itemType = jpackage.owner().ref(Object.class); } JClass arrayType; if (uniqueItems) { arrayType = jpackage.owner().ref(Set.class).narrow(itemType); } else { arrayType = jpackage.owner().ref(List.class).narrow(itemType); } if (rootSchemaIsArray) { schema.setJavaType(arrayType); } return arrayType; }
java
@Override public JClass apply(String nodeName, JsonNode node, JsonNode parent, JPackage jpackage, Schema schema) { boolean uniqueItems = node.has("uniqueItems") && node.get("uniqueItems").asBoolean(); boolean rootSchemaIsArray = !schema.isGenerated(); JType itemType; if (node.has("items")) { itemType = ruleFactory.getSchemaRule().apply(makeSingular(nodeName), node.get("items"), node, jpackage, schema); } else { itemType = jpackage.owner().ref(Object.class); } JClass arrayType; if (uniqueItems) { arrayType = jpackage.owner().ref(Set.class).narrow(itemType); } else { arrayType = jpackage.owner().ref(List.class).narrow(itemType); } if (rootSchemaIsArray) { schema.setJavaType(arrayType); } return arrayType; }
[ "@", "Override", "public", "JClass", "apply", "(", "String", "nodeName", ",", "JsonNode", "node", ",", "JsonNode", "parent", ",", "JPackage", "jpackage", ",", "Schema", "schema", ")", "{", "boolean", "uniqueItems", "=", "node", ".", "has", "(", "\"uniqueItem...
<p>Applies this schema rule to take the required code generation steps.</p> <p>When constructs of type "array" appear in the schema, these are mapped to Java collections in the generated POJO. If the array is marked as having "uniqueItems" then the resulting Java type is {@link Set}, if not, then the resulting Java type is {@link List}. The schema given by "items" will decide the generic type of the collection.</p> <p>If the "items" property requires newly generated types, then the type name will be the singular version of the nodeName (unless overridden by the javaType property) e.g. <pre> "fooBars" : {"type":"array", "uniqueItems":"true", "items":{type:"object"}} ==&gt; {@code Set<FooBar> getFooBars(); } </pre> </p> @param nodeName the name of the property which has type "array" @param node the schema "type" node @param parent the parent node @param jpackage the package into which newly generated types should be added @return the Java type associated with this array rule, either {@link Set} or {@link List}, narrowed by the "items" type
[ "<p", ">", "Applies", "this", "schema", "rule", "to", "take", "the", "required", "code", "generation", "steps", ".", "<", "/", "p", ">" ]
train
https://github.com/joelittlejohn/jsonschema2pojo/blob/0552b80db93214eb186e4ae45b40866cc1e7eb84/jsonschema2pojo-core/src/main/java/org/jsonschema2pojo/rules/ArrayRule.java#L75-L100
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java
DdosProtectionPlansInner.getByResourceGroupAsync
public Observable<DdosProtectionPlanInner> getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1<ServiceResponse<DdosProtectionPlanInner>, DdosProtectionPlanInner>() { @Override public DdosProtectionPlanInner call(ServiceResponse<DdosProtectionPlanInner> response) { return response.body(); } }); }
java
public Observable<DdosProtectionPlanInner> getByResourceGroupAsync(String resourceGroupName, String ddosProtectionPlanName) { return getByResourceGroupWithServiceResponseAsync(resourceGroupName, ddosProtectionPlanName).map(new Func1<ServiceResponse<DdosProtectionPlanInner>, DdosProtectionPlanInner>() { @Override public DdosProtectionPlanInner call(ServiceResponse<DdosProtectionPlanInner> response) { return response.body(); } }); }
[ "public", "Observable", "<", "DdosProtectionPlanInner", ">", "getByResourceGroupAsync", "(", "String", "resourceGroupName", ",", "String", "ddosProtectionPlanName", ")", "{", "return", "getByResourceGroupWithServiceResponseAsync", "(", "resourceGroupName", ",", "ddosProtectionP...
Gets information about the specified DDoS protection plan. @param resourceGroupName The name of the resource group. @param ddosProtectionPlanName The name of the DDoS protection plan. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the DdosProtectionPlanInner object
[ "Gets", "information", "about", "the", "specified", "DDoS", "protection", "plan", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/DdosProtectionPlansInner.java#L291-L298
leadware/jpersistence-tools
jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/utils/OrderContainer.java
OrderContainer.add
public OrderContainer add(String property, OrderType orderType) { // Si la ppt est nulle if(property == null || property.trim().length() == 0) return this; // Si le Type d'ordre est null if(orderType == null) return this; // Ajout orders.put(property.trim(), orderType); // On retourne le conteneur return this; }
java
public OrderContainer add(String property, OrderType orderType) { // Si la ppt est nulle if(property == null || property.trim().length() == 0) return this; // Si le Type d'ordre est null if(orderType == null) return this; // Ajout orders.put(property.trim(), orderType); // On retourne le conteneur return this; }
[ "public", "OrderContainer", "add", "(", "String", "property", ",", "OrderType", "orderType", ")", "{", "// Si la ppt est nulle\r", "if", "(", "property", "==", "null", "||", "property", ".", "trim", "(", ")", ".", "length", "(", ")", "==", "0", ")", "retur...
Methode d'ajout d'un ordre de tri @param property Propriete a ordonner @param orderType Type d'ordre @return Conteneur d'ordre de tri
[ "Methode", "d", "ajout", "d", "un", "ordre", "de", "tri" ]
train
https://github.com/leadware/jpersistence-tools/blob/4c15372993584579d7dbb9b23dd4c0c0fdc9e789/jpersistence-tools-api/src/main/java/net/leadware/persistence/tools/api/utils/OrderContainer.java#L62-L75
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java
AbstractManagerFactoryBuilder.withRuntimeCodecs
public T withRuntimeCodecs(Map<CodecSignature<?, ?>, Codec<?, ?>> runtimeCodecs) { if (!configMap.containsKey(RUNTIME_CODECS)) { configMap.put(RUNTIME_CODECS, new HashMap<CodecSignature<?, ?>, Codec<?, ?>>()); } configMap.<Map<CodecSignature<?, ?>, Codec<?, ?>>>getTyped(RUNTIME_CODECS).putAll(runtimeCodecs); return getThis(); }
java
public T withRuntimeCodecs(Map<CodecSignature<?, ?>, Codec<?, ?>> runtimeCodecs) { if (!configMap.containsKey(RUNTIME_CODECS)) { configMap.put(RUNTIME_CODECS, new HashMap<CodecSignature<?, ?>, Codec<?, ?>>()); } configMap.<Map<CodecSignature<?, ?>, Codec<?, ?>>>getTyped(RUNTIME_CODECS).putAll(runtimeCodecs); return getThis(); }
[ "public", "T", "withRuntimeCodecs", "(", "Map", "<", "CodecSignature", "<", "?", ",", "?", ">", ",", "Codec", "<", "?", ",", "?", ">", ">", "runtimeCodecs", ")", "{", "if", "(", "!", "configMap", ".", "containsKey", "(", "RUNTIME_CODECS", ")", ")", "...
Specify runtime codecs to register with Achilles <br/> <pre class="code"><code class="java"> <strong>final Codec&lt;MyBean, String&gt; beanCodec = new .... // Create your codec with initialization logic here</strong> <strong>final Codec&lt;MyEnum, String&gt; enumCodec = new .... // Create your codec with initialization logic here</strong> final CodecSignature&lt;MyBean, String&gt; codecSignature1 = new CodecSignature(MyBean.class, String.class); final CodecSignature&lt;MyBean, String&gt; codecSignature2 = new CodecSignature(MyEnum.class, String.class); final Map&lt;CodecSignature&lt;?, ?&gt;, Codec&lt;?, ?&gt;&gt; runtimeCodecs = new HashMap&lt;&gt;(); runtimeCodecs.put(codecSignature1, beanCodec); runtimeCodecs.put(codecSignature2, enumCodec); ManagerFactory factory = ManagerFactoryBuilder .builder(cluster) ... <strong>.withRuntimeCodecs(runtimeCodecs)</strong> .build(); </code></pre> <br/> <br/> <em>Remark: you can call this method as many time as there are runtime codecs to be registered</em> @param runtimeCodecs a map of codec signature and its corresponding codec @return ManagerFactoryBuilder
[ "Specify", "runtime", "codecs", "to", "register", "with", "Achilles", "<br", "/", ">", "<pre", "class", "=", "code", ">", "<code", "class", "=", "java", ">" ]
train
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/bootstrap/AbstractManagerFactoryBuilder.java#L541-L547
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java
AbstractInvokable.triggerCheckpointOnBarrier
public void triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetrics checkpointMetrics) throws Exception { throw new UnsupportedOperationException(String.format("triggerCheckpointOnBarrier not supported by %s", this.getClass().getName())); }
java
public void triggerCheckpointOnBarrier(CheckpointMetaData checkpointMetaData, CheckpointOptions checkpointOptions, CheckpointMetrics checkpointMetrics) throws Exception { throw new UnsupportedOperationException(String.format("triggerCheckpointOnBarrier not supported by %s", this.getClass().getName())); }
[ "public", "void", "triggerCheckpointOnBarrier", "(", "CheckpointMetaData", "checkpointMetaData", ",", "CheckpointOptions", "checkpointOptions", ",", "CheckpointMetrics", "checkpointMetrics", ")", "throws", "Exception", "{", "throw", "new", "UnsupportedOperationException", "(", ...
This method is called when a checkpoint is triggered as a result of receiving checkpoint barriers on all input streams. @param checkpointMetaData Meta data for about this checkpoint @param checkpointOptions Options for performing this checkpoint @param checkpointMetrics Metrics about this checkpoint @throws Exception Exceptions thrown as the result of triggering a checkpoint are forwarded.
[ "This", "method", "is", "called", "when", "a", "checkpoint", "is", "triggered", "as", "a", "result", "of", "receiving", "checkpoint", "barriers", "on", "all", "input", "streams", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/jobgraph/tasks/AbstractInvokable.java#L225-L227
vakinge/jeesuite-libs
jeesuite-common/src/main/java/com/jeesuite/common/crypt/DES.java
DES.encrypt
public static String encrypt(String key,String data) { if(data == null) return null; try{ DESKeySpec dks = new DESKeySpec(key.getBytes()); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); //key的长度不能够小于8位字节 Key secretKey = keyFactory.generateSecret(dks); Cipher cipher = Cipher.getInstance(ALGORITHM_DES); AlgorithmParameterSpec paramSpec = new IvParameterSpec(IV_PARAMS_BYTES);; cipher.init(Cipher.ENCRYPT_MODE, secretKey,paramSpec); byte[] bytes = cipher.doFinal(data.getBytes()); return byte2hex(bytes); }catch(Exception e){ e.printStackTrace(); return data; } }
java
public static String encrypt(String key,String data) { if(data == null) return null; try{ DESKeySpec dks = new DESKeySpec(key.getBytes()); SecretKeyFactory keyFactory = SecretKeyFactory.getInstance("DES"); //key的长度不能够小于8位字节 Key secretKey = keyFactory.generateSecret(dks); Cipher cipher = Cipher.getInstance(ALGORITHM_DES); AlgorithmParameterSpec paramSpec = new IvParameterSpec(IV_PARAMS_BYTES);; cipher.init(Cipher.ENCRYPT_MODE, secretKey,paramSpec); byte[] bytes = cipher.doFinal(data.getBytes()); return byte2hex(bytes); }catch(Exception e){ e.printStackTrace(); return data; } }
[ "public", "static", "String", "encrypt", "(", "String", "key", ",", "String", "data", ")", "{", "if", "(", "data", "==", "null", ")", "return", "null", ";", "try", "{", "DESKeySpec", "dks", "=", "new", "DESKeySpec", "(", "key", ".", "getBytes", "(", ...
DES算法,加密 @param data 待加密字符串 @param key 加密私钥,长度不能够小于8位 @return 加密后的字节数组,一般结合Base64编码使用 @throws InvalidAlgorithmParameterException @throws Exception
[ "DES算法,加密" ]
train
https://github.com/vakinge/jeesuite-libs/blob/c48fe2c7fbd294892cf4030dbec96e744dd3e386/jeesuite-common/src/main/java/com/jeesuite/common/crypt/DES.java#L28-L45
googleapis/cloud-bigtable-client
bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/util/TracingUtilities.java
TracingUtilities.addDescriptor
private static void addDescriptor(List<String> descriptors, ServiceDescriptor serviceDescriptor) { for (MethodDescriptor<?, ?> method : serviceDescriptor.getMethods()) { // This is added by Cloud Bigtable's AbstractRetryingOperation descriptors.add("Operation." + method.getFullMethodName().replace('/', '.')); } }
java
private static void addDescriptor(List<String> descriptors, ServiceDescriptor serviceDescriptor) { for (MethodDescriptor<?, ?> method : serviceDescriptor.getMethods()) { // This is added by Cloud Bigtable's AbstractRetryingOperation descriptors.add("Operation." + method.getFullMethodName().replace('/', '.')); } }
[ "private", "static", "void", "addDescriptor", "(", "List", "<", "String", ">", "descriptors", ",", "ServiceDescriptor", "serviceDescriptor", ")", "{", "for", "(", "MethodDescriptor", "<", "?", ",", "?", ">", "method", ":", "serviceDescriptor", ".", "getMethods",...
Reads a list of {@link MethodDescriptor}s from a {@link ServiceDescriptor} and creates a list of Open Census tags. @param descriptors a {@link} of Strings to add Open Census tags to @param serviceDescriptor A {@link ServiceDescriptor} that contains a list of RPCs that are provided by that service
[ "Reads", "a", "list", "of", "{", "@link", "MethodDescriptor", "}", "s", "from", "a", "{", "@link", "ServiceDescriptor", "}", "and", "creates", "a", "list", "of", "Open", "Census", "tags", "." ]
train
https://github.com/googleapis/cloud-bigtable-client/blob/53543f36e4d6f9ed1963640d91a35be2a2047656/bigtable-client-core-parent/bigtable-client-core/src/main/java/com/google/cloud/bigtable/util/TracingUtilities.java#L81-L86
fuinorg/objects4j
src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java
AnnotationAnalyzer.createFieldInfos
public final List<FieldTextInfo> createFieldInfos(@NotNull final Class<?> clasz, @NotNull final Locale locale, @NotNull final Class<? extends Annotation> annotationClasz) { Contract.requireArgNotNull("clasz", clasz); Contract.requireArgNotNull("locale", locale); Contract.requireArgNotNull("annotationClasz", annotationClasz); final List<FieldTextInfo> infos = new ArrayList<FieldTextInfo>(); final Field[] fields = clasz.getDeclaredFields(); for (final Field field : fields) { final Annotation annotation = field.getAnnotation(annotationClasz); if (annotation != null) { try { final ResourceBundle bundle = getResourceBundle(annotation, locale, field.getDeclaringClass()); final String text = getText(bundle, annotation, field.getName() + "." + annotationClasz.getSimpleName()); infos.add(new FieldTextInfo(field, text)); } catch (final MissingResourceException ex) { final String text = toNullableString(getValue(annotation)); infos.add(new FieldTextInfo(field, text)); } } } Class<?> parent = clasz; while ((parent = parent.getSuperclass()) != Object.class) { infos.addAll(createFieldInfos(parent, locale, annotationClasz)); } return infos; }
java
public final List<FieldTextInfo> createFieldInfos(@NotNull final Class<?> clasz, @NotNull final Locale locale, @NotNull final Class<? extends Annotation> annotationClasz) { Contract.requireArgNotNull("clasz", clasz); Contract.requireArgNotNull("locale", locale); Contract.requireArgNotNull("annotationClasz", annotationClasz); final List<FieldTextInfo> infos = new ArrayList<FieldTextInfo>(); final Field[] fields = clasz.getDeclaredFields(); for (final Field field : fields) { final Annotation annotation = field.getAnnotation(annotationClasz); if (annotation != null) { try { final ResourceBundle bundle = getResourceBundle(annotation, locale, field.getDeclaringClass()); final String text = getText(bundle, annotation, field.getName() + "." + annotationClasz.getSimpleName()); infos.add(new FieldTextInfo(field, text)); } catch (final MissingResourceException ex) { final String text = toNullableString(getValue(annotation)); infos.add(new FieldTextInfo(field, text)); } } } Class<?> parent = clasz; while ((parent = parent.getSuperclass()) != Object.class) { infos.addAll(createFieldInfos(parent, locale, annotationClasz)); } return infos; }
[ "public", "final", "List", "<", "FieldTextInfo", ">", "createFieldInfos", "(", "@", "NotNull", "final", "Class", "<", "?", ">", "clasz", ",", "@", "NotNull", "final", "Locale", "locale", ",", "@", "NotNull", "final", "Class", "<", "?", "extends", "Annotati...
Returns text annotation informations for all field of a class that are annotated with <code>annotationClasz</code>. All other fields are ignored. @param clasz Class that contains the fields. @param locale Locale to use. @param annotationClasz Type of annotation to find. @return List of informations - Never <code>null</code>, but may be empty.
[ "Returns", "text", "annotation", "informations", "for", "all", "field", "of", "a", "class", "that", "are", "annotated", "with", "<code", ">", "annotationClasz<", "/", "code", ">", ".", "All", "other", "fields", "are", "ignored", "." ]
train
https://github.com/fuinorg/objects4j/blob/e7f278b5bae073ebb6a76053650571c718f36246/src/main/java/org/fuin/objects4j/ui/AnnotationAnalyzer.java#L107-L138
TakahikoKawasaki/nv-websocket-client
src/main/java/com/neovisionaries/ws/client/WebSocket.java
WebSocket.sendBinary
public WebSocket sendBinary(byte[] payload, boolean fin) { return sendFrame(WebSocketFrame.createBinaryFrame(payload).setFin(fin)); }
java
public WebSocket sendBinary(byte[] payload, boolean fin) { return sendFrame(WebSocketFrame.createBinaryFrame(payload).setFin(fin)); }
[ "public", "WebSocket", "sendBinary", "(", "byte", "[", "]", "payload", ",", "boolean", "fin", ")", "{", "return", "sendFrame", "(", "WebSocketFrame", ".", "createBinaryFrame", "(", "payload", ")", ".", "setFin", "(", "fin", ")", ")", ";", "}" ]
Send a binary frame to the server. <p> This method is an alias of {@link #sendFrame(WebSocketFrame) sendFrame}{@code (WebSocketFrame.}{@link WebSocketFrame#createBinaryFrame(byte[]) createBinaryFrame}{@code (payload).}{@link WebSocketFrame#setFin(boolean) setFin}{@code (fin))}. </p> @param payload The payload of a binary frame. @param fin The FIN bit value. @return {@code this} object.
[ "Send", "a", "binary", "frame", "to", "the", "server", "." ]
train
https://github.com/TakahikoKawasaki/nv-websocket-client/blob/efaec21181d740ad3808313acf679313179e0825/src/main/java/com/neovisionaries/ws/client/WebSocket.java#L3022-L3025
Javacord/Javacord
javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java
EmbedBuilder.setFooter
public EmbedBuilder setFooter(String text, File icon) { delegate.setFooter(text, icon); return this; }
java
public EmbedBuilder setFooter(String text, File icon) { delegate.setFooter(text, icon); return this; }
[ "public", "EmbedBuilder", "setFooter", "(", "String", "text", ",", "File", "icon", ")", "{", "delegate", ".", "setFooter", "(", "text", ",", "icon", ")", ";", "return", "this", ";", "}" ]
Sets the footer of the embed. @param text The text of the footer. @param icon The footer's icon. @return The current instance in order to chain call methods.
[ "Sets", "the", "footer", "of", "the", "embed", "." ]
train
https://github.com/Javacord/Javacord/blob/915aad084dc5e863284267529d0dccd625fc6886/javacord-api/src/main/java/org/javacord/api/entity/message/embed/EmbedBuilder.java#L143-L146
apache/flink
flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java
KinesisDataFetcher.advanceLastDiscoveredShardOfStream
public void advanceLastDiscoveredShardOfStream(String stream, String shardId) { String lastSeenShardIdOfStream = this.subscribedStreamsToLastDiscoveredShardIds.get(stream); // the update is valid only if the given shard id is greater // than the previous last seen shard id of the stream if (lastSeenShardIdOfStream == null) { // if not previously set, simply put as the last seen shard id this.subscribedStreamsToLastDiscoveredShardIds.put(stream, shardId); } else if (shouldAdvanceLastDiscoveredShardId(shardId, lastSeenShardIdOfStream)) { this.subscribedStreamsToLastDiscoveredShardIds.put(stream, shardId); } }
java
public void advanceLastDiscoveredShardOfStream(String stream, String shardId) { String lastSeenShardIdOfStream = this.subscribedStreamsToLastDiscoveredShardIds.get(stream); // the update is valid only if the given shard id is greater // than the previous last seen shard id of the stream if (lastSeenShardIdOfStream == null) { // if not previously set, simply put as the last seen shard id this.subscribedStreamsToLastDiscoveredShardIds.put(stream, shardId); } else if (shouldAdvanceLastDiscoveredShardId(shardId, lastSeenShardIdOfStream)) { this.subscribedStreamsToLastDiscoveredShardIds.put(stream, shardId); } }
[ "public", "void", "advanceLastDiscoveredShardOfStream", "(", "String", "stream", ",", "String", "shardId", ")", "{", "String", "lastSeenShardIdOfStream", "=", "this", ".", "subscribedStreamsToLastDiscoveredShardIds", ".", "get", "(", "stream", ")", ";", "// the update i...
Updates the last discovered shard of a subscribed stream; only updates if the update is valid.
[ "Updates", "the", "last", "discovered", "shard", "of", "a", "subscribed", "stream", ";", "only", "updates", "if", "the", "update", "is", "valid", "." ]
train
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-connectors/flink-connector-kinesis/src/main/java/org/apache/flink/streaming/connectors/kinesis/internals/KinesisDataFetcher.java#L519-L530
alkacon/opencms-core
src/org/opencms/db/CmsSecurityManager.java
CmsSecurityManager.unsubscribeAllResourcesFor
public void unsubscribeAllResourcesFor(CmsRequestContext context, String poolName, CmsPrincipal principal) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.unsubscribeAllResourcesFor(dbc, poolName, principal); } catch (Exception e) { if (principal instanceof CmsUser) { dbc.report( null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_RESOURCES_USER_1, principal.getName()), e); } else { dbc.report( null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_RESOURCES_GROUP_1, principal.getName()), e); } } finally { dbc.clear(); } }
java
public void unsubscribeAllResourcesFor(CmsRequestContext context, String poolName, CmsPrincipal principal) throws CmsException { CmsDbContext dbc = m_dbContextFactory.getDbContext(context); try { m_driverManager.unsubscribeAllResourcesFor(dbc, poolName, principal); } catch (Exception e) { if (principal instanceof CmsUser) { dbc.report( null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_RESOURCES_USER_1, principal.getName()), e); } else { dbc.report( null, Messages.get().container(Messages.ERR_UNSUBSCRIBE_ALL_RESOURCES_GROUP_1, principal.getName()), e); } } finally { dbc.clear(); } }
[ "public", "void", "unsubscribeAllResourcesFor", "(", "CmsRequestContext", "context", ",", "String", "poolName", ",", "CmsPrincipal", "principal", ")", "throws", "CmsException", "{", "CmsDbContext", "dbc", "=", "m_dbContextFactory", ".", "getDbContext", "(", "context", ...
Unsubscribes the user or group from all resources.<p> @param context the request context @param poolName the name of the database pool to use @param principal the principal that unsubscribes from all resources @throws CmsException if something goes wrong
[ "Unsubscribes", "the", "user", "or", "group", "from", "all", "resources", ".", "<p", ">" ]
train
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/db/CmsSecurityManager.java#L6355-L6376
apereo/cas
support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java
AbstractServiceValidateController.getServiceCredentialsFromRequest
protected Credential getServiceCredentialsFromRequest(final WebApplicationService service, final HttpServletRequest request) { val pgtUrl = request.getParameter(CasProtocolConstants.PARAMETER_PROXY_CALLBACK_URL); if (StringUtils.isNotBlank(pgtUrl)) { try { val registeredService = serviceValidateConfigurationContext.getServicesManager().findServiceBy(service); verifyRegisteredServiceProperties(registeredService, service); return new HttpBasedServiceCredential(new URL(pgtUrl), registeredService); } catch (final Exception e) { LOGGER.error("Error constructing [{}]", CasProtocolConstants.PARAMETER_PROXY_CALLBACK_URL, e); } } return null; }
java
protected Credential getServiceCredentialsFromRequest(final WebApplicationService service, final HttpServletRequest request) { val pgtUrl = request.getParameter(CasProtocolConstants.PARAMETER_PROXY_CALLBACK_URL); if (StringUtils.isNotBlank(pgtUrl)) { try { val registeredService = serviceValidateConfigurationContext.getServicesManager().findServiceBy(service); verifyRegisteredServiceProperties(registeredService, service); return new HttpBasedServiceCredential(new URL(pgtUrl), registeredService); } catch (final Exception e) { LOGGER.error("Error constructing [{}]", CasProtocolConstants.PARAMETER_PROXY_CALLBACK_URL, e); } } return null; }
[ "protected", "Credential", "getServiceCredentialsFromRequest", "(", "final", "WebApplicationService", "service", ",", "final", "HttpServletRequest", "request", ")", "{", "val", "pgtUrl", "=", "request", ".", "getParameter", "(", "CasProtocolConstants", ".", "PARAMETER_PRO...
Overrideable method to determine which credentials to use to grant a proxy granting ticket. Default is to use the pgtUrl. @param service the webapp service requesting proxy @param request the HttpServletRequest object. @return the credentials or null if there was an error or no credentials provided.
[ "Overrideable", "method", "to", "determine", "which", "credentials", "to", "use", "to", "grant", "a", "proxy", "granting", "ticket", ".", "Default", "is", "to", "use", "the", "pgtUrl", "." ]
train
https://github.com/apereo/cas/blob/b4b306433a8782cef803a39bea5b1f96740e0e9b/support/cas-server-support-validation/src/main/java/org/apereo/cas/web/AbstractServiceValidateController.java#L89-L101
Harium/keel
src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java
HistogramStatistics.GetRange
public static IntRange GetRange( int[] values, double percent ){ int total = 0, n = values.length; // for all values for ( int i = 0; i < n; i++ ) { // accumalate total total += values[i]; } int min, max, hits; int h = (int) ( total * ( percent + ( 1 - percent ) / 2 ) ); // get range min value for ( min = 0, hits = total; min < n; min++ ) { hits -= values[min]; if ( hits < h ) break; } // get range max value for ( max = n - 1, hits = total; max >= 0; max-- ) { hits -= values[max]; if ( hits < h ) break; } return new IntRange( min, max ); }
java
public static IntRange GetRange( int[] values, double percent ){ int total = 0, n = values.length; // for all values for ( int i = 0; i < n; i++ ) { // accumalate total total += values[i]; } int min, max, hits; int h = (int) ( total * ( percent + ( 1 - percent ) / 2 ) ); // get range min value for ( min = 0, hits = total; min < n; min++ ) { hits -= values[min]; if ( hits < h ) break; } // get range max value for ( max = n - 1, hits = total; max >= 0; max-- ) { hits -= values[max]; if ( hits < h ) break; } return new IntRange( min, max ); }
[ "public", "static", "IntRange", "GetRange", "(", "int", "[", "]", "values", ",", "double", "percent", ")", "{", "int", "total", "=", "0", ",", "n", "=", "values", ".", "length", ";", "// for all values", "for", "(", "int", "i", "=", "0", ";", "i", ...
Get range around median containing specified percentage of values. @param values Values. @param percent Values percentage around median. @return Returns the range which containes specifies percentage of values.
[ "Get", "range", "around", "median", "containing", "specified", "percentage", "of", "values", "." ]
train
https://github.com/Harium/keel/blob/0369ae674f9e664bccc5f9e161ae7e7a3b949a1e/src/main/java/com/harium/keel/catalano/statistics/HistogramStatistics.java#L79-L107
tencentyun/cos-java-sdk
src/main/java/com/qcloud/cos/op/FileOp.java
FileOp.uploadSingleFile
public String uploadSingleFile(UploadFileRequest request) throws AbstractCosException { request.check_param(); String localPath = request.getLocalPath(); long fileSize = 0; try { fileSize = CommonFileUtils.getFileLength(localPath); } catch (Exception e) { throw new UnknownException(e.toString()); } // 单文件上传上限不超过20MB if (fileSize > 20 * 1024 * 1024) { throw new ParamException("file is to big, please use uploadFile interface!"); } String fileContent = ""; String shaDigest = ""; try { fileContent = CommonFileUtils.getFileContent(localPath); shaDigest = CommonCodecUtils.getEntireFileSha1(localPath); } catch (Exception e) { throw new UnknownException(e.toString()); } String url = buildUrl(request); long signExpired = System.currentTimeMillis() / 1000 + this.config.getSignExpired(); String sign = Sign.getPeriodEffectiveSign(request.getBucketName(), request.getCosPath(), this.cred, signExpired); HttpRequest httpRequest = new HttpRequest(); httpRequest.setUrl(url); httpRequest.addHeader(RequestHeaderKey.Authorization, sign); httpRequest.addHeader(RequestHeaderKey.USER_AGENT, this.config.getUserAgent()); httpRequest.addParam(RequestBodyKey.OP, RequestBodyValue.OP.UPLOAD); httpRequest.addParam(RequestBodyKey.SHA, shaDigest); httpRequest.addParam(RequestBodyKey.BIZ_ATTR, request.getBizAttr()); httpRequest.addParam(RequestBodyKey.FILE_CONTENT, fileContent); httpRequest.addParam(RequestBodyKey.INSERT_ONLY, String.valueOf(request.getInsertOnly().ordinal())); httpRequest.setMethod(HttpMethod.POST); httpRequest.setContentType(HttpContentType.MULTIPART_FORM_DATA); return httpClient.sendHttpRequest(httpRequest); }
java
public String uploadSingleFile(UploadFileRequest request) throws AbstractCosException { request.check_param(); String localPath = request.getLocalPath(); long fileSize = 0; try { fileSize = CommonFileUtils.getFileLength(localPath); } catch (Exception e) { throw new UnknownException(e.toString()); } // 单文件上传上限不超过20MB if (fileSize > 20 * 1024 * 1024) { throw new ParamException("file is to big, please use uploadFile interface!"); } String fileContent = ""; String shaDigest = ""; try { fileContent = CommonFileUtils.getFileContent(localPath); shaDigest = CommonCodecUtils.getEntireFileSha1(localPath); } catch (Exception e) { throw new UnknownException(e.toString()); } String url = buildUrl(request); long signExpired = System.currentTimeMillis() / 1000 + this.config.getSignExpired(); String sign = Sign.getPeriodEffectiveSign(request.getBucketName(), request.getCosPath(), this.cred, signExpired); HttpRequest httpRequest = new HttpRequest(); httpRequest.setUrl(url); httpRequest.addHeader(RequestHeaderKey.Authorization, sign); httpRequest.addHeader(RequestHeaderKey.USER_AGENT, this.config.getUserAgent()); httpRequest.addParam(RequestBodyKey.OP, RequestBodyValue.OP.UPLOAD); httpRequest.addParam(RequestBodyKey.SHA, shaDigest); httpRequest.addParam(RequestBodyKey.BIZ_ATTR, request.getBizAttr()); httpRequest.addParam(RequestBodyKey.FILE_CONTENT, fileContent); httpRequest.addParam(RequestBodyKey.INSERT_ONLY, String.valueOf(request.getInsertOnly().ordinal())); httpRequest.setMethod(HttpMethod.POST); httpRequest.setContentType(HttpContentType.MULTIPART_FORM_DATA); return httpClient.sendHttpRequest(httpRequest); }
[ "public", "String", "uploadSingleFile", "(", "UploadFileRequest", "request", ")", "throws", "AbstractCosException", "{", "request", ".", "check_param", "(", ")", ";", "String", "localPath", "=", "request", ".", "getLocalPath", "(", ")", ";", "long", "fileSize", ...
上传单文件请求, 不分片 @param request 上传文件请求 @return JSON格式的字符串, 格式为{"code":$code, "message":"$mess"}, code为0表示成功, 其他为失败, message为success或者失败原因 @throws AbstractCosException SDK定义的COS异常, 通常是输入参数有误或者环境问题(如网络不通)
[ "上传单文件请求", "不分片" ]
train
https://github.com/tencentyun/cos-java-sdk/blob/6709a48f67c1ea7b82a7215f5037d6ccf218b630/src/main/java/com/qcloud/cos/op/FileOp.java#L179-L223
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java
SvgGraphicsContext.setCursor
public void setCursor(Object object, String cursor) { if (isAttached()) { helper.setCursor(object, cursor); } }
java
public void setCursor(Object object, String cursor) { if (isAttached()) { helper.setCursor(object, cursor); } }
[ "public", "void", "setCursor", "(", "Object", "object", ",", "String", "cursor", ")", "{", "if", "(", "isAttached", "(", ")", ")", "{", "helper", ".", "setCursor", "(", "object", ",", "cursor", ")", ";", "}", "}" ]
Set a specific cursor on an element of this <code>GraphicsContext</code>. @param object the element on which the controller should be set. @param cursor The string representation of the cursor to use.
[ "Set", "a", "specific", "cursor", "on", "an", "element", "of", "this", "<code", ">", "GraphicsContext<", "/", "code", ">", "." ]
train
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/gfx/context/SvgGraphicsContext.java#L679-L683
netty/netty
codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java
Http2ConnectionHandler.handleServerHeaderDecodeSizeError
protected void handleServerHeaderDecodeSizeError(ChannelHandlerContext ctx, Http2Stream stream) { encoder().writeHeaders(ctx, stream.id(), HEADERS_TOO_LARGE_HEADERS, 0, true, ctx.newPromise()); }
java
protected void handleServerHeaderDecodeSizeError(ChannelHandlerContext ctx, Http2Stream stream) { encoder().writeHeaders(ctx, stream.id(), HEADERS_TOO_LARGE_HEADERS, 0, true, ctx.newPromise()); }
[ "protected", "void", "handleServerHeaderDecodeSizeError", "(", "ChannelHandlerContext", "ctx", ",", "Http2Stream", "stream", ")", "{", "encoder", "(", ")", ".", "writeHeaders", "(", "ctx", ",", "stream", ".", "id", "(", ")", ",", "HEADERS_TOO_LARGE_HEADERS", ",", ...
Notifies client that this server has received headers that are larger than what it is willing to accept. Override to change behavior. @param ctx the channel context @param stream the Http2Stream on which the header was received
[ "Notifies", "client", "that", "this", "server", "has", "received", "headers", "that", "are", "larger", "than", "what", "it", "is", "willing", "to", "accept", ".", "Override", "to", "change", "behavior", "." ]
train
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/codec-http2/src/main/java/io/netty/handler/codec/http2/Http2ConnectionHandler.java#L732-L734
joniles/mpxj
src/main/java/net/sf/mpxj/RecurringData.java
RecurringData.getDailyDates
private void getDailyDates(Calendar calendar, int frequency, List<Date> dates) { while (moreDates(calendar, dates)) { dates.add(calendar.getTime()); calendar.add(Calendar.DAY_OF_YEAR, frequency); } }
java
private void getDailyDates(Calendar calendar, int frequency, List<Date> dates) { while (moreDates(calendar, dates)) { dates.add(calendar.getTime()); calendar.add(Calendar.DAY_OF_YEAR, frequency); } }
[ "private", "void", "getDailyDates", "(", "Calendar", "calendar", ",", "int", "frequency", ",", "List", "<", "Date", ">", "dates", ")", "{", "while", "(", "moreDates", "(", "calendar", ",", "dates", ")", ")", "{", "dates", ".", "add", "(", "calendar", "...
Calculate start dates for a daily recurrence. @param calendar current date @param frequency frequency @param dates array of start dates
[ "Calculate", "start", "dates", "for", "a", "daily", "recurrence", "." ]
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L401-L408
codeprimate-software/cp-elements
src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java
ElementsExceptionsFactory.newFormatException
public static FormatException newFormatException(String message, Object... args) { return newFormatException(null, message, args); }
java
public static FormatException newFormatException(String message, Object... args) { return newFormatException(null, message, args); }
[ "public", "static", "FormatException", "newFormatException", "(", "String", "message", ",", "Object", "...", "args", ")", "{", "return", "newFormatException", "(", "null", ",", "message", ",", "args", ")", ";", "}" ]
Constructs and initializes a new {@link FormatException} with the given {@link String message} formatted with the given {@link Object[] arguments}. @param message {@link String} describing the {@link FormatException exception}. @param args {@link Object[] arguments} used to replace format placeholders in the {@link String message}. @return a new {@link FormatException} with the given {@link String message}. @see #newFormatException(Throwable, String, Object...) @see org.cp.elements.text.FormatException
[ "Constructs", "and", "initializes", "a", "new", "{", "@link", "FormatException", "}", "with", "the", "given", "{", "@link", "String", "message", "}", "formatted", "with", "the", "given", "{", "@link", "Object", "[]", "arguments", "}", "." ]
train
https://github.com/codeprimate-software/cp-elements/blob/f2163c149fbbef05015e688132064ebcac7c49ab/src/main/java/org/cp/elements/lang/ElementsExceptionsFactory.java#L703-L705
UrielCh/ovh-java-sdk
ovh-java-sdk-connectivity/src/main/java/net/minidev/ovh/api/ApiOvhConnectivity.java
ApiOvhConnectivity.eligibility_search_cities_POST
public OvhAsyncTaskArray<OvhCity> eligibility_search_cities_POST(String zipCode) throws IOException { String qPath = "/connectivity/eligibility/search/cities"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "zipCode", zipCode); String resp = execN(qPath, "POST", sb.toString(), o); return convertTo(resp, t4); }
java
public OvhAsyncTaskArray<OvhCity> eligibility_search_cities_POST(String zipCode) throws IOException { String qPath = "/connectivity/eligibility/search/cities"; StringBuilder sb = path(qPath); HashMap<String, Object>o = new HashMap<String, Object>(); addBody(o, "zipCode", zipCode); String resp = execN(qPath, "POST", sb.toString(), o); return convertTo(resp, t4); }
[ "public", "OvhAsyncTaskArray", "<", "OvhCity", ">", "eligibility_search_cities_POST", "(", "String", "zipCode", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/connectivity/eligibility/search/cities\"", ";", "StringBuilder", "sb", "=", "path", "(", "qPath...
Get all localities linked to a zip code REST: POST /connectivity/eligibility/search/cities @param zipCode [required] Zip code
[ "Get", "all", "localities", "linked", "to", "a", "zip", "code" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-connectivity/src/main/java/net/minidev/ovh/api/ApiOvhConnectivity.java#L88-L95
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java
ProcessorInclude.getBaseURIOfIncludedStylesheet
private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s) throws TransformerException { String baseURI; String idFromUriResolverSource; if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) { // We have a Source obtained from a users's URIResolver, // and the system ID is set on it, so return that as the base URI baseURI = idFromUriResolverSource; } else { // The user did not provide a URIResolver, or it did not // return a Source for the included stylesheet module, or // the Source has no system ID set, so we fall back to using // the system ID Resolver to take the href and base // to generate the baseURI of the included stylesheet. baseURI = SystemIDResolver.getAbsoluteURI(getHref(), handler .getBaseIdentifier()); } return baseURI; }
java
private String getBaseURIOfIncludedStylesheet(StylesheetHandler handler, Source s) throws TransformerException { String baseURI; String idFromUriResolverSource; if (s != null && (idFromUriResolverSource = s.getSystemId()) != null) { // We have a Source obtained from a users's URIResolver, // and the system ID is set on it, so return that as the base URI baseURI = idFromUriResolverSource; } else { // The user did not provide a URIResolver, or it did not // return a Source for the included stylesheet module, or // the Source has no system ID set, so we fall back to using // the system ID Resolver to take the href and base // to generate the baseURI of the included stylesheet. baseURI = SystemIDResolver.getAbsoluteURI(getHref(), handler .getBaseIdentifier()); } return baseURI; }
[ "private", "String", "getBaseURIOfIncludedStylesheet", "(", "StylesheetHandler", "handler", ",", "Source", "s", ")", "throws", "TransformerException", "{", "String", "baseURI", ";", "String", "idFromUriResolverSource", ";", "if", "(", "s", "!=", "null", "&&", "(", ...
Get the base URI of the included or imported stylesheet, if the user provided a URIResolver, then get the Source object for the stylsheet from it, and get the systemId from that Source object, otherwise try to recover by using the SysteIDResolver to figure out the base URI. @param handler The handler that processes the stylesheet as SAX events, and maintains state @param s The Source object from a URIResolver, for the included stylesheet module, so this will be null if there is no URIResolver set.
[ "Get", "the", "base", "URI", "of", "the", "included", "or", "imported", "stylesheet", "if", "the", "user", "provided", "a", "URIResolver", "then", "get", "the", "Source", "object", "for", "the", "stylsheet", "from", "it", "and", "get", "the", "systemId", "...
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/processor/ProcessorInclude.java#L373-L395
MenoData/Time4J
base/src/main/java/net/time4j/calendar/PersianCalendar.java
PersianCalendar.getDate
public Date getDate(ZonalOffset offset) { if (offset == null) { throw new NullPointerException("Missing timezone offset."); } PersianAlgorithm algorithm = PersianAlgorithm.ASTRONOMICAL; long utcDays = DEFAULT_COMPUTATION.transform(this, PersianAlgorithm.STD_OFFSET); return new Date(algorithm.transform(utcDays, offset), algorithm, offset); }
java
public Date getDate(ZonalOffset offset) { if (offset == null) { throw new NullPointerException("Missing timezone offset."); } PersianAlgorithm algorithm = PersianAlgorithm.ASTRONOMICAL; long utcDays = DEFAULT_COMPUTATION.transform(this, PersianAlgorithm.STD_OFFSET); return new Date(algorithm.transform(utcDays, offset), algorithm, offset); }
[ "public", "Date", "getDate", "(", "ZonalOffset", "offset", ")", "{", "if", "(", "offset", "==", "null", ")", "{", "throw", "new", "NullPointerException", "(", "\"Missing timezone offset.\"", ")", ";", "}", "PersianAlgorithm", "algorithm", "=", "PersianAlgorithm", ...
/*[deutsch] <p>Erh&auml;lt eine astronomische Datumssicht spezifisch f&uuml;r die angegebene Zeitzonenverschiebung. </p> @param offset timezone offset @return Persian date based on astronomical calculations for given offset (possibly modified) @throws IllegalArgumentException in case of date overflow @see PersianAlgorithm#ASTRONOMICAL @see #getDate(PersianAlgorithm) @since 3.33/4.28
[ "/", "*", "[", "deutsch", "]", "<p", ">", "Erh&auml", ";", "lt", "eine", "astronomische", "Datumssicht", "spezifisch", "f&uuml", ";", "r", "die", "angegebene", "Zeitzonenverschiebung", ".", "<", "/", "p", ">" ]
train
https://github.com/MenoData/Time4J/blob/08b2eda6b2dbb140b92011cf7071bb087edd46a5/base/src/main/java/net/time4j/calendar/PersianCalendar.java#L747-L757
OpenLiberty/open-liberty
dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/SingleThreadModelServlet.java
SingleThreadModelServlet.service
public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException { try { TimedServletPoolElement e = _pool.getNextElement(); e.getServlet().service(req, resp); _pool.returnElement(e); _pool.removeExpiredElements(); } catch (Throwable th) { com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.servlet.SingleThreadModelServlet.service", "84", this); throw new ServletErrorReport(th); } }
java
public void service(ServletRequest req, ServletResponse resp) throws ServletException, IOException { try { TimedServletPoolElement e = _pool.getNextElement(); e.getServlet().service(req, resp); _pool.returnElement(e); _pool.removeExpiredElements(); } catch (Throwable th) { com.ibm.wsspi.webcontainer.util.FFDCWrapper.processException(th, "com.ibm.ws.webcontainer.servlet.SingleThreadModelServlet.service", "84", this); throw new ServletErrorReport(th); } }
[ "public", "void", "service", "(", "ServletRequest", "req", ",", "ServletResponse", "resp", ")", "throws", "ServletException", ",", "IOException", "{", "try", "{", "TimedServletPoolElement", "e", "=", "_pool", ".", "getNextElement", "(", ")", ";", "e", ".", "ge...
Overloaded by subclasses to perform the servlet's request handling operation.
[ "Overloaded", "by", "subclasses", "to", "perform", "the", "servlet", "s", "request", "handling", "operation", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.webcontainer/src/com/ibm/ws/webcontainer/servlet/SingleThreadModelServlet.java#L116-L131
docusign/docusign-java-client
src/main/java/com/docusign/esign/api/UsersApi.java
UsersApi.getProfileImage
public byte[] getProfileImage(String accountId, String userId) throws ApiException { return getProfileImage(accountId, userId, null); }
java
public byte[] getProfileImage(String accountId, String userId) throws ApiException { return getProfileImage(accountId, userId, null); }
[ "public", "byte", "[", "]", "getProfileImage", "(", "String", "accountId", ",", "String", "userId", ")", "throws", "ApiException", "{", "return", "getProfileImage", "(", "accountId", ",", "userId", ",", "null", ")", ";", "}" ]
Retrieves the user profile image for the specified user. Retrieves the user profile picture for the specified user. The image is returned in the same format as uploaded. The userId parameter specified in the endpoint must match the authenticated user&#39;s user ID and the user must be a member of the specified account. If successful, the response returns a 200 - OK and the user profile image. @param accountId The external account number (int) or account ID Guid. (required) @param userId The user ID of the user being accessed. Generally this is the user ID of the authenticated user, but if the authenticated user is an Admin on the account, this may be another user the Admin user is accessing. (required) @return byte[]
[ "Retrieves", "the", "user", "profile", "image", "for", "the", "specified", "user", ".", "Retrieves", "the", "user", "profile", "picture", "for", "the", "specified", "user", ".", "The", "image", "is", "returned", "in", "the", "same", "format", "as", "uploaded...
train
https://github.com/docusign/docusign-java-client/blob/17ae82ace0f023e98edf813be832950568212e34/src/main/java/com/docusign/esign/api/UsersApi.java#L751-L753
PeterisP/LVTagger
src/main/java/edu/stanford/nlp/io/IOUtils.java
IOUtils.writeStreamToStream
public static void writeStreamToStream(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[4096]; while (true) { int len = input.read(buffer); if (len == -1) { break; } output.write(buffer, 0, len); } }
java
public static void writeStreamToStream(InputStream input, OutputStream output) throws IOException { byte[] buffer = new byte[4096]; while (true) { int len = input.read(buffer); if (len == -1) { break; } output.write(buffer, 0, len); } }
[ "public", "static", "void", "writeStreamToStream", "(", "InputStream", "input", ",", "OutputStream", "output", ")", "throws", "IOException", "{", "byte", "[", "]", "buffer", "=", "new", "byte", "[", "4096", "]", ";", "while", "(", "true", ")", "{", "int", ...
Send all bytes from the input stream to the output stream. @param input The input bytes. @param output Where the bytes should be written.
[ "Send", "all", "bytes", "from", "the", "input", "stream", "to", "the", "output", "stream", "." ]
train
https://github.com/PeterisP/LVTagger/blob/b3d44bab9ec07ace0d13612c448a6b7298c1f681/src/main/java/edu/stanford/nlp/io/IOUtils.java#L930-L940
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java
NodeSequence.withNodes
public static NodeSequence withNodes( final Iterator<CachedNode> nodes, final long nodeCount, final float score, final String workspaceName ) { assert nodeCount >= -1; if (nodes == null) return emptySequence(1); return withBatch(batchOf(nodes, nodeCount, score, workspaceName)); }
java
public static NodeSequence withNodes( final Iterator<CachedNode> nodes, final long nodeCount, final float score, final String workspaceName ) { assert nodeCount >= -1; if (nodes == null) return emptySequence(1); return withBatch(batchOf(nodes, nodeCount, score, workspaceName)); }
[ "public", "static", "NodeSequence", "withNodes", "(", "final", "Iterator", "<", "CachedNode", ">", "nodes", ",", "final", "long", "nodeCount", ",", "final", "float", "score", ",", "final", "String", "workspaceName", ")", "{", "assert", "nodeCount", ">=", "-", ...
Create a sequence of nodes that iterates over the supplied nodes. Note that the supplied iterator is accessed lazily as the resulting sequence's {@link #nextBatch() first batch} is {@link Batch#nextRow() used}. @param nodes the iterator over the node keys to be returned; if null, an {@link #emptySequence empty instance} is returned @param nodeCount the number of nodes in the iterator; must be -1 if not known, 0 if known to be empty, or a positive number if the number of nodes is known @param score the score to return for all of the nodes @param workspaceName the name of the workspace in which all of the nodes exist @return the sequence of nodes; never null
[ "Create", "a", "sequence", "of", "nodes", "that", "iterates", "over", "the", "supplied", "nodes", ".", "Note", "that", "the", "supplied", "iterator", "is", "accessed", "lazily", "as", "the", "resulting", "sequence", "s", "{", "@link", "#nextBatch", "()", "fi...
train
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/NodeSequence.java#L431-L438
infinispan/infinispan
core/src/main/java/org/infinispan/encoding/DataConversion.java
DataConversion.getStorageMediaType
private MediaType getStorageMediaType(Configuration configuration, boolean embeddedMode) { EncodingConfiguration encodingConfiguration = configuration.encoding(); ContentTypeConfiguration contentTypeConfiguration = isKey ? encodingConfiguration.keyDataType() : encodingConfiguration.valueDataType(); // If explicitly configured, use the value provided if (contentTypeConfiguration.isMediaTypeChanged()) { return contentTypeConfiguration.mediaType(); } // Indexed caches started by the server will assume application/protostream as storage media type if (!embeddedMode && configuration.indexing().index().isEnabled() && contentTypeConfiguration.mediaType() == null) { return MediaType.APPLICATION_PROTOSTREAM; } return MediaType.APPLICATION_UNKNOWN; }
java
private MediaType getStorageMediaType(Configuration configuration, boolean embeddedMode) { EncodingConfiguration encodingConfiguration = configuration.encoding(); ContentTypeConfiguration contentTypeConfiguration = isKey ? encodingConfiguration.keyDataType() : encodingConfiguration.valueDataType(); // If explicitly configured, use the value provided if (contentTypeConfiguration.isMediaTypeChanged()) { return contentTypeConfiguration.mediaType(); } // Indexed caches started by the server will assume application/protostream as storage media type if (!embeddedMode && configuration.indexing().index().isEnabled() && contentTypeConfiguration.mediaType() == null) { return MediaType.APPLICATION_PROTOSTREAM; } return MediaType.APPLICATION_UNKNOWN; }
[ "private", "MediaType", "getStorageMediaType", "(", "Configuration", "configuration", ",", "boolean", "embeddedMode", ")", "{", "EncodingConfiguration", "encodingConfiguration", "=", "configuration", ".", "encoding", "(", ")", ";", "ContentTypeConfiguration", "contentTypeCo...
Obtain the configured {@link MediaType} for this instance, or assume sensible defaults.
[ "Obtain", "the", "configured", "{" ]
train
https://github.com/infinispan/infinispan/blob/7c62b94886c3febb4774ae8376acf2baa0265ab5/core/src/main/java/org/infinispan/encoding/DataConversion.java#L119-L131
arquillian/arquillian-cube
kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java
KubernetesAssistant.deployApplication
public void deployApplication(String applicationName, URL... urls) throws IOException { this.applicationName = applicationName; for (URL url : urls) { try (InputStream inputStream = url.openStream()) { deploy(inputStream); } } }
java
public void deployApplication(String applicationName, URL... urls) throws IOException { this.applicationName = applicationName; for (URL url : urls) { try (InputStream inputStream = url.openStream()) { deploy(inputStream); } } }
[ "public", "void", "deployApplication", "(", "String", "applicationName", ",", "URL", "...", "urls", ")", "throws", "IOException", "{", "this", ".", "applicationName", "=", "applicationName", ";", "for", "(", "URL", "url", ":", "urls", ")", "{", "try", "(", ...
Deploys application reading resources from specified URLs @param applicationName to configure in cluster @param urls where resources are read @return the name of the application @throws IOException
[ "Deploys", "application", "reading", "resources", "from", "specified", "URLs" ]
train
https://github.com/arquillian/arquillian-cube/blob/ce6b08062cc6ba2a68ecc29606bbae9acda5be13/kubernetes/kubernetes/src/main/java/org/arquillian/cube/kubernetes/impl/KubernetesAssistant.java#L136-L144
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java
JSONConverter.writeNotificationArea
public void writeNotificationArea(OutputStream out, NotificationArea value) throws IOException { writeStartObject(out); writeStringField(out, OM_REGISTRATIONS, value.registrationsURL); writeStringField(out, OM_SERVERREGISTRATIONS, value.serverRegistrationsURL); writeStringField(out, OM_INBOX, value.inboxURL); writeStringField(out, OM_CLIENT, value.clientURL); writeEndObject(out); }
java
public void writeNotificationArea(OutputStream out, NotificationArea value) throws IOException { writeStartObject(out); writeStringField(out, OM_REGISTRATIONS, value.registrationsURL); writeStringField(out, OM_SERVERREGISTRATIONS, value.serverRegistrationsURL); writeStringField(out, OM_INBOX, value.inboxURL); writeStringField(out, OM_CLIENT, value.clientURL); writeEndObject(out); }
[ "public", "void", "writeNotificationArea", "(", "OutputStream", "out", ",", "NotificationArea", "value", ")", "throws", "IOException", "{", "writeStartObject", "(", "out", ")", ";", "writeStringField", "(", "out", ",", "OM_REGISTRATIONS", ",", "value", ".", "regis...
Encode a NotificationArea instance as JSON: { "registrations" : URL, "serverRegistrations" : URL, "inbox" : URL } @param out The stream to write JSON to @param value The NotificationArea instance to encode. Can't be null. @throws IOException If an I/O error occurs @see #readNotificationArea(InputStream)
[ "Encode", "a", "NotificationArea", "instance", "as", "JSON", ":", "{", "registrations", ":", "URL", "serverRegistrations", ":", "URL", "inbox", ":", "URL", "}" ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.client.rest/src/com/ibm/ws/jmx/connector/converter/JSONConverter.java#L1440-L1447
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java
ToStream.ignorableWhitespace
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if (0 == length) return; characters(ch, start, length); }
java
public void ignorableWhitespace(char ch[], int start, int length) throws org.xml.sax.SAXException { if (0 == length) return; characters(ch, start, length); }
[ "public", "void", "ignorableWhitespace", "(", "char", "ch", "[", "]", ",", "int", "start", ",", "int", "length", ")", "throws", "org", ".", "xml", ".", "sax", ".", "SAXException", "{", "if", "(", "0", "==", "length", ")", "return", ";", "characters", ...
Receive notification of ignorable whitespace in element content. Not sure how to get this invoked quite yet. @param ch The characters from the XML document. @param start The start position in the array. @param length The number of characters to read from the array. @throws org.xml.sax.SAXException Any SAX exception, possibly wrapping another exception. @see #characters @throws org.xml.sax.SAXException
[ "Receive", "notification", "of", "ignorable", "whitespace", "in", "element", "content", "." ]
train
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xml/serializer/ToStream.java#L2536-L2543
poetix/protonpack
src/main/java/com/codepoetics/protonpack/StreamUtils.java
StreamUtils.takeUntilInclusive
public static <T> Stream<T> takeUntilInclusive(Stream<T> source, Predicate<T> condition) { return takeWhileInclusive(source, condition.negate()); }
java
public static <T> Stream<T> takeUntilInclusive(Stream<T> source, Predicate<T> condition) { return takeWhileInclusive(source, condition.negate()); }
[ "public", "static", "<", "T", ">", "Stream", "<", "T", ">", "takeUntilInclusive", "(", "Stream", "<", "T", ">", "source", ",", "Predicate", "<", "T", ">", "condition", ")", "{", "return", "takeWhileInclusive", "(", "source", ",", "condition", ".", "negat...
Construct a stream which takes values from the source stream until but including the first value that is encountered which meets the supplied condition. @param source The source stream. @param condition The condition to apply to elements of the source stream. @param <T> The type over which the stream streams. @return A condition-bounded stream.
[ "Construct", "a", "stream", "which", "takes", "values", "from", "the", "source", "stream", "until", "but", "including", "the", "first", "value", "that", "is", "encountered", "which", "meets", "the", "supplied", "condition", "." ]
train
https://github.com/poetix/protonpack/blob/00c55a05a4779926d02d5f4e6c820560a773f9f1/src/main/java/com/codepoetics/protonpack/StreamUtils.java#L167-L169
elki-project/elki
addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java
VisualizerParameterizer.newContext
public VisualizerContext newContext(ResultHierarchy hier, Result start) { Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class); for(Relation<?> rel : rels) { if(samplesize == 0) { continue; } if(!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty()) { continue; } if(rel.size() > samplesize) { SamplingResult sample = new SamplingResult(rel); sample.setSample(DBIDUtil.randomSample(sample.getSample(), samplesize, rnd)); ResultUtil.addChildResult(rel, sample); } } return new VisualizerContext(hier, start, stylelib, factories); }
java
public VisualizerContext newContext(ResultHierarchy hier, Result start) { Collection<Relation<?>> rels = ResultUtil.filterResults(hier, Relation.class); for(Relation<?> rel : rels) { if(samplesize == 0) { continue; } if(!ResultUtil.filterResults(hier, rel, SamplingResult.class).isEmpty()) { continue; } if(rel.size() > samplesize) { SamplingResult sample = new SamplingResult(rel); sample.setSample(DBIDUtil.randomSample(sample.getSample(), samplesize, rnd)); ResultUtil.addChildResult(rel, sample); } } return new VisualizerContext(hier, start, stylelib, factories); }
[ "public", "VisualizerContext", "newContext", "(", "ResultHierarchy", "hier", ",", "Result", "start", ")", "{", "Collection", "<", "Relation", "<", "?", ">", ">", "rels", "=", "ResultUtil", ".", "filterResults", "(", "hier", ",", "Relation", ".", "class", ")"...
Make a new visualization context @param hier Result hierarchy @param start Starting result @return New context
[ "Make", "a", "new", "visualization", "context" ]
train
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/addons/batikvis/src/main/java/de/lmu/ifi/dbs/elki/visualization/VisualizerParameterizer.java#L128-L144
mebigfatguy/fb-contrib
src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java
DubiousListCollection.reportBugs
private void reportBugs() { int major = getClassContext().getJavaClass().getMajor(); for (Map.Entry<String, FieldInfo> entry : fieldsReported.entrySet()) { String field = entry.getKey(); FieldInfo fi = entry.getValue(); int cnt = fi.getSetCount(); if (cnt > 0) { FieldAnnotation fa = getFieldAnnotation(field); if (fa != null) { // can't use LinkedHashSet in 1.3 so report at LOW bugReporter.reportBug(new BugInstance(this, BugType.DLC_DUBIOUS_LIST_COLLECTION.name(), (major >= Const.MAJOR_1_4) ? NORMAL_PRIORITY : LOW_PRIORITY) .addSourceLine(fi.getSourceLineAnnotation())); } } } }
java
private void reportBugs() { int major = getClassContext().getJavaClass().getMajor(); for (Map.Entry<String, FieldInfo> entry : fieldsReported.entrySet()) { String field = entry.getKey(); FieldInfo fi = entry.getValue(); int cnt = fi.getSetCount(); if (cnt > 0) { FieldAnnotation fa = getFieldAnnotation(field); if (fa != null) { // can't use LinkedHashSet in 1.3 so report at LOW bugReporter.reportBug(new BugInstance(this, BugType.DLC_DUBIOUS_LIST_COLLECTION.name(), (major >= Const.MAJOR_1_4) ? NORMAL_PRIORITY : LOW_PRIORITY) .addSourceLine(fi.getSourceLineAnnotation())); } } } }
[ "private", "void", "reportBugs", "(", ")", "{", "int", "major", "=", "getClassContext", "(", ")", ".", "getJavaClass", "(", ")", ".", "getMajor", "(", ")", ";", "for", "(", "Map", ".", "Entry", "<", "String", ",", "FieldInfo", ">", "entry", ":", "fie...
implements the detector, by reporting all remaining fields that only have set based access
[ "implements", "the", "detector", "by", "reporting", "all", "remaining", "fields", "that", "only", "have", "set", "based", "access" ]
train
https://github.com/mebigfatguy/fb-contrib/blob/3b5203196f627b399fbcea3c2ab2b1f4e56cc7b8/src/main/java/com/mebigfatguy/fbcontrib/detect/DubiousListCollection.java#L243-L259
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java
TreeScanner.visitBlock
@Override public R visitBlock(BlockTree node, P p) { return scan(node.getStatements(), p); }
java
@Override public R visitBlock(BlockTree node, P p) { return scan(node.getStatements(), p); }
[ "@", "Override", "public", "R", "visitBlock", "(", "BlockTree", "node", ",", "P", "p", ")", "{", "return", "scan", "(", "node", ".", "getStatements", "(", ")", ",", "p", ")", ";", "}" ]
{@inheritDoc} This implementation scans the children in left to right order. @param node {@inheritDoc} @param p {@inheritDoc} @return the result of scanning
[ "{", "@inheritDoc", "}", "This", "implementation", "scans", "the", "children", "in", "left", "to", "right", "order", "." ]
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/source/util/TreeScanner.java#L246-L249
Red5/red5-server-common
src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java
RTMPHandshake.calculateDigest
public void calculateDigest(int digestPos, byte[] handshakeMessage, int handshakeOffset, byte[] key, int keyLen, byte[] digest, int digestOffset) { if (log.isTraceEnabled()) { log.trace("calculateDigest - digestPos: {} handshakeOffset: {} keyLen: {} digestOffset: {}", digestPos, handshakeOffset, keyLen, digestOffset); } int messageLen = Constants.HANDSHAKE_SIZE - DIGEST_LENGTH; // 1504 byte[] message = new byte[messageLen]; // copy bytes from handshake message starting at handshake offset into message start at index 0 and up-to digest position length System.arraycopy(handshakeMessage, handshakeOffset, message, 0, digestPos); // copy bytes from handshake message starting at handshake offset plus digest position plus digest length // into message start at digest position and up-to message length minus digest position System.arraycopy(handshakeMessage, handshakeOffset + digestPos + DIGEST_LENGTH, message, digestPos, messageLen - digestPos); calculateHMAC_SHA256(message, 0, messageLen, key, keyLen, digest, digestOffset); }
java
public void calculateDigest(int digestPos, byte[] handshakeMessage, int handshakeOffset, byte[] key, int keyLen, byte[] digest, int digestOffset) { if (log.isTraceEnabled()) { log.trace("calculateDigest - digestPos: {} handshakeOffset: {} keyLen: {} digestOffset: {}", digestPos, handshakeOffset, keyLen, digestOffset); } int messageLen = Constants.HANDSHAKE_SIZE - DIGEST_LENGTH; // 1504 byte[] message = new byte[messageLen]; // copy bytes from handshake message starting at handshake offset into message start at index 0 and up-to digest position length System.arraycopy(handshakeMessage, handshakeOffset, message, 0, digestPos); // copy bytes from handshake message starting at handshake offset plus digest position plus digest length // into message start at digest position and up-to message length minus digest position System.arraycopy(handshakeMessage, handshakeOffset + digestPos + DIGEST_LENGTH, message, digestPos, messageLen - digestPos); calculateHMAC_SHA256(message, 0, messageLen, key, keyLen, digest, digestOffset); }
[ "public", "void", "calculateDigest", "(", "int", "digestPos", ",", "byte", "[", "]", "handshakeMessage", ",", "int", "handshakeOffset", ",", "byte", "[", "]", "key", ",", "int", "keyLen", ",", "byte", "[", "]", "digest", ",", "int", "digestOffset", ")", ...
Calculates the digest given the its offset in the handshake data. @param digestPos digest position @param handshakeMessage handshake message @param handshakeOffset handshake message offset @param key contains the key @param keyLen the length of the key @param digest contains the calculated digest @param digestOffset digest offset
[ "Calculates", "the", "digest", "given", "the", "its", "offset", "in", "the", "handshake", "data", "." ]
train
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/net/rtmp/RTMPHandshake.java#L323-L335
airbnb/lottie-android
lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java
KeyPath.propagateToChildren
@SuppressWarnings("SimplifiableIfStatement") @RestrictTo(RestrictTo.Scope.LIBRARY) public boolean propagateToChildren(String key, int depth) { if ("__container".equals(key)) { return true; } return depth < keys.size() - 1 || keys.get(depth).equals("**"); }
java
@SuppressWarnings("SimplifiableIfStatement") @RestrictTo(RestrictTo.Scope.LIBRARY) public boolean propagateToChildren(String key, int depth) { if ("__container".equals(key)) { return true; } return depth < keys.size() - 1 || keys.get(depth).equals("**"); }
[ "@", "SuppressWarnings", "(", "\"SimplifiableIfStatement\"", ")", "@", "RestrictTo", "(", "RestrictTo", ".", "Scope", ".", "LIBRARY", ")", "public", "boolean", "propagateToChildren", "(", "String", "key", ",", "int", "depth", ")", "{", "if", "(", "\"__container\...
Returns whether the keypath resolution should propagate to children. Some keypaths resolve to content other than leaf contents (such as a layer or content group transform) so sometimes this will return false.
[ "Returns", "whether", "the", "keypath", "resolution", "should", "propagate", "to", "children", ".", "Some", "keypaths", "resolve", "to", "content", "other", "than", "leaf", "contents", "(", "such", "as", "a", "layer", "or", "content", "group", "transform", ")"...
train
https://github.com/airbnb/lottie-android/blob/126dabdc9f586c87822f85fe1128cdad439d30fa/lottie/src/main/java/com/airbnb/lottie/model/KeyPath.java#L185-L192
google/closure-compiler
src/com/google/javascript/jscomp/InlineFunctions.java
InlineFunctions.verifyAllReferencesInlined
void verifyAllReferencesInlined(String name, FunctionState functionState) { for (Reference ref : functionState.getReferences()) { if (!ref.inlined) { Node parent = ref.callNode.getParent(); throw new IllegalStateException( "Call site missed (" + name + ").\n call: " + ref.callNode.toStringTree() + "\n parent: " + ((parent == null) ? "null" : parent.toStringTree())); } } }
java
void verifyAllReferencesInlined(String name, FunctionState functionState) { for (Reference ref : functionState.getReferences()) { if (!ref.inlined) { Node parent = ref.callNode.getParent(); throw new IllegalStateException( "Call site missed (" + name + ").\n call: " + ref.callNode.toStringTree() + "\n parent: " + ((parent == null) ? "null" : parent.toStringTree())); } } }
[ "void", "verifyAllReferencesInlined", "(", "String", "name", ",", "FunctionState", "functionState", ")", "{", "for", "(", "Reference", "ref", ":", "functionState", ".", "getReferences", "(", ")", ")", "{", "if", "(", "!", "ref", ".", "inlined", ")", "{", "...
Check to verify that expression rewriting didn't make a call inaccessible.
[ "Check", "to", "verify", "that", "expression", "rewriting", "didn", "t", "make", "a", "call", "inaccessible", "." ]
train
https://github.com/google/closure-compiler/blob/d81e36740f6a9e8ac31a825ee8758182e1dc5aae/src/com/google/javascript/jscomp/InlineFunctions.java#L819-L832
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/util/BoundedSortedMultiMap.java
BoundedSortedMultiMap.putMulti
public boolean putMulti(K key, Collection<V> values) { boolean added = false; for (V v : values) { if (put(key, v)) added = true; } return added; }
java
public boolean putMulti(K key, Collection<V> values) { boolean added = false; for (V v : values) { if (put(key, v)) added = true; } return added; }
[ "public", "boolean", "putMulti", "(", "K", "key", ",", "Collection", "<", "V", ">", "values", ")", "{", "boolean", "added", "=", "false", ";", "for", "(", "V", "v", ":", "values", ")", "{", "if", "(", "put", "(", "key", ",", "v", ")", ")", "add...
Adds all of the key-value mapping to this map, and if the total number of mappings exceeds the bounds, removes either the currently lowest element, or if reversed, the currently highest element. If this map is bound by the number of keys, a {@code put} operation may result in the {@code range} decreasing, even though the number of keys stays constant. @param key {@inheritDoc} @param values {@inheritDoc}
[ "Adds", "all", "of", "the", "key", "-", "value", "mapping", "to", "this", "map", "and", "if", "the", "total", "number", "of", "mappings", "exceeds", "the", "bounds", "removes", "either", "the", "currently", "lowest", "element", "or", "if", "reversed", "the...
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/BoundedSortedMultiMap.java#L177-L184
OpenLiberty/open-liberty
dev/com.ibm.ws.serialization/src/com/ibm/ws/serialization/internal/SerializationServiceImpl.java
SerializationServiceImpl.loadClass
Class<?> loadClass(String name) throws ClassNotFoundException { // First, try to find the class by name. ServiceReference<DeserializationClassProvider> provider = classProviders.getReference(name); if (provider != null) { return loadClass(provider, name); } // Next, try to find the class by package. int index = name.lastIndexOf('.'); if (index != -1) { String pkg = name.substring(0, index); provider = packageProviders.getReference(pkg); if (provider != null) { return loadClass(provider, name); } } return null; }
java
Class<?> loadClass(String name) throws ClassNotFoundException { // First, try to find the class by name. ServiceReference<DeserializationClassProvider> provider = classProviders.getReference(name); if (provider != null) { return loadClass(provider, name); } // Next, try to find the class by package. int index = name.lastIndexOf('.'); if (index != -1) { String pkg = name.substring(0, index); provider = packageProviders.getReference(pkg); if (provider != null) { return loadClass(provider, name); } } return null; }
[ "Class", "<", "?", ">", "loadClass", "(", "String", "name", ")", "throws", "ClassNotFoundException", "{", "// First, try to find the class by name.", "ServiceReference", "<", "DeserializationClassProvider", ">", "provider", "=", "classProviders", ".", "getReference", "(",...
Attempts to resolve a class from registered class providers. @param name the class name @return the class, or null if not found @throws ClassNotFoundException if a class provider claimed to provide a class or package, but its bundle did not contain the class
[ "Attempts", "to", "resolve", "a", "class", "from", "registered", "class", "providers", "." ]
train
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.serialization/src/com/ibm/ws/serialization/internal/SerializationServiceImpl.java#L247-L265
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java
ValueEnforcer.notEmpty
@CodingStyleguideUnaware public static <T extends Map <?, ?>> T notEmpty (final T aValue, final String sName) { if (isEnabled ()) return notEmpty (aValue, () -> sName); return aValue; }
java
@CodingStyleguideUnaware public static <T extends Map <?, ?>> T notEmpty (final T aValue, final String sName) { if (isEnabled ()) return notEmpty (aValue, () -> sName); return aValue; }
[ "@", "CodingStyleguideUnaware", "public", "static", "<", "T", "extends", "Map", "<", "?", ",", "?", ">", ">", "T", "notEmpty", "(", "final", "T", "aValue", ",", "final", "String", "sName", ")", "{", "if", "(", "isEnabled", "(", ")", ")", "return", "n...
Check that the passed Collection is neither <code>null</code> nor empty. @param <T> Type to be checked and returned @param aValue The String to check. @param sName The name of the value (e.g. the parameter name) @return The passed value. @throws IllegalArgumentException if the passed value is empty
[ "Check", "that", "the", "passed", "Collection", "is", "neither", "<code", ">", "null<", "/", "code", ">", "nor", "empty", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/ValueEnforcer.java#L826-L832
paymill/paymill-java
src/main/java/com/paymill/services/SubscriptionService.java
SubscriptionService.changeAmountTemporary
public Subscription changeAmountTemporary( Subscription subscription, Integer amount ) { return changeAmount( subscription, amount, 0, null, null ); }
java
public Subscription changeAmountTemporary( Subscription subscription, Integer amount ) { return changeAmount( subscription, amount, 0, null, null ); }
[ "public", "Subscription", "changeAmountTemporary", "(", "Subscription", "subscription", ",", "Integer", "amount", ")", "{", "return", "changeAmount", "(", "subscription", ",", "amount", ",", "0", ",", "null", ",", "null", ")", ";", "}" ]
Changes the amount of a subscription.<br> <br> The new amount is valid one-time only after which the original subscription amount will be charged again. If you want to permanently change the amount use {@link SubscriptionService#changeAmount(String, Integer)} . @param subscription the subscription. @param amount the new amount. @return the updated subscription.
[ "Changes", "the", "amount", "of", "a", "subscription", ".", "<br", ">", "<br", ">", "The", "new", "amount", "is", "valid", "one", "-", "time", "only", "after", "which", "the", "original", "subscription", "amount", "will", "be", "charged", "again", ".", "...
train
https://github.com/paymill/paymill-java/blob/17281a0d4376c76f1711af9f09bfc138c90ba65a/src/main/java/com/paymill/services/SubscriptionService.java#L353-L355
groupe-sii/ogham
ogham-core/src/main/java/fr/sii/ogham/core/util/bean/BeanWrapperUtils.java
BeanWrapperUtils.getReadMethods
public static Map<String, Method> getReadMethods(Object bean) { Class<? extends Object> beanClass = bean.getClass(); try { Map<String, Method> readMethods = new HashMap<>(); final BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); final PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); if (propertyDescriptors != null) { for (final PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor != null) { final String name = propertyDescriptor.getName(); final Method readMethod = propertyDescriptor.getReadMethod(); if (readMethod != null) { readMethods.put(name, readMethod); } } } } return readMethods; } catch (final IntrospectionException e) { throw new BeanWrapperException("Failed to initialize bean wrapper on " + beanClass, e); } }
java
public static Map<String, Method> getReadMethods(Object bean) { Class<? extends Object> beanClass = bean.getClass(); try { Map<String, Method> readMethods = new HashMap<>(); final BeanInfo beanInfo = Introspector.getBeanInfo(beanClass); final PropertyDescriptor[] propertyDescriptors = beanInfo.getPropertyDescriptors(); if (propertyDescriptors != null) { for (final PropertyDescriptor propertyDescriptor : propertyDescriptors) { if (propertyDescriptor != null) { final String name = propertyDescriptor.getName(); final Method readMethod = propertyDescriptor.getReadMethod(); if (readMethod != null) { readMethods.put(name, readMethod); } } } } return readMethods; } catch (final IntrospectionException e) { throw new BeanWrapperException("Failed to initialize bean wrapper on " + beanClass, e); } }
[ "public", "static", "Map", "<", "String", ",", "Method", ">", "getReadMethods", "(", "Object", "bean", ")", "{", "Class", "<", "?", "extends", "Object", ">", "beanClass", "=", "bean", ".", "getClass", "(", ")", ";", "try", "{", "Map", "<", "String", ...
Get the whole list of read {@link Method}s using introspection. @param bean the bean to introspect @return the map of bean property getters (indexed by property name)
[ "Get", "the", "whole", "list", "of", "read", "{", "@link", "Method", "}", "s", "using", "introspection", "." ]
train
https://github.com/groupe-sii/ogham/blob/e273b845604add74b5a25dfd931cb3c166b1008f/ogham-core/src/main/java/fr/sii/ogham/core/util/bean/BeanWrapperUtils.java#L65-L87
lievendoclo/Valkyrie-RCP
valkyrie-rcp-core/src/main/java/org/valkyriercp/wizard/AbstractWizard.java
AbstractWizard.addForm
public WizardPage addForm(Form formPage) { Assert.notNull(formPage, "The form page cannot be null"); WizardPage page = new FormBackedWizardPage(formPage, !autoConfigureChildPages); addPage(page); return page; }
java
public WizardPage addForm(Form formPage) { Assert.notNull(formPage, "The form page cannot be null"); WizardPage page = new FormBackedWizardPage(formPage, !autoConfigureChildPages); addPage(page); return page; }
[ "public", "WizardPage", "addForm", "(", "Form", "formPage", ")", "{", "Assert", ".", "notNull", "(", "formPage", ",", "\"The form page cannot be null\"", ")", ";", "WizardPage", "page", "=", "new", "FormBackedWizardPage", "(", "formPage", ",", "!", "autoConfigureC...
Adds a new page to this wizard. The page is created by wrapping the form in a {@link FormBackedWizardPage} and appending it to the end of the page list. @param formPage The form page to be added to the wizard. @return the newly created wizard page that wraps the given form. @throws IllegalArgumentException if {@code formPage} is null.
[ "Adds", "a", "new", "page", "to", "this", "wizard", ".", "The", "page", "is", "created", "by", "wrapping", "the", "form", "in", "a", "{", "@link", "FormBackedWizardPage", "}", "and", "appending", "it", "to", "the", "end", "of", "the", "page", "list", "...
train
https://github.com/lievendoclo/Valkyrie-RCP/blob/6aad6e640b348cda8f3b0841f6e42025233f1eb8/valkyrie-rcp-core/src/main/java/org/valkyriercp/wizard/AbstractWizard.java#L194-L199
Squarespace/cldr
core/src/main/java/com/squarespace/cldr/units/Rational.java
Rational.compute
public BigDecimal compute(int scale, RoundingMode mode) { return numerator.divide(denominator, scale, mode).stripTrailingZeros(); }
java
public BigDecimal compute(int scale, RoundingMode mode) { return numerator.divide(denominator, scale, mode).stripTrailingZeros(); }
[ "public", "BigDecimal", "compute", "(", "int", "scale", ",", "RoundingMode", "mode", ")", "{", "return", "numerator", ".", "divide", "(", "denominator", ",", "scale", ",", "mode", ")", ".", "stripTrailingZeros", "(", ")", ";", "}" ]
Divide the numerator by the denominator, using the given scale and rounding mode, and return the resulting decimal number.
[ "Divide", "the", "numerator", "by", "the", "denominator", "using", "the", "given", "scale", "and", "rounding", "mode", "and", "return", "the", "resulting", "decimal", "number", "." ]
train
https://github.com/Squarespace/cldr/blob/54b752d4ec2457df56e98461618f9c0eec41e1e1/core/src/main/java/com/squarespace/cldr/units/Rational.java#L74-L76
Esri/geometry-api-java
src/main/java/com/esri/core/geometry/MultiPath.java
MultiPath.bezierTo
void bezierTo(Point2D controlPoint1, Point2D controlPoint2, Point2D endPoint) { m_impl.bezierTo(controlPoint1, controlPoint2, endPoint); }
java
void bezierTo(Point2D controlPoint1, Point2D controlPoint2, Point2D endPoint) { m_impl.bezierTo(controlPoint1, controlPoint2, endPoint); }
[ "void", "bezierTo", "(", "Point2D", "controlPoint1", ",", "Point2D", "controlPoint2", ",", "Point2D", "endPoint", ")", "{", "m_impl", ".", "bezierTo", "(", "controlPoint1", ",", "controlPoint2", ",", "endPoint", ")", ";", "}" ]
Adds a Cubic Bezier Segment to the current Path. The Bezier Segment connects the current last Point and the given endPoint.
[ "Adds", "a", "Cubic", "Bezier", "Segment", "to", "the", "current", "Path", ".", "The", "Bezier", "Segment", "connects", "the", "current", "last", "Point", "and", "the", "given", "endPoint", "." ]
train
https://github.com/Esri/geometry-api-java/blob/494da8ec953d76e7c6072afbc081abfe48ff07cf/src/main/java/com/esri/core/geometry/MultiPath.java#L615-L617
joniles/mpxj
src/main/java/net/sf/mpxj/RecurringData.java
RecurringData.moreDates
private boolean moreDates(Calendar calendar, List<Date> dates) { boolean result; if (m_finishDate == null) { int occurrences = NumberHelper.getInt(m_occurrences); if (occurrences < 1) { occurrences = 1; } result = dates.size() < occurrences; } else { result = calendar.getTimeInMillis() <= m_finishDate.getTime(); } return result; }
java
private boolean moreDates(Calendar calendar, List<Date> dates) { boolean result; if (m_finishDate == null) { int occurrences = NumberHelper.getInt(m_occurrences); if (occurrences < 1) { occurrences = 1; } result = dates.size() < occurrences; } else { result = calendar.getTimeInMillis() <= m_finishDate.getTime(); } return result; }
[ "private", "boolean", "moreDates", "(", "Calendar", "calendar", ",", "List", "<", "Date", ">", "dates", ")", "{", "boolean", "result", ";", "if", "(", "m_finishDate", "==", "null", ")", "{", "int", "occurrences", "=", "NumberHelper", ".", "getInt", "(", ...
Determines if we need to calculate more dates. If we do not have a finish date, this method falls back on using the occurrences attribute. If we have a finish date, we'll use that instead. We're assuming that the recurring data has one or other of those values. @param calendar current date @param dates dates generated so far @return true if we should calculate another date
[ "Determines", "if", "we", "need", "to", "calculate", "more", "dates", ".", "If", "we", "do", "not", "have", "a", "finish", "date", "this", "method", "falls", "back", "on", "using", "the", "occurrences", "attribute", ".", "If", "we", "have", "a", "finish"...
train
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/RecurringData.java#L375-L392
lesaint/damapping
core-parent/annotation-processor/src/main/java/fr/javatronic/damapping/processor/impl/javaxparsing/ProcessingEnvironmentWrapper.java
ProcessingEnvironmentWrapper.buildErrorMessage
private static String buildErrorMessage(Exception e, String annotationSimpleName) { StackTraceElement[] stackTrace = e.getStackTrace(); StringBuilder builder = new StringBuilder() .append("Processing of annotation ") .append(annotationSimpleName) .append(" : ") .append(e); if (stackTrace.length > 0) { builder.append(" at ").append(stackTrace[0]); } return builder.toString(); }
java
private static String buildErrorMessage(Exception e, String annotationSimpleName) { StackTraceElement[] stackTrace = e.getStackTrace(); StringBuilder builder = new StringBuilder() .append("Processing of annotation ") .append(annotationSimpleName) .append(" : ") .append(e); if (stackTrace.length > 0) { builder.append(" at ").append(stackTrace[0]); } return builder.toString(); }
[ "private", "static", "String", "buildErrorMessage", "(", "Exception", "e", ",", "String", "annotationSimpleName", ")", "{", "StackTraceElement", "[", "]", "stackTrace", "=", "e", ".", "getStackTrace", "(", ")", ";", "StringBuilder", "builder", "=", "new", "Strin...
Produit un message d'erreur indiquant que le traitement de l'annoation {@code annotation} a échoué avec l'exception indiquée et précise la première ligne de la stacktrace si l'information est disponible. @param e l'{@link Exception} capturée @param annotationSimpleName un {@link TypeElement} représentation la classe d'une annotation @return une {@link String}
[ "Produit", "un", "message", "d", "erreur", "indiquant", "que", "le", "traitement", "de", "l", "annoation", "{", "@code", "annotation", "}", "a", "échoué", "avec", "l", "exception", "indiquée", "et", "précise", "la", "première", "ligne", "de", "la", "stacktra...
train
https://github.com/lesaint/damapping/blob/357afa5866939fd2a18c09213975ffef4836f328/core-parent/annotation-processor/src/main/java/fr/javatronic/damapping/processor/impl/javaxparsing/ProcessingEnvironmentWrapper.java#L109-L120
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/matrix/MatrixIO.java
MatrixIO.readMatrix
public static Matrix readMatrix(File matrix, Format format) throws IOException { switch (format) { // Assume all sparse formats will fit in memory. case SVDLIBC_SPARSE_TEXT: case SVDLIBC_SPARSE_BINARY: case MATLAB_SPARSE: case CLUTO_SPARSE: return readMatrix(matrix, format, Type.SPARSE_IN_MEMORY, false); // Assume all dense formats will fit in memory. case SVDLIBC_DENSE_TEXT: case SVDLIBC_DENSE_BINARY: case DENSE_TEXT: case CLUTO_DENSE: return readMatrix(matrix, format, Type.DENSE_IN_MEMORY, false); default: throw new Error( "Reading matrices of " + format + " format is not "+ "currently supported. Email " + "s-space-research-dev@googlegroups.com to request " + "its inclusion and it will be quickly added"); } }
java
public static Matrix readMatrix(File matrix, Format format) throws IOException { switch (format) { // Assume all sparse formats will fit in memory. case SVDLIBC_SPARSE_TEXT: case SVDLIBC_SPARSE_BINARY: case MATLAB_SPARSE: case CLUTO_SPARSE: return readMatrix(matrix, format, Type.SPARSE_IN_MEMORY, false); // Assume all dense formats will fit in memory. case SVDLIBC_DENSE_TEXT: case SVDLIBC_DENSE_BINARY: case DENSE_TEXT: case CLUTO_DENSE: return readMatrix(matrix, format, Type.DENSE_IN_MEMORY, false); default: throw new Error( "Reading matrices of " + format + " format is not "+ "currently supported. Email " + "s-space-research-dev@googlegroups.com to request " + "its inclusion and it will be quickly added"); } }
[ "public", "static", "Matrix", "readMatrix", "(", "File", "matrix", ",", "Format", "format", ")", "throws", "IOException", "{", "switch", "(", "format", ")", "{", "// Assume all sparse formats will fit in memory.", "case", "SVDLIBC_SPARSE_TEXT", ":", "case", "SVDLIBC_S...
Converts the contents of a matrix file as a {@link Matrix} object, using the provided format as a hint for what kind to create. The type of {@code Matrix} object created will assuming that the entire matrix can fit in memory based on the format of the file speicfied Note that the returned {@link Matrix} instance is not backed by the data on file; changes to the {@code Matrix} will <i>not</i> be reflected in the original file's data. @param matrix a file contain matrix data @param format the format of the file @return the {@code Matrix} instance that contains the data in the provided file
[ "Converts", "the", "contents", "of", "a", "matrix", "file", "as", "a", "{", "@link", "Matrix", "}", "object", "using", "the", "provided", "format", "as", "a", "hint", "for", "what", "kind", "to", "create", ".", "The", "type", "of", "{", "@code", "Matri...
train
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/matrix/MatrixIO.java#L716-L740
GoogleCloudPlatform/appengine-plugins-core
src/main/java/com/google/cloud/tools/appengine/operations/cloudsdk/PathResolver.java
PathResolver.getLocationsFromLink
@VisibleForTesting static void getLocationsFromLink(List<String> possiblePaths, Path link) { try { Path resolvedLink = link.toRealPath(); Path possibleBinDir = resolvedLink.getParent(); // check if the parent is "bin", we actually depend on that for other resolution if (possibleBinDir != null && possibleBinDir.getFileName().toString().equals("bin")) { Path possibleCloudSdkHome = possibleBinDir.getParent(); if (possibleCloudSdkHome != null && Files.exists(possibleCloudSdkHome)) { possiblePaths.add(possibleCloudSdkHome.toString()); } } } catch (IOException ioe) { // intentionally ignore exception logger.log(Level.FINE, "Non-critical exception when searching for cloud-sdk", ioe); } }
java
@VisibleForTesting static void getLocationsFromLink(List<String> possiblePaths, Path link) { try { Path resolvedLink = link.toRealPath(); Path possibleBinDir = resolvedLink.getParent(); // check if the parent is "bin", we actually depend on that for other resolution if (possibleBinDir != null && possibleBinDir.getFileName().toString().equals("bin")) { Path possibleCloudSdkHome = possibleBinDir.getParent(); if (possibleCloudSdkHome != null && Files.exists(possibleCloudSdkHome)) { possiblePaths.add(possibleCloudSdkHome.toString()); } } } catch (IOException ioe) { // intentionally ignore exception logger.log(Level.FINE, "Non-critical exception when searching for cloud-sdk", ioe); } }
[ "@", "VisibleForTesting", "static", "void", "getLocationsFromLink", "(", "List", "<", "String", ">", "possiblePaths", ",", "Path", "link", ")", "{", "try", "{", "Path", "resolvedLink", "=", "link", ".", "toRealPath", "(", ")", ";", "Path", "possibleBinDir", ...
resolve symlinks to a path that could be the bin directory of the cloud sdk
[ "resolve", "symlinks", "to", "a", "path", "that", "could", "be", "the", "bin", "directory", "of", "the", "cloud", "sdk" ]
train
https://github.com/GoogleCloudPlatform/appengine-plugins-core/blob/d22e9fa1103522409ab6fdfbf68c4a5a0bc5b97d/src/main/java/com/google/cloud/tools/appengine/operations/cloudsdk/PathResolver.java#L128-L144
reactor/reactor-netty
src/main/java/reactor/netty/tcp/TcpClient.java
TcpClient.wiretap
public final TcpClient wiretap(boolean enable) { if (enable) { return bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER)); } else { return bootstrap(b -> BootstrapHandlers.removeConfiguration(b, NettyPipeline.LoggingHandler)); } }
java
public final TcpClient wiretap(boolean enable) { if (enable) { return bootstrap(b -> BootstrapHandlers.updateLogSupport(b, LOGGING_HANDLER)); } else { return bootstrap(b -> BootstrapHandlers.removeConfiguration(b, NettyPipeline.LoggingHandler)); } }
[ "public", "final", "TcpClient", "wiretap", "(", "boolean", "enable", ")", "{", "if", "(", "enable", ")", "{", "return", "bootstrap", "(", "b", "->", "BootstrapHandlers", ".", "updateLogSupport", "(", "b", ",", "LOGGING_HANDLER", ")", ")", ";", "}", "else",...
Apply or remove a wire logger configuration using {@link TcpClient} category and {@code DEBUG} logger level @param enable Specifies whether the wire logger configuration will be added to the pipeline @return a new {@link TcpClient}
[ "Apply", "or", "remove", "a", "wire", "logger", "configuration", "using", "{", "@link", "TcpClient", "}", "category", "and", "{", "@code", "DEBUG", "}", "logger", "level" ]
train
https://github.com/reactor/reactor-netty/blob/4ed14316e1d7fca3cecd18d6caa5f2251e159e49/src/main/java/reactor/netty/tcp/TcpClient.java#L528-L535
w3c/epubcheck
src/main/java/org/idpf/epubcheck/util/css/CssScanner.java
CssScanner.isNextEscape
private boolean isNextEscape() throws IOException { boolean result = false; Mark mark = reader.mark(); int ch = reader.next(); if (ch == '\\') { try { Optional<CssEscape> esc = new CssEscape(reader, builder) .create(); result = esc.isPresent(); } catch (CssException ignore) { } } reader.unread(ch, mark); return result; }
java
private boolean isNextEscape() throws IOException { boolean result = false; Mark mark = reader.mark(); int ch = reader.next(); if (ch == '\\') { try { Optional<CssEscape> esc = new CssEscape(reader, builder) .create(); result = esc.isPresent(); } catch (CssException ignore) { } } reader.unread(ch, mark); return result; }
[ "private", "boolean", "isNextEscape", "(", ")", "throws", "IOException", "{", "boolean", "result", "=", "false", ";", "Mark", "mark", "=", "reader", ".", "mark", "(", ")", ";", "int", "ch", "=", "reader", ".", "next", "(", ")", ";", "if", "(", "ch", ...
Returns true if reader next() is the start of a valid escape sequence. @return whether or not the reader is at the start of a valid escape sequence. @throws IOException
[ "Returns", "true", "if", "reader", "next", "()", "is", "the", "start", "of", "a", "valid", "escape", "sequence", "." ]
train
https://github.com/w3c/epubcheck/blob/4d5a24d9f2878a2a5497eb11c036cc18fe2c0a78/src/main/java/org/idpf/epubcheck/util/css/CssScanner.java#L1000-L1021
UrielCh/ovh-java-sdk
ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java
ApiOvhOrder.dedicated_nasha_new_GET
public ArrayList<String> dedicated_nasha_new_GET(OvhNasHAZoneEnum datacenter, OvhNasHAOfferEnum model) throws IOException { String qPath = "/order/dedicated/nasha/new"; StringBuilder sb = path(qPath); query(sb, "datacenter", datacenter); query(sb, "model", model); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t1); }
java
public ArrayList<String> dedicated_nasha_new_GET(OvhNasHAZoneEnum datacenter, OvhNasHAOfferEnum model) throws IOException { String qPath = "/order/dedicated/nasha/new"; StringBuilder sb = path(qPath); query(sb, "datacenter", datacenter); query(sb, "model", model); String resp = exec(qPath, "GET", sb.toString(), null); return convertTo(resp, t1); }
[ "public", "ArrayList", "<", "String", ">", "dedicated_nasha_new_GET", "(", "OvhNasHAZoneEnum", "datacenter", ",", "OvhNasHAOfferEnum", "model", ")", "throws", "IOException", "{", "String", "qPath", "=", "\"/order/dedicated/nasha/new\"", ";", "StringBuilder", "sb", "=", ...
Get allowed durations for 'new' option REST: GET /order/dedicated/nasha/new @param datacenter [required] Nas HA localization @param model [required] Capacity of Nas HA offer
[ "Get", "allowed", "durations", "for", "new", "option" ]
train
https://github.com/UrielCh/ovh-java-sdk/blob/6d531a40e56e09701943e334c25f90f640c55701/ovh-java-sdk-order/src/main/java/net/minidev/ovh/api/ApiOvhOrder.java#L2123-L2130
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.addPrebuiltAsync
public Observable<List<PrebuiltEntityExtractor>> addPrebuiltAsync(UUID appId, String versionId, List<String> prebuiltExtractorNames) { return addPrebuiltWithServiceResponseAsync(appId, versionId, prebuiltExtractorNames).map(new Func1<ServiceResponse<List<PrebuiltEntityExtractor>>, List<PrebuiltEntityExtractor>>() { @Override public List<PrebuiltEntityExtractor> call(ServiceResponse<List<PrebuiltEntityExtractor>> response) { return response.body(); } }); }
java
public Observable<List<PrebuiltEntityExtractor>> addPrebuiltAsync(UUID appId, String versionId, List<String> prebuiltExtractorNames) { return addPrebuiltWithServiceResponseAsync(appId, versionId, prebuiltExtractorNames).map(new Func1<ServiceResponse<List<PrebuiltEntityExtractor>>, List<PrebuiltEntityExtractor>>() { @Override public List<PrebuiltEntityExtractor> call(ServiceResponse<List<PrebuiltEntityExtractor>> response) { return response.body(); } }); }
[ "public", "Observable", "<", "List", "<", "PrebuiltEntityExtractor", ">", ">", "addPrebuiltAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "List", "<", "String", ">", "prebuiltExtractorNames", ")", "{", "return", "addPrebuiltWithServiceResponseAsync", ...
Adds a list of prebuilt entity extractors to the application. @param appId The application ID. @param versionId The version ID. @param prebuiltExtractorNames An array of prebuilt entity extractor names. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the List&lt;PrebuiltEntityExtractor&gt; object
[ "Adds", "a", "list", "of", "prebuilt", "entity", "extractors", "to", "the", "application", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L2117-L2124
fhoeben/hsac-fitnesse-fixtures
src/main/java/nl/hsac/fitnesse/fixture/slim/ListFixture.java
ListFixture.copyValuesFromTo
public void copyValuesFromTo(Collection<Object> source, List<Object> target) { target.addAll(source); }
java
public void copyValuesFromTo(Collection<Object> source, List<Object> target) { target.addAll(source); }
[ "public", "void", "copyValuesFromTo", "(", "Collection", "<", "Object", ">", "source", ",", "List", "<", "Object", ">", "target", ")", "{", "target", ".", "addAll", "(", "source", ")", ";", "}" ]
Adds values to list. @param source list whose values are to be copied. @param target list to get element value from.
[ "Adds", "values", "to", "list", "." ]
train
https://github.com/fhoeben/hsac-fitnesse-fixtures/blob/4e9018d7386a9aa65bfcbf07eb28ae064edd1732/src/main/java/nl/hsac/fitnesse/fixture/slim/ListFixture.java#L166-L168
Azure/azure-sdk-for-java
eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java
DomainsInner.regenerateKey
public DomainSharedAccessKeysInner regenerateKey(String resourceGroupName, String domainName, String keyName) { return regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName).toBlocking().single().body(); }
java
public DomainSharedAccessKeysInner regenerateKey(String resourceGroupName, String domainName, String keyName) { return regenerateKeyWithServiceResponseAsync(resourceGroupName, domainName, keyName).toBlocking().single().body(); }
[ "public", "DomainSharedAccessKeysInner", "regenerateKey", "(", "String", "resourceGroupName", ",", "String", "domainName", ",", "String", "keyName", ")", "{", "return", "regenerateKeyWithServiceResponseAsync", "(", "resourceGroupName", ",", "domainName", ",", "keyName", "...
Regenerate key for a domain. Regenerate a shared access key for a domain. @param resourceGroupName The name of the resource group within the user's subscription. @param domainName Name of the domain @param keyName Key name to regenerate key1 or key2 @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the DomainSharedAccessKeysInner object if successful.
[ "Regenerate", "key", "for", "a", "domain", ".", "Regenerate", "a", "shared", "access", "key", "for", "a", "domain", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/eventgrid/resource-manager/v2018_09_15_preview/src/main/java/com/microsoft/azure/management/eventgrid/v2018_09_15_preview/implementation/DomainsInner.java#L1163-L1165
Azure/azure-sdk-for-java
keyvault/data-plane/azure-keyvault/src/main/java/com/microsoft/azure/keyvault/implementation/KeyVaultClientBaseImpl.java
KeyVaultClientBaseImpl.updateKeyAsync
public Observable<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) { return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() { @Override public KeyBundle call(ServiceResponse<KeyBundle> response) { return response.body(); } }); }
java
public Observable<KeyBundle> updateKeyAsync(String vaultBaseUrl, String keyName, String keyVersion, List<JsonWebKeyOperation> keyOps, KeyAttributes keyAttributes, Map<String, String> tags) { return updateKeyWithServiceResponseAsync(vaultBaseUrl, keyName, keyVersion, keyOps, keyAttributes, tags).map(new Func1<ServiceResponse<KeyBundle>, KeyBundle>() { @Override public KeyBundle call(ServiceResponse<KeyBundle> response) { return response.body(); } }); }
[ "public", "Observable", "<", "KeyBundle", ">", "updateKeyAsync", "(", "String", "vaultBaseUrl", ",", "String", "keyName", ",", "String", "keyVersion", ",", "List", "<", "JsonWebKeyOperation", ">", "keyOps", ",", "KeyAttributes", "keyAttributes", ",", "Map", "<", ...
The update key operation changes specified attributes of a stored key and can be applied to any key type and key version stored in Azure Key Vault. In order to perform this operation, the key must already exist in the Key Vault. Note: The cryptographic material of a key itself cannot be changed. This operation requires the keys/update permission. @param vaultBaseUrl The vault name, for example https://myvault.vault.azure.net. @param keyName The name of key to update. @param keyVersion The version of the key to update. @param keyOps Json web key operations. For more information on possible key operations, see JsonWebKeyOperation. @param keyAttributes the KeyAttributes value @param tags Application specific metadata in the form of key-value pairs. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the KeyBundle object
[ "The", "update", "key", "operation", "changes", "specified", "attributes", "of", "a", "stored", "key", "and", "can", "be", "applied", "to", "any", "key", "type", "and", "key", "version", "stored", "in", "Azure", "Key", "Vault", ".", "In", "order", "to", ...
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#L1309-L1316
ixa-ehu/kaflib
src/main/java/ixa/kaflib/KAFDocument.java
KAFDocument.newPredicate
public Predicate newPredicate(Span<Term> span) { String newId = idManager.getNextId(AnnotationType.PREDICATE); Predicate newPredicate = new Predicate(newId, span); annotationContainer.add(newPredicate, Layer.SRL, AnnotationType.PREDICATE); return newPredicate; }
java
public Predicate newPredicate(Span<Term> span) { String newId = idManager.getNextId(AnnotationType.PREDICATE); Predicate newPredicate = new Predicate(newId, span); annotationContainer.add(newPredicate, Layer.SRL, AnnotationType.PREDICATE); return newPredicate; }
[ "public", "Predicate", "newPredicate", "(", "Span", "<", "Term", ">", "span", ")", "{", "String", "newId", "=", "idManager", ".", "getNextId", "(", "AnnotationType", ".", "PREDICATE", ")", ";", "Predicate", "newPredicate", "=", "new", "Predicate", "(", "newI...
Creates a new srl predicate. It assigns an appropriate ID to it. The predicate is added to the document. @param span span containing all the targets of the predicate @return a new predicate
[ "Creates", "a", "new", "srl", "predicate", ".", "It", "assigns", "an", "appropriate", "ID", "to", "it", ".", "The", "predicate", "is", "added", "to", "the", "document", "." ]
train
https://github.com/ixa-ehu/kaflib/blob/3921f55d9ae4621736a329418f6334fb721834b8/src/main/java/ixa/kaflib/KAFDocument.java#L1007-L1012
jenkinsci/java-client-api
jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java
JenkinsServer.createView
public JenkinsServer createView(String viewName, String viewXml, Boolean crumbFlag) throws IOException { return createView(null, viewName, viewXml, crumbFlag); }
java
public JenkinsServer createView(String viewName, String viewXml, Boolean crumbFlag) throws IOException { return createView(null, viewName, viewXml, crumbFlag); }
[ "public", "JenkinsServer", "createView", "(", "String", "viewName", ",", "String", "viewXml", ",", "Boolean", "crumbFlag", ")", "throws", "IOException", "{", "return", "createView", "(", "null", ",", "viewName", ",", "viewXml", ",", "crumbFlag", ")", ";", "}" ...
Create a view on the server using the provided xml. @param viewName name of the view to be created. @param viewXml The configuration for the view. @param crumbFlag <code>true</code> to add <b>crumbIssuer</b> <code>false</code> otherwise. @throws IOException in case of an error.
[ "Create", "a", "view", "on", "the", "server", "using", "the", "provided", "xml", "." ]
train
https://github.com/jenkinsci/java-client-api/blob/c4f5953d3d4dda92cd946ad3bf2b811524c32da9/jenkins-client/src/main/java/com/offbytwo/jenkins/JenkinsServer.java#L414-L416
unbescape/unbescape
src/main/java/org/unbescape/xml/XmlEscape.java
XmlEscape.escapeXml10
public static void escapeXml10(final Reader reader, final Writer writer, final XmlEscapeType type, final XmlEscapeLevel level) throws IOException { escapeXml(reader, writer, XmlEscapeSymbols.XML10_SYMBOLS, type, level); }
java
public static void escapeXml10(final Reader reader, final Writer writer, final XmlEscapeType type, final XmlEscapeLevel level) throws IOException { escapeXml(reader, writer, XmlEscapeSymbols.XML10_SYMBOLS, type, level); }
[ "public", "static", "void", "escapeXml10", "(", "final", "Reader", "reader", ",", "final", "Writer", "writer", ",", "final", "XmlEscapeType", "type", ",", "final", "XmlEscapeLevel", "level", ")", "throws", "IOException", "{", "escapeXml", "(", "reader", ",", "...
<p> Perform a (configurable) XML 1.0 <strong>escape</strong> operation on a <tt>Reader</tt> input, writing results to a <tt>Writer</tt>. </p> <p> This method will perform an escape operation according to the specified {@link org.unbescape.xml.XmlEscapeType} and {@link org.unbescape.xml.XmlEscapeLevel} argument values. </p> <p> All other <tt>Reader</tt>/<tt>Writer</tt>-based <tt>escapeXml10*(...)</tt> methods call this one with preconfigured <tt>type</tt> and <tt>level</tt> values. </p> <p> This method is <strong>thread-safe</strong>. </p> @param reader the <tt>Reader</tt> reading the text to be escaped. @param writer the <tt>java.io.Writer</tt> to which the escaped result will be written. Nothing will be written at all to this writer if input is <tt>null</tt>. @param type the type of escape operation to be performed, see {@link org.unbescape.xml.XmlEscapeType}. @param level the escape level to be applied, see {@link org.unbescape.xml.XmlEscapeLevel}. @throws IOException if an input/output exception occurs @since 1.1.2
[ "<p", ">", "Perform", "a", "(", "configurable", ")", "XML", "1", ".", "0", "<strong", ">", "escape<", "/", "strong", ">", "operation", "on", "a", "<tt", ">", "Reader<", "/", "tt", ">", "input", "writing", "results", "to", "a", "<tt", ">", "Writer<", ...
train
https://github.com/unbescape/unbescape/blob/ec5435fb3508c2eed25d8165dc27ded2602cae13/src/main/java/org/unbescape/xml/XmlEscape.java#L1589-L1592
opsmatters/newrelic-api
src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java
HttpContext.executePutRequest
protected void executePutRequest(URI uri, Object obj) { executePutRequest(uri, obj, null, null); }
java
protected void executePutRequest(URI uri, Object obj) { executePutRequest(uri, obj, null, null); }
[ "protected", "void", "executePutRequest", "(", "URI", "uri", ",", "Object", "obj", ")", "{", "executePutRequest", "(", "uri", ",", "obj", ",", "null", ",", "null", ")", ";", "}" ]
Execute a PUT request. @param uri The URI to call @param obj The object to use for the PUT
[ "Execute", "a", "PUT", "request", "." ]
train
https://github.com/opsmatters/newrelic-api/blob/5bc2ea62ec368db891e4fd5fe3dcdf529d086b5e/src/main/java/com/opsmatters/newrelic/api/services/HttpContext.java#L360-L363
BellaDati/belladati-sdk-java
src/main/java/com/belladati/sdk/impl/BellaDatiServiceImpl.java
BellaDatiServiceImpl.appendFilter
public URIBuilder appendFilter(URIBuilder builder, Collection<Filter<?>> filters) { if (filters.size() > 0) { ObjectNode filterNode = new ObjectMapper().createObjectNode(); for (Filter<?> filter : filters) { filterNode.setAll(filter.toJson()); } ObjectNode drilldownNode = new ObjectMapper().createObjectNode(); drilldownNode.put("drilldown", filterNode); builder.addParameter("filter", drilldownNode.toString()); } return builder; }
java
public URIBuilder appendFilter(URIBuilder builder, Collection<Filter<?>> filters) { if (filters.size() > 0) { ObjectNode filterNode = new ObjectMapper().createObjectNode(); for (Filter<?> filter : filters) { filterNode.setAll(filter.toJson()); } ObjectNode drilldownNode = new ObjectMapper().createObjectNode(); drilldownNode.put("drilldown", filterNode); builder.addParameter("filter", drilldownNode.toString()); } return builder; }
[ "public", "URIBuilder", "appendFilter", "(", "URIBuilder", "builder", ",", "Collection", "<", "Filter", "<", "?", ">", ">", "filters", ")", "{", "if", "(", "filters", ".", "size", "(", ")", ">", "0", ")", "{", "ObjectNode", "filterNode", "=", "new", "O...
Appends a filter parameter from the given filters to the URI builder. Won't do anything if the filter collection is empty. @param builder the builder to append to @param filters filters to append @return the same builder, for chaining
[ "Appends", "a", "filter", "parameter", "from", "the", "given", "filters", "to", "the", "URI", "builder", ".", "Won", "t", "do", "anything", "if", "the", "filter", "collection", "is", "empty", "." ]
train
https://github.com/BellaDati/belladati-sdk-java/blob/1a732a57ebc825ddf47ce405723cc958adb1a43f/src/main/java/com/belladati/sdk/impl/BellaDatiServiceImpl.java#L384-L395
liferay/com-liferay-commerce
commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java
CommerceNotificationQueueEntryPersistenceImpl.findByLtS
@Override public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate, int start, int end) { return findByLtS(sentDate, start, end, null); }
java
@Override public List<CommerceNotificationQueueEntry> findByLtS(Date sentDate, int start, int end) { return findByLtS(sentDate, start, end, null); }
[ "@", "Override", "public", "List", "<", "CommerceNotificationQueueEntry", ">", "findByLtS", "(", "Date", "sentDate", ",", "int", "start", ",", "int", "end", ")", "{", "return", "findByLtS", "(", "sentDate", ",", "start", ",", "end", ",", "null", ")", ";", ...
Returns a range of all the commerce notification queue entries where sentDate &lt; &#63;. <p> Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link CommerceNotificationQueueEntryModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order. </p> @param sentDate the sent date @param start the lower bound of the range of commerce notification queue entries @param end the upper bound of the range of commerce notification queue entries (not inclusive) @return the range of matching commerce notification queue entries
[ "Returns", "a", "range", "of", "all", "the", "commerce", "notification", "queue", "entries", "where", "sentDate", "&lt", ";", "&#63", ";", "." ]
train
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-notification-service/src/main/java/com/liferay/commerce/notification/service/persistence/impl/CommerceNotificationQueueEntryPersistenceImpl.java#L1703-L1707
arakelian/more-commons
src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java
XmlStreamReaderUtils.requiredDoubleAttribute
public static double requiredDoubleAttribute(final XMLStreamReader reader, final String localName) throws XMLStreamException { return requiredDoubleAttribute(reader, null, localName); }
java
public static double requiredDoubleAttribute(final XMLStreamReader reader, final String localName) throws XMLStreamException { return requiredDoubleAttribute(reader, null, localName); }
[ "public", "static", "double", "requiredDoubleAttribute", "(", "final", "XMLStreamReader", "reader", ",", "final", "String", "localName", ")", "throws", "XMLStreamException", "{", "return", "requiredDoubleAttribute", "(", "reader", ",", "null", ",", "localName", ")", ...
Returns the value of an attribute as a double. If the attribute is empty, this method throws an exception. @param reader <code>XMLStreamReader</code> that contains attribute values. @param localName local name of attribute (the namespace is ignored). @return value of attribute as double @throws XMLStreamException if attribute is empty.
[ "Returns", "the", "value", "of", "an", "attribute", "as", "a", "double", ".", "If", "the", "attribute", "is", "empty", "this", "method", "throws", "an", "exception", "." ]
train
https://github.com/arakelian/more-commons/blob/83c607044f64a7f6c005a67866c0ef7cb68d6e29/src/main/java/com/arakelian/core/utils/XmlStreamReaderUtils.java#L1131-L1134
spring-projects/spring-social
spring-social-core/src/main/java/org/springframework/social/oauth1/OAuth1Template.java
OAuth1Template.createOAuthToken
protected OAuthToken createOAuthToken(String tokenValue, String tokenSecret, MultiValueMap<String, String> response) { return new OAuthToken(tokenValue, tokenSecret); }
java
protected OAuthToken createOAuthToken(String tokenValue, String tokenSecret, MultiValueMap<String, String> response) { return new OAuthToken(tokenValue, tokenSecret); }
[ "protected", "OAuthToken", "createOAuthToken", "(", "String", "tokenValue", ",", "String", "tokenSecret", ",", "MultiValueMap", "<", "String", ",", "String", ">", "response", ")", "{", "return", "new", "OAuthToken", "(", "tokenValue", ",", "tokenSecret", ")", ";...
Creates an {@link OAuthToken} given the response from the request token or access token exchange with the provider. May be overridden to create a custom {@link OAuthToken}. @param tokenValue the token value received from the provider. @param tokenSecret the token secret received from the provider. @param response all parameters from the response received in the request/access token exchange. @return an {@link OAuthToken}
[ "Creates", "an", "{" ]
train
https://github.com/spring-projects/spring-social/blob/e41cfecb288022b83c79413b58f52511c3c9d4fc/spring-social-core/src/main/java/org/springframework/social/oauth1/OAuth1Template.java#L156-L158
gallandarakhneorg/afc
advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/RoadPolyline.java
RoadPolyline.getNearestPoint
@Pure <CT extends RoadConnection> CT getNearestPoint(Class<CT> connectionClass, double x, double y) { final int index = getNearestEndIndex(x, y); if (index == 0) { return getBeginPoint(connectionClass); } return getEndPoint(connectionClass); }
java
@Pure <CT extends RoadConnection> CT getNearestPoint(Class<CT> connectionClass, double x, double y) { final int index = getNearestEndIndex(x, y); if (index == 0) { return getBeginPoint(connectionClass); } return getEndPoint(connectionClass); }
[ "@", "Pure", "<", "CT", "extends", "RoadConnection", ">", "CT", "getNearestPoint", "(", "Class", "<", "CT", ">", "connectionClass", ",", "double", "x", ",", "double", "y", ")", "{", "final", "int", "index", "=", "getNearestEndIndex", "(", "x", ",", "y", ...
Replies the nearest start/end point to the specified point. @param <CT> is the type of the connection to reply @param connectionClass is the type of the connection to reply @param x x coordinate. @param y y coordinate. @return the nearest point
[ "Replies", "the", "nearest", "start", "/", "end", "point", "to", "the", "specified", "point", "." ]
train
https://github.com/gallandarakhneorg/afc/blob/0c7d2e1ddefd4167ef788416d970a6c1ef6f8bbb/advanced/gis/gisroad/src/main/java/org/arakhne/afc/gis/road/RoadPolyline.java#L293-L300
Azure/azure-sdk-for-java
network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java
PublicIPAddressesInner.beginCreateOrUpdate
public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().body(); }
java
public PublicIPAddressInner beginCreateOrUpdate(String resourceGroupName, String publicIpAddressName, PublicIPAddressInner parameters) { return beginCreateOrUpdateWithServiceResponseAsync(resourceGroupName, publicIpAddressName, parameters).toBlocking().single().body(); }
[ "public", "PublicIPAddressInner", "beginCreateOrUpdate", "(", "String", "resourceGroupName", ",", "String", "publicIpAddressName", ",", "PublicIPAddressInner", "parameters", ")", "{", "return", "beginCreateOrUpdateWithServiceResponseAsync", "(", "resourceGroupName", ",", "publi...
Creates or updates a static or dynamic public IP address. @param resourceGroupName The name of the resource group. @param publicIpAddressName The name of the public IP address. @param parameters Parameters supplied to the create or update public IP address operation. @throws IllegalArgumentException thrown if parameters fail the validation @throws CloudException thrown if the request is rejected by server @throws RuntimeException all other wrapped checked exceptions if the request fails to be sent @return the PublicIPAddressInner object if successful.
[ "Creates", "or", "updates", "a", "static", "or", "dynamic", "public", "IP", "address", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/network/resource-manager/v2018_07_01/src/main/java/com/microsoft/azure/management/network/v2018_07_01/implementation/PublicIPAddressesInner.java#L539-L541
jamesagnew/hapi-fhir
hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java
DateRangeParam.setRangeFromDatesInclusive
public void setRangeFromDatesInclusive(IPrimitiveType<Date> theLowerBound, IPrimitiveType<Date> theUpperBound) { IPrimitiveType<Date> lowerBound = theLowerBound; IPrimitiveType<Date> upperBound = theUpperBound; if (lowerBound != null && lowerBound.getValue() != null && upperBound != null && upperBound.getValue() != null) { if (lowerBound.getValue().after(upperBound.getValue())) { IPrimitiveType<Date> temp = lowerBound; lowerBound = upperBound; upperBound = temp; } } validateAndSet( lowerBound != null ? new DateParam(GREATERTHAN_OR_EQUALS, lowerBound) : null, upperBound != null ? new DateParam(LESSTHAN_OR_EQUALS, upperBound) : null); }
java
public void setRangeFromDatesInclusive(IPrimitiveType<Date> theLowerBound, IPrimitiveType<Date> theUpperBound) { IPrimitiveType<Date> lowerBound = theLowerBound; IPrimitiveType<Date> upperBound = theUpperBound; if (lowerBound != null && lowerBound.getValue() != null && upperBound != null && upperBound.getValue() != null) { if (lowerBound.getValue().after(upperBound.getValue())) { IPrimitiveType<Date> temp = lowerBound; lowerBound = upperBound; upperBound = temp; } } validateAndSet( lowerBound != null ? new DateParam(GREATERTHAN_OR_EQUALS, lowerBound) : null, upperBound != null ? new DateParam(LESSTHAN_OR_EQUALS, upperBound) : null); }
[ "public", "void", "setRangeFromDatesInclusive", "(", "IPrimitiveType", "<", "Date", ">", "theLowerBound", ",", "IPrimitiveType", "<", "Date", ">", "theUpperBound", ")", "{", "IPrimitiveType", "<", "Date", ">", "lowerBound", "=", "theLowerBound", ";", "IPrimitiveType...
Sets the range from a pair of dates, inclusive on both ends. Note that if theLowerBound is after theUpperBound, thie method will automatically reverse the order of the arguments in order to create an inclusive range. @param theLowerBound A qualified date param representing the lower date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null. @param theUpperBound A qualified date param representing the upper date bound (optionally may include time), e.g. "2011-02-22" or "2011-02-22T13:12:00Z". Will be treated inclusively. Either theLowerBound or theUpperBound may both be populated, or one may be null, but it is not valid for both to be null.
[ "Sets", "the", "range", "from", "a", "pair", "of", "dates", "inclusive", "on", "both", "ends", ".", "Note", "that", "if", "theLowerBound", "is", "after", "theUpperBound", "thie", "method", "will", "automatically", "reverse", "the", "order", "of", "the", "arg...
train
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/param/DateRangeParam.java#L421-L434
RoaringBitmap/RoaringBitmap
roaringbitmap/src/main/java/org/roaringbitmap/Util.java
Util.unsignedIntersect2by2
public static int unsignedIntersect2by2(final short[] set1, final int length1, final short[] set2, final int length2, final short[] buffer) { final int THRESHOLD = 25; if (set1.length * THRESHOLD < set2.length) { return unsignedOneSidedGallopingIntersect2by2(set1, length1, set2, length2, buffer); } else if (set2.length * THRESHOLD < set1.length) { return unsignedOneSidedGallopingIntersect2by2(set2, length2, set1, length1, buffer); } else { return unsignedLocalIntersect2by2(set1, length1, set2, length2, buffer); } }
java
public static int unsignedIntersect2by2(final short[] set1, final int length1, final short[] set2, final int length2, final short[] buffer) { final int THRESHOLD = 25; if (set1.length * THRESHOLD < set2.length) { return unsignedOneSidedGallopingIntersect2by2(set1, length1, set2, length2, buffer); } else if (set2.length * THRESHOLD < set1.length) { return unsignedOneSidedGallopingIntersect2by2(set2, length2, set1, length1, buffer); } else { return unsignedLocalIntersect2by2(set1, length1, set2, length2, buffer); } }
[ "public", "static", "int", "unsignedIntersect2by2", "(", "final", "short", "[", "]", "set1", ",", "final", "int", "length1", ",", "final", "short", "[", "]", "set2", ",", "final", "int", "length2", ",", "final", "short", "[", "]", "buffer", ")", "{", "...
Intersect two sorted lists and write the result to the provided output array @param set1 first array @param length1 length of first array @param set2 second array @param length2 length of second array @param buffer output array @return cardinality of the intersection
[ "Intersect", "two", "sorted", "lists", "and", "write", "the", "result", "to", "the", "provided", "output", "array" ]
train
https://github.com/RoaringBitmap/RoaringBitmap/blob/b26fd0a1330fd4d2877f4d74feb69ceb812e9efa/roaringbitmap/src/main/java/org/roaringbitmap/Util.java#L779-L789
wellner/jcarafe
jcarafe-core/src/main/java/cern/colt/list/AbstractIntList.java
AbstractIntList.beforeInsertDummies
protected void beforeInsertDummies(int index, int length) { if (index > size || index < 0) throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size); if (length > 0) { ensureCapacity(size + length); setSizeRaw(size + length); replaceFromToWithFrom(index+length,size-1,this,index); } }
java
protected void beforeInsertDummies(int index, int length) { if (index > size || index < 0) throw new IndexOutOfBoundsException("Index: "+index+", Size: "+size); if (length > 0) { ensureCapacity(size + length); setSizeRaw(size + length); replaceFromToWithFrom(index+length,size-1,this,index); } }
[ "protected", "void", "beforeInsertDummies", "(", "int", "index", ",", "int", "length", ")", "{", "if", "(", "index", ">", "size", "||", "index", "<", "0", ")", "throw", "new", "IndexOutOfBoundsException", "(", "\"Index: \"", "+", "index", "+", "\", Size: \""...
Inserts <tt>length</tt> dummy elements before the specified position into the receiver. Shifts the element currently at that position (if any) and any subsequent elements to the right. <b>This method must set the new size to be <tt>size()+length</tt>. @param index index before which to insert dummy elements (must be in [0,size]).. @param length number of dummy elements to be inserted. @throws IndexOutOfBoundsException if <tt>index &lt; 0 || index &gt; size()</tt>.
[ "Inserts", "<tt", ">", "length<", "/", "tt", ">", "dummy", "elements", "before", "the", "specified", "position", "into", "the", "receiver", ".", "Shifts", "the", "element", "currently", "at", "that", "position", "(", "if", "any", ")", "and", "any", "subseq...
train
https://github.com/wellner/jcarafe/blob/ab8b0a83dbf600fe80c27711815c90bd3055b217/jcarafe-core/src/main/java/cern/colt/list/AbstractIntList.java#L96-L104
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.updateHierarchicalEntityRoleAsync
public Observable<OperationStatus> updateHierarchicalEntityRoleAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) { return updateHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId, updateHierarchicalEntityRoleOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override public OperationStatus call(ServiceResponse<OperationStatus> response) { return response.body(); } }); }
java
public Observable<OperationStatus> updateHierarchicalEntityRoleAsync(UUID appId, String versionId, UUID hEntityId, UUID roleId, UpdateHierarchicalEntityRoleOptionalParameter updateHierarchicalEntityRoleOptionalParameter) { return updateHierarchicalEntityRoleWithServiceResponseAsync(appId, versionId, hEntityId, roleId, updateHierarchicalEntityRoleOptionalParameter).map(new Func1<ServiceResponse<OperationStatus>, OperationStatus>() { @Override public OperationStatus call(ServiceResponse<OperationStatus> response) { return response.body(); } }); }
[ "public", "Observable", "<", "OperationStatus", ">", "updateHierarchicalEntityRoleAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "hEntityId", ",", "UUID", "roleId", ",", "UpdateHierarchicalEntityRoleOptionalParameter", "updateHierarchicalEntityRoleOpti...
Update an entity role for a given entity. @param appId The application ID. @param versionId The version ID. @param hEntityId The hierarchical entity extractor ID. @param roleId The entity role ID. @param updateHierarchicalEntityRoleOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object
[ "Update", "an", "entity", "role", "for", "a", "given", "entity", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L13291-L13298
sagiegurari/fax4j
src/main/java/org/fax4j/spi/hoiio/HoiioFaxClientSpi.java
HoiioFaxClientSpi.updateFaxJob2HTTPRequestConverterConfiguration
@Override protected void updateFaxJob2HTTPRequestConverterConfiguration(Map<String,String> configuration) { //get ID and token String applicationID=this.getConfigurationValue(FaxClientSpiConfigurationConstants.APPLICATION_ID_PROPERTY_KEY); String accessToken=this.getConfigurationValue(FaxClientSpiConfigurationConstants.ACCESS_TOKEN_PROPERTY_KEY); //validate data if((applicationID==null)||(accessToken==null)) { throw new FaxException("Missing hoiio Application ID/Access Token values."); } //get property part String propertyPart=this.getPropertyPart(); //modify configuration configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_FILE_CONTENT_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"file"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_TARGET_ADDRESS_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"dest"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_SENDER_FAX_NUMBER_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"caller_id"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.GET_FAX_JOB_STATUS_ACTION_FAX_JOB_ID_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"txn_ref"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.ADDITIONAL_PARAMETER_PROPERTY_KEY_PREFIX.toString()+"app_id",propertyPart),applicationID); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.ADDITIONAL_PARAMETER_PROPERTY_KEY_PREFIX.toString()+"access_token",propertyPart),accessToken); }
java
@Override protected void updateFaxJob2HTTPRequestConverterConfiguration(Map<String,String> configuration) { //get ID and token String applicationID=this.getConfigurationValue(FaxClientSpiConfigurationConstants.APPLICATION_ID_PROPERTY_KEY); String accessToken=this.getConfigurationValue(FaxClientSpiConfigurationConstants.ACCESS_TOKEN_PROPERTY_KEY); //validate data if((applicationID==null)||(accessToken==null)) { throw new FaxException("Missing hoiio Application ID/Access Token values."); } //get property part String propertyPart=this.getPropertyPart(); //modify configuration configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_FILE_CONTENT_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"file"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_TARGET_ADDRESS_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"dest"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.SUBMIT_ACTION_SENDER_FAX_NUMBER_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"caller_id"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.GET_FAX_JOB_STATUS_ACTION_FAX_JOB_ID_PARAMETER_NAME_PROPERTY_KEY.toString(),propertyPart),"txn_ref"); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.ADDITIONAL_PARAMETER_PROPERTY_KEY_PREFIX.toString()+"app_id",propertyPart),applicationID); configuration.put(MessageFormat.format(FaxJob2HTTPRequestConverterConfigurationConstants.ADDITIONAL_PARAMETER_PROPERTY_KEY_PREFIX.toString()+"access_token",propertyPart),accessToken); }
[ "@", "Override", "protected", "void", "updateFaxJob2HTTPRequestConverterConfiguration", "(", "Map", "<", "String", ",", "String", ">", "configuration", ")", "{", "//get ID and token", "String", "applicationID", "=", "this", ".", "getConfigurationValue", "(", "FaxClientS...
Hook for extending classes. @param configuration The converter configuration
[ "Hook", "for", "extending", "classes", "." ]
train
https://github.com/sagiegurari/fax4j/blob/42fa51acabe7bf279e27ab3dd1cf76146b27955f/src/main/java/org/fax4j/spi/hoiio/HoiioFaxClientSpi.java#L171-L194
phax/ph-javacc-maven-plugin
src/main/java/org/codehaus/mojo/javacc/JTB.java
JTB.getOutputFile
public File getOutputFile () { File outputFile = null; if (this.outputDirectory != null && this.inputFile != null) { final String fileName = FileUtils.removeExtension (this.inputFile.getName ()) + ".jj"; outputFile = new File (this.outputDirectory, fileName); } return outputFile; }
java
public File getOutputFile () { File outputFile = null; if (this.outputDirectory != null && this.inputFile != null) { final String fileName = FileUtils.removeExtension (this.inputFile.getName ()) + ".jj"; outputFile = new File (this.outputDirectory, fileName); } return outputFile; }
[ "public", "File", "getOutputFile", "(", ")", "{", "File", "outputFile", "=", "null", ";", "if", "(", "this", ".", "outputDirectory", "!=", "null", "&&", "this", ".", "inputFile", "!=", "null", ")", "{", "final", "String", "fileName", "=", "FileUtils", "....
Gets the absolute path to the enhanced grammar file generated by JTB. @return The absolute path to the enhanced grammar file generated by JTB or <code>null</code> if either the input file or the output directory have not been set.
[ "Gets", "the", "absolute", "path", "to", "the", "enhanced", "grammar", "file", "generated", "by", "JTB", "." ]
train
https://github.com/phax/ph-javacc-maven-plugin/blob/99497a971fe59ab2289258ca7ddcfa40e651f19f/src/main/java/org/codehaus/mojo/javacc/JTB.java#L174-L183
togglz/togglz
core/src/main/java/org/togglz/core/activation/AbstractPropertyDrivenActivationStrategy.java
AbstractPropertyDrivenActivationStrategy.getPropertyName
protected String getPropertyName(FeatureState featureState, String parameterName) { String propertyName = featureState.getParameter(parameterName); if (Strings.isNotBlank(propertyName)) { return propertyName; } return DEFAULT_PROPERTY_PREFIX + featureState.getFeature().name(); }
java
protected String getPropertyName(FeatureState featureState, String parameterName) { String propertyName = featureState.getParameter(parameterName); if (Strings.isNotBlank(propertyName)) { return propertyName; } return DEFAULT_PROPERTY_PREFIX + featureState.getFeature().name(); }
[ "protected", "String", "getPropertyName", "(", "FeatureState", "featureState", ",", "String", "parameterName", ")", "{", "String", "propertyName", "=", "featureState", ".", "getParameter", "(", "parameterName", ")", ";", "if", "(", "Strings", ".", "isNotBlank", "(...
<p> Returns the name of the property on which to base the activation of the feature. </p> <p> This method will first attempt to use the value of the parameter with the name provided. If that does not return a valid property name (i.e. non-blank), then a property name will be constructed using a common prefix ("{@value #DEFAULT_PROPERTY_PREFIX}") and the name of the feature. </p> @param featureState the {@link FeatureState} which represents the current configuration of the feature @param parameterName the name of the parameter that potentially contains the property name @return The name of the property.
[ "<p", ">", "Returns", "the", "name", "of", "the", "property", "on", "which", "to", "base", "the", "activation", "of", "the", "feature", ".", "<", "/", "p", ">", "<p", ">", "This", "method", "will", "first", "attempt", "to", "use", "the", "value", "of...
train
https://github.com/togglz/togglz/blob/76d3ffbc8e3fac5a6cb566cc4afbd8dd5f06c4e5/core/src/main/java/org/togglz/core/activation/AbstractPropertyDrivenActivationStrategy.java#L63-L70
salesforce/Argus
ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/MethodHelpDto.java
MethodHelpDto.fromMethodClass
public static MethodHelpDto fromMethodClass(String parentPath, Method method) { String methodName = _getHttpMethod(method); Path path = method.getAnnotation(Path.class); Description description = method.getAnnotation(Description.class); Produces produces = method.getAnnotation(Produces.class); Consumes consumes = method.getAnnotation(Consumes.class); if ((path == null || !path.value().contains("help")) && description != null) { String relativePath = path == null ? "" : path.value(); String fullPath = parentPath == null ? relativePath : parentPath + relativePath; MethodHelpDto result = new MethodHelpDto(); result.setDescription(description.value()); result.setMethod(methodName); result.setPath(fullPath); if (produces != null) { result.setProduces(produces.value()); } if (consumes != null) { result.setConsumes(consumes.value()); } List<MethodParameterDto> params = _getMethodParams(method); result.setParams(params); return result; } else { return null; } }
java
public static MethodHelpDto fromMethodClass(String parentPath, Method method) { String methodName = _getHttpMethod(method); Path path = method.getAnnotation(Path.class); Description description = method.getAnnotation(Description.class); Produces produces = method.getAnnotation(Produces.class); Consumes consumes = method.getAnnotation(Consumes.class); if ((path == null || !path.value().contains("help")) && description != null) { String relativePath = path == null ? "" : path.value(); String fullPath = parentPath == null ? relativePath : parentPath + relativePath; MethodHelpDto result = new MethodHelpDto(); result.setDescription(description.value()); result.setMethod(methodName); result.setPath(fullPath); if (produces != null) { result.setProduces(produces.value()); } if (consumes != null) { result.setConsumes(consumes.value()); } List<MethodParameterDto> params = _getMethodParams(method); result.setParams(params); return result; } else { return null; } }
[ "public", "static", "MethodHelpDto", "fromMethodClass", "(", "String", "parentPath", ",", "Method", "method", ")", "{", "String", "methodName", "=", "_getHttpMethod", "(", "method", ")", ";", "Path", "path", "=", "method", ".", "getAnnotation", "(", "Path", "....
Creates a method help DTO from a method object. @param parentPath The parent method path. @param method The method to convert. @return The method help DTO.
[ "Creates", "a", "method", "help", "DTO", "from", "a", "method", "object", "." ]
train
https://github.com/salesforce/Argus/blob/121b59a268da264316cded6a3e9271366a23cd86/ArgusWebServices/src/main/java/com/salesforce/dva/argus/ws/dto/MethodHelpDto.java#L168-L197
xhsun/gw2wrapper
src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java
AsynchronousRequest.getAchievementProgression
public void getAchievementProgression(String API, Callback<List<AchievementProgression>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.API, API)); gw2API.getAchievementProgression(API).enqueue(callback); }
java
public void getAchievementProgression(String API, Callback<List<AchievementProgression>> callback) throws GuildWars2Exception, NullPointerException { isParamValid(new ParamChecker(ParamType.API, API)); gw2API.getAchievementProgression(API).enqueue(callback); }
[ "public", "void", "getAchievementProgression", "(", "String", "API", ",", "Callback", "<", "List", "<", "AchievementProgression", ">", ">", "callback", ")", "throws", "GuildWars2Exception", ",", "NullPointerException", "{", "isParamValid", "(", "new", "ParamChecker", ...
For more info on Account API go <a href="https://wiki.guildwars2.com/wiki/API:2/account">here</a><br/> Give user the access to {@link Callback#onResponse(Call, Response)} and {@link Callback#onFailure(Call, Throwable)} methods for custom interactions @param API API key @param callback callback that is going to be used for {@link Call#enqueue(Callback)} @throws GuildWars2Exception invalid API key @throws NullPointerException if given {@link Callback} is empty @see AchievementProgression Account achievement info
[ "For", "more", "info", "on", "Account", "API", "go", "<a", "href", "=", "https", ":", "//", "wiki", ".", "guildwars2", ".", "com", "/", "wiki", "/", "API", ":", "2", "/", "account", ">", "here<", "/", "a", ">", "<br", "/", ">", "Give", "user", ...
train
https://github.com/xhsun/gw2wrapper/blob/c8a43b51f363b032074fb152ee6efe657e33e525/src/main/java/me/xhsun/guildwars2wrapper/AsynchronousRequest.java#L179-L182
openbase/jul
extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java
LabelProcessor.generateLabelBuilder
public static Label.Builder generateLabelBuilder(final Locale locale, final String label) { return addLabel(Label.newBuilder(), locale.getLanguage(), label); }
java
public static Label.Builder generateLabelBuilder(final Locale locale, final String label) { return addLabel(Label.newBuilder(), locale.getLanguage(), label); }
[ "public", "static", "Label", ".", "Builder", "generateLabelBuilder", "(", "final", "Locale", "locale", ",", "final", "String", "label", ")", "{", "return", "addLabel", "(", "Label", ".", "newBuilder", "(", ")", ",", "locale", ".", "getLanguage", "(", ")", ...
Create a new labelBuilder and register label with given locale. @param locale the locale from which the language code is extracted for which the label is added @param label the label to be added @return the updated label builder
[ "Create", "a", "new", "labelBuilder", "and", "register", "label", "with", "given", "locale", "." ]
train
https://github.com/openbase/jul/blob/662e98c3a853085e475be54c3be3deb72193c72d/extension/type/processing/src/main/java/org/openbase/jul/extension/type/processing/LabelProcessor.java#L108-L110
apiman/apiman
gateway/engine/jdbc/src/main/java/io/apiman/gateway/engine/jdbc/JdbcRegistry.java
JdbcRegistry.getApiInternal
protected Api getApiInternal(String organizationId, String apiId, String apiVersion) throws SQLException { QueryRunner run = new QueryRunner(ds); return run.query("SELECT bean FROM gw_apis WHERE org_id = ? AND id = ? AND version = ?", //$NON-NLS-1$ Handlers.API_HANDLER, organizationId, apiId, apiVersion); }
java
protected Api getApiInternal(String organizationId, String apiId, String apiVersion) throws SQLException { QueryRunner run = new QueryRunner(ds); return run.query("SELECT bean FROM gw_apis WHERE org_id = ? AND id = ? AND version = ?", //$NON-NLS-1$ Handlers.API_HANDLER, organizationId, apiId, apiVersion); }
[ "protected", "Api", "getApiInternal", "(", "String", "organizationId", ",", "String", "apiId", ",", "String", "apiVersion", ")", "throws", "SQLException", "{", "QueryRunner", "run", "=", "new", "QueryRunner", "(", "ds", ")", ";", "return", "run", ".", "query",...
Gets an api from the DB. @param organizationId @param apiId @param apiVersion @throws SQLException
[ "Gets", "an", "api", "from", "the", "DB", "." ]
train
https://github.com/apiman/apiman/blob/8c049c2a2f2e4a69bbb6125686a15edd26f29c21/gateway/engine/jdbc/src/main/java/io/apiman/gateway/engine/jdbc/JdbcRegistry.java#L247-L251
Canadensys/canadensys-core
src/main/java/net/canadensys/bundle/UTF8PropertyResourceBundle.java
UTF8PropertyResourceBundle.getBundle
public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncodingException, IOException{ InputStream is = UTF8PropertyResourceBundle.class.getResourceAsStream("/"+baseName + "_"+locale.toString()+PROPERTIES_EXT); if(is != null){ return new PropertyResourceBundle(new InputStreamReader(is, "UTF-8")); } return null; }
java
public static PropertyResourceBundle getBundle(String baseName, Locale locale) throws UnsupportedEncodingException, IOException{ InputStream is = UTF8PropertyResourceBundle.class.getResourceAsStream("/"+baseName + "_"+locale.toString()+PROPERTIES_EXT); if(is != null){ return new PropertyResourceBundle(new InputStreamReader(is, "UTF-8")); } return null; }
[ "public", "static", "PropertyResourceBundle", "getBundle", "(", "String", "baseName", ",", "Locale", "locale", ")", "throws", "UnsupportedEncodingException", ",", "IOException", "{", "InputStream", "is", "=", "UTF8PropertyResourceBundle", ".", "class", ".", "getResource...
Get a PropertyResourceBundle able to read an UTF-8 properties file. @param baseName @param locale @return new ResourceBundle or null if no bundle can be found. @throws UnsupportedEncodingException @throws IOException
[ "Get", "a", "PropertyResourceBundle", "able", "to", "read", "an", "UTF", "-", "8", "properties", "file", "." ]
train
https://github.com/Canadensys/canadensys-core/blob/5e13569f7c0f4cdc7080da72643ff61123ad76fd/src/main/java/net/canadensys/bundle/UTF8PropertyResourceBundle.java#L26-L32
inkstand-io/scribble
scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java
JCRAssert.assertNodeNotExistByPath
public static void assertNodeNotExistByPath(final Session session, final String absPath) throws RepositoryException { try { session.getNode(absPath); fail("Node " + absPath + " does not exist"); } catch (final PathNotFoundException e) { // NOSONAR // the exception is expected } }
java
public static void assertNodeNotExistByPath(final Session session, final String absPath) throws RepositoryException { try { session.getNode(absPath); fail("Node " + absPath + " does not exist"); } catch (final PathNotFoundException e) { // NOSONAR // the exception is expected } }
[ "public", "static", "void", "assertNodeNotExistByPath", "(", "final", "Session", "session", ",", "final", "String", "absPath", ")", "throws", "RepositoryException", "{", "try", "{", "session", ".", "getNode", "(", "absPath", ")", ";", "fail", "(", "\"Node \"", ...
Asserts that a specific node with the given absolute path does not exist in the session @param session the session to search for the node @param absPath the absolute path to look for a node @throws RepositoryException if the repository access failed
[ "Asserts", "that", "a", "specific", "node", "with", "the", "given", "absolute", "path", "does", "not", "exist", "in", "the", "session" ]
train
https://github.com/inkstand-io/scribble/blob/66e67553bad4b1ff817e1715fd1d3dd833406744/scribble-jcr/src/main/java/io/inkstand/scribble/jcr/JCRAssert.java#L99-L106
synchronoss/cpo-api
cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java
JdbcCpoAdapter.processUpdateGroup
protected <T> long processUpdateGroup(Collection<T> coll, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException { Connection c = null; long updateCount = 0; try { c = getWriteConnection(); updateCount = processUpdateGroup(coll, groupType, groupName, wheres, orderBy, nativeExpressions, c); commitLocalConnection(c); } catch (Exception e) { // Any exception has to try to rollback the work; rollbackLocalConnection(c); ExceptionHelper.reThrowCpoException(e, "processUpdateGroup(Collection coll, String groupType, String groupName) failed"); } finally { closeLocalConnection(c); } return updateCount; }
java
protected <T> long processUpdateGroup(Collection<T> coll, String groupType, String groupName, Collection<CpoWhere> wheres, Collection<CpoOrderBy> orderBy, Collection<CpoNativeFunction> nativeExpressions) throws CpoException { Connection c = null; long updateCount = 0; try { c = getWriteConnection(); updateCount = processUpdateGroup(coll, groupType, groupName, wheres, orderBy, nativeExpressions, c); commitLocalConnection(c); } catch (Exception e) { // Any exception has to try to rollback the work; rollbackLocalConnection(c); ExceptionHelper.reThrowCpoException(e, "processUpdateGroup(Collection coll, String groupType, String groupName) failed"); } finally { closeLocalConnection(c); } return updateCount; }
[ "protected", "<", "T", ">", "long", "processUpdateGroup", "(", "Collection", "<", "T", ">", "coll", ",", "String", "groupType", ",", "String", "groupName", ",", "Collection", "<", "CpoWhere", ">", "wheres", ",", "Collection", "<", "CpoOrderBy", ">", "orderBy...
DOCUMENT ME! @param coll DOCUMENT ME! @param groupType DOCUMENT ME! @param groupName DOCUMENT ME! @return DOCUMENT ME! @throws CpoException DOCUMENT ME!
[ "DOCUMENT", "ME!" ]
train
https://github.com/synchronoss/cpo-api/blob/dc745aca3b3206abf80b85d9689b0132f5baa694/cpo-jdbc/src/main/java/org/synchronoss/cpo/jdbc/JdbcCpoAdapter.java#L2745-L2763
jbundle/jbundle
main/db/src/main/java/org/jbundle/main/user/db/UserField.java
UserField.setupDefaultView
public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { Record record = this.makeReferenceRecord(); return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, record, -1, record.getField(UserInfo.USER_NAME), true, true); }
java
public ScreenComponent setupDefaultView(ScreenLoc itsLocation, ComponentParent targetScreen, Convert converter, int iDisplayFieldDesc, Map<String, Object> properties) { Record record = this.makeReferenceRecord(); return this.setupTableLookup(itsLocation, targetScreen, converter, iDisplayFieldDesc, record, -1, record.getField(UserInfo.USER_NAME), true, true); }
[ "public", "ScreenComponent", "setupDefaultView", "(", "ScreenLoc", "itsLocation", ",", "ComponentParent", "targetScreen", ",", "Convert", "converter", ",", "int", "iDisplayFieldDesc", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "Record", ...
Set up the default screen control for this field. @param itsLocation Location of this component on screen (ie., GridBagConstraint). @param targetScreen Where to place this component (ie., Parent screen or GridBagLayout). @param converter The converter to set the screenfield to. @param iDisplayFieldDesc Display the label? (optional). @param properties Extra properties @return Return the component or ScreenField that is created for this field.
[ "Set", "up", "the", "default", "screen", "control", "for", "this", "field", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/user/db/UserField.java#L76-L80
konmik/nucleus
nucleus-example-with-fragments/src/main/java/nucleus/example/main/FragmentStack.java
FragmentStack.findCallback
@SuppressWarnings("unchecked") public <T> T findCallback(Fragment fragment, Class<T> callbackType) { Fragment back = getBackFragment(fragment); if (back != null && callbackType.isAssignableFrom(back.getClass())) return (T)back; if (callbackType.isAssignableFrom(activity.getClass())) return (T)activity; return null; }
java
@SuppressWarnings("unchecked") public <T> T findCallback(Fragment fragment, Class<T> callbackType) { Fragment back = getBackFragment(fragment); if (back != null && callbackType.isAssignableFrom(back.getClass())) return (T)back; if (callbackType.isAssignableFrom(activity.getClass())) return (T)activity; return null; }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "<", "T", ">", "T", "findCallback", "(", "Fragment", "fragment", ",", "Class", "<", "T", ">", "callbackType", ")", "{", "Fragment", "back", "=", "getBackFragment", "(", "fragment", ")", ";", "if...
Returns a back fragment if the fragment is of given class. If such fragment does not exist and activity implements the given class then the activity will be returned. @param fragment a fragment to search from. @param callbackType a class of type for callback to search. @param <T> a type of callback. @return a back fragment or activity.
[ "Returns", "a", "back", "fragment", "if", "the", "fragment", "is", "of", "given", "class", ".", "If", "such", "fragment", "does", "not", "exist", "and", "activity", "implements", "the", "given", "class", "then", "the", "activity", "will", "be", "returned", ...
train
https://github.com/konmik/nucleus/blob/b161484a2bbf66a7896a8c1f61fa7187856ca5f7/nucleus-example-with-fragments/src/main/java/nucleus/example/main/FragmentStack.java#L122-L134
jdereg/java-util
src/main/java/com/cedarsoftware/util/UrlUtilities.java
UrlUtilities.getContentFromUrlAsString
public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts) { byte[] bytes = getContentFromUrl(url, inCookies, outCookies, trustAllCerts); return bytes == null ? null : StringUtilities.createString(bytes, "UTF-8"); }
java
public static String getContentFromUrlAsString(String url, Map inCookies, Map outCookies, boolean trustAllCerts) { byte[] bytes = getContentFromUrl(url, inCookies, outCookies, trustAllCerts); return bytes == null ? null : StringUtilities.createString(bytes, "UTF-8"); }
[ "public", "static", "String", "getContentFromUrlAsString", "(", "String", "url", ",", "Map", "inCookies", ",", "Map", "outCookies", ",", "boolean", "trustAllCerts", ")", "{", "byte", "[", "]", "bytes", "=", "getContentFromUrl", "(", "url", ",", "inCookies", ",...
Get content from the passed in URL. This code will open a connection to the passed in server, fetch the requested content, and return it as a String. @param url URL to hit @param inCookies Map of session cookies (or null if not needed) @param outCookies Map of session cookies (or null if not needed) @param trustAllCerts if true, SSL connection will always be trusted. @return String of content fetched from URL.
[ "Get", "content", "from", "the", "passed", "in", "URL", ".", "This", "code", "will", "open", "a", "connection", "to", "the", "passed", "in", "server", "fetch", "the", "requested", "content", "and", "return", "it", "as", "a", "String", "." ]
train
https://github.com/jdereg/java-util/blob/a2dce61aed16d6454ee575174dda1ba6bff0015c/src/main/java/com/cedarsoftware/util/UrlUtilities.java#L439-L443
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java
ArrayHelper.getAllExceptFirst
@Nullable @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExceptFirst (@Nullable final ELEMENTTYPE... aArray) { return getAllExceptFirst (aArray, 1); }
java
@Nullable @ReturnsMutableCopy @SafeVarargs public static <ELEMENTTYPE> ELEMENTTYPE [] getAllExceptFirst (@Nullable final ELEMENTTYPE... aArray) { return getAllExceptFirst (aArray, 1); }
[ "@", "Nullable", "@", "ReturnsMutableCopy", "@", "SafeVarargs", "public", "static", "<", "ELEMENTTYPE", ">", "ELEMENTTYPE", "[", "]", "getAllExceptFirst", "(", "@", "Nullable", "final", "ELEMENTTYPE", "...", "aArray", ")", "{", "return", "getAllExceptFirst", "(", ...
Get an array that contains all elements, except for the first element. @param <ELEMENTTYPE> Array element type @param aArray The source array. May be <code>null</code>. @return <code>null</code> if the passed array is <code>null</code> or has less than one element. A non-<code>null</code> copy of the array without the first element otherwise.
[ "Get", "an", "array", "that", "contains", "all", "elements", "except", "for", "the", "first", "element", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/collection/ArrayHelper.java#L2737-L2743
igniterealtime/Smack
smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java
MessageEventManager.sendCancelledNotification
public void sendCancelledNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException { // Create the message to send Message msg = new Message(to); // Create a MessageEvent Package and add it to the message MessageEvent messageEvent = new MessageEvent(); messageEvent.setCancelled(true); messageEvent.setStanzaId(packetID); msg.addExtension(messageEvent); // Send the packet connection().sendStanza(msg); }
java
public void sendCancelledNotification(Jid to, String packetID) throws NotConnectedException, InterruptedException { // Create the message to send Message msg = new Message(to); // Create a MessageEvent Package and add it to the message MessageEvent messageEvent = new MessageEvent(); messageEvent.setCancelled(true); messageEvent.setStanzaId(packetID); msg.addExtension(messageEvent); // Send the packet connection().sendStanza(msg); }
[ "public", "void", "sendCancelledNotification", "(", "Jid", "to", ",", "String", "packetID", ")", "throws", "NotConnectedException", ",", "InterruptedException", "{", "// Create the message to send", "Message", "msg", "=", "new", "Message", "(", "to", ")", ";", "// C...
Sends the notification that the receiver of the message has cancelled composing a reply. @param to the recipient of the notification. @param packetID the id of the message to send. @throws NotConnectedException @throws InterruptedException
[ "Sends", "the", "notification", "that", "the", "receiver", "of", "the", "message", "has", "cancelled", "composing", "a", "reply", "." ]
train
https://github.com/igniterealtime/Smack/blob/870756997faec1e1bfabfac0cd6c2395b04da873/smack-legacy/src/main/java/org/jivesoftware/smackx/xevent/MessageEventManager.java#L275-L285
zxing/zxing
core/src/main/java/com/google/zxing/oned/EAN13Reader.java
EAN13Reader.determineFirstDigit
private static void determineFirstDigit(StringBuilder resultString, int lgPatternFound) throws NotFoundException { for (int d = 0; d < 10; d++) { if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) { resultString.insert(0, (char) ('0' + d)); return; } } throw NotFoundException.getNotFoundInstance(); }
java
private static void determineFirstDigit(StringBuilder resultString, int lgPatternFound) throws NotFoundException { for (int d = 0; d < 10; d++) { if (lgPatternFound == FIRST_DIGIT_ENCODINGS[d]) { resultString.insert(0, (char) ('0' + d)); return; } } throw NotFoundException.getNotFoundInstance(); }
[ "private", "static", "void", "determineFirstDigit", "(", "StringBuilder", "resultString", ",", "int", "lgPatternFound", ")", "throws", "NotFoundException", "{", "for", "(", "int", "d", "=", "0", ";", "d", "<", "10", ";", "d", "++", ")", "{", "if", "(", "...
Based on pattern of odd-even ('L' and 'G') patterns used to encoded the explicitly-encoded digits in a barcode, determines the implicitly encoded first digit and adds it to the result string. @param resultString string to insert decoded first digit into @param lgPatternFound int whose bits indicates the pattern of odd/even L/G patterns used to encode digits @throws NotFoundException if first digit cannot be determined
[ "Based", "on", "pattern", "of", "odd", "-", "even", "(", "L", "and", "G", ")", "patterns", "used", "to", "encoded", "the", "explicitly", "-", "encoded", "digits", "in", "a", "barcode", "determines", "the", "implicitly", "encoded", "first", "digit", "and", ...
train
https://github.com/zxing/zxing/blob/653ac2a3beb11481eff82e7d5f2bab8a745f7fac/core/src/main/java/com/google/zxing/oned/EAN13Reader.java#L127-L136
alipay/sofa-rpc
extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/common/utils/CalculateUtils.java
CalculateUtils.subtract
public static double subtract(double minuend, double reduction, int scale) { BigDecimal minuendBd = new BigDecimal(Double.toString(minuend)); BigDecimal reductionBd = new BigDecimal(Double.toString(reduction)); MathContext mathContext = new MathContext(scale, RoundingMode.HALF_UP); return minuendBd.subtract(reductionBd, mathContext).doubleValue(); }
java
public static double subtract(double minuend, double reduction, int scale) { BigDecimal minuendBd = new BigDecimal(Double.toString(minuend)); BigDecimal reductionBd = new BigDecimal(Double.toString(reduction)); MathContext mathContext = new MathContext(scale, RoundingMode.HALF_UP); return minuendBd.subtract(reductionBd, mathContext).doubleValue(); }
[ "public", "static", "double", "subtract", "(", "double", "minuend", ",", "double", "reduction", ",", "int", "scale", ")", "{", "BigDecimal", "minuendBd", "=", "new", "BigDecimal", "(", "Double", ".", "toString", "(", "minuend", ")", ")", ";", "BigDecimal", ...
减法。计算结果四舍五入。 @param minuend 被减数 @param reduction 减数 @param scale 计算结果保留位数。(注意包括整数部分) @return 计算结果
[ "减法。计算结果四舍五入。" ]
train
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/extension-impl/fault-tolerance/src/main/java/com/alipay/sofa/rpc/common/utils/CalculateUtils.java#L88-L93
paypal/SeLion
appium-provider/src/main/java/com/paypal/selion/appium/platform/grid/SeLionAppiumProvider.java
SeLionAppiumProvider.createDriver
@Override public RemoteWebDriver createDriver(WebDriverPlatform platform, CommandExecutor commandExecutor, URL url, Capabilities caps) { if (platform.equals(WebDriverPlatform.ANDROID)) { if (commandExecutor == null) { return new SeLionAppiumAndroidDriver(url, caps); } else { return new SeLionAppiumAndroidDriver(commandExecutor, caps, url); } } else if (platform.equals(WebDriverPlatform.IOS)) { if (commandExecutor == null) { return new SeLionAppiumIOSDriver(url, caps); } else { return new SeLionAppiumIOSDriver(commandExecutor, caps, url); } } logger.log(Level.SEVERE, "Error creating instance of Appium RemoteWebDriver for " + platform); return null; }
java
@Override public RemoteWebDriver createDriver(WebDriverPlatform platform, CommandExecutor commandExecutor, URL url, Capabilities caps) { if (platform.equals(WebDriverPlatform.ANDROID)) { if (commandExecutor == null) { return new SeLionAppiumAndroidDriver(url, caps); } else { return new SeLionAppiumAndroidDriver(commandExecutor, caps, url); } } else if (platform.equals(WebDriverPlatform.IOS)) { if (commandExecutor == null) { return new SeLionAppiumIOSDriver(url, caps); } else { return new SeLionAppiumIOSDriver(commandExecutor, caps, url); } } logger.log(Level.SEVERE, "Error creating instance of Appium RemoteWebDriver for " + platform); return null; }
[ "@", "Override", "public", "RemoteWebDriver", "createDriver", "(", "WebDriverPlatform", "platform", ",", "CommandExecutor", "commandExecutor", ",", "URL", "url", ",", "Capabilities", "caps", ")", "{", "if", "(", "platform", ".", "equals", "(", "WebDriverPlatform", ...
create an instance of SeLionAppiumIOSDriver or SeLionAppiumAndroidDriver
[ "create", "an", "instance", "of", "SeLionAppiumIOSDriver", "or", "SeLionAppiumAndroidDriver" ]
train
https://github.com/paypal/SeLion/blob/694d12d0df76db48d0360b16192770c6a4fbdfd2/appium-provider/src/main/java/com/paypal/selion/appium/platform/grid/SeLionAppiumProvider.java#L47-L66
xiancloud/xian
xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java
SharedCount.trySetCount
public boolean trySetCount(VersionedValue<Integer> previous, int newCount) throws Exception { VersionedValue<byte[]> previousCopy = new VersionedValue<byte[]>(previous.getVersion(), toBytes(previous.getValue())); return sharedValue.trySetValue(previousCopy, toBytes(newCount)); }
java
public boolean trySetCount(VersionedValue<Integer> previous, int newCount) throws Exception { VersionedValue<byte[]> previousCopy = new VersionedValue<byte[]>(previous.getVersion(), toBytes(previous.getValue())); return sharedValue.trySetValue(previousCopy, toBytes(newCount)); }
[ "public", "boolean", "trySetCount", "(", "VersionedValue", "<", "Integer", ">", "previous", ",", "int", "newCount", ")", "throws", "Exception", "{", "VersionedValue", "<", "byte", "[", "]", ">", "previousCopy", "=", "new", "VersionedValue", "<", "byte", "[", ...
Changes the shared count only if its value has not changed since the version specified by newCount. If the count has changed, the value is not set and this client's view of the value is updated. i.e. if the count is not successful you can get the updated value by calling {@link #getCount()}. @param newCount the new value to attempt @return true if the change attempt was successful, false if not. If the change was not successful, {@link #getCount()} will return the updated value @throws Exception ZK errors, interruptions, etc.
[ "Changes", "the", "shared", "count", "only", "if", "its", "value", "has", "not", "changed", "since", "the", "version", "specified", "by", "newCount", ".", "If", "the", "count", "has", "changed", "the", "value", "is", "not", "set", "and", "this", "client", ...
train
https://github.com/xiancloud/xian/blob/1948e088545553d2745b2c86d8b5a64988bb850e/xian-zookeeper/xian-curator/xian-curator-recipes/src/main/java/org/apache/curator/framework/recipes/shared/SharedCount.java#L108-L112
radkovo/CSSBox
src/main/java/org/fit/cssbox/layout/BoxFactory.java
BoxFactory.createViewportTree
public Viewport createViewportTree(Element root, Graphics2D g, VisualContext ctx, int width, int height) { Element vp = createAnonymousElement(root.getOwnerDocument(), "Xdiv", "block"); viewport = new Viewport(vp, g, ctx, this, root, width, height); viewport.setConfig(config); overflowPropagated = false; BoxTreeCreationStatus stat = new BoxTreeCreationStatus(viewport); createSubtree(root, stat); log.debug("Root box is: " + viewport.getRootBox()); return viewport; }
java
public Viewport createViewportTree(Element root, Graphics2D g, VisualContext ctx, int width, int height) { Element vp = createAnonymousElement(root.getOwnerDocument(), "Xdiv", "block"); viewport = new Viewport(vp, g, ctx, this, root, width, height); viewport.setConfig(config); overflowPropagated = false; BoxTreeCreationStatus stat = new BoxTreeCreationStatus(viewport); createSubtree(root, stat); log.debug("Root box is: " + viewport.getRootBox()); return viewport; }
[ "public", "Viewport", "createViewportTree", "(", "Element", "root", ",", "Graphics2D", "g", ",", "VisualContext", "ctx", ",", "int", "width", ",", "int", "height", ")", "{", "Element", "vp", "=", "createAnonymousElement", "(", "root", ".", "getOwnerDocument", ...
Create the viewport and the underlying box tree from a DOM tree. @param root the root element of the source DOM tree. @param g the root graphic context. Copies of this context will be used for the individual boxes. @param ctx the visual context (computed style). Copies of this context will be used for the individual boxes. @param width preferred viewport width. @param height preferred viewport height. @return the created viewport box with the corresponding box subtrees.
[ "Create", "the", "viewport", "and", "the", "underlying", "box", "tree", "from", "a", "DOM", "tree", "." ]
train
https://github.com/radkovo/CSSBox/blob/38aaf8f22d233d7b4dbc12a56cdbc72b447bc559/src/main/java/org/fit/cssbox/layout/BoxFactory.java#L196-L207
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java
ModelsImpl.updateExplicitListItemWithServiceResponseAsync
public Observable<ServiceResponse<OperationStatus>> updateExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } final String explicitListItem = updateExplicitListItemOptionalParameter != null ? updateExplicitListItemOptionalParameter.explicitListItem() : null; return updateExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, itemId, explicitListItem); }
java
public Observable<ServiceResponse<OperationStatus>> updateExplicitListItemWithServiceResponseAsync(UUID appId, String versionId, UUID entityId, long itemId, UpdateExplicitListItemOptionalParameter updateExplicitListItemOptionalParameter) { if (this.client.endpoint() == null) { throw new IllegalArgumentException("Parameter this.client.endpoint() is required and cannot be null."); } if (appId == null) { throw new IllegalArgumentException("Parameter appId is required and cannot be null."); } if (versionId == null) { throw new IllegalArgumentException("Parameter versionId is required and cannot be null."); } if (entityId == null) { throw new IllegalArgumentException("Parameter entityId is required and cannot be null."); } final String explicitListItem = updateExplicitListItemOptionalParameter != null ? updateExplicitListItemOptionalParameter.explicitListItem() : null; return updateExplicitListItemWithServiceResponseAsync(appId, versionId, entityId, itemId, explicitListItem); }
[ "public", "Observable", "<", "ServiceResponse", "<", "OperationStatus", ">", ">", "updateExplicitListItemWithServiceResponseAsync", "(", "UUID", "appId", ",", "String", "versionId", ",", "UUID", "entityId", ",", "long", "itemId", ",", "UpdateExplicitListItemOptionalParame...
Updates an explicit list item for a Pattern.Any entity. @param appId The application ID. @param versionId The version ID. @param entityId The Pattern.Any entity extractor ID. @param itemId The explicit list item ID. @param updateExplicitListItemOptionalParameter the object representing the optional parameters to be set before calling this API @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the OperationStatus object
[ "Updates", "an", "explicit", "list", "item", "for", "a", "Pattern", ".", "Any", "entity", "." ]
train
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/luis/authoring/src/main/java/com/microsoft/azure/cognitiveservices/language/luis/authoring/implementation/ModelsImpl.java#L14114-L14130
JOML-CI/JOML
src/org/joml/Quaternionf.java
Quaternionf.premul
public Quaternionf premul(float qx, float qy, float qz, float qw) { return premul(qx, qy, qz, qw, this); }
java
public Quaternionf premul(float qx, float qy, float qz, float qw) { return premul(qx, qy, qz, qw, this); }
[ "public", "Quaternionf", "premul", "(", "float", "qx", ",", "float", "qy", ",", "float", "qz", ",", "float", "qw", ")", "{", "return", "premul", "(", "qx", ",", "qy", ",", "qz", ",", "qw", ",", "this", ")", ";", "}" ]
Pre-multiply this quaternion by the quaternion represented via <code>(qx, qy, qz, qw)</code>. <p> If <code>T</code> is <code>this</code> and <code>Q</code> is the given quaternion, then the resulting quaternion <code>R</code> is: <p> <code>R = Q * T</code> <p> So, this method uses pre-multiplication, resulting in a vector to be transformed by <code>T</code> first, and then by <code>Q</code>. @param qx the x component of the quaternion to multiply <code>this</code> by @param qy the y component of the quaternion to multiply <code>this</code> by @param qz the z component of the quaternion to multiply <code>this</code> by @param qw the w component of the quaternion to multiply <code>this</code> by @return this
[ "Pre", "-", "multiply", "this", "quaternion", "by", "the", "quaternion", "represented", "via", "<code", ">", "(", "qx", "qy", "qz", "qw", ")", "<", "/", "code", ">", ".", "<p", ">", "If", "<code", ">", "T<", "/", "code", ">", "is", "<code", ">", ...
train
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaternionf.java#L1059-L1061
deeplearning4j/deeplearning4j
nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java
CudaAffinityManager.replicateToDevice
@Override public synchronized INDArray replicateToDevice(Integer deviceId, INDArray array) { if (array == null) return null; // string arrays are stored in host memory only atm if (array.isS()) return array.dup(array.ordering()); if (array.isView()) throw new UnsupportedOperationException("It's impossible to replicate View"); val shape = array.shape(); val stride = array.stride(); val elementWiseStride = array.elementWiseStride(); val ordering = array.ordering(); val length = array.length(); val dtype = array.dataType(); // we use this call to get device memory updated AtomicAllocator.getInstance().getPointer(array, (CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()); int currentDeviceId = getDeviceForCurrentThread(); if (currentDeviceId != deviceId.intValue()) { Nd4j.getMemoryManager().releaseCurrentContext(); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(deviceId); attachThreadToDevice(Thread.currentThread().getId(), deviceId); } DataBuffer newDataBuffer = replicateToDevice(deviceId, array.data()); DataBuffer newShapeBuffer = Nd4j.getShapeInfoProvider().createShapeInformation(shape, stride, elementWiseStride, ordering, dtype).getFirst(); INDArray result = Nd4j.createArrayFromShapeBuffer(newDataBuffer, newShapeBuffer); if (currentDeviceId != deviceId.intValue()) { Nd4j.getMemoryManager().releaseCurrentContext(); attachThreadToDevice(Thread.currentThread().getId(), currentDeviceId); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(currentDeviceId); } return result; }
java
@Override public synchronized INDArray replicateToDevice(Integer deviceId, INDArray array) { if (array == null) return null; // string arrays are stored in host memory only atm if (array.isS()) return array.dup(array.ordering()); if (array.isView()) throw new UnsupportedOperationException("It's impossible to replicate View"); val shape = array.shape(); val stride = array.stride(); val elementWiseStride = array.elementWiseStride(); val ordering = array.ordering(); val length = array.length(); val dtype = array.dataType(); // we use this call to get device memory updated AtomicAllocator.getInstance().getPointer(array, (CudaContext) AtomicAllocator.getInstance().getDeviceContext().getContext()); int currentDeviceId = getDeviceForCurrentThread(); if (currentDeviceId != deviceId.intValue()) { Nd4j.getMemoryManager().releaseCurrentContext(); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(deviceId); attachThreadToDevice(Thread.currentThread().getId(), deviceId); } DataBuffer newDataBuffer = replicateToDevice(deviceId, array.data()); DataBuffer newShapeBuffer = Nd4j.getShapeInfoProvider().createShapeInformation(shape, stride, elementWiseStride, ordering, dtype).getFirst(); INDArray result = Nd4j.createArrayFromShapeBuffer(newDataBuffer, newShapeBuffer); if (currentDeviceId != deviceId.intValue()) { Nd4j.getMemoryManager().releaseCurrentContext(); attachThreadToDevice(Thread.currentThread().getId(), currentDeviceId); NativeOpsHolder.getInstance().getDeviceNativeOps().setDevice(currentDeviceId); } return result; }
[ "@", "Override", "public", "synchronized", "INDArray", "replicateToDevice", "(", "Integer", "deviceId", ",", "INDArray", "array", ")", "{", "if", "(", "array", "==", "null", ")", "return", "null", ";", "// string arrays are stored in host memory only atm", "if", "("...
This method replicates given INDArray, and places it to target device. @param deviceId target deviceId @param array INDArray to replicate @return
[ "This", "method", "replicates", "given", "INDArray", "and", "places", "it", "to", "target", "device", "." ]
train
https://github.com/deeplearning4j/deeplearning4j/blob/effce52f2afd7eeb53c5bcca699fcd90bd06822f/nd4j/nd4j-backends/nd4j-backend-impls/nd4j-cuda/src/main/java/org/nd4j/jita/concurrency/CudaAffinityManager.java#L257-L300
hal/core
gui/src/main/java/org/jboss/as/console/client/widgets/CollapsibleSplitLayoutPanel.java
CollapsibleSplitLayoutPanel.setWidgetMinSize
public void setWidgetMinSize(Widget child, int minSize) { assertIsChild(child); Splitter splitter = getAssociatedSplitter(child); // The splitter is null for the center element. if (splitter != null) { splitter.setMinSize(minSize); } }
java
public void setWidgetMinSize(Widget child, int minSize) { assertIsChild(child); Splitter splitter = getAssociatedSplitter(child); // The splitter is null for the center element. if (splitter != null) { splitter.setMinSize(minSize); } }
[ "public", "void", "setWidgetMinSize", "(", "Widget", "child", ",", "int", "minSize", ")", "{", "assertIsChild", "(", "child", ")", ";", "Splitter", "splitter", "=", "getAssociatedSplitter", "(", "child", ")", ";", "// The splitter is null for the center element.", "...
Sets the minimum allowable size for the given widget. <p> Its associated splitter cannot be dragged to a position that would make it smaller than this size. This method has no effect for the {@link DockLayoutPanel.Direction#CENTER} widget. </p> @param child the child whose minimum size will be set @param minSize the minimum size for this widget
[ "Sets", "the", "minimum", "allowable", "size", "for", "the", "given", "widget", "." ]
train
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/CollapsibleSplitLayoutPanel.java#L416-L423
toddfast/typeconverter
src/main/java/com/toddfast/util/convert/TypeConverter.java
TypeConverter.asDouble
public static double asDouble(Object value, double nullValue) { value=convert(Double.class,value); return (value!=null) ? ((Double)value).doubleValue() : nullValue; }
java
public static double asDouble(Object value, double nullValue) { value=convert(Double.class,value); return (value!=null) ? ((Double)value).doubleValue() : nullValue; }
[ "public", "static", "double", "asDouble", "(", "Object", "value", ",", "double", "nullValue", ")", "{", "value", "=", "convert", "(", "Double", ".", "class", ",", "value", ")", ";", "return", "(", "value", "!=", "null", ")", "?", "(", "(", "Double", ...
Return the value converted to a double or the specified alternate value if the original value is null. Note, this method still throws {@link IllegalArgumentException} if the value is not null and could not be converted. @param value The value to be converted @param nullValue The value to be returned if {@link value} is null. Note, this value will not be returned if the conversion fails otherwise. @throws IllegalArgumentException If the value cannot be converted
[ "Return", "the", "value", "converted", "to", "a", "double", "or", "the", "specified", "alternate", "value", "if", "the", "original", "value", "is", "null", ".", "Note", "this", "method", "still", "throws", "{", "@link", "IllegalArgumentException", "}", "if", ...
train
https://github.com/toddfast/typeconverter/blob/44efa352254faa49edaba5c5935389705aa12b90/src/main/java/com/toddfast/util/convert/TypeConverter.java#L633-L638
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java
Types.notSoftSubtype
public boolean notSoftSubtype(Type t, Type s) { if (t == s) return false; if (t.hasTag(TYPEVAR)) { TypeVar tv = (TypeVar) t; return !isCastable(tv.bound, relaxBound(s), noWarnings); } if (!s.hasTag(WILDCARD)) s = cvarUpperBound(s); return !isSubtype(t, relaxBound(s)); }
java
public boolean notSoftSubtype(Type t, Type s) { if (t == s) return false; if (t.hasTag(TYPEVAR)) { TypeVar tv = (TypeVar) t; return !isCastable(tv.bound, relaxBound(s), noWarnings); } if (!s.hasTag(WILDCARD)) s = cvarUpperBound(s); return !isSubtype(t, relaxBound(s)); }
[ "public", "boolean", "notSoftSubtype", "(", "Type", "t", ",", "Type", "s", ")", "{", "if", "(", "t", "==", "s", ")", "return", "false", ";", "if", "(", "t", ".", "hasTag", "(", "TYPEVAR", ")", ")", "{", "TypeVar", "tv", "=", "(", "TypeVar", ")", ...
This relation answers the question: is impossible that something of type `t' can be a subtype of `s'? This is different from the question "is `t' not a subtype of `s'?" when type variables are involved: Integer is not a subtype of T where {@code <T extends Number>} but it is not true that Integer cannot possibly be a subtype of T.
[ "This", "relation", "answers", "the", "question", ":", "is", "impossible", "that", "something", "of", "type", "t", "can", "be", "a", "subtype", "of", "s", "?", "This", "is", "different", "from", "the", "question", "is", "t", "not", "a", "subtype", "of", ...
train
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/Types.java#L1707-L1719
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/PdfContentByte.java
PdfContentByte.createPrinterGraphicsShapes
public java.awt.Graphics2D createPrinterGraphicsShapes(float width, float height, PrinterJob printerJob) { return new PdfPrinterGraphics2D(this, width, height, null, true, false, 0, printerJob); }
java
public java.awt.Graphics2D createPrinterGraphicsShapes(float width, float height, PrinterJob printerJob) { return new PdfPrinterGraphics2D(this, width, height, null, true, false, 0, printerJob); }
[ "public", "java", ".", "awt", ".", "Graphics2D", "createPrinterGraphicsShapes", "(", "float", "width", ",", "float", "height", ",", "PrinterJob", "printerJob", ")", "{", "return", "new", "PdfPrinterGraphics2D", "(", "this", ",", "width", ",", "height", ",", "n...
Gets a <CODE>Graphics2D</CODE> to print on. The graphics are translated to PDF commands as shapes. No PDF fonts will appear. @param width the width of the panel @param height the height of the panel @param printerJob a printer job @return a <CODE>Graphics2D</CODE>
[ "Gets", "a", "<CODE", ">", "Graphics2D<", "/", "CODE", ">", "to", "print", "on", ".", "The", "graphics", "are", "translated", "to", "PDF", "commands", "as", "shapes", ".", "No", "PDF", "fonts", "will", "appear", "." ]
train
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/PdfContentByte.java#L2802-L2804
jbundle/jbundle
thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/landf/ScreenUtil.java
ScreenUtil.getColor
public static ColorUIResource getColor(String strProperty, PropertyOwner propertyOwner, Map<String,Object> properties) { String strColor = ScreenUtil.getPropery(strProperty, propertyOwner, properties, null); if (strColor != null) return new ColorUIResource(BaseApplet.nameToColor(strColor)); return null; // Error on decode or no such color }
java
public static ColorUIResource getColor(String strProperty, PropertyOwner propertyOwner, Map<String,Object> properties) { String strColor = ScreenUtil.getPropery(strProperty, propertyOwner, properties, null); if (strColor != null) return new ColorUIResource(BaseApplet.nameToColor(strColor)); return null; // Error on decode or no such color }
[ "public", "static", "ColorUIResource", "getColor", "(", "String", "strProperty", ",", "PropertyOwner", "propertyOwner", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "String", "strColor", "=", "ScreenUtil", ".", "getPropery", "(", "strPr...
Get this color. (Utility method). @return The registered color for this property key.
[ "Get", "this", "color", ".", "(", "Utility", "method", ")", "." ]
train
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/thin/base/screen/screen/src/main/java/org/jbundle/thin/base/screen/landf/ScreenUtil.java#L187-L193
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/datetime/DateTimeFormatterCache.java
DateTimeFormatterCache.getDateTimeFormatter
@Nonnull public static DateTimeFormatter getDateTimeFormatter (@Nonnull @Nonempty final String sPattern, @Nonnull final ResolverStyle eResolverStyle) { return getInstance ().getFromCache (new DateTimeFormatterPattern (sPattern, eResolverStyle)); }
java
@Nonnull public static DateTimeFormatter getDateTimeFormatter (@Nonnull @Nonempty final String sPattern, @Nonnull final ResolverStyle eResolverStyle) { return getInstance ().getFromCache (new DateTimeFormatterPattern (sPattern, eResolverStyle)); }
[ "@", "Nonnull", "public", "static", "DateTimeFormatter", "getDateTimeFormatter", "(", "@", "Nonnull", "@", "Nonempty", "final", "String", "sPattern", ",", "@", "Nonnull", "final", "ResolverStyle", "eResolverStyle", ")", "{", "return", "getInstance", "(", ")", ".",...
Get the cached DateTimeFormatter using the provided resolver style. @param sPattern The pattern to retrieve. May neither be <code>null</code> nor empty. @param eResolverStyle The resolver style to be used. May not be <code>null</code>. @return The compiled DateTimeFormatter and never <code>null</code>. @throws IllegalArgumentException If the pattern is invalid
[ "Get", "the", "cached", "DateTimeFormatter", "using", "the", "provided", "resolver", "style", "." ]
train
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/datetime/DateTimeFormatterCache.java#L123-L128