repo
stringlengths
7
59
path
stringlengths
17
234
func_name
stringlengths
3
117
original_string
stringlengths
63
281k
language
stringclasses
1 value
code
stringlengths
63
281k
code_tokens
listlengths
20
16.3k
docstring
stringlengths
1
34k
docstring_tokens
listlengths
1
3.44k
sha
stringlengths
40
40
url
stringlengths
106
339
partition
stringclasses
3 values
summary
stringlengths
3
248
output
stringlengths
142
281k
xmlunit/xmlunit
xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java
XMLAssert.assertXpathEquality
private static void assertXpathEquality(String controlXpath, Document controlDocument, String testXpath, Document testDocument, boolean equal) ...
java
private static void assertXpathEquality(String controlXpath, Document controlDocument, String testXpath, Document testDocument, boolean equal) ...
[ "private", "static", "void", "assertXpathEquality", "(", "String", "controlXpath", ",", "Document", "controlDocument", ",", "String", "testXpath", ",", "Document", "testDocument", ",", "boolean", "equal", ")", "throws", "XpathException", "{", "XpathEngine", "xpath", ...
Assert that the node lists of two Xpaths in two documents are equal or not. @param controlXpath @param testXpath @param controlDocument @param testDocument @param equal whether the values should be equal. @see XpathEngine
[ "Assert", "that", "the", "node", "lists", "of", "two", "Xpaths", "in", "two", "documents", "are", "equal", "or", "not", "." ]
fe3d701d43f57ee83dcba336e4c1555619d3084b
https://github.com/xmlunit/xmlunit/blob/fe3d701d43f57ee83dcba336e4c1555619d3084b/xmlunit-legacy/src/main/java/org/custommonkey/xmlunit/XMLAssert.java#L575-L589
train
Assert that two XML documents are equal.
Of course, here is the Java code you requested: ```java private static void assertXpathEquality(String controlXpath, Document controlDocument, String testXpath, Document testDocument, ...
Fleker/ChannelSurfer
library/src/main/java/com/felkertech/channelsurfer/service/MultimediaInputProvider.java
MultimediaInputProvider.play
@Override public void play(final String uri) { Log.d(TAG, "Start playing "+uri); notifyVideoUnavailable(REASON_BUFFERING); isWeb = false; TvInputPlayer.Callback callback = new TvInputPlayer.Callback() { @Override public void onPrepared() { noti...
java
@Override public void play(final String uri) { Log.d(TAG, "Start playing "+uri); notifyVideoUnavailable(REASON_BUFFERING); isWeb = false; TvInputPlayer.Callback callback = new TvInputPlayer.Callback() { @Override public void onPrepared() { noti...
[ "@", "Override", "public", "void", "play", "(", "final", "String", "uri", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"Start playing \"", "+", "uri", ")", ";", "notifyVideoUnavailable", "(", "REASON_BUFFERING", ")", ";", "isWeb", "=", "false", ";", "Tv...
Tries to load a video file. If one cannot be played, it will be interpreted as a website and begin to load it in a web browser @param uri The URL for the file or website
[ "Tries", "to", "load", "a", "video", "file", ".", "If", "one", "cannot", "be", "played", "it", "will", "be", "interpreted", "as", "a", "website", "and", "begin", "to", "load", "it", "in", "a", "web", "browser" ]
f677beae37112f463c0c4783967fdb8fa97eb633
https://github.com/Fleker/ChannelSurfer/blob/f677beae37112f463c0c4783967fdb8fa97eb633/library/src/main/java/com/felkertech/channelsurfer/service/MultimediaInputProvider.java#L92-L169
train
Play the specified image.
Of course, here is the Java code you requested: ```java @Override public void play(final String uri) { Log.d(TAG, "Start playing "+uri); notifyVideoUnavailable(REASON_BUFFERING); isWeb = false; TvInputPlayer.Callback callback = new TvInputPlayer.Callback() { @Override ...
twitter/cloudhopper-commons
ch-commons-util/src/main/java/com/cloudhopper/commons/util/CompressionUtil.java
CompressionUtil.compress
public static File compress(File sourceFile, String algorithm, boolean deleteSourceFileAfterCompressed) throws FileAlreadyExistsException, IOException { return compress(sourceFile, sourceFile.getParentFile(), algorithm, deleteSourceFileAfterCompressed); }
java
public static File compress(File sourceFile, String algorithm, boolean deleteSourceFileAfterCompressed) throws FileAlreadyExistsException, IOException { return compress(sourceFile, sourceFile.getParentFile(), algorithm, deleteSourceFileAfterCompressed); }
[ "public", "static", "File", "compress", "(", "File", "sourceFile", ",", "String", "algorithm", ",", "boolean", "deleteSourceFileAfterCompressed", ")", "throws", "FileAlreadyExistsException", ",", "IOException", "{", "return", "compress", "(", "sourceFile", ",", "sourc...
Compresses the source file using a variety of supported compression algorithms. This method will create a target file in the same directory as the source file and will append a file extension matching the compression algorithm used. For example, using "gzip" will mean a source file of "app.log" would be compressed to...
[ "Compresses", "the", "source", "file", "using", "a", "variety", "of", "supported", "compression", "algorithms", ".", "This", "method", "will", "create", "a", "target", "file", "in", "the", "same", "directory", "as", "the", "source", "file", "and", "will", "a...
b5bc397dbec4537e8149e7ec0733c1d7ed477499
https://github.com/twitter/cloudhopper-commons/blob/b5bc397dbec4537e8149e7ec0733c1d7ed477499/ch-commons-util/src/main/java/com/cloudhopper/commons/util/CompressionUtil.java#L162-L164
train
Compress a source file using the specified algorithm.
Of course, here is the Java code you requested: ```java public static File compress(File sourceFile, String algorithm, boolean deleteSourceFileAfterCompressed) throws FileAlreadyExistsException, IOException { return compress(sourceFile, sourceFile.getParentFile(), algorithm, deleteSourceFileAfterCompressed); ...
joniles/mpxj
src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java
MPD9AbstractReader.processField
protected void processField(Row row, String fieldIDColumn, String entityIDColumn, Object value) { processField(row, fieldIDColumn, row.getInteger(entityIDColumn), value); }
java
protected void processField(Row row, String fieldIDColumn, String entityIDColumn, Object value) { processField(row, fieldIDColumn, row.getInteger(entityIDColumn), value); }
[ "protected", "void", "processField", "(", "Row", "row", ",", "String", "fieldIDColumn", ",", "String", "entityIDColumn", ",", "Object", "value", ")", "{", "processField", "(", "row", ",", "fieldIDColumn", ",", "row", ".", "getInteger", "(", "entityIDColumn", "...
Generic method to process an extended attribute field. @param row extended attribute data @param fieldIDColumn column containing the field ID @param entityIDColumn column containing the entity ID @param value field value
[ "Generic", "method", "to", "process", "an", "extended", "attribute", "field", "." ]
143ea0e195da59cd108f13b3b06328e9542337e8
https://github.com/joniles/mpxj/blob/143ea0e195da59cd108f13b3b06328e9542337e8/src/main/java/net/sf/mpxj/mpd/MPD9AbstractReader.java#L716-L719
train
Process a single field of the data.
Of course, here is the Java code you requested: ```java protected void processField(Row row, String fieldIDColumn, String entityIDColumn, Object value) { processField(row, fieldIDColumn, row.getInteger(entityIDColumn), value); } ``` Hope this helps!
Azure/azure-sdk-for-java
sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerTableAuditingPoliciesInner.java
ServerTableAuditingPoliciesInner.createOrUpdateAsync
public Observable<ServerTableAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerTableAuditingPolicyInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerTableAuditingPolicyInner>, ...
java
public Observable<ServerTableAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerTableAuditingPolicyInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(new Func1<ServiceResponse<ServerTableAuditingPolicyInner>, ...
[ "public", "Observable", "<", "ServerTableAuditingPolicyInner", ">", "createOrUpdateAsync", "(", "String", "resourceGroupName", ",", "String", "serverName", ",", "ServerTableAuditingPolicyInner", "parameters", ")", "{", "return", "createOrUpdateWithServiceResponseAsync", "(", ...
Creates or updates a servers's table auditing policy. Table auditing is deprecated, use blob auditing instead. @param resourceGroupName The name of the resource group that contains the resource. You can obtain this value from the Azure Resource Manager API or the portal. @param serverName The name of the server. @para...
[ "Creates", "or", "updates", "a", "servers", "s", "table", "auditing", "policy", ".", "Table", "auditing", "is", "deprecated", "use", "blob", "auditing", "instead", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/sql/resource-manager/v2014_04_01/src/main/java/com/microsoft/azure/management/sql/v2014_04_01/implementation/ServerTableAuditingPoliciesInner.java#L196-L203
train
Creates or updates a server s table auditing policy. Table auditing is deprecated use blob auditing instead.
Of course, here is the Java code you requested: ```java public Observable<ServerTableAuditingPolicyInner> createOrUpdateAsync(String resourceGroupName, String serverName, ServerTableAuditingPolicyInner parameters) { return createOrUpdateWithServiceResponseAsync(resourceGroupName, serverName, parameters).map(ne...
looly/hutool
hutool-core/src/main/java/cn/hutool/core/lang/Range.java
Range.reset
public Range<T> reset() { lock.lock(); try { this.current = this.start; this.index = 0; } finally { lock.unlock(); } return this; }
java
public Range<T> reset() { lock.lock(); try { this.current = this.start; this.index = 0; } finally { lock.unlock(); } return this; }
[ "public", "Range", "<", "T", ">", "reset", "(", ")", "{", "lock", ".", "lock", "(", ")", ";", "try", "{", "this", ".", "current", "=", "this", ".", "start", ";", "this", ".", "index", "=", "0", ";", "}", "finally", "{", "lock", ".", "unlock", ...
重置{@link Range} @return this
[ "重置", "{", "@link", "Range", "}" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-core/src/main/java/cn/hutool/core/lang/Range.java#L172-L181
train
Resets the range to the beginning of this range.
Of course, here is the Java code you requested: ```java public Range<T> reset() { lock.lock(); try { this.current = this.start; this.index = 0; } finally { lock.unlock(); } return this; } ``` Hope this helps!
jeremylong/DependencyCheck
core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java
DependencyBundlingAnalyzer.isCore
protected boolean isCore(Dependency left, Dependency right) { final String leftName = left.getFileName().toLowerCase(); final String rightName = right.getFileName().toLowerCase(); final boolean returnVal; //TODO - should we get rid of this merging? It removes a true BOM... if (...
java
protected boolean isCore(Dependency left, Dependency right) { final String leftName = left.getFileName().toLowerCase(); final String rightName = right.getFileName().toLowerCase(); final boolean returnVal; //TODO - should we get rid of this merging? It removes a true BOM... if (...
[ "protected", "boolean", "isCore", "(", "Dependency", "left", ",", "Dependency", "right", ")", "{", "final", "String", "leftName", "=", "left", ".", "getFileName", "(", ")", ".", "toLowerCase", "(", ")", ";", "final", "String", "rightName", "=", "right", "....
This is likely a very broken attempt at determining if the 'left' dependency is the 'core' library in comparison to the 'right' library. @param left the dependency to test @param right the dependency to test against @return a boolean indicating whether or not the left dependency should be considered the "core" version...
[ "This", "is", "likely", "a", "very", "broken", "attempt", "at", "determining", "if", "the", "left", "dependency", "is", "the", "core", "library", "in", "comparison", "to", "the", "right", "library", "." ]
6cc7690ea12e4ca1454210ceaa2e9a5523f0926c
https://github.com/jeremylong/DependencyCheck/blob/6cc7690ea12e4ca1454210ceaa2e9a5523f0926c/core/src/main/java/org/owasp/dependencycheck/analyzer/DependencyBundlingAnalyzer.java#L342-L379
train
Checks if the two dependencies are core.
Of course, here is the Java code you requested: ```java protected boolean isCore(Dependency left, Dependency right) { final String leftName = left.getFileName().toLowerCase(); final String rightName = right.getFileName().toLowerCase(); final boolean returnVal; //TODO - should we get ri...
querydsl/querydsl
querydsl-core/src/main/java/com/querydsl/core/group/GroupBy.java
GroupBy.sortedMap
public static <K, V> AbstractGroupExpression<Pair<K, V>, SortedMap<K, V>> sortedMap(Expression<K> key, Expression<V> value, Comparator<? super K...
java
public static <K, V> AbstractGroupExpression<Pair<K, V>, SortedMap<K, V>> sortedMap(Expression<K> key, Expression<V> value, Comparator<? super K...
[ "public", "static", "<", "K", ",", "V", ">", "AbstractGroupExpression", "<", "Pair", "<", "K", ",", "V", ">", ",", "SortedMap", "<", "K", ",", "V", ">", ">", "sortedMap", "(", "Expression", "<", "K", ">", "key", ",", "Expression", "<", "V", ">", ...
Create a new aggregating map expression using a backing TreeMap using the given comparator @param key key for the map entries @param value value for the map entries @param comparator comparator for the created TreeMap instances @return wrapper expression
[ "Create", "a", "new", "aggregating", "map", "expression", "using", "a", "backing", "TreeMap", "using", "the", "given", "comparator" ]
2bf234caf78549813a1e0f44d9c30ecc5ef734e3
https://github.com/querydsl/querydsl/blob/2bf234caf78549813a1e0f44d9c30ecc5ef734e3/querydsl-core/src/main/java/com/querydsl/core/group/GroupBy.java#L295-L299
train
Create an AbstractGroupExpression that represents a SortedMap of the specified key - value pairs.
Of course, here is the Java code you requested: ```java public static <K, V> AbstractGroupExpression<Pair<K, V>, SortedMap<K, V>> sortedMap(Expression<K> key, Expression<V> value, ...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsByteBuffer.java
CommsByteBuffer.getCommandCompletionCode
public synchronized short getCommandCompletionCode(int expectedSegmentType) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getCommandCompletionCode", new Object[] {""+expectedSegmentType}); checkReleased(); shor...
java
public synchronized short getCommandCompletionCode(int expectedSegmentType) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getCommandCompletionCode", new Object[] {""+expectedSegmentType}); checkReleased(); shor...
[ "public", "synchronized", "short", "getCommandCompletionCode", "(", "int", "expectedSegmentType", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "isEntryEnabled", "(", ")", ")", "SibTr", ".", "entry", "(", "this", ...
When this buffer is representing the result of an exchange call (i.e. wrapping a JFap ReceivedData object) this method can be used to determine what the outcome of the call was. <p> There are three possible outcomes: <ol> <li>The returned segment type matches expectations e.g a SEND would expect a SEND_R handshake retu...
[ "When", "this", "buffer", "is", "representing", "the", "result", "of", "an", "exchange", "call", "(", "i", ".", "e", ".", "wrapping", "a", "JFap", "ReceivedData", "object", ")", "this", "method", "can", "be", "used", "to", "determine", "what", "the", "ou...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/common/CommsByteBuffer.java#L1106-L1148
train
Gets the command completion code.
Of course, here is the Java code you requested: ```java public synchronized short getCommandCompletionCode(int expectedSegmentType) { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "getCommandCompletionCode", new Object[] {""+e...
legsem/legstar-core2
legstar-base/src/main/java/com/legstar/base/type/primitive/CobolDecimalType.java
CobolDecimalType.getJavaMaxInclusive
@SuppressWarnings("unchecked") private static <D extends Number> D getJavaMaxInclusive(Class < D > clazz, int totalDigits, int fractionDigits) { int dec = totalDigits - fractionDigits; char[] decPart = new char[dec]; Arrays.fill(decPart, '9'); StringBuilder sb = new Strin...
java
@SuppressWarnings("unchecked") private static <D extends Number> D getJavaMaxInclusive(Class < D > clazz, int totalDigits, int fractionDigits) { int dec = totalDigits - fractionDigits; char[] decPart = new char[dec]; Arrays.fill(decPart, '9'); StringBuilder sb = new Strin...
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "private", "static", "<", "D", "extends", "Number", ">", "D", "getJavaMaxInclusive", "(", "Class", "<", "D", ">", "clazz", ",", "int", "totalDigits", ",", "int", "fractionDigits", ")", "{", "int", "dec", ...
Determines the maximum value a numeric can take. <p/> The maximum is constrained either from the host side by the the number of digits in the picture clause or by the mapping java type maximum value whichever is smaller. @param clazz the target java numeric type @param totalDigits the host total number of digits @para...
[ "Determines", "the", "maximum", "value", "a", "numeric", "can", "take", ".", "<p", "/", ">", "The", "maximum", "is", "constrained", "either", "from", "the", "host", "side", "by", "the", "the", "number", "of", "digits", "in", "the", "picture", "clause", "...
f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6
https://github.com/legsem/legstar-core2/blob/f74d25d5b2b21a2ebaaaf2162b3fb7138dca40c6/legstar-base/src/main/java/com/legstar/base/type/primitive/CobolDecimalType.java#L269-L301
train
Gets the java maxInclusive.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") private static <D extends Number> D getJavaMaxInclusive(Class < D > clazz, int totalDigits, int fractionDigits) { int dec = totalDigits - fractionDigits; char[] decPart = new char[dec]; Arrays...
liferay/com-liferay-commerce
commerce-api/src/main/java/com/liferay/commerce/service/CommerceOrderNoteLocalServiceUtil.java
CommerceOrderNoteLocalServiceUtil.createCommerceOrderNote
public static com.liferay.commerce.model.CommerceOrderNote createCommerceOrderNote( long commerceOrderNoteId) { return getService().createCommerceOrderNote(commerceOrderNoteId); }
java
public static com.liferay.commerce.model.CommerceOrderNote createCommerceOrderNote( long commerceOrderNoteId) { return getService().createCommerceOrderNote(commerceOrderNoteId); }
[ "public", "static", "com", ".", "liferay", ".", "commerce", ".", "model", ".", "CommerceOrderNote", "createCommerceOrderNote", "(", "long", "commerceOrderNoteId", ")", "{", "return", "getService", "(", ")", ".", "createCommerceOrderNote", "(", "commerceOrderNoteId", ...
Creates a new commerce order note with the primary key. Does not add the commerce order note to the database. @param commerceOrderNoteId the primary key for the new commerce order note @return the new commerce order note
[ "Creates", "a", "new", "commerce", "order", "note", "with", "the", "primary", "key", ".", "Does", "not", "add", "the", "commerce", "order", "note", "to", "the", "database", "." ]
9e54362d7f59531fc684016ba49ee7cdc3a2f22b
https://github.com/liferay/com-liferay-commerce/blob/9e54362d7f59531fc684016ba49ee7cdc3a2f22b/commerce-api/src/main/java/com/liferay/commerce/service/CommerceOrderNoteLocalServiceUtil.java#L82-L85
train
Creates a commerce order note with the primary key.
Of course, here is the Java code you requested: ```java public static com.liferay.commerce.model.CommerceOrderNote createCommerceOrderNote( long commerceOrderNoteId) { return getService().createCommerceOrderNote(commerceOrderNoteId); } ``` Hope this helps!
Azure/azure-sdk-for-java
containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java
RegistriesInner.listAsync
public Observable<Page<RegistryInner>> listAsync() { return listWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<RegistryInner>>, Page<RegistryInner>>() { @Override public Page<RegistryInner> call(ServiceResponse<Page<RegistryInner>> response) { ...
java
public Observable<Page<RegistryInner>> listAsync() { return listWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<RegistryInner>>, Page<RegistryInner>>() { @Override public Page<RegistryInner> call(ServiceResponse<Page<RegistryInner>> response) { ...
[ "public", "Observable", "<", "Page", "<", "RegistryInner", ">", ">", "listAsync", "(", ")", "{", "return", "listWithServiceResponseAsync", "(", ")", ".", "map", "(", "new", "Func1", "<", "ServiceResponse", "<", "Page", "<", "RegistryInner", ">", ">", ",", ...
Lists all the container registries under the specified subscription. @throws IllegalArgumentException thrown if parameters fail the validation @return the observable to the PagedList&lt;RegistryInner&gt; object
[ "Lists", "all", "the", "container", "registries", "under", "the", "specified", "subscription", "." ]
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/containerregistry/resource-manager/v2017_03_01/src/main/java/com/microsoft/azure/management/containerregistry/v2017_03_01/implementation/RegistriesInner.java#L801-L809
train
List all the CDNA registry.
Of course, here is the Java code you requested: ```java public Observable<Page<RegistryInner>> listAsync() { return listWithServiceResponseAsync() .map(new Func1<ServiceResponse<Page<RegistryInner>>, Page<RegistryInner>>() { @Override public Page<RegistryInner> call(...
googleads/googleads-java-lib
modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/BidLandscapeLandscapePoint.java
BidLandscapeLandscapePoint.getRequiredBudget
public com.google.api.ads.adwords.axis.v201809.cm.Money getRequiredBudget() { return requiredBudget; }
java
public com.google.api.ads.adwords.axis.v201809.cm.Money getRequiredBudget() { return requiredBudget; }
[ "public", "com", ".", "google", ".", "api", ".", "ads", ".", "adwords", ".", "axis", ".", "v201809", ".", "cm", ".", "Money", "getRequiredBudget", "(", ")", "{", "return", "requiredBudget", ";", "}" ]
Gets the requiredBudget value for this BidLandscapeLandscapePoint. @return requiredBudget * Required daily budget to achieve the predicted stats at this bid. Only available for campaign criterion bid landscapes. <span class="constraint Selectable">This field can be selected using the value "RequiredBudget".</span><s...
[ "Gets", "the", "requiredBudget", "value", "for", "this", "BidLandscapeLandscapePoint", "." ]
967957cc4f6076514e3a7926fe653e4f1f7cc9c9
https://github.com/googleads/googleads-java-lib/blob/967957cc4f6076514e3a7926fe653e4f1f7cc9c9/modules/adwords_axis/src/main/java/com/google/api/ads/adwords/axis/v201809/cm/BidLandscapeLandscapePoint.java#L346-L348
train
Gets the requiredBudget value for this CIDCTYPE.
Of course, here is the Java code you requested: ```java public com.google.api.ads.adwords.axis.v201809.cm.Money getRequiredBudget() { return requiredBudget; } ``` Hope this helps!
line/armeria
core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java
AbstractClientOptionsBuilder.addHttpHeader
public B addHttpHeader(CharSequence name, Object value) { requireNonNull(name, "name"); requireNonNull(value, "value"); httpHeaders.addObject(HttpHeaderNames.of(name), value); return self(); }
java
public B addHttpHeader(CharSequence name, Object value) { requireNonNull(name, "name"); requireNonNull(value, "value"); httpHeaders.addObject(HttpHeaderNames.of(name), value); return self(); }
[ "public", "B", "addHttpHeader", "(", "CharSequence", "name", ",", "Object", "value", ")", "{", "requireNonNull", "(", "name", ",", "\"name\"", ")", ";", "requireNonNull", "(", "value", ",", "\"value\"", ")", ";", "httpHeaders", ".", "addObject", "(", "HttpHe...
Adds the specified HTTP header.
[ "Adds", "the", "specified", "HTTP", "header", "." ]
67d29e019fd35a35f89c45cc8f9119ff9b12b44d
https://github.com/line/armeria/blob/67d29e019fd35a35f89c45cc8f9119ff9b12b44d/core/src/main/java/com/linecorp/armeria/client/AbstractClientOptionsBuilder.java#L333-L338
train
Add a header to the request.
Of course, here is the Java code you requested: ```java public B addHttpHeader(CharSequence name, Object value) { requireNonNull(name, "name"); requireNonNull(value, "value"); httpHeaders.addObject(HttpHeaderNames.of(name), value); return self(); } ``` Hope this helps!
zaproxy/zaproxy
src/org/parosproxy/paros/core/scanner/HostProcess.java
HostProcess.getRequestCount
public int getRequestCount() { synchronized (mapPluginStats) { int count = requestCount + getAnalyser().getRequestCount(); for (PluginStats stats : mapPluginStats.values()) { count += stats.getMessageCount(); } return count; } }
java
public int getRequestCount() { synchronized (mapPluginStats) { int count = requestCount + getAnalyser().getRequestCount(); for (PluginStats stats : mapPluginStats.values()) { count += stats.getMessageCount(); } return count; } }
[ "public", "int", "getRequestCount", "(", ")", "{", "synchronized", "(", "mapPluginStats", ")", "{", "int", "count", "=", "requestCount", "+", "getAnalyser", "(", ")", ".", "getRequestCount", "(", ")", ";", "for", "(", "PluginStats", "stats", ":", "mapPluginS...
Gets the count of requests sent (and received) by all {@code Plugin}s and the {@code Analyser}. @return the count of request sent @since 2.5.0 @see #getPluginRequestCount(int) @see #getAnalyser()
[ "Gets", "the", "count", "of", "requests", "sent", "(", "and", "received", ")", "by", "all", "{", "@code", "Plugin", "}", "s", "and", "the", "{", "@code", "Analyser", "}", "." ]
0cbe5121f2ae1ecca222513d182759210c569bec
https://github.com/zaproxy/zaproxy/blob/0cbe5121f2ae1ecca222513d182759210c569bec/src/org/parosproxy/paros/core/scanner/HostProcess.java#L1140-L1148
train
Gets the request count.
Of course, here is the Java code you requested: ```java public int getRequestCount() { synchronized (mapPluginStats) { int count = requestCount + getAnalyser().getRequestCount(); for (PluginStats stats : mapPluginStats.values()) { count += stats.getMessageCount(); ...
OpenLiberty/open-liberty
dev/com.ibm.ws.ejbcontainer.remote.portable.core/src/com/ibm/ejs/container/finder/FinderResultClientIterator.java
FinderResultClientIterator.writeObject
private void writeObject(java.io.ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.write(frciEyecatcher); out.writeShort(frciPlatform); out.writeShort(frciVersionID); }
java
private void writeObject(java.io.ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.write(frciEyecatcher); out.writeShort(frciPlatform); out.writeShort(frciVersionID); }
[ "private", "void", "writeObject", "(", "java", ".", "io", ".", "ObjectOutputStream", "out", ")", "throws", "IOException", "{", "out", ".", "defaultWriteObject", "(", ")", ";", "out", ".", "write", "(", "frciEyecatcher", ")", ";", "out", ".", "writeShort", ...
/* d113380 interop implementation for readObject and writeObject
[ "/", "*", "d113380", "interop", "implementation", "for", "readObject", "and", "writeObject" ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.ejbcontainer.remote.portable.core/src/com/ibm/ejs/container/finder/FinderResultClientIterator.java#L83-L90
train
Write the object in the sequence of bytes.
Of course, here is the Java code you requested: ```java private void writeObject(java.io.ObjectOutputStream out) throws IOException { out.defaultWriteObject(); out.write(frciEyecatcher); out.writeShort(frciPlatform); out.writeShort(frciVersionID); } ``` Hope...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcPersonImpl.java
IfcPersonImpl.getPrefixTitles
@SuppressWarnings("unchecked") public EList<String> getPrefixTitles() { return (EList<String>) eGet(Ifc2x3tc1Package.Literals.IFC_PERSON__PREFIX_TITLES, true); }
java
@SuppressWarnings("unchecked") public EList<String> getPrefixTitles() { return (EList<String>) eGet(Ifc2x3tc1Package.Literals.IFC_PERSON__PREFIX_TITLES, true); }
[ "@", "SuppressWarnings", "(", "\"unchecked\"", ")", "public", "EList", "<", "String", ">", "getPrefixTitles", "(", ")", "{", "return", "(", "EList", "<", "String", ">", ")", "eGet", "(", "Ifc2x3tc1Package", ".", "Literals", ".", "IFC_PERSON__PREFIX_TITLES", ",...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc2x3tc1/impl/IfcPersonImpl.java#L237-L240
train
Gets the value of the PrefixTitles property.
Of course, here is the Java code you requested: ```java @SuppressWarnings("unchecked") public EList<String> getPrefixTitles() { return (EList<String>) eGet(Ifc2x3tc1Package.Literals.IFC_PERSON__PREFIX_TITLES, true); } ``` Hope this helps!
twilio/twilio-java
src/main/java/com/twilio/rest/chat/v2/CredentialUpdater.java
CredentialUpdater.addPostParams
private void addPostParams(final Request request) { if (friendlyName != null) { request.addPostParam("FriendlyName", friendlyName); } if (certificate != null) { request.addPostParam("Certificate", certificate); } if (privateKey != null) { req...
java
private void addPostParams(final Request request) { if (friendlyName != null) { request.addPostParam("FriendlyName", friendlyName); } if (certificate != null) { request.addPostParam("Certificate", certificate); } if (privateKey != null) { req...
[ "private", "void", "addPostParams", "(", "final", "Request", "request", ")", "{", "if", "(", "friendlyName", "!=", "null", ")", "{", "request", ".", "addPostParam", "(", "\"FriendlyName\"", ",", "friendlyName", ")", ";", "}", "if", "(", "certificate", "!=", ...
Add the requested post parameters to the Request. @param request Request to add post params to
[ "Add", "the", "requested", "post", "parameters", "to", "the", "Request", "." ]
0318974c0a6a152994af167d430255684d5e9b9f
https://github.com/twilio/twilio-java/blob/0318974c0a6a152994af167d430255684d5e9b9f/src/main/java/com/twilio/rest/chat/v2/CredentialUpdater.java#L162-L186
train
Add the post parameters to the request.
Of course, here is the Java code you requested: ```java private void addPostParams(final Request request) { if (friendlyName != null) { request.addPostParam("FriendlyName", friendlyName); } if (certificate != null) { request.addPostParam("Certificate", certificate); ...
Unidata/thredds
ui/src/main/java/thredds/logs/LogCategorizer.java
LogCategorizer.getServiceSpecial
static public String getServiceSpecial(String path) { String ss = null; if (path.startsWith("/dqcServlet")) ss = "dqcServlet"; else if (path.startsWith("/cdmvalidator")) ss = "cdmvalidator"; return ss; }
java
static public String getServiceSpecial(String path) { String ss = null; if (path.startsWith("/dqcServlet")) ss = "dqcServlet"; else if (path.startsWith("/cdmvalidator")) ss = "cdmvalidator"; return ss; }
[ "static", "public", "String", "getServiceSpecial", "(", "String", "path", ")", "{", "String", "ss", "=", "null", ";", "if", "(", "path", ".", "startsWith", "(", "\"/dqcServlet\"", ")", ")", "ss", "=", "\"dqcServlet\"", ";", "else", "if", "(", "path", "."...
the ones that dont start with thredds
[ "the", "ones", "that", "dont", "start", "with", "thredds" ]
d2d68f9eee87f345625211324d71d5dc3e162ee1
https://github.com/Unidata/thredds/blob/d2d68f9eee87f345625211324d71d5dc3e162ee1/ui/src/main/java/thredds/logs/LogCategorizer.java#L220-L227
test
Get the service special name from the path
Of course, here is the Java code you requested: ```java static public String getServiceSpecial(String path) { String ss = null; if (path.startsWith("/dqcServlet")) ss = "dqcServlet"; else if (path.startsWith("/cdmvalidator")) ss = "cdmvalidator"; return ss; } ``` Hope this helps!
dwdyer/uncommons-maths
core/src/java/main/org/uncommons/maths/binary/BitString.java
BitString.getBit
public boolean getBit(int index) { assertValidIndex(index); int word = index / WORD_LENGTH; int offset = index % WORD_LENGTH; return (data[word] & (1 << offset)) != 0; }
java
public boolean getBit(int index) { assertValidIndex(index); int word = index / WORD_LENGTH; int offset = index % WORD_LENGTH; return (data[word] & (1 << offset)) != 0; }
[ "public", "boolean", "getBit", "(", "int", "index", ")", "{", "assertValidIndex", "(", "index", ")", ";", "int", "word", "=", "index", "/", "WORD_LENGTH", ";", "int", "offset", "=", "index", "%", "WORD_LENGTH", ";", "return", "(", "data", "[", "word", ...
Returns the bit at the specified index. @param index The index of the bit to look-up (0 is the least-significant bit). @return A boolean indicating whether the bit is set or not. @throws IndexOutOfBoundsException If the specified index is not a bit position in this bit string.
[ "Returns", "the", "bit", "at", "the", "specified", "index", "." ]
b7ba13aea70625bb7f37c856783a29e17e354964
https://github.com/dwdyer/uncommons-maths/blob/b7ba13aea70625bb7f37c856783a29e17e354964/core/src/java/main/org/uncommons/maths/binary/BitString.java#L129-L135
train
Gets the bit at the specified index.
Of course, here is the Java code you requested: ```java public boolean getBit(int index) { assertValidIndex(index); int word = index / WORD_LENGTH; int offset = index % WORD_LENGTH; return (data[word] & (1 << offset)) != 0; } ``` Hope this helps!
facebookarchive/hadoop-20
src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java
SessionDriver.setPriority
public void setPriority(SessionPriority prio) throws IOException { if (failException != null) { throw failException; } sessionInfo.priority = prio; SessionInfo newInfo = new SessionInfo(sessionInfo); cmNotifier.addCall( new ClusterManagerService.sessionUpdateInfo_args(sessionId, newI...
java
public void setPriority(SessionPriority prio) throws IOException { if (failException != null) { throw failException; } sessionInfo.priority = prio; SessionInfo newInfo = new SessionInfo(sessionInfo); cmNotifier.addCall( new ClusterManagerService.sessionUpdateInfo_args(sessionId, newI...
[ "public", "void", "setPriority", "(", "SessionPriority", "prio", ")", "throws", "IOException", "{", "if", "(", "failException", "!=", "null", ")", "{", "throw", "failException", ";", "}", "sessionInfo", ".", "priority", "=", "prio", ";", "SessionInfo", "newInf...
Set the priority for this session in the ClusterManager @param prio the priority of this session @throws IOException
[ "Set", "the", "priority", "for", "this", "session", "in", "the", "ClusterManager" ]
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/contrib/corona/src/java/org/apache/hadoop/corona/SessionDriver.java#L324-L334
train
Sets the priority of the session.
Of course, here is the Java code you requested: ```java public void setPriority(SessionPriority prio) throws IOException { if (failException != null) { throw failException; } sessionInfo.priority = prio; SessionInfo newInfo = new SessionInfo(sessionInfo); cmNotifier.addCall( new Clu...
hal/core
gui/src/main/java/org/jboss/as/console/client/widgets/pages/Pages.java
Pages.insert
public void insert(Widget widget, String tabText, int beforeIndex) { insert(widget, tabText, false, beforeIndex); }
java
public void insert(Widget widget, String tabText, int beforeIndex) { insert(widget, tabText, false, beforeIndex); }
[ "public", "void", "insert", "(", "Widget", "widget", ",", "String", "tabText", ",", "int", "beforeIndex", ")", "{", "insert", "(", "widget", ",", "tabText", ",", "false", ",", "beforeIndex", ")", ";", "}" ]
Inserts a widget into the tab panel. If the Widget is already attached to the TabPanel, it will be moved to the requested index. @param widget the widget to be inserted @param tabText the text to be shown on its tab @param beforeIndex the index before which it will be inserted
[ "Inserts", "a", "widget", "into", "the", "tab", "panel", ".", "If", "the", "Widget", "is", "already", "attached", "to", "the", "TabPanel", "it", "will", "be", "moved", "to", "the", "requested", "index", "." ]
d6d03f0bb128dc0470f5dc75fdb1ea1014400602
https://github.com/hal/core/blob/d6d03f0bb128dc0470f5dc75fdb1ea1014400602/gui/src/main/java/org/jboss/as/console/client/widgets/pages/Pages.java#L291-L293
train
Insert a widget into the container.
Of course, here is the Java code you requested: ```java public void insert(Widget widget, String tabText, int beforeIndex) { insert(widget, tabText, false, beforeIndex); } ``` Hope this helps!
rest-assured/rest-assured
rest-assured/src/main/java/io/restassured/RestAssured.java
RestAssured.options
public static Response options(String path, Map<String, ?> pathParams) { return given().options(path, pathParams); }
java
public static Response options(String path, Map<String, ?> pathParams) { return given().options(path, pathParams); }
[ "public", "static", "Response", "options", "(", "String", "path", ",", "Map", "<", "String", ",", "?", ">", "pathParams", ")", "{", "return", "given", "(", ")", ".", "options", "(", "path", ",", "pathParams", ")", ";", "}" ]
Perform a OPTIONS request to a <code>path</code>. Normally the path doesn't have to be fully-qualified e.g. you don't need to specify the path as <tt>http://localhost:8080/path</tt>. In this case it's enough to use <tt>/path</tt>. @param path The path to send the request to. @param pathParams The path parameters...
[ "Perform", "a", "OPTIONS", "request", "to", "a", "<code", ">", "path<", "/", "code", ">", ".", "Normally", "the", "path", "doesn", "t", "have", "to", "be", "fully", "-", "qualified", "e", ".", "g", ".", "you", "don", "t", "need", "to", "specify", "...
165a85b65070f5a07fe0045175613fb2c2811642
https://github.com/rest-assured/rest-assured/blob/165a85b65070f5a07fe0045175613fb2c2811642/rest-assured/src/main/java/io/restassured/RestAssured.java#L873-L875
test
Options HTTP request with path and path parameters.
Of course, here is the Java code you requested: ```java public static Response options(String path, Map<String, ?> pathParams) { return given().options(path, pathParams); } ``` Hope this helps!
citygml4j/citygml4j
src-gen/main/java/net/opengis/gml/ObjectFactory.java
ObjectFactory.createMinutes
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "minutes") public JAXBElement<Integer> createMinutes(Integer value) { return new JAXBElement<Integer>(_Minutes_QNAME, Integer.class, null, value); }
java
@XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "minutes") public JAXBElement<Integer> createMinutes(Integer value) { return new JAXBElement<Integer>(_Minutes_QNAME, Integer.class, null, value); }
[ "@", "XmlElementDecl", "(", "namespace", "=", "\"http://www.opengis.net/gml\"", ",", "name", "=", "\"minutes\"", ")", "public", "JAXBElement", "<", "Integer", ">", "createMinutes", "(", "Integer", "value", ")", "{", "return", "new", "JAXBElement", "<", "Integer", ...
Create an instance of {@link JAXBElement }{@code <}{@link Integer }{@code >} @param value Java instance representing xml element's value. @return the new instance of {@link JAXBElement }{@code <}{@link Integer }{@code >}
[ "Create", "an", "instance", "of", "{", "@link", "JAXBElement", "}", "{", "@code", "<", "}", "{", "@link", "Integer", "}", "{", "@code", ">", "}" ]
9155997d5ecf7e8f19411a02ba047f13375b97b9
https://github.com/citygml4j/citygml4j/blob/9155997d5ecf7e8f19411a02ba047f13375b97b9/src-gen/main/java/net/opengis/gml/ObjectFactory.java#L3782-L3785
train
Create an instance of a minutes specification.
Of course, here is the Java code you requested: ```java @XmlElementDecl(namespace = "http://www.opengis.net/gml", name = "minutes") public JAXBElement<Integer> createMinutes(Integer value) { return new JAXBElement<Integer>(_Minutes_QNAME, Integer.class, null, value); } ``` Hope this helps!
bit-man/SwissArmyJavaGit
javagit/src/main/java/edu/nyu/cs/javagit/api/commands/GitBranchOptions.java
GitBranchOptions.checkCanSetDeleteOption
public void checkCanSetDeleteOption(String option) { if (isOptColor() || isOptNoColor() || isOptA() || isOptVerbose() || isOptMerged() || isOptNoMerged() || (null != getOptContains()) || isOptTrack() || isOptNoTrack() || isOptL() || isOptF() || isOptMLower() || isOptMUpper()) { throw new Ill...
java
public void checkCanSetDeleteOption(String option) { if (isOptColor() || isOptNoColor() || isOptA() || isOptVerbose() || isOptMerged() || isOptNoMerged() || (null != getOptContains()) || isOptTrack() || isOptNoTrack() || isOptL() || isOptF() || isOptMLower() || isOptMUpper()) { throw new Ill...
[ "public", "void", "checkCanSetDeleteOption", "(", "String", "option", ")", "{", "if", "(", "isOptColor", "(", ")", "||", "isOptNoColor", "(", ")", "||", "isOptA", "(", ")", "||", "isOptVerbose", "(", ")", "||", "isOptMerged", "(", ")", "||", "isOptNoMerged...
Checks whether an option for deleting a branch or branch list can be set. If not, throws an <code>IllegalArgumentException</code>. @param option The name of the option being checked; for use in exception messages.
[ "Checks", "whether", "an", "option", "for", "deleting", "a", "branch", "or", "branch", "list", "can", "be", "set", ".", "If", "not", "throws", "an", "<code", ">", "IllegalArgumentException<", "/", "code", ">", "." ]
ba045a76d1a3ae6d07272520501daebf5159a8bd
https://github.com/bit-man/SwissArmyJavaGit/blob/ba045a76d1a3ae6d07272520501daebf5159a8bd/javagit/src/main/java/edu/nyu/cs/javagit/api/commands/GitBranchOptions.java#L556-L563
valid
Check if the command can be set to delete the branch.
Of course, here is the Java code you requested: ```java public void checkCanSetDeleteOption(String option) { if (isOptColor() || isOptNoColor() || isOptA() || isOptVerbose() || isOptMerged() || isOptNoMerged() || (null != getOptContains()) || isOptTrack() || isOptNoTrack() || isOptL() || isOptF()...
PinaeOS/timon
src/main/java/org/pinae/timon/sql/Sql.java
Sql.setSql
public void setSql(String sql) { if (StringUtils.isNotEmpty(sql)) { this.sql = sql.trim(); this.comment = parseComment(sql); this.digest = MessageDigestUtils.MD5(sql); String sqlStatement = this.sql.toLowerCase(); if (sqlStatement != null) { this.select = sqlStatement.startsWith("select...
java
public void setSql(String sql) { if (StringUtils.isNotEmpty(sql)) { this.sql = sql.trim(); this.comment = parseComment(sql); this.digest = MessageDigestUtils.MD5(sql); String sqlStatement = this.sql.toLowerCase(); if (sqlStatement != null) { this.select = sqlStatement.startsWith("select...
[ "public", "void", "setSql", "(", "String", "sql", ")", "{", "if", "(", "StringUtils", ".", "isNotEmpty", "(", "sql", ")", ")", "{", "this", ".", "sql", "=", "sql", ".", "trim", "(", ")", ";", "this", ".", "comment", "=", "parseComment", "(", "sql",...
设置Sql语句 @param sql Sql语句
[ "设置Sql语句" ]
b8c66868624e3eb1b36f6ecda3c556c456a30cd3
https://github.com/PinaeOS/timon/blob/b8c66868624e3eb1b36f6ecda3c556c456a30cd3/src/main/java/org/pinae/timon/sql/Sql.java#L89-L101
train
Sets the sql statement.
Of course, here is the Java code you requested: ```java public void setSql(String sql) { if (StringUtils.isNotEmpty(sql)) { this.sql = sql.trim(); this.comment = parseComment(sql); this.digest = MessageDigestUtils.MD5(sql); String sqlStatement = this.sql.toLowerCase(); if (sqlStatement != n...
VoltDB/voltdb
src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java
Log.open
void open() { initParams(); int state = properties.getDBModified(); switch (state) { case HsqlDatabaseProperties.FILES_MODIFIED : deleteNewAndOldFiles(); restoreBackup(); processScript(); processDataFile(); ...
java
void open() { initParams(); int state = properties.getDBModified(); switch (state) { case HsqlDatabaseProperties.FILES_MODIFIED : deleteNewAndOldFiles(); restoreBackup(); processScript(); processDataFile(); ...
[ "void", "open", "(", ")", "{", "initParams", "(", ")", ";", "int", "state", "=", "properties", ".", "getDBModified", "(", ")", ";", "switch", "(", "state", ")", "{", "case", "HsqlDatabaseProperties", ".", "FILES_MODIFIED", ":", "deleteNewAndOldFiles", "(", ...
When opening a database, the hsqldb.compatible_version property is used to determine if this version of the engine is equal to or greater than the earliest version of the engine capable of opening that database.<p> @throws HsqlException
[ "When", "opening", "a", "database", "the", "hsqldb", ".", "compatible_version", "property", "is", "used", "to", "determine", "if", "this", "version", "of", "the", "engine", "is", "equal", "to", "or", "greater", "than", "the", "earliest", "version", "of", "th...
8afc1031e475835344b5497ea9e7203bc95475ac
https://github.com/VoltDB/voltdb/blob/8afc1031e475835344b5497ea9e7203bc95475ac/src/hsqldb19b3/org/hsqldb_voltpatches/persist/Log.java#L178-L244
train
Open the database.
Of course, here is the Java code you requested: ```java void open() { initParams(); int state = properties.getDBModified(); switch (state) { case HsqlDatabaseProperties.FILES_MODIFIED : deleteNewAndOldFiles(); restoreBackup(); proc...
cdk/cdk
tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java
PharmacophoreUtils.writePharmacophoreDefinition
public static void writePharmacophoreDefinition(PharmacophoreQuery[] queries, OutputStream out) throws IOException { Element root = new Element("pharmacophoreContainer"); root.addAttribute(new Attribute("version", "1.0")); for (PharmacophoreQuery query : queries) { Element pcore = ne...
java
public static void writePharmacophoreDefinition(PharmacophoreQuery[] queries, OutputStream out) throws IOException { Element root = new Element("pharmacophoreContainer"); root.addAttribute(new Attribute("version", "1.0")); for (PharmacophoreQuery query : queries) { Element pcore = ne...
[ "public", "static", "void", "writePharmacophoreDefinition", "(", "PharmacophoreQuery", "[", "]", "queries", ",", "OutputStream", "out", ")", "throws", "IOException", "{", "Element", "root", "=", "new", "Element", "(", "\"pharmacophoreContainer\"", ")", ";", "root", ...
Write out one or more pharmacophore queries in the CDK XML format. @param queries The pharmacophore queries @param out The OutputStream to write to @throws IOException if there is a problem writing the XML document
[ "Write", "out", "one", "or", "more", "pharmacophore", "queries", "in", "the", "CDK", "XML", "format", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/tool/pcore/src/main/java/org/openscience/cdk/pharmacophore/PharmacophoreUtils.java#L178-L233
train
Write the PharmacophoreDefinition XML file.
Of course, here is the Java code you requested: ```java public static void writePharmacophoreDefinition(PharmacophoreQuery[] queries, OutputStream out) throws IOException { Element root = new Element("pharmacophoreContainer"); root.addAttribute(new Attribute("version", "1.0")); for (Pharmacopho...
kiegroup/drools
drools-core/src/main/java/org/drools/core/reteoo/PropagationQueuingNode.java
PropagationQueuingNode.propagateActions
public void propagateActions( InternalWorkingMemory workingMemory ) { final PropagationQueueingNodeMemory memory = workingMemory.getNodeMemory( this ); // first we clear up the action queued flag memory.isQueued().compareAndSet( true, false ); /...
java
public void propagateActions( InternalWorkingMemory workingMemory ) { final PropagationQueueingNodeMemory memory = workingMemory.getNodeMemory( this ); // first we clear up the action queued flag memory.isQueued().compareAndSet( true, false ); /...
[ "public", "void", "propagateActions", "(", "InternalWorkingMemory", "workingMemory", ")", "{", "final", "PropagationQueueingNodeMemory", "memory", "=", "workingMemory", ".", "getNodeMemory", "(", "this", ")", ";", "// first we clear up the action queued flag", "memory", "."...
Propagate all queued actions (asserts and retracts). <p/> This method implementation is based on optimistic behavior to avoid the use of locks. There may eventually be a minimum wasted effort, but overall it will be better than paying for the lock's cost.
[ "Propagate", "all", "queued", "actions", "(", "asserts", "and", "retracts", ")", ".", "<p", "/", ">", "This", "method", "implementation", "is", "based", "on", "optimistic", "behavior", "to", "avoid", "the", "use", "of", "locks", ".", "There", "may", "event...
22b0275d6dbe93070b8090948502cf46eda543c4
https://github.com/kiegroup/drools/blob/22b0275d6dbe93070b8090948502cf46eda543c4/drools-core/src/main/java/org/drools/core/reteoo/PropagationQueuingNode.java#L230-L254
train
Propagate the actions to the sink.
Of course, here is the Java code you requested: ```java public void propagateActions( InternalWorkingMemory workingMemory ) { final PropagationQueueingNodeMemory memory = workingMemory.getNodeMemory( this ); // first we clear up the action queued flag memory.isQueued().compareAndSet( true, ...
osglworks/java-tool
src/main/java/org/osgl/util/FastStr.java
FastStr.toUpperCase
@Override public FastStr toUpperCase(Locale locale) { String s = toString(); return unsafeOf(s.toUpperCase(locale)); }
java
@Override public FastStr toUpperCase(Locale locale) { String s = toString(); return unsafeOf(s.toUpperCase(locale)); }
[ "@", "Override", "public", "FastStr", "toUpperCase", "(", "Locale", "locale", ")", "{", "String", "s", "=", "toString", "(", ")", ";", "return", "unsafeOf", "(", "s", ".", "toUpperCase", "(", "locale", ")", ")", ";", "}" ]
Wrapper of {@link String#toUpperCase(java.util.Locale)} but return FastStr type instance @param locale the locale @return a FastStr instance with all characters from this FastStr be converted into uppercase based on the locale specified
[ "Wrapper", "of", "{", "@link", "String#toUpperCase", "(", "java", ".", "util", ".", "Locale", ")", "}", "but", "return", "FastStr", "type", "instance" ]
8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b
https://github.com/osglworks/java-tool/blob/8b6eee2bccb067eb32e6a7bc4a4dfef7a7d9008b/src/main/java/org/osgl/util/FastStr.java#L1287-L1291
train
Returns a FastStr in the specified locale uppercase.
Of course, here is the Java code you requested: ```java @Override public FastStr toUpperCase(Locale locale) { String s = toString(); return unsafeOf(s.toUpperCase(locale)); } ``` Hope this helps!
moleculer-java/moleculer-java
src/main/java/services/moleculer/service/DefaultServiceRegistry.java
DefaultServiceRegistry.getAction
@Override public Action getAction(String name, String nodeID) { Strategy<ActionEndpoint> strategy = null; long stamp = lock.tryOptimisticRead(); if (stamp != 0) { try { strategy = strategies.get(name); } catch (Exception modified) { stamp = 0; } } if (!lock.validate(stamp) || stamp == 0) { ...
java
@Override public Action getAction(String name, String nodeID) { Strategy<ActionEndpoint> strategy = null; long stamp = lock.tryOptimisticRead(); if (stamp != 0) { try { strategy = strategies.get(name); } catch (Exception modified) { stamp = 0; } } if (!lock.validate(stamp) || stamp == 0) { ...
[ "@", "Override", "public", "Action", "getAction", "(", "String", "name", ",", "String", "nodeID", ")", "{", "Strategy", "<", "ActionEndpoint", ">", "strategy", "=", "null", ";", "long", "stamp", "=", "lock", ".", "tryOptimisticRead", "(", ")", ";", "if", ...
--- GET LOCAL OR REMOTE ACTION ---
[ "---", "GET", "LOCAL", "OR", "REMOTE", "ACTION", "---" ]
27575c44b9ecacc17c4456ceacf5d1851abf1cc4
https://github.com/moleculer-java/moleculer-java/blob/27575c44b9ecacc17c4456ceacf5d1851abf1cc4/src/main/java/services/moleculer/service/DefaultServiceRegistry.java#L1232-L1259
train
Get an action by name and nodeID.
Of course, here is the Java code you requested: ```java @Override public Action getAction(String name, String nodeID) { Strategy<ActionEndpoint> strategy = null; long stamp = lock.tryOptimisticRead(); if (stamp != 0) { try { strategy = strategies.get(name); } catch (Exception modified) { stamp = 0...
googleapis/google-cloud-java
google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java
LoggingSnippets.updateMetric
public Metric updateMetric(String metricName) { // [START updateMetric] MetricInfo metricInfo = MetricInfo.newBuilder(metricName, "severity>=ERROR") .setDescription("new description") .build(); Metric metric = logging.update(metricInfo); // [END updateMetric] return m...
java
public Metric updateMetric(String metricName) { // [START updateMetric] MetricInfo metricInfo = MetricInfo.newBuilder(metricName, "severity>=ERROR") .setDescription("new description") .build(); Metric metric = logging.update(metricInfo); // [END updateMetric] return m...
[ "public", "Metric", "updateMetric", "(", "String", "metricName", ")", "{", "// [START updateMetric]", "MetricInfo", "metricInfo", "=", "MetricInfo", ".", "newBuilder", "(", "metricName", ",", "\"severity>=ERROR\"", ")", ".", "setDescription", "(", "\"new description\"",...
[VARIABLE "my_metric_name"]
[ "[", "VARIABLE", "my_metric_name", "]" ]
d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a
https://github.com/googleapis/google-cloud-java/blob/d2f0bc64a53049040fe9c9d338b12fab3dd1ad6a/google-cloud-examples/src/main/java/com/google/cloud/examples/logging/snippets/LoggingSnippets.java#L303-L312
train
Update a metric in the log.
Of course, here is the Java code you requested: ```java public Metric updateMetric(String metricName) { // [START updateMetric] MetricInfo metricInfo = MetricInfo.newBuilder(metricName, "severity>=ERROR") .setDescription("new description") .build(); Metric metric = logging.u...
geomajas/geomajas-project-client-gwt
client/src/main/java/org/geomajas/gwt/client/map/cache/tile/VectorTile.java
VectorTile.getStatus
public STATUS getStatus() { if (featureContent.isLoaded()) { return STATUS.LOADED; } if (deferred == null) { return STATUS.EMPTY; } return STATUS.LOADING; }
java
public STATUS getStatus() { if (featureContent.isLoaded()) { return STATUS.LOADED; } if (deferred == null) { return STATUS.EMPTY; } return STATUS.LOADING; }
[ "public", "STATUS", "getStatus", "(", ")", "{", "if", "(", "featureContent", ".", "isLoaded", "(", ")", ")", "{", "return", "STATUS", ".", "LOADED", ";", "}", "if", "(", "deferred", "==", "null", ")", "{", "return", "STATUS", ".", "EMPTY", ";", "}", ...
Return the current status of this VectorTile. Can be one of the following: <ul> <li>STATUS.EMPTY</li> <li>STATUS.LOADING</li> <li>STATUS.LOADED</li> </ul> @return status
[ "Return", "the", "current", "status", "of", "this", "VectorTile", ".", "Can", "be", "one", "of", "the", "following", ":", "<ul", ">", "<li", ">", "STATUS", ".", "EMPTY<", "/", "li", ">", "<li", ">", "STATUS", ".", "LOADING<", "/", "li", ">", "<li", ...
1c1adc48deb192ed825265eebcc74d70bbf45670
https://github.com/geomajas/geomajas-project-client-gwt/blob/1c1adc48deb192ed825265eebcc74d70bbf45670/client/src/main/java/org/geomajas/gwt/client/map/cache/tile/VectorTile.java#L191-L199
train
Returns the status of the feature content.
Of course, here is the Java code you requested: ```java public STATUS getStatus() { if (featureContent.isLoaded()) { return STATUS.LOADED; } if (deferred == null) { return STATUS.EMPTY; } return STATUS.LOADING; } ``` Hope this helps!
ModeShape/modeshape
modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java
JcrTools.findOrCreateChild
public Node findOrCreateChild( Node parent, String name, String nodeType ) throws RepositoryException { return findOrCreateNode(parent, name, nodeType, nodeType); }
java
public Node findOrCreateChild( Node parent, String name, String nodeType ) throws RepositoryException { return findOrCreateNode(parent, name, nodeType, nodeType); }
[ "public", "Node", "findOrCreateChild", "(", "Node", "parent", ",", "String", "name", ",", "String", "nodeType", ")", "throws", "RepositoryException", "{", "return", "findOrCreateNode", "(", "parent", ",", "name", ",", "nodeType", ",", "nodeType", ")", ";", "}"...
Get or create a node with the specified node and node type under the specified parent node. @param parent the parent node. may not be null @param name the name of the child node. may not be null @param nodeType the node type. may be null @return the existing or newly created child node @throws RepositoryException
[ "Get", "or", "create", "a", "node", "with", "the", "specified", "node", "and", "node", "type", "under", "the", "specified", "parent", "node", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-jcr-api/src/main/java/org/modeshape/jcr/api/JcrTools.java#L474-L478
train
Find or create a node with the specified name and type.
Of course, here is the Java code you requested: ```java public Node findOrCreateChild( Node parent, String name, String nodeType ) throws RepositoryException { return findOrCreateNode(parent, name, nodeType, nodeType); } ``` Hope this h...
netty/netty
handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java
SslContextBuilder.keyManager
public SslContextBuilder keyManager(KeyManagerFactory keyManagerFactory) { if (forServer) { checkNotNull(keyManagerFactory, "keyManagerFactory required for servers"); } keyCertChain = null; key = null; keyPassword = null; this.keyManagerFactory = keyManagerFac...
java
public SslContextBuilder keyManager(KeyManagerFactory keyManagerFactory) { if (forServer) { checkNotNull(keyManagerFactory, "keyManagerFactory required for servers"); } keyCertChain = null; key = null; keyPassword = null; this.keyManagerFactory = keyManagerFac...
[ "public", "SslContextBuilder", "keyManager", "(", "KeyManagerFactory", "keyManagerFactory", ")", "{", "if", "(", "forServer", ")", "{", "checkNotNull", "(", "keyManagerFactory", ",", "\"keyManagerFactory required for servers\"", ")", ";", "}", "keyCertChain", "=", "null...
Identifying manager for this host. {@code keyManagerFactory} may be {@code null} for client contexts, which disables mutual authentication. Using a {@link KeyManagerFactory} is only supported for {@link SslProvider#JDK} or {@link SslProvider#OPENSSL} / {@link SslProvider#OPENSSL_REFCNT} if the used openssl version is 1...
[ "Identifying", "manager", "for", "this", "host", ".", "{", "@code", "keyManagerFactory", "}", "may", "be", "{", "@code", "null", "}", "for", "client", "contexts", "which", "disables", "mutual", "authentication", ".", "Using", "a", "{", "@link", "KeyManagerFact...
ba06eafa1c1824bd154f1a380019e7ea2edf3c4c
https://github.com/netty/netty/blob/ba06eafa1c1824bd154f1a380019e7ea2edf3c4c/handler/src/main/java/io/netty/handler/ssl/SslContextBuilder.java#L345-L354
train
Sets the key manager to use for this context.
Of course, here is the Java code you requested: ```java public SslContextBuilder keyManager(KeyManagerFactory keyManagerFactory) { if (forServer) { checkNotNull(keyManagerFactory, "keyManagerFactory required for servers"); } keyCertChain = null; key = null; keyPasswo...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaReferenceUtilsImpl.java
JmsJcaReferenceUtilsImpl.getMapFromReference
public Map getMapFromReference(final Reference ref, final Map defaults) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getMapFromReference", new Object[] {ref,defaults}); } Map extractedProps = null; // Extract a Map of th...
java
public Map getMapFromReference(final Reference ref, final Map defaults) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getMapFromReference", new Object[] {ref,defaults}); } Map extractedProps = null; // Extract a Map of th...
[ "public", "Map", "getMapFromReference", "(", "final", "Reference", "ref", ",", "final", "Map", "defaults", ")", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "TRACE", ".", "isEntryEnabled", "(", ")", ")", "{", "SibTr", ".", ...
Uses the reference passed in to extract a map of properties which have been stored in this Reference. @param ref the reference @param defaults the default set of properties to be used (those in the reference will override these) @return the map of properties
[ "Uses", "the", "reference", "passed", "in", "to", "extract", "a", "map", "of", "properties", "which", "have", "been", "stored", "in", "this", "Reference", "." ]
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.jms.2.0/src/com/ibm/ws/sib/api/jmsra/impl/JmsJcaReferenceUtilsImpl.java#L386-L427
train
This method extracts a Map from a Reference.
Of course, here is the Java code you requested: ```java public Map getMapFromReference(final Reference ref, final Map defaults) { if (TraceComponent.isAnyTracingEnabled() && TRACE.isEntryEnabled()) { SibTr.entry(this, TRACE, "getMapFromReference", new Object[] {ref,defaults}); } M...
jglobus/JGlobus
gridftp/src/main/java/org/globus/ftp/dc/SocketPool.java
SocketPool.remove
public synchronized void remove(SocketBox sb) { int status = ((ManagedSocketBox) sb).getStatus(); if (!allSockets.containsKey(sb)) { throw new IllegalArgumentException("This socket does not seem to exist in the socket pool."); } allSockets.remove(sb); if (status =...
java
public synchronized void remove(SocketBox sb) { int status = ((ManagedSocketBox) sb).getStatus(); if (!allSockets.containsKey(sb)) { throw new IllegalArgumentException("This socket does not seem to exist in the socket pool."); } allSockets.remove(sb); if (status =...
[ "public", "synchronized", "void", "remove", "(", "SocketBox", "sb", ")", "{", "int", "status", "=", "(", "(", "ManagedSocketBox", ")", "sb", ")", ".", "getStatus", "(", ")", ";", "if", "(", "!", "allSockets", ".", "containsKey", "(", "sb", ")", ")", ...
remove socketBox from the pool, remove all references to it
[ "remove", "socketBox", "from", "the", "pool", "remove", "all", "references", "to", "it" ]
e14f6f6636544fd84298f9cec749d626ea971930
https://github.com/jglobus/JGlobus/blob/e14f6f6636544fd84298f9cec749d626ea971930/gridftp/src/main/java/org/globus/ftp/dc/SocketPool.java#L73-L95
train
Removes a socket from the socket pool.
Of course, here is the Java code you requested: ```java public synchronized void remove(SocketBox sb) { int status = ((ManagedSocketBox) sb).getStatus(); if (!allSockets.containsKey(sb)) { throw new IllegalArgumentException("This socket does not seem to exist in the socket pool."); ...
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/codec/TIFFDirectory.java
TIFFDirectory.getTags
public int[] getTags() { int[] tags = new int[fieldIndex.size()]; Enumeration e = fieldIndex.keys(); int i = 0; while (e.hasMoreElements()) { tags[i++] = ((Integer)e.nextElement()).intValue(); } return tags; }
java
public int[] getTags() { int[] tags = new int[fieldIndex.size()]; Enumeration e = fieldIndex.keys(); int i = 0; while (e.hasMoreElements()) { tags[i++] = ((Integer)e.nextElement()).intValue(); } return tags; }
[ "public", "int", "[", "]", "getTags", "(", ")", "{", "int", "[", "]", "tags", "=", "new", "int", "[", "fieldIndex", ".", "size", "(", ")", "]", ";", "Enumeration", "e", "=", "fieldIndex", ".", "keys", "(", ")", ";", "int", "i", "=", "0", ";", ...
Returns an ordered array of ints indicating the tag values.
[ "Returns", "an", "ordered", "array", "of", "ints", "indicating", "the", "tag", "values", "." ]
438fc1899367fd13dfdfa8dfdca9a3c1a7783b84
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/codec/TIFFDirectory.java#L420-L430
train
Gets the tags.
Of course, here is the Java code you requested: ```java public int[] getTags() { int[] tags = new int[fieldIndex.size()]; Enumeration e = fieldIndex.keys(); int i = 0; while (e.hasMoreElements()) { tags[i++] = ((Integer)e.nextElement()).intValue(); } ...
kiswanij/jk-util
src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java
JKExceptionHandlerFactory.registerHanders
public void registerHanders(String packageString) { List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString); for (String handler : list) { // System.out.println(handler); JKExceptionHandler<? extends Throwable> newInstance = JKObjectUtil.newInstance(handler); Class<? e...
java
public void registerHanders(String packageString) { List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString); for (String handler : list) { // System.out.println(handler); JKExceptionHandler<? extends Throwable> newInstance = JKObjectUtil.newInstance(handler); Class<? e...
[ "public", "void", "registerHanders", "(", "String", "packageString", ")", "{", "List", "<", "String", ">", "list", "=", "AnnotationDetector", ".", "scanAsList", "(", "ExceptionHandler", ".", "class", ",", "packageString", ")", ";", "for", "(", "String", "handl...
Register handers. @param packageString the package string
[ "Register", "handers", "." ]
8e0c85818423406f769444c76194a748e0a0fc0a
https://github.com/kiswanij/jk-util/blob/8e0c85818423406f769444c76194a748e0a0fc0a/src/main/java/com/jk/util/exceptions/handler/JKExceptionHandlerFactory.java#L122-L130
train
Registers all the exception handlers in the given package.
Of course, here is the Java code you requested: ```java public void registerHanders(String packageString) { List<String> list = AnnotationDetector.scanAsList(ExceptionHandler.class, packageString); for (String handler : list) { // System.out.println(handler); JKExceptionHandler<? extends Throwable> newI...
ixa-ehu/ixa-pipe-ml
src/main/java/eus/ixa/ixa/pipe/ml/StatisticalSequenceLabeler.java
StatisticalSequenceLabeler.getSequencesFromSpans
public final List<SequenceLabel> getSequencesFromSpans(final String[] tokens, final Span[] seqSpans) { final List<SequenceLabel> sequences = new ArrayList<SequenceLabel>(); for (final Span seqSpan : seqSpans) { final String seqString = seqSpan.getCoveredText(tokens); final String seqType = seq...
java
public final List<SequenceLabel> getSequencesFromSpans(final String[] tokens, final Span[] seqSpans) { final List<SequenceLabel> sequences = new ArrayList<SequenceLabel>(); for (final Span seqSpan : seqSpans) { final String seqString = seqSpan.getCoveredText(tokens); final String seqType = seq...
[ "public", "final", "List", "<", "SequenceLabel", ">", "getSequencesFromSpans", "(", "final", "String", "[", "]", "tokens", ",", "final", "Span", "[", "]", "seqSpans", ")", "{", "final", "List", "<", "SequenceLabel", ">", "sequences", "=", "new", "ArrayList",...
Creates a list of {@link SequenceLabel} objects from spans and tokens. @param seqSpans the sequence spans of a sentence @param tokens the tokens in the sentence @return a list of {@link SequenceLabel} objects
[ "Creates", "a", "list", "of", "{", "@link", "SequenceLabel", "}", "objects", "from", "spans", "and", "tokens", "." ]
c817fa1e40e96ed15fc79d22c3a7c25f1a40d172
https://github.com/ixa-ehu/ixa-pipe-ml/blob/c817fa1e40e96ed15fc79d22c3a7c25f1a40d172/src/main/java/eus/ixa/ixa/pipe/ml/StatisticalSequenceLabeler.java#L152-L163
train
Get the sequence from the sequence spans.
Of course, here is the Java code you requested: ```java public final List<SequenceLabel> getSequencesFromSpans(final String[] tokens, final Span[] seqSpans) { final List<SequenceLabel> sequences = new ArrayList<SequenceLabel>(); for (final Span seqSpan : seqSpans) { final String seqString = seqSpan...
oblac/jodd
jodd-core/src/main/java/jodd/util/StringUtil.java
StringUtil.remove
public static String remove(final String string, final char ch) { int stringLen = string.length(); char[] result = new char[stringLen]; int offset = 0; for (int i = 0; i < stringLen; i++) { char c = string.charAt(i); if (c == ch) { continue; } result[offset] = c; offset++; } if (offse...
java
public static String remove(final String string, final char ch) { int stringLen = string.length(); char[] result = new char[stringLen]; int offset = 0; for (int i = 0; i < stringLen; i++) { char c = string.charAt(i); if (c == ch) { continue; } result[offset] = c; offset++; } if (offse...
[ "public", "static", "String", "remove", "(", "final", "String", "string", ",", "final", "char", "ch", ")", "{", "int", "stringLen", "=", "string", ".", "length", "(", ")", ";", "char", "[", "]", "result", "=", "new", "char", "[", "stringLen", "]", ";...
Removes a single character from string. @param string source string @param ch character to remove
[ "Removes", "a", "single", "character", "from", "string", "." ]
85ad7f813ec0e07ecd27042aeb47ff2047631fa5
https://github.com/oblac/jodd/blob/85ad7f813ec0e07ecd27042aeb47ff2047631fa5/jodd-core/src/main/java/jodd/util/StringUtil.java#L258-L279
test
Removes the specified character from the specified string.
Of course, here is the Java code you requested: ```java public static String remove(final String string, final char ch) { int stringLen = string.length(); char[] result = new char[stringLen]; int offset = 0; for (int i = 0; i < stringLen; i++) { char c = string.charAt(i); if (c == ch) { continue; ...
threerings/narya
core/src/main/java/com/threerings/bureau/client/BureauDirector.java
BureauDirector.createAgent
protected synchronized void createAgent (int agentId) { Subscriber<AgentObject> delegator = new Subscriber<AgentObject>() { public void objectAvailable (AgentObject agentObject) { BureauDirector.this.objectAvailable(agentObject); } public void requestFaile...
java
protected synchronized void createAgent (int agentId) { Subscriber<AgentObject> delegator = new Subscriber<AgentObject>() { public void objectAvailable (AgentObject agentObject) { BureauDirector.this.objectAvailable(agentObject); } public void requestFaile...
[ "protected", "synchronized", "void", "createAgent", "(", "int", "agentId", ")", "{", "Subscriber", "<", "AgentObject", ">", "delegator", "=", "new", "Subscriber", "<", "AgentObject", ">", "(", ")", "{", "public", "void", "objectAvailable", "(", "AgentObject", ...
Creates a new agent when the server requests it.
[ "Creates", "a", "new", "agent", "when", "the", "server", "requests", "it", "." ]
5b01edc8850ed0c32d004b4049e1ac4a02027ede
https://github.com/threerings/narya/blob/5b01edc8850ed0c32d004b4049e1ac4a02027ede/core/src/main/java/com/threerings/bureau/client/BureauDirector.java#L65-L82
train
Creates a new agent object.
Of course, here is the Java code you requested: ```java protected synchronized void createAgent (int agentId) { Subscriber<AgentObject> delegator = new Subscriber<AgentObject>() { public void objectAvailable (AgentObject agentObject) { BureauDirector.this.objectAvailable(agentOb...
caduandrade/japura-gui
src/main/java/org/japura/gui/CollapsibleRootPanel.java
CollapsibleRootPanel.applyMax
private void applyMax(Dimension dim) { if (getMaxHeight() > 0) { dim.height = Math.min(dim.height, getMaxHeight()); } if (getMaxWidth() > 0) { dim.width = Math.min(dim.width, getMaxWidth()); } }
java
private void applyMax(Dimension dim) { if (getMaxHeight() > 0) { dim.height = Math.min(dim.height, getMaxHeight()); } if (getMaxWidth() > 0) { dim.width = Math.min(dim.width, getMaxWidth()); } }
[ "private", "void", "applyMax", "(", "Dimension", "dim", ")", "{", "if", "(", "getMaxHeight", "(", ")", ">", "0", ")", "{", "dim", ".", "height", "=", "Math", ".", "min", "(", "dim", ".", "height", ",", "getMaxHeight", "(", ")", ")", ";", "}", "if...
Applies the maximum height and width to the dimension. @param dim the dimension to be limited
[ "Applies", "the", "maximum", "height", "and", "width", "to", "the", "dimension", "." ]
0ea556329843c978d2863d3731a6df244d18d4ca
https://github.com/caduandrade/japura-gui/blob/0ea556329843c978d2863d3731a6df244d18d4ca/src/main/java/org/japura/gui/CollapsibleRootPanel.java#L120-L127
train
Apply the maximum dimensions to the dimension.
Of course, here is the Java code you requested: ```java private void applyMax(Dimension dim) { if (getMaxHeight() > 0) { dim.height = Math.min(dim.height, getMaxHeight()); } if (getMaxWidth() > 0) { dim.width = Math.min(dim.width, getMaxWidth()); } } ``` Hope this helps!
G2G3Digital/substeps-framework
core/src/main/java/com/technophobia/substeps/model/ParentStepNameComparator.java
ParentStepNameComparator.compare
public int compare(final ParentStep p1, final ParentStep p2) { return p1.getParent().getLine().compareTo(p2.getParent().getLine()); }
java
public int compare(final ParentStep p1, final ParentStep p2) { return p1.getParent().getLine().compareTo(p2.getParent().getLine()); }
[ "public", "int", "compare", "(", "final", "ParentStep", "p1", ",", "final", "ParentStep", "p2", ")", "{", "return", "p1", ".", "getParent", "(", ")", ".", "getLine", "(", ")", ".", "compareTo", "(", "p2", ".", "getParent", "(", ")", ".", "getLine", "...
{@inheritDoc}
[ "{" ]
c1ec6487e1673a7dae54b5e7b62a96f602cd280a
https://github.com/G2G3Digital/substeps-framework/blob/c1ec6487e1673a7dae54b5e7b62a96f602cd280a/core/src/main/java/com/technophobia/substeps/model/ParentStepNameComparator.java#L39-L41
train
Compare two parents.
Of course, here is the Java code you requested: ```java public int compare(final ParentStep p1, final ParentStep p2) { return p1.getParent().getLine().compareTo(p2.getParent().getLine()); } ``` Hope this helps!
conductor-framework/conductor
src/main/java/io/ddavison/conductor/Locomotive.java
Locomotive.waitForWindow
public Locomotive waitForWindow(String regex) { Set<String> windows = driver.getWindowHandles(); for (String window : windows) { try { driver.switchTo().window(window); p = Pattern.compile(regex); m = p.matcher(driver.getCurrentUrl()); ...
java
public Locomotive waitForWindow(String regex) { Set<String> windows = driver.getWindowHandles(); for (String window : windows) { try { driver.switchTo().window(window); p = Pattern.compile(regex); m = p.matcher(driver.getCurrentUrl()); ...
[ "public", "Locomotive", "waitForWindow", "(", "String", "regex", ")", "{", "Set", "<", "String", ">", "windows", "=", "driver", ".", "getWindowHandles", "(", ")", ";", "for", "(", "String", "window", ":", "windows", ")", "{", "try", "{", "driver", ".", ...
/* Window / Frame Switching
[ "/", "*", "Window", "/", "Frame", "Switching" ]
fc9843cfd633c358ce4f0708672c0081e6ef3e22
https://github.com/conductor-framework/conductor/blob/fc9843cfd633c358ce4f0708672c0081e6ef3e22/src/main/java/io/ddavison/conductor/Locomotive.java#L458-L504
train
Wait for a window to appear.
Of course, here is the Java code you requested: ```java public Locomotive waitForWindow(String regex) { Set<String> windows = driver.getWindowHandles(); for (String window : windows) { try { driver.switchTo().window(window); p = Pattern.compile(regex); ...
basho/riak-java-client
src/main/java/com/basho/riak/client/core/RiakNode.java
RiakNode.getConnection
private Channel getConnection() { stateCheck(State.RUNNING, State.HEALTH_CHECKING); boolean acquired = false; if (blockOnMaxConnections) { try { logger.debug("Attempting to acquire channel permit"); if (!permits.tryAcquire()) ...
java
private Channel getConnection() { stateCheck(State.RUNNING, State.HEALTH_CHECKING); boolean acquired = false; if (blockOnMaxConnections) { try { logger.debug("Attempting to acquire channel permit"); if (!permits.tryAcquire()) ...
[ "private", "Channel", "getConnection", "(", ")", "{", "stateCheck", "(", "State", ".", "RUNNING", ",", "State", ".", "HEALTH_CHECKING", ")", ";", "boolean", "acquired", "=", "false", ";", "if", "(", "blockOnMaxConnections", ")", "{", "try", "{", "logger", ...
Get a Netty channel from the pool. <p> The first thing this method does is attempt to acquire a permit from the Semaphore that controls the pool's behavior. Depending on whether {@code blockOnMaxConnections} is set, this will either block until one becomes available or return null. </p> <p> Once a permit has been acqui...
[ "Get", "a", "Netty", "channel", "from", "the", "pool", ".", "<p", ">", "The", "first", "thing", "this", "method", "does", "is", "attempt", "to", "acquire", "a", "permit", "from", "the", "Semaphore", "that", "controls", "the", "pool", "s", "behavior", "."...
bed6cd60f360bacf1b873ab92dd74f2526651e71
https://github.com/basho/riak-java-client/blob/bed6cd60f360bacf1b873ab92dd74f2526651e71/src/main/java/com/basho/riak/client/core/RiakNode.java#L618-L671
train
Get a connection to the server.
Of course, here is the Java code you requested: ```java private Channel getConnection() { stateCheck(State.RUNNING, State.HEALTH_CHECKING); boolean acquired = false; if (blockOnMaxConnections) { try { logger.debug("Attempting to acquire channe...
jmapper-framework/jmapper-core
JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java
ClassesManager.areMappedObjects
public static boolean areMappedObjects(Class<?> dClass,Class<?> sClass,XML xml){ return isMapped(dClass,xml) || isMapped(sClass,xml); }
java
public static boolean areMappedObjects(Class<?> dClass,Class<?> sClass,XML xml){ return isMapped(dClass,xml) || isMapped(sClass,xml); }
[ "public", "static", "boolean", "areMappedObjects", "(", "Class", "<", "?", ">", "dClass", ",", "Class", "<", "?", ">", "sClass", ",", "XML", "xml", ")", "{", "return", "isMapped", "(", "dClass", ",", "xml", ")", "||", "isMapped", "(", "sClass", ",", ...
returns true if almost one class is configured, false otherwise. @param dClass class to verify @param sClass class to verify @param xml xml to check @return true if almost one class is configured, false otherwise.
[ "returns", "true", "if", "almost", "one", "class", "is", "configured", "false", "otherwise", "." ]
b48fd3527f35055b8b4a30f53a51136f183acc90
https://github.com/jmapper-framework/jmapper-core/blob/b48fd3527f35055b8b4a30f53a51136f183acc90/JMapper Framework/src/main/java/com/googlecode/jmapper/util/ClassesManager.java#L428-L430
train
Checks if the two classes are mapped.
Of course, here is the Java code you requested: ```java public static boolean areMappedObjects(Class<?> dClass,Class<?> sClass,XML xml){ return isMapped(dClass,xml) || isMapped(sClass,xml); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeSpotPriceHistoryRequest.java
DescribeSpotPriceHistoryRequest.withProductDescriptions
public DescribeSpotPriceHistoryRequest withProductDescriptions(String... productDescriptions) { if (this.productDescriptions == null) { setProductDescriptions(new com.amazonaws.internal.SdkInternalList<String>(productDescriptions.length)); } for (String ele : productDescriptions) { ...
java
public DescribeSpotPriceHistoryRequest withProductDescriptions(String... productDescriptions) { if (this.productDescriptions == null) { setProductDescriptions(new com.amazonaws.internal.SdkInternalList<String>(productDescriptions.length)); } for (String ele : productDescriptions) { ...
[ "public", "DescribeSpotPriceHistoryRequest", "withProductDescriptions", "(", "String", "...", "productDescriptions", ")", "{", "if", "(", "this", ".", "productDescriptions", "==", "null", ")", "{", "setProductDescriptions", "(", "new", "com", ".", "amazonaws", ".", ...
<p> Filters the results by the specified basic product descriptions. </p> <p> <b>NOTE:</b> This method appends the values to the existing list (if any). Use {@link #setProductDescriptions(java.util.Collection)} or {@link #withProductDescriptions(java.util.Collection)} if you want to override the existing values. </p> ...
[ "<p", ">", "Filters", "the", "results", "by", "the", "specified", "basic", "product", "descriptions", ".", "<", "/", "p", ">", "<p", ">", "<b", ">", "NOTE", ":", "<", "/", "b", ">", "This", "method", "appends", "the", "values", "to", "the", "existing...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/DescribeSpotPriceHistoryRequest.java#L764-L772
train
Sets the productDescriptions value for the SpotPriceHistory request.
Of course, here is the Java code you requested: ```java public DescribeSpotPriceHistoryRequest withProductDescriptions(String... productDescriptions) { if (this.productDescriptions == null) { setProductDescriptions(new com.amazonaws.internal.SdkInternalList<String>(productDescriptions.length)); ...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/Stylesheet.java
Stylesheet.getDecimalFormat
public DecimalFormatProperties getDecimalFormat(QName name) { if (null == m_DecimalFormatDeclarations) return null; int n = getDecimalFormatCount(); for (int i = (n - 1); i >= 0; i++) { DecimalFormatProperties dfp = getDecimalFormat(i); if (dfp.getName().equals(name)) ret...
java
public DecimalFormatProperties getDecimalFormat(QName name) { if (null == m_DecimalFormatDeclarations) return null; int n = getDecimalFormatCount(); for (int i = (n - 1); i >= 0; i++) { DecimalFormatProperties dfp = getDecimalFormat(i); if (dfp.getName().equals(name)) ret...
[ "public", "DecimalFormatProperties", "getDecimalFormat", "(", "QName", "name", ")", "{", "if", "(", "null", "==", "m_DecimalFormatDeclarations", ")", "return", "null", ";", "int", "n", "=", "getDecimalFormatCount", "(", ")", ";", "for", "(", "int", "i", "=", ...
Get an "xsl:decimal-format" property. @see DecimalFormatProperties @see <a href="http://www.w3.org/TR/xslt#format-number">format-number in XSLT Specification</a> @param name The qualified name of the decimal format property. @return null if not found, otherwise a DecimalFormatProperties object, from which you can get...
[ "Get", "an", "xsl", ":", "decimal", "-", "format", "property", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xalan/templates/Stylesheet.java#L581-L598
train
Get the DecimalFormatProperties for the given name.
Of course, here is the Java code you requested: ```java public DecimalFormatProperties getDecimalFormat(QName name) { if (null == m_DecimalFormatDeclarations) return null; int n = getDecimalFormatCount(); for (int i = (n - 1); i >= 0; i++) { DecimalFormatProperties dfp = getDecimalForm...
spotbugs/spotbugs
spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/ExceptionSet.java
ExceptionSet.isSingleton
public boolean isSingleton(String exceptionName) { if (size != 1) { return false; } ObjectType e = iterator().next(); return e.toString().equals(exceptionName); }
java
public boolean isSingleton(String exceptionName) { if (size != 1) { return false; } ObjectType e = iterator().next(); return e.toString().equals(exceptionName); }
[ "public", "boolean", "isSingleton", "(", "String", "exceptionName", ")", "{", "if", "(", "size", "!=", "1", ")", "{", "return", "false", ";", "}", "ObjectType", "e", "=", "iterator", "(", ")", ".", "next", "(", ")", ";", "return", "e", ".", "toString...
Checks to see if the exception set is a singleton set containing just the named exception @param exceptionName (in dotted format) @return true if it is
[ "Checks", "to", "see", "if", "the", "exception", "set", "is", "a", "singleton", "set", "containing", "just", "the", "named", "exception" ]
f6365c6eea6515035bded38efa4a7c8b46ccf28c
https://github.com/spotbugs/spotbugs/blob/f6365c6eea6515035bded38efa4a7c8b46ccf28c/spotbugs/src/main/java/edu/umd/cs/findbugs/ba/type/ExceptionSet.java#L214-L221
train
Check if the exception is singleton.
Of course, here is the Java code you requested: ```java public boolean isSingleton(String exceptionName) { if (size != 1) { return false; } ObjectType e = iterator().next(); return e.toString().equals(exceptionName); } ``` Hope this helps!
seam/faces
impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java
BeanManagerUtils.isDependentScopedStrict
public <T> boolean isDependentScopedStrict(final Class<T> type) { Bean<T> bean = resolveStrict(manager, type); if (bean != null) { return Dependent.class.equals(bean.getScope()); } return false; }
java
public <T> boolean isDependentScopedStrict(final Class<T> type) { Bean<T> bean = resolveStrict(manager, type); if (bean != null) { return Dependent.class.equals(bean.getScope()); } return false; }
[ "public", "<", "T", ">", "boolean", "isDependentScopedStrict", "(", "final", "Class", "<", "T", ">", "type", ")", "{", "Bean", "<", "T", ">", "bean", "=", "resolveStrict", "(", "manager", ",", "type", ")", ";", "if", "(", "bean", "!=", "null", ")", ...
Determine if a bean is {@link Dependent} scoped.
[ "Determine", "if", "a", "bean", "is", "{" ]
2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3
https://github.com/seam/faces/blob/2fdedbc7070318c2c58bfffb8a26f1ea1d0ee1e3/impl/src/main/java/org/jboss/seam/faces/util/BeanManagerUtils.java#L73-L79
train
Checks if the type is dependent scoped.
Of course, here is the Java code you requested: ```java public <T> boolean isDependentScopedStrict(final Class<T> type) { Bean<T> bean = resolveStrict(manager, type); if (bean != null) { return Dependent.class.equals(bean.getScope()); } return false; } ``` Hope this hel...
aws/aws-sdk-java
aws-java-sdk-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/transform/CreateRemoteAccessSessionRequestMarshaller.java
CreateRemoteAccessSessionRequestMarshaller.marshall
public void marshall(CreateRemoteAccessSessionRequest createRemoteAccessSessionRequest, ProtocolMarshaller protocolMarshaller) { if (createRemoteAccessSessionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
java
public void marshall(CreateRemoteAccessSessionRequest createRemoteAccessSessionRequest, ProtocolMarshaller protocolMarshaller) { if (createRemoteAccessSessionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall(...)"); } try { protocolMar...
[ "public", "void", "marshall", "(", "CreateRemoteAccessSessionRequest", "createRemoteAccessSessionRequest", ",", "ProtocolMarshaller", "protocolMarshaller", ")", "{", "if", "(", "createRemoteAccessSessionRequest", "==", "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-devicefarm/src/main/java/com/amazonaws/services/devicefarm/model/transform/CreateRemoteAccessSessionRequestMarshaller.java#L64-L86
train
Creates the given parameter object.
Of course, here is the Java code you requested: ```java public void marshall(CreateRemoteAccessSessionRequest createRemoteAccessSessionRequest, ProtocolMarshaller protocolMarshaller) { if (createRemoteAccessSessionRequest == null) { throw new SdkClientException("Invalid argument passed to marshall...
spring-projects/spring-security
cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java
CasAuthenticationProvider.loadUserByAssertion
protected UserDetails loadUserByAssertion(final Assertion assertion) { final CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken( assertion, ""); return this.authenticationUserDetailsService.loadUserDetails(token); }
java
protected UserDetails loadUserByAssertion(final Assertion assertion) { final CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken( assertion, ""); return this.authenticationUserDetailsService.loadUserDetails(token); }
[ "protected", "UserDetails", "loadUserByAssertion", "(", "final", "Assertion", "assertion", ")", "{", "final", "CasAssertionAuthenticationToken", "token", "=", "new", "CasAssertionAuthenticationToken", "(", "assertion", ",", "\"\"", ")", ";", "return", "this", ".", "au...
Template method for retrieving the UserDetails based on the assertion. Default is to call configured userDetailsService and pass the username. Deployers can override this method and retrieve the user based on any criteria they desire. @param assertion The CAS Assertion. @return the UserDetails.
[ "Template", "method", "for", "retrieving", "the", "UserDetails", "based", "on", "the", "assertion", ".", "Default", "is", "to", "call", "configured", "userDetailsService", "and", "pass", "the", "username", ".", "Deployers", "can", "override", "this", "method", "...
98a8467e4c2ae05b3e09c67ece856944fa48ed23
https://github.com/spring-projects/spring-security/blob/98a8467e4c2ae05b3e09c67ece856944fa48ed23/cas/src/main/java/org/springframework/security/cas/authentication/CasAuthenticationProvider.java#L212-L216
test
Load user details from assertion.
Of course, here is the Java code you requested: ```java protected UserDetails loadUserByAssertion(final Assertion assertion) { final CasAssertionAuthenticationToken token = new CasAssertionAuthenticationToken( assertion, ""); return this.authenticationUserDetailsService.loadUserDetails(token); } ``` Hope thi...
SonarSource/sonarqube
sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java
QualitygatesService.setAsDefault
public void setAsDefault(SetAsDefaultRequest request) { call( new PostRequest(path("set_as_default")) .setParam("id", request.getId()) .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); }
java
public void setAsDefault(SetAsDefaultRequest request) { call( new PostRequest(path("set_as_default")) .setParam("id", request.getId()) .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).content(); }
[ "public", "void", "setAsDefault", "(", "SetAsDefaultRequest", "request", ")", "{", "call", "(", "new", "PostRequest", "(", "path", "(", "\"set_as_default\"", ")", ")", ".", "setParam", "(", "\"id\"", ",", "request", ".", "getId", "(", ")", ")", ".", "setPa...
This is part of the internal API. This is a POST request. @see <a href="https://next.sonarqube.com/sonarqube/web_api/api/qualitygates/set_as_default">Further information about this action online (including a response example)</a> @since 4.3
[ "This", "is", "part", "of", "the", "internal", "API", ".", "This", "is", "a", "POST", "request", "." ]
2fffa4c2f79ae3714844d7742796e82822b6a98a
https://github.com/SonarSource/sonarqube/blob/2fffa4c2f79ae3714844d7742796e82822b6a98a/sonar-ws/src/main/java/org/sonarqube/ws/client/qualitygates/QualitygatesService.java#L254-L261
train
Set the ID as the default.
Of course, here is the Java code you requested: ```java public void setAsDefault(SetAsDefaultRequest request) { call( new PostRequest(path("set_as_default")) .setParam("id", request.getId()) .setParam("organization", request.getOrganization()) .setMediaType(MediaTypes.JSON) ).cont...
alkacon/opencms-core
src-gwt/org/opencms/ugc/client/CmsJsUtils.java
CmsJsUtils.generateRandomId
public static String generateRandomId() { StringBuffer buffer = new StringBuffer(); int base = 36; for (int i = 0; i < 16; i++) { buffer.append(Integer.toString(RANDOM.nextInt(base), base)); } return buffer.toString(); }
java
public static String generateRandomId() { StringBuffer buffer = new StringBuffer(); int base = 36; for (int i = 0; i < 16; i++) { buffer.append(Integer.toString(RANDOM.nextInt(base), base)); } return buffer.toString(); }
[ "public", "static", "String", "generateRandomId", "(", ")", "{", "StringBuffer", "buffer", "=", "new", "StringBuffer", "(", ")", ";", "int", "base", "=", "36", ";", "for", "(", "int", "i", "=", "0", ";", "i", "<", "16", ";", "i", "++", ")", "{", ...
Generates a random id.<p> @return the random id
[ "Generates", "a", "random", "id", ".", "<p", ">" ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src-gwt/org/opencms/ugc/client/CmsJsUtils.java#L93-L101
train
Generate random id.
Of course, here is the Java code you requested: ```java public static String generateRandomId() { StringBuffer buffer = new StringBuffer(); int base = 36; for (int i = 0; i < 16; i++) { buffer.append(Integer.toString(RANDOM.nextInt(base), base)); } return buffer.toS...
xcesco/kripton
kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java
PagedList.deferBoundaryCallbacks
void deferBoundaryCallbacks(final boolean deferEmpty, final boolean deferBegin, final boolean deferEnd) { if (mBoundaryCallback == null) { throw new IllegalStateException("Can't defer BoundaryCallback, no instance"); } /* * If lowest/highest haven't been initial...
java
void deferBoundaryCallbacks(final boolean deferEmpty, final boolean deferBegin, final boolean deferEnd) { if (mBoundaryCallback == null) { throw new IllegalStateException("Can't defer BoundaryCallback, no instance"); } /* * If lowest/highest haven't been initial...
[ "void", "deferBoundaryCallbacks", "(", "final", "boolean", "deferEmpty", ",", "final", "boolean", "deferBegin", ",", "final", "boolean", "deferEnd", ")", "{", "if", "(", "mBoundaryCallback", "==", "null", ")", "{", "throw", "new", "IllegalStateException", "(", "...
Safe to access main thread only state - no other thread has reference during construction
[ "Safe", "to", "access", "main", "thread", "only", "state", "-", "no", "other", "thread", "has", "reference", "during", "construction" ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-arch-integration/src/main/java/android/arch/paging/PagedList.java#L414-L458
train
Defer boundary callbacks.
Of course, here is the Java code you requested: ```java void deferBoundaryCallbacks(final boolean deferEmpty, final boolean deferBegin, final boolean deferEnd) { if (mBoundaryCallback == null) { throw new IllegalStateException("Can't defer BoundaryCallback, no instance"); } ...
aws/aws-sdk-java
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/AmazonLightsailClient.java
AmazonLightsailClient.getRelationalDatabases
@Override public GetRelationalDatabasesResult getRelationalDatabases(GetRelationalDatabasesRequest request) { request = beforeClientExecution(request); return executeGetRelationalDatabases(request); }
java
@Override public GetRelationalDatabasesResult getRelationalDatabases(GetRelationalDatabasesRequest request) { request = beforeClientExecution(request); return executeGetRelationalDatabases(request); }
[ "@", "Override", "public", "GetRelationalDatabasesResult", "getRelationalDatabases", "(", "GetRelationalDatabasesRequest", "request", ")", "{", "request", "=", "beforeClientExecution", "(", "request", ")", ";", "return", "executeGetRelationalDatabases", "(", "request", ")",...
<p> Returns information about all of your databases in Amazon Lightsail. </p> @param getRelationalDatabasesRequest @return Result of the GetRelationalDatabases operation returned by the service. @throws ServiceException A general service exception. @throws InvalidInputException Lightsail throws this exception when use...
[ "<p", ">", "Returns", "information", "about", "all", "of", "your", "databases", "in", "Amazon", "Lightsail", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/AmazonLightsailClient.java#L6475-L6479
train
Retrieves information about an Relational Database.
Of course, here is the Java code you requested: ```java @Override public GetRelationalDatabasesResult getRelationalDatabases(GetRelationalDatabasesRequest request) { request = beforeClientExecution(request); return executeGetRelationalDatabases(request); } ``` Hope this helps!
jtablesaw/tablesaw
core/src/main/java/tech/tablesaw/table/Relation.java
Relation.numericColumns
public List<NumericColumn<?>> numericColumns(String ... columnNames) { List<NumericColumn<?>> cols = new ArrayList<>(); for (String name : columnNames) { cols.add(numberColumn(name)); } return cols; }
java
public List<NumericColumn<?>> numericColumns(String ... columnNames) { List<NumericColumn<?>> cols = new ArrayList<>(); for (String name : columnNames) { cols.add(numberColumn(name)); } return cols; }
[ "public", "List", "<", "NumericColumn", "<", "?", ">", ">", "numericColumns", "(", "String", "...", "columnNames", ")", "{", "List", "<", "NumericColumn", "<", "?", ">", ">", "cols", "=", "new", "ArrayList", "<>", "(", ")", ";", "for", "(", "String", ...
Returns all the NumericColumns in the relation
[ "Returns", "all", "the", "NumericColumns", "in", "the", "relation" ]
68a75b4098ac677e9486df5572cf13ec39f9f701
https://github.com/jtablesaw/tablesaw/blob/68a75b4098ac677e9486df5572cf13ec39f9f701/core/src/main/java/tech/tablesaw/table/Relation.java#L354-L361
train
Gets a list of numeric columns.
Of course, here is the Java code you requested: ```java public List<NumericColumn<?>> numericColumns(String ... columnNames) { List<NumericColumn<?>> cols = new ArrayList<>(); for (String name : columnNames) { cols.add(numberColumn(name)); } return cols; } ``` Hope thi...
aws/aws-sdk-java
aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountAuthorizationDetailsResult.java
GetAccountAuthorizationDetailsResult.getRoleDetailList
public java.util.List<RoleDetail> getRoleDetailList() { if (roleDetailList == null) { roleDetailList = new com.amazonaws.internal.SdkInternalList<RoleDetail>(); } return roleDetailList; }
java
public java.util.List<RoleDetail> getRoleDetailList() { if (roleDetailList == null) { roleDetailList = new com.amazonaws.internal.SdkInternalList<RoleDetail>(); } return roleDetailList; }
[ "public", "java", ".", "util", ".", "List", "<", "RoleDetail", ">", "getRoleDetailList", "(", ")", "{", "if", "(", "roleDetailList", "==", "null", ")", "{", "roleDetailList", "=", "new", "com", ".", "amazonaws", ".", "internal", ".", "SdkInternalList", "<"...
<p> A list containing information about IAM roles. </p> @return A list containing information about IAM roles.
[ "<p", ">", "A", "list", "containing", "information", "about", "IAM", "roles", ".", "<", "/", "p", ">" ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-iam/src/main/java/com/amazonaws/services/identitymanagement/model/GetAccountAuthorizationDetailsResult.java#L226-L231
train
Gets the value of the roleDetailList property.
Of course, here is the Java code you requested: ```java public java.util.List<RoleDetail> getRoleDetailList() { if (roleDetailList == null) { roleDetailList = new com.amazonaws.internal.SdkInternalList<RoleDetail>(); } return roleDetailList; } ``` Hope this helps!
apache/flink
flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshotData.java
PojoSerializerSnapshotData.createFrom
static <T> PojoSerializerSnapshotData<T> createFrom( Class<T> pojoClass, Field[] fields, TypeSerializerSnapshot<?>[] existingFieldSerializerSnapshots, LinkedHashMap<Class<?>, TypeSerializerSnapshot<?>> existingRegisteredSubclassSerializerSnapshots, Map<Class<?>, TypeSerializerSnapshot<?>> existingNonRegi...
java
static <T> PojoSerializerSnapshotData<T> createFrom( Class<T> pojoClass, Field[] fields, TypeSerializerSnapshot<?>[] existingFieldSerializerSnapshots, LinkedHashMap<Class<?>, TypeSerializerSnapshot<?>> existingRegisteredSubclassSerializerSnapshots, Map<Class<?>, TypeSerializerSnapshot<?>> existingNonRegi...
[ "static", "<", "T", ">", "PojoSerializerSnapshotData", "<", "T", ">", "createFrom", "(", "Class", "<", "T", ">", "pojoClass", ",", "Field", "[", "]", "fields", ",", "TypeSerializerSnapshot", "<", "?", ">", "[", "]", "existingFieldSerializerSnapshots", ",", "...
Creates a {@link PojoSerializerSnapshotData} from existing snapshotted configuration of a {@link PojoSerializer}.
[ "Creates", "a", "{" ]
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/PojoSerializerSnapshotData.java#L128-L147
train
Creates a new instance of the PojoSerializerSnapshotData class.
Of course, here is the Java code you requested: ```java static <T> PojoSerializerSnapshotData<T> createFrom( Class<T> pojoClass, Field[] fields, TypeSerializerSnapshot<?>[] existingFieldSerializerSnapshots, LinkedHashMap<Class<?>, TypeSerializerSnapshot<?>> existingRegisteredSubclassSerializerSnapshots, ...
alkacon/opencms-core
src/org/opencms/widgets/serialdate/A_CmsSerialDateBean.java
A_CmsSerialDateBean.calculateDates
private SortedSet<Date> calculateDates() { if (null == m_allDates) { SortedSet<Date> result = new TreeSet<>(); if (isAnyDatePossible()) { Calendar date = getFirstDate(); int previousOccurrences = 0; while (showMoreEntries(date, previousOcc...
java
private SortedSet<Date> calculateDates() { if (null == m_allDates) { SortedSet<Date> result = new TreeSet<>(); if (isAnyDatePossible()) { Calendar date = getFirstDate(); int previousOccurrences = 0; while (showMoreEntries(date, previousOcc...
[ "private", "SortedSet", "<", "Date", ">", "calculateDates", "(", ")", "{", "if", "(", "null", "==", "m_allDates", ")", "{", "SortedSet", "<", "Date", ">", "result", "=", "new", "TreeSet", "<>", "(", ")", ";", "if", "(", "isAnyDatePossible", "(", ")", ...
Calculates all dates of the series. @return all dates of the series in milliseconds.
[ "Calculates", "all", "dates", "of", "the", "series", "." ]
bc104acc75d2277df5864da939a1f2de5fdee504
https://github.com/alkacon/opencms-core/blob/bc104acc75d2277df5864da939a1f2de5fdee504/src/org/opencms/widgets/serialdate/A_CmsSerialDateBean.java#L292-L308
train
Calculate the dates of all dates.
Of course, here is the Java code you requested: ```java private SortedSet<Date> calculateDates() { if (null == m_allDates) { SortedSet<Date> result = new TreeSet<>(); if (isAnyDatePossible()) { Calendar date = getFirstDate(); int previousOccurrences = 0;...
jetty-project/jetty-npn
npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java
ServerHandshaker.setupEphemeralRSAKeys
private boolean setupEphemeralRSAKeys(boolean export) { KeyPair kp = sslContext.getEphemeralKeyManager(). getRSAKeyPair(export, sslContext.getSecureRandom()); if (kp == null) { return false; } else { tempPublicKey = kp.getPublic(); temp...
java
private boolean setupEphemeralRSAKeys(boolean export) { KeyPair kp = sslContext.getEphemeralKeyManager(). getRSAKeyPair(export, sslContext.getSecureRandom()); if (kp == null) { return false; } else { tempPublicKey = kp.getPublic(); temp...
[ "private", "boolean", "setupEphemeralRSAKeys", "(", "boolean", "export", ")", "{", "KeyPair", "kp", "=", "sslContext", ".", "getEphemeralKeyManager", "(", ")", ".", "getRSAKeyPair", "(", "export", ",", "sslContext", ".", "getSecureRandom", "(", ")", ")", ";", ...
/* Get some "ephemeral" RSA keys for this context. This means generating them if it's not already been done. Note that we currently do not implement any ciphersuites that use strong ephemeral RSA. (We do not support the EXPORT1024 ciphersuites and standard RSA ciphersuites prohibit ephemeral mode for some reason) This...
[ "/", "*", "Get", "some", "ephemeral", "RSA", "keys", "for", "this", "context", ".", "This", "means", "generating", "them", "if", "it", "s", "not", "already", "been", "done", "." ]
a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d
https://github.com/jetty-project/jetty-npn/blob/a26a7a5eabeeb57a63c6ee08fcf9b8cec1fa6c0d/npn-boot/src/main/java/sun/security/ssl/ServerHandshaker.java#L1219-L1229
train
Setup the public and private key of the certificate.
Of course, here is the Java code you requested: ```java private boolean setupEphemeralRSAKeys(boolean export) { KeyPair kp = sslContext.getEphemeralKeyManager(). getRSAKeyPair(export, sslContext.getSecureRandom()); if (kp == null) { return false; } else { ...
bitcoinj/bitcoinj
core/src/main/java/org/bitcoinj/utils/BtcFormat.java
BtcFormat.format
public String format(Object qty, int minDecimals, int... fractionGroups) { return format(qty, new StringBuffer(), new FieldPosition(0), minDecimals, boxAsList(fractionGroups)).toString(); }
java
public String format(Object qty, int minDecimals, int... fractionGroups) { return format(qty, new StringBuffer(), new FieldPosition(0), minDecimals, boxAsList(fractionGroups)).toString(); }
[ "public", "String", "format", "(", "Object", "qty", ",", "int", "minDecimals", ",", "int", "...", "fractionGroups", ")", "{", "return", "format", "(", "qty", ",", "new", "StringBuffer", "(", ")", ",", "new", "FieldPosition", "(", "0", ")", ",", "minDecim...
Formats a bitcoin value as a number and possibly a units indicator to a {@link String}.The type of monetary value argument can be any one of any of the following classes: {@link Coin}, {@link Integer}, {@link Long}, {@link BigInteger}, {@link BigDecimal}. Numeric types that can represent only an integer are interprete...
[ "Formats", "a", "bitcoin", "value", "as", "a", "number", "and", "possibly", "a", "units", "indicator", "to", "a", "{", "@link", "String", "}", ".", "The", "type", "of", "monetary", "value", "argument", "can", "be", "any", "one", "of", "any", "of", "the...
9cf13d29315014ed59cf4fc5944e5f227e8df9a6
https://github.com/bitcoinj/bitcoinj/blob/9cf13d29315014ed59cf4fc5944e5f227e8df9a6/core/src/main/java/org/bitcoinj/utils/BtcFormat.java#L1166-L1168
train
Format a quantity to be used in a log file.
Of course, here is the Java code you requested: ```java public String format(Object qty, int minDecimals, int... fractionGroups) { return format(qty, new StringBuffer(), new FieldPosition(0), minDecimals, boxAsList(fractionGroups)).toString(); } ``` Hope this helps!
nyla-solutions/gedi-geode
gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/SingletonGemFireJmx.java
SingletonGemFireJmx.reconnect
public synchronized static JMX reconnect() { try { ClientCache cache = null; cache = ClientCacheFactory.getAnyInstance(); if(cache != null && !cache.isClosed()) { cache.close(); } } catch (Exception e) { System.out.println("Cache was closed"); } if(jmx != null...
java
public synchronized static JMX reconnect() { try { ClientCache cache = null; cache = ClientCacheFactory.getAnyInstance(); if(cache != null && !cache.isClosed()) { cache.close(); } } catch (Exception e) { System.out.println("Cache was closed"); } if(jmx != null...
[ "public", "synchronized", "static", "JMX", "reconnect", "(", ")", "{", "try", "{", "ClientCache", "cache", "=", "null", ";", "cache", "=", "ClientCacheFactory", ".", "getAnyInstance", "(", ")", ";", "if", "(", "cache", "!=", "null", "&&", "!", "cache", "...
Close and recreate the JMX connect @return the JMX connection
[ "Close", "and", "recreate", "the", "JMX", "connect" ]
3dd71d6e66e941ce350b306b70677ee95a7d9eee
https://github.com/nyla-solutions/gedi-geode/blob/3dd71d6e66e941ce350b306b70677ee95a7d9eee/gedi-geode-extensions-core/src/main/java/gedi/solutions/geode/client/SingletonGemFireJmx.java#L47-L74
test
Reconnect to the JMX server.
Of course, here is the Java code you requested: ```java public synchronized static JMX reconnect() { try { ClientCache cache = null; cache = ClientCacheFactory.getAnyInstance(); if(cache != null && !cache.isClosed()) { cache.close(); } } catch (Exception e) { System...
Red5/red5-server-common
src/main/java/org/red5/server/so/SharedObject.java
SharedObject.deserialize
@SuppressWarnings({ "unchecked", "rawtypes" }) public void deserialize(Input input) throws IOException { log.debug("deserialize"); name = Deserializer.deserialize(input, String.class); log.trace("Name: {}", name); persistent = true; Map<String, Object> map = Deserialize...
java
@SuppressWarnings({ "unchecked", "rawtypes" }) public void deserialize(Input input) throws IOException { log.debug("deserialize"); name = Deserializer.deserialize(input, String.class); log.trace("Name: {}", name); persistent = true; Map<String, Object> map = Deserialize...
[ "@", "SuppressWarnings", "(", "{", "\"unchecked\"", ",", "\"rawtypes\"", "}", ")", "public", "void", "deserialize", "(", "Input", "input", ")", "throws", "IOException", "{", "log", ".", "debug", "(", "\"deserialize\"", ")", ";", "name", "=", "Deserializer", ...
{@inheritDoc}
[ "{" ]
39ae73710c25bda86d70b13ef37ae707962217b9
https://github.com/Red5/red5-server-common/blob/39ae73710c25bda86d70b13ef37ae707962217b9/src/main/java/org/red5/server/so/SharedObject.java#L682-L695
train
Deserializes the Taxonomy object from the given input.
Of course, here is the Java code you requested: ```java @SuppressWarnings({ "unchecked", "rawtypes" }) public void deserialize(Input input) throws IOException { log.debug("deserialize"); name = Deserializer.deserialize(input, String.class); log.trace("Name: {}", name); persiste...
kaazing/gateway
mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java
ExecutorFilter.exceptionCaught
@Override public final void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) { if (eventTypes.contains(IoEventType.EXCEPTION_CAUGHT)) { IoFilterEvent event = new IoFilterEvent(nextFilter, IoEventType.EXCEPTION_CAUGHT, session, cause); ...
java
@Override public final void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) { if (eventTypes.contains(IoEventType.EXCEPTION_CAUGHT)) { IoFilterEvent event = new IoFilterEvent(nextFilter, IoEventType.EXCEPTION_CAUGHT, session, cause); ...
[ "@", "Override", "public", "final", "void", "exceptionCaught", "(", "NextFilter", "nextFilter", ",", "IoSession", "session", ",", "Throwable", "cause", ")", "{", "if", "(", "eventTypes", ".", "contains", "(", "IoEventType", ".", "EXCEPTION_CAUGHT", ")", ")", "...
{@inheritDoc}
[ "{" ]
06017b19273109b3b992e528e702586446168d57
https://github.com/kaazing/gateway/blob/06017b19273109b3b992e528e702586446168d57/mina.core/core/src/main/java/org/apache/mina/filter/executor/ExecutorFilter.java#L649-L659
train
Method exceptionCaught.
Of course, here is the Java code you requested: ```java @Override public final void exceptionCaught(NextFilter nextFilter, IoSession session, Throwable cause) { if (eventTypes.contains(IoEventType.EXCEPTION_CAUGHT)) { IoFilterEvent event = new IoFilterEvent(nextFilter, ...
sebastiangraf/treetank
interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java
ConnectionMap.set
public void set(final T paramOrigin, final T paramDestination, final boolean paramBool) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { mMap.put(paramOrigin, new IdentityHashMap<T, Boolean>()); } mMap.get(paramOrig...
java
public void set(final T paramOrigin, final T paramDestination, final boolean paramBool) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { mMap.put(paramOrigin, new IdentityHashMap<T, Boolean>()); } mMap.get(paramOrig...
[ "public", "void", "set", "(", "final", "T", "paramOrigin", ",", "final", "T", "paramDestination", ",", "final", "boolean", "paramBool", ")", "{", "assert", "paramOrigin", "!=", "null", ";", "assert", "paramDestination", "!=", "null", ";", "if", "(", "!", "...
Sets the connection between a and b. @param paramOrigin origin object @param paramDestination destination object @param paramBool if connection is established or not
[ "Sets", "the", "connection", "between", "a", "and", "b", "." ]
9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60
https://github.com/sebastiangraf/treetank/blob/9b96d631b6c2a8502a0cc958dcb02bd6a6fd8b60/interfacemodules/xml/src/main/java/org/treetank/service/xml/diff/algorithm/fmes/ConnectionMap.java#L74-L82
train
Set the value of a single attribute.
Of course, here is the Java code you requested: ```java public void set(final T paramOrigin, final T paramDestination, final boolean paramBool) { assert paramOrigin != null; assert paramDestination != null; if (!mMap.containsKey(paramOrigin)) { mMap.put(paramOrigin, new IdentityHash...
google/j2objc
xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/res/XPATHMessages.java
XPATHMessages.createXPATHWarning
public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception { // BEGIN android-changed // don't localize exception messages return createXPATHMsg(XPATHBundle, msgKey, args); // END android-changed }
java
public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception { // BEGIN android-changed // don't localize exception messages return createXPATHMsg(XPATHBundle, msgKey, args); // END android-changed }
[ "public", "static", "final", "String", "createXPATHWarning", "(", "String", "msgKey", ",", "Object", "args", "[", "]", ")", "//throws Exception", "{", "// BEGIN android-changed", "// don't localize exception messages", "return", "createXPATHMsg", "(", "XPATHBundle", "...
Creates a message from the specified key and replacement arguments, localized to the given locale. @param msgKey The key for the message text. @param args The arguments to be used as replacement text in the message created. @return The formatted warning string.
[ "Creates", "a", "message", "from", "the", "specified", "key", "and", "replacement", "arguments", "localized", "to", "the", "given", "locale", "." ]
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/xalan/third_party/android/platform/external/apache-xml/src/main/java/org/apache/xpath/res/XPATHMessages.java#L68-L74
train
Create a warning message for an exception.
Of course, here is the Java code you requested: ```java public static final String createXPATHWarning(String msgKey, Object args[]) //throws Exception { // BEGIN android-changed // don't localize exception messages return createXPATHMsg(XPATHBundle, msgKey, args); // END android-changed ...
google/error-prone
check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java
DataFlow.findEnclosingMethodOrLambdaOrInitializer
@Nullable private static <T> TreePath findEnclosingMethodOrLambdaOrInitializer(TreePath path) { while (path != null) { if (path.getLeaf() instanceof MethodTree) { return path; } TreePath parent = path.getParentPath(); if (parent != null) { if (parent.getLeaf() instanceof Cl...
java
@Nullable private static <T> TreePath findEnclosingMethodOrLambdaOrInitializer(TreePath path) { while (path != null) { if (path.getLeaf() instanceof MethodTree) { return path; } TreePath parent = path.getParentPath(); if (parent != null) { if (parent.getLeaf() instanceof Cl...
[ "@", "Nullable", "private", "static", "<", "T", ">", "TreePath", "findEnclosingMethodOrLambdaOrInitializer", "(", "TreePath", "path", ")", "{", "while", "(", "path", "!=", "null", ")", "{", "if", "(", "path", ".", "getLeaf", "(", ")", "instanceof", "MethodTr...
TODO(user), remove once we merge jdk8 specific's with core
[ "TODO", "(", "user", ")", "remove", "once", "we", "merge", "jdk8", "specific", "s", "with", "core" ]
fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d
https://github.com/google/error-prone/blob/fe2e3cc2cf1958cb7c487bfe89852bb4c225ba9d/check_api/src/main/java/com/google/errorprone/dataflow/DataFlow.java#L125-L151
train
Find the enclosing method or lambda or initializer tree.
Of course, here is the Java code you requested: ```java @Nullable private static <T> TreePath findEnclosingMethodOrLambdaOrInitializer(TreePath path) { while (path != null) { if (path.getLeaf() instanceof MethodTree) { return path; } TreePath parent = path.getParentPath(); if (par...
azaptree/azaptree-services
azaptree-executor-service/src/main/java/com/azaptree/services/executor/ThreadPoolExecutor.java
ThreadPoolExecutor.setMaximumPoolSize
@ManagedOperation(description = "Sets the maximum allowed number of threads.") @ManagedOperationParameters({ @ManagedOperationParameter(name = "maximumPoolSize", description = "the new maximum") }) @Override public void setMaximumPoolSize(final int maximumPoolSize) { super.setMaximumPoolSize(maximumPoolSize); }
java
@ManagedOperation(description = "Sets the maximum allowed number of threads.") @ManagedOperationParameters({ @ManagedOperationParameter(name = "maximumPoolSize", description = "the new maximum") }) @Override public void setMaximumPoolSize(final int maximumPoolSize) { super.setMaximumPoolSize(maximumPoolSize); }
[ "@", "ManagedOperation", "(", "description", "=", "\"Sets the maximum allowed number of threads.\"", ")", "@", "ManagedOperationParameters", "(", "{", "@", "ManagedOperationParameter", "(", "name", "=", "\"maximumPoolSize\"", ",", "description", "=", "\"the new maximum\"", ...
/* (non-Javadoc) @see com.azaptree.services.executor.ThreadPoolExecutorJmxApi#setMaximumPoolSize(int)
[ "/", "*", "(", "non", "-", "Javadoc", ")" ]
f38bc23acf536bf4d63c007406158fdc4b0cc160
https://github.com/azaptree/azaptree-services/blob/f38bc23acf536bf4d63c007406158fdc4b0cc160/azaptree-executor-service/src/main/java/com/azaptree/services/executor/ThreadPoolExecutor.java#L311-L316
valid
Sets the maximum allowed number of threads.
Of course, here is the Java code you requested: ```java @ManagedOperation(description = "Sets the maximum allowed number of threads.") @ManagedOperationParameters({ @ManagedOperationParameter(name = "maximumPoolSize", description = "the new maximum") }) @Override public void setMaximumPoolSize(final int maximumPool...
cdk/cdk
descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/atompair/PiContactDetectionDescriptor.java
PiContactDetectionDescriptor.isANeighboorsInAnAtomContainer
private boolean isANeighboorsInAnAtomContainer(List<IAtom> neighs, IAtomContainer ac) { boolean isIn = false; int count = 0; for (IAtom neigh : neighs) { if (ac.contains(neigh)) { count += 1; } } if (count > 0) { isIn = true; ...
java
private boolean isANeighboorsInAnAtomContainer(List<IAtom> neighs, IAtomContainer ac) { boolean isIn = false; int count = 0; for (IAtom neigh : neighs) { if (ac.contains(neigh)) { count += 1; } } if (count > 0) { isIn = true; ...
[ "private", "boolean", "isANeighboorsInAnAtomContainer", "(", "List", "<", "IAtom", ">", "neighs", ",", "IAtomContainer", "ac", ")", "{", "boolean", "isIn", "=", "false", ";", "int", "count", "=", "0", ";", "for", "(", "IAtom", "neigh", ":", "neighs", ")", ...
Gets if neighbours of an atom are in an atom container. @param neighs array of atoms @param ac AtomContainer @return The boolean result
[ "Gets", "if", "neighbours", "of", "an", "atom", "are", "in", "an", "atom", "container", "." ]
c3d0f16502bf08df50365fee392e11d7c9856657
https://github.com/cdk/cdk/blob/c3d0f16502bf08df50365fee392e11d7c9856657/descriptor/qsarmolecular/src/main/java/org/openscience/cdk/qsar/descriptors/atompair/PiContactDetectionDescriptor.java#L202-L214
train
isANeighboorsInAnAtomContainer This method checks if a list of AminoAcidNeigh objects is contained in an AtomContainer.
Of course, here is the Java code you requested: ```java private boolean isANeighboorsInAnAtomContainer(List<IAtom> neighs, IAtomContainer ac) { boolean isIn = false; int count = 0; for (IAtom neigh : neighs) { if (ac.contains(neigh)) { count += 1; } ...
IBM/ibm-cos-sdk-java
ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/client/builder/AwsClientBuilder.java
AwsClientBuilder.withIAMMaxRetry
public Subclass withIAMMaxRetry(int retryCount) { this.iamMaxRetry = retryCount; if ((retryCount > 0) && (this.credentials.getCredentials() instanceof IBMOAuthCredentials) && ((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){ ...
java
public Subclass withIAMMaxRetry(int retryCount) { this.iamMaxRetry = retryCount; if ((retryCount > 0) && (this.credentials.getCredentials() instanceof IBMOAuthCredentials) && ((IBMOAuthCredentials)this.credentials.getCredentials()).getTokenManager() instanceof DefaultTokenManager){ ...
[ "public", "Subclass", "withIAMMaxRetry", "(", "int", "retryCount", ")", "{", "this", ".", "iamMaxRetry", "=", "retryCount", ";", "if", "(", "(", "retryCount", ">", "0", ")", "&&", "(", "this", ".", "credentials", ".", "getCredentials", "(", ")", "instanceo...
Sets the maximum number of attempts for retrieving/refreshing IAM token by the DefaultTokenManager. This should only be over written for a dev or staging environment @param offset, offset in seconds from token expiry time. @return This object for method chaining.
[ "Sets", "the", "maximum", "number", "of", "attempts", "for", "retrieving", "/", "refreshing", "IAM", "token", "by", "the", "DefaultTokenManager", ".", "This", "should", "only", "be", "over", "written", "for", "a", "dev", "or", "staging", "environment" ]
d0bb2dd754c328a05e7dba8dc42e28b271b6daf2
https://github.com/IBM/ibm-cos-sdk-java/blob/d0bb2dd754c328a05e7dba8dc42e28b271b6daf2/ibm-cos-java-sdk-core/src/main/java/com/ibm/cloud/objectstorage/client/builder/AwsClientBuilder.java#L197-L206
train
Sets the max retry count for the current user.
Of course, here is the Java code you requested: ```java public Subclass withIAMMaxRetry(int retryCount) { this.iamMaxRetry = retryCount; if ((retryCount > 0) && (this.credentials.getCredentials() instanceof IBMOAuthCredentials) && ((IBMOAuthCredentials)this.credentials.getCredentia...
centic9/commons-dost
src/main/java/org/dstadler/commons/zip/ZipUtils.java
ZipUtils.getZipContentsRecursive
@SuppressWarnings("resource") public static InputStream getZipContentsRecursive(final String file) throws IOException { // return local file directly int pos = file.indexOf('!'); if (pos == -1) { if (!new File(file).exists()) { throw new IOException("File " + file + " does not exist"); } try { ...
java
@SuppressWarnings("resource") public static InputStream getZipContentsRecursive(final String file) throws IOException { // return local file directly int pos = file.indexOf('!'); if (pos == -1) { if (!new File(file).exists()) { throw new IOException("File " + file + " does not exist"); } try { ...
[ "@", "SuppressWarnings", "(", "\"resource\"", ")", "public", "static", "InputStream", "getZipContentsRecursive", "(", "final", "String", "file", ")", "throws", "IOException", "{", "// return local file directly", "int", "pos", "=", "file", ".", "indexOf", "(", "'", ...
Get a stream of the noted file which potentially resides inside ZIP files. An exclamation mark '!' denotes a zip-entry. ZIP files can be nested inside one another. e.g. c:\temp\test.zip!sample.zip!my.zip!somefile.txt If there is no exclamation mark contained in the file-parameter, an input stream to this file is ret...
[ "Get", "a", "stream", "of", "the", "noted", "file", "which", "potentially", "resides", "inside", "ZIP", "files", ".", "An", "exclamation", "mark", "!", "denotes", "a", "zip", "-", "entry", ".", "ZIP", "files", "can", "be", "nested", "inside", "one", "ano...
f6fa4e3e0b943ff103f918824319d8abf33d0e0f
https://github.com/centic9/commons-dost/blob/f6fa4e3e0b943ff103f918824319d8abf33d0e0f/src/main/java/org/dstadler/commons/zip/ZipUtils.java#L151-L214
train
Gets the contents of a ZIP file recursively.
Of course, here is the Java code you requested: ```java @SuppressWarnings("resource") public static InputStream getZipContentsRecursive(final String file) throws IOException { // return local file directly int pos = file.indexOf('!'); if (pos == -1) { if (!new File(file).exists()) { throw new IOException...
opensourceBIM/BIMserver
PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java
Ifc4PackageImpl.getIfcSwitchingDevice
@Override public EClass getIfcSwitchingDevice() { if (ifcSwitchingDeviceEClass == null) { ifcSwitchingDeviceEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(689); } return ifcSwitchingDeviceEClass; }
java
@Override public EClass getIfcSwitchingDevice() { if (ifcSwitchingDeviceEClass == null) { ifcSwitchingDeviceEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(689); } return ifcSwitchingDeviceEClass; }
[ "@", "Override", "public", "EClass", "getIfcSwitchingDevice", "(", ")", "{", "if", "(", "ifcSwitchingDeviceEClass", "==", "null", ")", "{", "ifcSwitchingDeviceEClass", "=", "(", "EClass", ")", "EPackage", ".", "Registry", ".", "INSTANCE", ".", "getEPackage", "("...
<!-- begin-user-doc --> <!-- end-user-doc --> @generated
[ "<!", "--", "begin", "-", "user", "-", "doc", "--", ">", "<!", "--", "end", "-", "user", "-", "doc", "--", ">" ]
116803c3047d1b32217366757cee1bb3880fda63
https://github.com/opensourceBIM/BIMserver/blob/116803c3047d1b32217366757cee1bb3880fda63/PluginBase/generated/org/bimserver/models/ifc4/impl/Ifc4PackageImpl.java#L35146-L35153
train
Get the IfcSwitchingDeviceEClass attribute of the class.
Of course, here is the Java code you requested: ```java @Override public EClass getIfcSwitchingDevice() { if (ifcSwitchingDeviceEClass == null) { ifcSwitchingDeviceEClass = (EClass) EPackage.Registry.INSTANCE.getEPackage(Ifc4Package.eNS_URI) .getEClassifiers().get(689); } return ifcSwitchingDevice...
google/j2objc
jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Collections.java
Collections.unmodifiableList
public static <T> List<T> unmodifiableList(List<? extends T> list) { return (list instanceof RandomAccess ? new UnmodifiableRandomAccessList<>(list) : new UnmodifiableList<>(list)); }
java
public static <T> List<T> unmodifiableList(List<? extends T> list) { return (list instanceof RandomAccess ? new UnmodifiableRandomAccessList<>(list) : new UnmodifiableList<>(list)); }
[ "public", "static", "<", "T", ">", "List", "<", "T", ">", "unmodifiableList", "(", "List", "<", "?", "extends", "T", ">", "list", ")", "{", "return", "(", "list", "instanceof", "RandomAccess", "?", "new", "UnmodifiableRandomAccessList", "<>", "(", "list", ...
Returns an unmodifiable view of the specified list. This method allows modules to provide users with "read-only" access to internal lists. Query operations on the returned list "read through" to the specified list, and attempts to modify the returned list, whether direct or via its iterator, result in an <tt>Unsuppor...
[ "Returns", "an", "unmodifiable", "view", "of", "the", "specified", "list", ".", "This", "method", "allows", "modules", "to", "provide", "users", "with", "read", "-", "only", "access", "to", "internal", "lists", ".", "Query", "operations", "on", "the", "retur...
471504a735b48d5d4ace51afa1542cc4790a921a
https://github.com/google/j2objc/blob/471504a735b48d5d4ace51afa1542cc4790a921a/jre_emul/android/platform/libcore/ojluni/src/main/java/java/util/Collections.java#L1318-L1322
train
Returns an unmodifiable list of the specified list.
Of course, here is the Java code you requested: ```java public static <T> List<T> unmodifiableList(List<? extends T> list) { return (list instanceof RandomAccess ? new UnmodifiableRandomAccessList<>(list) : new UnmodifiableList<>(list)); } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/LoadBalancer.java
LoadBalancer.setTlsCertificateSummaries
public void setTlsCertificateSummaries(java.util.Collection<LoadBalancerTlsCertificateSummary> tlsCertificateSummaries) { if (tlsCertificateSummaries == null) { this.tlsCertificateSummaries = null; return; } this.tlsCertificateSummaries = new java.util.ArrayList<LoadBala...
java
public void setTlsCertificateSummaries(java.util.Collection<LoadBalancerTlsCertificateSummary> tlsCertificateSummaries) { if (tlsCertificateSummaries == null) { this.tlsCertificateSummaries = null; return; } this.tlsCertificateSummaries = new java.util.ArrayList<LoadBala...
[ "public", "void", "setTlsCertificateSummaries", "(", "java", ".", "util", ".", "Collection", "<", "LoadBalancerTlsCertificateSummary", ">", "tlsCertificateSummaries", ")", "{", "if", "(", "tlsCertificateSummaries", "==", "null", ")", "{", "this", ".", "tlsCertificateS...
<p> An array of LoadBalancerTlsCertificateSummary objects that provide additional information about the SSL/TLS certificates. For example, if <code>true</code>, the certificate is attached to the load balancer. </p> @param tlsCertificateSummaries An array of LoadBalancerTlsCertificateSummary objects that provide addit...
[ "<p", ">", "An", "array", "of", "LoadBalancerTlsCertificateSummary", "objects", "that", "provide", "additional", "information", "about", "the", "SSL", "/", "TLS", "certificates", ".", "For", "example", "if", "<code", ">", "true<", "/", "code", ">", "the", "cer...
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-lightsail/src/main/java/com/amazonaws/services/lightsail/model/LoadBalancer.java#L926-L933
train
Sets the value of the tlsCertificateSummaries property.
Of course, here is the Java code you requested: ```java public void setTlsCertificateSummaries(java.util.Collection<LoadBalancerTlsCertificateSummary> tlsCertificateSummaries) { if (tlsCertificateSummaries == null) { this.tlsCertificateSummaries = null; return; } this.t...
jamesagnew/hapi-fhir
hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HumanName.java
HumanName.addPrefixElement
public StringType addPrefixElement() {//2 StringType t = new StringType(); if (this.prefix == null) this.prefix = new ArrayList<StringType>(); this.prefix.add(t); return t; }
java
public StringType addPrefixElement() {//2 StringType t = new StringType(); if (this.prefix == null) this.prefix = new ArrayList<StringType>(); this.prefix.add(t); return t; }
[ "public", "StringType", "addPrefixElement", "(", ")", "{", "//2 \r", "StringType", "t", "=", "new", "StringType", "(", ")", ";", "if", "(", "this", ".", "prefix", "==", "null", ")", "this", ".", "prefix", "=", "new", "ArrayList", "<", "StringType", ">", ...
syntactic sugar
[ "syntactic", "sugar" ]
150a84d52fe691b7f48fcb28247c4bddb7aec352
https://github.com/jamesagnew/hapi-fhir/blob/150a84d52fe691b7f48fcb28247c4bddb7aec352/hapi-fhir-structures-hl7org-dstu2/src/main/java/org/hl7/fhir/instance/model/HumanName.java#L497-L503
train
Add this element to the prefix list.
Of course, here is the Java code you requested: ```java public StringType addPrefixElement() {//2 StringType t = new StringType(); if (this.prefix == null) this.prefix = new ArrayList<StringType>(); this.prefix.add(t); return t; } ``` Hope this helps!
aws/aws-sdk-java
aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/CancelCapacityReservationRequest.java
CancelCapacityReservationRequest.getDryRunRequest
@Override public Request<CancelCapacityReservationRequest> getDryRunRequest() { Request<CancelCapacityReservationRequest> request = new CancelCapacityReservationRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
java
@Override public Request<CancelCapacityReservationRequest> getDryRunRequest() { Request<CancelCapacityReservationRequest> request = new CancelCapacityReservationRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toString(true)); return request; }
[ "@", "Override", "public", "Request", "<", "CancelCapacityReservationRequest", ">", "getDryRunRequest", "(", ")", "{", "Request", "<", "CancelCapacityReservationRequest", ">", "request", "=", "new", "CancelCapacityReservationRequestMarshaller", "(", ")", ".", "marshall", ...
This method is intended for internal use only. Returns the marshaled request configured with additional parameters to enable operation dry-run.
[ "This", "method", "is", "intended", "for", "internal", "use", "only", ".", "Returns", "the", "marshaled", "request", "configured", "with", "additional", "parameters", "to", "enable", "operation", "dry", "-", "run", "." ]
aa38502458969b2d13a1c3665a56aba600e4dbd0
https://github.com/aws/aws-sdk-java/blob/aa38502458969b2d13a1c3665a56aba600e4dbd0/aws-java-sdk-ec2/src/main/java/com/amazonaws/services/ec2/model/CancelCapacityReservationRequest.java#L80-L85
train
Returns a request configured to cancel the reservation of a resource in the Service.
Of course, here is the Java code you requested: ```java @Override public Request<CancelCapacityReservationRequest> getDryRunRequest() { Request<CancelCapacityReservationRequest> request = new CancelCapacityReservationRequestMarshaller().marshall(this); request.addParameter("DryRun", Boolean.toStrin...
jbundle/jbundle
base/base/src/main/java/org/jbundle/base/field/convert/FirstMLastConverter.java
FirstMLastConverter.setString
public int setString(String strSource, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iErrorReturn = FirstMLastConverter.nameToParts(strSource, bDisplayOption, iMoveMode, m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix,...
java
public int setString(String strSource, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iErrorReturn = FirstMLastConverter.nameToParts(strSource, bDisplayOption, iMoveMode, m_recThis, m_iNamePrefix, m_iNameFirst, m_iNameMiddle, m_iNameSur, m_iNameSuffix,...
[ "public", "int", "setString", "(", "String", "strSource", ",", "boolean", "bDisplayOption", ",", "int", "iMoveMode", ")", "// init this field override for other value", "{", "int", "iErrorReturn", "=", "FirstMLastConverter", ".", "nameToParts", "(", "strSource", ",", ...
Convert and move string to this field. Split the part of this string into the target fields. Override this method to convert the String to the actual Physical Data Type. @param bState the state to set the data to. @param bDisplayOption Display the data on the screen if true. @param iMoveMode INIT, SCREEN, or READ move ...
[ "Convert", "and", "move", "string", "to", "this", "field", ".", "Split", "the", "part", "of", "this", "string", "into", "the", "target", "fields", ".", "Override", "this", "method", "to", "convert", "the", "String", "to", "the", "actual", "Physical", "Data...
4037fcfa85f60c7d0096c453c1a3cd573c2b0abc
https://github.com/jbundle/jbundle/blob/4037fcfa85f60c7d0096c453c1a3cd573c2b0abc/base/base/src/main/java/org/jbundle/base/field/convert/FirstMLastConverter.java#L270-L277
train
Convert this string to this field.
Of course, here is the Java code you requested: ```java public int setString(String strSource, boolean bDisplayOption, int iMoveMode) // init this field override for other value { int iErrorReturn = FirstMLastConverter.nameToParts(strSource, bDisplayOption, iMoveMode, m_recThis, m_iNamePrefix...
OWASP/java-html-sanitizer
src/main/java/org/owasp/html/HtmlPolicyBuilder.java
HtmlPolicyBuilder.allowElements
public HtmlPolicyBuilder allowElements( ElementPolicy policy, String... elementNames) { invalidateCompiledState(); for (String elementName : elementNames) { elementName = HtmlLexer.canonicalName(elementName); ElementPolicy newPolicy = ElementPolicy.Util.join( elPolicies.get(elementNa...
java
public HtmlPolicyBuilder allowElements( ElementPolicy policy, String... elementNames) { invalidateCompiledState(); for (String elementName : elementNames) { elementName = HtmlLexer.canonicalName(elementName); ElementPolicy newPolicy = ElementPolicy.Util.join( elPolicies.get(elementNa...
[ "public", "HtmlPolicyBuilder", "allowElements", "(", "ElementPolicy", "policy", ",", "String", "...", "elementNames", ")", "{", "invalidateCompiledState", "(", ")", ";", "for", "(", "String", "elementName", ":", "elementNames", ")", "{", "elementName", "=", "HtmlL...
Allow the given elements with the given policy. @param policy May remove or add attributes, change the element name, or deny the element.
[ "Allow", "the", "given", "elements", "with", "the", "given", "policy", "." ]
a30315fe9a41e19c449628e7ef3488b3a7856009
https://github.com/OWASP/java-html-sanitizer/blob/a30315fe9a41e19c449628e7ef3488b3a7856009/src/main/java/org/owasp/html/HtmlPolicyBuilder.java#L229-L247
train
Allow the specified elements.
Of course, here is the Java code you requested: ```java public HtmlPolicyBuilder allowElements( ElementPolicy policy, String... elementNames) { invalidateCompiledState(); for (String elementName : elementNames) { elementName = HtmlLexer.canonicalName(elementName); ElementPolicy newPolicy = El...
imsweb/naaccr-xml
src/main/java/com/imsweb/naaccrxml/entity/AbstractEntity.java
AbstractEntity.getItemValue
public String getItemValue(String id) { Item item = getItem(id); if (item != null) return item.getValue(); return null; }
java
public String getItemValue(String id) { Item item = getItem(id); if (item != null) return item.getValue(); return null; }
[ "public", "String", "getItemValue", "(", "String", "id", ")", "{", "Item", "item", "=", "getItem", "(", "id", ")", ";", "if", "(", "item", "!=", "null", ")", "return", "item", ".", "getValue", "(", ")", ";", "return", "null", ";", "}" ]
Returns the value of the item with the requested ID. @param id requested item ID @return the value of the corresponding item, sometimes null
[ "Returns", "the", "value", "of", "the", "item", "with", "the", "requested", "ID", "." ]
a3a501faa2a0c3411dd5248b2c1379f279131696
https://github.com/imsweb/naaccr-xml/blob/a3a501faa2a0c3411dd5248b2c1379f279131696/src/main/java/com/imsweb/naaccrxml/entity/AbstractEntity.java#L94-L99
train
Gets the value of a single item.
Of course, here is the Java code you requested: ```java public String getItemValue(String id) { Item item = getItem(id); if (item != null) return item.getValue(); return null; } ``` Hope this helps!
xcesco/kripton
kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java
BindTypeBuilder.generateParseOnXmlAttributes
private static void generateParseOnXmlAttributes(BindTypeContext context, MethodSpec.Builder methodBuilder, BindEntity entity) { BindTransform bindTransform; int count = 0; // count property to manage { // for each elements for (BindProperty property : entity.getCollection()) { if (property.xmlInf...
java
private static void generateParseOnXmlAttributes(BindTypeContext context, MethodSpec.Builder methodBuilder, BindEntity entity) { BindTransform bindTransform; int count = 0; // count property to manage { // for each elements for (BindProperty property : entity.getCollection()) { if (property.xmlInf...
[ "private", "static", "void", "generateParseOnXmlAttributes", "(", "BindTypeContext", "context", ",", "MethodSpec", ".", "Builder", "methodBuilder", ",", "BindEntity", "entity", ")", "{", "BindTransform", "bindTransform", ";", "int", "count", "=", "0", ";", "// count...
Generate parse on xml attributes. @param context the context @param methodBuilder the method builder @param entity the entity
[ "Generate", "parse", "on", "xml", "attributes", "." ]
90de2c0523d39b99e81b8d38aa996898762f594a
https://github.com/xcesco/kripton/blob/90de2c0523d39b99e81b8d38aa996898762f594a/kripton-processor/src/main/java/com/abubusoft/kripton/processor/bind/BindTypeBuilder.java#L364-L419
train
Generate parse on xml attributes.
Of course, here is the Java code you requested: ```java private static void generateParseOnXmlAttributes(BindTypeContext context, MethodSpec.Builder methodBuilder, BindEntity entity) { BindTransform bindTransform; int count = 0; // count property to manage { // for each elements for (BindProperty pro...
looly/hutool
hutool-db/src/main/java/cn/hutool/db/AbstractDb.java
AbstractDb.insertOrUpdate
public int insertOrUpdate(Entity record, String... keys) throws SQLException { Connection conn = null; try { conn = this.getConnection(); return runner.insertOrUpdate(conn, record, keys); } catch (SQLException e) { throw e; } finally { this.closeConnection(conn); } }
java
public int insertOrUpdate(Entity record, String... keys) throws SQLException { Connection conn = null; try { conn = this.getConnection(); return runner.insertOrUpdate(conn, record, keys); } catch (SQLException e) { throw e; } finally { this.closeConnection(conn); } }
[ "public", "int", "insertOrUpdate", "(", "Entity", "record", ",", "String", "...", "keys", ")", "throws", "SQLException", "{", "Connection", "conn", "=", "null", ";", "try", "{", "conn", "=", "this", ".", "getConnection", "(", ")", ";", "return", "runner", ...
插入或更新数据<br> 根据给定的字段名查询数据,如果存在则更新这些数据,否则执行插入 @param record 记录 @param keys 需要检查唯一性的字段 @return 插入行数 @throws SQLException SQL执行异常 @since 4.0.10
[ "插入或更新数据<br", ">", "根据给定的字段名查询数据,如果存在则更新这些数据,否则执行插入" ]
bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a
https://github.com/looly/hutool/blob/bbd74eda4c7e8a81fe7a991fa6c2276eec062e6a/hutool-db/src/main/java/cn/hutool/db/AbstractDb.java#L268-L278
train
Inserts or updates an entity in the database or updates the existing record in the database.
Of course, here is the Java code you requested: ```java public int insertOrUpdate(Entity record, String... keys) throws SQLException { Connection conn = null; try { conn = this.getConnection(); return runner.insertOrUpdate(conn, record, keys); } catch (SQLException e) { throw e; } finally { ...
spring-projects/spring-boot
spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java
SpringApplicationAdminClient.stop
public void stop() throws MojoExecutionException, IOException, InstanceNotFoundException { try { this.connection.invoke(this.objectName, "shutdown", null, null); } catch (ReflectionException ex) { throw new MojoExecutionException("Shutdown failed", ex.getCause()); } catch (MBeanException ex) { thr...
java
public void stop() throws MojoExecutionException, IOException, InstanceNotFoundException { try { this.connection.invoke(this.objectName, "shutdown", null, null); } catch (ReflectionException ex) { throw new MojoExecutionException("Shutdown failed", ex.getCause()); } catch (MBeanException ex) { thr...
[ "public", "void", "stop", "(", ")", "throws", "MojoExecutionException", ",", "IOException", ",", "InstanceNotFoundException", "{", "try", "{", "this", ".", "connection", ".", "invoke", "(", "this", ".", "objectName", ",", "\"shutdown\"", ",", "null", ",", "nul...
Stop the application managed by this instance. @throws MojoExecutionException if the JMX service could not be contacted @throws IOException if an I/O error occurs @throws InstanceNotFoundException if the lifecycle mbean cannot be found
[ "Stop", "the", "application", "managed", "by", "this", "instance", "." ]
0b27f7c70e164b2b1a96477f1d9c1acba56790c1
https://github.com/spring-projects/spring-boot/blob/0b27f7c70e164b2b1a96477f1d9c1acba56790c1/spring-boot-project/spring-boot-tools/spring-boot-maven-plugin/src/main/java/org/springframework/boot/maven/SpringApplicationAdminClient.java#L87-L98
train
Stop the managed object.
Of course, here is the Java code you requested: ```java public void stop() throws MojoExecutionException, IOException, InstanceNotFoundException { try { this.connection.invoke(this.objectName, "shutdown", null, null); } catch (ReflectionException ex) { throw new MojoExecutionException("Shutdown failed",...
apache/flink
flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java
FutureUtils.thenApplyAsyncIfNotDone
public static <IN, OUT> CompletableFuture<OUT> thenApplyAsyncIfNotDone( CompletableFuture<IN> completableFuture, Executor executor, Function<? super IN, ? extends OUT> applyFun) { return completableFuture.isDone() ? completableFuture.thenApply(applyFun) : completableFuture.thenApplyAsync(applyFun, executo...
java
public static <IN, OUT> CompletableFuture<OUT> thenApplyAsyncIfNotDone( CompletableFuture<IN> completableFuture, Executor executor, Function<? super IN, ? extends OUT> applyFun) { return completableFuture.isDone() ? completableFuture.thenApply(applyFun) : completableFuture.thenApplyAsync(applyFun, executo...
[ "public", "static", "<", "IN", ",", "OUT", ">", "CompletableFuture", "<", "OUT", ">", "thenApplyAsyncIfNotDone", "(", "CompletableFuture", "<", "IN", ">", "completableFuture", ",", "Executor", "executor", ",", "Function", "<", "?", "super", "IN", ",", "?", "...
This function takes a {@link CompletableFuture} and a function to apply to this future. If the input future is already done, this function returns {@link CompletableFuture#thenApply(Function)}. Otherwise, the return value is {@link CompletableFuture#thenApplyAsync(Function, Executor)} with the given executor. @param c...
[ "This", "function", "takes", "a", "{", "@link", "CompletableFuture", "}", "and", "a", "function", "to", "apply", "to", "this", "future", ".", "If", "the", "input", "future", "is", "already", "done", "this", "function", "returns", "{", "@link", "CompletableFu...
b62db93bf63cb3bb34dd03d611a779d9e3fc61ac
https://github.com/apache/flink/blob/b62db93bf63cb3bb34dd03d611a779d9e3fc61ac/flink-runtime/src/main/java/org/apache/flink/runtime/concurrent/FutureUtils.java#L837-L844
train
Apply a function to a CompletableFuture if the CompletableFuture is done otherwise apply the function to the CompletableFuture.
Of course, here is the Java code you requested: ```java public static <IN, OUT> CompletableFuture<OUT> thenApplyAsyncIfNotDone( CompletableFuture<IN> completableFuture, Executor executor, Function<? super IN, ? extends OUT> applyFun) { return completableFuture.isDone() ? completableFuture.thenApply(applyFun...
beanshell/beanshell
src/main/java/bsh/org/objectweb/asm/TypeReference.java
TypeReference.putTarget
static void putTarget(final int targetTypeAndInfo, final ByteVector output) { switch (targetTypeAndInfo >>> 24) { case CLASS_TYPE_PARAMETER: case METHOD_TYPE_PARAMETER: case METHOD_FORMAL_PARAMETER: output.putShort(targetTypeAndInfo >>> 16); break; case FIELD: case METH...
java
static void putTarget(final int targetTypeAndInfo, final ByteVector output) { switch (targetTypeAndInfo >>> 24) { case CLASS_TYPE_PARAMETER: case METHOD_TYPE_PARAMETER: case METHOD_FORMAL_PARAMETER: output.putShort(targetTypeAndInfo >>> 16); break; case FIELD: case METH...
[ "static", "void", "putTarget", "(", "final", "int", "targetTypeAndInfo", ",", "final", "ByteVector", "output", ")", "{", "switch", "(", "targetTypeAndInfo", ">>>", "24", ")", "{", "case", "CLASS_TYPE_PARAMETER", ":", "case", "METHOD_TYPE_PARAMETER", ":", "case", ...
Puts the given target_type and target_info JVMS structures into the given ByteVector. @param targetTypeAndInfo a target_type and a target_info structures encoded as in {@link #targetTypeAndInfo}. LOCAL_VARIABLE and RESOURCE_VARIABLE target types are not supported. @param output where the type reference must be put.
[ "Puts", "the", "given", "target_type", "and", "target_info", "JVMS", "structures", "into", "the", "given", "ByteVector", "." ]
fdddee3de948c9e6babb2d1337028f6fd0a2ba5c
https://github.com/beanshell/beanshell/blob/fdddee3de948c9e6babb2d1337028f6fd0a2ba5c/src/main/java/bsh/org/objectweb/asm/TypeReference.java#L402-L435
train
Put target into the byte vector.
Of course, here is the Java code you requested: ```java static void putTarget(final int targetTypeAndInfo, final ByteVector output) { switch (targetTypeAndInfo >>> 24) { case CLASS_TYPE_PARAMETER: case METHOD_TYPE_PARAMETER: case METHOD_FORMAL_PARAMETER: output.putShort(targetTypeAndInfo ...
OpenLiberty/open-liberty
dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ClientSideConnection.java
ClientSideConnection.connect
public void connect(ConnectionProperties cp, ClientComponentHandshake cch) throws SIResourceException, SIAuthenticationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "connect", new Object[] {cp, cch}); ClientConnectionManager conMan = null; ...
java
public void connect(ConnectionProperties cp, ClientComponentHandshake cch) throws SIResourceException, SIAuthenticationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "connect", new Object[] {cp, cch}); ClientConnectionManager conMan = null; ...
[ "public", "void", "connect", "(", "ConnectionProperties", "cp", ",", "ClientComponentHandshake", "cch", ")", "throws", "SIResourceException", ",", "SIAuthenticationException", "{", "if", "(", "TraceComponent", ".", "isAnyTracingEnabled", "(", ")", "&&", "tc", ".", "...
Attempts to establish a client connection with the remote ME identified by the connection properties argument. Comms allocates communications resources to the connection and if successful, invoke the client component handshake implementation passed as an argument. <p> Normally, the caller will be notified of a failure...
[ "Attempts", "to", "establish", "a", "client", "connection", "with", "the", "remote", "ME", "identified", "by", "the", "connection", "properties", "argument", ".", "Comms", "allocates", "communications", "resources", "to", "the", "connection", "and", "if", "success...
ca725d9903e63645018f9fa8cbda25f60af83a5d
https://github.com/OpenLiberty/open-liberty/blob/ca725d9903e63645018f9fa8cbda25f60af83a5d/dev/com.ibm.ws.messaging.comms.client/src/com/ibm/ws/sib/comms/client/ClientSideConnection.java#L101-L328
train
This method is called by the client side connection code to establish a connection to a server.
Of course, here is the Java code you requested: ```java public void connect(ConnectionProperties cp, ClientComponentHandshake cch) throws SIResourceException, SIAuthenticationException { if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) SibTr.entry(this, tc, "connect", new Object[] {cp, c...
facebookarchive/hadoop-20
src/core/org/apache/hadoop/net/NetUtils.java
NetUtils.getOutputStream
public static OutputStream getOutputStream(Socket socket, long timeout) throws IOException { return (socket.getChannel() == null) ? socket.getOutputStream() : new SocketOutputStream(socket, timeout); }
java
public static OutputStream getOutputStream(Socket socket, long timeout) throws IOException { return (socket.getChannel() == null) ? socket.getOutputStream() : new SocketOutputStream(socket, timeout); }
[ "public", "static", "OutputStream", "getOutputStream", "(", "Socket", "socket", ",", "long", "timeout", ")", "throws", "IOException", "{", "return", "(", "socket", ".", "getChannel", "(", ")", "==", "null", ")", "?", "socket", ".", "getOutputStream", "(", ")...
Returns OutputStream for the socket. If the socket has an associated SocketChannel then it returns a {@link SocketOutputStream} with the given timeout. If the socket does not have a channel, {@link Socket#getOutputStream()} is returned. In the later case, the timeout argument is ignored and the write will wait until da...
[ "Returns", "OutputStream", "for", "the", "socket", ".", "If", "the", "socket", "has", "an", "associated", "SocketChannel", "then", "it", "returns", "a", "{", "@link", "SocketOutputStream", "}", "with", "the", "given", "timeout", ".", "If", "the", "socket", "...
2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4
https://github.com/facebookarchive/hadoop-20/blob/2a29bc6ecf30edb1ad8dbde32aa49a317b4d44f4/src/core/org/apache/hadoop/net/NetUtils.java#L390-L394
train
Get an output stream for the given socket.
Of course, here is the Java code you requested: ```java public static OutputStream getOutputStream(Socket socket, long timeout) throws IOException { return (socket.getChannel() == null) ? socket.getOutputStream() : new SocketOutputStream(socket, timeout); } ``` Hope this helps!
project-ncl/pnc
model/src/main/java/org/jboss/pnc/model/User.java
User.removeBuildRecord
public BuildRecord removeBuildRecord(BuildRecord buildRecord) { getBuildRecords().remove(buildRecord); buildRecord.setUser(null); return buildRecord; }
java
public BuildRecord removeBuildRecord(BuildRecord buildRecord) { getBuildRecords().remove(buildRecord); buildRecord.setUser(null); return buildRecord; }
[ "public", "BuildRecord", "removeBuildRecord", "(", "BuildRecord", "buildRecord", ")", "{", "getBuildRecords", "(", ")", ".", "remove", "(", "buildRecord", ")", ";", "buildRecord", ".", "setUser", "(", "null", ")", ";", "return", "buildRecord", ";", "}" ]
Removes the project build record. @param buildRecord the project build record @return the project build record
[ "Removes", "the", "project", "build", "record", "." ]
85743ca59d14cdf750d6daa8bd0a0a8be390a796
https://github.com/project-ncl/pnc/blob/85743ca59d14cdf750d6daa8bd0a0a8be390a796/model/src/main/java/org/jboss/pnc/model/User.java#L220-L224
valid
Removes a build record from the build record list.
Of course, here is the Java code you requested: ```java public BuildRecord removeBuildRecord(BuildRecord buildRecord) { getBuildRecords().remove(buildRecord); buildRecord.setUser(null); return buildRecord; } ``` Hope this helps!
alexvasilkov/GestureViews
library/src/main/java/com/alexvasilkov/gestures/animation/ViewPositionAnimator.java
ViewPositionAnimator.enter
public void enter(@NonNull View from, boolean withAnimation) { if (GestureDebug.isDebugAnimator()) { Log.d(TAG, "Entering from view, with animation = " + withAnimation); } enterInternal(withAnimation); updateInternal(from); }
java
public void enter(@NonNull View from, boolean withAnimation) { if (GestureDebug.isDebugAnimator()) { Log.d(TAG, "Entering from view, with animation = " + withAnimation); } enterInternal(withAnimation); updateInternal(from); }
[ "public", "void", "enter", "(", "@", "NonNull", "View", "from", ",", "boolean", "withAnimation", ")", "{", "if", "(", "GestureDebug", ".", "isDebugAnimator", "(", ")", ")", "{", "Log", ".", "d", "(", "TAG", ",", "\"Entering from view, with animation = \"", "...
Starts 'enter' animation from {@code from} view to {@code to}. <p> Note, if {@code from} view was changed (i.e. during list adapter refresh) you should update to new view using {@link #update(View)} method. @param from 'From' view @param withAnimation Whether to animate entering or immediately jump to entered state
[ "Starts", "enter", "animation", "from", "{", "@code", "from", "}", "view", "to", "{", "@code", "to", "}", ".", "<p", ">", "Note", "if", "{", "@code", "from", "}", "view", "was", "changed", "(", "i", ".", "e", ".", "during", "list", "adapter", "refr...
f0a4c266e31dcad23bd0d9013531bc1c501b9c9f
https://github.com/alexvasilkov/GestureViews/blob/f0a4c266e31dcad23bd0d9013531bc1c501b9c9f/library/src/main/java/com/alexvasilkov/gestures/animation/ViewPositionAnimator.java#L199-L206
train
Enter a view.
Of course, here is the Java code you requested: ```java public void enter(@NonNull View from, boolean withAnimation) { if (GestureDebug.isDebugAnimator()) { Log.d(TAG, "Entering from view, with animation = " + withAnimation); } enterInternal(withAnimation); updateInternal(f...
radkovo/jStyleParser
src/main/java/cz/vutbr/web/csskit/CombinedSelectorImpl.java
CombinedSelectorImpl.computeSpecificity
public Specificity computeSpecificity() { Specificity spec = new SpecificityImpl(); for(Selector s: list) s.computeSpecificity(spec); return spec; }
java
public Specificity computeSpecificity() { Specificity spec = new SpecificityImpl(); for(Selector s: list) s.computeSpecificity(spec); return spec; }
[ "public", "Specificity", "computeSpecificity", "(", ")", "{", "Specificity", "spec", "=", "new", "SpecificityImpl", "(", ")", ";", "for", "(", "Selector", "s", ":", "list", ")", "s", ".", "computeSpecificity", "(", "spec", ")", ";", "return", "spec", ";", ...
Computes specificity of selector
[ "Computes", "specificity", "of", "selector" ]
8ab049ac6866aa52c4d7deee25c9e294e7191957
https://github.com/radkovo/jStyleParser/blob/8ab049ac6866aa52c4d7deee25c9e294e7191957/src/main/java/cz/vutbr/web/csskit/CombinedSelectorImpl.java#L34-L43
train
Compute specificity.
Of course, here is the Java code you requested: ```java public Specificity computeSpecificity() { Specificity spec = new SpecificityImpl(); for(Selector s: list) s.computeSpecificity(spec); return spec; } ``` Hope this helps!
briandilley/jsonrpc4j
src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java
JsonRpcHttpAsyncClient.addHeaders
private void addHeaders(HttpRequest request, Map<String, String> headers) { for (Map.Entry<String, String> key : headers.entrySet()) { request.addHeader(key.getKey(), key.getValue()); } }
java
private void addHeaders(HttpRequest request, Map<String, String> headers) { for (Map.Entry<String, String> key : headers.entrySet()) { request.addHeader(key.getKey(), key.getValue()); } }
[ "private", "void", "addHeaders", "(", "HttpRequest", "request", ",", "Map", "<", "String", ",", "String", ">", "headers", ")", "{", "for", "(", "Map", ".", "Entry", "<", "String", ",", "String", ">", "key", ":", "headers", ".", "entrySet", "(", ")", ...
Set the request headers. @param request the request object @param headers to be used
[ "Set", "the", "request", "headers", "." ]
d749762c9295b92d893677a8c7be2a14dd43b3bb
https://github.com/briandilley/jsonrpc4j/blob/d749762c9295b92d893677a8c7be2a14dd43b3bb/src/main/java/com/googlecode/jsonrpc4j/JsonRpcHttpAsyncClient.java#L261-L265
train
Add headers to the request
Of course, here is the Java code you requested: ```java private void addHeaders(HttpRequest request, Map<String, String> headers) { for (Map.Entry<String, String> key : headers.entrySet()) { request.addHeader(key.getKey(), key.getValue()); } } ``` Hope this helps!
albfernandez/itext2
src/main/java/com/lowagie/text/pdf/AcroFields.java
AcroFields.signatureCoversWholeDocument
public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; return ((int[])sigNames.get(name))[0] == reader.getFileLength(); }
java
public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; return ((int[])sigNames.get(name))[0] == reader.getFileLength(); }
[ "public", "boolean", "signatureCoversWholeDocument", "(", "String", "name", ")", "{", "getSignatureNames", "(", ")", ";", "name", "=", "getTranslatedFieldName", "(", "name", ")", ";", "if", "(", "!", "sigNames", ".", "containsKey", "(", "name", ")", ")", "re...
Checks is the signature covers the entire document or just part of it. @param name the signature field name @return <CODE>true</CODE> if the signature covers the entire document, <CODE>false</CODE> otherwise
[ "Checks", "is", "the", "signature", "covers", "the", "entire", "document", "or", "just", "part", "of", "it", "." ]
438fc1899367fd13dfdfa8dfdca9a3c1a7783b84
https://github.com/albfernandez/itext2/blob/438fc1899367fd13dfdfa8dfdca9a3c1a7783b84/src/main/java/com/lowagie/text/pdf/AcroFields.java#L2108-L2114
train
Check if the signature contains a single document.
Of course, here is the Java code you requested: ```java public boolean signatureCoversWholeDocument(String name) { getSignatureNames(); name = getTranslatedFieldName(name); if (!sigNames.containsKey(name)) return false; return ((int[])sigNames.get(name))[0] == reader.getFile...
Azure/azure-sdk-for-java
cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java
ComputerVisionImpl.recognizeTextAsync
public Observable<Void> recognizeTextAsync(String url, TextRecognitionMode mode) { return recognizeTextWithServiceResponseAsync(url, mode).map(new Func1<ServiceResponseWithHeaders<Void, RecognizeTextHeaders>, Void>() { @Override public Void call(ServiceResponseWithHeaders<Void, Recognize...
java
public Observable<Void> recognizeTextAsync(String url, TextRecognitionMode mode) { return recognizeTextWithServiceResponseAsync(url, mode).map(new Func1<ServiceResponseWithHeaders<Void, RecognizeTextHeaders>, Void>() { @Override public Void call(ServiceResponseWithHeaders<Void, Recognize...
[ "public", "Observable", "<", "Void", ">", "recognizeTextAsync", "(", "String", "url", ",", "TextRecognitionMode", "mode", ")", "{", "return", "recognizeTextWithServiceResponseAsync", "(", "url", ",", "mode", ")", ".", "map", "(", "new", "Func1", "<", "ServiceRes...
Recognize Text operation. When you use the Recognize Text interface, the response contains a field called 'Operation-Location'. The 'Operation-Location' field contains the URL that you must use for your Get Recognize Text Operation Result operation. @param mode Type of text to recognize. Possible values include: 'Hand...
[ "Recognize", "Text", "operation", ".", "When", "you", "use", "the", "Recognize", "Text", "interface", "the", "response", "contains", "a", "field", "called", "Operation", "-", "Location", ".", "The", "Operation", "-", "Location", "field", "contains", "the", "UR...
aab183ddc6686c82ec10386d5a683d2691039626
https://github.com/Azure/azure-sdk-for-java/blob/aab183ddc6686c82ec10386d5a683d2691039626/cognitiveservices/data-plane/vision/computervision/src/main/java/com/microsoft/azure/cognitiveservices/vision/computervision/implementation/ComputerVisionImpl.java#L1351-L1358
train
Recognize text from the specified URL.
Of course, here is the Java code you requested: ```java public Observable<Void> recognizeTextAsync(String url, TextRecognitionMode mode) { return recognizeTextWithServiceResponseAsync(url, mode).map(new Func1<ServiceResponseWithHeaders<Void, RecognizeTextHeaders>, Void>() { @Override pu...
simlife/simlife
simlife-framework/src/main/java/io/github/simlife/service/QueryService.java
QueryService.buildSpecification
protected <X> Specification<ENTITY> buildSpecification(Filter<X> filter, SingularAttribute<? super ENTITY, X> field) { if (filter.getEquals() != null) { return equalsSpecification(field, filter.getEquals()); } else if (filter.getIn() != null) { return valueIn(field, filte...
java
protected <X> Specification<ENTITY> buildSpecification(Filter<X> filter, SingularAttribute<? super ENTITY, X> field) { if (filter.getEquals() != null) { return equalsSpecification(field, filter.getEquals()); } else if (filter.getIn() != null) { return valueIn(field, filte...
[ "protected", "<", "X", ">", "Specification", "<", "ENTITY", ">", "buildSpecification", "(", "Filter", "<", "X", ">", "filter", ",", "SingularAttribute", "<", "?", "super", "ENTITY", ",", "X", ">", "field", ")", "{", "if", "(", "filter", ".", "getEquals",...
Helper function to return a specification for filtering on a single field, where equality, and null/non-null conditions are supported. @param filter the individual attribute filter coming from the frontend. @param field the JPA static metamodel representing the field. @param <X> The type of the attribute which is ...
[ "Helper", "function", "to", "return", "a", "specification", "for", "filtering", "on", "a", "single", "field", "where", "equality", "and", "null", "/", "non", "-", "null", "conditions", "are", "supported", "." ]
357bb8f3fb39e085239b89bc7f9a19248ff3d0bb
https://github.com/simlife/simlife/blob/357bb8f3fb39e085239b89bc7f9a19248ff3d0bb/simlife-framework/src/main/java/io/github/simlife/service/QueryService.java#L51-L61
train
Build a Specification from a filter.
Of course, here is the Java code you requested: ```java protected <X> Specification<ENTITY> buildSpecification(Filter<X> filter, SingularAttribute<? super ENTITY, X> field) { if (filter.getEquals() != null) { return equalsSpecification(field, filter.getEquals()); } else if (filter.g...
bazaarvoice/rison
src/main/java/com/bazaarvoice/jackson/rison/RisonGenerator.java
RisonGenerator._appendCharacterEscape
private void _appendCharacterEscape(char esc, char ch) throws IOException, JsonGenerationException { if ((_outputTail + 1) >= _outputEnd) { _flushBuffer(); } _outputBuffer[_outputTail++] = esc; _outputBuffer[_outputTail++] = ch; }
java
private void _appendCharacterEscape(char esc, char ch) throws IOException, JsonGenerationException { if ((_outputTail + 1) >= _outputEnd) { _flushBuffer(); } _outputBuffer[_outputTail++] = esc; _outputBuffer[_outputTail++] = ch; }
[ "private", "void", "_appendCharacterEscape", "(", "char", "esc", ",", "char", "ch", ")", "throws", "IOException", ",", "JsonGenerationException", "{", "if", "(", "(", "_outputTail", "+", "1", ")", ">=", "_outputEnd", ")", "{", "_flushBuffer", "(", ")", ";", ...
Method called to append escape sequence for given character, at the end of standard output buffer; or if not possible, write out directly.
[ "Method", "called", "to", "append", "escape", "sequence", "for", "given", "character", "at", "the", "end", "of", "standard", "output", "buffer", ";", "or", "if", "not", "possible", "write", "out", "directly", "." ]
623bcbcea65081e75e54d27d4e264a1f6840e9ba
https://github.com/bazaarvoice/rison/blob/623bcbcea65081e75e54d27d4e264a1f6840e9ba/src/main/java/com/bazaarvoice/jackson/rison/RisonGenerator.java#L1062-L1070
valid
Append a character escape.
Of course, here is the Java code you requested: ```java private void _appendCharacterEscape(char esc, char ch) throws IOException, JsonGenerationException { if ((_outputTail + 1) >= _outputEnd) { _flushBuffer(); } _outputBuffer[_outputTail++] = esc; _outputBu...
phax/ph-commons
ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingStringWriter.java
NonBlockingStringWriter.write
@Override public void write (@Nonnull final String sStr, final int nOfs, final int nLen) { m_aSB.append (sStr.substring (nOfs, nOfs + nLen)); }
java
@Override public void write (@Nonnull final String sStr, final int nOfs, final int nLen) { m_aSB.append (sStr.substring (nOfs, nOfs + nLen)); }
[ "@", "Override", "public", "void", "write", "(", "@", "Nonnull", "final", "String", "sStr", ",", "final", "int", "nOfs", ",", "final", "int", "nLen", ")", "{", "m_aSB", ".", "append", "(", "sStr", ".", "substring", "(", "nOfs", ",", "nOfs", "+", "nLe...
Write a portion of a string. @param sStr String to be written @param nOfs Offset from which to start writing characters @param nLen Number of characters to write
[ "Write", "a", "portion", "of", "a", "string", "." ]
d28c03565f44a0b804d96028d0969f9bb38c4313
https://github.com/phax/ph-commons/blob/d28c03565f44a0b804d96028d0969f9bb38c4313/ph-commons/src/main/java/com/helger/commons/io/stream/NonBlockingStringWriter.java#L116-L120
train
Write the content of the IDE phrase.
Of course, here is the Java code you requested: ```java @Override public void write (@Nonnull final String sStr, final int nOfs, final int nLen) { m_aSB.append (sStr.substring (nOfs, nOfs + nLen)); } ``` Hope this helps!
pressgang-ccms/PressGangCCMSContentSpecProcessor
src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java
ContentSpecProcessor.processTopicSourceUrls
protected boolean processTopicSourceUrls(final TopicSourceURLProvider topicSourceURLProvider, final SpecTopic specTopic, final TopicWrapper topic) { LOG.debug("Processing topic source urls"); boolean changed = false; // Save the new Source Urls final List<String> urls = spec...
java
protected boolean processTopicSourceUrls(final TopicSourceURLProvider topicSourceURLProvider, final SpecTopic specTopic, final TopicWrapper topic) { LOG.debug("Processing topic source urls"); boolean changed = false; // Save the new Source Urls final List<String> urls = spec...
[ "protected", "boolean", "processTopicSourceUrls", "(", "final", "TopicSourceURLProvider", "topicSourceURLProvider", ",", "final", "SpecTopic", "specTopic", ",", "final", "TopicWrapper", "topic", ")", "{", "LOG", ".", "debug", "(", "\"Processing topic source urls\"", ")", ...
Processes a Spec Topic and adds any new Source Urls to the topic it represents. @param topicSourceURLProvider @param specTopic The spec topic object that contains the urls to add. @param topic The topic entity to be updated. @return True if anything in the topic entity was changed, otherw...
[ "Processes", "a", "Spec", "Topic", "and", "adds", "any", "new", "Source", "Urls", "to", "the", "topic", "it", "represents", "." ]
85ffac047c4ede0f972364ab1f03f7d61a4de5f1
https://github.com/pressgang-ccms/PressGangCCMSContentSpecProcessor/blob/85ffac047c4ede0f972364ab1f03f7d61a4de5f1/src/main/java/org/jboss/pressgang/ccms/contentspec/processor/ContentSpecProcessor.java#L960-L985
train
Process the topic source urls.
Of course, here is the Java code you requested: ```java protected boolean processTopicSourceUrls(final TopicSourceURLProvider topicSourceURLProvider, final SpecTopic specTopic, final TopicWrapper topic) { LOG.debug("Processing topic source urls"); boolean changed = false; // Save t...
michel-kraemer/citeproc-java
citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/ShellCommand.java
ShellCommand.augmentCommand
private String[] augmentCommand(String[] args, Class<? extends Command> cmd, boolean acceptsInputFile) { OptionGroup<ID> options; try { if (acceptsInputFile) { options = OptionIntrospector.introspect(cmd, InputFileCommand.class); } else { options = OptionIntrospector.introspect(cmd); } } catch...
java
private String[] augmentCommand(String[] args, Class<? extends Command> cmd, boolean acceptsInputFile) { OptionGroup<ID> options; try { if (acceptsInputFile) { options = OptionIntrospector.introspect(cmd, InputFileCommand.class); } else { options = OptionIntrospector.introspect(cmd); } } catch...
[ "private", "String", "[", "]", "augmentCommand", "(", "String", "[", "]", "args", ",", "Class", "<", "?", "extends", "Command", ">", "cmd", ",", "boolean", "acceptsInputFile", ")", "{", "OptionGroup", "<", "ID", ">", "options", ";", "try", "{", "if", "...
Augments the given command line with context variables @param args the current command line @param cmd the last parsed command in the command line @param acceptsInputFile true if the given command accepts an input file @return the new command line
[ "Augments", "the", "given", "command", "line", "with", "context", "variables" ]
1d5bf0e7bbb2bdc47309530babf0ecaba838bf10
https://github.com/michel-kraemer/citeproc-java/blob/1d5bf0e7bbb2bdc47309530babf0ecaba838bf10/citeproc-java-tool/src/main/java/de/undercouch/citeproc/tool/ShellCommand.java#L205-L238
train
Augment command with command options.
Of course, here is the Java code you requested: ```java private String[] augmentCommand(String[] args, Class<? extends Command> cmd, boolean acceptsInputFile) { OptionGroup<ID> options; try { if (acceptsInputFile) { options = OptionIntrospector.introspect(cmd, InputFileCommand.class); } else { opt...
ModeShape/modeshape
modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java
CheckArg.isNotEmpty
public static void isNotEmpty( Iterator<?> argument, String name ) { isNotNull(argument, name); if (!argument.hasNext()) { throw new IllegalArgumentException(CommonI18n.argumentMayNotBeEmpty.text(name)); } }
java
public static void isNotEmpty( Iterator<?> argument, String name ) { isNotNull(argument, name); if (!argument.hasNext()) { throw new IllegalArgumentException(CommonI18n.argumentMayNotBeEmpty.text(name)); } }
[ "public", "static", "void", "isNotEmpty", "(", "Iterator", "<", "?", ">", "argument", ",", "String", "name", ")", "{", "isNotNull", "(", "argument", ",", "name", ")", ";", "if", "(", "!", "argument", ".", "hasNext", "(", ")", ")", "{", "throw", "new"...
Checks that the iterator is not empty, and throws an exception if it is. @param argument the iterator to check @param name The name of the argument @throws IllegalArgumentException If iterator is empty (i.e., iterator.hasNext() returns false)
[ "Checks", "that", "the", "iterator", "is", "not", "empty", "and", "throws", "an", "exception", "if", "it", "is", "." ]
794cfdabb67a90f24629c4fff0424a6125f8f95b
https://github.com/ModeShape/modeshape/blob/794cfdabb67a90f24629c4fff0424a6125f8f95b/modeshape-common/src/main/java/org/modeshape/common/util/CheckArg.java#L569-L575
train
Check if the iterator is not empty
Of course, here is the Java code you requested: ```java public static void isNotEmpty( Iterator<?> argument, String name ) { isNotNull(argument, name); if (!argument.hasNext()) { throw new IllegalArgumentException(CommonI18n.argumentMayNotBeEmpty.text(name...