repo
stringlengths
7
59
path
stringlengths
3
222
func_name
stringlengths
3
127
original_string
stringlengths
0
466k
language
stringclasses
1 value
code
stringlengths
0
466k
code_tokens
listlengths
0
68.3k
docstring
stringlengths
0
21.3k
docstring_tokens
listlengths
0
1.93k
sha
stringlengths
0
40
url
stringlengths
0
339
partition
stringclasses
3 values
summary
stringlengths
0
250
instruction
stringlengths
38
3.13k
input
stringclasses
1 value
output
stringlengths
146
466k
Netflix/Hystrix
hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolMetrics.java
HystrixThreadPoolMetrics.getInstance
public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) { // attempt to retrieve from cache first HystrixThreadPoolMetrics threadPoolMetrics = metrics.get(key.name()); if (threadPoolMetrics != null) { ...
java
public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) { // attempt to retrieve from cache first HystrixThreadPoolMetrics threadPoolMetrics = metrics.get(key.name()); if (threadPoolMetrics != null) { ...
[ "public", "static", "HystrixThreadPoolMetrics", "getInstance", "(", "HystrixThreadPoolKey", "key", ",", "ThreadPoolExecutor", "threadPool", ",", "HystrixThreadPoolProperties", "properties", ")", "{", "// attempt to retrieve from cache first", "HystrixThreadPoolMetrics", "threadPool...
Get or create the {@link HystrixThreadPoolMetrics} instance for a given {@link HystrixThreadPoolKey}. <p> This is thread-safe and ensures only 1 {@link HystrixThreadPoolMetrics} per {@link HystrixThreadPoolKey}. @param key {@link HystrixThreadPoolKey} of {@link HystrixThreadPool} instance requesting the {@link Hystrix...
[ "Get", "or", "create", "the", "{", "@link", "HystrixThreadPoolMetrics", "}", "instance", "for", "a", "given", "{", "@link", "HystrixThreadPoolKey", "}", ".", "<p", ">", "This", "is", "thread", "-", "safe", "and", "ensures", "only", "1", "{", "@link", "Hyst...
3cb21589895e9f8f87cfcdbc9d96d9f63d48b848
https://github.com/Netflix/Hystrix/blob/3cb21589895e9f8f87cfcdbc9d96d9f63d48b848/hystrix-core/src/main/java/com/netflix/hystrix/HystrixThreadPoolMetrics.java#L62-L79
train
Gets the instance of the HystrixThreadPoolMetrics class.
Create a Java method that does the following: "Gets the instance of the HystrixThreadPoolMetrics class.".
Of course, here is the Java code you requested: ```java public static HystrixThreadPoolMetrics getInstance(HystrixThreadPoolKey key, ThreadPoolExecutor threadPool, HystrixThreadPoolProperties properties) { // attempt to retrieve from cache first HystrixThreadPoolMetrics threadPoolMetrics = metrics.get(...
QSFT/Doradus
doradus-common/src/main/java/com/dell/doradus/common/Utils.java
Utils.joinURIQuery
public static String joinURIQuery(Map<String, String> uriParams) { StringBuilder buffer = new StringBuilder(); for (String name : uriParams.keySet()) { String value = uriParams.get(name); if (buffer.length() > 0) { buffer.append("&"); } ...
java
public static String joinURIQuery(Map<String, String> uriParams) { StringBuilder buffer = new StringBuilder(); for (String name : uriParams.keySet()) { String value = uriParams.get(name); if (buffer.length() > 0) { buffer.append("&"); } ...
[ "public", "static", "String", "joinURIQuery", "(", "Map", "<", "String", ",", "String", ">", "uriParams", ")", "{", "StringBuilder", "buffer", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "String", "name", ":", "uriParams", ".", "keySet", "(", ...
Concatenate and encode the given name/value pairs into a valid URI query string. This method is the complement of {@link #parseURIQuery(String)}. @param uriParams Unencoded name/value pairs. @return URI query in the form {name 1}={value 1}{@literal &}...{@literal &}{name}={value n}.
[ "Concatenate", "and", "encode", "the", "given", "name", "/", "value", "pairs", "into", "a", "valid", "URI", "query", "string", ".", "This", "method", "is", "the", "complement", "of", "{", "@link", "#parseURIQuery", "(", "String", ")", "}", "." ]
ad64d3c37922eefda68ec8869ef089c1ca604b70
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-common/src/main/java/com/dell/doradus/common/Utils.java#L1733-L1747
train
Join the URI query string with the HTTP parameters.
Create a Java method that does the following: "Join the URI query string with the HTTP parameters.".
Of course, here is the Java code you requested: ```java public static String joinURIQuery(Map<String, String> uriParams) { StringBuilder buffer = new StringBuilder(); for (String name : uriParams.keySet()) { String value = uriParams.get(name); if (buffer.length() > 0) { ...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnescapeTransliterator.java
UnescapeTransliterator.register
static void register() { // Unicode: "U+10FFFF" hex, min=4, max=6 Transliterator.registerFactory("Hex-Any/Unicode", new Transliterator.Factory() { @Override public Transliterator getInstance(String ID) { return new UnescapeTransliterator("Hex-Any/Unicode", new cha...
java
static void register() { // Unicode: "U+10FFFF" hex, min=4, max=6 Transliterator.registerFactory("Hex-Any/Unicode", new Transliterator.Factory() { @Override public Transliterator getInstance(String ID) { return new UnescapeTransliterator("Hex-Any/Unicode", new cha...
[ "static", "void", "register", "(", ")", "{", "// Unicode: \"U+10FFFF\" hex, min=4, max=6", "Transliterator", ".", "registerFactory", "(", "\"Hex-Any/Unicode\"", ",", "new", "Transliterator", ".", "Factory", "(", ")", "{", "@", "Override", "public", "Transliterator", "...
Registers standard variants with the system. Called by Transliterator during initialization.
[ "Registers", "standard", "variants", "with", "the", "system", ".", "Called", "by", "Transliterator", "during", "initialization", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/UnescapeTransliterator.java#L52-L135
train
Register the Transliterator factories for the ID.
Create a Java method that does the following: "Register the Transliterator factories for the ID.".
Of course, here is the Java code you requested: ```java static void register() { // Unicode: "U+10FFFF" hex, min=4, max=6 Transliterator.registerFactory("Hex-Any/Unicode", new Transliterator.Factory() { @Override public Transliterator getInstance(String ID) { ret...
lamydev/Android-Notification
core/src/zemin/notification/NotificationBoard.java
NotificationBoard.setBoardPivotX
public void setBoardPivotX(float x) { if (mListeners != null) { for (StateListener l : mListeners) { l.onBoardPivotX(this, x); } } mContentView.setPivotX(x); }
java
public void setBoardPivotX(float x) { if (mListeners != null) { for (StateListener l : mListeners) { l.onBoardPivotX(this, x); } } mContentView.setPivotX(x); }
[ "public", "void", "setBoardPivotX", "(", "float", "x", ")", "{", "if", "(", "mListeners", "!=", "null", ")", "{", "for", "(", "StateListener", "l", ":", "mListeners", ")", "{", "l", ".", "onBoardPivotX", "(", "this", ",", "x", ")", ";", "}", "}", "...
Set the x location of pivot point around which this board is rotated. @param x
[ "Set", "the", "x", "location", "of", "pivot", "point", "around", "which", "this", "board", "is", "rotated", "." ]
6d6571d2862cb6edbacf9a78125418f7d621c3f8
https://github.com/lamydev/Android-Notification/blob/6d6571d2862cb6edbacf9a78125418f7d621c3f8/core/src/zemin/notification/NotificationBoard.java#L1172-L1179
train
Set the pivot X value of the board.
Create a Java method that does the following: "Set the pivot X value of the board.".
Of course, here is the Java code you requested: ```java public void setBoardPivotX(float x) { if (mListeners != null) { for (StateListener l : mListeners) { l.onBoardPivotX(this, x); } } mContentView.setPivotX(x); } ``` Hope this helps!
apache/incubator-gobblin
gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java
BaseDataPublisher.getPublisherOutputDir
protected Path getPublisherOutputDir(WorkUnitState workUnitState, int branchId) { return WriterUtils.getDataPublisherFinalDir(workUnitState, this.numBranches, branchId); }
java
protected Path getPublisherOutputDir(WorkUnitState workUnitState, int branchId) { return WriterUtils.getDataPublisherFinalDir(workUnitState, this.numBranches, branchId); }
[ "protected", "Path", "getPublisherOutputDir", "(", "WorkUnitState", "workUnitState", ",", "int", "branchId", ")", "{", "return", "WriterUtils", ".", "getDataPublisherFinalDir", "(", "workUnitState", ",", "this", ".", "numBranches", ",", "branchId", ")", ";", "}" ]
Get the output directory path this {@link BaseDataPublisher} will write to. <p> This is the default implementation. Subclasses of {@link BaseDataPublisher} may override this to write to a custom directory or write using a custom directory structure or naming pattern. </p> @param workUnitState a {@link WorkUnitState} ...
[ "Get", "the", "output", "directory", "path", "this", "{", "@link", "BaseDataPublisher", "}", "will", "write", "to", "." ]
f029b4c0fea0fe4aa62f36dda2512344ff708bae
https://github.com/apache/incubator-gobblin/blob/f029b4c0fea0fe4aa62f36dda2512344ff708bae/gobblin-core/src/main/java/org/apache/gobblin/publisher/BaseDataPublisher.java#L455-L457
train
Get the output directory for the publisher.
Create a Java method that does the following: "Get the output directory for the publisher.".
Of course, here is the Java code you requested: ```java protected Path getPublisherOutputDir(WorkUnitState workUnitState, int branchId) { return WriterUtils.getDataPublisherFinalDir(workUnitState, this.numBranches, branchId); } ``` Hope this helps!
spring-projects/spring-android
spring-android-rest-template/src/main/java/org/springframework/http/MediaType.java
MediaType.includes
public boolean includes(MediaType other) { if (other == null) { return false; } if (this.isWildcardType()) { // */* includes anything return true; } else if (this.type.equals(other.type)) { if (this.subtype.equals(other.subtype)) { return true; } if (this.isWildcardSubtype()) { // wi...
java
public boolean includes(MediaType other) { if (other == null) { return false; } if (this.isWildcardType()) { // */* includes anything return true; } else if (this.type.equals(other.type)) { if (this.subtype.equals(other.subtype)) { return true; } if (this.isWildcardSubtype()) { // wi...
[ "public", "boolean", "includes", "(", "MediaType", "other", ")", "{", "if", "(", "other", "==", "null", ")", "{", "return", "false", ";", "}", "if", "(", "this", ".", "isWildcardType", "(", ")", ")", "{", "// */* includes anything", "return", "true", ";"...
Indicate whether this {@code MediaType} includes the given media type. <p>For instance, {@code text/*} includes {@code text/plain} and {@code text/html}, and {@code application/*+xml} includes {@code application/soap+xml}, etc. This method is <b>not</b> symmetric. @param other the reference media type with which to com...
[ "Indicate", "whether", "this", "{" ]
941296e152d49a40e0745a3e81628a974f72b7e4
https://github.com/spring-projects/spring-android/blob/941296e152d49a40e0745a3e81628a974f72b7e4/spring-android-rest-template/src/main/java/org/springframework/http/MediaType.java#L499-L532
train
Checks if this media type includes the other media type.
Create a Java method that does the following: "Checks if this media type includes the other media type.".
Of course, here is the Java code you requested: ```java public boolean includes(MediaType other) { if (other == null) { return false; } if (this.isWildcardType()) { // */* includes anything return true; } else if (this.type.equals(other.type)) { if (this.subtype.equals(other.subtype)) { retur...
JDBDT/jdbdt
src/main/java/org/jdbdt/DataSet.java
DataSet.join
@SafeVarargs public static DataSet join(DataSet... dataSets) { if (dataSets == null || dataSets.length == 0) { throw new InvalidOperationException("No source data sets given for joining."); } DataSet r = copyOf(dataSets[0]); for (int i = 1; i < dataSets.length; i++) { DataSet d = dataSets[...
java
@SafeVarargs public static DataSet join(DataSet... dataSets) { if (dataSets == null || dataSets.length == 0) { throw new InvalidOperationException("No source data sets given for joining."); } DataSet r = copyOf(dataSets[0]); for (int i = 1; i < dataSets.length; i++) { DataSet d = dataSets[...
[ "@", "SafeVarargs", "public", "static", "DataSet", "join", "(", "DataSet", "...", "dataSets", ")", "{", "if", "(", "dataSets", "==", "null", "||", "dataSets", ".", "length", "==", "0", ")", "{", "throw", "new", "InvalidOperationException", "(", "\"No source ...
Create data set that results from joining several data sets. @param dataSets Data sets to join. @return A new data set containing the rows from all given data sets. @throws InvalidOperationException if <code>dataSets</code> is null or empty or if the data source is not the same for all data sets.
[ "Create", "data", "set", "that", "results", "from", "joining", "several", "data", "sets", "." ]
7e32845ad41dfbc5d6fd0fd561e3613697186df4
https://github.com/JDBDT/jdbdt/blob/7e32845ad41dfbc5d6fd0fd561e3613697186df4/src/main/java/org/jdbdt/DataSet.java#L318-L332
train
Join the data sets with the source data sets.
Create a Java method that does the following: "Join the data sets with the source data sets.".
Of course, here is the Java code you requested: ```java @SafeVarargs public static DataSet join(DataSet... dataSets) { if (dataSets == null || dataSets.length == 0) { throw new InvalidOperationException("No source data sets given for joining."); } DataSet r = copyOf(dataSets[0]); for (int i = 1...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Implement the following algorithm in Java, with a slight modification to the original bubble sort algorithm. // Modified Bubble sort algorithm for i in 1 to n-1 for j in 0 to n-i-1 if array[j] > array[j+1] swap array[j] and array[j+1] Your task is to modify the bubble sort algorithm to sort the array ...
Here is the modified bubble sort algorithm in Java to sort the array in descending order: ```java public class BubbleSortDescending { public static void main(String[] args) { int[] array = {5, 2, 8, 1, 3}; // Modified Bubble sort algorithm for descending order int n = array.length; ...
JadiraOrg/jadira
jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java
BatchedJmsTemplate.receive
@Override public Message receive() throws JmsException { Destination defaultDestination = getDefaultDestination(); if (defaultDestination != null) { return receive(defaultDestination); } else { return receive(getRequiredDefaultDestinationName()); } }
java
@Override public Message receive() throws JmsException { Destination defaultDestination = getDefaultDestination(); if (defaultDestination != null) { return receive(defaultDestination); } else { return receive(getRequiredDefaultDestinationName()); } }
[ "@", "Override", "public", "Message", "receive", "(", ")", "throws", "JmsException", "{", "Destination", "defaultDestination", "=", "getDefaultDestination", "(", ")", ";", "if", "(", "defaultDestination", "!=", "null", ")", "{", "return", "receive", "(", "defaul...
{@inheritDoc}
[ "{" ]
d55d0238395f0cb900531f1f08b4b2d87fa9a4f6
https://github.com/JadiraOrg/jadira/blob/d55d0238395f0cb900531f1f08b4b2d87fa9a4f6/jms/src/main/java/org/jadira/jms/template/BatchedJmsTemplate.java#L440-L448
train
This method is overridden to receive a Message from the JMS server.
Create a Java method that does the following: "This method is overridden to receive a Message from the JMS server.".
Of course, here is the Java code you requested: ```java @Override public Message receive() throws JmsException { Destination defaultDestination = getDefaultDestination(); if (defaultDestination != null) { return receive(defaultDestination); } else { return receive(ge...
facebookarchive/hadoop-20
src/core/org/apache/hadoop/fs/FileUtil.java
FileUtil.listStatus
public static FileStatus[] listStatus(FileSystem fs, Path f, int depth) throws IOException { if (null == f) { throw new IllegalArgumentException("Path cannot be null."); } if (null == fs) { throw new IllegalArgumentException("File system cannot be null."); } if (depth < 0) { ...
java
public static FileStatus[] listStatus(FileSystem fs, Path f, int depth) throws IOException { if (null == f) { throw new IllegalArgumentException("Path cannot be null."); } if (null == fs) { throw new IllegalArgumentException("File system cannot be null."); } if (depth < 0) { ...
[ "public", "static", "FileStatus", "[", "]", "listStatus", "(", "FileSystem", "fs", ",", "Path", "f", ",", "int", "depth", ")", "throws", "IOException", "{", "if", "(", "null", "==", "f", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"Path ca...
Return an array of FileStatus objects for each file beneath the given path to a specified depth (inclusive). Directories at the given depth will be returned, while directories above that depth will not. @param fs FileSystem on which to operate @param f starting path @param depth the depth of recursion. If 0 the functio...
[ "Return", "an", "array", "of", "FileStatus", "objects", "for", "each", "file", "beneath", "the", "given", "path", "to", "a", "specified", "depth", "(", "inclusive", ")", ".", "Directories", "at", "the", "given", "depth", "will", "be", "returned", "while", ...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/fs/FileUtil.java#L811-L831
train
List status of a file.
Create a Java method that does the following: "List status of a file.".
Of course, here is the Java code you requested: ```java public static FileStatus[] listStatus(FileSystem fs, Path f, int depth) throws IOException { if (null == f) { throw new IllegalArgumentException("Path cannot be null."); } if (null == fs) { throw new IllegalArgumentException("File sy...
aol/cyclops
cyclops/src/main/java/com/oath/cyclops/util/ExceptionSoftener.java
ExceptionSoftener.softenConsumer
public static <T> Consumer<T> softenConsumer(final CheckedConsumer<T> fn) { return t -> { try { fn.accept(t); } catch (final Throwable e) { throw throwSoftenedException(e); } }; }
java
public static <T> Consumer<T> softenConsumer(final CheckedConsumer<T> fn) { return t -> { try { fn.accept(t); } catch (final Throwable e) { throw throwSoftenedException(e); } }; }
[ "public", "static", "<", "T", ">", "Consumer", "<", "T", ">", "softenConsumer", "(", "final", "CheckedConsumer", "<", "T", ">", "fn", ")", "{", "return", "t", "->", "{", "try", "{", "fn", ".", "accept", "(", "t", ")", ";", "}", "catch", "(", "fin...
Soften a CheckedConsumer that can throw Checked Exceptions to a standard Consumer that can also throw Checked Exceptions (without declaring them) e.g. <pre> {@code ExceptionSoftener.softenConsumer(this::save).accept(data); public void save(Data data) throws IOException </pre> @param fn CheckedConsumer to be convert...
[ "Soften", "a", "CheckedConsumer", "that", "can", "throw", "Checked", "Exceptions", "to", "a", "standard", "Consumer", "that", "can", "also", "throw", "Checked", "Exceptions", "(", "without", "declaring", "them", ")" ]
59a9fde30190a4d1faeb9f6d9851d209d82b81dd
https://github.com/aol/cyclops/blob/59a9fde30190a4d1faeb9f6d9851d209d82b81dd/cyclops/src/main/java/com/oath/cyclops/util/ExceptionSoftener.java#L532-L540
train
Soften a CheckedConsumer into a Consumer.
Create a Java method that does the following: "Soften a CheckedConsumer into a Consumer.".
Of course, here is the Java code you requested: ```java public static <T> Consumer<T> softenConsumer(final CheckedConsumer<T> fn) { return t -> { try { fn.accept(t); } catch (final Throwable e) { throw throwSoftenedException(e); } }; ...
eclipse/xtext-core
org.eclipse.xtext.util/src/org/eclipse/xtext/util/MergeableManifest2.java
MergeableManifest2.addImportedPackages
public void addImportedPackages(Set<String> importedPackages) { addImportedPackages(importedPackages.toArray(new String[importedPackages.size()])); }
java
public void addImportedPackages(Set<String> importedPackages) { addImportedPackages(importedPackages.toArray(new String[importedPackages.size()])); }
[ "public", "void", "addImportedPackages", "(", "Set", "<", "String", ">", "importedPackages", ")", "{", "addImportedPackages", "(", "importedPackages", ".", "toArray", "(", "new", "String", "[", "importedPackages", ".", "size", "(", ")", "]", ")", ")", ";", "...
Add the set with given bundles to the "Import-Package" main attribute. @param importedPackages The set of all packages to add.
[ "Add", "the", "set", "with", "given", "bundles", "to", "the", "Import", "-", "Package", "main", "attribute", "." ]
bac941cb75cb24706519845ec174cfef874d7557
https://github.com/eclipse/xtext-core/blob/bac941cb75cb24706519845ec174cfef874d7557/org.eclipse.xtext.util/src/org/eclipse/xtext/util/MergeableManifest2.java#L298-L300
train
Add the set of imported packages to the package list.
Create a Java method that does the following: "Add the set of imported packages to the package list.".
Of course, here is the Java code you requested: ```java public void addImportedPackages(Set<String> importedPackages) { addImportedPackages(importedPackages.toArray(new String[importedPackages.size()])); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/CipherLite.java
CipherLite.doFinal
byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException { return cipher.doFinal(input, inputOffset, inputLen); }
java
byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException { return cipher.doFinal(input, inputOffset, inputLen); }
[ "byte", "[", "]", "doFinal", "(", "byte", "[", "]", "input", ",", "int", "inputOffset", ",", "int", "inputLen", ")", "throws", "IllegalBlockSizeException", ",", "BadPaddingException", "{", "return", "cipher", ".", "doFinal", "(", "input", ",", "inputOffset", ...
Encrypts or decrypts data in a single-part operation, or finishes a multiple-part operation. The data is encrypted or decrypted, depending on how the underlying cipher was initialized. <p> The first <code>inputLen</code> bytes in the <code>input</code> buffer, starting at <code>inputOffset</code> inclusive, and any in...
[ "Encrypts", "or", "decrypts", "data", "in", "a", "single", "-", "part", "operation", "or", "finishes", "a", "multiple", "-", "part", "operation", ".", "The", "data", "is", "encrypted", "or", "decrypted", "depending", "on", "how", "the", "underlying", "cipher...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-s3/src/main/java/com/amazonaws/services/s3/internal/crypto/CipherLite.java#L263-L266
train
Finalize the input.
Create a Java method that does the following: "Finalize the input.".
Of course, here is the Java code you requested: ```java byte[] doFinal(byte[] input, int inputOffset, int inputLen) throws IllegalBlockSizeException, BadPaddingException { return cipher.doFinal(input, inputOffset, inputLen); } ``` Hope this helps!
line/armeria
core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java
AbstractClientOptionsBuilder.rpcDecorator
public <I extends RpcRequest, O extends RpcResponse> B rpcDecorator(DecoratingClientFunction<I, O> decorator) { decoration.addRpc(decorator); return self(); }
java
public <I extends RpcRequest, O extends RpcResponse> B rpcDecorator(DecoratingClientFunction<I, O> decorator) { decoration.addRpc(decorator); return self(); }
[ "public", "<", "I", "extends", "RpcRequest", ",", "O", "extends", "RpcResponse", ">", "B", "rpcDecorator", "(", "DecoratingClientFunction", "<", "I", ",", "O", ">", "decorator", ")", "{", "decoration", ".", "addRpc", "(", "decorator", ")", ";", "return", "...
Adds the specified RPC-level {@code decorator}. @param decorator the {@link DecoratingClientFunction} that intercepts an invocation @param <I> the {@link Request} type of the {@link Client} being decorated @param <O> the {@link Response} type of the {@link Client} being decorated
[ "Adds", "the", "specified", "RPC", "-", "level", "{", "@code", "decorator", "}", "." ]
67d29e019fd35a35f89c45cc8f9119ff9b12b44d
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java#L324-L328
train
Add an RPC decorator to the result.
Create a Java method that does the following: "Add an RPC decorator to the result.".
Of course, here is the Java code you requested: ```java public <I extends RpcRequest, O extends RpcResponse> B rpcDecorator(DecoratingClientFunction<I, O> decorator) { decoration.addRpc(decorator); return self(); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/CreateTrainingJobRequestMarshaller.java
CreateTrainingJobRequestMarshaller.marshall
public void marshall(CreateTrainingJobRequest createTrainingJobRequest, ProtocolMarshaller protocolMarshaller) { if (createTrainingJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createT...
java
public void marshall(CreateTrainingJobRequest createTrainingJobRequest, ProtocolMarshaller protocolMarshaller) { if (createTrainingJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(createT...
[ "public", "void", "marshall", "(", "CreateTrainingJobRequest", "createTrainingJobRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "createTrainingJobRequest", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argum...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sagemaker/src/main/java/com/amazonaws/services/sagemaker/model/transform/CreateTrainingJobRequestMarshaller.java#L66-L88
train
marshalls the given parameter object to the JSON object.
Create a Java method that does the following: "marshalls the given parameter object to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(CreateTrainingJobRequest createTrainingJobRequest, ProtocolMarshaller protocolMarshaller) { if (createTrainingJobRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
jenkinsci/jenkins
core/src/main/java/hudson/model/ComputerSet.java
ComputerSet.getTotalExecutors
@Exported public int getTotalExecutors() { int r=0; for (Computer c : get_all()) { if(c.isOnline()) r += c.countExecutors(); } return r; }
java
@Exported public int getTotalExecutors() { int r=0; for (Computer c : get_all()) { if(c.isOnline()) r += c.countExecutors(); } return r; }
[ "@", "Exported", "public", "int", "getTotalExecutors", "(", ")", "{", "int", "r", "=", "0", ";", "for", "(", "Computer", "c", ":", "get_all", "(", ")", ")", "{", "if", "(", "c", ".", "isOnline", "(", ")", ")", "r", "+=", "c", ".", "countExecutors...
Number of total {@link Executor}s that belong to this label that are functioning. <p> This excludes executors that belong to offline nodes.
[ "Number", "of", "total", "{" ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/model/ComputerSet.java#L162-L170
train
Gets the total number of executors in this system.
Create a Java method that does the following: "Gets the total number of executors in this system.".
Of course, here is the Java code you requested: ```java @Exported public int getTotalExecutors() { int r=0; for (Computer c : get_all()) { if(c.isOnline()) r += c.countExecutors(); } return r; } ``` Hope this helps!
jboss-integration/fuse-bxms-integ
switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/task/PropertiesUserGroupCallback.java
PropertiesUserGroupCallback.getGroupsForUser
@Override public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) { List<String> groups = _groupStore.get(userId); if (groups == null) { groups = new ArrayList<String>(0); } return groups; }
java
@Override public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) { List<String> groups = _groupStore.get(userId); if (groups == null) { groups = new ArrayList<String>(0); } return groups; }
[ "@", "Override", "public", "List", "<", "String", ">", "getGroupsForUser", "(", "String", "userId", ",", "List", "<", "String", ">", "groupIds", ",", "List", "<", "String", ">", "allExistingGroupIds", ")", "{", "List", "<", "String", ">", "groups", "=", ...
{@inheritDoc}
[ "{" ]
ca5c012bf867ea15d1250f0991af3cd7e708aaaf
https://github.com/jboss-integration/fuse-bxms-integ/blob/ca5c012bf867ea15d1250f0991af3cd7e708aaaf/switchyard/switchyard-component-common-knowledge/src/main/java/org/switchyard/component/common/knowledge/task/PropertiesUserGroupCallback.java#L105-L112
train
Get the groups for a user.
Create a Java method that does the following: "Get the groups for a user.".
Of course, here is the Java code you requested: ```java @Override public List<String> getGroupsForUser(String userId, List<String> groupIds, List<String> allExistingGroupIds) { List<String> groups = _groupStore.get(userId); if (groups == null) { groups = new ArrayList<String>(0); ...
Koekiebox-PTY-LTD/Fluid
fluid-api/src/main/java/com/fluidbpm/program/api/vo/auth0/Connection.java
Connection.getListOfProvidersFromIdentities
public String getListOfProvidersFromIdentities() { if(this.getIdentities() == null || this.getIdentities().isEmpty()) { return ""; } StringBuilder returnVal = new StringBuilder(); for(Client client : this.getIdentities()) { returnVal.append(c...
java
public String getListOfProvidersFromIdentities() { if(this.getIdentities() == null || this.getIdentities().isEmpty()) { return ""; } StringBuilder returnVal = new StringBuilder(); for(Client client : this.getIdentities()) { returnVal.append(c...
[ "public", "String", "getListOfProvidersFromIdentities", "(", ")", "{", "if", "(", "this", ".", "getIdentities", "(", ")", "==", "null", "||", "this", ".", "getIdentities", "(", ")", ".", "isEmpty", "(", ")", ")", "{", "return", "\"\"", ";", "}", "StringB...
Gets a comma seperated list of providers from {@code Identity}'s. @return Text list of Providers for user {@code Identities}. @see NormalizedUserProfile#getIdentities()
[ "Gets", "a", "comma", "seperated", "list", "of", "providers", "from", "{", "@code", "Identity", "}", "s", "." ]
81153d865f71b84ca933532c7115717bc3979270
https://github.com/Koekiebox-PTY-LTD/Fluid/blob/81153d865f71b84ca933532c7115717bc3979270/fluid-api/src/main/java/com/fluidbpm/program/api/vo/auth0/Connection.java#L554-L571
test
Get the list of providers from the identities.
Create a Java method that does the following: "Get the list of providers from the identities.".
Of course, here is the Java code you requested: ```java public String getListOfProvidersFromIdentities() { if(this.getIdentities() == null || this.getIdentities().isEmpty()) { return ""; } StringBuilder returnVal = new StringBuilder(); for(Client client : this....
querydsl/querydsl
querydsl-spatial/src/main/java/com/querydsl/spatial/jts/JTSCurveExpression.java
JTSCurveExpression.endPoint
public JTSPointExpression<Point> endPoint() { if (endPoint == null) { endPoint = JTSGeometryExpressions.pointOperation(SpatialOps.END_POINT, mixin); } return endPoint; }
java
public JTSPointExpression<Point> endPoint() { if (endPoint == null) { endPoint = JTSGeometryExpressions.pointOperation(SpatialOps.END_POINT, mixin); } return endPoint; }
[ "public", "JTSPointExpression", "<", "Point", ">", "endPoint", "(", ")", "{", "if", "(", "endPoint", "==", "null", ")", "{", "endPoint", "=", "JTSGeometryExpressions", ".", "pointOperation", "(", "SpatialOps", ".", "END_POINT", ",", "mixin", ")", ";", "}", ...
The end Point of this Curve. @return end point
[ "The", "end", "Point", "of", "this", "Curve", "." ]
2bf234caf78549813a1e0f44d9c30ecc5ef734e3
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-spatial/src/main/java/com/querydsl/spatial/jts/JTSCurveExpression.java#L81-L86
train
Get the end point of this geometry.
Create a Java method that does the following: "Get the end point of this geometry.".
Of course, here is the Java code you requested: ```java public JTSPointExpression<Point> endPoint() { if (endPoint == null) { endPoint = JTSGeometryExpressions.pointOperation(SpatialOps.END_POINT, mixin); } return endPoint; } ``` Hope this helps!
google/guava
guava/src/com/google/common/io/MoreFiles.java
MoreFiles.isDirectory
public static Predicate<Path> isDirectory(LinkOption... options) { final LinkOption[] optionsCopy = options.clone(); return new Predicate<Path>() { @Override public boolean apply(Path input) { return Files.isDirectory(input, optionsCopy); } @Override public String toString...
java
public static Predicate<Path> isDirectory(LinkOption... options) { final LinkOption[] optionsCopy = options.clone(); return new Predicate<Path>() { @Override public boolean apply(Path input) { return Files.isDirectory(input, optionsCopy); } @Override public String toString...
[ "public", "static", "Predicate", "<", "Path", ">", "isDirectory", "(", "LinkOption", "...", "options", ")", "{", "final", "LinkOption", "[", "]", "optionsCopy", "=", "options", ".", "clone", "(", ")", ";", "return", "new", "Predicate", "<", "Path", ">", ...
Returns a predicate that returns the result of {@link java.nio.file.Files#isDirectory(Path, LinkOption...)} on input paths with the given link options.
[ "Returns", "a", "predicate", "that", "returns", "the", "result", "of", "{" ]
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/io/MoreFiles.java#L319-L332
valid
Create a predicate that returns true if the path is a directory.
Create a Java method that does the following: "Create a predicate that returns true if the path is a directory.".
Of course, here is the Java code you requested: ```java public static Predicate<Path> isDirectory(LinkOption... options) { final LinkOption[] optionsCopy = options.clone(); return new Predicate<Path>() { @Override public boolean apply(Path input) { return Files.isDirectory(input, optionsCop...
devnied/Bit-lib4j
src/main/java/fr/devnied/bitlib/BitUtils.java
BitUtils.setNextDate
public void setNextDate(final Date pValue, final String pPattern, final boolean pUseBcd) { // create date formatter SimpleDateFormat sdf = new SimpleDateFormat(pPattern); String value = sdf.format(pValue); if (pUseBcd) { setNextHexaString(value, value.length() * 4); } else { setNextString(value...
java
public void setNextDate(final Date pValue, final String pPattern, final boolean pUseBcd) { // create date formatter SimpleDateFormat sdf = new SimpleDateFormat(pPattern); String value = sdf.format(pValue); if (pUseBcd) { setNextHexaString(value, value.length() * 4); } else { setNextString(value...
[ "public", "void", "setNextDate", "(", "final", "Date", "pValue", ",", "final", "String", "pPattern", ",", "final", "boolean", "pUseBcd", ")", "{", "// create date formatter\r", "SimpleDateFormat", "sdf", "=", "new", "SimpleDateFormat", "(", "pPattern", ")", ";", ...
Method to write a date @param pValue the value to write @param pPattern the Date pattern @param pUseBcd write date as BCD (binary coded decimal)
[ "Method", "to", "write", "a", "date" ]
bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0
https://github.com/devnied/Bit-lib4j/blob/bdfa79fd12e7e3d5cf1196291825ef1bb12a1ee0/src/main/java/fr/devnied/bitlib/BitUtils.java#L536-L546
train
Set the next date in the list.
Create a Java method that does the following: "Set the next date in the list.".
Of course, here is the Java code you requested: ```java public void setNextDate(final Date pValue, final String pPattern, final boolean pUseBcd) { // create date formatter SimpleDateFormat sdf = new SimpleDateFormat(pPattern); String value = sdf.format(pValue); if (pUseBcd) { setNextHexaString(value,...
js-lib-com/template.xhtml
src/main/java/js/template/xhtml/Serializer.java
Serializer.writeEndTag
private void writeEndTag(String tag) throws IOException { writer.write('<'); writer.write('/'); writer.write(tag); writer.write('>'); }
java
private void writeEndTag(String tag) throws IOException { writer.write('<'); writer.write('/'); writer.write(tag); writer.write('>'); }
[ "private", "void", "writeEndTag", "(", "String", "tag", ")", "throws", "IOException", "{", "writer", ".", "write", "(", "'", "'", ")", ";", "writer", ".", "write", "(", "'", "'", ")", ";", "writer", ".", "write", "(", "tag", ")", ";", "writer", "."...
Write end tag for non-empty elements. At this point element start tag and its content is already wrote to underlying writer and just need to close it with, e.g. <em>&lt/div&gt;</em>. @param tag tag name @throws IOException if underlying writer fails to write.
[ "Write", "end", "tag", "for", "non", "-", "empty", "elements", ".", "At", "this", "point", "element", "start", "tag", "and", "its", "content", "is", "already", "wrote", "to", "underlying", "writer", "and", "just", "need", "to", "close", "it", "with", "e"...
d50cec08aca9ab9680baebe2a26a341c096564fb
https://github.com/js-lib-com/template.xhtml/blob/d50cec08aca9ab9680baebe2a26a341c096564fb/src/main/java/js/template/xhtml/Serializer.java#L340-L345
train
Write the end tag.
Create a Java method that does the following: "Write the end tag.".
Of course, here is the Java code you requested: ```java private void writeEndTag(String tag) throws IOException { writer.write('<'); writer.write('/'); writer.write(tag); writer.write('>'); } ``` Hope this helps!
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/util/SerializableUtil.java
SerializableUtil.save
public static byte[] save(Object o) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); save(o, baos); return baos.toByteArray(); }
java
public static byte[] save(Object o) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); save(o, baos); return baos.toByteArray(); }
[ "public", "static", "byte", "[", "]", "save", "(", "Object", "o", ")", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "save", "(", "o", ",", "baos", ")", ";", "return", "baos", ".", "toByteArray", "(", ")", ";...
Serializes the object to a {@code byte} array. @param o the object to be stored in the file
[ "Serializes", "the", "object", "to", "a", "{", "@code", "byte", "}", "array", "." ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/util/SerializableUtil.java#L107-L111
train
Save a single object to a byte array.
Create a Java method that does the following: "Save a single object to a byte array.".
Of course, here is the Java code you requested: ```java public static byte[] save(Object o) { ByteArrayOutputStream baos = new ByteArrayOutputStream(); save(o, baos); return baos.toByteArray(); } ``` Hope this helps!
jmxtrans/embedded-jmxtrans
src/main/java/org/jmxtrans/embedded/output/StatsDWriter.java
StatsDWriter.getStatsdMetricType
protected char getStatsdMetricType(@Nonnull QueryResult result) { String metricType = result.getType(); char statsBucketType; if(metricType == null || metricType.equalsIgnoreCase("counter")) { statsBucketType = 'c'; } else if(metricType.equalsIgnoreCase("gauge")) { ...
java
protected char getStatsdMetricType(@Nonnull QueryResult result) { String metricType = result.getType(); char statsBucketType; if(metricType == null || metricType.equalsIgnoreCase("counter")) { statsBucketType = 'c'; } else if(metricType.equalsIgnoreCase("gauge")) { ...
[ "protected", "char", "getStatsdMetricType", "(", "@", "Nonnull", "QueryResult", "result", ")", "{", "String", "metricType", "=", "result", ".", "getType", "(", ")", ";", "char", "statsBucketType", ";", "if", "(", "metricType", "==", "null", "||", "metricType",...
See <a href="https://github.com/etsy/statsd/blob/master/docs/metric_types.md">StatsD Metric Types</a>. @param result @return StatsD metric type such as 'c', 'g' or 's'. Default to 'c' if not known, return the metric type itself if its length == 1
[ "See", "<a", "href", "=", "https", ":", "//", "github", ".", "com", "/", "etsy", "/", "statsd", "/", "blob", "/", "master", "/", "docs", "/", "metric_types", ".", "md", ">", "StatsD", "Metric", "Types<", "/", "a", ">", "." ]
17224389e7d8323284cabc2a5167fc03bed6d223
https://github.com/jmxtrans/embedded-jmxtrans/blob/17224389e7d8323284cabc2a5167fc03bed6d223/src/main/java/org/jmxtrans/embedded/output/StatsDWriter.java#L162-L178
train
Get the statsd metric type.
Create a Java method that does the following: "Get the statsd metric type.".
Of course, here is the Java code you requested: ```java protected char getStatsdMetricType(@Nonnull QueryResult result) { String metricType = result.getType(); char statsBucketType; if(metricType == null || metricType.equalsIgnoreCase("counter")) { statsBucketType = 'c'; } e...
lunisolar/magma
magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/consumer/primitives/obj/LObjCharConsumerBuilder.java
LObjCharConsumerBuilder.objCharConsumer
@Nonnull public static <T> LObjCharConsumerBuilder<T> objCharConsumer(Consumer<LObjCharConsumer<T>> consumer) { return new LObjCharConsumerBuilder(consumer); }
java
@Nonnull public static <T> LObjCharConsumerBuilder<T> objCharConsumer(Consumer<LObjCharConsumer<T>> consumer) { return new LObjCharConsumerBuilder(consumer); }
[ "@", "Nonnull", "public", "static", "<", "T", ">", "LObjCharConsumerBuilder", "<", "T", ">", "objCharConsumer", "(", "Consumer", "<", "LObjCharConsumer", "<", "T", ">", ">", "consumer", ")", "{", "return", "new", "LObjCharConsumerBuilder", "(", "consumer", ")"...
One of ways of creating builder. This might be the only way (considering all _functional_ builders) that might be utilize to specify generic params only once.
[ "One", "of", "ways", "of", "creating", "builder", ".", "This", "might", "be", "the", "only", "way", "(", "considering", "all", "_functional_", "builders", ")", "that", "might", "be", "utilize", "to", "specify", "generic", "params", "only", "once", "." ]
83809c6d1a33d913aec6c49920251e4f0be8b213
https://github.com/lunisolar/magma/blob/83809c6d1a33d913aec6c49920251e4f0be8b213/magma-func-builder/src/main/java/eu/lunisolar/magma/func/build/consumer/primitives/obj/LObjCharConsumerBuilder.java#L90-L93
train
Create a LObjCharConsumerBuilder.
Create a Java method that does the following: "Create a LObjCharConsumerBuilder.".
Of course, here is the Java code you requested: ```java @Nonnull public static <T> LObjCharConsumerBuilder<T> objCharConsumer(Consumer<LObjCharConsumer<T>> consumer) { return new LObjCharConsumerBuilder(consumer); } ``` Hope this helps!
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/tools/AtomTypeTools.java
AtomTypeTools.assignAtomTypePropertiesToAtom
public IRingSet assignAtomTypePropertiesToAtom(IAtomContainer molecule, boolean aromaticity) throws Exception { SmilesGenerator sg = new SmilesGenerator(); //logger.debug("assignAtomTypePropertiesToAtom Start ..."); logger.debug("assignAtomTypePropertiesToAtom Start ..."); String hoseCo...
java
public IRingSet assignAtomTypePropertiesToAtom(IAtomContainer molecule, boolean aromaticity) throws Exception { SmilesGenerator sg = new SmilesGenerator(); //logger.debug("assignAtomTypePropertiesToAtom Start ..."); logger.debug("assignAtomTypePropertiesToAtom Start ..."); String hoseCo...
[ "public", "IRingSet", "assignAtomTypePropertiesToAtom", "(", "IAtomContainer", "molecule", ",", "boolean", "aromaticity", ")", "throws", "Exception", "{", "SmilesGenerator", "sg", "=", "new", "SmilesGenerator", "(", ")", ";", "//logger.debug(\"assignAtomTypePropertiesToAtom...
Method assigns certain properties to an atom. Necessary for the atom type matching Properties: <ul> <li>aromaticity) <li>ChemicalGroup (CDKChemicalRingGroupConstant) <li>SSSR <li>Ring/Group, ringSize, aromaticity <li>SphericalMatcher (HoSe Code) </ul> @param aromaticity boolean true/false true if aromaticity should be...
[ "Method", "assigns", "certain", "properties", "to", "an", "atom", ".", "Necessary", "for", "the", "atom", "type", "matching", "Properties", ":", "<ul", ">", "<li", ">", "aromaticity", ")", "<li", ">", "ChemicalGroup", "(", "CDKChemicalRingGroupConstant", ")", ...
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/tools/AtomTypeTools.java#L85-L133
train
Assign atom type properties to the molecule.
Create a Java method that does the following: "Assign atom type properties to the molecule.".
Of course, here is the Java code you requested: ```java public IRingSet assignAtomTypePropertiesToAtom(IAtomContainer molecule, boolean aromaticity) throws Exception { SmilesGenerator sg = new SmilesGenerator(); //logger.debug("assignAtomTypePropertiesToAtom Start ..."); logger.debug("assignAt...
asterisk-java/asterisk-java
src/main/java/org/asteriskjava/live/internal/ChannelManager.java
ChannelManager.handleNewStateEvent
void handleNewStateEvent(NewStateEvent event) { AsteriskChannelImpl channel = getChannelImplById(event.getUniqueId()); if (channel == null) { // NewStateEvent can occur for an existing channel that now has a // different unique id (originate with Local/) ...
java
void handleNewStateEvent(NewStateEvent event) { AsteriskChannelImpl channel = getChannelImplById(event.getUniqueId()); if (channel == null) { // NewStateEvent can occur for an existing channel that now has a // different unique id (originate with Local/) ...
[ "void", "handleNewStateEvent", "(", "NewStateEvent", "event", ")", "{", "AsteriskChannelImpl", "channel", "=", "getChannelImplById", "(", "event", ".", "getUniqueId", "(", ")", ")", ";", "if", "(", "channel", "==", "null", ")", "{", "// NewStateEvent can occur for...
idChanged
[ "idChanged" ]
cdc9849270d97ef75afa447a02c5194ed29121eb
https://github.com/asterisk-java/asterisk-java/blob/cdc9849270d97ef75afa447a02c5194ed29121eb/src/main/java/org/asteriskjava/live/internal/ChannelManager.java#L555-L629
train
Handle a new state event.
Create a Java method that does the following: "Handle a new state event.".
Of course, here is the Java code you requested: ```java void handleNewStateEvent(NewStateEvent event) { AsteriskChannelImpl channel = getChannelImplById(event.getUniqueId()); if (channel == null) { // NewStateEvent can occur for an existing channel that now has a //...
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java
NodeTypeDataManagerImpl.getPropertyDefinitions
public PropertyDefinitionDatas getPropertyDefinitions(final InternalQName propertyName, final InternalQName primaryNodeType, final InternalQName[] mixinTypes) throws RepositoryException { if (mixinTypes != null) { final InternalQName[] nts = new InternalQName[mixinTypes.length + 1];...
java
public PropertyDefinitionDatas getPropertyDefinitions(final InternalQName propertyName, final InternalQName primaryNodeType, final InternalQName[] mixinTypes) throws RepositoryException { if (mixinTypes != null) { final InternalQName[] nts = new InternalQName[mixinTypes.length + 1];...
[ "public", "PropertyDefinitionDatas", "getPropertyDefinitions", "(", "final", "InternalQName", "propertyName", ",", "final", "InternalQName", "primaryNodeType", ",", "final", "InternalQName", "[", "]", "mixinTypes", ")", "throws", "RepositoryException", "{", "if", "(", "...
{@inheritDoc} @throws RepositoryException
[ "{" ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/core/nodetype/NodeTypeDataManagerImpl.java#L632-L647
train
Gets the property definitions for the given property name and primary node type and mixin types.
Create a Java method that does the following: "Gets the property definitions for the given property name and primary node type and mixin types.".
Of course, here is the Java code you requested: ```java public PropertyDefinitionDatas getPropertyDefinitions(final InternalQName propertyName, final InternalQName primaryNodeType, final InternalQName[] mixinTypes) throws RepositoryException { if (mixinTypes != null) { final Intern...
AgNO3/jcifs-ng
src/main/java/jcifs/smb/SpnegoContext.java
SpnegoContext.initSecContext
@Override public byte[] initSecContext ( byte[] inputBuf, int offset, int len ) throws CIFSException { SpnegoToken resp; if ( this.completed ) { throw new CIFSException("Already complete"); } else if ( len == 0 ) { resp = initialToken(); } else...
java
@Override public byte[] initSecContext ( byte[] inputBuf, int offset, int len ) throws CIFSException { SpnegoToken resp; if ( this.completed ) { throw new CIFSException("Already complete"); } else if ( len == 0 ) { resp = initialToken(); } else...
[ "@", "Override", "public", "byte", "[", "]", "initSecContext", "(", "byte", "[", "]", "inputBuf", ",", "int", "offset", ",", "int", "len", ")", "throws", "CIFSException", "{", "SpnegoToken", "resp", ";", "if", "(", "this", ".", "completed", ")", "{", "...
Initialize the GSSContext to provide SPNEGO feature. @param inputBuf @param offset @param len @return response token
[ "Initialize", "the", "GSSContext", "to", "provide", "SPNEGO", "feature", "." ]
0311107a077ea372527ae74839eec8042197332f
https://github.com/AgNO3/jcifs-ng/blob/0311107a077ea372527ae74839eec8042197332f/src/main/java/jcifs/smb/SpnegoContext.java#L191-L208
train
This method is called to initialize the security context.
Create a Java method that does the following: "This method is called to initialize the security context.".
Of course, here is the Java code you requested: ```java @Override public byte[] initSecContext ( byte[] inputBuf, int offset, int len ) throws CIFSException { SpnegoToken resp; if ( this.completed ) { throw new CIFSException("Already complete"); } else if ( len == 0 ) { ...
aws/aws-sdk-java
aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/transform/ErrorRootCauseEntityMarshaller.java
ErrorRootCauseEntityMarshaller.marshall
public void marshall(ErrorRootCauseEntity errorRootCauseEntity, ProtocolMarshaller protocolMarshaller) { if (errorRootCauseEntity == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(errorRootCauseEntit...
java
public void marshall(ErrorRootCauseEntity errorRootCauseEntity, ProtocolMarshaller protocolMarshaller) { if (errorRootCauseEntity == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(errorRootCauseEntit...
[ "public", "void", "marshall", "(", "ErrorRootCauseEntity", "errorRootCauseEntity", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "errorRootCauseEntity", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument passed t...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-xray/src/main/java/com/amazonaws/services/xray/model/transform/ErrorRootCauseEntityMarshaller.java#L47-L60
train
marshalls the ErrorRootCauseEntity to the given protocolMarshaller.
Create a Java method that does the following: "marshalls the ErrorRootCauseEntity to the given protocolMarshaller.".
Of course, here is the Java code you requested: ```java public void marshall(ErrorRootCauseEntity errorRootCauseEntity, ProtocolMarshaller protocolMarshaller) { if (errorRootCauseEntity == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { ...
objectify/objectify
src/main/java/com/googlecode/objectify/impl/LoadEngine.java
LoadEngine.fetch
public Result<Map<com.google.cloud.datastore.Key, Entity>> fetch(Set<com.google.cloud.datastore.Key> keys) { log.debug("Fetching {} keys: {}", keys.size(), keys); final Future<Map<com.google.cloud.datastore.Key, Entity>> fut = datastore.get(keys, readOptions.toArray(new ReadOption[readOptions.size()])); retu...
java
public Result<Map<com.google.cloud.datastore.Key, Entity>> fetch(Set<com.google.cloud.datastore.Key> keys) { log.debug("Fetching {} keys: {}", keys.size(), keys); final Future<Map<com.google.cloud.datastore.Key, Entity>> fut = datastore.get(keys, readOptions.toArray(new ReadOption[readOptions.size()])); retu...
[ "public", "Result", "<", "Map", "<", "com", ".", "google", ".", "cloud", ".", "datastore", ".", "Key", ",", "Entity", ">", ">", "fetch", "(", "Set", "<", "com", ".", "google", ".", "cloud", ".", "datastore", ".", "Key", ">", "keys", ")", "{", "lo...
Fetch the keys from the async datastore using the current transaction context
[ "Fetch", "the", "keys", "from", "the", "async", "datastore", "using", "the", "current", "transaction", "context" ]
4bf325d2e49b400326416977c7d9bbdf5380175b
https://github.com/objectify/objectify/blob/4bf325d2e49b400326416977c7d9bbdf5380175b/src/main/java/com/googlecode/objectify/impl/LoadEngine.java#L176-L181
test
Fetch the entities with the specified keys.
Create a Java method that does the following: "Fetch the entities with the specified keys.".
Of course, here is the Java code you requested: ```java public Result<Map<com.google.cloud.datastore.Key, Entity>> fetch(Set<com.google.cloud.datastore.Key> keys) { log.debug("Fetching {} keys: {}", keys.size(), keys); final Future<Map<com.google.cloud.datastore.Key, Entity>> fut = datastore.get(keys, readOpti...
liyiorg/weixin-popular
src/main/java/weixin/popular/util/PayUtil.java
PayUtil.generateMchPayJsRequestJson
public static String generateMchPayJsRequestJson(String prepay_id, String appId, String key) { String package_ = "prepay_id=" + prepay_id; Map<String, String> map = new LinkedHashMap<String, String>(); map.put("appId", appId); map.put("nonceStr", UUID.randomUUID().toString().replace("-", "")); map.put("p...
java
public static String generateMchPayJsRequestJson(String prepay_id, String appId, String key) { String package_ = "prepay_id=" + prepay_id; Map<String, String> map = new LinkedHashMap<String, String>(); map.put("appId", appId); map.put("nonceStr", UUID.randomUUID().toString().replace("-", "")); map.put("p...
[ "public", "static", "String", "generateMchPayJsRequestJson", "(", "String", "prepay_id", ",", "String", "appId", ",", "String", "key", ")", "{", "String", "package_", "=", "\"prepay_id=\"", "+", "prepay_id", ";", "Map", "<", "String", ",", "String", ">", "map"...
(MCH)生成支付JS请求对象 @param prepay_id 预支付订单号 @param appId appId @param key 商户支付密钥 @return json
[ "(", "MCH", ")", "生成支付JS请求对象" ]
c64255292d41463bdb671938feaabf42a335d82c
https://github.com/liyiorg/weixin-popular/blob/c64255292d41463bdb671938feaabf42a335d82c/src/main/java/weixin/popular/util/PayUtil.java#L41-L52
train
Generates a MchPayJsRequestJson string for a prepay_id and appId
Create a Java method that does the following: "Generates a MchPayJsRequestJson string for a prepay_id and appId".
Of course, here is the Java code you requested: ```java public static String generateMchPayJsRequestJson(String prepay_id, String appId, String key) { String package_ = "prepay_id=" + prepay_id; Map<String, String> map = new LinkedHashMap<String, String>(); map.put("appId", appId); map.put("nonceStr", UUID...
Pi4J/pi4j
pi4j-core/src/main/java/com/pi4j/io/i2c/impl/I2CDeviceImpl.java
I2CDeviceImpl.read
@Override public int read(final byte[] data, final int offset, final int size) throws IOException { return getBus().readBytesDirect(this, size, offset, data); }
java
@Override public int read(final byte[] data, final int offset, final int size) throws IOException { return getBus().readBytesDirect(this, size, offset, data); }
[ "@", "Override", "public", "int", "read", "(", "final", "byte", "[", "]", "data", ",", "final", "int", "offset", ",", "final", "int", "size", ")", "throws", "IOException", "{", "return", "getBus", "(", ")", ".", "readBytesDirect", "(", "this", ",", "si...
<p> This method reads bytes from the i2c device to given buffer at asked offset. </p> <p> Note: Current implementation calls {@link #read(int)}. That means for each read byte i2c bus will send (next) address to i2c device. </p> @param data buffer of data to be read from the i2c device in one go @param offset offset i...
[ "<p", ">", "This", "method", "reads", "bytes", "from", "the", "i2c", "device", "to", "given", "buffer", "at", "asked", "offset", ".", "<", "/", "p", ">" ]
03cacc62223cc59b3118bfcefadabab979fd84c7
https://github.com/Pi4J/pi4j/blob/03cacc62223cc59b3118bfcefadabab979fd84c7/pi4j-core/src/main/java/com/pi4j/io/i2c/impl/I2CDeviceImpl.java#L190-L193
train
Read a block of bytes from the input stream.
Create a Java method that does the following: "Read a block of bytes from the input stream.".
Of course, here is the Java code you requested: ```java @Override public int read(final byte[] data, final int offset, final int size) throws IOException { return getBus().readBytesDirect(this, size, offset, data); } ``` Hope this helps!
protostuff/protostuff
protostuff-core/src/main/java/io/protostuff/CodedInput.java
CodedInput.readRawBytes
public byte[] readRawBytes(final int size) throws IOException { if (size < 0) { throw ProtobufException.negativeSize(); } if (totalBytesRetired + bufferPos + size > currentLimit) { // Read to the end of the stream anyway. skipRawBytes(curr...
java
public byte[] readRawBytes(final int size) throws IOException { if (size < 0) { throw ProtobufException.negativeSize(); } if (totalBytesRetired + bufferPos + size > currentLimit) { // Read to the end of the stream anyway. skipRawBytes(curr...
[ "public", "byte", "[", "]", "readRawBytes", "(", "final", "int", "size", ")", "throws", "IOException", "{", "if", "(", "size", "<", "0", ")", "{", "throw", "ProtobufException", ".", "negativeSize", "(", ")", ";", "}", "if", "(", "totalBytesRetired", "+",...
Read a fixed size of bytes from the input. @throws ProtobufException The end of the stream or the current limit was reached.
[ "Read", "a", "fixed", "size", "of", "bytes", "from", "the", "input", "." ]
af669cf089057d0ec83220266131ce411854af7b
https://github.com/protostuff/protostuff/blob/af669cf089057d0ec83220266131ce411854af7b/protostuff-core/src/main/java/io/protostuff/CodedInput.java#L1006-L1118
train
Read a raw byte array of size bytes from the stream.
Create a Java method that does the following: "Read a raw byte array of size bytes from the stream.".
Of course, here is the Java code you requested: ```java public byte[] readRawBytes(final int size) throws IOException { if (size < 0) { throw ProtobufException.negativeSize(); } if (totalBytesRetired + bufferPos + size > currentLimit) { // Read to th...
aws/aws-sdk-java
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsResult.java
ListThingsResult.setThings
public void setThings(java.util.Collection<ThingAttribute> things) { if (things == null) { this.things = null; return; } this.things = new java.util.ArrayList<ThingAttribute>(things); }
java
public void setThings(java.util.Collection<ThingAttribute> things) { if (things == null) { this.things = null; return; } this.things = new java.util.ArrayList<ThingAttribute>(things); }
[ "public", "void", "setThings", "(", "java", ".", "util", ".", "Collection", "<", "ThingAttribute", ">", "things", ")", "{", "if", "(", "things", "==", "null", ")", "{", "this", ".", "things", "=", "null", ";", "return", ";", "}", "this", ".", "things...
<p> The things. </p> @param things The things.
[ "<p", ">", "The", "things", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListThingsResult.java#L60-L67
train
Sets the value of the things property.
Create a Java method that does the following: "Sets the value of the things property.".
Of course, here is the Java code you requested: ```java public void setThings(java.util.Collection<ThingAttribute> things) { if (things == null) { this.things = null; return; } this.things = new java.util.ArrayList<ThingAttribute>(things); } ``` Hope this helps!
ef-labs/vertx-jersey
features/vertx-jersey-swagger/src/main/java/com/englishtown/vertx/jersey/features/swagger/internal/SwaggerFeatureBinder.java
SwaggerFeatureBinder.configure
@Override protected void configure() { bind(SwaggerServletContext.class).to(ServletContext.class).in(Singleton.class); bind(SwaggerServletConfig.class).to(ServletConfig.class).in(Singleton.class); }
java
@Override protected void configure() { bind(SwaggerServletContext.class).to(ServletContext.class).in(Singleton.class); bind(SwaggerServletConfig.class).to(ServletConfig.class).in(Singleton.class); }
[ "@", "Override", "protected", "void", "configure", "(", ")", "{", "bind", "(", "SwaggerServletContext", ".", "class", ")", ".", "to", "(", "ServletContext", ".", "class", ")", ".", "in", "(", "Singleton", ".", "class", ")", ";", "bind", "(", "SwaggerServ...
Implement to provide binding definitions using the exposed binding methods.
[ "Implement", "to", "provide", "binding", "definitions", "using", "the", "exposed", "binding", "methods", "." ]
733482a8a5afb1fb257c682b3767655e56f7a0fe
https://github.com/ef-labs/vertx-jersey/blob/733482a8a5afb1fb257c682b3767655e56f7a0fe/features/vertx-jersey-swagger/src/main/java/com/englishtown/vertx/jersey/features/swagger/internal/SwaggerFeatureBinder.java#L15-L19
train
Configure the swagger servlets.
Create a Java method that does the following: "Configure the swagger servlets.".
Of course, here is the Java code you requested: ```java @Override protected void configure() { bind(SwaggerServletContext.class).to(ServletContext.class).in(Singleton.class); bind(SwaggerServletConfig.class).to(ServletConfig.class).in(Singleton.class); } ``` Hope this helps!
OpenEstate/OpenEstate-IO
IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java
GrundstueckEmpfohleneNutzung.setBauerwartungsland
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setBauerwartungsland(JAXBElement<Object> value) { this.bauerwartungsland = value; }
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setBauerwartungsland(JAXBElement<Object> value) { this.bauerwartungsland = value; }
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:52:47+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "void", "setBauerwartungsland", "(", "JAXBElement", "<", "Object", ">", "value", ")", ...
Sets the value of the bauerwartungsland property. @param value allowed object is {@link JAXBElement }{@code <}{@link Object }{@code >}
[ "Sets", "the", "value", "of", "the", "bauerwartungsland", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/IS24-XML/src/main/jaxb/org/openestate/io/is24_xml/xml/GrundstueckEmpfohleneNutzung.java#L210-L213
test
Sets the value of the bauerwartungsland property.
Create a Java method that does the following: "Sets the value of the bauerwartungsland property.".
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:52:47+02:00", comments = "JAXB RI v2.2.11") public void setBauerwartungsland(JAXBElement<Object> value) { this.bauerwartungsland = value; } ``` Hope this helps!
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java
AfplibFactoryImpl.createResourceObjectIncludeObOrentFromString
public ResourceObjectIncludeObOrent createResourceObjectIncludeObOrentFromString(EDataType eDataType, String initialValue) { ResourceObjectIncludeObOrent result = ResourceObjectIncludeObOrent.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid e...
java
public ResourceObjectIncludeObOrent createResourceObjectIncludeObOrentFromString(EDataType eDataType, String initialValue) { ResourceObjectIncludeObOrent result = ResourceObjectIncludeObOrent.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid e...
[ "public", "ResourceObjectIncludeObOrent", "createResourceObjectIncludeObOrentFromString", "(", "EDataType", "eDataType", ",", "String", "initialValue", ")", "{", "ResourceObjectIncludeObOrent", "result", "=", "ResourceObjectIncludeObOrent", ".", "get", "(", "initialValue", ")",...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f
https://github.com/yan74/afplib/blob/9ff0513f9448bdf8c0b0e31dc4910c094c48fb2f/org.afplib/src/main/java/org/afplib/afplib/impl/AfplibFactoryImpl.java#L8388-L8392
train
Create a ResourceObjectIncludeObOrent from a String value.
Create a Java method that does the following: "Create a ResourceObjectIncludeObOrent from a String value.".
Of course, here is the Java code you requested: ```java public ResourceObjectIncludeObOrent createResourceObjectIncludeObOrentFromString(EDataType eDataType, String initialValue) { ResourceObjectIncludeObOrent result = ResourceObjectIncludeObOrent.get(initialValue); if (result == null) throw new IllegalArgumentExc...
GerdHolz/TOVAL
src/de/invation/code/toval/types/HashList.java
HashList.set
@Override public E set(int index, E element) { if(element!=null && !contains(element)){ return super.set(index, element); } return get(index); }
java
@Override public E set(int index, E element) { if(element!=null && !contains(element)){ return super.set(index, element); } return get(index); }
[ "@", "Override", "public", "E", "set", "(", "int", "index", ",", "E", "element", ")", "{", "if", "(", "element", "!=", "null", "&&", "!", "contains", "(", "element", ")", ")", "{", "return", "super", ".", "set", "(", "index", ",", "element", ")", ...
Replaces the element at the specified position in this list with the specified element. @param index index of element to replace. @param element element to be stored at the specified position. @return the element previously at the specified position. @throws IndexOutOfBoundsException if index out of range <tt>(inde...
[ "Replaces", "the", "element", "at", "the", "specified", "position", "in", "this", "list", "with", "the", "specified", "element", "." ]
036922cdfd710fa53b18e5dbe1e07f226f731fde
https://github.com/GerdHolz/TOVAL/blob/036922cdfd710fa53b18e5dbe1e07f226f731fde/src/de/invation/code/toval/types/HashList.java#L35-L41
train
Sets the element at the specified index.
Create a Java method that does the following: "Sets the element at the specified index.".
Of course, here is the Java code you requested: ```java @Override public E set(int index, E element) { if(element!=null && !contains(element)){ return super.set(index, element); } return get(index); } ``` Hope this helps!
eFaps/eFaps-Kernel
src/main/java/org/efaps/admin/datamodel/attributetype/PasswordType.java
PasswordType.prepare
@Override protected void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate, final Attribute _attribute, final Object... _values) throws SQLException { if (_insertUpdate instanceof SQLUpdate) { final long id = ((SQLUpdate) _in...
java
@Override protected void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate, final Attribute _attribute, final Object... _values) throws SQLException { if (_insertUpdate instanceof SQLUpdate) { final long id = ((SQLUpdate) _in...
[ "@", "Override", "protected", "void", "prepare", "(", "final", "AbstractSQLInsertUpdate", "<", "?", ">", "_insertUpdate", ",", "final", "Attribute", "_attribute", ",", "final", "Object", "...", "_values", ")", "throws", "SQLException", "{", "if", "(", "_insertUp...
{@inheritDoc}
[ "{" ]
04b96548f518c2386a93f5ec2b9349f9b9063859
https://github.com/eFaps/eFaps-Kernel/blob/04b96548f518c2386a93f5ec2b9349f9b9063859/src/main/java/org/efaps/admin/datamodel/attributetype/PasswordType.java#L68-L101
train
Method prepare.
Create a Java method that does the following: "Method prepare.".
Of course, here is the Java code you requested: ```java @Override protected void prepare(final AbstractSQLInsertUpdate<?> _insertUpdate, final Attribute _attribute, final Object... _values) throws SQLException { if (_insertUpdate instanceof ...
duracloud/duracloud
storeclient/src/main/java/org/duracloud/client/ContentStoreImpl.java
ContentStoreImpl.mergeMaps
private Map<String, String> mergeMaps(Map<String, String> map1, Map<String, String> map2) { Iterator<String> map1Names = map1.keySet().iterator(); while (map1Names.hasNext()) { String name = map1Names.next(); map2.put(name, map1.get(name)); } return map2; }
java
private Map<String, String> mergeMaps(Map<String, String> map1, Map<String, String> map2) { Iterator<String> map1Names = map1.keySet().iterator(); while (map1Names.hasNext()) { String name = map1Names.next(); map2.put(name, map1.get(name)); } return map2; }
[ "private", "Map", "<", "String", ",", "String", ">", "mergeMaps", "(", "Map", "<", "String", ",", "String", ">", "map1", ",", "Map", "<", "String", ",", "String", ">", "map2", ")", "{", "Iterator", "<", "String", ">", "map1Names", "=", "map1", ".", ...
/* Adds all mappings from map1 into map2. In the case of a conflict the values from map1 will win.
[ "/", "*", "Adds", "all", "mappings", "from", "map1", "into", "map2", ".", "In", "the", "case", "of", "a", "conflict", "the", "values", "from", "map1", "will", "win", "." ]
dc4f3a1716d43543cc3b2e1880605f9389849b66
https://github.com/duracloud/duracloud/blob/dc4f3a1716d43543cc3b2e1880605f9389849b66/storeclient/src/main/java/org/duracloud/client/ContentStoreImpl.java#L1113-L1120
train
Merge two maps.
Create a Java method that does the following: "Merge two maps.".
Of course, here is the Java code you requested: ```java private Map<String, String> mergeMaps(Map<String, String> map1, Map<String, String> map2) { Iterator<String> map1Names = map1.keySet().iterator(); while (map1Names.hasNext()) { String name = map1Names.next(); map2.put(name,...
sarl/sarl
main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java
MavenHelper.getConfig
public String getConfig(String key) throws MojoExecutionException { ResourceBundle resource = null; try { resource = ResourceBundle.getBundle( "io/sarl/maven/compiler/config", //$NON-NLS-1$ java.util.Locale.getDefault(), MavenHelper.class.getClassLoader()); } catch (MissingResourceException e) {...
java
public String getConfig(String key) throws MojoExecutionException { ResourceBundle resource = null; try { resource = ResourceBundle.getBundle( "io/sarl/maven/compiler/config", //$NON-NLS-1$ java.util.Locale.getDefault(), MavenHelper.class.getClassLoader()); } catch (MissingResourceException e) {...
[ "public", "String", "getConfig", "(", "String", "key", ")", "throws", "MojoExecutionException", "{", "ResourceBundle", "resource", "=", "null", ";", "try", "{", "resource", "=", "ResourceBundle", ".", "getBundle", "(", "\"io/sarl/maven/compiler/config\"", ",", "//$N...
Extract the value from the hard-coded configuration. @param key the key of the configuration entry. @return the value. @throws MojoExecutionException on error.
[ "Extract", "the", "value", "from", "the", "hard", "-", "coded", "configuration", "." ]
ca00ff994598c730339972def4e19a60e0b8cace
https://github.com/sarl/sarl/blob/ca00ff994598c730339972def4e19a60e0b8cace/main/internalmaven/sarl-maven-plugin/src/main/java/io/sarl/maven/compiler/MavenHelper.java#L152-L168
train
Get the value of the configuration property.
Create a Java method that does the following: "Get the value of the configuration property.".
Of course, here is the Java code you requested: ```java public String getConfig(String key) throws MojoExecutionException { ResourceBundle resource = null; try { resource = ResourceBundle.getBundle( "io/sarl/maven/compiler/config", //$NON-NLS-1$ java.util.Locale.getDefault(), MavenHelper.class.ge...
opencb/biodata
biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java
VariantMetadataManager.removeFile
public void removeFile(VariantFileMetadata file, String studyId) { // Sanity check if (file == null) { logger.error("Variant file metadata is null."); return; } removeFile(file.getId(), studyId); }
java
public void removeFile(VariantFileMetadata file, String studyId) { // Sanity check if (file == null) { logger.error("Variant file metadata is null."); return; } removeFile(file.getId(), studyId); }
[ "public", "void", "removeFile", "(", "VariantFileMetadata", "file", ",", "String", "studyId", ")", "{", "// Sanity check", "if", "(", "file", "==", "null", ")", "{", "logger", ".", "error", "(", "\"Variant file metadata is null.\"", ")", ";", "return", ";", "}...
Remove a variant file metadata of a given variant study metadata (from study ID). @param file File @param studyId Study ID
[ "Remove", "a", "variant", "file", "metadata", "of", "a", "given", "variant", "study", "metadata", "(", "from", "study", "ID", ")", "." ]
21b3d51d71f578efab908422aca4bab7a73097b1
https://github.com/opencb/biodata/blob/21b3d51d71f578efab908422aca4bab7a73097b1/biodata-tools/src/main/java/org/opencb/biodata/tools/variant/metadata/VariantMetadataManager.java#L283-L290
train
Removes a variant file from the CIS.
Create a Java method that does the following: "Removes a variant file from the CIS.".
Of course, here is the Java code you requested: ```java public void removeFile(VariantFileMetadata file, String studyId) { // Sanity check if (file == null) { logger.error("Variant file metadata is null."); return; } removeFile(file.getId(), studyId); } ``` ...
ModeShape/modeshape
modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java
QueryBuilder.rightOuterJoinAllNodesAs
public JoinClause rightOuterJoinAllNodesAs( String alias ) { // Expect there to be a source already ... return new JoinClause(namedSelector(AllNodes.ALL_NODES_NAME + " AS " + alias), JoinType.RIGHT_OUTER); }
java
public JoinClause rightOuterJoinAllNodesAs( String alias ) { // Expect there to be a source already ... return new JoinClause(namedSelector(AllNodes.ALL_NODES_NAME + " AS " + alias), JoinType.RIGHT_OUTER); }
[ "public", "JoinClause", "rightOuterJoinAllNodesAs", "(", "String", "alias", ")", "{", "// Expect there to be a source already ...", "return", "new", "JoinClause", "(", "namedSelector", "(", "AllNodes", ".", "ALL_NODES_NAME", "+", "\" AS \"", "+", "alias", ")", ",", "J...
Perform a right outer join between the already defined source with the "__ALL_NODES" table using the supplied alias. @param alias the alias for the "__ALL_NODES" table; may not be null @return the component that must be used to complete the join specification; never null
[ "Perform", "a", "right", "outer", "join", "between", "the", "already", "defined", "source", "with", "the", "__ALL_NODES", "table", "using", "the", "supplied", "alias", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr/src/main/java/org/modeshape/jcr/query/QueryBuilder.java#L587-L590
train
Joins the all nodes in the source with the given alias.
Create a Java method that does the following: "Joins the all nodes in the source with the given alias.".
Of course, here is the Java code you requested: ```java public JoinClause rightOuterJoinAllNodesAs( String alias ) { // Expect there to be a source already ... return new JoinClause(namedSelector(AllNodes.ALL_NODES_NAME + " AS " + alias), JoinType.RIGHT_OUTER); } ``` Hope this helps!
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java
Neighbour.resetListFailed
synchronized void resetListFailed() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "resetListFailed"); iRequestFailed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "resetListFailed"); }
java
synchronized void resetListFailed() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "resetListFailed"); iRequestFailed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.exit(tc, "resetListFailed"); }
[ "synchronized", "void", "resetListFailed", "(", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "tc", ",", "\"resetListFailed\"", ")", ";", "iRequestFa...
Method indicates that the reset list failed - update the alarm to indicate that this failed.
[ "Method", "indicates", "that", "the", "reset", "list", "failed", "-", "update", "the", "alarm", "to", "indicate", "that", "this", "failed", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/proxyhandler/Neighbour.java#L1456-L1465
train
This method is called by the DME when a request to the list failed.
Create a Java method that does the following: "This method is called by the DME when a request to the list failed.".
Of course, here is the Java code you requested: ```java synchronized void resetListFailed() { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(tc, "resetListFailed"); iRequestFailed = true; if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.ex...
Red5/red5-io
src/main/java/org/red5/io/amf3/Input.java
Input.readInteger
private int readInteger() { int b = buf.get(); if (buf.hasRemaining()) { int n = 0; int result = 0; while ((b & 0x80) != 0 && n < 3) { result <<= 7; result |= (b & 0x7f); b = buf.get(); n++; ...
java
private int readInteger() { int b = buf.get(); if (buf.hasRemaining()) { int n = 0; int result = 0; while ((b & 0x80) != 0 && n < 3) { result <<= 7; result |= (b & 0x7f); b = buf.get(); n++; ...
[ "private", "int", "readInteger", "(", ")", "{", "int", "b", "=", "buf", ".", "get", "(", ")", ";", "if", "(", "buf", ".", "hasRemaining", "(", ")", ")", "{", "int", "n", "=", "0", ";", "int", "result", "=", "0", ";", "while", "(", "(", "b", ...
Parser of AMF3 "compressed" integer data type @return a converted integer value
[ "Parser", "of", "AMF3", "compressed", "integer", "data", "type" ]
9bbbc506423c5a8f18169d46d400df56c0072a33
https://github.com/Red5/red5-io/blob/9bbbc506423c5a8f18169d46d400df56c0072a33/src/main/java/org/red5/io/amf3/Input.java#L1048-L1075
train
Reads a single integer from the buffer.
Create a Java method that does the following: "Reads a single integer from the buffer.".
Of course, here is the Java code you requested: ```java private int readInteger() { int b = buf.get(); if (buf.hasRemaining()) { int n = 0; int result = 0; while ((b & 0x80) != 0 && n < 3) { result <<= 7; result |= (b & 0x7f); ...
abmargb/jamppa
src/main/java/org/jivesoftware/smack/XMPPConnection.java
XMPPConnection.notifyConnectionError
synchronized void notifyConnectionError(Exception e) { // Listeners were already notified of the exception, return right here. if ((packetReader == null || packetReader.done) && (packetWriter == null || packetWriter.done)) return; if (packetReader != null) ...
java
synchronized void notifyConnectionError(Exception e) { // Listeners were already notified of the exception, return right here. if ((packetReader == null || packetReader.done) && (packetWriter == null || packetWriter.done)) return; if (packetReader != null) ...
[ "synchronized", "void", "notifyConnectionError", "(", "Exception", "e", ")", "{", "// Listeners were already notified of the exception, return right here.", "if", "(", "(", "packetReader", "==", "null", "||", "packetReader", ".", "done", ")", "&&", "(", "packetWriter", ...
Sends out a notification that there was an error with the connection and closes the connection. Also prints the stack trace of the given exception @param e the exception that causes the connection close event.
[ "Sends", "out", "a", "notification", "that", "there", "was", "an", "error", "with", "the", "connection", "and", "closes", "the", "connection", ".", "Also", "prints", "the", "stack", "trace", "of", "the", "given", "exception" ]
76f253239923df40904c462e3b88e7278b36b282
https://github.com/abmargb/jamppa/blob/76f253239923df40904c462e3b88e7278b36b282/src/main/java/org/jivesoftware/smack/XMPPConnection.java#L1134-L1156
test
Notifies all connection listeners that the connection has been closed.
Create a Java method that does the following: "Notifies all connection listeners that the connection has been closed.".
Of course, here is the Java code you requested: ```java synchronized void notifyConnectionError(Exception e) { // Listeners were already notified of the exception, return right here. if ((packetReader == null || packetReader.done) && (packetWriter == null || packetWriter.done)) ...
liferay/com-liferay-commerce
commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPInstanceUtil.java
CPInstanceUtil.fetchByUUID_G
public static CPInstance fetchByUUID_G(String uuid, long groupId, boolean retrieveFromCache) { return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache); }
java
public static CPInstance fetchByUUID_G(String uuid, long groupId, boolean retrieveFromCache) { return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache); }
[ "public", "static", "CPInstance", "fetchByUUID_G", "(", "String", "uuid", ",", "long", "groupId", ",", "boolean", "retrieveFromCache", ")", "{", "return", "getPersistence", "(", ")", ".", "fetchByUUID_G", "(", "uuid", ",", "groupId", ",", "retrieveFromCache", ")...
Returns the cp instance where uuid = &#63; and groupId = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache. @param uuid the uuid @param groupId the group ID @param retrieveFromCache whether to retrieve from the finder cache @return the matching cp instance, or <code>null</c...
[ "Returns", "the", "cp", "instance", "where", "uuid", "=", "&#63", ";", "and", "groupId", "=", "&#63", ";", "or", "returns", "<code", ">", "null<", "/", "code", ">", "if", "it", "could", "not", "be", "found", "optionally", "using", "the", "finder", "cac...
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-product-api/src/main/java/com/liferay/commerce/product/service/persistence/CPInstanceUtil.java#L301-L304
train
Returns the cp instance with the UUID and groupId from the database.
Create a Java method that does the following: "Returns the cp instance with the UUID and groupId from the database.".
Of course, here is the Java code you requested: ```java public static CPInstance fetchByUUID_G(String uuid, long groupId, boolean retrieveFromCache) { return getPersistence().fetchByUUID_G(uuid, groupId, retrieveFromCache); } ``` Hope this helps!
nutzam/nutz
src/org/nutz/lang/util/Disks.java
Disks.getRelativePath
public static String getRelativePath(String base, String path, String equalPath) { // 如果两个路径相等 if (base.equals(path) || "./".equals(path) || ".".equals(path)) { return equalPath; } // 开始判断 String[] bb = Strings.splitIgnoreBlank(getCanonicalPath(base), "[\\\\/]...
java
public static String getRelativePath(String base, String path, String equalPath) { // 如果两个路径相等 if (base.equals(path) || "./".equals(path) || ".".equals(path)) { return equalPath; } // 开始判断 String[] bb = Strings.splitIgnoreBlank(getCanonicalPath(base), "[\\\\/]...
[ "public", "static", "String", "getRelativePath", "(", "String", "base", ",", "String", "path", ",", "String", "equalPath", ")", "{", "// 如果两个路径相等\r", "if", "(", "base", ".", "equals", "(", "path", ")", "||", "\"./\"", ".", "equals", "(", "path", ")", "||...
将两个路径比较,得出相对路径 @param base 基础路径,以 '/' 结束,表示目录 @param path 相对文件路径,以 '/' 结束,表示目录 @param equalPath 如果两个路径相等,返回什么,通常为 "./"。 你也可以用 "" 或者 "." 或者随便什么字符串来表示 @return 相对于基础路径对象的相对路径
[ "将两个路径比较,得出相对路径" ]
a38694d5cbda2692e7931ab093c168487a6a4bfe
https://github.com/nutzam/nutz/blob/a38694d5cbda2692e7931ab093c168487a6a4bfe/src/org/nutz/lang/util/Disks.java#L118-L148
valid
Gets the relative path of a file from a base and a path.
Create a Java method that does the following: "Gets the relative path of a file from a base and a path.".
Of course, here is the Java code you requested: ```java public static String getRelativePath(String base, String path, String equalPath) { // 如果两个路径相等 if (base.equals(path) || "./".equals(path) || ".".equals(path)) { return equalPath; } // 开始判断 String[] bb = ...
webfolderio/ui4j
ui4j-api/src/main/java/io/webfolder/ui4j/api/browser/BrowserFactory.java
BrowserFactory.getBrowser
public static synchronized BrowserEngine getBrowser(BrowserType type) { if (BROWSERS.containsKey(type)) { return BROWSERS.get(type); } ServiceLoader<BrowserProvider> loader = ServiceLoader.load(BrowserProvider.class); Iterator<BrowserProvider> iter = loader.iterator(); ...
java
public static synchronized BrowserEngine getBrowser(BrowserType type) { if (BROWSERS.containsKey(type)) { return BROWSERS.get(type); } ServiceLoader<BrowserProvider> loader = ServiceLoader.load(BrowserProvider.class); Iterator<BrowserProvider> iter = loader.iterator(); ...
[ "public", "static", "synchronized", "BrowserEngine", "getBrowser", "(", "BrowserType", "type", ")", "{", "if", "(", "BROWSERS", ".", "containsKey", "(", "type", ")", ")", "{", "return", "BROWSERS", ".", "get", "(", "type", ")", ";", "}", "ServiceLoader", "...
Returns a {@link BrowserEngine} of a specified {@link BrowserType}. <p>The {@link BrowserType} values that are supported are those for which at least one {@link BrowserProvider} implementation for that {@link BrowserType} can be found at runtime by the {@link ServiceLoader} class.</p> <p>By default, Ui4j includes a b...
[ "Returns", "a", "{", "@link", "BrowserEngine", "}", "of", "a", "specified", "{", "@link", "BrowserType", "}", "." ]
b0b95f20e21e8ff0d0ce6b1f2a4b84d3f9074625
https://github.com/webfolderio/ui4j/blob/b0b95f20e21e8ff0d0ce6b1f2a4b84d3f9074625/ui4j-api/src/main/java/io/webfolder/ui4j/api/browser/BrowserFactory.java#L104-L120
train
Gets the browser engine for the specified type.
Create a Java method that does the following: "Gets the browser engine for the specified type.".
Of course, here is the Java code you requested: ```java public static synchronized BrowserEngine getBrowser(BrowserType type) { if (BROWSERS.containsKey(type)) { return BROWSERS.get(type); } ServiceLoader<BrowserProvider> loader = ServiceLoader.load(BrowserProvider.class); I...
micronaut-projects/micronaut-core
jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java
CalculatedSettings.getUrl
public String getUrl() { final String url = basicJdbcConfiguration.getConfiguredUrl(); if (calculatedUrl == null || StringUtils.hasText(url)) { calculatedUrl = url; if (!StringUtils.hasText(calculatedUrl) && embeddedDatabaseConnection.isPresent()) { calculatedUrl ...
java
public String getUrl() { final String url = basicJdbcConfiguration.getConfiguredUrl(); if (calculatedUrl == null || StringUtils.hasText(url)) { calculatedUrl = url; if (!StringUtils.hasText(calculatedUrl) && embeddedDatabaseConnection.isPresent()) { calculatedUrl ...
[ "public", "String", "getUrl", "(", ")", "{", "final", "String", "url", "=", "basicJdbcConfiguration", ".", "getConfiguredUrl", "(", ")", ";", "if", "(", "calculatedUrl", "==", "null", "||", "StringUtils", ".", "hasText", "(", "url", ")", ")", "{", "calcula...
Determines the URL based on the configured value. If the URL is not configured, search for an embedded database driver on the classpath and retrieve a default URL for it. @return The calculated URL
[ "Determines", "the", "URL", "based", "on", "the", "configured", "value", ".", "If", "the", "URL", "is", "not", "configured", "search", "for", "an", "embedded", "database", "driver", "on", "the", "classpath", "and", "retrieve", "a", "default", "URL", "for", ...
c31f5b03ce0eb88c2f6470710987db03b8967d5c
https://github.com/micronaut-projects/micronaut-core/blob/c31f5b03ce0eb88c2f6470710987db03b8967d5c/jdbc/src/main/java/io/micronaut/jdbc/CalculatedSettings.java#L101-L114
train
Gets the URL of the database.
Create a Java method that does the following: "Gets the URL of the database.".
Of course, here is the Java code you requested: ```java public String getUrl() { final String url = basicJdbcConfiguration.getConfiguredUrl(); if (calculatedUrl == null || StringUtils.hasText(url)) { calculatedUrl = url; if (!StringUtils.hasText(calculatedUrl) && embeddedDatabas...
aNNiMON/Lightweight-Stream-API
stream/src/main/java/com/annimon/stream/Stream.java
Stream.reduce
@Nullable public <R> R reduce(@Nullable R identity, @NotNull BiFunction<? super R, ? super T, ? extends R> accumulator) { R result = identity; while (iterator.hasNext()) { final T value = iterator.next(); result = accumulator.apply(result, value); ...
java
@Nullable public <R> R reduce(@Nullable R identity, @NotNull BiFunction<? super R, ? super T, ? extends R> accumulator) { R result = identity; while (iterator.hasNext()) { final T value = iterator.next(); result = accumulator.apply(result, value); ...
[ "@", "Nullable", "public", "<", "R", ">", "R", "reduce", "(", "@", "Nullable", "R", "identity", ",", "@", "NotNull", "BiFunction", "<", "?", "super", "R", ",", "?", "super", "T", ",", "?", "extends", "R", ">", "accumulator", ")", "{", "R", "result"...
Reduces the elements using provided identity value and the associative accumulation function. <p>This is a terminal operation. <p>Example: <pre> identity: 0 accumulator: (a, b) -&gt; a + b stream: [1, 2, 3, 4, 5] result: 15 </pre> @param <R> the type of the result @param identity the initial value @param accumulato...
[ "Reduces", "the", "elements", "using", "provided", "identity", "value", "and", "the", "associative", "accumulation", "function", "." ]
f29fd57208c20252a4549b084d55ed082c3e58f0
https://github.com/aNNiMON/Lightweight-Stream-API/blob/f29fd57208c20252a4549b084d55ed082c3e58f0/stream/src/main/java/com/annimon/stream/Stream.java#L1632-L1641
train
Reduce the set of elements using the given identity and a binary function.
Create a Java method that does the following: "Reduce the set of elements using the given identity and a binary function.".
Of course, here is the Java code you requested: ```java @Nullable public <R> R reduce(@Nullable R identity, @NotNull BiFunction<? super R, ? super T, ? extends R> accumulator) { R result = identity; while (iterator.hasNext()) { final T value = iterator.next(); ...
rollbar/rollbar-java
rollbar-android/src/main/java/com/rollbar/android/Rollbar.java
Rollbar.init
public static Rollbar init(Context context, String accessToken, String environment, boolean registerExceptionHandler, boolean includeLogcat) { return init(context, accessToken, environment, registerExceptionHandler, includeLogcat, null); }
java
public static Rollbar init(Context context, String accessToken, String environment, boolean registerExceptionHandler, boolean includeLogcat) { return init(context, accessToken, environment, registerExceptionHandler, includeLogcat, null); }
[ "public", "static", "Rollbar", "init", "(", "Context", "context", ",", "String", "accessToken", ",", "String", "environment", ",", "boolean", "registerExceptionHandler", ",", "boolean", "includeLogcat", ")", "{", "return", "init", "(", "context", ",", "accessToken...
Initialize the singleton instance of Rollbar. @param context Android context to use. @param accessToken a Rollbar access token with at least post_client_item scope @param environment the environment to set for items @param registerExceptionHandler whether or not to handle uncaught exceptions. @param includeLogcat ...
[ "Initialize", "the", "singleton", "instance", "of", "Rollbar", "." ]
5eb4537d1363722b51cfcce55b427cbd8489f17b
https://github.com/rollbar/rollbar-java/blob/5eb4537d1363722b51cfcce55b427cbd8489f17b/rollbar-android/src/main/java/com/rollbar/android/Rollbar.java#L93-L95
train
Initialize Rollbar with the given context access token environment and logcat flag.
Create a Java method that does the following: "Initialize Rollbar with the given context access token environment and logcat flag.".
Of course, here is the Java code you requested: ```java public static Rollbar init(Context context, String accessToken, String environment, boolean registerExceptionHandler, boolean includeLogcat) { return init(context, accessToken, environment, registerExceptionHandler, includeLogcat, null); } ``` Hope this he...
OpenLiberty/open-liberty
dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/NotificationManager.java
NotificationManager.cleanUp
public void cleanUp(RESTRequest request, int clientID) { ClientNotificationArea inbox = inboxes.get(clientID); //If somehow the inbox timed out before we came here, then just exit, because the end result is the same. if (inbox != null) { inbox.cleanUp(request); inboxes.re...
java
public void cleanUp(RESTRequest request, int clientID) { ClientNotificationArea inbox = inboxes.get(clientID); //If somehow the inbox timed out before we came here, then just exit, because the end result is the same. if (inbox != null) { inbox.cleanUp(request); inboxes.re...
[ "public", "void", "cleanUp", "(", "RESTRequest", "request", ",", "int", "clientID", ")", "{", "ClientNotificationArea", "inbox", "=", "inboxes", ".", "get", "(", "clientID", ")", ";", "//If somehow the inbox timed out before we came here, then just exit, because the end res...
Cleanup specified clientID
[ "Cleanup", "specified", "clientID" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jmx.connector.server.rest/src/com/ibm/ws/jmx/connector/server/rest/notification/NotificationManager.java#L368-L375
train
Clean up the cache for a specific client ID.
Create a Java method that does the following: "Clean up the cache for a specific client ID.".
Of course, here is the Java code you requested: ```java public void cleanUp(RESTRequest request, int clientID) { ClientNotificationArea inbox = inboxes.get(clientID); //If somehow the inbox timed out before we came here, then just exit, because the end result is the same. if (inbox != null) { ...
wmdietl/jsr308-langtools
src/share/classes/com/sun/tools/javac/comp/Resolve.java
Resolve.findGlobalType
Symbol findGlobalType(Env<AttrContext> env, Scope scope, Name name) { Symbol bestSoFar = typeNotFound; for (Scope.Entry e = scope.lookup(name); e.scope != null; e = e.next()) { Symbol sym = loadClass(env, e.sym.flatName()); if (bestSoFar.kind == TYP && sym.kind == TYP && ...
java
Symbol findGlobalType(Env<AttrContext> env, Scope scope, Name name) { Symbol bestSoFar = typeNotFound; for (Scope.Entry e = scope.lookup(name); e.scope != null; e = e.next()) { Symbol sym = loadClass(env, e.sym.flatName()); if (bestSoFar.kind == TYP && sym.kind == TYP && ...
[ "Symbol", "findGlobalType", "(", "Env", "<", "AttrContext", ">", "env", ",", "Scope", "scope", ",", "Name", "name", ")", "{", "Symbol", "bestSoFar", "=", "typeNotFound", ";", "for", "(", "Scope", ".", "Entry", "e", "=", "scope", ".", "lookup", "(", "na...
Find a global type in given scope and load corresponding class. @param env The current environment. @param scope The scope in which to look for the type. @param name The type's name.
[ "Find", "a", "global", "type", "in", "given", "scope", "and", "load", "corresponding", "class", "." ]
8812d28c20f4de070a0dd6de1b45602431379834
https://github.com/wmdietl/jsr308-langtools/blob/8812d28c20f4de070a0dd6de1b45602431379834/src/share/classes/com/sun/tools/javac/comp/Resolve.java#L2004-L2015
train
Find the global type.
Create a Java method that does the following: "Find the global type.".
Of course, here is the Java code you requested: ```java Symbol findGlobalType(Env<AttrContext> env, Scope scope, Name name) { Symbol bestSoFar = typeNotFound; for (Scope.Entry e = scope.lookup(name); e.scope != null; e = e.next()) { Symbol sym = loadClass(env, e.sym.flatName()); ...
youngmonkeys/ezyfox-sfs2x
src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/MessageEventHandler.java
MessageEventHandler.notifyToHandler
protected void notifyToHandler(ServerHandlerClass handler, Object message, ISFSObject params) { Object object = handler.newInstance(); MessageParamsClass paramsClass = context.getMessageParamsClass(object.getClass()); if(paramsClass == null) paramsClass = new MessageParamsClass(obje...
java
protected void notifyToHandler(ServerHandlerClass handler, Object message, ISFSObject params) { Object object = handler.newInstance(); MessageParamsClass paramsClass = context.getMessageParamsClass(object.getClass()); if(paramsClass == null) paramsClass = new MessageParamsClass(obje...
[ "protected", "void", "notifyToHandler", "(", "ServerHandlerClass", "handler", ",", "Object", "message", ",", "ISFSObject", "params", ")", "{", "Object", "object", "=", "handler", ".", "newInstance", "(", ")", ";", "MessageParamsClass", "paramsClass", "=", "context...
Propagate event to handler @param handler structure of handler class @param message message data @param params addition data to send
[ "Propagate", "event", "to", "handler" ]
7e004033a3b551c3ae970a0c8f45db7b1ec144de
https://github.com/youngmonkeys/ezyfox-sfs2x/blob/7e004033a3b551c3ae970a0c8f45db7b1ec144de/src/main/java/com/tvd12/ezyfox/sfs2x/serverhandler/MessageEventHandler.java#L48-L58
train
Notify to handler
Create a Java method that does the following: "Notify to handler".
Of course, here is the Java code you requested: ```java protected void notifyToHandler(ServerHandlerClass handler, Object message, ISFSObject params) { Object object = handler.newInstance(); MessageParamsClass paramsClass = context.getMessageParamsClass(object.getClass()); if(param...
Unidata/thredds
grib/src/main/java/ucar/nc2/grib/collection/PartitionCollectionImmutable.java
PartitionCollectionImmutable.getFilename
public String getFilename(int partno, int fileno) throws IOException { Partition part = getPartition(partno); try (GribCollectionImmutable gc = part.getGribCollection()) { return gc.getFilename(fileno); } }
java
public String getFilename(int partno, int fileno) throws IOException { Partition part = getPartition(partno); try (GribCollectionImmutable gc = part.getGribCollection()) { return gc.getFilename(fileno); } }
[ "public", "String", "getFilename", "(", "int", "partno", ",", "int", "fileno", ")", "throws", "IOException", "{", "Partition", "part", "=", "getPartition", "(", "partno", ")", ";", "try", "(", "GribCollectionImmutable", "gc", "=", "part", ".", "getGribCollecti...
debugging
[ "debugging" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/grib/src/main/java/ucar/nc2/grib/collection/PartitionCollectionImmutable.java#L166-L171
test
Get the filename of a file in a partition.
Create a Java method that does the following: "Get the filename of a file in a partition.".
Of course, here is the Java code you requested: ```java public String getFilename(int partno, int fileno) throws IOException { Partition part = getPartition(partno); try (GribCollectionImmutable gc = part.getGribCollection()) { return gc.getFilename(fileno); } } ``` Hope this helps!
groupon/odo
proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java
ClientService.remove
public void remove(int profileId, String clientUUID) throws Exception { PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { // first try selecting the row we want to deal with statement = sqlConnectio...
java
public void remove(int profileId, String clientUUID) throws Exception { PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { // first try selecting the row we want to deal with statement = sqlConnectio...
[ "public", "void", "remove", "(", "int", "profileId", ",", "String", "clientUUID", ")", "throws", "Exception", "{", "PreparedStatement", "statement", "=", "null", ";", "ResultSet", "results", "=", "null", ";", "try", "(", "Connection", "sqlConnection", "=", "sq...
Removes a client from the database Also clears all additional override information for the clientId @param profileId profile ID of client to remove @param clientUUID client UUID of client to remove @throws Exception exception
[ "Removes", "a", "client", "from", "the", "database", "Also", "clears", "all", "additional", "override", "information", "for", "the", "clientId" ]
3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1
https://github.com/groupon/odo/blob/3bae43d5eca8ace036775e5b2d3ed9af1a9ff9b1/proxylib/src/main/java/com/groupon/odo/proxylib/ClientService.java#L480-L570
train
Remove a specific user from a profile
Create a Java method that does the following: "Remove a specific user from a profile".
Of course, here is the Java code you requested: ```java public void remove(int profileId, String clientUUID) throws Exception { PreparedStatement statement = null; ResultSet results = null; try (Connection sqlConnection = sqlService.getConnection()) { // first try selecting the row ...
knowm/XChange
xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsAccountServiceRaw.java
AbucoinsAccountServiceRaw.abucoinsDepositHistory
public AbucoinsDepositsHistory abucoinsDepositHistory() throws IOException { AbucoinsDepositsHistory history = abucoinsAuthenticated.depositsHistory( exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), ...
java
public AbucoinsDepositsHistory abucoinsDepositHistory() throws IOException { AbucoinsDepositsHistory history = abucoinsAuthenticated.depositsHistory( exchange.getExchangeSpecification().getApiKey(), signatureCreator, exchange.getExchangeSpecification().getPassword(), ...
[ "public", "AbucoinsDepositsHistory", "abucoinsDepositHistory", "(", ")", "throws", "IOException", "{", "AbucoinsDepositsHistory", "history", "=", "abucoinsAuthenticated", ".", "depositsHistory", "(", "exchange", ".", "getExchangeSpecification", "(", ")", ".", "getApiKey", ...
Corresponds to <code>GET deposits/history</code> @param cryptoRequest @return @throws IOException
[ "Corresponds", "to", "<code", ">", "GET", "deposits", "/", "history<", "/", "code", ">" ]
e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186
https://github.com/knowm/XChange/blob/e45f437ac8e0b89cd66cdcb3258bdb1bf3d88186/xchange-abucoins/src/main/java/org/knowm/xchange/abucoins/service/AbucoinsAccountServiceRaw.java#L161-L172
train
Authenticated resource that shows the details of a deposit request.
Create a Java method that does the following: "Authenticated resource that shows the details of a deposit request.".
Of course, here is the Java code you requested: ```java public AbucoinsDepositsHistory abucoinsDepositHistory() throws IOException { AbucoinsDepositsHistory history = abucoinsAuthenticated.depositsHistory( exchange.getExchangeSpecification().getApiKey(), signatureCreator, ...
shrinkwrap/shrinkwrap
impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/nio2/file/ShrinkWrapFileSystemProvider.java
ShrinkWrapFileSystemProvider.isSameFile
@Override public boolean isSameFile(final Path path1, final Path path2) throws IOException { // Only equal if pointing to same FS final FileSystem fs1 = path1.getFileSystem(); final FileSystem fs2 = path2.getFileSystem(); if (fs1 != fs2) { return false; } ...
java
@Override public boolean isSameFile(final Path path1, final Path path2) throws IOException { // Only equal if pointing to same FS final FileSystem fs1 = path1.getFileSystem(); final FileSystem fs2 = path2.getFileSystem(); if (fs1 != fs2) { return false; } ...
[ "@", "Override", "public", "boolean", "isSameFile", "(", "final", "Path", "path1", ",", "final", "Path", "path2", ")", "throws", "IOException", "{", "// Only equal if pointing to same FS", "final", "FileSystem", "fs1", "=", "path1", ".", "getFileSystem", "(", ")",...
{@inheritDoc} @see java.nio.file.spi.FileSystemProvider#isSameFile(java.nio.file.Path, java.nio.file.Path)
[ "{", "@inheritDoc", "}" ]
3f8a1a6d344651428c709a63ebb52d35343c5387
https://github.com/shrinkwrap/shrinkwrap/blob/3f8a1a6d344651428c709a63ebb52d35343c5387/impl-base/src/main/java/org/jboss/shrinkwrap/impl/base/nio2/file/ShrinkWrapFileSystemProvider.java#L486-L500
train
Check if two files are the same.
Create a Java method that does the following: "Check if two files are the same.".
Of course, here is the Java code you requested: ```java @Override public boolean isSameFile(final Path path1, final Path path2) throws IOException { // Only equal if pointing to same FS final FileSystem fs1 = path1.getFileSystem(); final FileSystem fs2 = path2.getFileSystem(); if (...
tango-controls/JTango
common/src/main/java/fr/esrf/TangoApi/Database.java
Database.delete_class_property
public void delete_class_property(String name, DbDatum[] properties) throws DevFailed { databaseDAO.delete_class_property(this, name, properties); }
java
public void delete_class_property(String name, DbDatum[] properties) throws DevFailed { databaseDAO.delete_class_property(this, name, properties); }
[ "public", "void", "delete_class_property", "(", "String", "name", ",", "DbDatum", "[", "]", "properties", ")", "throws", "DevFailed", "{", "databaseDAO", ".", "delete_class_property", "(", "this", ",", "name", ",", "properties", ")", ";", "}" ]
==========================================================================
[ "==========================================================================" ]
1ccc9dcb83e6de2359a9f1906d170571cacf1345
https://github.com/tango-controls/JTango/blob/1ccc9dcb83e6de2359a9f1906d170571cacf1345/common/src/main/java/fr/esrf/TangoApi/Database.java#L1163-L1165
train
Delete a class property
Create a Java method that does the following: "Delete a class property".
Of course, here is the Java code you requested: ```java public void delete_class_property(String name, DbDatum[] properties) throws DevFailed { databaseDAO.delete_class_property(this, name, properties); } ``` Hope this helps!
Samsung/GearVRf
GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java
Widget.getChildInfo
public List<ChildInfo> getChildInfo(boolean includeHidden) { List<ChildInfo> children = new ArrayList<>(); for (Widget child : getChildren()) { if (includeHidden || child.mVisibility == Visibility.VISIBLE) { children.add(new ChildInfo(child.getName(), child ...
java
public List<ChildInfo> getChildInfo(boolean includeHidden) { List<ChildInfo> children = new ArrayList<>(); for (Widget child : getChildren()) { if (includeHidden || child.mVisibility == Visibility.VISIBLE) { children.add(new ChildInfo(child.getName(), child ...
[ "public", "List", "<", "ChildInfo", ">", "getChildInfo", "(", "boolean", "includeHidden", ")", "{", "List", "<", "ChildInfo", ">", "children", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "Widget", "child", ":", "getChildren", "(", ")", ")",...
Get a recursive set of {@link ChildInfo} instances describing the {@link Widget} children of this {@code Widget}. @param includeHidden Pass {@code false} to only count children whose {@link #setVisibility(Visibility) visibility} is {@link Visibility#VISIBLE}. @return A {@link List} of {@code ChildInfo}.
[ "Get", "a", "recursive", "set", "of", "{", "@link", "ChildInfo", "}", "instances", "describing", "the", "{", "@link", "Widget", "}", "children", "of", "this", "{", "@code", "Widget", "}", "." ]
05034d465a7b0a494fabb9e9f2971ac19392f32d
https://github.com/Samsung/GearVRf/blob/05034d465a7b0a494fabb9e9f2971ac19392f32d/GVRf/Extensions/widgetLib/src/org/gearvrf/widgetlib/widget/Widget.java#L1937-L1946
train
Get the children of this widget.
Create a Java method that does the following: "Get the children of this widget.".
Of course, here is the Java code you requested: ```java public List<ChildInfo> getChildInfo(boolean includeHidden) { List<ChildInfo> children = new ArrayList<>(); for (Widget child : getChildren()) { if (includeHidden || child.mVisibility == Visibility.VISIBLE) { children.ad...
apache/flink
flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java
DataStream.writeUsingOutputFormat
@PublicEvolving public DataStreamSink<T> writeUsingOutputFormat(OutputFormat<T> format) { return addSink(new OutputFormatSinkFunction<>(format)); }
java
@PublicEvolving public DataStreamSink<T> writeUsingOutputFormat(OutputFormat<T> format) { return addSink(new OutputFormatSinkFunction<>(format)); }
[ "@", "PublicEvolving", "public", "DataStreamSink", "<", "T", ">", "writeUsingOutputFormat", "(", "OutputFormat", "<", "T", ">", "format", ")", "{", "return", "addSink", "(", "new", "OutputFormatSinkFunction", "<>", "(", "format", ")", ")", ";", "}" ]
Writes the dataStream into an output, described by an OutputFormat. <p>The output is not participating in Flink's checkpointing! <p>For writing to a file system periodically, the use of the "flink-connector-filesystem" is recommended. @param format The output format @return The closed DataStream
[ "Writes", "the", "dataStream", "into", "an", "output", "described", "by", "an", "OutputFormat", "." ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-streaming-java/src/main/java/org/apache/flink/streaming/api/datastream/DataStream.java#L1157-L1160
train
Write using output format.
Create a Java method that does the following: "Write using output format.".
Of course, here is the Java code you requested: ```java @PublicEvolving public DataStreamSink<T> writeUsingOutputFormat(OutputFormat<T> format) { return addSink(new OutputFormatSinkFunction<>(format)); } ``` Hope this helps!
alipay/sofa-hessian
src/main/java/com/caucho/hessian/mux/MuxInputStream.java
MuxInputStream.skipToEnd
private void skipToEnd() throws IOException { InputStream is = getInputStream(); if (is == null) return; if (chunkLength > 0) is.skip(chunkLength); for (int tag = is.read(); tag >= 0; tag = is.read()) { switch (tag) { cas...
java
private void skipToEnd() throws IOException { InputStream is = getInputStream(); if (is == null) return; if (chunkLength > 0) is.skip(chunkLength); for (int tag = is.read(); tag >= 0; tag = is.read()) { switch (tag) { cas...
[ "private", "void", "skipToEnd", "(", ")", "throws", "IOException", "{", "InputStream", "is", "=", "getInputStream", "(", ")", ";", "if", "(", "is", "==", "null", ")", "return", ";", "if", "(", "chunkLength", ">", "0", ")", "is", ".", "skip", "(", "ch...
Skips data until the end of the channel.
[ "Skips", "data", "until", "the", "end", "of", "the", "channel", "." ]
89e4f5af28602101dab7b498995018871616357b
https://github.com/alipay/sofa-hessian/blob/89e4f5af28602101dab7b498995018871616357b/src/main/java/com/caucho/hessian/mux/MuxInputStream.java#L150-L190
train
Skip to end of a sequence of bytes.
Create a Java method that does the following: "Skip to end of a sequence of bytes.".
Of course, here is the Java code you requested: ```java private void skipToEnd() throws IOException { InputStream is = getInputStream(); if (is == null) return; if (chunkLength > 0) is.skip(chunkLength); for (int tag = is.read(); tag >= 0; tag = is...
kiegroup/drools
drools-compiler/src/main/java/org/drools/compiler/lang/descr/AnnotatedBaseDescr.java
AnnotatedBaseDescr.getAnnotation
public AnnotationDescr getAnnotation( String name ) { return annotations == null ? null : annotations.get( name ); }
java
public AnnotationDescr getAnnotation( String name ) { return annotations == null ? null : annotations.get( name ); }
[ "public", "AnnotationDescr", "getAnnotation", "(", "String", "name", ")", "{", "return", "annotations", "==", "null", "?", "null", ":", "annotations", ".", "get", "(", "name", ")", ";", "}" ]
Returns the annotation with the given name @param name
[ "Returns", "the", "annotation", "with", "the", "given", "name" ]
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-compiler/src/main/java/org/drools/compiler/lang/descr/AnnotatedBaseDescr.java#L114-L116
train
Get the annotation for the given name.
Create a Java method that does the following: "Get the annotation for the given name.".
Of course, here is the Java code you requested: ```java public AnnotationDescr getAnnotation( String name ) { return annotations == null ? null : annotations.get( name ); } ``` Hope this helps!
resty-gwt/resty-gwt
restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderClassCreator.java
JsonEncoderDecoderClassCreator.getJsonPropertyFromGetterSetter
private JsonProperty getJsonPropertyFromGetterSetter(JMethod getter, JMethod setter) { JsonProperty setterProp = getAnnotation(setter, JsonProperty.class); return (null != setterProp) ? setterProp : getAnnotation(getter, JsonProperty.class); }
java
private JsonProperty getJsonPropertyFromGetterSetter(JMethod getter, JMethod setter) { JsonProperty setterProp = getAnnotation(setter, JsonProperty.class); return (null != setterProp) ? setterProp : getAnnotation(getter, JsonProperty.class); }
[ "private", "JsonProperty", "getJsonPropertyFromGetterSetter", "(", "JMethod", "getter", ",", "JMethod", "setter", ")", "{", "JsonProperty", "setterProp", "=", "getAnnotation", "(", "setter", ",", "JsonProperty", ".", "class", ")", ";", "return", "(", "null", "!=",...
Get {@link JsonProperty} from getter or setter. Annotation from setter is preferred to getter. @param getter @param setter @return
[ "Get", "{", "@link", "JsonProperty", "}", "from", "getter", "or", "setter", ".", "Annotation", "from", "setter", "is", "preferred", "to", "getter", "." ]
44b644aa1512afbc5d496a12f03579ad4ba730a1
https://github.com/resty-gwt/resty-gwt/blob/44b644aa1512afbc5d496a12f03579ad4ba730a1/restygwt/src/main/java/org/fusesource/restygwt/rebind/JsonEncoderDecoderClassCreator.java#L916-L919
valid
Gets the JsonProperty from the getter and setter.
Create a Java method that does the following: "Gets the JsonProperty from the getter and setter.".
Of course, here is the Java code you requested: ```java private JsonProperty getJsonPropertyFromGetterSetter(JMethod getter, JMethod setter) { JsonProperty setterProp = getAnnotation(setter, JsonProperty.class); return (null != setterProp) ? setterProp : getAnnotation(getter, JsonProperty.class); }...
networknt/light-rest-4j
openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java
ResponseValidator.getOpenApiOperation
private OpenApiOperation getOpenApiOperation(String uri, String httpMethod) throws URISyntaxException { String uriWithoutQuery = new URI(uri).getPath(); NormalisedPath requestPath = new ApiNormalisedPath(uriWithoutQuery); Optional<NormalisedPath> maybeApiPath = OpenApiHelper.findMatchingApiPath(...
java
private OpenApiOperation getOpenApiOperation(String uri, String httpMethod) throws URISyntaxException { String uriWithoutQuery = new URI(uri).getPath(); NormalisedPath requestPath = new ApiNormalisedPath(uriWithoutQuery); Optional<NormalisedPath> maybeApiPath = OpenApiHelper.findMatchingApiPath(...
[ "private", "OpenApiOperation", "getOpenApiOperation", "(", "String", "uri", ",", "String", "httpMethod", ")", "throws", "URISyntaxException", "{", "String", "uriWithoutQuery", "=", "new", "URI", "(", "uri", ")", ".", "getPath", "(", ")", ";", "NormalisedPath", "...
locate operation based on uri and httpMethod @param uri original uri of the request @param httpMethod http method of the request @return OpenApiOperation the wrapper of an api operation
[ "locate", "operation", "based", "on", "uri", "and", "httpMethod" ]
06b15128e6101351e617284a636ef5d632e6b1fe
https://github.com/networknt/light-rest-4j/blob/06b15128e6101351e617284a636ef5d632e6b1fe/openapi-validator/src/main/java/com/networknt/openapi/ResponseValidator.java#L173-L186
train
Gets the OpenApiOperation object.
Create a Java method that does the following: "Gets the OpenApiOperation object.".
Of course, here is the Java code you requested: ```java private OpenApiOperation getOpenApiOperation(String uri, String httpMethod) throws URISyntaxException { String uriWithoutQuery = new URI(uri).getPath(); NormalisedPath requestPath = new ApiNormalisedPath(uriWithoutQuery); Optional<Normalis...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Create a new Java thread that performs the following steps: 1. Prompt the user to enter a number between 1 and 100. 2. Read the input number from the user. 3. Check if the number is divisible by 2 and 3. 4. If the number is divisible by 2 and 3, print "Divisible by 2 and 3" to the console. 5. If the number is divisible...
Here is an example implementation of a Java thread that follows the steps you provided: ```java import java.util.Random; import java.util.Scanner; public class DivisibleThread extends Thread { private boolean running = true; @Override public void run() { Scanner scanner = new Scanner(System.in); ...
IBM/ibm-cos-sdk-java
ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/AmazonS3Client.java
AmazonS3Client.populateRequestWithCopyObjectParameters
private void populateRequestWithCopyObjectParameters(Request<? extends AmazonWebServiceRequest> request, CopyObjectRequest copyObjectRequest) { String copySourceHeader = "/" + SdkHttpUtils.urlEncode(copyObjectRequest.getSourceBucketName(), true) + "/" + SdkHttpUtils.urlEncode(copyObjectR...
java
private void populateRequestWithCopyObjectParameters(Request<? extends AmazonWebServiceRequest> request, CopyObjectRequest copyObjectRequest) { String copySourceHeader = "/" + SdkHttpUtils.urlEncode(copyObjectRequest.getSourceBucketName(), true) + "/" + SdkHttpUtils.urlEncode(copyObjectR...
[ "private", "void", "populateRequestWithCopyObjectParameters", "(", "Request", "<", "?", "extends", "AmazonWebServiceRequest", ">", "request", ",", "CopyObjectRequest", "copyObjectRequest", ")", "{", "String", "copySourceHeader", "=", "\"/\"", "+", "SdkHttpUtils", ".", "...
<p> Populates the specified request with the numerous options available in <code>CopyObjectRequest</code>. </p> @param request The request to populate with headers to represent all the options expressed in the <code>CopyObjectRequest</code> object. @param copyObjectRequest The object containing all the options for cop...
[ "<p", ">", "Populates", "the", "specified", "request", "with", "the", "numerous", "options", "available", "in", "<code", ">", "CopyObjectRequest<", "/", "code", ">", ".", "<", "/", "p", ">" ]
d0bb2dd754c328a05e7dba8dc42e28b271b6daf2
https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-s3/src/main/java/com/ibm/cloud/objectstorage/services/s3/AmazonS3Client.java#L3364-L3436
train
Populates the request with the copy object parameters.
Create a Java method that does the following: "Populates the request with the copy object parameters.".
Of course, here is the Java code you requested: ```java private void populateRequestWithCopyObjectParameters(Request<? extends AmazonWebServiceRequest> request, CopyObjectRequest copyObjectRequest) { String copySourceHeader = "/" + SdkHttpUtils.urlEncode(copyObjectRequest.getSourceBucketName(), tr...
devnied/EMV-NFC-Paycard-Enrollment
library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java
EmvTemplate.parseFCIProprietaryTemplate
protected List<Application> parseFCIProprietaryTemplate(final byte[] pData) throws CommunicationException { List<Application> ret = new ArrayList<Application>(); // Get SFI byte[] data = TlvUtil.getValue(pData, EmvTags.SFI); // Check SFI if (data != null) { int sfi = BytesUtils.byteArrayToInt(data); if...
java
protected List<Application> parseFCIProprietaryTemplate(final byte[] pData) throws CommunicationException { List<Application> ret = new ArrayList<Application>(); // Get SFI byte[] data = TlvUtil.getValue(pData, EmvTags.SFI); // Check SFI if (data != null) { int sfi = BytesUtils.byteArrayToInt(data); if...
[ "protected", "List", "<", "Application", ">", "parseFCIProprietaryTemplate", "(", "final", "byte", "[", "]", "pData", ")", "throws", "CommunicationException", "{", "List", "<", "Application", ">", "ret", "=", "new", "ArrayList", "<", "Application", ">", "(", "...
Method used to parse FCI Proprietary Template @param pData data to parse @return the list of EMV application in the card @throws CommunicationException communication error
[ "Method", "used", "to", "parse", "FCI", "Proprietary", "Template" ]
bfbd3960708689154a7a75c8a9a934197d738a5b
https://github.com/devnied/EMV-NFC-Paycard-Enrollment/blob/bfbd3960708689154a7a75c8a9a934197d738a5b/library/src/main/java/com/github/devnied/emvnfccard/parser/EmvTemplate.java#L435-L466
train
Parses FCI Proximity Template
Create a Java method that does the following: "Parses FCI Proximity Template".
Of course, here is the Java code you requested: ```java protected List<Application> parseFCIProprietaryTemplate(final byte[] pData) throws CommunicationException { List<Application> ret = new ArrayList<Application>(); // Get SFI byte[] data = TlvUtil.getValue(pData, EmvTags.SFI); // Check SFI if (data != nu...
looly/hutool
hutool-db/src/main/java/cn/hutool/db/sql/Wrapper.java
Wrapper.wrap
public String wrap(String field){ if(preWrapQuote == null || sufWrapQuote == null || StrUtil.isBlank(field)) { return field; } //如果已经包含包装的引号,返回原字符 if(StrUtil.isSurround(field, preWrapQuote, sufWrapQuote)){ return field; } //如果字段中包含通配符或者括号(字段通配符或者函数),不做包装 if(StrUtil.containsAnyIgnore...
java
public String wrap(String field){ if(preWrapQuote == null || sufWrapQuote == null || StrUtil.isBlank(field)) { return field; } //如果已经包含包装的引号,返回原字符 if(StrUtil.isSurround(field, preWrapQuote, sufWrapQuote)){ return field; } //如果字段中包含通配符或者括号(字段通配符或者函数),不做包装 if(StrUtil.containsAnyIgnore...
[ "public", "String", "wrap", "(", "String", "field", ")", "{", "if", "(", "preWrapQuote", "==", "null", "||", "sufWrapQuote", "==", "null", "||", "StrUtil", ".", "isBlank", "(", "field", ")", ")", "{", "return", "field", ";", "}", "//如果已经包含包装的引号,返回原字符\r", ...
包装字段名<br> 有时字段与SQL的某些关键字冲突,导致SQL出错,因此需要将字段名用单引号或者反引号包装起来,避免冲突 @param field 字段名 @return 包装后的字段名
[ "包装字段名<br", ">", "有时字段与SQL的某些关键字冲突,导致SQL出错,因此需要将字段名用单引号或者反引号包装起来,避免冲突" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/sql/Wrapper.java#L84-L111
train
Wrap the specified field with the specified quote.
Create a Java method that does the following: "Wrap the specified field with the specified quote.".
Of course, here is the Java code you requested: ```java public String wrap(String field){ if(preWrapQuote == null || sufWrapQuote == null || StrUtil.isBlank(field)) { return field; } //如果已经包含包装的引号,返回原字符 if(StrUtil.isSurround(field, preWrapQuote, sufWrapQuote)){ return field; } //如果字段中...
drinkjava2/jDialects
core/src/main/java/com/github/drinkjava2/jdialects/ReservedDBWords.java
ReservedDBWords.isReservedWord
public static boolean isReservedWord(String word) { return !StrUtils.isEmpty(word) && RESERVED_WORDS.containsKey(word.toUpperCase()); }
java
public static boolean isReservedWord(String word) { return !StrUtils.isEmpty(word) && RESERVED_WORDS.containsKey(word.toUpperCase()); }
[ "public", "static", "boolean", "isReservedWord", "(", "String", "word", ")", "{", "return", "!", "StrUtils", ".", "isEmpty", "(", "word", ")", "&&", "RESERVED_WORDS", ".", "containsKey", "(", "word", ".", "toUpperCase", "(", ")", ")", ";", "}" ]
Check if is a reserved word of any database
[ "Check", "if", "is", "a", "reserved", "word", "of", "any", "database" ]
1c165f09c6042a599b681c279024abcc1b848b88
https://github.com/drinkjava2/jDialects/blob/1c165f09c6042a599b681c279024abcc1b848b88/core/src/main/java/com/github/drinkjava2/jdialects/ReservedDBWords.java#L321-L323
train
Checks if the word is a reserved word.
Create a Java method that does the following: "Checks if the word is a reserved word.".
Of course, here is the Java code you requested: ```java public static boolean isReservedWord(String word) { return !StrUtils.isEmpty(word) && RESERVED_WORDS.containsKey(word.toUpperCase()); } ``` Hope this helps!
dvasilen/Hive-XML-SerDe
src/main/java/com/ibm/spss/hive/serde2/xml/processor/AbstractXmlProcessor.java
AbstractXmlProcessor.getMapEntry
@SuppressWarnings({"rawtypes"}) private Map.Entry getMapEntry(XmlNode node) { String keyName = node.getName(); Object value = null; XmlMapEntry xmlMapEntry = this.mapSpecification.get(keyName); switch (node.getType()) { case XmlNode.ATTRIBUTE_NODE: value =...
java
@SuppressWarnings({"rawtypes"}) private Map.Entry getMapEntry(XmlNode node) { String keyName = node.getName(); Object value = null; XmlMapEntry xmlMapEntry = this.mapSpecification.get(keyName); switch (node.getType()) { case XmlNode.ATTRIBUTE_NODE: value =...
[ "@", "SuppressWarnings", "(", "{", "\"rawtypes\"", "}", ")", "private", "Map", ".", "Entry", "getMapEntry", "(", "XmlNode", "node", ")", "{", "String", "keyName", "=", "node", ".", "getName", "(", ")", ";", "Object", "value", "=", "null", ";", "XmlMapEnt...
The given node returns a map entry or null @param node the node @return a map entry for the given node or null
[ "The", "given", "node", "returns", "a", "map", "entry", "or", "null" ]
2a7a184b2cfaeb63008529a9851cd72edb8025d9
https://github.com/dvasilen/Hive-XML-SerDe/blob/2a7a184b2cfaeb63008529a9851cd72edb8025d9/src/main/java/com/ibm/spss/hive/serde2/xml/processor/AbstractXmlProcessor.java#L228-L319
train
Gets the entry from the map specification.
Create a Java method that does the following: "Gets the entry from the map specification.".
Of course, here is the Java code you requested: ```java @SuppressWarnings({"rawtypes"}) private Map.Entry getMapEntry(XmlNode node) { String keyName = node.getName(); Object value = null; XmlMapEntry xmlMapEntry = this.mapSpecification.get(keyName); switch (node.getType()) { ...
colin-lee/mybatis-spring-support
src/main/java/com/github/mybatis/provider/CrudProvider.java
CrudProvider.insert
public String insert(Object obj) { PersistMeta meta = EntityUtil.getMeta(obj.getClass()); StringBuilder names = new StringBuilder(), values = new StringBuilder(); int i = 0; for (Map.Entry<String, Field> kv : meta.getColumns().entrySet()) { if (isNull(kv.getValue(), obj)) { continue; ...
java
public String insert(Object obj) { PersistMeta meta = EntityUtil.getMeta(obj.getClass()); StringBuilder names = new StringBuilder(), values = new StringBuilder(); int i = 0; for (Map.Entry<String, Field> kv : meta.getColumns().entrySet()) { if (isNull(kv.getValue(), obj)) { continue; ...
[ "public", "String", "insert", "(", "Object", "obj", ")", "{", "PersistMeta", "meta", "=", "EntityUtil", ".", "getMeta", "(", "obj", ".", "getClass", "(", ")", ")", ";", "StringBuilder", "names", "=", "new", "StringBuilder", "(", ")", ",", "values", "=", ...
新增操作 @param obj @return String
[ "新增操作" ]
de412e98d00e9a012c0619778fa1a61832863b82
https://github.com/colin-lee/mybatis-spring-support/blob/de412e98d00e9a012c0619778fa1a61832863b82/src/main/java/com/github/mybatis/provider/CrudProvider.java#L181-L200
train
Insert a single record into the database.
Create a Java method that does the following: "Insert a single record into the database.".
Of course, here is the Java code you requested: ```java public String insert(Object obj) { PersistMeta meta = EntityUtil.getMeta(obj.getClass()); StringBuilder names = new StringBuilder(), values = new StringBuilder(); int i = 0; for (Map.Entry<String, Field> kv : meta.getColumns().entrySet()) { ...
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/CFFFontSubset.java
CFFFontSubset.ReconstructPrivateDict
void ReconstructPrivateDict(int Font,OffsetItem[] fdPrivate,IndexBaseItem[] fdPrivateBase, OffsetItem[] fdSubrs) { // For each fdarray private dict check if that FD is used. // if is used build a new one by changing the subrs offset // Else do nothing for (int i=0;i<fonts[Font].fdprivateOffsets.len...
java
void ReconstructPrivateDict(int Font,OffsetItem[] fdPrivate,IndexBaseItem[] fdPrivateBase, OffsetItem[] fdSubrs) { // For each fdarray private dict check if that FD is used. // if is used build a new one by changing the subrs offset // Else do nothing for (int i=0;i<fonts[Font].fdprivateOffsets.len...
[ "void", "ReconstructPrivateDict", "(", "int", "Font", ",", "OffsetItem", "[", "]", "fdPrivate", ",", "IndexBaseItem", "[", "]", "fdPrivateBase", ",", "OffsetItem", "[", "]", "fdSubrs", ")", "{", "// For each fdarray private dict check if that FD is used.", "// if is use...
Function Adds the new private dicts (only for the FDs used) to the list @param Font the font @param fdPrivate OffsetItem array one element for each private @param fdPrivateBase IndexBaseItem array one element for each private @param fdSubrs OffsetItem array one element for each private
[ "Function", "Adds", "the", "new", "private", "dicts", "(", "only", "for", "the", "FDs", "used", ")", "to", "the", "list" ]
438fc1899367fd13dfdfa8dfdca9a3c1a7783b84
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/CFFFontSubset.java#L1488-L1523
train
Reconstruct the private dict.
Create a Java method that does the following: "Reconstruct the private dict.".
Of course, here is the Java code you requested: ```java void ReconstructPrivateDict(int Font,OffsetItem[] fdPrivate,IndexBaseItem[] fdPrivateBase, OffsetItem[] fdSubrs) { // For each fdarray private dict check if that FD is used. // if is used build a new one by changing the subrs offset // Else do ...
kiegroup/drools
drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSinkNodeList.java
LeftTupleSinkNodeList.removeLast
public LeftTupleSinkNode removeLast() { if ( this.lastNode == null ) { return null; } final LeftTupleSinkNode node = this.lastNode; this.lastNode = node.getPreviousLeftTupleSinkNode(); node.setPreviousLeftTupleSinkNode( null ); if ( this.lastNode != null ) { ...
java
public LeftTupleSinkNode removeLast() { if ( this.lastNode == null ) { return null; } final LeftTupleSinkNode node = this.lastNode; this.lastNode = node.getPreviousLeftTupleSinkNode(); node.setPreviousLeftTupleSinkNode( null ); if ( this.lastNode != null ) { ...
[ "public", "LeftTupleSinkNode", "removeLast", "(", ")", "{", "if", "(", "this", ".", "lastNode", "==", "null", ")", "{", "return", "null", ";", "}", "final", "LeftTupleSinkNode", "node", "=", "this", ".", "lastNode", ";", "this", ".", "lastNode", "=", "no...
Remove the last node from the list. The previous node then becomes the last node. If this is the last node then both first and last node references are set to null. @return The first <code>TupleSinkNode</code>.
[ "Remove", "the", "last", "node", "from", "the", "list", ".", "The", "previous", "node", "then", "becomes", "the", "last", "node", ".", "If", "this", "is", "the", "last", "node", "then", "both", "first", "and", "last", "node", "references", "are", "set", ...
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/reteoo/LeftTupleSinkNodeList.java#L190-L204
train
Remove the last node.
Create a Java method that does the following: "Remove the last node.".
Of course, here is the Java code you requested: ```java public LeftTupleSinkNode removeLast() { if ( this.lastNode == null ) { return null; } final LeftTupleSinkNode node = this.lastNode; this.lastNode = node.getPreviousLeftTupleSinkNode(); node.setPreviousLeftTupleS...
intuit/QuickBooks-V3-Java-SDK
payments-api/src/main/java/com/intuit/payment/exception/BaseException.java
BaseException.getString
protected static String getString(List<com.intuit.payment.data.Error> errorList) { String exceptionDetails = ""; if (errorList != null) { Iterator<com.intuit.payment.data.Error> iter = errorList.iterator(); while (iter.hasNext()) { com.intuit.payment.data.Error error = iter.next(); StringBuilder sb = ...
java
protected static String getString(List<com.intuit.payment.data.Error> errorList) { String exceptionDetails = ""; if (errorList != null) { Iterator<com.intuit.payment.data.Error> iter = errorList.iterator(); while (iter.hasNext()) { com.intuit.payment.data.Error error = iter.next(); StringBuilder sb = ...
[ "protected", "static", "String", "getString", "(", "List", "<", "com", ".", "intuit", ".", "payment", ".", "data", ".", "Error", ">", "errorList", ")", "{", "String", "exceptionDetails", "=", "\"\"", ";", "if", "(", "errorList", "!=", "null", ")", "{", ...
Method to get the error codes received from server as String message @param errorList @return
[ "Method", "to", "get", "the", "error", "codes", "received", "from", "server", "as", "String", "message" ]
59f988d0776d46620d0b34711c411b2b5b1da06b
https://github.com/intuit/QuickBooks-V3-Java-SDK/blob/59f988d0776d46620d0b34711c411b2b5b1da06b/payments-api/src/main/java/com/intuit/payment/exception/BaseException.java#L100-L119
train
Method to get the String for the error list
Create a Java method that does the following: "Method to get the String for the error list".
Of course, here is the Java code you requested: ```java protected static String getString(List<com.intuit.payment.data.Error> errorList) { String exceptionDetails = ""; if (errorList != null) { Iterator<com.intuit.payment.data.Error> iter = errorList.iterator(); while (iter.hasNext()) { com.intuit.paymen...
dbracewell/mango
src/main/java/com/davidbracewell/reflection/Reflect.java
Reflect.getMethods
public Set<Method> getMethods(final String name, final int numParams) { if (StringUtils.isNullOrBlank(name) || numParams < 0) { return Collections.emptySet(); } return ClassDescriptorCache.getInstance() .getClassDescriptor(clazz) ...
java
public Set<Method> getMethods(final String name, final int numParams) { if (StringUtils.isNullOrBlank(name) || numParams < 0) { return Collections.emptySet(); } return ClassDescriptorCache.getInstance() .getClassDescriptor(clazz) ...
[ "public", "Set", "<", "Method", ">", "getMethods", "(", "final", "String", "name", ",", "final", "int", "numParams", ")", "{", "if", "(", "StringUtils", ".", "isNullOrBlank", "(", "name", ")", "||", "numParams", "<", "0", ")", "{", "return", "Collections...
Gets methods. @param name the name @param numParams the num params @return the methods
[ "Gets", "methods", "." ]
2cec08826f1fccd658694dd03abce10fc97618ec
https://github.com/dbracewell/mango/blob/2cec08826f1fccd658694dd03abce10fc97618ec/src/main/java/com/davidbracewell/reflection/Reflect.java#L335-L345
train
Get methods by name and number of parameters
Create a Java method that does the following: "Get methods by name and number of parameters".
Of course, here is the Java code you requested: ```java public Set<Method> getMethods(final String name, final int numParams) { if (StringUtils.isNullOrBlank(name) || numParams < 0) { return Collections.emptySet(); } return ClassDescriptorCache.getInstance() ...
pac4j/pac4j
pac4j-core/src/main/java/org/pac4j/core/client/Clients.java
Clients.updateIndirectClient
protected void updateIndirectClient(final IndirectClient client) { if (this.callbackUrl != null && client.getCallbackUrl() == null) { client.setCallbackUrl(this.callbackUrl); } if (this.urlResolver != null && client.getUrlResolver() == null) { client.setUrlResolver(this....
java
protected void updateIndirectClient(final IndirectClient client) { if (this.callbackUrl != null && client.getCallbackUrl() == null) { client.setCallbackUrl(this.callbackUrl); } if (this.urlResolver != null && client.getUrlResolver() == null) { client.setUrlResolver(this....
[ "protected", "void", "updateIndirectClient", "(", "final", "IndirectClient", "client", ")", "{", "if", "(", "this", ".", "callbackUrl", "!=", "null", "&&", "client", ".", "getCallbackUrl", "(", ")", "==", "null", ")", "{", "client", ".", "setCallbackUrl", "(...
Setup the indirect client. @param client the indirect client
[ "Setup", "the", "indirect", "client", "." ]
d9cd029f8783792b31dd48bf1e32f80628f2c4a3
https://github.com/pac4j/pac4j/blob/d9cd029f8783792b31dd48bf1e32f80628f2c4a3/pac4j-core/src/main/java/org/pac4j/core/client/Clients.java#L102-L115
train
Update the indirect client.
Create a Java method that does the following: "Update the indirect client.".
Of course, here is the Java code you requested: ```java protected void updateIndirectClient(final IndirectClient client) { if (this.callbackUrl != null && client.getCallbackUrl() == null) { client.setCallbackUrl(this.callbackUrl); } if (this.urlResolver != null && client.getUrlReso...
OpenLiberty/open-liberty
dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TxExecutionContextHandler.java
TxExecutionContextHandler.associate
public void associate(ExecutionContext ec, String providerId) throws WorkCompletedException { if (tc.isEntryEnabled()) Tr.entry(tc, "doAssociate", new Object[] { ec, providerId }); // Check that a transaction context is present if (null == ec) { final WorkCompletedExcept...
java
public void associate(ExecutionContext ec, String providerId) throws WorkCompletedException { if (tc.isEntryEnabled()) Tr.entry(tc, "doAssociate", new Object[] { ec, providerId }); // Check that a transaction context is present if (null == ec) { final WorkCompletedExcept...
[ "public", "void", "associate", "(", "ExecutionContext", "ec", ",", "String", "providerId", ")", "throws", "WorkCompletedException", "{", "if", "(", "tc", ".", "isEntryEnabled", "(", ")", ")", "Tr", ".", "entry", "(", "tc", ",", "\"doAssociate\"", ",", "new",...
/* (non-Javadoc) Associates an ExecutionContext with the current thread. This is called on the *dispatch thread*. @see com.ibm.ws.j2c.work.ExecutionContextHandler#associate(javax.resource.spi.work.ExecutionContext, java.lang.String)
[ "/", "*", "(", "non", "-", "Javadoc", ")", "Associates", "an", "ExecutionContext", "with", "the", "current", "thread", ".", "This", "is", "called", "on", "the", "*", "dispatch", "thread", "*", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.tx.core/src/com/ibm/tx/jta/impl/TxExecutionContextHandler.java#L50-L157
train
This method is called by the work unit to associate a transaction context with a specific provider.
Create a Java method that does the following: "This method is called by the work unit to associate a transaction context with a specific provider.".
Of course, here is the Java code you requested: ```java public void associate(ExecutionContext ec, String providerId) throws WorkCompletedException { if (tc.isEntryEnabled()) Tr.entry(tc, "doAssociate", new Object[] { ec, providerId }); // Check that a transaction context is present if (nu...
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java
BindM2MBuilder.generate
public static Pair<Set<GeneratedTypeElement>, Set<GeneratedTypeElement>> generate(Filer filer, M2MModel model) { entityResult.clear(); daoResult.clear(); BindM2MBuilder visitor = new BindM2MBuilder(filer); for (M2MEntity item : model.getEntities()) { visitor.generate(item); } Pair<Set<GeneratedType...
java
public static Pair<Set<GeneratedTypeElement>, Set<GeneratedTypeElement>> generate(Filer filer, M2MModel model) { entityResult.clear(); daoResult.clear(); BindM2MBuilder visitor = new BindM2MBuilder(filer); for (M2MEntity item : model.getEntities()) { visitor.generate(item); } Pair<Set<GeneratedType...
[ "public", "static", "Pair", "<", "Set", "<", "GeneratedTypeElement", ">", ",", "Set", "<", "GeneratedTypeElement", ">", ">", "generate", "(", "Filer", "filer", ",", "M2MModel", "model", ")", "{", "entityResult", ".", "clear", "(", ")", ";", "daoResult", "....
Generate. @param filer the filer @param model the model @return the pair @throws Exception the exception
[ "Generate", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/sqlite/BindM2MBuilder.java#L145-L160
train
Generate the entity and dao results.
Create a Java method that does the following: "Generate the entity and dao results.".
Of course, here is the Java code you requested: ```java public static Pair<Set<GeneratedTypeElement>, Set<GeneratedTypeElement>> generate(Filer filer, M2MModel model) { entityResult.clear(); daoResult.clear(); BindM2MBuilder visitor = new BindM2MBuilder(filer); for (M2MEntity item : model.getEntities()) {...
linkedin/dexmaker
dexmaker/src/main/java/com/android/dx/Code.java
Code.compareFloatingPoint
public <T extends Number> void compareFloatingPoint( Local<Integer> target, Local<T> a, Local<T> b, int nanValue) { Rop rop; if (nanValue == 1) { rop = Rops.opCmpg(a.type.ropType); } else if (nanValue == -1) { rop = Rops.opCmpl(a.type.ropType); } else ...
java
public <T extends Number> void compareFloatingPoint( Local<Integer> target, Local<T> a, Local<T> b, int nanValue) { Rop rop; if (nanValue == 1) { rop = Rops.opCmpg(a.type.ropType); } else if (nanValue == -1) { rop = Rops.opCmpl(a.type.ropType); } else ...
[ "public", "<", "T", "extends", "Number", ">", "void", "compareFloatingPoint", "(", "Local", "<", "Integer", ">", "target", ",", "Local", "<", "T", ">", "a", ",", "Local", "<", "T", ">", "b", ",", "int", "nanValue", ")", "{", "Rop", "rop", ";", "if"...
Compare floats or doubles. This stores -1 in {@code target} if {@code a < b}, 0 in {@code target} if {@code a == b} and 1 in target if {@code a > b}. This stores {@code nanValue} in {@code target} if either value is {@code NaN}.
[ "Compare", "floats", "or", "doubles", ".", "This", "stores", "-", "1", "in", "{" ]
c58ffebcbb2564c7d1fa6fb58b48f351c330296d
https://github.com/linkedin/dexmaker/blob/c58ffebcbb2564c7d1fa6fb58b48f351c330296d/dexmaker/src/main/java/com/android/dx/Code.java#L560-L572
train
Compare two Local objects.
Create a Java method that does the following: "Compare two Local objects.".
Of course, here is the Java code you requested: ```java public <T extends Number> void compareFloatingPoint( Local<Integer> target, Local<T> a, Local<T> b, int nanValue) { Rop rop; if (nanValue == 1) { rop = Rops.opCmpg(a.type.ropType); } else if (nanValue == -1) { ...
OpenLiberty/open-liberty
dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java
HtmlRendererUtils.decodeUIInput
public static void decodeUIInput(FacesContext facesContext, UIComponent component) { if (!(component instanceof EditableValueHolder)) { throw new IllegalArgumentException("Component " + component.getClientId(facesContext) + " is not an EditableValu...
java
public static void decodeUIInput(FacesContext facesContext, UIComponent component) { if (!(component instanceof EditableValueHolder)) { throw new IllegalArgumentException("Component " + component.getClientId(facesContext) + " is not an EditableValu...
[ "public", "static", "void", "decodeUIInput", "(", "FacesContext", "facesContext", ",", "UIComponent", "component", ")", "{", "if", "(", "!", "(", "component", "instanceof", "EditableValueHolder", ")", ")", "{", "throw", "new", "IllegalArgumentException", "(", "\"C...
Utility to set the submitted value of the provided component from the data in the current request object. <p/> Param component is required to be an EditableValueHolder. On return from this method, the component's submittedValue property will be set if the submitted form contained that component.
[ "Utility", "to", "set", "the", "submitted", "value", "of", "the", "provided", "component", "from", "the", "data", "in", "the", "current", "request", "object", ".", "<p", "/", ">", "Param", "component", "is", "required", "to", "be", "an", "EditableValueHolder...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jsf.2.2/src/org/apache/myfaces/shared/renderkit/html/HtmlRendererUtils.java#L107-L132
train
This method is called to decode the UIInput of a EditableValueHolder.
Create a Java method that does the following: "This method is called to decode the UIInput of a EditableValueHolder.".
Of course, here is the Java code you requested: ```java public static void decodeUIInput(FacesContext facesContext, UIComponent component) { if (!(component instanceof EditableValueHolder)) { throw new IllegalArgumentException("Component " + component.getClientId(fac...
stratosphere/stratosphere
stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/cluster/ClusterManager.java
ClusterManager.matchHardwareDescriptionWithInstanceType
private InstanceType matchHardwareDescriptionWithInstanceType(final HardwareDescription hardwareDescription) { // Assumes that the available instance types are ordered by number of CPU cores in descending order for (int i = 0; i < this.availableInstanceTypes.length; i++) { final InstanceType candidateInstanceT...
java
private InstanceType matchHardwareDescriptionWithInstanceType(final HardwareDescription hardwareDescription) { // Assumes that the available instance types are ordered by number of CPU cores in descending order for (int i = 0; i < this.availableInstanceTypes.length; i++) { final InstanceType candidateInstanceT...
[ "private", "InstanceType", "matchHardwareDescriptionWithInstanceType", "(", "final", "HardwareDescription", "hardwareDescription", ")", "{", "// Assumes that the available instance types are ordered by number of CPU cores in descending order", "for", "(", "int", "i", "=", "0", ";", ...
Attempts to match the hardware characteristics provided by the {@link HardwareDescription} object with one of the instance types set in the configuration. The matching is pessimistic, i.e. the hardware characteristics of the chosen instance type never exceed the actually reported characteristics from the hardware descr...
[ "Attempts", "to", "match", "the", "hardware", "characteristics", "provided", "by", "the", "{", "@link", "HardwareDescription", "}", "object", "with", "one", "of", "the", "instance", "types", "set", "in", "the", "configuration", ".", "The", "matching", "is", "p...
c543a08f9676c5b2b0a7088123bd6e795a8ae0c8
https://github.com/stratosphere/stratosphere/blob/c543a08f9676c5b2b0a7088123bd6e795a8ae0c8/stratosphere-runtime/src/main/java/eu/stratosphere/nephele/instance/cluster/ClusterManager.java#L477-L502
train
Checks if the available instance types match with the hardware description.
Create a Java method that does the following: "Checks if the available instance types match with the hardware description.".
Of course, here is the Java code you requested: ```java private InstanceType matchHardwareDescriptionWithInstanceType(final HardwareDescription hardwareDescription) { // Assumes that the available instance types are ordered by number of CPU cores in descending order for (int i = 0; i < this.availableInstanceTypes...
lionsoul2014/jcseg
jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java
IStringBuffer.set
public void set(int idx, char chr) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); buff[idx] = chr; }
java
public void set(int idx, char chr) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); buff[idx] = chr; }
[ "public", "void", "set", "(", "int", "idx", ",", "char", "chr", ")", "{", "if", "(", "idx", "<", "0", ")", "throw", "new", "IndexOutOfBoundsException", "(", "\"idx < 0\"", ")", ";", "if", "(", "idx", ">=", "count", ")", "throw", "new", "IndexOutOfBound...
set the char at the specified index @param idx @param chr
[ "set", "the", "char", "at", "the", "specified", "index" ]
7c8a912e3bbcaf4f8de701180b9c24e2e444a94b
https://github.com/lionsoul2014/jcseg/blob/7c8a912e3bbcaf4f8de701180b9c24e2e444a94b/jcseg-core/src/main/java/org/lionsoul/jcseg/util/IStringBuffer.java#L320-L328
train
Sets the value of the specified surrogate character in the buffer.
Create a Java method that does the following: "Sets the value of the specified surrogate character in the buffer.".
Of course, here is the Java code you requested: ```java public void set(int idx, char chr) { if ( idx < 0 ) throw new IndexOutOfBoundsException("idx < 0"); if ( idx >= count ) throw new IndexOutOfBoundsException("idx >= buffer.length"); buff[idx] = chr; ...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/SourceStream.java
SourceStream.writeSilenceForced
public void writeSilenceForced(TickRange vtr) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeSilenceForced", new Object[] { vtr }); long start = vtr.startstamp; long end = vtr.endstamp; if (TraceComponent.isAnyTracing...
java
public void writeSilenceForced(TickRange vtr) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeSilenceForced", new Object[] { vtr }); long start = vtr.startstamp; long end = vtr.endstamp; if (TraceComponent.isAnyTracing...
[ "public", "void", "writeSilenceForced", "(", "TickRange", "vtr", ")", "throws", "SIResourceException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this",...
This method uses a Value TickRange to write Silence into the stream, because a message has expired before it was sent and so needs to be removed from the stream It forces the stream to be updated to Silence without checking the existing state @param m The value tickRange
[ "This", "method", "uses", "a", "Value", "TickRange", "to", "write", "Silence", "into", "the", "stream", "because", "a", "message", "has", "expired", "before", "it", "was", "sent", "and", "so", "needs", "to", "be", "removed", "from", "the", "stream", "It", ...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.runtime/src/com/ibm/ws/sib/processor/gd/SourceStream.java#L712-L759
train
This method is called by the SIBLK stream when a message is Silenced.
Create a Java method that does the following: "This method is called by the SIBLK stream when a message is Silenced.".
Of course, here is the Java code you requested: ```java public void writeSilenceForced(TickRange vtr) throws SIResourceException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "writeSilenceForced", new Object[] { vtr }); long start = vtr.startstamp; long e...
liferay/com-liferay-commerce
commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDefinitionInventoryPersistenceImpl.java
CPDefinitionInventoryPersistenceImpl.findAll
@Override public List<CPDefinitionInventory> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
java
@Override public List<CPDefinitionInventory> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); }
[ "@", "Override", "public", "List", "<", "CPDefinitionInventory", ">", "findAll", "(", ")", "{", "return", "findAll", "(", "QueryUtil", ".", "ALL_POS", ",", "QueryUtil", ".", "ALL_POS", ",", "null", ")", ";", "}" ]
Returns all the cp definition inventories. @return the cp definition inventories
[ "Returns", "all", "the", "cp", "definition", "inventories", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-service/src/main/java/com/liferay/commerce/service/persistence/impl/CPDefinitionInventoryPersistenceImpl.java#L2331-L2334
train
Returns all the cp definition inventories.
Create a Java method that does the following: "Returns all the cp definition inventories.".
Of course, here is the Java code you requested: ```java @Override public List<CPDefinitionInventory> findAll() { return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null); } ``` Hope this helps!
cdk/cdk
misc/extra/src/main/java/org/openscience/cdk/tools/GridGenerator.java
GridGenerator.generateGrid
public void generateGrid() { minx = minx - extendGrid; maxx = maxx + extendGrid; miny = miny - extendGrid; maxy = maxy + extendGrid; minz = minz - extendGrid; maxz = maxz + extendGrid; dim[0] = (int) Math.round(Math.abs(maxx - minx) / latticeConstant); di...
java
public void generateGrid() { minx = minx - extendGrid; maxx = maxx + extendGrid; miny = miny - extendGrid; maxy = maxy + extendGrid; minz = minz - extendGrid; maxz = maxz + extendGrid; dim[0] = (int) Math.round(Math.abs(maxx - minx) / latticeConstant); di...
[ "public", "void", "generateGrid", "(", ")", "{", "minx", "=", "minx", "-", "extendGrid", ";", "maxx", "=", "maxx", "+", "extendGrid", ";", "miny", "=", "miny", "-", "extendGrid", ";", "maxy", "=", "maxy", "+", "extendGrid", ";", "minz", "=", "minz", ...
Main method creates a grid between given boundaries (dimensions). The grid my be extended over the given boundaries with the variable extendGrid.
[ "Main", "method", "creates", "a", "grid", "between", "given", "boundaries", "(", "dimensions", ")", ".", "The", "grid", "my", "be", "extended", "over", "the", "given", "boundaries", "with", "the", "variable", "extendGrid", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/misc/extra/src/main/java/org/openscience/cdk/tools/GridGenerator.java#L125-L138
train
Generate the grid of the log2 files.
Create a Java method that does the following: "Generate the grid of the log2 files.".
Of course, here is the Java code you requested: ```java public void generateGrid() { minx = minx - extendGrid; maxx = maxx + extendGrid; miny = miny - extendGrid; maxy = maxy + extendGrid; minz = minz - extendGrid; maxz = maxz + extendGrid; dim[0] = (int) Math.r...
netscaler/nitro
src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiuspolicy_vpnglobal_binding.java
authenticationradiuspolicy_vpnglobal_binding.get
public static authenticationradiuspolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_vpnglobal_binding obj = new authenticationradiuspolicy_vpnglobal_binding(); obj.set_name(name); authenticationradiuspolicy_vpnglobal_binding response[] = (authenticatio...
java
public static authenticationradiuspolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_vpnglobal_binding obj = new authenticationradiuspolicy_vpnglobal_binding(); obj.set_name(name); authenticationradiuspolicy_vpnglobal_binding response[] = (authenticatio...
[ "public", "static", "authenticationradiuspolicy_vpnglobal_binding", "[", "]", "get", "(", "nitro_service", "service", ",", "String", "name", ")", "throws", "Exception", "{", "authenticationradiuspolicy_vpnglobal_binding", "obj", "=", "new", "authenticationradiuspolicy_vpnglob...
Use this API to fetch authenticationradiuspolicy_vpnglobal_binding resources of given name .
[ "Use", "this", "API", "to", "fetch", "authenticationradiuspolicy_vpnglobal_binding", "resources", "of", "given", "name", "." ]
2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4
https://github.com/netscaler/nitro/blob/2a98692dcf4e4ec430c7d7baab8382e4ba5a35e4/src/main/java/com/citrix/netscaler/nitro/resource/config/authentication/authenticationradiuspolicy_vpnglobal_binding.java#L132-L137
train
Use this API to fetch authenticationradiuspolicy_vpnglobal_binding resources of given name.
Create a Java method that does the following: "Use this API to fetch authenticationradiuspolicy_vpnglobal_binding resources of given name.".
Of course, here is the Java code you requested: ```java public static authenticationradiuspolicy_vpnglobal_binding[] get(nitro_service service, String name) throws Exception{ authenticationradiuspolicy_vpnglobal_binding obj = new authenticationradiuspolicy_vpnglobal_binding(); obj.set_name(name); authenticationr...
Netflix/governator
governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java
Grapher.graph
public String graph() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(baos); Injector localInjector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher renderer = localInjector.getInstance(GraphvizGrapher.class); ...
java
public String graph() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(baos); Injector localInjector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher renderer = localInjector.getInstance(GraphvizGrapher.class); ...
[ "public", "String", "graph", "(", ")", "throws", "Exception", "{", "ByteArrayOutputStream", "baos", "=", "new", "ByteArrayOutputStream", "(", ")", ";", "PrintWriter", "out", "=", "new", "PrintWriter", "(", "baos", ")", ";", "Injector", "localInjector", "=", "G...
Returns a String containing the "Dot" graph definition. @return the "Dot" graph definition
[ "Returns", "a", "String", "containing", "the", "Dot", "graph", "definition", "." ]
c1f4bb1518e759c61f2e9cad8a896ec6beba0294
https://github.com/Netflix/governator/blob/c1f4bb1518e759c61f2e9cad8a896ec6beba0294/governator-legacy/src/main/java/com/netflix/governator/guice/Grapher.java#L146-L158
train
Graphviz implementation of the class.
Create a Java method that does the following: "Graphviz implementation of the class.".
Of course, here is the Java code you requested: ```java public String graph() throws Exception { ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintWriter out = new PrintWriter(baos); Injector localInjector = Guice.createInjector(new GraphvizModule()); GraphvizGrapher render...
MGunlogson/CuckooFilter4J
src/main/java/com/github/mgunlogson/cuckoofilter4j/CuckooFilter.java
CuckooFilter.put
public boolean put(T item) { BucketAndTag pos = hasher.generate(item); long curTag = pos.tag; long curIndex = pos.index; long altIndex = hasher.altIndex(curIndex, curTag); bucketLocker.lockBucketsWrite(curIndex, altIndex); try { if (table.insertToBucket(curIndex, curTag) || table.insertToBucket(al...
java
public boolean put(T item) { BucketAndTag pos = hasher.generate(item); long curTag = pos.tag; long curIndex = pos.index; long altIndex = hasher.altIndex(curIndex, curTag); bucketLocker.lockBucketsWrite(curIndex, altIndex); try { if (table.insertToBucket(curIndex, curTag) || table.insertToBucket(al...
[ "public", "boolean", "put", "(", "T", "item", ")", "{", "BucketAndTag", "pos", "=", "hasher", ".", "generate", "(", "item", ")", ";", "long", "curTag", "=", "pos", ".", "tag", ";", "long", "curIndex", "=", "pos", ".", "index", ";", "long", "altIndex"...
Puts an element into this {@code CuckooFilter}. Ensures that subsequent invocations of {@link #mightContain(Object)} with the same element will always return {@code true}. <p> Note that the filter should be considered full after insertion failure. Further inserts <i>may</i> fail, although deleting items can also make t...
[ "Puts", "an", "element", "into", "this", "{", "@code", "CuckooFilter", "}", ".", "Ensures", "that", "subsequent", "invocations", "of", "{", "@link", "#mightContain", "(", "Object", ")", "}", "with", "the", "same", "element", "will", "always", "return", "{", ...
e8472aa150b201f05046d1c81cac5a5ca4348db8
https://github.com/MGunlogson/CuckooFilter4J/blob/e8472aa150b201f05046d1c81cac5a5ca4348db8/src/main/java/com/github/mgunlogson/cuckoofilter4j/CuckooFilter.java#L413-L456
train
Inserts the specified item into the table.
Create a Java method that does the following: "Inserts the specified item into the table.".
Of course, here is the Java code you requested: ```java public boolean put(T item) { BucketAndTag pos = hasher.generate(item); long curTag = pos.tag; long curIndex = pos.index; long altIndex = hasher.altIndex(curIndex, curTag); bucketLocker.lockBucketsWrite(curIndex, altIndex); try { if (table.in...
census-instrumentation/opencensus-java
api/src/main/java/io/opencensus/trace/TraceOptions.java
TraceOptions.fromLowerBase16
public static TraceOptions fromLowerBase16(CharSequence src, int srcOffset) { return new TraceOptions(BigendianEncoding.byteFromBase16String(src, srcOffset)); }
java
public static TraceOptions fromLowerBase16(CharSequence src, int srcOffset) { return new TraceOptions(BigendianEncoding.byteFromBase16String(src, srcOffset)); }
[ "public", "static", "TraceOptions", "fromLowerBase16", "(", "CharSequence", "src", ",", "int", "srcOffset", ")", "{", "return", "new", "TraceOptions", "(", "BigendianEncoding", ".", "byteFromBase16String", "(", "src", ",", "srcOffset", ")", ")", ";", "}" ]
Returns a {@code TraceOption} built from a lowercase base16 representation. @param src the lowercase base16 representation. @param srcOffset the offset in the buffer where the representation of the {@code TraceOptions} begins. @return a {@code TraceOption} built from a lowercase base16 representation. @throws NullPoin...
[ "Returns", "a", "{", "@code", "TraceOption", "}", "built", "from", "a", "lowercase", "base16", "representation", "." ]
deefac9bed77e40a2297bff1ca5ec5aa48a5f755
https://github.com/census-instrumentation/opencensus-java/blob/deefac9bed77e40a2297bff1ca5ec5aa48a5f755/api/src/main/java/io/opencensus/trace/TraceOptions.java#L131-L133
train
Creates a TraceOptions object from a Base16 encoded string.
Create a Java method that does the following: "Creates a TraceOptions object from a Base16 encoded string.".
Of course, here is the Java code you requested: ```java public static TraceOptions fromLowerBase16(CharSequence src, int srcOffset) { return new TraceOptions(BigendianEncoding.byteFromBase16String(src, srcOffset)); } ``` Hope this helps!
google/error-prone
check_api/src/main/java/com/google/errorprone/util/FindIdentifiers.java
FindIdentifiers.findUnusedIdentifiers
public static ImmutableSet<VarSymbol> findUnusedIdentifiers(VisitorState state) { ImmutableSet.Builder<VarSymbol> definedVariables = ImmutableSet.builder(); ImmutableSet.Builder<Symbol> usedSymbols = ImmutableSet.builder(); Tree prev = state.getPath().getLeaf(); for (Tree curr : state.getPath().getParen...
java
public static ImmutableSet<VarSymbol> findUnusedIdentifiers(VisitorState state) { ImmutableSet.Builder<VarSymbol> definedVariables = ImmutableSet.builder(); ImmutableSet.Builder<Symbol> usedSymbols = ImmutableSet.builder(); Tree prev = state.getPath().getLeaf(); for (Tree curr : state.getPath().getParen...
[ "public", "static", "ImmutableSet", "<", "VarSymbol", ">", "findUnusedIdentifiers", "(", "VisitorState", "state", ")", "{", "ImmutableSet", ".", "Builder", "<", "VarSymbol", ">", "definedVariables", "=", "ImmutableSet", ".", "builder", "(", ")", ";", "ImmutableSet...
Finds all variable declarations which are unused at this point in the AST (i.e. they might be used further on).
[ "Finds", "all", "variable", "declarations", "which", "are", "unused", "at", "this", "point", "in", "the", "AST", "(", "i", ".", "e", ".", "they", "might", "be", "used", "further", "on", ")", "." ]
fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/util/FindIdentifiers.java#L237-L269
train
Find unused identifiers.
Create a Java method that does the following: "Find unused identifiers.".
Of course, here is the Java code you requested: ```java public static ImmutableSet<VarSymbol> findUnusedIdentifiers(VisitorState state) { ImmutableSet.Builder<VarSymbol> definedVariables = ImmutableSet.builder(); ImmutableSet.Builder<Symbol> usedSymbols = ImmutableSet.builder(); Tree prev = state.getPath()...
cologneintelligence/FitGoodies
fitgoodies-mail/src/main/java/de/cologneintelligence/fitgoodies/mail/SetupFixture.java
SetupFixture.ssl
public void ssl(final String ssl) { DependencyManager.getOrCreate(SetupHelper.class) .setSSL(BooleanTypeHandler.parseBool(ssl)); }
java
public void ssl(final String ssl) { DependencyManager.getOrCreate(SetupHelper.class) .setSSL(BooleanTypeHandler.parseBool(ssl)); }
[ "public", "void", "ssl", "(", "final", "String", "ssl", ")", "{", "DependencyManager", ".", "getOrCreate", "(", "SetupHelper", ".", "class", ")", ".", "setSSL", "(", "BooleanTypeHandler", ".", "parseBool", "(", "ssl", ")", ")", ";", "}" ]
Sets the SSL parameter of the mail {@link SetupHelper}. @param ssl indicates whether SSL shall be used @see SetupHelper#setSSL(boolean) SetupHelper.setSSL(boolean)
[ "Sets", "the", "SSL", "parameter", "of", "the", "mail", "{", "@link", "SetupHelper", "}", "." ]
834e42d1f41b4b9226060b1e83a80cc69ea88c7b
https://github.com/cologneintelligence/FitGoodies/blob/834e42d1f41b4b9226060b1e83a80cc69ea88c7b/fitgoodies-mail/src/main/java/de/cologneintelligence/fitgoodies/mail/SetupFixture.java#L125-L128
test
Sets the SSL flag.
Create a Java method that does the following: "Sets the SSL flag.".
Of course, here is the Java code you requested: ```java public void ssl(final String ssl) { DependencyManager.getOrCreate(SetupHelper.class) .setSSL(BooleanTypeHandler.parseBool(ssl)); } ``` Hope this helps!
VoltDB/voltdb
src/frontend/org/voltdb/parser/SQLLexer.java
SQLLexer.matchesStringAtIndex
static private boolean matchesStringAtIndex(char[] buf, int index, String str) { int strLength = str.length(); if (index + strLength > buf.length) { return false; } for (int i = 0; i < strLength; ++i) { if (buf[index + i] != str.charAt(i)) { retur...
java
static private boolean matchesStringAtIndex(char[] buf, int index, String str) { int strLength = str.length(); if (index + strLength > buf.length) { return false; } for (int i = 0; i < strLength; ++i) { if (buf[index + i] != str.charAt(i)) { retur...
[ "static", "private", "boolean", "matchesStringAtIndex", "(", "char", "[", "]", "buf", ",", "int", "index", ",", "String", "str", ")", "{", "int", "strLength", "=", "str", ".", "length", "(", ")", ";", "if", "(", "index", "+", "strLength", ">", "buf", ...
Determine if a character buffer contains the specified string a the specified index. Avoids an array index exception if the buffer is too short. @param buf a character buffer @param index an offset into the buffer @param str the string to look for @return true if the buffer contains the specified string
[ "Determine", "if", "a", "character", "buffer", "contains", "the", "specified", "string", "a", "the", "specified", "index", ".", "Avoids", "an", "array", "index", "exception", "if", "the", "buffer", "is", "too", "short", "." ]
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/frontend/org/voltdb/parser/SQLLexer.java#L395-L408
train
Checks if a string matches the specified string at the specified index.
Create a Java method that does the following: "Checks if a string matches the specified string at the specified index.".
Of course, here is the Java code you requested: ```java static private boolean matchesStringAtIndex(char[] buf, int index, String str) { int strLength = str.length(); if (index + strLength > buf.length) { return false; } for (int i = 0; i < strLength; ++i) { if ...
socialize/socialize-sdk-android
sdk/src/com/socialize/SocializeServiceImpl.java
SocializeServiceImpl.isAuthenticatedForWrite
@Override public boolean isAuthenticatedForWrite(AuthProviderType providerType, String...permissions) { return isAuthenticated(providerType, false, permissions); }
java
@Override public boolean isAuthenticatedForWrite(AuthProviderType providerType, String...permissions) { return isAuthenticated(providerType, false, permissions); }
[ "@", "Override", "public", "boolean", "isAuthenticatedForWrite", "(", "AuthProviderType", "providerType", ",", "String", "...", "permissions", ")", "{", "return", "isAuthenticated", "(", "providerType", ",", "false", ",", "permissions", ")", ";", "}" ]
/* (non-Javadoc) @see com.socialize.SocializeService#isAuthenticatedForWrite(com.socialize.auth.AuthProviderType)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
23044d66c83718fe5c3f6f4b7b4033ac5b06fbee
https://github.com/socialize/socialize-sdk-android/blob/23044d66c83718fe5c3f6f4b7b4033ac5b06fbee/sdk/src/com/socialize/SocializeServiceImpl.java#L777-L780
valid
Returns true if the user is authenticated for write.
Create a Java method that does the following: "Returns true if the user is authenticated for write.".
Of course, here is the Java code you requested: ```java @Override public boolean isAuthenticatedForWrite(AuthProviderType providerType, String...permissions) { return isAuthenticated(providerType, false, permissions); } ``` Hope this helps!
Unidata/thredds
dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java
ChunkWriter.write
@Override public void write(byte[] b, int off, int len) throws IOException { verifystate(); if(writecount + len >= writelimit) throw new DapException("Attempt to write too much data: limit=" + writecount + len) .setCode(DapCodes.SC_REQUESTED_RANGE_NOT_...
java
@Override public void write(byte[] b, int off, int len) throws IOException { verifystate(); if(writecount + len >= writelimit) throw new DapException("Attempt to write too much data: limit=" + writecount + len) .setCode(DapCodes.SC_REQUESTED_RANGE_NOT_...
[ "@", "Override", "public", "void", "write", "(", "byte", "[", "]", "b", ",", "int", "off", ",", "int", "len", ")", "throws", "IOException", "{", "verifystate", "(", ")", ";", "if", "(", "writecount", "+", "len", ">=", "writelimit", ")", "throw", "new...
Writes len bytes from the specified byte array starting at offset off to this output stream. <p> If this write fills up the chunk buffer, then write out the buffer and put the remaining bytes into the reset buffer. @param b the data @param off start point in b from which to write data @param len number of bytes to w...
[ "Writes", "len", "bytes", "from", "the", "specified", "byte", "array", "starting", "at", "offset", "off", "to", "this", "output", "stream", ".", "<p", ">", "If", "this", "write", "fills", "up", "the", "chunk", "buffer", "then", "write", "out", "the", "bu...
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/dap4/d4servlet/src/main/java/dap4/servlet/ChunkWriter.java#L450-L483
test
Write a block of bytes to the DAP file.
Create a Java method that does the following: "Write a block of bytes to the DAP file.".
Of course, here is the Java code you requested: ```java @Override public void write(byte[] b, int off, int len) throws IOException { verifystate(); if(writecount + len >= writelimit) throw new DapException("Attempt to write too much data: limit=" + writecount + len) ...
nyla-solutions/gedi-geode
gedi-geode-rest-app/src/main/java/gedi/solutions/geode/rest/app/GeodeRegionRestService.java
GeodeRegionRestService.putEntry
@PostMapping(path = "{region}/{type}/{key}",produces = "application/json") public String putEntry(@PathVariable String region ,@PathVariable String type, @PathVariable String key, @RequestBody String value) throws Exception { if(region == null || region.length() == 0 || key == null || value ==null) return n...
java
@PostMapping(path = "{region}/{type}/{key}",produces = "application/json") public String putEntry(@PathVariable String region ,@PathVariable String type, @PathVariable String key, @RequestBody String value) throws Exception { if(region == null || region.length() == 0 || key == null || value ==null) return n...
[ "@", "PostMapping", "(", "path", "=", "\"{region}/{type}/{key}\"", ",", "produces", "=", "\"application/json\"", ")", "public", "String", "putEntry", "(", "@", "PathVariable", "String", "region", ",", "@", "PathVariable", "String", "type", ",", "@", "PathVariable"...
Put a new records @param region the region name @param type teh class name type @param key the region key @param value the region value @return previous Region values in JSON @throws Exception when an unknown error occurs
[ "Put", "a", "new", "records" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-rest-app/src/main/java/gedi/solutions/geode/rest/app/GeodeRegionRestService.java#L54-L88
test
PUT entry in a Galaxy Region
Create a Java method that does the following: "PUT entry in a Galaxy Region".
Of course, here is the Java code you requested: ```java @PostMapping(path = "{region}/{type}/{key}",produces = "application/json") public String putEntry(@PathVariable String region ,@PathVariable String type, @PathVariable String key, @RequestBody String value) throws Exception { if(region == null || region....
nyla-solutions/nyla
nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java
Organizer.findMapValueByKey
public static Object findMapValueByKey(Object key, Map<?, ?> map, Object defaultValue) { if (key == null || map == null) return defaultValue; Object value = map.get(key); if (value == null) return defaultValue; return value; }
java
public static Object findMapValueByKey(Object key, Map<?, ?> map, Object defaultValue) { if (key == null || map == null) return defaultValue; Object value = map.get(key); if (value == null) return defaultValue; return value; }
[ "public", "static", "Object", "findMapValueByKey", "(", "Object", "key", ",", "Map", "<", "?", ",", "?", ">", "map", ",", "Object", "defaultValue", ")", "{", "if", "(", "key", "==", "null", "||", "map", "==", "null", ")", "return", "defaultValue", ";",...
Find the value with a given key in the map. @param key the map key @param map the map with key/value pairs @param defaultValue this is returned if the value is now found @return the single value found
[ "Find", "the", "value", "with", "a", "given", "key", "in", "the", "map", "." ]
38d5b843c76eae9762bbca20453ed0f0ad8412a9
https://github.com/nyla-solutions/nyla/blob/38d5b843c76eae9762bbca20453ed0f0ad8412a9/nyla.solutions.core/src/main/java/nyla/solutions/core/util/Organizer.java#L455-L467
train
Returns the value of the Link object property with the specified key in the given map. If the map is null or the key does not exist or the value for the key is null the defaultValue is returned.
Create a Java method that does the following: "Returns the value of the Link object property with the specified key in the given map. If the map is null or the key does not exist or the value for the key is null the defaultValue is returned.".
Of course, here is the Java code you requested: ```java public static Object findMapValueByKey(Object key, Map<?, ?> map, Object defaultValue) { if (key == null || map == null) return defaultValue; Object value = map.get(key); if (value == null) return defaultValue; return value; } ``` ...
sai-pullabhotla/catatumbo
src/main/java/com/jmethods/catatumbo/impl/DefaultDatastoreWriter.java
DefaultDatastoreWriter.deleteByKey
public void deleteByKey(DatastoreKey key) { try { nativeWriter.delete(key.nativeKey()); } catch (DatastoreException exp) { throw DatastoreUtils.wrap(exp); } }
java
public void deleteByKey(DatastoreKey key) { try { nativeWriter.delete(key.nativeKey()); } catch (DatastoreException exp) { throw DatastoreUtils.wrap(exp); } }
[ "public", "void", "deleteByKey", "(", "DatastoreKey", "key", ")", "{", "try", "{", "nativeWriter", ".", "delete", "(", "key", ".", "nativeKey", "(", ")", ")", ";", "}", "catch", "(", "DatastoreException", "exp", ")", "{", "throw", "DatastoreUtils", ".", ...
Deletes an entity given its key. @param key the entity's key @throws EntityManagerException if any error occurs while deleting.
[ "Deletes", "an", "entity", "given", "its", "key", "." ]
96d4c6dce3a5009624f7112a398406914dd19165
https://github.com/sai-pullabhotla/catatumbo/blob/96d4c6dce3a5009624f7112a398406914dd19165/src/main/java/com/jmethods/catatumbo/impl/DefaultDatastoreWriter.java#L531-L537
train
Delete a single entity from the underlying store.
Create a Java method that does the following: "Delete a single entity from the underlying store.".
Of course, here is the Java code you requested: ```java public void deleteByKey(DatastoreKey key) { try { nativeWriter.delete(key.nativeKey()); } catch (DatastoreException exp) { throw DatastoreUtils.wrap(exp); } } ``` Hope this helps!