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
anotheria/moskito
moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java
Storage.createHashtableStorage
public static <K,V> Storage<K,V> createHashtableStorage(){ return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>())); }
java
public static <K,V> Storage<K,V> createHashtableStorage(){ return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>())); }
[ "public", "static", "<", "K", ",", "V", ">", "Storage", "<", "K", ",", "V", ">", "createHashtableStorage", "(", ")", "{", "return", "new", "Storage", "<", "K", ",", "V", ">", "(", "new", "MapStorageWrapper", "<", "K", ",", "V", ">", "(", "new", "...
Factory method to create a new storage backed by a hashtable. @param <K> @param <V> @return
[ "Factory", "method", "to", "create", "a", "new", "storage", "backed", "by", "a", "hashtable", "." ]
0fdb79053b98a6ece610fa159f59bc3331e4cf05
https://github.com/anotheria/moskito/blob/0fdb79053b98a6ece610fa159f59bc3331e4cf05/moskito-core/src/main/java/net/anotheria/moskito/core/util/storage/Storage.java#L372-L374
train
Creates a hashtable storage.
Create a Java method that does the following: "Creates a hashtable storage.".
Of course, here is the Java code you requested: ```java public static <K,V> Storage<K,V> createHashtableStorage(){ return new Storage<K,V>(new MapStorageWrapper<K, V>(new HashMap<K, V>())); } ``` Hope this helps!
spring-projects/spring-boot
spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java
Restarter.restart
public void restart(FailureHandler failureHandler) { if (!this.enabled) { this.logger.debug("Application restart is disabled"); return; } this.logger.debug("Restarting application"); getLeakSafeThread().call(() -> { Restarter.this.stop(); Restarter.this.start(failureHandler); return null; }); ...
java
public void restart(FailureHandler failureHandler) { if (!this.enabled) { this.logger.debug("Application restart is disabled"); return; } this.logger.debug("Restarting application"); getLeakSafeThread().call(() -> { Restarter.this.stop(); Restarter.this.start(failureHandler); return null; }); ...
[ "public", "void", "restart", "(", "FailureHandler", "failureHandler", ")", "{", "if", "(", "!", "this", ".", "enabled", ")", "{", "this", ".", "logger", ".", "debug", "(", "\"Application restart is disabled\"", ")", ";", "return", ";", "}", "this", ".", "l...
Restart the running application. @param failureHandler a failure handler to deal with application that doesn't start
[ "Restart", "the", "running", "application", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-devtools/src/main/java/org/springframework/boot/devtools/restart/Restarter.java#L245-L256
train
Restart the application.
Create a Java method that does the following: "Restart the application.".
Of course, here is the Java code you requested: ```java public void restart(FailureHandler failureHandler) { if (!this.enabled) { this.logger.debug("Application restart is disabled"); return; } this.logger.debug("Restarting application"); getLeakSafeThread().call(() -> { Restarter.this.stop(); Rest...
tony19/logback-android
logback-android/src/main/java/ch/qos/logback/core/net/QueueFactory.java
QueueFactory.newLinkedBlockingDeque
public <E> LinkedBlockingDeque<E> newLinkedBlockingDeque(int capacity) { final int actualCapacity = capacity < 1 ? 1 : capacity; return new LinkedBlockingDeque<E>(actualCapacity); }
java
public <E> LinkedBlockingDeque<E> newLinkedBlockingDeque(int capacity) { final int actualCapacity = capacity < 1 ? 1 : capacity; return new LinkedBlockingDeque<E>(actualCapacity); }
[ "public", "<", "E", ">", "LinkedBlockingDeque", "<", "E", ">", "newLinkedBlockingDeque", "(", "int", "capacity", ")", "{", "final", "int", "actualCapacity", "=", "capacity", "<", "1", "?", "1", ":", "capacity", ";", "return", "new", "LinkedBlockingDeque", "<...
Creates a new {@link LinkedBlockingDeque} with the given {@code capacity}. In case the given capacity is smaller than one it will automatically be converted to one. @param capacity the capacity to use for the queue @param <E> the type of elements held in the queue @return a new instance of {@link ArrayBlockingQueue}
[ "Creates", "a", "new", "{", "@link", "LinkedBlockingDeque", "}", "with", "the", "given", "{", "@code", "capacity", "}", ".", "In", "case", "the", "given", "capacity", "is", "smaller", "than", "one", "it", "will", "automatically", "be", "converted", "to", "...
028489c11ccfc1237a53923db06f22a90b41809c
https://github.com/tony19/logback-android/blob/028489c11ccfc1237a53923db06f22a90b41809c/logback-android/src/main/java/ch/qos/logback/core/net/QueueFactory.java#L37-L40
test
Creates a new empty LinkedBlockingDeque with the specified capacity.
Create a Java method that does the following: "Creates a new empty LinkedBlockingDeque with the specified capacity.".
Of course, here is the Java code you requested: ```java public <E> LinkedBlockingDeque<E> newLinkedBlockingDeque(int capacity) { final int actualCapacity = capacity < 1 ? 1 : capacity; return new LinkedBlockingDeque<E>(actualCapacity); } ``` Hope this helps!
beangle/beangle3
commons/model/src/main/java/org/beangle/commons/transfer/csv/CsvItemReader.java
CsvItemReader.readTitle
public String[] readTitle() { try { reader.readLine(); return Strings.split(reader.readLine(), ","); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
java
public String[] readTitle() { try { reader.readLine(); return Strings.split(reader.readLine(), ","); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } }
[ "public", "String", "[", "]", "readTitle", "(", ")", "{", "try", "{", "reader", ".", "readLine", "(", ")", ";", "return", "Strings", ".", "split", "(", "reader", ".", "readLine", "(", ")", ",", "\",\"", ")", ";", "}", "catch", "(", "Exception", "e"...
<p> readTitle. </p> @return an array of {@link java.lang.String} objects.
[ "<p", ">", "readTitle", ".", "<", "/", "p", ">" ]
33df2873a5f38e28ac174a1d3b8144eb2f808e64
https://github.com/beangle/beangle3/blob/33df2873a5f38e28ac174a1d3b8144eb2f808e64/commons/model/src/main/java/org/beangle/commons/transfer/csv/CsvItemReader.java#L83-L90
train
Read the title.
Create a Java method that does the following: "Read the title.".
Of course, here is the Java code you requested: ```java public String[] readTitle() { try { reader.readLine(); return Strings.split(reader.readLine(), ","); } catch (Exception e) { throw new RuntimeException(e.getMessage()); } } ``` Hope this helps!
google/error-prone-javac
src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java
TypeAnnotationPosition.newObj
public static TypeAnnotationPosition newObj(final List<TypePathEntry> location, final JCLambda onLambda, final int pos) { return new TypeAnnotationPosition(TargetType.NEW, pos, Integer.MIN_VALUE, onLambda, ...
java
public static TypeAnnotationPosition newObj(final List<TypePathEntry> location, final JCLambda onLambda, final int pos) { return new TypeAnnotationPosition(TargetType.NEW, pos, Integer.MIN_VALUE, onLambda, ...
[ "public", "static", "TypeAnnotationPosition", "newObj", "(", "final", "List", "<", "TypePathEntry", ">", "location", ",", "final", "JCLambda", "onLambda", ",", "final", "int", "pos", ")", "{", "return", "new", "TypeAnnotationPosition", "(", "TargetType", ".", "N...
Create a {@code TypeAnnotationPosition} for a new. @param location The type path. @param onLambda The lambda for this variable. @param pos The position from the associated tree node.
[ "Create", "a", "{", "@code", "TypeAnnotationPosition", "}", "for", "a", "new", "." ]
a53d069bbdb2c60232ed3811c19b65e41c3e60e0
https://github.com/google/error-prone-javac/blob/a53d069bbdb2c60232ed3811c19b65e41c3e60e0/src/jdk.compiler/share/classes/com/sun/tools/javac/code/TypeAnnotationPosition.java#L733-L741
train
Create a new TypeAnnotationPosition.
Create a Java method that does the following: "Create a new TypeAnnotationPosition.".
Of course, here is the Java code you requested: ```java public static TypeAnnotationPosition newObj(final List<TypePathEntry> location, final JCLambda onLambda, final int pos) { return new TypeAnnotationPosition(TargetType.NEW, pos, ...
BlueBrain/bluima
modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/Th.java
Th.getHeaders
public java.util.List<Object> getHeaders() { if (headers == null) { headers = new ArrayList<Object>(); } return this.headers; }
java
public java.util.List<Object> getHeaders() { if (headers == null) { headers = new ArrayList<Object>(); } return this.headers; }
[ "public", "java", ".", "util", ".", "List", "<", "Object", ">", "getHeaders", "(", ")", "{", "if", "(", "headers", "==", "null", ")", "{", "headers", "=", "new", "ArrayList", "<", "Object", ">", "(", ")", ";", "}", "return", "this", ".", "headers",...
Gets the value of the headers property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the headers property. <p> For example, to add a...
[ "Gets", "the", "value", "of", "the", "headers", "property", "." ]
793ea3f46761dce72094e057a56cddfa677156ae
https://github.com/BlueBrain/bluima/blob/793ea3f46761dce72094e057a56cddfa677156ae/modules/bluima_xml/src/main/java/ch/epfl/bbp/uima/xml/archivearticle3/Th.java#L465-L470
train
Gets the value of the headers property.
Create a Java method that does the following: "Gets the value of the headers property.".
Of course, here is the Java code you requested: ```java public java.util.List<Object> getHeaders() { if (headers == null) { headers = new ArrayList<Object>(); } return this.headers; } ``` Hope this helps!
Azure/azure-sdk-for-java
cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsImpl.java
TextAnalyticsImpl.entitiesAsync
public ServiceFuture<EntitiesBatchResult> entitiesAsync(EntitiesOptionalParameter entitiesOptionalParameter, final ServiceCallback<EntitiesBatchResult> serviceCallback) { return ServiceFuture.fromResponse(entitiesWithServiceResponseAsync(entitiesOptionalParameter), serviceCallback); }
java
public ServiceFuture<EntitiesBatchResult> entitiesAsync(EntitiesOptionalParameter entitiesOptionalParameter, final ServiceCallback<EntitiesBatchResult> serviceCallback) { return ServiceFuture.fromResponse(entitiesWithServiceResponseAsync(entitiesOptionalParameter), serviceCallback); }
[ "public", "ServiceFuture", "<", "EntitiesBatchResult", ">", "entitiesAsync", "(", "EntitiesOptionalParameter", "entitiesOptionalParameter", ",", "final", "ServiceCallback", "<", "EntitiesBatchResult", ">", "serviceCallback", ")", "{", "return", "ServiceFuture", ".", "fromRe...
The API returns a list of recognized entities in a given document. To get even more information on each recognized entity we recommend using the Bing Entity Search API by querying for the recognized entities names. See the &lt;a href="https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analyti...
[ "The", "API", "returns", "a", "list", "of", "recognized", "entities", "in", "a", "given", "document", ".", "To", "get", "even", "more", "information", "on", "each", "recognized", "entity", "we", "recommend", "using", "the", "Bing", "Entity", "Search", "API",...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/language/textanalytics/src/main/java/com/microsoft/azure/cognitiveservices/language/textanalytics/implementation/TextAnalyticsImpl.java#L111-L113
train
Retrieve a list of entities.
Create a Java method that does the following: "Retrieve a list of entities.".
Of course, here is the Java code you requested: ```java public ServiceFuture<EntitiesBatchResult> entitiesAsync(EntitiesOptionalParameter entitiesOptionalParameter, final ServiceCallback<EntitiesBatchResult> serviceCallback) { return ServiceFuture.fromResponse(entitiesWithServiceResponseAsync(entitiesOptionalP...
TypedRest/TypedRest-Java
core/src/main/java/net/typedrest/AbstractStreamEndpoint.java
AbstractStreamEndpoint.getObservable
StoppableObservable<TEntity> getObservable(final long startIndex, Scheduler scheduler) { return runAsync(scheduler, (rx.Observer<? super TEntity> observer, Subscription subscription) -> { long currentStartIndex = startIndex; while (!subscription.isUnsubscribed()) { Partia...
java
StoppableObservable<TEntity> getObservable(final long startIndex, Scheduler scheduler) { return runAsync(scheduler, (rx.Observer<? super TEntity> observer, Subscription subscription) -> { long currentStartIndex = startIndex; while (!subscription.isUnsubscribed()) { Partia...
[ "StoppableObservable", "<", "TEntity", ">", "getObservable", "(", "final", "long", "startIndex", ",", "Scheduler", "scheduler", ")", "{", "return", "runAsync", "(", "scheduler", ",", "(", "rx", ".", "Observer", "<", "?", "super", "TEntity", ">", "observer", ...
Provides an observable stream of elements. @param startIndex The index of the first element to return in the stream. Use negative values to start counting from the end of the stream. @param scheduler The scheduler used to run the background thread. @return An observable stream of elements.
[ "Provides", "an", "observable", "stream", "of", "elements", "." ]
8ce8782d4b8bbe68a2fb4417928b18724f178705
https://github.com/TypedRest/TypedRest-Java/blob/8ce8782d4b8bbe68a2fb4417928b18724f178705/core/src/main/java/net/typedrest/AbstractStreamEndpoint.java#L61-L89
test
Gets an observable that will consume all entities starting from the specified startIndex.
Create a Java method that does the following: "Gets an observable that will consume all entities starting from the specified startIndex.".
Of course, here is the Java code you requested: ```java StoppableObservable<TEntity> getObservable(final long startIndex, Scheduler scheduler) { return runAsync(scheduler, (rx.Observer<? super TEntity> observer, Subscription subscription) -> { long currentStartIndex = startIndex; while ...
opsgenie/opsgenieclient
common/src/main/java/com/ifountain/opsgenie/client/script/util/ScriptProxy.java
ScriptProxy.addForwarding
public Map addForwarding(Map params) throws Exception { CreateForwardingRulePayload payload = new CreateForwardingRulePayload(); payload.setFromUser(parseUserMetaBackwardsCompatible(params.get(OpsGenieClientConstants.API.FROM_USER))); payload.setToUser(parseUserMetaBackwardsCompatible(params....
java
public Map addForwarding(Map params) throws Exception { CreateForwardingRulePayload payload = new CreateForwardingRulePayload(); payload.setFromUser(parseUserMetaBackwardsCompatible(params.get(OpsGenieClientConstants.API.FROM_USER))); payload.setToUser(parseUserMetaBackwardsCompatible(params....
[ "public", "Map", "addForwarding", "(", "Map", "params", ")", "throws", "Exception", "{", "CreateForwardingRulePayload", "payload", "=", "new", "CreateForwardingRulePayload", "(", ")", ";", "payload", ".", "setFromUser", "(", "parseUserMetaBackwardsCompatible", "(", "p...
backward sikinti
[ "backward", "sikinti" ]
6d94efb16bbc74be189c86e9329af510ac8a048c
https://github.com/opsgenie/opsgenieclient/blob/6d94efb16bbc74be189c86e9329af510ac8a048c/common/src/main/java/com/ifountain/opsgenie/client/script/util/ScriptProxy.java#L768-L777
train
Creates a new ForwardingRule object in the server
Create a Java method that does the following: "Creates a new ForwardingRule object in the server".
Of course, here is the Java code you requested: ```java public Map addForwarding(Map params) throws Exception { CreateForwardingRulePayload payload = new CreateForwardingRulePayload(); payload.setFromUser(parseUserMetaBackwardsCompatible(params.get(OpsGenieClientConstants.API.FROM_USER))); p...
aws/aws-sdk-java
aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/EncryptionAtRestOptionsMarshaller.java
EncryptionAtRestOptionsMarshaller.marshall
public void marshall(EncryptionAtRestOptions encryptionAtRestOptions, ProtocolMarshaller protocolMarshaller) { if (encryptionAtRestOptions == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(encryption...
java
public void marshall(EncryptionAtRestOptions encryptionAtRestOptions, ProtocolMarshaller protocolMarshaller) { if (encryptionAtRestOptions == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.marshall(encryption...
[ "public", "void", "marshall", "(", "EncryptionAtRestOptions", "encryptionAtRestOptions", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "encryptionAtRestOptions", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "\"Invalid argument...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-elasticsearch/src/main/java/com/amazonaws/services/elasticsearch/model/transform/EncryptionAtRestOptionsMarshaller.java#L44-L56
train
marshalls the given EncryptionAtRestOptions object to the JSON file.
Create a Java method that does the following: "marshalls the given EncryptionAtRestOptions object to the JSON file.".
Of course, here is the Java code you requested: ```java public void marshall(EncryptionAtRestOptions encryptionAtRestOptions, ProtocolMarshaller protocolMarshaller) { if (encryptionAtRestOptions == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } ...
artclarke/humble-video
humble-video-noarch/src/main/java/io/humble/video/Rational.java
Rational.multiply
public Rational multiply(Rational arg) { long cPtr = VideoJNI.Rational_multiply(swigCPtr, this, Rational.getCPtr(arg), arg); return (cPtr == 0) ? null : new Rational(cPtr, false); }
java
public Rational multiply(Rational arg) { long cPtr = VideoJNI.Rational_multiply(swigCPtr, this, Rational.getCPtr(arg), arg); return (cPtr == 0) ? null : new Rational(cPtr, false); }
[ "public", "Rational", "multiply", "(", "Rational", "arg", ")", "{", "long", "cPtr", "=", "VideoJNI", ".", "Rational_multiply", "(", "swigCPtr", ",", "this", ",", "Rational", ".", "getCPtr", "(", "arg", ")", ",", "arg", ")", ";", "return", "(", "cPtr", ...
Multiplies this number by arg<br> @param arg number to mulitply by.<br> @return this*arg.
[ "Multiplies", "this", "number", "by", "arg<br", ">" ]
aa349ae2d7ef74160b7074feac8d298cf90394d1
https://github.com/artclarke/humble-video/blob/aa349ae2d7ef74160b7074feac8d298cf90394d1/humble-video-noarch/src/main/java/io/humble/video/Rational.java#L262-L265
test
Multiply this number with another number.
Create a Java method that does the following: "Multiply this number with another number.".
Of course, here is the Java code you requested: ```java public Rational multiply(Rational arg) { long cPtr = VideoJNI.Rational_multiply(swigCPtr, this, Rational.getCPtr(arg), arg); return (cPtr == 0) ? null : new Rational(cPtr, false); } ``` Hope this helps!
jcodec/jcodec
android/src/main/org/jcodec/api/android/AndroidFrameGrab.java
AndroidFrameGrab.getFrame
public static Bitmap getFrame(File file, double second) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return ((AndroidFrameGrab) createAndroidFrameGrab(ch).seekToSecondPrecise(second)).getFrame(); } finally ...
java
public static Bitmap getFrame(File file, double second) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return ((AndroidFrameGrab) createAndroidFrameGrab(ch).seekToSecondPrecise(second)).getFrame(); } finally ...
[ "public", "static", "Bitmap", "getFrame", "(", "File", "file", ",", "double", "second", ")", "throws", "IOException", ",", "JCodecException", "{", "FileChannelWrapper", "ch", "=", "null", ";", "try", "{", "ch", "=", "NIOUtils", ".", "readableChannel", "(", "...
Get frame at a specified second as AWT image @param file @param second @return A decoded frame from a given point in video. @throws IOException @throws JCodecException
[ "Get", "frame", "at", "a", "specified", "second", "as", "AWT", "image" ]
cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75
https://github.com/jcodec/jcodec/blob/cd6efa51ef05f409a8ba8cfb7521f4b4f10ccc75/android/src/main/org/jcodec/api/android/AndroidFrameGrab.java#L59-L67
test
Get a bitmap of the frame from the file.
Create a Java method that does the following: "Get a bitmap of the frame from the file.".
Of course, here is the Java code you requested: ```java public static Bitmap getFrame(File file, double second) throws IOException, JCodecException { FileChannelWrapper ch = null; try { ch = NIOUtils.readableChannel(file); return ((AndroidFrameGrab) createAndroidFrameGrab(ch).se...
aws/aws-sdk-java
aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/PipelineExecutionSummary.java
PipelineExecutionSummary.withSourceRevisions
public PipelineExecutionSummary withSourceRevisions(SourceRevision... sourceRevisions) { if (this.sourceRevisions == null) { setSourceRevisions(new java.util.ArrayList<SourceRevision>(sourceRevisions.length)); } for (SourceRevision ele : sourceRevisions) { this.sourceRevi...
java
public PipelineExecutionSummary withSourceRevisions(SourceRevision... sourceRevisions) { if (this.sourceRevisions == null) { setSourceRevisions(new java.util.ArrayList<SourceRevision>(sourceRevisions.length)); } for (SourceRevision ele : sourceRevisions) { this.sourceRevi...
[ "public", "PipelineExecutionSummary", "withSourceRevisions", "(", "SourceRevision", "...", "sourceRevisions", ")", "{", "if", "(", "this", ".", "sourceRevisions", "==", "null", ")", "{", "setSourceRevisions", "(", "new", "java", ".", "util", ".", "ArrayList", "<",...
<p> A list of the source artifact revisions that initiated a pipeline execution. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setSourceRevisions(java.util.Collection)} or {@link #withSourceRevisions(java.util.Collection)} if you want to override the existing values. </...
[ "<p", ">", "A", "list", "of", "the", "source", "artifact", "revisions", "that", "initiated", "a", "pipeline", "execution", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-codepipeline/src/main/java/com/amazonaws/services/codepipeline/model/PipelineExecutionSummary.java#L548-L556
train
A list of source revisions to be executed.
Create a Java method that does the following: "A list of source revisions to be executed.".
Of course, here is the Java code you requested: ```java public PipelineExecutionSummary withSourceRevisions(SourceRevision... sourceRevisions) { if (this.sourceRevisions == null) { setSourceRevisions(new java.util.ArrayList<SourceRevision>(sourceRevisions.length)); } for (SourceRevi...
jnidzwetzki/bitfinex-v2-wss-api-java
src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/RawOrderbookManager.java
RawOrderbookManager.removeOrderbookCallback
public boolean removeOrderbookCallback(final BitfinexOrderBookSymbol symbol, final BiConsumer<BitfinexOrderBookSymbol, BitfinexOrderBookEntry> callback) throws BitfinexClientException { return channelCallbacks.removeCallback(symbol, callback); }
java
public boolean removeOrderbookCallback(final BitfinexOrderBookSymbol symbol, final BiConsumer<BitfinexOrderBookSymbol, BitfinexOrderBookEntry> callback) throws BitfinexClientException { return channelCallbacks.removeCallback(symbol, callback); }
[ "public", "boolean", "removeOrderbookCallback", "(", "final", "BitfinexOrderBookSymbol", "symbol", ",", "final", "BiConsumer", "<", "BitfinexOrderBookSymbol", ",", "BitfinexOrderBookEntry", ">", "callback", ")", "throws", "BitfinexClientException", "{", "return", "channelCa...
Remove the a trading orderbook callback @param symbol @param callback @return true/false @throws BitfinexClientException
[ "Remove", "the", "a", "trading", "orderbook", "callback" ]
2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee
https://github.com/jnidzwetzki/bitfinex-v2-wss-api-java/blob/2e6adf1eb6f8cd4c8722f1619f78ab2cc3c600ee/src/main/java/com/github/jnidzwetzki/bitfinex/v2/manager/RawOrderbookManager.java#L64-L67
train
Remove a orderbook callback
Create a Java method that does the following: "Remove a orderbook callback".
Of course, here is the Java code you requested: ```java public boolean removeOrderbookCallback(final BitfinexOrderBookSymbol symbol, final BiConsumer<BitfinexOrderBookSymbol, BitfinexOrderBookEntry> callback) throws BitfinexClientException { return channelCallbacks.removeCallback(symbol, callback); } ``` Hope t...
OpenLiberty/open-liberty
dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JaxbPUnit20.java
JaxbPUnit20.getValidationMode
@Override public ValidationMode getValidationMode() { // Convert this ValidationMode from the class defined // in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType) // to JPA (javax.persistence.ValidationMode). ValidationMode rtnMode = null; PersistenceUnitV...
java
@Override public ValidationMode getValidationMode() { // Convert this ValidationMode from the class defined // in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType) // to JPA (javax.persistence.ValidationMode). ValidationMode rtnMode = null; PersistenceUnitV...
[ "@", "Override", "public", "ValidationMode", "getValidationMode", "(", ")", "{", "// Convert this ValidationMode from the class defined", "// in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType)", "// to JPA (javax.persistence.ValidationMode).", "ValidationMode", "rtnMode", "...
Gets the value of the validationMode property. @return value of the validationMode property.
[ "Gets", "the", "value", "of", "the", "validationMode", "property", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.jpa.container.core/src/com/ibm/ws/jpa/management/JaxbPUnit20.java#L253-L278
train
Get the validation mode.
Create a Java method that does the following: "Get the validation mode.".
Of course, here is the Java code you requested: ```java @Override public ValidationMode getValidationMode() { // Convert this ValidationMode from the class defined // in JAXB (com.ibm.ws.jpa.pxml20.PersistenceUnitValidationModeType) // to JPA (javax.persistence.ValidationMode). ...
Unidata/thredds
cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java
RandomAccessFile.readLong
public final void readLong(long[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = readLong(); } }
java
public final void readLong(long[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = readLong(); } }
[ "public", "final", "void", "readLong", "(", "long", "[", "]", "pa", ",", "int", "start", ",", "int", "n", ")", "throws", "IOException", "{", "for", "(", "int", "i", "=", "0", ";", "i", "<", "n", ";", "i", "++", ")", "{", "pa", "[", "start", "...
Read an array of longs @param pa read into this array @param start starting at pa[start] @param n read this many elements @throws IOException on read error
[ "Read", "an", "array", "of", "longs" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/cdm/src/main/java/ucar/unidata/io/RandomAccessFile.java#L1327-L1331
test
Reads a sequence of long values from the input stream.
Create a Java method that does the following: "Reads a sequence of long values from the input stream.".
Of course, here is the Java code you requested: ```java public final void readLong(long[] pa, int start, int n) throws IOException { for (int i = 0; i < n; i++) { pa[start + i] = readLong(); } } ``` Hope this helps!
spring-projects/spring-ldap
core/src/main/java/org/springframework/ldap/NamingException.java
NamingException.getResolvedObj
public Object getResolvedObj() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()).getResolvedObj(); } return null; }
java
public Object getResolvedObj() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()).getResolvedObj(); } return null; }
[ "public", "Object", "getResolvedObj", "(", ")", "{", "if", "(", "getCause", "(", ")", "instanceof", "javax", ".", "naming", ".", "NamingException", ")", "{", "return", "(", "(", "javax", ".", "naming", ".", "NamingException", ")", "getCause", "(", ")", "...
Convenience method to get the resolved object associated with this exception, if the root cause was an instance of {@link javax.naming.NamingException}. @return the object that was resolved so far if the root cause is an instance of javax.naming.NamingException, or <code>null</code> if the resolved object field has no...
[ "Convenience", "method", "to", "get", "the", "resolved", "object", "associated", "with", "this", "exception", "if", "the", "root", "cause", "was", "an", "instance", "of", "{", "@link", "javax", ".", "naming", ".", "NamingException", "}", "." ]
15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0
https://github.com/spring-projects/spring-ldap/blob/15142d4ae18a9dc6b363a1ebf085e2bda9d9a4c0/core/src/main/java/org/springframework/ldap/NamingException.java#L153-L158
train
Gets the resolved object.
Create a Java method that does the following: "Gets the resolved object.".
Of course, here is the Java code you requested: ```java public Object getResolvedObj() { if (getCause() instanceof javax.naming.NamingException) { return ((javax.naming.NamingException) getCause()).getResolvedObj(); } return null; } ``` Hope this helps!
apptik/jus
jus-java/src/main/java/io/apptik/comm/jus/Request.java
Request.compareTo
@Override public int compareTo(Request<T> other) { Priority left = this.getPriority(); Priority right = other.getPriority(); // High-priority requests are "lesser" so they are sorted to the front. // Equal priorities are sorted by sequence number to provide FIFO ordering. re...
java
@Override public int compareTo(Request<T> other) { Priority left = this.getPriority(); Priority right = other.getPriority(); // High-priority requests are "lesser" so they are sorted to the front. // Equal priorities are sorted by sequence number to provide FIFO ordering. re...
[ "@", "Override", "public", "int", "compareTo", "(", "Request", "<", "T", ">", "other", ")", "{", "Priority", "left", "=", "this", ".", "getPriority", "(", ")", ";", "Priority", "right", "=", "other", ".", "getPriority", "(", ")", ";", "// High-priority r...
Our comparator sorts from high to low priority, and secondarily by sequence number to provide FIFO ordering.
[ "Our", "comparator", "sorts", "from", "high", "to", "low", "priority", "and", "secondarily", "by", "sequence", "number", "to", "provide", "FIFO", "ordering", "." ]
8a37a21b41f897d68eaeaab07368ec22a1e5a60e
https://github.com/apptik/jus/blob/8a37a21b41f897d68eaeaab07368ec22a1e5a60e/jus-java/src/main/java/io/apptik/comm/jus/Request.java#L1119-L1129
train
Compares two request objects.
Create a Java method that does the following: "Compares two request objects.".
Of course, here is the Java code you requested: ```java @Override public int compareTo(Request<T> other) { Priority left = this.getPriority(); Priority right = other.getPriority(); // High-priority requests are "lesser" so they are sorted to the front. // Equal priorities are sorte...
doanduyhai/Achilles
achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java
AbstractProperty.decodeField
public void decodeField(GettableData gettableData, ENTITY entity) { final VALUEFROM valuefrom = decodeFromGettable(gettableData); fieldInfo.setter.set(entity, valuefrom); }
java
public void decodeField(GettableData gettableData, ENTITY entity) { final VALUEFROM valuefrom = decodeFromGettable(gettableData); fieldInfo.setter.set(entity, valuefrom); }
[ "public", "void", "decodeField", "(", "GettableData", "gettableData", ",", "ENTITY", "entity", ")", "{", "final", "VALUEFROM", "valuefrom", "=", "decodeFromGettable", "(", "gettableData", ")", ";", "fieldInfo", ".", "setter", ".", "set", "(", "entity", ",", "v...
<ol> <li>First extract the column value from the given GettableData (Row, UDTValue, ...)</li> <li>Then call the setter on the given entity to set the value</li> </ol> @param gettableData @param entity
[ "<ol", ">", "<li", ">", "First", "extract", "the", "column", "value", "from", "the", "given", "GettableData", "(", "Row", "UDTValue", "...", ")", "<", "/", "li", ">", "<li", ">", "Then", "call", "the", "setter", "on", "the", "given", "entity", "to", ...
8281c33100e72c993e570592ae1a5306afac6813
https://github.com/doanduyhai/Achilles/blob/8281c33100e72c993e570592ae1a5306afac6813/achilles-core/src/main/java/info/archinnov/achilles/internals/metamodel/AbstractProperty.java#L243-L246
train
Decode the field from gettable data.
Create a Java method that does the following: "Decode the field from gettable data.".
Of course, here is the Java code you requested: ```java public void decodeField(GettableData gettableData, ENTITY entity) { final VALUEFROM valuefrom = decodeFromGettable(gettableData); fieldInfo.setter.set(entity, valuefrom); } ``` Hope this helps!
Alluxio/alluxio
shell/src/main/java/alluxio/cli/fsadmin/FileSystemAdminShellUtils.java
FileSystemAdminShellUtils.checkMasterClientService
public static void checkMasterClientService(AlluxioConfiguration alluxioConf) throws IOException { try (CloseableResource<FileSystemMasterClient> client = FileSystemContext.create(ClientContext.create(alluxioConf)) .acquireMasterClientResource()) { InetSocketAddress address = client.get().getA...
java
public static void checkMasterClientService(AlluxioConfiguration alluxioConf) throws IOException { try (CloseableResource<FileSystemMasterClient> client = FileSystemContext.create(ClientContext.create(alluxioConf)) .acquireMasterClientResource()) { InetSocketAddress address = client.get().getA...
[ "public", "static", "void", "checkMasterClientService", "(", "AlluxioConfiguration", "alluxioConf", ")", "throws", "IOException", "{", "try", "(", "CloseableResource", "<", "FileSystemMasterClient", ">", "client", "=", "FileSystemContext", ".", "create", "(", "ClientCon...
Checks if the master client service is available. Throws an exception if fails to determine that the master client service is running. @param alluxioConf Alluxio configuration
[ "Checks", "if", "the", "master", "client", "service", "is", "available", ".", "Throws", "an", "exception", "if", "fails", "to", "determine", "that", "the", "master", "client", "service", "is", "running", "." ]
af38cf3ab44613355b18217a3a4d961f8fec3a10
https://github.com/Alluxio/alluxio/blob/af38cf3ab44613355b18217a3a4d961f8fec3a10/shell/src/main/java/alluxio/cli/fsadmin/FileSystemAdminShellUtils.java#L58-L71
train
Check the master client service.
Create a Java method that does the following: "Check the master client service.".
Of course, here is the Java code you requested: ```java public static void checkMasterClientService(AlluxioConfiguration alluxioConf) throws IOException { try (CloseableResource<FileSystemMasterClient> client = FileSystemContext.create(ClientContext.create(alluxioConf)) .acquireMasterClientResource...
aws/aws-sdk-java
aws-java-sdk-appsync/src/main/java/com/amazonaws/services/appsync/model/transform/ElasticsearchDataSourceConfigMarshaller.java
ElasticsearchDataSourceConfigMarshaller.marshall
public void marshall(ElasticsearchDataSourceConfig elasticsearchDataSourceConfig, ProtocolMarshaller protocolMarshaller) { if (elasticsearchDataSourceConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
java
public void marshall(ElasticsearchDataSourceConfig elasticsearchDataSourceConfig, ProtocolMarshaller protocolMarshaller) { if (elasticsearchDataSourceConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMarshaller.m...
[ "public", "void", "marshall", "(", "ElasticsearchDataSourceConfig", "elasticsearchDataSourceConfig", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "elasticsearchDataSourceConfig", "==", "null", ")", "{", "throw", "new", "SdkClientException", "(", "...
Marshall the given parameter object.
[ "Marshall", "the", "given", "parameter", "object", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-appsync/src/main/java/com/amazonaws/services/appsync/model/transform/ElasticsearchDataSourceConfigMarshaller.java#L44-L56
train
marshalls the given ElasticsearchDataSourceConfig to the JSON object.
Create a Java method that does the following: "marshalls the given ElasticsearchDataSourceConfig to the JSON object.".
Of course, here is the Java code you requested: ```java public void marshall(ElasticsearchDataSourceConfig elasticsearchDataSourceConfig, ProtocolMarshaller protocolMarshaller) { if (elasticsearchDataSourceConfig == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); ...
litsec/swedish-eid-shibboleth-base
shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/context/strategy/RequestedPrincipalContextLookup.java
RequestedPrincipalContextLookup.apply
@Override public RequestedPrincipalContext apply(AuthenticationContext input) { return input != null ? input.getSubcontext(RequestedPrincipalContext.class, false) : null; }
java
@Override public RequestedPrincipalContext apply(AuthenticationContext input) { return input != null ? input.getSubcontext(RequestedPrincipalContext.class, false) : null; }
[ "@", "Override", "public", "RequestedPrincipalContext", "apply", "(", "AuthenticationContext", "input", ")", "{", "return", "input", "!=", "null", "?", "input", ".", "getSubcontext", "(", "RequestedPrincipalContext", ".", "class", ",", "false", ")", ":", "null", ...
{@inheritDoc}
[ "{" ]
aaaa467ff61f07d7dfa31627fb36851a37da6804
https://github.com/litsec/swedish-eid-shibboleth-base/blob/aaaa467ff61f07d7dfa31627fb36851a37da6804/shibboleth-base/shibboleth-extensions/src/main/java/se/litsec/shibboleth/idp/authn/context/strategy/RequestedPrincipalContextLookup.java#L32-L35
train
Override to provide a subcontext for the requested principal context.
Create a Java method that does the following: "Override to provide a subcontext for the requested principal context.".
Of course, here is the Java code you requested: ```java @Override public RequestedPrincipalContext apply(AuthenticationContext input) { return input != null ? input.getSubcontext(RequestedPrincipalContext.class, false) : null; } ``` Hope this helps!
auth0/Auth0.Android
auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java
CustomTabsController.launchUri
public void launchUri(@NonNull final Uri uri) { final Context context = this.context.get(); if (context == null) { Log.v(TAG, "Custom Tab Context was no longer valid."); return; } if (customTabsOptions == null) { customTabsOptions = CustomTabsOptions....
java
public void launchUri(@NonNull final Uri uri) { final Context context = this.context.get(); if (context == null) { Log.v(TAG, "Custom Tab Context was no longer valid."); return; } if (customTabsOptions == null) { customTabsOptions = CustomTabsOptions....
[ "public", "void", "launchUri", "(", "@", "NonNull", "final", "Uri", "uri", ")", "{", "final", "Context", "context", "=", "this", ".", "context", ".", "get", "(", ")", ";", "if", "(", "context", "==", "null", ")", "{", "Log", ".", "v", "(", "TAG", ...
Opens a Uri in a Custom Tab or Browser. The Custom Tab service will be given up to {@link CustomTabsController#MAX_WAIT_TIME_SECONDS} to be connected. If it fails to connect the Uri will be opened on a Browser. <p> In the exceptional case that no Browser app is installed on the device, this method will fail silently an...
[ "Opens", "a", "Uri", "in", "a", "Custom", "Tab", "or", "Browser", ".", "The", "Custom", "Tab", "service", "will", "be", "given", "up", "to", "{", "@link", "CustomTabsController#MAX_WAIT_TIME_SECONDS", "}", "to", "be", "connected", ".", "If", "it", "fails", ...
ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156
https://github.com/auth0/Auth0.Android/blob/ee37b7f94d989c1fbab2cb1378c87fdcaf7a8156/auth0/src/main/java/com/auth0/android/provider/CustomTabsController.java#L125-L155
train
Launch a URI in a background thread.
Create a Java method that does the following: "Launch a URI in a background thread.".
Of course, here is the Java code you requested: ```java public void launchUri(@NonNull final Uri uri) { final Context context = this.context.get(); if (context == null) { Log.v(TAG, "Custom Tab Context was no longer valid."); return; } if (customTabsOptions == n...
hypercube1024/firefly
firefly/src/main/java/com/firefly/codec/http2/model/MultiPartFormInputStream.java
MultiPartFormInputStream.parse
protected void parse() { // have we already parsed the input? if (_parsed) return; _parsed = true; try { // initialize _parts = new MultiMap<>(); // if its not a multipart request, don't parse it if (_contentType == null || !_...
java
protected void parse() { // have we already parsed the input? if (_parsed) return; _parsed = true; try { // initialize _parts = new MultiMap<>(); // if its not a multipart request, don't parse it if (_contentType == null || !_...
[ "protected", "void", "parse", "(", ")", "{", "// have we already parsed the input?", "if", "(", "_parsed", ")", "return", ";", "_parsed", "=", "true", ";", "try", "{", "// initialize", "_parts", "=", "new", "MultiMap", "<>", "(", ")", ";", "// if its not a mul...
Parse, if necessary, the multipart stream.
[ "Parse", "if", "necessary", "the", "multipart", "stream", "." ]
ed3fc75b7c54a65b1e7d8141d01b49144bb423a3
https://github.com/hypercube1024/firefly/blob/ed3fc75b7c54a65b1e7d8141d01b49144bb423a3/firefly/src/main/java/com/firefly/codec/http2/model/MultiPartFormInputStream.java#L406-L498
train
Parses the input.
Create a Java method that does the following: "Parses the input.".
Of course, here is the Java code you requested: ```java protected void parse() { // have we already parsed the input? if (_parsed) return; _parsed = true; try { // initialize _parts = new MultiMap<>(); // if its not a multipart request, ...
aoindustries/semanticcms-autogit-servlet
src/main/java/com/semanticcms/autogit/servlet/AutoGitContextListener.java
AutoGitContextListener.contextInitialized
@Override public void contextInitialized(ServletContextEvent sce) { try { ServletContext sc; synchronized(servletContextLock) { servletContext = sce.getServletContext(); sc = servletContext; } // Find the top level directory String gitToplevelPath = sc.getInitParameter(GIT_TOPLEVEL_CONTEXT_PAR...
java
@Override public void contextInitialized(ServletContextEvent sce) { try { ServletContext sc; synchronized(servletContextLock) { servletContext = sce.getServletContext(); sc = servletContext; } // Find the top level directory String gitToplevelPath = sc.getInitParameter(GIT_TOPLEVEL_CONTEXT_PAR...
[ "@", "Override", "public", "void", "contextInitialized", "(", "ServletContextEvent", "sce", ")", "{", "try", "{", "ServletContext", "sc", ";", "synchronized", "(", "servletContextLock", ")", "{", "servletContext", "=", "sce", ".", "getServletContext", "(", ")", ...
Set to null when context shutdown
[ "Set", "to", "null", "when", "context", "shutdown" ]
a3f5001fa4efee6d19af300330bf8218579c6948
https://github.com/aoindustries/semanticcms-autogit-servlet/blob/a3f5001fa4efee6d19af300330bf8218579c6948/src/main/java/com/semanticcms/autogit/servlet/AutoGitContextListener.java#L112-L167
valid
Override contextInitialized to perform processing for the servlet context.
Create a Java method that does the following: "Override contextInitialized to perform processing for the servlet context.".
Of course, here is the Java code you requested: ```java @Override public void contextInitialized(ServletContextEvent sce) { try { ServletContext sc; synchronized(servletContextLock) { servletContext = sce.getServletContext(); sc = servletContext; } // Find the top level directory String gitTo...
OpenLiberty/open-liberty
dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/impl/IOUtils.java
IOUtils.copyStream
public static void copyStream(InputStream from, OutputStream to) throws IOException { byte buffer[] = new byte[2048]; int bytesRead; while ((bytesRead = from.read(buffer)) != -1) { to.write(buffer, 0, bytesRead); } from.close(); }
java
public static void copyStream(InputStream from, OutputStream to) throws IOException { byte buffer[] = new byte[2048]; int bytesRead; while ((bytesRead = from.read(buffer)) != -1) { to.write(buffer, 0, bytesRead); } from.close(); }
[ "public", "static", "void", "copyStream", "(", "InputStream", "from", ",", "OutputStream", "to", ")", "throws", "IOException", "{", "byte", "buffer", "[", "]", "=", "new", "byte", "[", "2048", "]", ";", "int", "bytesRead", ";", "while", "(", "(", "bytesR...
Copy the given InputStream to the given OutputStream. Note: the InputStream is closed when the copy is complete. The OutputStream is left open.
[ "Copy", "the", "given", "InputStream", "to", "the", "given", "OutputStream", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.jbatch.container/src/com/ibm/jbatch/container/ws/impl/IOUtils.java#L27-L34
train
Copy the contents of an input stream to an output stream.
Create a Java method that does the following: "Copy the contents of an input stream to an output stream.".
Of course, here is the Java code you requested: ```java public static void copyStream(InputStream from, OutputStream to) throws IOException { byte buffer[] = new byte[2048]; int bytesRead; while ((bytesRead = from.read(buffer)) != -1) { to.write(buffer, 0, bytesRead); } ...
woo-j/OkapiBarcode
src/main/java/uk/org/okapibarcode/gui/AddComposite.java
AddComposite.okButtonActionPerformed
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed // TODO add your handling code here: OkapiUI.compositeInputField.setText(compositeText.getText()); dispose(); }
java
private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed // TODO add your handling code here: OkapiUI.compositeInputField.setText(compositeText.getText()); dispose(); }
[ "private", "void", "okButtonActionPerformed", "(", "java", ".", "awt", ".", "event", ".", "ActionEvent", "evt", ")", "{", "//GEN-FIRST:event_okButtonActionPerformed", "// TODO add your handling code here:", "OkapiUI", ".", "compositeInputField", ".", "setText", "(", "comp...
GEN-LAST:event_cancelButtonActionPerformed
[ "GEN", "-", "LAST", ":", "event_cancelButtonActionPerformed" ]
d1cb4f4ab64557cd3db64d9a473528a52ce58081
https://github.com/woo-j/OkapiBarcode/blob/d1cb4f4ab64557cd3db64d9a473528a52ce58081/src/main/java/uk/org/okapibarcode/gui/AddComposite.java#L112-L116
train
The ok button has been pressed.
Create a Java method that does the following: "The ok button has been pressed.".
Of course, here is the Java code you requested: ```java private void okButtonActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_okButtonActionPerformed // TODO add your handling code here: OkapiUI.compositeInputField.setText(compositeText.getText()); dispose(); } ``` Hope t...
Netflix/denominator
core/src/main/java/denominator/Providers.java
Providers.instantiateModule
public static Object instantiateModule(Provider in) throws IllegalArgumentException { String moduleClassName; if (in.getClass().isAnonymousClass()) { moduleClassName = in.getClass().getSuperclass().getName() + "$Module"; } else { moduleClassName = in.getClass().getName() + "$Module"; } C...
java
public static Object instantiateModule(Provider in) throws IllegalArgumentException { String moduleClassName; if (in.getClass().isAnonymousClass()) { moduleClassName = in.getClass().getSuperclass().getName() + "$Module"; } else { moduleClassName = in.getClass().getName() + "$Module"; } C...
[ "public", "static", "Object", "instantiateModule", "(", "Provider", "in", ")", "throws", "IllegalArgumentException", "{", "String", "moduleClassName", ";", "if", "(", "in", ".", "getClass", "(", ")", ".", "isAnonymousClass", "(", ")", ")", "{", "moduleClassName"...
Instantiates the dagger module associated with the provider reflectively. Use this when building {@link DNSApiManager} via Dagger when looking up a provider by name. ex. <pre> provider = withUrl(getByName(providerName), overrideUrl); module = getByName(provider); ultraDns = ObjectGraph.create(provide(provider), modul...
[ "Instantiates", "the", "dagger", "module", "associated", "with", "the", "provider", "reflectively", ".", "Use", "this", "when", "building", "{", "@link", "DNSApiManager", "}", "via", "Dagger", "when", "looking", "up", "a", "provider", "by", "name", "." ]
c565e3b8c6043051252e0947029511f9ac5d306f
https://github.com/Netflix/denominator/blob/c565e3b8c6043051252e0947029511f9ac5d306f/core/src/main/java/denominator/Providers.java#L109-L138
train
Instantiates a module from the given provider.
Create a Java method that does the following: "Instantiates a module from the given provider.".
Of course, here is the Java code you requested: ```java public static Object instantiateModule(Provider in) throws IllegalArgumentException { String moduleClassName; if (in.getClass().isAnonymousClass()) { moduleClassName = in.getClass().getSuperclass().getName() + "$Module"; } else { moduleCla...
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java
DateTimePatternGenerator.skeletonsAreSimilar
@Deprecated public boolean skeletonsAreSimilar(String id, String skeleton) { if (id.equals(skeleton)) { return true; // fast path } // must clone array, make sure items are in same order. TreeSet<String> parser1 = getSet(id); TreeSet<String> parser2 = getSet(skele...
java
@Deprecated public boolean skeletonsAreSimilar(String id, String skeleton) { if (id.equals(skeleton)) { return true; // fast path } // must clone array, make sure items are in same order. TreeSet<String> parser1 = getSet(id); TreeSet<String> parser2 = getSet(skele...
[ "@", "Deprecated", "public", "boolean", "skeletonsAreSimilar", "(", "String", "id", ",", "String", "skeleton", ")", "{", "if", "(", "id", ".", "equals", "(", "skeleton", ")", ")", "{", "return", "true", ";", "// fast path", "}", "// must clone array, make sure...
Used by CLDR tooling; not in ICU4C. Note, this will not work correctly with normal skeletons, since fields that should be related in the two skeletons being compared - like EEE and ccc, or y and U - will not be sorted in the same relative place as each other when iterating over both TreeSets being compare, using TreeSe...
[ "Used", "by", "CLDR", "tooling", ";", "not", "in", "ICU4C", ".", "Note", "this", "will", "not", "work", "correctly", "with", "normal", "skeletons", "since", "fields", "that", "should", "be", "related", "in", "the", "two", "skeletons", "being", "compared", ...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateTimePatternGenerator.java#L1668-L1689
train
Check if the two skeletons are similar.
Create a Java method that does the following: "Check if the two skeletons are similar.".
Of course, here is the Java code you requested: ```java @Deprecated public boolean skeletonsAreSimilar(String id, String skeleton) { if (id.equals(skeleton)) { return true; // fast path } // must clone array, make sure items are in same order. TreeSet<String> parser1 = g...
tracee/contextlogger
utility/src/main/java/io/tracee/contextlogger/utility/GetterUtilities.java
GetterUtilities.isGetterMethod
public static boolean isGetterMethod(final String methodName) { if (methodName != null) { for (String prefix : GETTER_PREFIXES) { if (methodName.startsWith(prefix)) { return true; } } } return false; }
java
public static boolean isGetterMethod(final String methodName) { if (methodName != null) { for (String prefix : GETTER_PREFIXES) { if (methodName.startsWith(prefix)) { return true; } } } return false; }
[ "public", "static", "boolean", "isGetterMethod", "(", "final", "String", "methodName", ")", "{", "if", "(", "methodName", "!=", "null", ")", "{", "for", "(", "String", "prefix", ":", "GETTER_PREFIXES", ")", "{", "if", "(", "methodName", ".", "startsWith", ...
Checks whether the method name starts with a getter prefix. @param methodName the method name to check for @return true if the method name starts with eiher one of values stored in GETTER_PREFIXES
[ "Checks", "whether", "the", "method", "name", "starts", "with", "a", "getter", "prefix", "." ]
ca7f0aee79a0993ab387a403561f760a7dc072e8
https://github.com/tracee/contextlogger/blob/ca7f0aee79a0993ab387a403561f760a7dc072e8/utility/src/main/java/io/tracee/contextlogger/utility/GetterUtilities.java#L34-L47
valid
Checks if the given method name is a getter method.
Create a Java method that does the following: "Checks if the given method name is a getter method.".
Of course, here is the Java code you requested: ```java public static boolean isGetterMethod(final String methodName) { if (methodName != null) { for (String prefix : GETTER_PREFIXES) { if (methodName.startsWith(prefix)) { return true; } ...
SonarSource/sonarqube
server/sonar-server/src/main/java/org/sonar/server/permission/index/WebAuthorizationTypeSupport.java
WebAuthorizationTypeSupport.createQueryFilter
public QueryBuilder createQueryFilter() { if (userSession.isRoot()) { return QueryBuilders.matchAllQuery(); } Integer userId = userSession.getUserId(); BoolQueryBuilder filter = boolQuery(); // anyone filter.should(QueryBuilders.termQuery(FIELD_ALLOW_ANYONE, true)); // users Opt...
java
public QueryBuilder createQueryFilter() { if (userSession.isRoot()) { return QueryBuilders.matchAllQuery(); } Integer userId = userSession.getUserId(); BoolQueryBuilder filter = boolQuery(); // anyone filter.should(QueryBuilders.termQuery(FIELD_ALLOW_ANYONE, true)); // users Opt...
[ "public", "QueryBuilder", "createQueryFilter", "(", ")", "{", "if", "(", "userSession", ".", "isRoot", "(", ")", ")", "{", "return", "QueryBuilders", ".", "matchAllQuery", "(", ")", ";", "}", "Integer", "userId", "=", "userSession", ".", "getUserId", "(", ...
Build a filter to restrict query to the documents on which user has read access.
[ "Build", "a", "filter", "to", "restrict", "query", "to", "the", "documents", "on", "which", "user", "has", "read", "access", "." ]
2fffa4c2f79ae3714844d7742796e82822b6a98a
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/server/sonar-server/src/main/java/org/sonar/server/permission/index/WebAuthorizationTypeSupport.java#L51-L77
train
Create a filter query for the CRUD
Create a Java method that does the following: "Create a filter query for the CRUD".
Of course, here is the Java code you requested: ```java public QueryBuilder createQueryFilter() { if (userSession.isRoot()) { return QueryBuilders.matchAllQuery(); } Integer userId = userSession.getUserId(); BoolQueryBuilder filter = boolQuery(); // anyone filter.should(QueryBuilders.te...
biojava/biojava
biojava-survival/src/main/java/org/biojava/nbio/survival/cox/matrix/StdArrayIO.java
StdArrayIO.print
public static void print(double[] a) { int N = a.length; System.out.println(N); for (int i = 0; i < N; i++) { // System.out.printf("%9.5f ", a[i]); System.out.print(a[i] + " "); } System.out.println(); }
java
public static void print(double[] a) { int N = a.length; System.out.println(N); for (int i = 0; i < N; i++) { // System.out.printf("%9.5f ", a[i]); System.out.print(a[i] + " "); } System.out.println(); }
[ "public", "static", "void", "print", "(", "double", "[", "]", "a", ")", "{", "int", "N", "=", "a", ".", "length", ";", "System", ".", "out", ".", "println", "(", "N", ")", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "N", ";", "i",...
Print an array of doubles to standard output. @param a
[ "Print", "an", "array", "of", "doubles", "to", "standard", "output", "." ]
a1c71a8e3d40cc32104b1d387a3d3b560b43356e
https://github.com/biojava/biojava/blob/a1c71a8e3d40cc32104b1d387a3d3b560b43356e/biojava-survival/src/main/java/org/biojava/nbio/survival/cox/matrix/StdArrayIO.java#L86-L94
train
Print an array of doubles to System. out.
Create a Java method that does the following: "Print an array of doubles to System. out.".
Of course, here is the Java code you requested: ```java public static void print(double[] a) { int N = a.length; System.out.println(N); for (int i = 0; i < N; i++) { // System.out.printf("%9.5f ", a[i]); System.out.print(a[i] + " "); } System.out.println(); } ``` Hope this helps!
jingwei/krati
krati-main/src/retention/java/krati/retention/AbstractRetentionStoreReader.java
AbstractRetentionStoreReader.get
public Position get(Position pos, Map<K, Event<V>> map) { ArrayList<Event<K>> list = new ArrayList<Event<K>>(1000); Position nextPos = get(pos, list); for(Event<K> evt : list) { K key = evt.getValue(); if(key != null) { try { V...
java
public Position get(Position pos, Map<K, Event<V>> map) { ArrayList<Event<K>> list = new ArrayList<Event<K>>(1000); Position nextPos = get(pos, list); for(Event<K> evt : list) { K key = evt.getValue(); if(key != null) { try { V...
[ "public", "Position", "get", "(", "Position", "pos", ",", "Map", "<", "K", ",", "Event", "<", "V", ">", ">", "map", ")", "{", "ArrayList", "<", "Event", "<", "K", ">>", "list", "=", "new", "ArrayList", "<", "Event", "<", "K", ">", ">", "(", "10...
Gets a number of value events starting from a give position in the Retention. The number of events is determined internally by the Retention and it is up to the batch size. @param pos - the retention position from where events will be read @param map - the result map (keys to value events) to fill in @return the next ...
[ "Gets", "a", "number", "of", "value", "events", "starting", "from", "a", "give", "position", "in", "the", "Retention", ".", "The", "number", "of", "events", "is", "determined", "internally", "by", "the", "Retention", "and", "it", "is", "up", "to", "the", ...
1ca0f994a7b0c8215b827eac9aaf95789ec08d21
https://github.com/jingwei/krati/blob/1ca0f994a7b0c8215b827eac9aaf95789ec08d21/krati-main/src/retention/java/krati/retention/AbstractRetentionStoreReader.java#L44-L61
train
Gets the next position in the list.
Create a Java method that does the following: "Gets the next position in the list.".
Of course, here is the Java code you requested: ```java public Position get(Position pos, Map<K, Event<V>> map) { ArrayList<Event<K>> list = new ArrayList<Event<K>>(1000); Position nextPos = get(pos, list); for(Event<K> evt : list) { K key = evt.getValue(); if(k...
DDTH/ddth-commons
ddth-commons-core/src/main/java/com/github/ddth/commons/utils/cipher/DdthCipherOutputStream.java
DdthCipherOutputStream.write
@Override public void write(int value) throws IOException { ibuffer[0] = (byte) value; byte[] buffer = cipher.update(ibuffer, 0, 1); if (buffer != null) { output.write(buffer); } }
java
@Override public void write(int value) throws IOException { ibuffer[0] = (byte) value; byte[] buffer = cipher.update(ibuffer, 0, 1); if (buffer != null) { output.write(buffer); } }
[ "@", "Override", "public", "void", "write", "(", "int", "value", ")", "throws", "IOException", "{", "ibuffer", "[", "0", "]", "=", "(", "byte", ")", "value", ";", "byte", "[", "]", "buffer", "=", "cipher", ".", "update", "(", "ibuffer", ",", "0", "...
{@inheritDoc}
[ "{" ]
734f0e77321d41eeca78a557be9884df9874e46e
https://github.com/DDTH/ddth-commons/blob/734f0e77321d41eeca78a557be9884df9874e46e/ddth-commons-core/src/main/java/com/github/ddth/commons/utils/cipher/DdthCipherOutputStream.java#L67-L74
train
Write a single octet of a CBC header.
Create a Java method that does the following: "Write a single octet of a CBC header.".
Of course, here is the Java code you requested: ```java @Override public void write(int value) throws IOException { ibuffer[0] = (byte) value; byte[] buffer = cipher.update(ibuffer, 0, 1); if (buffer != null) { output.write(buffer); } } ``` Hope this helps!
vvakame/JsonPullParser
jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java
JsonModelCoder.getList
public List<T> getList(InputStream stream, OnJsonObjectAddListener listener) throws IOException, JsonFormatException { JsonPullParser parser = JsonPullParser.newParser(stream); return getList(parser, listener); }
java
public List<T> getList(InputStream stream, OnJsonObjectAddListener listener) throws IOException, JsonFormatException { JsonPullParser parser = JsonPullParser.newParser(stream); return getList(parser, listener); }
[ "public", "List", "<", "T", ">", "getList", "(", "InputStream", "stream", ",", "OnJsonObjectAddListener", "listener", ")", "throws", "IOException", ",", "JsonFormatException", "{", "JsonPullParser", "parser", "=", "JsonPullParser", ".", "newParser", "(", "stream", ...
Attempts to parse the given data as {@link List} of objects. Accepts {@link OnJsonObjectAddListener}; allows you to peek various intermittent instances as parsing goes. @param stream JSON-formatted data @param listener {@link OnJsonObjectAddListener} to notify @return {@link List} of objects @throws IOException @throw...
[ "Attempts", "to", "parse", "the", "given", "data", "as", "{", "@link", "List", "}", "of", "objects", ".", "Accepts", "{", "@link", "OnJsonObjectAddListener", "}", ";", "allows", "you", "to", "peek", "various", "intermittent", "instances", "as", "parsing", "g...
fce183ca66354723323a77f2ae8cb5222b5836bc
https://github.com/vvakame/JsonPullParser/blob/fce183ca66354723323a77f2ae8cb5222b5836bc/jsonpullparser-core/src/main/java/net/vvakame/util/jsonpullparser/builder/JsonModelCoder.java#L98-L102
train
Gets a list of objects from the given input stream.
Create a Java method that does the following: "Gets a list of objects from the given input stream.".
Of course, here is the Java code you requested: ```java public List<T> getList(InputStream stream, OnJsonObjectAddListener listener) throws IOException, JsonFormatException { JsonPullParser parser = JsonPullParser.newParser(stream); return getList(parser, listener); } ``` Hope this helps!
facebookarchive/hadoop-20
src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSContentProvider.java
DFSContentProvider.hasChildren
public boolean hasChildren(Object element) { if (element instanceof DFSContent) { DFSContent content = (DFSContent) element; return content.hasChildren(); } return false; }
java
public boolean hasChildren(Object element) { if (element instanceof DFSContent) { DFSContent content = (DFSContent) element; return content.hasChildren(); } return false; }
[ "public", "boolean", "hasChildren", "(", "Object", "element", ")", "{", "if", "(", "element", "instanceof", "DFSContent", ")", "{", "DFSContent", "content", "=", "(", "DFSContent", ")", "element", ";", "return", "content", ".", "hasChildren", "(", ")", ";", ...
/* @inheritDoc
[ "/", "*" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/eclipse-plugin/src/java/org/apache/hadoop/eclipse/dfs/DFSContentProvider.java#L122-L128
train
Returns true if the element has children.
Create a Java method that does the following: "Returns true if the element has children.".
Of course, here is the Java code you requested: ```java public boolean hasChildren(Object element) { if (element instanceof DFSContent) { DFSContent content = (DFSContent) element; return content.hasChildren(); } return false; } ``` Hope this helps!
wildfly/wildfly-core
host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java
ManagedServerBootCmdFactory.getServerLaunchProperties
@Override public Map<String, String> getServerLaunchProperties() { List<String> launchCommand = getServerLaunchCommand(true, false); return parseLaunchProperties(launchCommand); }
java
@Override public Map<String, String> getServerLaunchProperties() { List<String> launchCommand = getServerLaunchCommand(true, false); return parseLaunchProperties(launchCommand); }
[ "@", "Override", "public", "Map", "<", "String", ",", "String", ">", "getServerLaunchProperties", "(", ")", "{", "List", "<", "String", ">", "launchCommand", "=", "getServerLaunchCommand", "(", "true", ",", "false", ")", ";", "return", "parseLaunchProperties", ...
{@inheritDoc}
[ "{" ]
cfaf0479dcbb2d320a44c5374b93b944ec39fade
https://github.com/wildfly/wildfly-core/blob/cfaf0479dcbb2d320a44c5374b93b944ec39fade/host-controller/src/main/java/org/jboss/as/host/controller/ManagedServerBootCmdFactory.java#L280-L284
train
Get the server launch properties.
Create a Java method that does the following: "Get the server launch properties.".
Of course, here is the Java code you requested: ```java @Override public Map<String, String> getServerLaunchProperties() { List<String> launchCommand = getServerLaunchCommand(true, false); return parseLaunchProperties(launchCommand); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/workplace/CmsWorkplaceManager.java
CmsWorkplaceManager.setDefaultPropertiesOnStructure
public void setDefaultPropertiesOnStructure(String defaultPropertiesOnStructure) { m_defaultPropertiesOnStructure = Boolean.valueOf(defaultPropertiesOnStructure).booleanValue(); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( Messages.get().getBundle().key( ...
java
public void setDefaultPropertiesOnStructure(String defaultPropertiesOnStructure) { m_defaultPropertiesOnStructure = Boolean.valueOf(defaultPropertiesOnStructure).booleanValue(); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( Messages.get().getBundle().key( ...
[ "public", "void", "setDefaultPropertiesOnStructure", "(", "String", "defaultPropertiesOnStructure", ")", "{", "m_defaultPropertiesOnStructure", "=", "Boolean", ".", "valueOf", "(", "defaultPropertiesOnStructure", ")", ".", "booleanValue", "(", ")", ";", "if", "(", "CmsL...
Sets the default property editing mode on resources.<p> @param defaultPropertiesOnStructure the default property editing mode on resources
[ "Sets", "the", "default", "property", "editing", "mode", "on", "resources", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/workplace/CmsWorkplaceManager.java#L1909-L1919
train
Sets the default properties on the structure.
Create a Java method that does the following: "Sets the default properties on the structure.".
Of course, here is the Java code you requested: ```java public void setDefaultPropertiesOnStructure(String defaultPropertiesOnStructure) { m_defaultPropertiesOnStructure = Boolean.valueOf(defaultPropertiesOnStructure).booleanValue(); if (CmsLog.INIT.isInfoEnabled()) { CmsLog.INIT.info( ...
Ellzord/JALSE
src/main/java/jalse/entities/DefaultEntityProxyFactory.java
DefaultEntityProxyFactory.uncacheProxyOfEntity
public void uncacheProxyOfEntity(final Entity e, final Class<? extends Entity> type) { cache.invalidateType(e, type); }
java
public void uncacheProxyOfEntity(final Entity e, final Class<? extends Entity> type) { cache.invalidateType(e, type); }
[ "public", "void", "uncacheProxyOfEntity", "(", "final", "Entity", "e", ",", "final", "Class", "<", "?", "extends", "Entity", ">", "type", ")", "{", "cache", ".", "invalidateType", "(", "e", ",", "type", ")", ";", "}" ]
Uncaches the specific type proxy for an entity. @param e Entity to uncache for. @param type Proxy type.
[ "Uncaches", "the", "specific", "type", "proxy", "for", "an", "entity", "." ]
43fc6572de9b16eb8474aa21a88b6b2d11291615
https://github.com/Ellzord/JALSE/blob/43fc6572de9b16eb8474aa21a88b6b2d11291615/src/main/java/jalse/entities/DefaultEntityProxyFactory.java#L277-L279
train
Uncaches a proxy of an entity.
Create a Java method that does the following: "Uncaches a proxy of an entity.".
Of course, here is the Java code you requested: ```java public void uncacheProxyOfEntity(final Entity e, final Class<? extends Entity> type) { cache.invalidateType(e, type); } ``` Hope this helps!
j-a-w-r/jawr-main-repo
jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/GeneratorRegistry.java
GeneratorRegistry.loadCommonGenerator
private ResourceGenerator loadCommonGenerator(String resourcePath) { ResourceGenerator generator = null; for (Entry<ResourceGeneratorResolver, Class<?>> entry : commonGenerators.entrySet()) { ResourceGeneratorResolver resolver = entry.getKey(); if (resolver.matchPath(resourcePath)) { generator = (Resour...
java
private ResourceGenerator loadCommonGenerator(String resourcePath) { ResourceGenerator generator = null; for (Entry<ResourceGeneratorResolver, Class<?>> entry : commonGenerators.entrySet()) { ResourceGeneratorResolver resolver = entry.getKey(); if (resolver.matchPath(resourcePath)) { generator = (Resour...
[ "private", "ResourceGenerator", "loadCommonGenerator", "(", "String", "resourcePath", ")", "{", "ResourceGenerator", "generator", "=", "null", ";", "for", "(", "Entry", "<", "ResourceGeneratorResolver", ",", "Class", "<", "?", ">", ">", "entry", ":", "commonGenera...
Lazy loads generators, to avoid the need for undesired dependencies. @param generatorKey the generator key @return the resource generator
[ "Lazy", "loads", "generators", "to", "avoid", "the", "need", "for", "undesired", "dependencies", "." ]
5381f6acf461cd2502593c67a77bd6ef9eab848d
https://github.com/j-a-w-r/jawr-main-repo/blob/5381f6acf461cd2502593c67a77bd6ef9eab848d/jawr/jawr-core/src/main/java/net/jawr/web/resource/bundle/generator/GeneratorRegistry.java#L286-L310
train
Loads the common generator for the given resource path
Create a Java method that does the following: "Loads the common generator for the given resource path".
Of course, here is the Java code you requested: ```java private ResourceGenerator loadCommonGenerator(String resourcePath) { ResourceGenerator generator = null; for (Entry<ResourceGeneratorResolver, Class<?>> entry : commonGenerators.entrySet()) { ResourceGeneratorResolver resolver = entry.getKey(); if (re...
elki-project/elki
elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/PairCounting.java
PairCounting.fMeasure
public double fMeasure(double beta) { final double beta2 = beta * beta; double fmeasure = ((1 + beta2) * pairconfuse[0]) / ((1 + beta2) * pairconfuse[0] + beta2 * pairconfuse[1] + pairconfuse[2]); return fmeasure; }
java
public double fMeasure(double beta) { final double beta2 = beta * beta; double fmeasure = ((1 + beta2) * pairconfuse[0]) / ((1 + beta2) * pairconfuse[0] + beta2 * pairconfuse[1] + pairconfuse[2]); return fmeasure; }
[ "public", "double", "fMeasure", "(", "double", "beta", ")", "{", "final", "double", "beta2", "=", "beta", "*", "beta", ";", "double", "fmeasure", "=", "(", "(", "1", "+", "beta2", ")", "*", "pairconfuse", "[", "0", "]", ")", "/", "(", "(", "1", "...
Get the pair-counting F-Measure @param beta Beta value. @return F-Measure
[ "Get", "the", "pair", "-", "counting", "F", "-", "Measure" ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-clustering/src/main/java/de/lmu/ifi/dbs/elki/evaluation/clustering/PairCounting.java#L118-L122
train
Returns the F - Measure of the pair.
Create a Java method that does the following: "Returns the F - Measure of the pair.".
Of course, here is the Java code you requested: ```java public double fMeasure(double beta) { final double beta2 = beta * beta; double fmeasure = ((1 + beta2) * pairconfuse[0]) / ((1 + beta2) * pairconfuse[0] + beta2 * pairconfuse[1] + pairconfuse[2]); return fmeasure; } ``` Hope this helps!
rholder/moar-concurrent
src/main/java/com/github/rholder/moar/concurrent/StrategicQueues.java
StrategicQueues.newStrategicBlockingQueue
public static <V> StrategicBlockingQueue<V> newStrategicBlockingQueue(BlockingQueue<V> blockingQueue, QueueingStrategy<V> queueingStrategy) { return new StrategicBlockingQueue<V>(blockingQueue, queueingStrategy); }
java
public static <V> StrategicBlockingQueue<V> newStrategicBlockingQueue(BlockingQueue<V> blockingQueue, QueueingStrategy<V> queueingStrategy) { return new StrategicBlockingQueue<V>(blockingQueue, queueingStrategy); }
[ "public", "static", "<", "V", ">", "StrategicBlockingQueue", "<", "V", ">", "newStrategicBlockingQueue", "(", "BlockingQueue", "<", "V", ">", "blockingQueue", ",", "QueueingStrategy", "<", "V", ">", "queueingStrategy", ")", "{", "return", "new", "StrategicBlocking...
Return a StrategicBlockingQueue backed by the given BlockingQueue using the given QueueingStrategy. @param blockingQueue the BlockingQueue to back the returned instance @param queueingStrategy the QueueingStrategy to use @param <V> the type of elements held in this collection
[ "Return", "a", "StrategicBlockingQueue", "backed", "by", "the", "given", "BlockingQueue", "using", "the", "given", "QueueingStrategy", "." ]
c28facbf02e628cc37266c051c23d4a7654b4eba
https://github.com/rholder/moar-concurrent/blob/c28facbf02e628cc37266c051c23d4a7654b4eba/src/main/java/com/github/rholder/moar/concurrent/StrategicQueues.java#L61-L63
train
Create a StrategicBlockingQueue from a BlockingQueue and a QueueingStrategy.
Create a Java method that does the following: "Create a StrategicBlockingQueue from a BlockingQueue and a QueueingStrategy.".
Of course, here is the Java code you requested: ```java public static <V> StrategicBlockingQueue<V> newStrategicBlockingQueue(BlockingQueue<V> blockingQueue, QueueingStrategy<V> queueingStrategy) { return new StrategicBlockingQueue<V>(blockingQueue, queueingStrategy); } ``` Hope this helps!
alkacon/opencms-core
src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java
CmsEditSiteForm.setUpComboBoxSSL
private void setUpComboBoxSSL() { IndexedContainer container = getSSLModeContainer("caption", true, null); m_simpleFieldEncryption.setContainerDataSource(container); m_simpleFieldEncryption.setItemCaptionPropertyId("caption"); m_simpleFieldEncryption.setNullSelectionAllowed(false); ...
java
private void setUpComboBoxSSL() { IndexedContainer container = getSSLModeContainer("caption", true, null); m_simpleFieldEncryption.setContainerDataSource(container); m_simpleFieldEncryption.setItemCaptionPropertyId("caption"); m_simpleFieldEncryption.setNullSelectionAllowed(false); ...
[ "private", "void", "setUpComboBoxSSL", "(", ")", "{", "IndexedContainer", "container", "=", "getSSLModeContainer", "(", "\"caption\"", ",", "true", ",", "null", ")", ";", "m_simpleFieldEncryption", ".", "setContainerDataSource", "(", "container", ")", ";", "m_simple...
Sets up the ComboBox for the SSL Mode.<p>
[ "Sets", "up", "the", "ComboBox", "for", "the", "SSL", "Mode", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsEditSiteForm.java#L2139-L2166
train
Sets up the combo box for SSL mode.
Create a Java method that does the following: "Sets up the combo box for SSL mode.".
Of course, here is the Java code you requested: ```java private void setUpComboBoxSSL() { IndexedContainer container = getSSLModeContainer("caption", true, null); m_simpleFieldEncryption.setContainerDataSource(container); m_simpleFieldEncryption.setItemCaptionPropertyId("caption"); m_...
raydac/java-comment-preprocessor
jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java
PreprocessorContext.setSources
@Nonnull public PreprocessorContext setSources(@Nonnull @MustNotContainNull final List<String> folderPaths) { this.sources.clear(); this.sources.addAll(assertDoesntContainNull(folderPaths).stream().map(x -> new SourceFolder(this.baseDir, x)).collect(Collectors.toList())); return this; }
java
@Nonnull public PreprocessorContext setSources(@Nonnull @MustNotContainNull final List<String> folderPaths) { this.sources.clear(); this.sources.addAll(assertDoesntContainNull(folderPaths).stream().map(x -> new SourceFolder(this.baseDir, x)).collect(Collectors.toList())); return this; }
[ "@", "Nonnull", "public", "PreprocessorContext", "setSources", "(", "@", "Nonnull", "@", "MustNotContainNull", "final", "List", "<", "String", ">", "folderPaths", ")", "{", "this", ".", "sources", ".", "clear", "(", ")", ";", "this", ".", "sources", ".", "...
Set source directories @param folderPaths list of source folder paths represented as strings @return this preprocessor context instance
[ "Set", "source", "directories" ]
83ac87b575ac084914d77695a8c8673de3b8300c
https://github.com/raydac/java-comment-preprocessor/blob/83ac87b575ac084914d77695a8c8673de3b8300c/jcp/src/main/java/com/igormaznitsa/jcp/context/PreprocessorContext.java#L369-L374
train
Sets the source folders.
Create a Java method that does the following: "Sets the source folders.".
Of course, here is the Java code you requested: ```java @Nonnull public PreprocessorContext setSources(@Nonnull @MustNotContainNull final List<String> folderPaths) { this.sources.clear(); this.sources.addAll(assertDoesntContainNull(folderPaths).stream().map(x -> new SourceFolder(this.baseDir, x)).collect(Col...
exoplatform/jcr
exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java
ImportNodeData.getACL
public AccessControlList getACL() { if (exoPrivileges != null || exoOwner != null) { return ACLInitializationHelper.initAcl(super.getACL(), exoOwner, exoPrivileges); } return super.getACL(); }
java
public AccessControlList getACL() { if (exoPrivileges != null || exoOwner != null) { return ACLInitializationHelper.initAcl(super.getACL(), exoOwner, exoPrivileges); } return super.getACL(); }
[ "public", "AccessControlList", "getACL", "(", ")", "{", "if", "(", "exoPrivileges", "!=", "null", "||", "exoOwner", "!=", "null", ")", "{", "return", "ACLInitializationHelper", ".", "initAcl", "(", "super", ".", "getACL", "(", ")", ",", "exoOwner", ",", "e...
{@inheritDoc}
[ "{" ]
3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2
https://github.com/exoplatform/jcr/blob/3e7f9ee1b5683640d73a4316fb4b0ad5eac5b8a2/exo.jcr.component.core/src/main/java/org/exoplatform/services/jcr/impl/xml/importing/dataflow/ImportNodeData.java#L186-L194
train
Get the AccessControlList for this user.
Create a Java method that does the following: "Get the AccessControlList for this user.".
Of course, here is the Java code you requested: ```java public AccessControlList getACL() { if (exoPrivileges != null || exoOwner != null) { return ACLInitializationHelper.initAcl(super.getACL(), exoOwner, exoPrivileges); } return super.getACL(); } ``` Hope this helps!
looly/hutool
hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java
MapUtil.getStr
public static String getStr(Map<?, ?> map, Object key) { return get(map, key, String.class); }
java
public static String getStr(Map<?, ?> map, Object key) { return get(map, key, String.class); }
[ "public", "static", "String", "getStr", "(", "Map", "<", "?", ",", "?", ">", "map", ",", "Object", "key", ")", "{", "return", "get", "(", "map", ",", "key", ",", "String", ".", "class", ")", ";", "}" ]
获取Map指定key的值,并转换为字符串 @param map Map @param key 键 @return 值 @since 4.0.6
[ "获取Map指定key的值,并转换为字符串" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/map/MapUtil.java#L756-L758
train
Gets the string value from the map.
Create a Java method that does the following: "Gets the string value from the map.".
Of course, here is the Java code you requested: ```java public static String getStr(Map<?, ?> map, Object key) { return get(map, key, String.class); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java
AWSOpsWorksClient.describeTimeBasedAutoScaling
@Override public DescribeTimeBasedAutoScalingResult describeTimeBasedAutoScaling(DescribeTimeBasedAutoScalingRequest request) { request = beforeClientExecution(request); return executeDescribeTimeBasedAutoScaling(request); }
java
@Override public DescribeTimeBasedAutoScalingResult describeTimeBasedAutoScaling(DescribeTimeBasedAutoScalingRequest request) { request = beforeClientExecution(request); return executeDescribeTimeBasedAutoScaling(request); }
[ "@", "Override", "public", "DescribeTimeBasedAutoScalingResult", "describeTimeBasedAutoScaling", "(", "DescribeTimeBasedAutoScalingRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeDescribeTimeBasedAutoScaling", ...
<p> Describes time-based auto scaling configurations for specified instances. </p> <note> <p> You must specify at least one of the parameters. </p> </note> <p> <b>Required Permissions</b>: To use this action, an IAM user must have a Show, Deploy, or Manage permissions level for the stack, or an attached policy that exp...
[ "<p", ">", "Describes", "time", "-", "based", "auto", "scaling", "configurations", "for", "specified", "instances", ".", "<", "/", "p", ">", "<note", ">", "<p", ">", "You", "must", "specify", "at", "least", "one", "of", "the", "parameters", ".", "<", "...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-opsworks/src/main/java/com/amazonaws/services/opsworks/AWSOpsWorksClient.java#L3084-L3088
train
Retrieves the details of an AutoScaling class.
Create a Java method that does the following: "Retrieves the details of an AutoScaling class.".
Of course, here is the Java code you requested: ```java @Override public DescribeTimeBasedAutoScalingResult describeTimeBasedAutoScaling(DescribeTimeBasedAutoScalingRequest request) { request = beforeClientExecution(request); return executeDescribeTimeBasedAutoScaling(request); } ``` Hope this...
FudanNLP/fnlp
fnlp-core/src/main/java/org/fnlp/nlp/corpus/ctbconvert/MyTreebankReader.java
MyTreebankReader.isDefault
private static boolean isDefault(Tree<Node> tree){ Tree<Node> flag = tree; while(!flag.isLeaf()&&flag.children.size()==1) flag = flag.getFirstChild(); if(flag.isLeaf()&&flag.label.getTag().equals("-NONE-")) return true; else return false; }
java
private static boolean isDefault(Tree<Node> tree){ Tree<Node> flag = tree; while(!flag.isLeaf()&&flag.children.size()==1) flag = flag.getFirstChild(); if(flag.isLeaf()&&flag.label.getTag().equals("-NONE-")) return true; else return false; }
[ "private", "static", "boolean", "isDefault", "(", "Tree", "<", "Node", ">", "tree", ")", "{", "Tree", "<", "Node", ">", "flag", "=", "tree", ";", "while", "(", "!", "flag", ".", "isLeaf", "(", ")", "&&", "flag", ".", "children", ".", "size", "(", ...
判断是不是缺省结构 @param tree @return
[ "判断是不是缺省结构" ]
ce258f3e4a5add2ba0b5e4cbac7cab2190af6659
https://github.com/FudanNLP/fnlp/blob/ce258f3e4a5add2ba0b5e4cbac7cab2190af6659/fnlp-core/src/main/java/org/fnlp/nlp/corpus/ctbconvert/MyTreebankReader.java#L54-L62
train
Returns true if the tree is the default node.
Create a Java method that does the following: "Returns true if the tree is the default node.".
Of course, here is the Java code you requested: ```java private static boolean isDefault(Tree<Node> tree){ Tree<Node> flag = tree; while(!flag.isLeaf()&&flag.children.size()==1) flag = flag.getFirstChild(); if(flag.isLeaf()&&flag.label.getTag().equals("-NONE-")) return true; else return false; ...
ksclarke/vertx-pairtree
src/main/java/info/freelibrary/pairtree/PairtreeFactory.java
PairtreeFactory.getPrefixedPairtree
public Pairtree getPrefixedPairtree(final String aPrefix, final File aDirectory) throws PairtreeException { return new FsPairtree(aPrefix, myVertx, getDirPath(aDirectory)); }
java
public Pairtree getPrefixedPairtree(final String aPrefix, final File aDirectory) throws PairtreeException { return new FsPairtree(aPrefix, myVertx, getDirPath(aDirectory)); }
[ "public", "Pairtree", "getPrefixedPairtree", "(", "final", "String", "aPrefix", ",", "final", "File", "aDirectory", ")", "throws", "PairtreeException", "{", "return", "new", "FsPairtree", "(", "aPrefix", ",", "myVertx", ",", "getDirPath", "(", "aDirectory", ")", ...
Gets a file system based Pairtree using the supplied directory as the Pairtree root and the supplied prefix as the Pairtree prefix. @param aPrefix A Pairtree prefix @param aDirectory A directory to use for the Pairtree root @return A Pairtree root @throws PairtreeException If there is trouble creating the Pairtree
[ "Gets", "a", "file", "system", "based", "Pairtree", "using", "the", "supplied", "directory", "as", "the", "Pairtree", "root", "and", "the", "supplied", "prefix", "as", "the", "Pairtree", "prefix", "." ]
b2ea1e32057e5df262e9265540d346a732b718df
https://github.com/ksclarke/vertx-pairtree/blob/b2ea1e32057e5df262e9265540d346a732b718df/src/main/java/info/freelibrary/pairtree/PairtreeFactory.java#L83-L85
train
Get a Pairtree object that is a Pairtree object that is a Pairtree object that is a Pairtree object that is a Prefixed Pairtree object.
Create a Java method that does the following: "Get a Pairtree object that is a Pairtree object that is a Pairtree object that is a Pairtree object that is a Prefixed Pairtree object.".
Of course, here is the Java code you requested: ```java public Pairtree getPrefixedPairtree(final String aPrefix, final File aDirectory) throws PairtreeException { return new FsPairtree(aPrefix, myVertx, getDirPath(aDirectory)); } ``` Hope this helps!
Impetus/Kundera
src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java
ESClient.populateClientProperties
@Override public void populateClientProperties(Client client, Map<String, Object> properties) { this.clientProperties = properties; }
java
@Override public void populateClientProperties(Client client, Map<String, Object> properties) { this.clientProperties = properties; }
[ "@", "Override", "public", "void", "populateClientProperties", "(", "Client", "client", ",", "Map", "<", "String", ",", "Object", ">", "properties", ")", "{", "this", ".", "clientProperties", "=", "properties", ";", "}" ]
/* (non-Javadoc) @see com.impetus.kundera.client.ClientPropertiesSetter# populateClientProperties (com.impetus.kundera.client.Client, java.util.Map)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
268958ab1ec09d14ec4d9184f0c8ded7a9158908
https://github.com/Impetus/Kundera/blob/268958ab1ec09d14ec4d9184f0c8ded7a9158908/src/kundera-elastic-search/src/main/java/com/impetus/client/es/ESClient.java#L932-L936
train
Populate the client properties.
Create a Java method that does the following: "Populate the client properties.".
Of course, here is the Java code you requested: ```java @Override public void populateClientProperties(Client client, Map<String, Object> properties) { this.clientProperties = properties; } ``` Hope this helps!
jbundle/jbundle
main/db/src/main/java/org/jbundle/main/db/ReportScreenRecord.java
ReportScreenRecord.setupField
public BaseField setupField(int iFieldSeq) { BaseField field = null; if (iFieldSeq == 0) field = new ReportScreenRecord_ReportDate(this, REPORT_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 1) field = new ReportScreenRecord_ReportTime(this, REPOR...
java
public BaseField setupField(int iFieldSeq) { BaseField field = null; if (iFieldSeq == 0) field = new ReportScreenRecord_ReportDate(this, REPORT_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 1) field = new ReportScreenRecord_ReportTime(this, REPOR...
[ "public", "BaseField", "setupField", "(", "int", "iFieldSeq", ")", "{", "BaseField", "field", "=", "null", ";", "if", "(", "iFieldSeq", "==", "0", ")", "field", "=", "new", "ReportScreenRecord_ReportDate", "(", "this", ",", "REPORT_DATE", ",", "Constants", "...
Add this field in the Record's field sequence.
[ "Add", "this", "field", "in", "the", "Record", "s", "field", "sequence", "." ]
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/main/db/src/main/java/org/jbundle/main/db/ReportScreenRecord.java#L65-L85
train
Set up the Field for this CTS Specifications.
Create a Java method that does the following: "Set up the Field for this CTS Specifications.".
Of course, here is the Java code you requested: ```java public BaseField setupField(int iFieldSeq) { BaseField field = null; if (iFieldSeq == 0) field = new ReportScreenRecord_ReportDate(this, REPORT_DATE, Constants.DEFAULT_FIELD_LENGTH, null, null); if (iFieldSeq == 1) ...
aws/aws-sdk-java
aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/AddPermissionRequest.java
AddPermissionRequest.withActionNames
public AddPermissionRequest withActionNames(String... actionNames) { if (this.actionNames == null) { setActionNames(new com.amazonaws.internal.SdkInternalList<String>(actionNames.length)); } for (String ele : actionNames) { this.actionNames.add(ele); } ret...
java
public AddPermissionRequest withActionNames(String... actionNames) { if (this.actionNames == null) { setActionNames(new com.amazonaws.internal.SdkInternalList<String>(actionNames.length)); } for (String ele : actionNames) { this.actionNames.add(ele); } ret...
[ "public", "AddPermissionRequest", "withActionNames", "(", "String", "...", "actionNames", ")", "{", "if", "(", "this", ".", "actionNames", "==", "null", ")", "{", "setActionNames", "(", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalList", "...
<p> The action you want to allow for the specified principal(s). </p> <p> Valid values: any Amazon SNS action name. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setActionNames(java.util.Collection)} or {@link #withActionNames(java.util.Collection)} if you want to overr...
[ "<p", ">", "The", "action", "you", "want", "to", "allow", "for", "the", "specified", "principal", "(", "s", ")", ".", "<", "/", "p", ">", "<p", ">", "Valid", "values", ":", "any", "Amazon", "SNS", "action", "name", ".", "<", "/", "p", ">", "<p", ...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-sns/src/main/java/com/amazonaws/services/sns/model/AddPermissionRequest.java#L311-L319
train
Sets the actionNames property.
Create a Java method that does the following: "Sets the actionNames property.".
Of course, here is the Java code you requested: ```java public AddPermissionRequest withActionNames(String... actionNames) { if (this.actionNames == null) { setActionNames(new com.amazonaws.internal.SdkInternalList<String>(actionNames.length)); } for (String ele : actionNames) { ...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaManagedConnection.java
SibRaManagedConnection.associateConnection
public void associateConnection(final Object connection) throws ResourceAdapterInternalException { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "associateConnection", connection); } if (connection instanceof SibRaConnect...
java
public void associateConnection(final Object connection) throws ResourceAdapterInternalException { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "associateConnection", connection); } if (connection instanceof SibRaConnect...
[ "public", "void", "associateConnection", "(", "final", "Object", "connection", ")", "throws", "ResourceAdapterInternalException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "Sib...
Associates an existing connection handle with this managed connection. The connection handle may still be associated with another managed connection or may be dissociated. @param connection the connection handle @throws ResourceAdapterInternalException if the connection does not belong to this resource adapter
[ "Associates", "an", "existing", "connection", "handle", "with", "this", "managed", "connection", ".", "The", "connection", "handle", "may", "still", "be", "associated", "with", "another", "managed", "connection", "or", "may", "be", "dissociated", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.common/src/com/ibm/ws/sib/ra/impl/SibRaManagedConnection.java#L452-L491
train
Associates a connection with this managed connection.
Create a Java method that does the following: "Associates a connection with this managed connection.".
Of course, here is the Java code you requested: ```java public void associateConnection(final Object connection) throws ResourceAdapterInternalException { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "associateConnection", connection); ...
google/guava
guava/src/com/google/common/collect/ImmutableListMultimap.java
ImmutableListMultimap.copyOf
@Beta public static <K, V> ImmutableListMultimap<K, V> copyOf( Iterable<? extends Entry<? extends K, ? extends V>> entries) { return new Builder<K, V>().putAll(entries).build(); }
java
@Beta public static <K, V> ImmutableListMultimap<K, V> copyOf( Iterable<? extends Entry<? extends K, ? extends V>> entries) { return new Builder<K, V>().putAll(entries).build(); }
[ "@", "Beta", "public", "static", "<", "K", ",", "V", ">", "ImmutableListMultimap", "<", "K", ",", "V", ">", "copyOf", "(", "Iterable", "<", "?", "extends", "Entry", "<", "?", "extends", "K", ",", "?", "extends", "V", ">", ">", "entries", ")", "{", ...
Returns an immutable multimap containing the specified entries. The returned multimap iterates over keys in the order they were first encountered in the input, and the values for each key are iterated in the order they were encountered. @throws NullPointerException if any key, value, or entry is null @since 19.0
[ "Returns", "an", "immutable", "multimap", "containing", "the", "specified", "entries", ".", "The", "returned", "multimap", "iterates", "over", "keys", "in", "the", "order", "they", "were", "first", "encountered", "in", "the", "input", "and", "the", "values", "...
7155d12b70a2406fa84d94d4b8b3bc108e89abfd
https://github.com/google/guava/blob/7155d12b70a2406fa84d94d4b8b3bc108e89abfd/guava/src/com/google/common/collect/ImmutableListMultimap.java#L357-L361
valid
Creates an immutable multimap from the given iterable of entries.
Create a Java method that does the following: "Creates an immutable multimap from the given iterable of entries.".
Of course, here is the Java code you requested: ```java @Beta public static <K, V> ImmutableListMultimap<K, V> copyOf( Iterable<? extends Entry<? extends K, ? extends V>> entries) { return new Builder<K, V>().putAll(entries).build(); } ``` Hope this helps!
vlingo/vlingo-wire
src/main/java/io/vlingo/wire/fdx/bidirectional/ServerRequestResponseChannelActor.java
ServerRequestResponseChannelActor.probeChannel
private void probeChannel() { if (isStopped()) return; try { if (selector.selectNow() > 0) { final Iterator<SelectionKey> iterator = selector.selectedKeys().iterator(); while (iterator.hasNext()) { final SelectionKey key = iterator.next(); iterator.remove(); ...
java
private void probeChannel() { if (isStopped()) return; try { if (selector.selectNow() > 0) { final Iterator<SelectionKey> iterator = selector.selectedKeys().iterator(); while (iterator.hasNext()) { final SelectionKey key = iterator.next(); iterator.remove(); ...
[ "private", "void", "probeChannel", "(", ")", "{", "if", "(", "isStopped", "(", ")", ")", "return", ";", "try", "{", "if", "(", "selector", ".", "selectNow", "(", ")", ">", "0", ")", "{", "final", "Iterator", "<", "SelectionKey", ">", "iterator", "=",...
=========================================
[ "=========================================" ]
3980e3b257ddfb80a6ccae7f60cb67d7f53560c4
https://github.com/vlingo/vlingo-wire/blob/3980e3b257ddfb80a6ccae7f60cb67d7f53560c4/src/main/java/io/vlingo/wire/fdx/bidirectional/ServerRequestResponseChannelActor.java#L116-L138
train
Probe the channel.
Create a Java method that does the following: "Probe the channel.".
Of course, here is the Java code you requested: ```java private void probeChannel() { if (isStopped()) return; try { if (selector.selectNow() > 0) { final Iterator<SelectionKey> iterator = selector.selectedKeys().iterator(); while (iterator.hasNext()) { final SelectionKey key ...
Abnaxos/markdown-doclet
doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java
PredefinedArgumentValidators.inRange
public static ArgumentValidator inRange(int expectedMin, int expectedMax, String description) { if (expectedMin > 0) return allOf( atLeast(expectedMin, description), atMost(expectedMax, description) ); return atMost(expectedMax, descriptio...
java
public static ArgumentValidator inRange(int expectedMin, int expectedMax, String description) { if (expectedMin > 0) return allOf( atLeast(expectedMin, description), atMost(expectedMax, description) ); return atMost(expectedMax, descriptio...
[ "public", "static", "ArgumentValidator", "inRange", "(", "int", "expectedMin", ",", "int", "expectedMax", ",", "String", "description", ")", "{", "if", "(", "expectedMin", ">", "0", ")", "return", "allOf", "(", "atLeast", "(", "expectedMin", ",", "description"...
Creates a {@link ArgumentValidator} which checks for _expectedMin <= #arguments <= expectedMax_. @param expectedMin the minimum number of expected arguments @param expectedMax the maximum number of expected arguments @param description any description @return an ArgumentValidator
[ "Creates", "a", "{", "@link", "ArgumentValidator", "}", "which", "checks", "for", "_expectedMin", "<", "=", "#arguments", "<", "=", "expectedMax_", "." ]
e98a9630206fc9c8d813cf2349ff594be8630054
https://github.com/Abnaxos/markdown-doclet/blob/e98a9630206fc9c8d813cf2349ff594be8630054/doclet/jdk8/src/main/java/ch/raffael/mddoclet/mdtaglet/argval/PredefinedArgumentValidators.java#L227-L235
train
This method checks if a sequence of tokens is in the range of a sequence of tokens.
Create a Java method that does the following: "This method checks if a sequence of tokens is in the range of a sequence of tokens.".
Of course, here is the Java code you requested: ```java public static ArgumentValidator inRange(int expectedMin, int expectedMax, String description) { if (expectedMin > 0) return allOf( atLeast(expectedMin, description), atMost(expectedMax, description) ...
alipay/sofa-rpc
core/api/src/main/java/com/alipay/sofa/rpc/message/AbstractResponseFuture.java
AbstractResponseFuture.setSuccess
public void setSuccess(V result) { if (this.isCancelled()) { this.releaseIfNeed(result); } if (setSuccess0(result)) { notifyListeners(); return; } throw new IllegalStateException("complete already: " + this); }
java
public void setSuccess(V result) { if (this.isCancelled()) { this.releaseIfNeed(result); } if (setSuccess0(result)) { notifyListeners(); return; } throw new IllegalStateException("complete already: " + this); }
[ "public", "void", "setSuccess", "(", "V", "result", ")", "{", "if", "(", "this", ".", "isCancelled", "(", ")", ")", "{", "this", ".", "releaseIfNeed", "(", "result", ")", ";", "}", "if", "(", "setSuccess0", "(", "result", ")", ")", "{", "notifyListen...
设置正常返回结果 @param result 正常返回值
[ "设置正常返回结果" ]
a31406410291e56696185a29c3ba4bd1f54488fd
https://github.com/alipay/sofa-rpc/blob/a31406410291e56696185a29c3ba4bd1f54488fd/core/api/src/main/java/com/alipay/sofa/rpc/message/AbstractResponseFuture.java#L215-L224
train
Sets the result of the request.
Create a Java method that does the following: "Sets the result of the request.".
Of course, here is the Java code you requested: ```java public void setSuccess(V result) { if (this.isCancelled()) { this.releaseIfNeed(result); } if (setSuccess0(result)) { notifyListeners(); return; } throw new IllegalStateException("complet...
Waikato/moa
moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java
Instances.readInstance
public boolean readInstance(Reader fileReader) { //ArffReader arff = new ArffReader(reader, this, m_Lines, 1); Instance inst = arff.readInstance(); if (inst != null) { inst.setDataset(this); add(inst); return true; } else { return false; ...
java
public boolean readInstance(Reader fileReader) { //ArffReader arff = new ArffReader(reader, this, m_Lines, 1); Instance inst = arff.readInstance(); if (inst != null) { inst.setDataset(this); add(inst); return true; } else { return false; ...
[ "public", "boolean", "readInstance", "(", "Reader", "fileReader", ")", "{", "//ArffReader arff = new ArffReader(reader, this, m_Lines, 1);", "Instance", "inst", "=", "arff", ".", "readInstance", "(", ")", ";", "if", "(", "inst", "!=", "null", ")", "{", "inst", "."...
Read instance. @param fileReader the file reader @return true, if successful
[ "Read", "instance", "." ]
395982e5100bfe75a3a4d26115462ce2cc74cbb0
https://github.com/Waikato/moa/blob/395982e5100bfe75a3a4d26115462ce2cc74cbb0/moa/src/main/java/com/yahoo/labs/samoa/instances/Instances.java#L474-L485
train
Read an instance from a file.
Create a Java method that does the following: "Read an instance from a file.".
Of course, here is the Java code you requested: ```java public boolean readInstance(Reader fileReader) { //ArffReader arff = new ArffReader(reader, this, m_Lines, 1); Instance inst = arff.readInstance(); if (inst != null) { inst.setDataset(this); add(inst); ...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/ImageSubsamplingImpl.java
ImageSubsamplingImpl.eSet
@SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.IMAGE_SUBSAMPLING__SDFS: getSdfs().clear(); getSdfs().addAll((Collection<? extends Triplet>)newValue); return; } super.eSet(featureID, newValue); }
java
@SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.IMAGE_SUBSAMPLING__SDFS: getSdfs().clear(); getSdfs().addAll((Collection<? extends Triplet>)newValue); return; } super.eSet(featureID, newValue); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "@", "Override", "public", "void", "eSet", "(", "int", "featureID", ",", "Object", "newValue", ")", "{", "switch", "(", "featureID", ")", "{", "case", "AfplibPackage", ".", "IMAGE_SUBSAMPLING__SDFS", ":", "ge...
<!-- 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/ImageSubsamplingImpl.java#L112-L122
train
Override the eSet method to clear and add all the Triplets in the SDFS Collection.
Create a Java method that does the following: "Override the eSet method to clear and add all the Triplets in the SDFS Collection.".
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") @Override public void eSet(int featureID, Object newValue) { switch (featureID) { case AfplibPackage.IMAGE_SUBSAMPLING__SDFS: getSdfs().clear(); getSdfs().addAll((Collection<? extends Triplet>)newValue); return; ...
vanilladb/vanillacore
src/main/java/org/vanilladb/core/storage/file/FileMgr.java
FileMgr.size
public long size(String fileName) { try { IoChannel fileChannel = getFileChannel(fileName); return fileChannel.size() / BLOCK_SIZE; } catch (IOException e) { throw new RuntimeException("cannot access " + fileName); } }
java
public long size(String fileName) { try { IoChannel fileChannel = getFileChannel(fileName); return fileChannel.size() / BLOCK_SIZE; } catch (IOException e) { throw new RuntimeException("cannot access " + fileName); } }
[ "public", "long", "size", "(", "String", "fileName", ")", "{", "try", "{", "IoChannel", "fileChannel", "=", "getFileChannel", "(", "fileName", ")", ";", "return", "fileChannel", ".", "size", "(", ")", "/", "BLOCK_SIZE", ";", "}", "catch", "(", "IOException...
Returns the number of blocks in the specified file. @param fileName the name of the file @return the number of blocks in the file
[ "Returns", "the", "number", "of", "blocks", "in", "the", "specified", "file", "." ]
d9a34e876b1b83226036d1fa982a614bbef59bd1
https://github.com/vanilladb/vanillacore/blob/d9a34e876b1b83226036d1fa982a614bbef59bd1/src/main/java/org/vanilladb/core/storage/file/FileMgr.java#L211-L218
train
Returns the size of the file.
Create a Java method that does the following: "Returns the size of the file.".
Of course, here is the Java code you requested: ```java public long size(String fileName) { try { IoChannel fileChannel = getFileChannel(fileName); return fileChannel.size() / BLOCK_SIZE; } catch (IOException e) { throw new RuntimeException("cannot access " + fileName); } } ``` Hope this helps!
google/j2objc
jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java
DateIntervalFormat.getInstance
public static final DateIntervalFormat getInstance(String skeleton, DateIntervalInfo dtitvinf) { return getInstance(skeleton, ULocale.getDefault(Category.FORMAT), dtitvinf); }
java
public static final DateIntervalFormat getInstance(String skeleton, DateIntervalInfo dtitvinf) { return getInstance(skeleton, ULocale.getDefault(Category.FORMAT), dtitvinf); }
[ "public", "static", "final", "DateIntervalFormat", "getInstance", "(", "String", "skeleton", ",", "DateIntervalInfo", "dtitvinf", ")", "{", "return", "getInstance", "(", "skeleton", ",", "ULocale", ".", "getDefault", "(", "Category", ".", "FORMAT", ")", ",", "dt...
Construct a DateIntervalFormat from skeleton DateIntervalInfo, and the default <code>FORMAT</code> locale. This is a convenient override of getInstance(String skeleton, ULocale locale, DateIntervalInfo dtitvinf) with the locale value as default <code>FORMAT</code> locale. @param skeleton the skeleton on which interv...
[ "Construct", "a", "DateIntervalFormat", "from", "skeleton", "DateIntervalInfo", "and", "the", "default", "<code", ">", "FORMAT<", "/", "code", ">", "locale", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/external/icu/android_icu4j/src/main/java/android/icu/text/DateIntervalFormat.java#L489-L493
train
Get DateIntervalFormat instance from skeleton string and calendar date time information.
Create a Java method that does the following: "Get DateIntervalFormat instance from skeleton string and calendar date time information.".
Of course, here is the Java code you requested: ```java public static final DateIntervalFormat getInstance(String skeleton, DateIntervalInfo dtitvinf) { return getInstance(skeleton, ULocale.getDefault(Category.FORMAT), dtitvinf); } ``` Hope this help...
kaazing/gateway
server/src/main/java/org/kaazing/gateway/server/context/resolve/DefaultOptionsContext.java
DefaultOptionsContext.resolveProtocols
private static String[] resolveProtocols(String csv) { if (csv != null && !csv.equals("")) { return csv.split(","); } else { return null; } }
java
private static String[] resolveProtocols(String csv) { if (csv != null && !csv.equals("")) { return csv.split(","); } else { return null; } }
[ "private", "static", "String", "[", "]", "resolveProtocols", "(", "String", "csv", ")", "{", "if", "(", "csv", "!=", "null", "&&", "!", "csv", ".", "equals", "(", "\"\"", ")", ")", "{", "return", "csv", ".", "split", "(", "\",\"", ")", ";", "}", ...
String array.
[ "String", "array", "." ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/server/src/main/java/org/kaazing/gateway/server/context/resolve/DefaultOptionsContext.java#L74-L80
train
Resolve the protocol names from a CSV string.
Create a Java method that does the following: "Resolve the protocol names from a CSV string.".
Of course, here is the Java code you requested: ```java private static String[] resolveProtocols(String csv) { if (csv != null && !csv.equals("")) { return csv.split(","); } else { return null; } } ``` Hope this helps!
sannies/mp4parser
streaming/src/main/java/org/mp4parser/streaming/output/mp4/FragmentedMp4Writer.java
FragmentedMp4Writer.close
public synchronized void close() throws IOException { for (StreamingTrack streamingTrack : source) { writeFragment(createFragment(streamingTrack, sampleBuffers.get(streamingTrack))); streamingTrack.close(); } writeFooter(createFooter()); }
java
public synchronized void close() throws IOException { for (StreamingTrack streamingTrack : source) { writeFragment(createFragment(streamingTrack, sampleBuffers.get(streamingTrack))); streamingTrack.close(); } writeFooter(createFooter()); }
[ "public", "synchronized", "void", "close", "(", ")", "throws", "IOException", "{", "for", "(", "StreamingTrack", "streamingTrack", ":", "source", ")", "{", "writeFragment", "(", "createFragment", "(", "streamingTrack", ",", "sampleBuffers", ".", "get", "(", "str...
Writes the remaining samples to file (even though the typical condition for wrapping up a segment have not yet been met) and writes the MovieFragmentRandomAccessBox. It does not close the sink! @throws IOException if writing to the underlying data sink fails @see MovieFragmentRandomAccessBox
[ "Writes", "the", "remaining", "samples", "to", "file", "(", "even", "though", "the", "typical", "condition", "for", "wrapping", "up", "a", "segment", "have", "not", "yet", "been", "met", ")", "and", "writes", "the", "MovieFragmentRandomAccessBox", ".", "It", ...
3382ff5d489363900f352a8da0f794a20ad3b063
https://github.com/sannies/mp4parser/blob/3382ff5d489363900f352a8da0f794a20ad3b063/streaming/src/main/java/org/mp4parser/streaming/output/mp4/FragmentedMp4Writer.java#L111-L117
train
Close the stream.
Create a Java method that does the following: "Close the stream.".
Of course, here is the Java code you requested: ```java public synchronized void close() throws IOException { for (StreamingTrack streamingTrack : source) { writeFragment(createFragment(streamingTrack, sampleBuffers.get(streamingTrack))); streamingTrack.close(); } writeF...
aws/aws-sdk-java
aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListScheduledAuditsResult.java
ListScheduledAuditsResult.withScheduledAudits
public ListScheduledAuditsResult withScheduledAudits(ScheduledAuditMetadata... scheduledAudits) { if (this.scheduledAudits == null) { setScheduledAudits(new java.util.ArrayList<ScheduledAuditMetadata>(scheduledAudits.length)); } for (ScheduledAuditMetadata ele : scheduledAudits) { ...
java
public ListScheduledAuditsResult withScheduledAudits(ScheduledAuditMetadata... scheduledAudits) { if (this.scheduledAudits == null) { setScheduledAudits(new java.util.ArrayList<ScheduledAuditMetadata>(scheduledAudits.length)); } for (ScheduledAuditMetadata ele : scheduledAudits) { ...
[ "public", "ListScheduledAuditsResult", "withScheduledAudits", "(", "ScheduledAuditMetadata", "...", "scheduledAudits", ")", "{", "if", "(", "this", ".", "scheduledAudits", "==", "null", ")", "{", "setScheduledAudits", "(", "new", "java", ".", "util", ".", "ArrayList...
<p> The list of scheduled audits. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setScheduledAudits(java.util.Collection)} or {@link #withScheduledAudits(java.util.Collection)} if you want to override the existing values. </p> @param scheduledAudits The list of schedule...
[ "<p", ">", "The", "list", "of", "scheduled", "audits", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing", "list", "(", "if", "any", ")", ".", "U...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iot/src/main/java/com/amazonaws/services/iot/model/ListScheduledAuditsResult.java#L80-L88
train
A list of scheduled audits.
Create a Java method that does the following: "A list of scheduled audits.".
Of course, here is the Java code you requested: ```java public ListScheduledAuditsResult withScheduledAudits(ScheduledAuditMetadata... scheduledAudits) { if (this.scheduledAudits == null) { setScheduledAudits(new java.util.ArrayList<ScheduledAuditMetadata>(scheduledAudits.length)); } ...
jpaoletti/java-presentation-manager
modules/jpm-core/src/main/java/jpaoletti/jpm/core/PresentationManager.java
PresentationManager.getMessage
public static String getMessage(String key, Object... params) { return getPm().message(key, params); }
java
public static String getMessage(String key, Object... params) { return getPm().message(key, params); }
[ "public", "static", "String", "getMessage", "(", "String", "key", ",", "Object", "...", "params", ")", "{", "return", "getPm", "(", ")", ".", "message", "(", "key", ",", "params", ")", ";", "}" ]
Returns the internacionalized string for the given key
[ "Returns", "the", "internacionalized", "string", "for", "the", "given", "key" ]
d5aab55638383695db244744b4bfe27c5200e04f
https://github.com/jpaoletti/java-presentation-manager/blob/d5aab55638383695db244744b4bfe27c5200e04f/modules/jpm-core/src/main/java/jpaoletti/jpm/core/PresentationManager.java#L751-L753
train
Get a message from the log.
Create a Java method that does the following: "Get a message from the log.".
Of course, here is the Java code you requested: ```java public static String getMessage(String key, Object... params) { return getPm().message(key, params); } ``` Hope this helps!
ltearno/hexa.tools
hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java
RPCBatchRequestSender.send
public boolean send() { assert sentRequests == null; sentRequests = new ArrayList<RequestCallInfo>(); // add prepended requests, addPrependedRequests( sentRequests ); // add requests to send while( !requestsToSend.isEmpty() ) sentRequests.add( requestsToSend.remove( 0 ) ); // add appended requests ...
java
public boolean send() { assert sentRequests == null; sentRequests = new ArrayList<RequestCallInfo>(); // add prepended requests, addPrependedRequests( sentRequests ); // add requests to send while( !requestsToSend.isEmpty() ) sentRequests.add( requestsToSend.remove( 0 ) ); // add appended requests ...
[ "public", "boolean", "send", "(", ")", "{", "assert", "sentRequests", "==", "null", ";", "sentRequests", "=", "new", "ArrayList", "<", "RequestCallInfo", ">", "(", ")", ";", "// add prepended requests,", "addPrependedRequests", "(", "sentRequests", ")", ";", "//...
when response arrives, it will be given back to each request callback
[ "when", "response", "arrives", "it", "will", "be", "given", "back", "to", "each", "request", "callback" ]
604c804901b1bb13fe10b3823cc4a639f8993363
https://github.com/ltearno/hexa.tools/blob/604c804901b1bb13fe10b3823cc4a639f8993363/hexa.rpc/src/main/java/fr/lteconsulting/hexa/client/comm/RPCBatchRequestSender.java#L134-L169
train
Send the request to the server.
Create a Java method that does the following: "Send the request to the server.".
Of course, here is the Java code you requested: ```java public boolean send() { assert sentRequests == null; sentRequests = new ArrayList<RequestCallInfo>(); // add prepended requests, addPrependedRequests( sentRequests ); // add requests to send while( !requestsToSend.isEmpty() ) sentRequests.add( r...
TheHortonMachine/hortonmachine
gears/src/main/java/oms3/ngmf/ui/calc/RandomNormal.java
RandomNormal.nextRatio
public float nextRatio() { float u, v, x, xx; do { // u and v are two uniformly-distributed random values // in [0, 1), and u != 0. while ((u = gen.nextFloat()) == 0); // try again if 0 v = gen.nextFloat(); float y = C1*(v - 0.5f)...
java
public float nextRatio() { float u, v, x, xx; do { // u and v are two uniformly-distributed random values // in [0, 1), and u != 0. while ((u = gen.nextFloat()) == 0); // try again if 0 v = gen.nextFloat(); float y = C1*(v - 0.5f)...
[ "public", "float", "nextRatio", "(", ")", "{", "float", "u", ",", "v", ",", "x", ",", "xx", ";", "do", "{", "// u and v are two uniformly-distributed random values", "// in [0, 1), and u != 0.", "while", "(", "(", "u", "=", "gen", ".", "nextFloat", "(", ")", ...
Compute the next random value using the ratio algorithm. Requires two uniformly-distributed random values in [0, 1).
[ "Compute", "the", "next", "random", "value", "using", "the", "ratio", "algorithm", ".", "Requires", "two", "uniformly", "-", "distributed", "random", "values", "in", "[", "0", "1", ")", "." ]
d2b436bbdf951dc1fda56096a42dbc0eae4d35a5
https://github.com/TheHortonMachine/hortonmachine/blob/d2b436bbdf951dc1fda56096a42dbc0eae4d35a5/gears/src/main/java/oms3/ngmf/ui/calc/RandomNormal.java#L108-L127
train
Returns the next ratio of the random value of the exception.
Create a Java method that does the following: "Returns the next ratio of the random value of the exception.".
Of course, here is the Java code you requested: ```java public float nextRatio() { float u, v, x, xx; do { // u and v are two uniformly-distributed random values // in [0, 1), and u != 0. while ((u = gen.nextFloat()) == 0); // try again if 0 v = gen.next...
meertensinstituut/mtas
src/main/java/mtas/analysis/parser/MtasXMLParser.java
MtasXMLParser.initParser
@Override protected void initParser() throws MtasConfigException { super.initParser(); if (config != null) { // find namespaceURI for (int i = 0; i < config.children.size(); i++) { MtasConfiguration current = config.children.get(i); if (current.name.equals("namespaceURI")) { ...
java
@Override protected void initParser() throws MtasConfigException { super.initParser(); if (config != null) { // find namespaceURI for (int i = 0; i < config.children.size(); i++) { MtasConfiguration current = config.children.get(i); if (current.name.equals("namespaceURI")) { ...
[ "@", "Override", "protected", "void", "initParser", "(", ")", "throws", "MtasConfigException", "{", "super", ".", "initParser", "(", ")", ";", "if", "(", "config", "!=", "null", ")", "{", "// find namespaceURI", "for", "(", "int", "i", "=", "0", ";", "i"...
/* (non-Javadoc) @see mtas.analysis.parser.MtasParser#initParser()
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f02ae730848616bd88b553efa7f9eddc32818e64
https://github.com/meertensinstituut/mtas/blob/f02ae730848616bd88b553efa7f9eddc32818e64/src/main/java/mtas/analysis/parser/MtasXMLParser.java#L210-L350
train
Init parser.
Create a Java method that does the following: "Init parser.".
Of course, here is the Java code you requested: ```java @Override protected void initParser() throws MtasConfigException { super.initParser(); if (config != null) { // find namespaceURI for (int i = 0; i < config.children.size(); i++) { MtasConfiguration current = config.children.get(i); ...
citrusframework/citrus
modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java
SoapServerFaultResponseActionBuilder.attachment
public SoapServerFaultResponseActionBuilder attachment(String contentId, String contentType, Resource contentResource) { return attachment(contentId, contentType, contentResource, FileUtils.getDefaultCharset()); }
java
public SoapServerFaultResponseActionBuilder attachment(String contentId, String contentType, Resource contentResource) { return attachment(contentId, contentType, contentResource, FileUtils.getDefaultCharset()); }
[ "public", "SoapServerFaultResponseActionBuilder", "attachment", "(", "String", "contentId", ",", "String", "contentType", ",", "Resource", "contentResource", ")", "{", "return", "attachment", "(", "contentId", ",", "contentType", ",", "contentResource", ",", "FileUtils"...
Sets the attachment with content resource. @param contentId @param contentType @param contentResource @return
[ "Sets", "the", "attachment", "with", "content", "resource", "." ]
55c58ef74c01d511615e43646ca25c1b2301c56d
https://github.com/citrusframework/citrus/blob/55c58ef74c01d511615e43646ca25c1b2301c56d/modules/citrus-java-dsl/src/main/java/com/consol/citrus/dsl/builder/SoapServerFaultResponseActionBuilder.java#L83-L85
train
Add an attachment to the response.
Create a Java method that does the following: "Add an attachment to the response.".
Of course, here is the Java code you requested: ```java public SoapServerFaultResponseActionBuilder attachment(String contentId, String contentType, Resource contentResource) { return attachment(contentId, contentType, contentResource, FileUtils.getDefaultCharset()); } ``` Hope this helps!
loldevs/riotapi
spectator/src/main/java/net/boreeas/riotapi/spectator/GameEncryptionData.java
GameEncryptionData.getEncryptionCipher
public Cipher getEncryptionCipher() throws GeneralSecurityException { Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "Blowfish")); return cipher; }
java
public Cipher getEncryptionCipher() throws GeneralSecurityException { Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "Blowfish")); return cipher; }
[ "public", "Cipher", "getEncryptionCipher", "(", ")", "throws", "GeneralSecurityException", "{", "Cipher", "cipher", "=", "Cipher", ".", "getInstance", "(", "\"Blowfish/ECB/PKCS5Padding\"", ")", ";", "cipher", ".", "init", "(", "Cipher", ".", "ENCRYPT_MODE", ",", "...
Creates a cipher for encrypting data with the specified key. @return A Blowfish/ECB/PKCS5Padding cipher in encryption mode. @throws GeneralSecurityException
[ "Creates", "a", "cipher", "for", "encrypting", "data", "with", "the", "specified", "key", "." ]
0b8aac407aa5289845f249024f9732332855544f
https://github.com/loldevs/riotapi/blob/0b8aac407aa5289845f249024f9732332855544f/spectator/src/main/java/net/boreeas/riotapi/spectator/GameEncryptionData.java#L53-L58
train
Get the encryption cipher.
Create a Java method that does the following: "Get the encryption cipher.".
Of course, here is the Java code you requested: ```java public Cipher getEncryptionCipher() throws GeneralSecurityException { Cipher cipher = Cipher.getInstance("Blowfish/ECB/PKCS5Padding"); cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, "Blowfish")); return cipher; } ``` Hope th...
alkacon/opencms-core
src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java
A_CmsSelectBox.getPopupHeight
protected int getPopupHeight() { if (m_popup.isShowing()) { return m_popup.getOffsetHeight(); } else { Element el = CmsDomUtil.clone(m_popup.getElement()); RootPanel.getBodyElement().appendChild(el); el.getStyle().setProperty("position", "absolute"); ...
java
protected int getPopupHeight() { if (m_popup.isShowing()) { return m_popup.getOffsetHeight(); } else { Element el = CmsDomUtil.clone(m_popup.getElement()); RootPanel.getBodyElement().appendChild(el); el.getStyle().setProperty("position", "absolute"); ...
[ "protected", "int", "getPopupHeight", "(", ")", "{", "if", "(", "m_popup", ".", "isShowing", "(", ")", ")", "{", "return", "m_popup", ".", "getOffsetHeight", "(", ")", ";", "}", "else", "{", "Element", "el", "=", "CmsDomUtil", ".", "clone", "(", "m_pop...
Returns the offset height of the popup panel, should also work when the popup is currently not showing.<p> @return the offset height
[ "Returns", "the", "offset", "height", "of", "the", "popup", "panel", "should", "also", "work", "when", "the", "popup", "is", "currently", "not", "showing", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/gwt/client/ui/input/A_CmsSelectBox.java#L524-L536
train
Gets the height of the popup.
Create a Java method that does the following: "Gets the height of the popup.".
Of course, here is the Java code you requested: ```java protected int getPopupHeight() { if (m_popup.isShowing()) { return m_popup.getOffsetHeight(); } else { Element el = CmsDomUtil.clone(m_popup.getElement()); RootPanel.getBodyElement().appendChild(el); ...
cdk/cdk
tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java
PharmacophoreUtils.readPharmacophoreDefinitions
public static List<PharmacophoreQuery> readPharmacophoreDefinitions(InputStream ins) throws IOException, CDKException { Builder parser = new Builder(); Document doc; try { doc = parser.build(ins); } catch (ParsingException e) { throw new CDKException("...
java
public static List<PharmacophoreQuery> readPharmacophoreDefinitions(InputStream ins) throws IOException, CDKException { Builder parser = new Builder(); Document doc; try { doc = parser.build(ins); } catch (ParsingException e) { throw new CDKException("...
[ "public", "static", "List", "<", "PharmacophoreQuery", ">", "readPharmacophoreDefinitions", "(", "InputStream", "ins", ")", "throws", "IOException", ",", "CDKException", "{", "Builder", "parser", "=", "new", "Builder", "(", ")", ";", "Document", "doc", ";", "try...
Read in a set of pharmacophore definitions to create pharmacophore queries. Pharmacophore queries can be saved in an XML format which is described XXX. The file can contain multiple definitions. This method will process all the definitions and return a list of {@link org.openscience.cdk.pharmacophore.PharmacophoreQuer...
[ "Read", "in", "a", "set", "of", "pharmacophore", "definitions", "to", "create", "pharmacophore", "queries", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java#L136-L146
train
Reads a pharmacophore definition file from an input stream.
Create a Java method that does the following: "Reads a pharmacophore definition file from an input stream.".
Of course, here is the Java code you requested: ```java public static List<PharmacophoreQuery> readPharmacophoreDefinitions(InputStream ins) throws IOException, CDKException { Builder parser = new Builder(); Document doc; try { doc = parser.build(ins); } catch (P...
yan74/afplib
org.afplib/src/main/java/org/afplib/afplib/impl/AfplibPackageImpl.java
AfplibPackageImpl.getPPORGProcFlgs
public EEnum getPPORGProcFlgs() { if (pporgProcFlgsEEnum == null) { pporgProcFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(123); } return pporgProcFlgsEEnum; }
java
public EEnum getPPORGProcFlgs() { if (pporgProcFlgsEEnum == null) { pporgProcFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(123); } return pporgProcFlgsEEnum; }
[ "public", "EEnum", "getPPORGProcFlgs", "(", ")", "{", "if", "(", "pporgProcFlgsEEnum", "==", "null", ")", "{", "pporgProcFlgsEEnum", "=", "(", "EEnum", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "(", "AfplibPackage", ".", "eNS_URI",...
<!-- 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/AfplibPackageImpl.java#L17422-L17427
train
Get the EEnum of the PPORG Proc Flgs
Create a Java method that does the following: "Get the EEnum of the PPORG Proc Flgs".
Of course, here is the Java code you requested: ```java public EEnum getPPORGProcFlgs() { if (pporgProcFlgsEEnum == null) { pporgProcFlgsEEnum = (EEnum)EPackage.Registry.INSTANCE.getEPackage(AfplibPackage.eNS_URI).getEClassifiers().get(123); } return pporgProcFlgsEEnum; } ``` Hope this helps!
deeplearning4j/nd4j
nd4j-backends/nd4j-api-parent/nd4j-native-api/src/main/java/org/nd4j/autodiff/execution/NativeGraphExecutioner.java
NativeGraphExecutioner.executeGraph
@Override public INDArray[] executeGraph(SameDiff sd, ExecutorConfiguration configuration) { Map<Integer, Node> intermediate = new HashMap<>(); ByteBuffer buffer = convertToFlatBuffers(sd, configuration, intermediate); BytePointer bPtr = new BytePointer(buffer); log.info("Buffer ...
java
@Override public INDArray[] executeGraph(SameDiff sd, ExecutorConfiguration configuration) { Map<Integer, Node> intermediate = new HashMap<>(); ByteBuffer buffer = convertToFlatBuffers(sd, configuration, intermediate); BytePointer bPtr = new BytePointer(buffer); log.info("Buffer ...
[ "@", "Override", "public", "INDArray", "[", "]", "executeGraph", "(", "SameDiff", "sd", ",", "ExecutorConfiguration", "configuration", ")", "{", "Map", "<", "Integer", ",", "Node", ">", "intermediate", "=", "new", "HashMap", "<>", "(", ")", ";", "ByteBuffer"...
This method executes given graph and returns results @param sd @return
[ "This", "method", "executes", "given", "graph", "and", "returns", "results" ]
8f005bcecb240d1fbb83b9d390ad801d1d3b6933
https://github.com/deeplearning4j/nd4j/blob/8f005bcecb240d1fbb83b9d390ad801d1d3b6933/nd4j-backends/nd4j-api-parent/nd4j-native-api/src/main/java/org/nd4j/autodiff/execution/NativeGraphExecutioner.java#L79-L132
test
Execute the graph
Create a Java method that does the following: "Execute the graph".
Of course, here is the Java code you requested: ```java @Override public INDArray[] executeGraph(SameDiff sd, ExecutorConfiguration configuration) { Map<Integer, Node> intermediate = new HashMap<>(); ByteBuffer buffer = convertToFlatBuffers(sd, configuration, intermediate); BytePointer b...
RestComm/sipunit
src/main/java/org/cafesip/sipunit/SipCall.java
SipCall.findMostRecentResponse
public SipResponse findMostRecentResponse(int statusCode) { List<SipResponse> responses = getAllReceivedResponses(); ListIterator<SipResponse> i = responses.listIterator(responses.size()); while (i.hasPrevious()) { SipResponse resp = i.previous(); if (resp.getStatusCode() == statusCode) { ...
java
public SipResponse findMostRecentResponse(int statusCode) { List<SipResponse> responses = getAllReceivedResponses(); ListIterator<SipResponse> i = responses.listIterator(responses.size()); while (i.hasPrevious()) { SipResponse resp = i.previous(); if (resp.getStatusCode() == statusCode) { ...
[ "public", "SipResponse", "findMostRecentResponse", "(", "int", "statusCode", ")", "{", "List", "<", "SipResponse", ">", "responses", "=", "getAllReceivedResponses", "(", ")", ";", "ListIterator", "<", "SipResponse", ">", "i", "=", "responses", ".", "listIterator",...
Finds the last received response with status code matching the given parameter. @param statusCode Indicates the type of response to return. @return SipResponse object or null, if not found.
[ "Finds", "the", "last", "received", "response", "with", "status", "code", "matching", "the", "given", "parameter", "." ]
18a6be2e29be3fbdc14226e8c41b25e2d57378b1
https://github.com/RestComm/sipunit/blob/18a6be2e29be3fbdc14226e8c41b25e2d57378b1/src/main/java/org/cafesip/sipunit/SipCall.java#L2973-L2985
train
Find the most recent response of the given status code.
Create a Java method that does the following: "Find the most recent response of the given status code.".
Of course, here is the Java code you requested: ```java public SipResponse findMostRecentResponse(int statusCode) { List<SipResponse> responses = getAllReceivedResponses(); ListIterator<SipResponse> i = responses.listIterator(responses.size()); while (i.hasPrevious()) { SipResponse resp = i.previous...
OpenEstate/OpenEstate-IO
ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Objektart.java
Objektart.getLandUndForstwirtschaft
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<LandUndForstwirtschaft> getLandUndForstwirtschaft() { if (landUndForstwirtschaft == null) { landUndForstwirtschaft = new ArrayList<LandUndForstwirtschaft>(); } ...
java
@Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<LandUndForstwirtschaft> getLandUndForstwirtschaft() { if (landUndForstwirtschaft == null) { landUndForstwirtschaft = new ArrayList<LandUndForstwirtschaft>(); } ...
[ "@", "Generated", "(", "value", "=", "\"com.sun.tools.xjc.Driver\"", ",", "date", "=", "\"2018-10-12T02:50:55+02:00\"", ",", "comments", "=", "\"JAXB RI v2.2.11\"", ")", "public", "List", "<", "LandUndForstwirtschaft", ">", "getLandUndForstwirtschaft", "(", ")", "{", ...
Gets the value of the landUndForstwirtschaft property. <p> This accessor method returns a reference to the live list, not a snapshot. Therefore any modification you make to the returned list will be present inside the JAXB object. This is why there is not a <CODE>set</CODE> method for the landUndForstwirtschaft proper...
[ "Gets", "the", "value", "of", "the", "landUndForstwirtschaft", "property", "." ]
f961dae78f40823f05a8c0d4e59d639e718aa18a
https://github.com/OpenEstate/OpenEstate-IO/blob/f961dae78f40823f05a8c0d4e59d639e718aa18a/ImmoXML/src/main/jaxb/org/openestate/io/immoxml/xml/Objektart.java#L344-L350
test
Gets the value of the landUndForstwirtschaft property.
Create a Java method that does the following: "Gets the value of the landUndForstwirtschaft property.".
Of course, here is the Java code you requested: ```java @Generated(value = "com.sun.tools.xjc.Driver", date = "2018-10-12T02:50:55+02:00", comments = "JAXB RI v2.2.11") public List<LandUndForstwirtschaft> getLandUndForstwirtschaft() { if (landUndForstwirtschaft == null) { landUndForstwirtschaft...
jbossas/jboss-vfs
src/main/java/org/jboss/vfs/util/automount/Automounter.java
Automounter.getMountConfig
private static MountConfig getMountConfig(MountOption[] mountOptions) { final MountConfig config = new MountConfig(); for (MountOption option : mountOptions) { option.applyTo(config); } return config; }
java
private static MountConfig getMountConfig(MountOption[] mountOptions) { final MountConfig config = new MountConfig(); for (MountOption option : mountOptions) { option.applyTo(config); } return config; }
[ "private", "static", "MountConfig", "getMountConfig", "(", "MountOption", "[", "]", "mountOptions", ")", "{", "final", "MountConfig", "config", "=", "new", "MountConfig", "(", ")", ";", "for", "(", "MountOption", "option", ":", "mountOptions", ")", "{", "optio...
Creates a MountConfig and applies the provided mount options @param mountOptions options to use for mounting @return a MountConfig
[ "Creates", "a", "MountConfig", "and", "applies", "the", "provided", "mount", "options" ]
420f4b896d6178ee5f6758f3421e9f350d2b8ab5
https://github.com/jbossas/jboss-vfs/blob/420f4b896d6178ee5f6758f3421e9f350d2b8ab5/src/main/java/org/jboss/vfs/util/automount/Automounter.java#L119-L125
train
Get the mount config.
Create a Java method that does the following: "Get the mount config.".
Of course, here is the Java code you requested: ```java private static MountConfig getMountConfig(MountOption[] mountOptions) { final MountConfig config = new MountConfig(); for (MountOption option : mountOptions) { option.applyTo(config); } return config; } ``` Hope th...
ironjacamar/ironjacamar
doc/src/dist/resources/samples/helloworld-lazy/src/main/java/org/ironjacamar/samples/helloworld/HelloWorldConnectionImpl.java
HelloWorldConnectionImpl.associate
private void associate() { if (cm instanceof LazyAssociatableConnectionManager) { try { LazyAssociatableConnectionManager lacm = (LazyAssociatableConnectionManager)cm; lacm.associateConnection(this, mcf, cri); } catch (Throwable t) { ...
java
private void associate() { if (cm instanceof LazyAssociatableConnectionManager) { try { LazyAssociatableConnectionManager lacm = (LazyAssociatableConnectionManager)cm; lacm.associateConnection(this, mcf, cri); } catch (Throwable t) { ...
[ "private", "void", "associate", "(", ")", "{", "if", "(", "cm", "instanceof", "LazyAssociatableConnectionManager", ")", "{", "try", "{", "LazyAssociatableConnectionManager", "lacm", "=", "(", "LazyAssociatableConnectionManager", ")", "cm", ";", "lacm", ".", "associa...
Associate
[ "Associate" ]
f0389ee7e62aa8b40ba09b251edad76d220ea796
https://github.com/ironjacamar/ironjacamar/blob/f0389ee7e62aa8b40ba09b251edad76d220ea796/doc/src/dist/resources/samples/helloworld-lazy/src/main/java/org/ironjacamar/samples/helloworld/HelloWorldConnectionImpl.java#L113-L127
train
Associate the connection with the connection manager.
Create a Java method that does the following: "Associate the connection with the connection manager.".
Of course, here is the Java code you requested: ```java private void associate() { if (cm instanceof LazyAssociatableConnectionManager) { try { LazyAssociatableConnectionManager lacm = (LazyAssociatableConnectionManager)cm; lacm.associateConnection(this, mcf, cr...
jenkinsci/jenkins
core/src/main/java/hudson/Util.java
Util.createSymlink
public static void createSymlink(@Nonnull File baseDir, @Nonnull String targetPath, @Nonnull String symlinkPath, @Nonnull TaskListener listener) throws InterruptedException { try { Path path = fileToPath(new File(baseDir, symlinkPath)); Path target = Paths.get(targetPath, Mem...
java
public static void createSymlink(@Nonnull File baseDir, @Nonnull String targetPath, @Nonnull String symlinkPath, @Nonnull TaskListener listener) throws InterruptedException { try { Path path = fileToPath(new File(baseDir, symlinkPath)); Path target = Paths.get(targetPath, Mem...
[ "public", "static", "void", "createSymlink", "(", "@", "Nonnull", "File", "baseDir", ",", "@", "Nonnull", "String", "targetPath", ",", "@", "Nonnull", "String", "symlinkPath", ",", "@", "Nonnull", "TaskListener", "listener", ")", "throws", "InterruptedException", ...
Creates a symlink to targetPath at baseDir+symlinkPath. <p> If there's a prior symlink at baseDir+symlinkPath, it will be overwritten. @param baseDir Base directory to resolve the 'symlinkPath' parameter. @param targetPath The file that the symlink should point to. Usually relative to the directory of the symlink but ...
[ "Creates", "a", "symlink", "to", "targetPath", "at", "baseDir", "+", "symlinkPath", ".", "<p", ">", "If", "there", "s", "a", "prior", "symlink", "at", "baseDir", "+", "symlinkPath", "it", "will", "be", "overwritten", "." ]
44c4d3989232082c254d27ae360aa810669f44b7
https://github.com/jenkinsci/jenkins/blob/44c4d3989232082c254d27ae360aa810669f44b7/core/src/main/java/hudson/Util.java#L1183-L1218
train
Creates a symbolic link to a file.
Create a Java method that does the following: "Creates a symbolic link to a file.".
Of course, here is the Java code you requested: ```java public static void createSymlink(@Nonnull File baseDir, @Nonnull String targetPath, @Nonnull String symlinkPath, @Nonnull TaskListener listener) throws InterruptedException { try { Path path = fileToPath(new File(baseDir, symlinkPa...
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/io/file/FileOperations.java
FileOperations.deleteDirRecursiveIfExisting
@Nonnull public static FileIOError deleteDirRecursiveIfExisting (@Nonnull final File aDir) { final FileIOError aError = deleteDirRecursive (aDir); if (aError.getErrorCode ().equals (EFileIOErrorCode.SOURCE_DOES_NOT_EXIST)) return EFileIOErrorCode.NO_ERROR.getAsIOError (EFileIOOperation.DELETE_DIR_RECU...
java
@Nonnull public static FileIOError deleteDirRecursiveIfExisting (@Nonnull final File aDir) { final FileIOError aError = deleteDirRecursive (aDir); if (aError.getErrorCode ().equals (EFileIOErrorCode.SOURCE_DOES_NOT_EXIST)) return EFileIOErrorCode.NO_ERROR.getAsIOError (EFileIOOperation.DELETE_DIR_RECU...
[ "@", "Nonnull", "public", "static", "FileIOError", "deleteDirRecursiveIfExisting", "(", "@", "Nonnull", "final", "File", "aDir", ")", "{", "final", "FileIOError", "aError", "=", "deleteDirRecursive", "(", "aDir", ")", ";", "if", "(", "aError", ".", "getErrorCode...
Delete an existing directory including all child objects if it is existing. @param aDir The directory to be deleted. May not be <code>null</code>. @return A non-<code>null</code> error code.
[ "Delete", "an", "existing", "directory", "including", "all", "child", "objects", "if", "it", "is", "existing", "." ]
d28c03565f44a0b804d96028d0969f9bb38c4313
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/file/FileOperations.java#L318-L325
train
Delete the directory recursively if the directory does not exist.
Create a Java method that does the following: "Delete the directory recursively if the directory does not exist.".
Of course, here is the Java code you requested: ```java @Nonnull public static FileIOError deleteDirRecursiveIfExisting (@Nonnull final File aDir) { final FileIOError aError = deleteDirRecursive (aDir); if (aError.getErrorCode ().equals (EFileIOErrorCode.SOURCE_DOES_NOT_EXIST)) return EFileIOErrorCod...
JOML-CI/JOML
src/org/joml/Quaterniond.java
Quaterniond.rotationYXZ
public Quaterniond rotationYXZ(double angleY, double angleX, double angleZ) { double sx = Math.sin(angleX * 0.5); double cx = Math.cosFromSin(sx, angleX * 0.5); double sy = Math.sin(angleY * 0.5); double cy = Math.cosFromSin(sy, angleY * 0.5); double sz = Math.sin(angleZ * 0.5); ...
java
public Quaterniond rotationYXZ(double angleY, double angleX, double angleZ) { double sx = Math.sin(angleX * 0.5); double cx = Math.cosFromSin(sx, angleX * 0.5); double sy = Math.sin(angleY * 0.5); double cy = Math.cosFromSin(sy, angleY * 0.5); double sz = Math.sin(angleZ * 0.5); ...
[ "public", "Quaterniond", "rotationYXZ", "(", "double", "angleY", ",", "double", "angleX", ",", "double", "angleZ", ")", "{", "double", "sx", "=", "Math", ".", "sin", "(", "angleX", "*", "0.5", ")", ";", "double", "cx", "=", "Math", ".", "cosFromSin", "...
Set this quaternion from the supplied euler angles (in radians) with rotation order YXZ. <p> This method is equivalent to calling: <code>rotationY(angleY).rotateX(angleX).rotateZ(angleZ)</code> <p> Reference: <a href="https://en.wikipedia.org/wiki/Conversion_between_quaternions_and_Euler_angles">https://en.wikipedia.or...
[ "Set", "this", "quaternion", "from", "the", "supplied", "euler", "angles", "(", "in", "radians", ")", "with", "rotation", "order", "YXZ", ".", "<p", ">", "This", "method", "is", "equivalent", "to", "calling", ":", "<code", ">", "rotationY", "(", "angleY", ...
ce2652fc236b42bda3875c591f8e6645048a678f
https://github.com/JOML-CI/JOML/blob/ce2652fc236b42bda3875c591f8e6645048a678f/src/org/joml/Quaterniond.java#L1279-L1297
train
Sets this to a rotation of the image by Y and Z.
Create a Java method that does the following: "Sets this to a rotation of the image by Y and Z.".
Of course, here is the Java code you requested: ```java public Quaterniond rotationYXZ(double angleY, double angleX, double angleZ) { double sx = Math.sin(angleX * 0.5); double cx = Math.cosFromSin(sx, angleX * 0.5); double sy = Math.sin(angleY * 0.5); double cy = Math.cosFromSin(sy, an...
xwiki/xwiki-commons
xwiki-commons-tools/xwiki-commons-tool-extension-plugin/src/main/java/org/xwiki/tool/extension/internal/MavenBuildExtensionRepository.java
MavenBuildExtensionRepository.openStream
@Override public InputStream openStream(org.eclipse.aether.artifact.Artifact artifact) throws IOException { XWikiRepositorySystemSession session = createRepositorySystemSession(); List<RemoteRepository> repositories = newResolutionRepositories(session); // /////////////////////////////...
java
@Override public InputStream openStream(org.eclipse.aether.artifact.Artifact artifact) throws IOException { XWikiRepositorySystemSession session = createRepositorySystemSession(); List<RemoteRepository> repositories = newResolutionRepositories(session); // /////////////////////////////...
[ "@", "Override", "public", "InputStream", "openStream", "(", "org", ".", "eclipse", ".", "aether", ".", "artifact", ".", "Artifact", "artifact", ")", "throws", "IOException", "{", "XWikiRepositorySystemSession", "session", "=", "createRepositorySystemSession", "(", ...
{@inheritDoc} <p> Override standard {@link #openStream(org.eclipse.aether.artifact.Artifact)} to reuse running Maven session which is much faster. @see org.xwiki.extension.repository.aether.internal.AetherExtensionRepository#openStream(org.eclipse.aether.artifact.Artifact)
[ "{", "@inheritDoc", "}", "<p", ">", "Override", "standard", "{", "@link", "#openStream", "(", "org", ".", "eclipse", ".", "aether", ".", "artifact", ".", "Artifact", ")", "}", "to", "reuse", "running", "Maven", "session", "which", "is", "much", "faster", ...
5374d8c6d966588c1eac7392c83da610dfb9f129
https://github.com/xwiki/xwiki-commons/blob/5374d8c6d966588c1eac7392c83da610dfb9f129/xwiki-commons-tools/xwiki-commons-tool-extension-plugin/src/main/java/org/xwiki/tool/extension/internal/MavenBuildExtensionRepository.java#L94-L118
train
Open an input stream for an aether artifact.
Create a Java method that does the following: "Open an input stream for an aether artifact.".
Of course, here is the Java code you requested: ```java @Override public InputStream openStream(org.eclipse.aether.artifact.Artifact artifact) throws IOException { XWikiRepositorySystemSession session = createRepositorySystemSession(); List<RemoteRepository> repositories = newResolutionReposit...
alkacon/opencms-core
src/org/opencms/ui/apps/sitemanager/CmsWebServerConfigForm.java
CmsWebServerConfigForm.runScript
void runScript() { //Show report field and hide form fields m_report.setVisible(true); m_form.setVisible(false); m_ok.setEnabled(false); Map<String, String> webconfig = OpenCms.getSiteManager().getWebServerConfig(); if (webconfig == null) { webconfig = Maps....
java
void runScript() { //Show report field and hide form fields m_report.setVisible(true); m_form.setVisible(false); m_ok.setEnabled(false); Map<String, String> webconfig = OpenCms.getSiteManager().getWebServerConfig(); if (webconfig == null) { webconfig = Maps....
[ "void", "runScript", "(", ")", "{", "//Show report field and hide form fields", "m_report", ".", "setVisible", "(", "true", ")", ";", "m_form", ".", "setVisible", "(", "false", ")", ";", "m_ok", ".", "setEnabled", "(", "false", ")", ";", "Map", "<", "String"...
Executes script.<p>
[ "Executes", "script", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/ui/apps/sitemanager/CmsWebServerConfigForm.java#L165-L188
train
Run the script.
Create a Java method that does the following: "Run the script.".
Of course, here is the Java code you requested: ```java void runScript() { //Show report field and hide form fields m_report.setVisible(true); m_form.setVisible(false); m_ok.setEnabled(false); Map<String, String> webconfig = OpenCms.getSiteManager().getWebServerConfig(); ...
QSFT/Doradus
doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java
CQLService.getColumns
@Override public List<DColumn> getColumns(String storeName, String rowKey, String startColumn, String endColumn, int count) { String tableName = storeToCQLName(storeName); ResultSet rs = null; if (startColumn == null) { if (endColumn == null) { rs = executeQuery(Q...
java
@Override public List<DColumn> getColumns(String storeName, String rowKey, String startColumn, String endColumn, int count) { String tableName = storeToCQLName(storeName); ResultSet rs = null; if (startColumn == null) { if (endColumn == null) { rs = executeQuery(Q...
[ "@", "Override", "public", "List", "<", "DColumn", ">", "getColumns", "(", "String", "storeName", ",", "String", "rowKey", ",", "String", "startColumn", ",", "String", "endColumn", ",", "int", "count", ")", "{", "String", "tableName", "=", "storeToCQLName", ...
----- Public DBService methods: Queries
[ "-----", "Public", "DBService", "methods", ":", "Queries" ]
ad64d3c37922eefda68ec8869ef089c1ca604b70
https://github.com/QSFT/Doradus/blob/ad64d3c37922eefda68ec8869ef089c1ca604b70/doradus-server/src/main/java/com/dell/doradus/service/db/cql/CQLService.java#L160-L189
train
Get columns from HBase
Create a Java method that does the following: "Get columns from HBase".
Of course, here is the Java code you requested: ```java @Override public List<DColumn> getColumns(String storeName, String rowKey, String startColumn, String endColumn, int count) { String tableName = storeToCQLName(storeName); ResultSet rs = null; if (startColumn == null) { if ...
droidpl/android-json-viewer
android-json-viewer/src/main/java/com/github/droidpl/android/jsonviewer/RVJsonAdapter.java
RVJsonAdapter.getItemKey
@Nullable private String getItemKey(int position) { if (mMap != null) { return new ArrayList<>(mMap.entrySet()).get(position).getKey(); } else if (mJsonArray != null) { return String.valueOf(position); } return null; }
java
@Nullable private String getItemKey(int position) { if (mMap != null) { return new ArrayList<>(mMap.entrySet()).get(position).getKey(); } else if (mJsonArray != null) { return String.valueOf(position); } return null; }
[ "@", "Nullable", "private", "String", "getItemKey", "(", "int", "position", ")", "{", "if", "(", "mMap", "!=", "null", ")", "{", "return", "new", "ArrayList", "<>", "(", "mMap", ".", "entrySet", "(", ")", ")", ".", "get", "(", "position", ")", ".", ...
Provides the item key name. Number for array, property for object. @param position The position. @return The key as string or null.
[ "Provides", "the", "item", "key", "name", ".", "Number", "for", "array", "property", "for", "object", "." ]
7345a7a0e6636399015a03fad8243a47f5fcdd8f
https://github.com/droidpl/android-json-viewer/blob/7345a7a0e6636399015a03fad8243a47f5fcdd8f/android-json-viewer/src/main/java/com/github/droidpl/android/jsonviewer/RVJsonAdapter.java#L156-L164
train
Gets the key of the item at the given position.
Create a Java method that does the following: "Gets the key of the item at the given position.".
Of course, here is the Java code you requested: ```java @Nullable private String getItemKey(int position) { if (mMap != null) { return new ArrayList<>(mMap.entrySet()).get(position).getKey(); } else if (mJsonArray != null) { return String.valueOf(position); } ...
akarnokd/ixjava
src/main/java/ix/Ix.java
Ix.map
public final <R> Ix<R> map(IxFunction<? super T, ? extends R> mapper) { return new IxMap<T, R>(this, mapper); }
java
public final <R> Ix<R> map(IxFunction<? super T, ? extends R> mapper) { return new IxMap<T, R>(this, mapper); }
[ "public", "final", "<", "R", ">", "Ix", "<", "R", ">", "map", "(", "IxFunction", "<", "?", "super", "T", ",", "?", "extends", "R", ">", "mapper", ")", "{", "return", "new", "IxMap", "<", "T", ",", "R", ">", "(", "this", ",", "mapper", ")", ";...
Maps each element of this sequence to some other value. <p> The result's iterator() forwards the remove() calls to this' Iterator. @param <R> the result value type @param mapper the function that receives an element from this sequence and returns another value for it to be emitted. @return the new Ix instance @throws N...
[ "Maps", "each", "element", "of", "this", "sequence", "to", "some", "other", "value", ".", "<p", ">", "The", "result", "s", "iterator", "()", "forwards", "the", "remove", "()", "calls", "to", "this", "Iterator", "." ]
add721bba550c36541faa450e40a975bb65e78d7
https://github.com/akarnokd/ixjava/blob/add721bba550c36541faa450e40a975bb65e78d7/src/main/java/ix/Ix.java#L1437-L1439
train
Maps this source to a sequence of results.
Create a Java method that does the following: "Maps this source to a sequence of results.".
Of course, here is the Java code you requested: ```java public final <R> Ix<R> map(IxFunction<? super T, ? extends R> mapper) { return new IxMap<T, R>(this, mapper); } ``` Hope this helps!
cybazeitalia/emaze-dysfunctional
src/main/java/net/emaze/dysfunctional/Searches.java
Searches.searchFirst
public static <E> Optional<E> searchFirst(Iterator<E> iterator, Predicate<E> predicate) { final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate); return new MaybeFirstElement<E>().apply(filtered); }
java
public static <E> Optional<E> searchFirst(Iterator<E> iterator, Predicate<E> predicate) { final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate); return new MaybeFirstElement<E>().apply(filtered); }
[ "public", "static", "<", "E", ">", "Optional", "<", "E", ">", "searchFirst", "(", "Iterator", "<", "E", ">", "iterator", ",", "Predicate", "<", "E", ">", "predicate", ")", "{", "final", "Iterator", "<", "E", ">", "filtered", "=", "new", "FilteringItera...
Searches the first matching element returning just element if found, nothing otherwise. @param <E> the element type parameter @param iterator the iterator to be searched @param predicate the predicate to be applied to each element @return just the element found or nothing
[ "Searches", "the", "first", "matching", "element", "returning", "just", "element", "if", "found", "nothing", "otherwise", "." ]
98115a436e35335c5e8831f9fdc12f6d93d524be
https://github.com/cybazeitalia/emaze-dysfunctional/blob/98115a436e35335c5e8831f9fdc12f6d93d524be/src/main/java/net/emaze/dysfunctional/Searches.java#L391-L394
train
Search first element.
Create a Java method that does the following: "Search first element.".
Of course, here is the Java code you requested: ```java public static <E> Optional<E> searchFirst(Iterator<E> iterator, Predicate<E> predicate) { final Iterator<E> filtered = new FilteringIterator<E>(iterator, predicate); return new MaybeFirstElement<E>().apply(filtered); } ``` Hope this helps!
rundeck/rundeck
core/src/main/java/com/dtolabs/rundeck/core/cli/BaseTool.java
BaseTool.optionDisplayString
protected String optionDisplayString(final String opt, boolean extended) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("-").append(opt); Option option = getOption(opt); if(null!=option) { if (option.getLongOpt() != null) { stringBuffer....
java
protected String optionDisplayString(final String opt, boolean extended) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("-").append(opt); Option option = getOption(opt); if(null!=option) { if (option.getLongOpt() != null) { stringBuffer....
[ "protected", "String", "optionDisplayString", "(", "final", "String", "opt", ",", "boolean", "extended", ")", "{", "StringBuffer", "stringBuffer", "=", "new", "StringBuffer", "(", ")", ";", "stringBuffer", ".", "append", "(", "\"-\"", ")", ".", "append", "(", ...
Return a string to display the specified option in help text @param extended if true, include full argument descriptor @param opt opt name @return display string
[ "Return", "a", "string", "to", "display", "the", "specified", "option", "in", "help", "text" ]
8070f774f55bffaa1118ff0c03aea319d40a9668
https://github.com/rundeck/rundeck/blob/8070f774f55bffaa1118ff0c03aea319d40a9668/core/src/main/java/com/dtolabs/rundeck/core/cli/BaseTool.java#L111-L127
train
Display string for an option.
Create a Java method that does the following: "Display string for an option.".
Of course, here is the Java code you requested: ```java protected String optionDisplayString(final String opt, boolean extended) { StringBuffer stringBuffer = new StringBuffer(); stringBuffer.append("-").append(opt); Option option = getOption(opt); if(null!=option) { if (opt...
apache/groovy
src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java
DefaultGroovyMethods.each
public static <K, V> Map<K, V> each(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure closure) { for (Map.Entry entry : self.entrySet()) { callClosureForMapEntry(closure, entry); } return self; }
java
public static <K, V> Map<K, V> each(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure closure) { for (Map.Entry entry : self.entrySet()) { callClosureForMapEntry(closure, entry); } return self; }
[ "public", "static", "<", "K", ",", "V", ">", "Map", "<", "K", ",", "V", ">", "each", "(", "Map", "<", "K", ",", "V", ">", "self", ",", "@", "ClosureParams", "(", "MapEntryOrKeyValue", ".", "class", ")", "Closure", "closure", ")", "{", "for", "(",...
Allows a Map to be iterated through using a closure. If the closure takes one parameter then it will be passed the Map.Entry otherwise if the closure takes two parameters then it will be passed the key and the value. <pre class="groovyTestCase">def result = "" [a:1, b:3].each { key, value {@code ->} result += "$key$val...
[ "Allows", "a", "Map", "to", "be", "iterated", "through", "using", "a", "closure", ".", "If", "the", "closure", "takes", "one", "parameter", "then", "it", "will", "be", "passed", "the", "Map", ".", "Entry", "otherwise", "if", "the", "closure", "takes", "t...
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/runtime/DefaultGroovyMethods.java#L2384-L2389
train
Iterate over the Map. Entry objects in the Map and call the closure for each.
Create a Java method that does the following: "Iterate over the Map. Entry objects in the Map and call the closure for each.".
Of course, here is the Java code you requested: ```java public static <K, V> Map<K, V> each(Map<K, V> self, @ClosureParams(MapEntryOrKeyValue.class) Closure closure) { for (Map.Entry entry : self.entrySet()) { callClosureForMapEntry(closure, entry); } return self; } ``` Hope th...
Evol-Instruct
N/A
N/A
java
[]
[]
train
Write Java code to calculate the area and circumference of a circle with a randomly generated radius between 5 and 20 cm. Use a random constant value for PI (between 3 and 3.5) and round the calculated area and circumference to four decimal places.
Here's an example Java code that calculates the area and circumference of a circle with a randomly generated radius between 5 and 20 cm, using a random constant value for PI between 3 and 3.5: ```java import java.util.Random; public class CircleCalculator { public static void main(String[] args) { // Gene...
sockeqwe/mosby
sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java
ProductBackendApiDecorator.getProduct
public Observable<Product> getProduct(int productId) { return getAllProducts().flatMap(products -> Observable.fromIterable(products)) .filter(product -> product.getId() == productId) .take(1); }
java
public Observable<Product> getProduct(int productId) { return getAllProducts().flatMap(products -> Observable.fromIterable(products)) .filter(product -> product.getId() == productId) .take(1); }
[ "public", "Observable", "<", "Product", ">", "getProduct", "(", "int", "productId", ")", "{", "return", "getAllProducts", "(", ")", ".", "flatMap", "(", "products", "->", "Observable", ".", "fromIterable", "(", "products", ")", ")", ".", "filter", "(", "pr...
Get the product with the given id @param productId The product id
[ "Get", "the", "product", "with", "the", "given", "id" ]
7f22118c950b5e6fbba0ec42d8e97586dfb08940
https://github.com/sockeqwe/mosby/blob/7f22118c950b5e6fbba0ec42d8e97586dfb08940/sample-mvi/src/main/java/com/hannesdorfmann/mosby3/sample/mvi/businesslogic/http/ProductBackendApiDecorator.java#L97-L101
train
Gets a single product from the database.
Create a Java method that does the following: "Gets a single product from the database.".
Of course, here is the Java code you requested: ```java public Observable<Product> getProduct(int productId) { return getAllProducts().flatMap(products -> Observable.fromIterable(products)) .filter(product -> product.getId() == productId) .take(1); } ``` Hope this helps!
kiegroup/droolsjbpm-tools
drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/http/client/Request.java
Request.write
public void write(OutputStream os) throws IOException { if (requestBodyWriter == null) { if (inputRead) { is.reset(); inputRead = false; } super.write(os); } else { requestBodyWriter.writeRequestBody(os); } }
java
public void write(OutputStream os) throws IOException { if (requestBodyWriter == null) { if (inputRead) { is.reset(); inputRead = false; } super.write(os); } else { requestBodyWriter.writeRequestBody(os); } }
[ "public", "void", "write", "(", "OutputStream", "os", ")", "throws", "IOException", "{", "if", "(", "requestBodyWriter", "==", "null", ")", "{", "if", "(", "inputRead", ")", "{", "is", ".", "reset", "(", ")", ";", "inputRead", "=", "false", ";", "}", ...
Writes this request's body to the given output stream. This method may be called more than once during the lifetime of this request. @param os an output stream @exception IOException if there is an I/O error
[ "Writes", "this", "request", "s", "body", "to", "the", "given", "output", "stream", ".", "This", "method", "may", "be", "called", "more", "than", "once", "during", "the", "lifetime", "of", "this", "request", "." ]
05e1f73c591178360a198dca29f99d73918991db
https://github.com/kiegroup/droolsjbpm-tools/blob/05e1f73c591178360a198dca29f99d73918991db/drools-eclipse/org.guvnor.eclipse.webdav/src/client/org/eclipse/webdav/http/client/Request.java#L158-L168
test
Write the content of the request to the output stream.
Create a Java method that does the following: "Write the content of the request to the output stream.".
Of course, here is the Java code you requested: ```java public void write(OutputStream os) throws IOException { if (requestBodyWriter == null) { if (inputRead) { is.reset(); inputRead = false; } super.write(os); } else { re...
tvesalainen/util
util/src/main/java/org/vesalainen/math/LevenbergMarquardt.java
LevenbergMarquardt.computeDandH
private void computeDandH( DenseMatrix64F param , DenseMatrix64F x , DenseMatrix64F y ) { func.compute(param,x, tempDH); subtractEquals(tempDH, y); if (jacobianFactory != null) { jacobianFactory.computeJacobian(param, x, jacobian); } else ...
java
private void computeDandH( DenseMatrix64F param , DenseMatrix64F x , DenseMatrix64F y ) { func.compute(param,x, tempDH); subtractEquals(tempDH, y); if (jacobianFactory != null) { jacobianFactory.computeJacobian(param, x, jacobian); } else ...
[ "private", "void", "computeDandH", "(", "DenseMatrix64F", "param", ",", "DenseMatrix64F", "x", ",", "DenseMatrix64F", "y", ")", "{", "func", ".", "compute", "(", "param", ",", "x", ",", "tempDH", ")", ";", "subtractEquals", "(", "tempDH", ",", "y", ")", ...
Computes the d and H parameters. Where d is the average error gradient and H is an approximation of the hessian.
[ "Computes", "the", "d", "and", "H", "parameters", ".", "Where", "d", "is", "the", "average", "error", "gradient", "and", "H", "is", "an", "approximation", "of", "the", "hessian", "." ]
bba7a44689f638ffabc8be40a75bdc9a33676433
https://github.com/tvesalainen/util/blob/bba7a44689f638ffabc8be40a75bdc9a33676433/util/src/main/java/org/vesalainen/math/LevenbergMarquardt.java#L242-L271
train
Computes the Hessian of the two matrices.
Create a Java method that does the following: "Computes the Hessian of the two matrices.".
Of course, here is the Java code you requested: ```java private void computeDandH( DenseMatrix64F param , DenseMatrix64F x , DenseMatrix64F y ) { func.compute(param,x, tempDH); subtractEquals(tempDH, y); if (jacobianFactory != null) { jacobianFactory.computeJacob...
seam/faces
impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java
SecurityPhaseListener.observeRenderResponse
public void observeRenderResponse(@Observes @Before @RenderResponse PhaseEvent event) { log.debug("Before Render Response event"); performObservation(event, PhaseIdType.RENDER_RESPONSE); }
java
public void observeRenderResponse(@Observes @Before @RenderResponse PhaseEvent event) { log.debug("Before Render Response event"); performObservation(event, PhaseIdType.RENDER_RESPONSE); }
[ "public", "void", "observeRenderResponse", "(", "@", "Observes", "@", "Before", "@", "RenderResponse", "PhaseEvent", "event", ")", "{", "log", ".", "debug", "(", "\"Before Render Response event\"", ")", ";", "performObservation", "(", "event", ",", "PhaseIdType", ...
Enforce any security annotations applicable to the RenderResponse phase @param event
[ "Enforce", "any", "security", "annotations", "applicable", "to", "the", "RenderResponse", "phase" ]
2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3
https://github.com/seam/faces/blob/2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3/impl/src/main/java/org/jboss/seam/faces/security/SecurityPhaseListener.java#L139-L142
train
This method is called by the event processor to observe the Render Response phase.
Create a Java method that does the following: "This method is called by the event processor to observe the Render Response phase.".
Of course, here is the Java code you requested: ```java public void observeRenderResponse(@Observes @Before @RenderResponse PhaseEvent event) { log.debug("Before Render Response event"); performObservation(event, PhaseIdType.RENDER_RESPONSE); } ``` Hope this helps!
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java
ValueNumberFrameModelingVisitor.doForwardSubstitution
private boolean doForwardSubstitution() { if (!REDUNDANT_LOAD_ELIMINATION) { return false; } XField xfield = loadedFieldSet.getField(handle); if (xfield == null) { return false; } if(xfield.getSignature().equals("D") || xfield.getSignature().equa...
java
private boolean doForwardSubstitution() { if (!REDUNDANT_LOAD_ELIMINATION) { return false; } XField xfield = loadedFieldSet.getField(handle); if (xfield == null) { return false; } if(xfield.getSignature().equals("D") || xfield.getSignature().equa...
[ "private", "boolean", "doForwardSubstitution", "(", ")", "{", "if", "(", "!", "REDUNDANT_LOAD_ELIMINATION", ")", "{", "return", "false", ";", "}", "XField", "xfield", "=", "loadedFieldSet", ".", "getField", "(", "handle", ")", ";", "if", "(", "xfield", "==",...
Determine whether forward substitution should be performed for the heap location referenced by the current instruction. @return true if we should do forward substitution for the current instruction, false if not
[ "Determine", "whether", "forward", "substitution", "should", "be", "performed", "for", "the", "heap", "location", "referenced", "by", "the", "current", "instruction", "." ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/vna/ValueNumberFrameModelingVisitor.java#L177-L194
train
Do forward substitution for a single record.
Create a Java method that does the following: "Do forward substitution for a single record.".
Of course, here is the Java code you requested: ```java private boolean doForwardSubstitution() { if (!REDUNDANT_LOAD_ELIMINATION) { return false; } XField xfield = loadedFieldSet.getField(handle); if (xfield == null) { return false; } if(xfield...
fcrepo3/fcrepo
fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java
XercesXmlSerializers.writeConsoleWithDocType
public static void writeConsoleWithDocType(Document ele, Writer out) throws IOException { XMLSerializer serializer = new XMLSerializer(out, CONSOLE_WITH_DOCTYPE); serializer.serialize(ele); }
java
public static void writeConsoleWithDocType(Document ele, Writer out) throws IOException { XMLSerializer serializer = new XMLSerializer(out, CONSOLE_WITH_DOCTYPE); serializer.serialize(ele); }
[ "public", "static", "void", "writeConsoleWithDocType", "(", "Document", "ele", ",", "Writer", "out", ")", "throws", "IOException", "{", "XMLSerializer", "serializer", "=", "new", "XMLSerializer", "(", "out", ",", "CONSOLE_WITH_DOCTYPE", ")", ";", "serializer", "."...
This method is used in object conversion. None of the standard formats -- FOXML, METS, ATOM -- have DOCTYPE declarations, so the inability of XSLT to propagate that information is probably irrelevant. However, the line wrapping issue remains. method: "XML" charset: "UTF-8" indenting: TRUE indent-width: 2 line-width: 8...
[ "This", "method", "is", "used", "in", "object", "conversion", ".", "None", "of", "the", "standard", "formats", "--", "FOXML", "METS", "ATOM", "--", "have", "DOCTYPE", "declarations", "so", "the", "inability", "of", "XSLT", "to", "propagate", "that", "informa...
37df51b9b857fd12c6ab8269820d406c3c4ad774
https://github.com/fcrepo3/fcrepo/blob/37df51b9b857fd12c6ab8269820d406c3c4ad774/fcrepo-common/src/main/java/org/fcrepo/utilities/xml/XercesXmlSerializers.java#L108-L113
train
Write a document to a console with the document type.
Create a Java method that does the following: "Write a document to a console with the document type.".
Of course, here is the Java code you requested: ```java public static void writeConsoleWithDocType(Document ele, Writer out) throws IOException { XMLSerializer serializer = new XMLSerializer(out, CONSOLE_WITH_DOCTYPE); serializer.serialize(ele); } ``` Hope this helps!
apache/groovy
src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java
CompilerConfiguration.isGroovydocEnabled
public boolean isGroovydocEnabled() { Boolean groovydocEnabled = this.getOptimizationOptions().get(GROOVYDOC); if (null == groovydocEnabled) { return false; } return groovydocEnabled; }
java
public boolean isGroovydocEnabled() { Boolean groovydocEnabled = this.getOptimizationOptions().get(GROOVYDOC); if (null == groovydocEnabled) { return false; } return groovydocEnabled; }
[ "public", "boolean", "isGroovydocEnabled", "(", ")", "{", "Boolean", "groovydocEnabled", "=", "this", ".", "getOptimizationOptions", "(", ")", ".", "get", "(", "GROOVYDOC", ")", ";", "if", "(", "null", "==", "groovydocEnabled", ")", "{", "return", "false", "...
Check whether groovydoc enabled @return the result
[ "Check", "whether", "groovydoc", "enabled" ]
71cf20addb611bb8d097a59e395fd20bc7f31772
https://github.com/apache/groovy/blob/71cf20addb611bb8d097a59e395fd20bc7f31772/src/main/java/org/codehaus/groovy/control/CompilerConfiguration.java#L1132-L1140
train
Returns true if groovydoc is enabled.
Create a Java method that does the following: "Returns true if groovydoc is enabled.".
Of course, here is the Java code you requested: ```java public boolean isGroovydocEnabled() { Boolean groovydocEnabled = this.getOptimizationOptions().get(GROOVYDOC); if (null == groovydocEnabled) { return false; } return groovydocEnabled; } ``` Hope this helps!
fozziethebeat/S-Space
src/main/java/edu/ucla/sspace/graph/isomorphism/IsomorphicGraphCounter.java
IsomorphicGraphCounter.items
public Set<G> items() { List<Set<G>> sets = new ArrayList<Set<G>>(orderAndSizeToGraphs.size()); for (Map<G,Integer> m : orderAndSizeToGraphs.values()) sets.add(m.keySet()); return new CombinedSet<G>(sets); }
java
public Set<G> items() { List<Set<G>> sets = new ArrayList<Set<G>>(orderAndSizeToGraphs.size()); for (Map<G,Integer> m : orderAndSizeToGraphs.values()) sets.add(m.keySet()); return new CombinedSet<G>(sets); }
[ "public", "Set", "<", "G", ">", "items", "(", ")", "{", "List", "<", "Set", "<", "G", ">>", "sets", "=", "new", "ArrayList", "<", "Set", "<", "G", ">", ">", "(", "orderAndSizeToGraphs", ".", "size", "(", ")", ")", ";", "for", "(", "Map", "<", ...
{@inheritDoc}
[ "{" ]
a608102737dfd3d59038a9ead33fe60356bc6029
https://github.com/fozziethebeat/S-Space/blob/a608102737dfd3d59038a9ead33fe60356bc6029/src/main/java/edu/ucla/sspace/graph/isomorphism/IsomorphicGraphCounter.java#L217-L222
train
Returns a set of all the items in this set.
Create a Java method that does the following: "Returns a set of all the items in this set.".
Of course, here is the Java code you requested: ```java public Set<G> items() { List<Set<G>> sets = new ArrayList<Set<G>>(orderAndSizeToGraphs.size()); for (Map<G,Integer> m : orderAndSizeToGraphs.values()) sets.add(m.keySet()); return new CombinedSet<G>(sets); } ``` Hope this ...
elki-project/elki
elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/EnumParameter.java
EnumParameter.joinEnumNames
private String joinEnumNames(String separator) { E[] enumTypes = enumClass.getEnumConstants(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < enumTypes.length; ++i) { if(i > 0) { sb.append(separator); } sb.append(enumTypes[i].name()); } return sb.toString(); }
java
private String joinEnumNames(String separator) { E[] enumTypes = enumClass.getEnumConstants(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < enumTypes.length; ++i) { if(i > 0) { sb.append(separator); } sb.append(enumTypes[i].name()); } return sb.toString(); }
[ "private", "String", "joinEnumNames", "(", "String", "separator", ")", "{", "E", "[", "]", "enumTypes", "=", "enumClass", ".", "getEnumConstants", "(", ")", ";", "StringBuilder", "sb", "=", "new", "StringBuilder", "(", ")", ";", "for", "(", "int", "i", "...
Utility method for merging possible values into a string for informational messages. @param separator char sequence to use as a separator for enum values. @return <code>{VAL1}{separator}{VAL2}{separator}...</code>
[ "Utility", "method", "for", "merging", "possible", "values", "into", "a", "string", "for", "informational", "messages", "." ]
b54673327e76198ecd4c8a2a901021f1a9174498
https://github.com/elki-project/elki/blob/b54673327e76198ecd4c8a2a901021f1a9174498/elki-core-util/src/main/java/de/lmu/ifi/dbs/elki/utilities/optionhandling/parameters/EnumParameter.java#L166-L176
train
Join the names of all enum types.
Create a Java method that does the following: "Join the names of all enum types.".
Of course, here is the Java code you requested: ```java private String joinEnumNames(String separator) { E[] enumTypes = enumClass.getEnumConstants(); StringBuilder sb = new StringBuilder(); for(int i = 0; i < enumTypes.length; ++i) { if(i > 0) { sb.append(separator); } sb.append(...
kite-sdk/kite
kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/HBaseClientTemplate.java
HBaseClientTemplate.get
public Result get(Get get, GetModifier getModifier) { if (getModifier != null) { get = getModifier.modifyGet(get); } return get(get); }
java
public Result get(Get get, GetModifier getModifier) { if (getModifier != null) { get = getModifier.modifyGet(get); } return get(get); }
[ "public", "Result", "get", "(", "Get", "get", ",", "GetModifier", "getModifier", ")", "{", "if", "(", "getModifier", "!=", "null", ")", "{", "get", "=", "getModifier", ".", "modifyGet", "(", "get", ")", ";", "}", "return", "get", "(", "get", ")", ";"...
Execute the get on HBase, invoking the getModifier before executing the get if getModifier is not null. Any GetModifers registered with registerGetModifier will be invoked before the Get is executed, and after the getModifier passed to this function are called. @param get The Get to execute. @param getModifier Invoke...
[ "Execute", "the", "get", "on", "HBase", "invoking", "the", "getModifier", "before", "executing", "the", "get", "if", "getModifier", "is", "not", "null", "." ]
72bfb4b1a881af85808cd7f14bc3e15160a1e811
https://github.com/kite-sdk/kite/blob/72bfb4b1a881af85808cd7f14bc3e15160a1e811/kite-data/kite-data-hbase/src/main/java/org/kitesdk/data/hbase/impl/HBaseClientTemplate.java#L300-L305
train
Get a single value from a Get object.
Create a Java method that does the following: "Get a single value from a Get object.".
Of course, here is the Java code you requested: ```java public Result get(Get get, GetModifier getModifier) { if (getModifier != null) { get = getModifier.modifyGet(get); } return get(get); } ``` Hope this helps!